diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..4a96cb856e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,224 @@ +/** @type {import('eslint').Linter.Config} */ +module.exports = { + root: true, + plugins: ['jsdoc', 'regexp'], + extends: 'eslint:recommended', + rules: { + 'no-use-before-define': ['error', { 'functions': false, 'classes': false }], + + // stylistic rules + 'brace-style': ['warn', '1tbs', { allowSingleLine: true }], + 'curly': ['warn', 'all'], + 'eol-last': 'warn', + 'no-multiple-empty-lines': ['warn', { max: 2, maxBOF: 0, maxEOF: 0 }], + 'no-tabs': ['warn', { allowIndentationTabs: true }], + 'no-var': 'error', + 'one-var': ['warn', 'never'], + 'quotes': ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }], + 'semi': 'warn', + 'wrap-iife': 'warn', + + // spaces and indentation + 'arrow-spacing': 'warn', + 'block-spacing': 'warn', + 'comma-spacing': 'warn', + 'computed-property-spacing': 'warn', + 'func-call-spacing': 'warn', + 'generator-star-spacing': 'warn', + 'indent': ['warn', 'tab', { SwitchCase: 1 }], + 'key-spacing': 'warn', + 'keyword-spacing': 'warn', + 'no-multi-spaces': ['warn', { ignoreEOLComments: true }], + 'no-trailing-spaces': 'warn', + 'no-whitespace-before-property': 'warn', + 'object-curly-spacing': ['warn', 'always'], + 'rest-spread-spacing': 'warn', + 'semi-spacing': 'warn', + 'space-before-blocks': 'warn', + 'space-before-function-paren': ['warn', { named: 'never' }], + 'space-in-parens': 'warn', + 'space-infix-ops': ['warn', { int32Hint: true }], + 'space-unary-ops': 'warn', + 'switch-colon-spacing': 'warn', + 'template-curly-spacing': 'warn', + 'yield-star-spacing': 'warn', + + // JSDoc + 'jsdoc/check-alignment': 'warn', + 'jsdoc/check-syntax': 'warn', + 'jsdoc/check-param-names': 'warn', + 'jsdoc/require-hyphen-before-param-description': ['warn', 'never'], + 'jsdoc/check-tag-names': 'warn', + 'jsdoc/check-types': 'warn', + 'jsdoc/empty-tags': 'warn', + 'jsdoc/newline-after-description': 'warn', + 'jsdoc/require-param-name': 'warn', + 'jsdoc/require-property-name': 'warn', + + // regexp + 'regexp/no-dupe-disjunctions': 'error', + 'regexp/no-empty-alternative': 'error', + 'regexp/no-empty-capturing-group': 'error', + 'regexp/no-empty-lookarounds-assertion': 'error', + 'regexp/no-lazy-ends': 'error', + 'regexp/no-obscure-range': 'error', + 'regexp/no-optional-assertion': 'error', + 'regexp/no-standalone-backslash': 'error', + 'regexp/no-super-linear-backtracking': 'error', + 'regexp/no-unused-capturing-group': 'error', + 'regexp/no-zero-quantifier': 'error', + 'regexp/optimal-lookaround-quantifier': 'error', + + 'regexp/match-any': 'warn', + 'regexp/negation': 'warn', + 'regexp/no-dupe-characters-character-class': 'warn', + 'regexp/no-trivially-nested-assertion': 'warn', + 'regexp/no-trivially-nested-quantifier': 'warn', + 'regexp/no-useless-character-class': 'warn', + 'regexp/no-useless-flag': 'warn', + 'regexp/no-useless-lazy': 'warn', + 'regexp/no-useless-range': 'warn', + 'regexp/prefer-d': ['warn', { insideCharacterClass: 'ignore' }], + 'regexp/prefer-plus-quantifier': 'warn', + 'regexp/prefer-question-quantifier': 'warn', + 'regexp/prefer-star-quantifier': 'warn', + 'regexp/prefer-w': 'warn', + 'regexp/sort-alternatives': 'warn', + 'regexp/sort-flags': 'warn', + 'regexp/strict': 'warn', + + // I turned this rule off because we use `hasOwnProperty` in a lot of places + // TODO: Think about re-enabling this rule + 'no-prototype-builtins': 'off', + // TODO: Think about re-enabling this rule + 'no-inner-declarations': 'off', + // TODO: Think about re-enabling this rule + 'no-sparse-arrays': 'off', + + // turning off some regex rules + // these are supposed to protect against accidental use but we need those quite often + 'no-control-regex': 'off', + 'no-empty-character-class': 'off', + 'no-useless-escape': 'off' + }, + settings: { + jsdoc: { mode: 'typescript' }, + regexp: { + // allow alphanumeric and cyrillic ranges + allowedCharacterRanges: ['alphanumeric', 'а-я', 'А-Я'] + } + }, + ignorePatterns: [ + '*.min.js', + 'vendor/', + 'docs/', + 'components.js', + 'prism.js', + 'node_modules' + ], + + overrides: [ + { + // Languages and plugins + files: [ + 'components/*.js', + 'plugins/*/prism-*.js' + ], + excludedFiles: 'components/index.js', + env: { + browser: true, + node: true, + worker: true + }, + globals: { + 'Prism': true, + // Allow Set and Map. They are partially supported by IE11 + 'Set': true, + 'Map': true + }, + rules: { + 'no-var': 'off' + } + }, + { + // `loadLanguages` function for Node.js + files: 'components/index.js', + env: { + es6: true, + node: true + }, + parserOptions: { + ecmaVersion: 6 + }, + globals: { + 'Prism': true + } + }, + { + // Gulp and Danger + files: 'dependencies.js', + env: { + browser: true, + node: true + }, + rules: { + 'no-var': 'off' + } + }, + { + // The scripts that run on our website + files: 'assets/*.js', + env: { + browser: true + }, + globals: { + 'components': true, + 'getLoader': true, + 'PrefixFree': true, + 'Prism': true, + 'Promise': true, + 'saveAs': true, + '$': true, + '$$': true, + '$u': true + }, + rules: { + 'no-var': 'off' + } + }, + { + // Test files + files: 'tests/**', + env: { + es6: true, + mocha: true, + node: true + }, + parserOptions: { + ecmaVersion: 2018 + } + }, + { + // Gulp, Danger, and benchmark + files: [ + 'gulpfile.js/**', + 'dangerfile.js', + 'benchmark/**', + ], + env: { + es6: true, + node: true + }, + parserOptions: { + ecmaVersion: 2018 + } + }, + { + // This file + files: '.eslintrc.js', + env: { + node: true + } + }, + ] +}; diff --git a/.gitattributes b/.gitattributes index 1d598bdc92..176a458f94 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1 @@ * text=auto - -# Test files should not have their line endings modified by git -/tests/languages/**/*.test binary \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..5987d5973a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Questions and Help + url: https://github.com/PrismJS/prism/discussions/categories/q-a + about: This issue tracker is not for support questions. Please refer to the Prism's Discussion tab. diff --git a/.github/ISSUE_TEMPLATE/highlighting-bug-report.md b/.github/ISSUE_TEMPLATE/highlighting-bug-report.md index 7ca00dc6b3..1e8c5e6fde 100644 --- a/.github/ISSUE_TEMPLATE/highlighting-bug-report.md +++ b/.github/ISSUE_TEMPLATE/highlighting-bug-report.md @@ -13,8 +13,9 @@ assignees: '' - Plugins: [a list of plugins you are using or 'none'] **Description** @@ -22,6 +23,11 @@ A clear and concise description of what is being highlighted incorrectly and how **Code snippet** + +[Test page]() +
The code being highlighted incorrectly. diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 0000000000..eda9686de4 --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,24 @@ +name: Danger + +on: + pull_request_target: + +jobs: + run: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 0 + # create a new branch called pr from the remote PR branch + - run: git remote add pr_repo $PR_URL && git fetch pr_repo $PR_REF && git branch pr pr_repo/$PR_REF + env: + PR_URL: ${{github.event.pull_request.head.repo.clone_url}} + PR_REF: ${{github.event.pull_request.head.ref}} + - run: npm ci + - name: Danger + run: npx danger ci + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..f8f4941b8b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,72 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + tests: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 16.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test + + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 16.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build + - run: | + git add --all && \ + git diff-index --cached HEAD --stat --exit-code || \ + (echo && echo "The above files changed because the build is not up to date." && echo "Please rebuild Prism." && exit 1) + + lint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - run: npm ci + - run: npm run lint:ci + + coverage: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - run: npm ci + - run: npm run regex-coverage diff --git a/.gitignore b/.gitignore index 3b16b7d30c..f3e4015150 100755 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ hide-*.js node_modules .idea/ .DS_Store +.eslintcache + +benchmark/remotes/ +benchmark/downloads/ diff --git a/.npmignore b/.npmignore index c2c324b302..aa4fd97e43 100644 --- a/.npmignore +++ b/.npmignore @@ -5,15 +5,21 @@ hide-*.js .DS_Store CNAME .github/ +benchmark/ assets/ docs/ examples/ tests/ *.tgz *.html +*.svg bower.json composer.json +dangerfile.js gulpfile.js .editorconfig .gitattributes .travis.yml +.eslintrc.js +.eslintcache +.jsdoc.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1023859023..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: node_js -node_js: -- '10' -- '12' -- 'node' -# Build all branches -branches: - only: - - gh-pages - - /.*/ -before_install: -- npm i -g npm@latest -install: -- npm ci -before_script: -# Rebuild Prism -- npx gulp -# Detect changes -# First, we stage all changes and then detect if there is anything staged -- git add --all && git diff-index --cached HEAD --stat --exit-code || - (echo && echo "The above files changed because the build is not up to date." && echo "Please rebuild Prism." && exit 1) -script: npm test -deploy: - provider: npm - email: lea@verou.me - api_key: - secure: TjRcXEr7Y/9KRJ4EOEQbd2Ij8hxKj8c/yOpEROy2lTYv6QH9x46nFDgZEE3VHfp/nnBUYpC47dRaSxiUj8H5rtkMNCZrREZu1n1zahmzP6dI6kCj+H3GiY7yw/Jhdx3uvQZHwknW2TJ/YRsLeQsmMSG2HnJobY9Zn4REX5ccP2E= - on: - tags: true - repo: PrismJS/prism diff --git a/CHANGELOG.md b/CHANGELOG.md index db84cf20fa..6329ab4686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,755 @@ # Prism Changelog + +## 1.27.0 (2022-02-17) + +### New components + +* __UO Razor Script__ (#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) +* __EditorConfig__ + * Change alias of `section` from `keyword` to `selector` (#3305) [`e46501b9`](https://github.com/PrismJS/prism/commit/e46501b9) +* __Ini__ + * Swap out `header` for `section` (#3304) [`deb3a97f`](https://github.com/PrismJS/prism/commit/deb3a97f) +* __MongoDB__ + * Added v5 support (#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) +* __Scala__ + * Added support for interpolated strings (#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) + +### 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) + +### Other + +* __Core__ + * Added better error message for missing grammars (#3311) [`2cc4660b`](https://github.com/PrismJS/prism/commit/2cc4660b) + +## 1.26.0 (2022-01-06) + +### New components + +* __Atmel AVR Assembly__ ([#2078](https://github.com/PrismJS/prism/issues/2078)) [`b5a70e4c`](https://github.com/PrismJS/prism/commit/b5a70e4c) +* __Go module__ ([#3209](https://github.com/PrismJS/prism/issues/3209)) [`8476a9ab`](https://github.com/PrismJS/prism/commit/8476a9ab) +* __Keepalived Configure__ ([#2417](https://github.com/PrismJS/prism/issues/2417)) [`d908e457`](https://github.com/PrismJS/prism/commit/d908e457) +* __Tremor__ & __Trickle__ & __Troy__ ([#3087](https://github.com/PrismJS/prism/issues/3087)) [`ec25ba65`](https://github.com/PrismJS/prism/commit/ec25ba65) +* __Web IDL__ ([#3107](https://github.com/PrismJS/prism/issues/3107)) [`ef53f021`](https://github.com/PrismJS/prism/commit/ef53f021) + +### Updated components + +* Use `\d` for `[0-9]` ([#3097](https://github.com/PrismJS/prism/issues/3097)) [`9fe2f93e`](https://github.com/PrismJS/prism/commit/9fe2f93e) +* __6502 Assembly__ + * Use standard tokens and minor improvements ([#3184](https://github.com/PrismJS/prism/issues/3184)) [`929c33e0`](https://github.com/PrismJS/prism/commit/929c33e0) +* __AppleScript__ + * Use `class-name` standard token ([#3182](https://github.com/PrismJS/prism/issues/3182)) [`9f5e511d`](https://github.com/PrismJS/prism/commit/9f5e511d) +* __AQL__ + * Differentiate between strings and identifiers ([#3183](https://github.com/PrismJS/prism/issues/3183)) [`fa540ab7`](https://github.com/PrismJS/prism/commit/fa540ab7) +* __Arduino__ + * Added `ino` alias ([#2990](https://github.com/PrismJS/prism/issues/2990)) [`5b7ce5e4`](https://github.com/PrismJS/prism/commit/5b7ce5e4) +* __Avro IDL__ + * Removed char syntax ([#3185](https://github.com/PrismJS/prism/issues/3185)) [`c7809285`](https://github.com/PrismJS/prism/commit/c7809285) +* __Bash__ + * Added `node` to known commands ([#3291](https://github.com/PrismJS/prism/issues/3291)) [`4b19b502`](https://github.com/PrismJS/prism/commit/4b19b502) + * Added `vcpkg` command ([#3282](https://github.com/PrismJS/prism/issues/3282)) [`b351bc69`](https://github.com/PrismJS/prism/commit/b351bc69) + * Added `docker` and `podman` commands ([#3237](https://github.com/PrismJS/prism/issues/3237)) [`8c5ed251`](https://github.com/PrismJS/prism/commit/8c5ed251) +* __Birb__ + * Fixed class name false positives ([#3111](https://github.com/PrismJS/prism/issues/3111)) [`d7017beb`](https://github.com/PrismJS/prism/commit/d7017beb) +* __Bro__ + * Removed `variable` and minor improvements ([#3186](https://github.com/PrismJS/prism/issues/3186)) [`4cebf34c`](https://github.com/PrismJS/prism/commit/4cebf34c) +* __BSL (1C:Enterprise)__ + * Made `directive` greedy ([#3112](https://github.com/PrismJS/prism/issues/3112)) [`5c412cbb`](https://github.com/PrismJS/prism/commit/5c412cbb) +* __C__ + * Added `char` token ([#3207](https://github.com/PrismJS/prism/issues/3207)) [`d85a64ae`](https://github.com/PrismJS/prism/commit/d85a64ae) +* __C#__ + * Added `char` token ([#3270](https://github.com/PrismJS/prism/issues/3270)) [`220bc40f`](https://github.com/PrismJS/prism/commit/220bc40f) + * Move everything into the IIFE ([#3077](https://github.com/PrismJS/prism/issues/3077)) [`9ed4cf6e`](https://github.com/PrismJS/prism/commit/9ed4cf6e) +* __Clojure__ + * Added `char` token ([#3188](https://github.com/PrismJS/prism/issues/3188)) [`1c88c7da`](https://github.com/PrismJS/prism/commit/1c88c7da) +* __Concurnas__ + * Improved tokenization ([#3189](https://github.com/PrismJS/prism/issues/3189)) [`7b34e65d`](https://github.com/PrismJS/prism/commit/7b34e65d) +* __Content-Security-Policy__ + * Improved tokenization ([#3276](https://github.com/PrismJS/prism/issues/3276)) [`a943f2bb`](https://github.com/PrismJS/prism/commit/a943f2bb) +* __Coq__ + * Improved attribute pattern performance ([#3085](https://github.com/PrismJS/prism/issues/3085)) [`2f9672aa`](https://github.com/PrismJS/prism/commit/2f9672aa) +* __Crystal__ + * Improved tokenization ([#3194](https://github.com/PrismJS/prism/issues/3194)) [`51e3ecc0`](https://github.com/PrismJS/prism/commit/51e3ecc0) +* __Cypher__ + * Removed non-standard use of `symbol` token name ([#3195](https://github.com/PrismJS/prism/issues/3195)) [`6af8a644`](https://github.com/PrismJS/prism/commit/6af8a644) +* __D__ + * Added standard char token ([#3196](https://github.com/PrismJS/prism/issues/3196)) [`dafdbdec`](https://github.com/PrismJS/prism/commit/dafdbdec) +* __Dart__ + * Added string interpolation and improved metadata ([#3197](https://github.com/PrismJS/prism/issues/3197)) [`e1370357`](https://github.com/PrismJS/prism/commit/e1370357) +* __DataWeave__ + * Fixed keywords being highlighted as functions ([#3113](https://github.com/PrismJS/prism/issues/3113)) [`532212b2`](https://github.com/PrismJS/prism/commit/532212b2) +* __EditorConfig__ + * Swap out `property` for `key`; alias with `attr-name` ([#3272](https://github.com/PrismJS/prism/issues/3272)) [`bee6ad56`](https://github.com/PrismJS/prism/commit/bee6ad56) +* __Eiffel__ + * Removed non-standard use of `builtin` name ([#3198](https://github.com/PrismJS/prism/issues/3198)) [`6add768b`](https://github.com/PrismJS/prism/commit/6add768b) +* __Elm__ + * Recognize unicode escapes as valid Char ([#3105](https://github.com/PrismJS/prism/issues/3105)) [`736c581d`](https://github.com/PrismJS/prism/commit/736c581d) +* __ERB__ + * Better embedding of Ruby ([#3192](https://github.com/PrismJS/prism/issues/3192)) [`336edeea`](https://github.com/PrismJS/prism/commit/336edeea) +* __F#__ + * Added `char` token ([#3271](https://github.com/PrismJS/prism/issues/3271)) [`b58cd722`](https://github.com/PrismJS/prism/commit/b58cd722) +* __G-code__ + * Use standard-conforming alias for checksum ([#3205](https://github.com/PrismJS/prism/issues/3205)) [`ee7ab563`](https://github.com/PrismJS/prism/commit/ee7ab563) +* __GameMaker Language__ + * Fixed `operator` token and added tests ([#3114](https://github.com/PrismJS/prism/issues/3114)) [`d359eeae`](https://github.com/PrismJS/prism/commit/d359eeae) +* __Go__ + * Added `char` token and improved `string` and `number` tokens ([#3208](https://github.com/PrismJS/prism/issues/3208)) [`f11b86e2`](https://github.com/PrismJS/prism/commit/f11b86e2) +* __GraphQL__ + * Optimized regexes ([#3136](https://github.com/PrismJS/prism/issues/3136)) [`8494519e`](https://github.com/PrismJS/prism/commit/8494519e) +* __Haml__ + * Use `symbol` alias for filter names ([#3210](https://github.com/PrismJS/prism/issues/3210)) [`3d410670`](https://github.com/PrismJS/prism/commit/3d410670) + * Improved filter and interpolation tokenization ([#3191](https://github.com/PrismJS/prism/issues/3191)) [`005ba469`](https://github.com/PrismJS/prism/commit/005ba469) +* __Haxe__ + * Improved tokenization ([#3211](https://github.com/PrismJS/prism/issues/3211)) [`f41bcf23`](https://github.com/PrismJS/prism/commit/f41bcf23) +* __Hoon__ + * Simplified the language definition a little ([#3212](https://github.com/PrismJS/prism/issues/3212)) [`81920b62`](https://github.com/PrismJS/prism/commit/81920b62) +* __HTTP__ + * Added support for special header value tokenization ([#3275](https://github.com/PrismJS/prism/issues/3275)) [`3362fc79`](https://github.com/PrismJS/prism/commit/3362fc79) + * Relax pattern for body ([#3169](https://github.com/PrismJS/prism/issues/3169)) [`22d0c6ba`](https://github.com/PrismJS/prism/commit/22d0c6ba) +* __HTTP Public-Key-Pins__ + * Improved tokenization ([#3278](https://github.com/PrismJS/prism/issues/3278)) [`0f1b5810`](https://github.com/PrismJS/prism/commit/0f1b5810) +* __HTTP Strict-Transport-Security__ + * Improved tokenization ([#3277](https://github.com/PrismJS/prism/issues/3277)) [`3d708b97`](https://github.com/PrismJS/prism/commit/3d708b97) +* __Idris__ + * Fixed import statements ([#3115](https://github.com/PrismJS/prism/issues/3115)) [`15cb3b78`](https://github.com/PrismJS/prism/commit/15cb3b78) +* __Io__ + * Simplified comment token ([#3214](https://github.com/PrismJS/prism/issues/3214)) [`c2afa59b`](https://github.com/PrismJS/prism/commit/c2afa59b) +* __J__ + * Made comments greedy ([#3215](https://github.com/PrismJS/prism/issues/3215)) [`5af16014`](https://github.com/PrismJS/prism/commit/5af16014) +* __Java__ + * Added `char` token ([#3217](https://github.com/PrismJS/prism/issues/3217)) [`0a9f909c`](https://github.com/PrismJS/prism/commit/0a9f909c) +* __Java stack trace__ + * Removed unreachable parts of regexes ([#3219](https://github.com/PrismJS/prism/issues/3219)) [`fa55492b`](https://github.com/PrismJS/prism/commit/fa55492b) + * Added missing lookbehinds ([#3116](https://github.com/PrismJS/prism/issues/3116)) [`cfb2e782`](https://github.com/PrismJS/prism/commit/cfb2e782) +* __JavaScript__ + * Improved `number` pattern ([#3149](https://github.com/PrismJS/prism/issues/3149)) [`5a24cbff`](https://github.com/PrismJS/prism/commit/5a24cbff) + * Added properties ([#3099](https://github.com/PrismJS/prism/issues/3099)) [`3b2238fa`](https://github.com/PrismJS/prism/commit/3b2238fa) +* __Jolie__ + * Improved tokenization ([#3221](https://github.com/PrismJS/prism/issues/3221)) [`dfbb2020`](https://github.com/PrismJS/prism/commit/dfbb2020) +* __JQ__ + * Improved performance of strings ([#3084](https://github.com/PrismJS/prism/issues/3084)) [`233415b8`](https://github.com/PrismJS/prism/commit/233415b8) +* __JS stack trace__ + * Added missing boundary assertion ([#3117](https://github.com/PrismJS/prism/issues/3117)) [`23d9aec1`](https://github.com/PrismJS/prism/commit/23d9aec1) +* __Julia__ + * Added `char` token ([#3223](https://github.com/PrismJS/prism/issues/3223)) [`3a876df0`](https://github.com/PrismJS/prism/commit/3a876df0) +* __Keyman__ + * Improved tokenization ([#3224](https://github.com/PrismJS/prism/issues/3224)) [`baa95cab`](https://github.com/PrismJS/prism/commit/baa95cab) +* __Kotlin__ + * Added `char` token and improved string interpolation ([#3225](https://github.com/PrismJS/prism/issues/3225)) [`563cd73e`](https://github.com/PrismJS/prism/commit/563cd73e) +* __Latte__ + * Use standard token names and combined delimiter tokens ([#3226](https://github.com/PrismJS/prism/issues/3226)) [`6b168a3b`](https://github.com/PrismJS/prism/commit/6b168a3b) +* __Liquid__ + * Removed unmatchable object variants ([#3135](https://github.com/PrismJS/prism/issues/3135)) [`05e7ab04`](https://github.com/PrismJS/prism/commit/05e7ab04) +* __Lisp__ + * Improved `defun` ([#3130](https://github.com/PrismJS/prism/issues/3130)) [`e8f84a6c`](https://github.com/PrismJS/prism/commit/e8f84a6c) +* __Makefile__ + * Use standard token names correctly ([#3227](https://github.com/PrismJS/prism/issues/3227)) [`21a3c2d7`](https://github.com/PrismJS/prism/commit/21a3c2d7) +* __Markdown__ + * Fixed typo in token name ([#3101](https://github.com/PrismJS/prism/issues/3101)) [`00f77a2c`](https://github.com/PrismJS/prism/commit/00f77a2c) +* __MAXScript__ + * Various improvements ([#3181](https://github.com/PrismJS/prism/issues/3181)) [`e9b856c8`](https://github.com/PrismJS/prism/commit/e9b856c8) + * Fixed booleans not being highlighted ([#3134](https://github.com/PrismJS/prism/issues/3134)) [`c6574e6b`](https://github.com/PrismJS/prism/commit/c6574e6b) +* __Monkey__ + * Use standard tokens correctly ([#3228](https://github.com/PrismJS/prism/issues/3228)) [`c1025aa6`](https://github.com/PrismJS/prism/commit/c1025aa6) +* __N1QL__ + * Updated keywords + minor improvements ([#3229](https://github.com/PrismJS/prism/issues/3229)) [`642d93ec`](https://github.com/PrismJS/prism/commit/642d93ec) +* __nginx__ + * Made some patterns greedy ([#3230](https://github.com/PrismJS/prism/issues/3230)) [`7b72e0ad`](https://github.com/PrismJS/prism/commit/7b72e0ad) +* __Nim__ + * Added `char` token and made some tokens greedy ([#3231](https://github.com/PrismJS/prism/issues/3231)) [`2334b4b6`](https://github.com/PrismJS/prism/commit/2334b4b6) + * Fixed backtick identifier ([#3118](https://github.com/PrismJS/prism/issues/3118)) [`75331bea`](https://github.com/PrismJS/prism/commit/75331bea) +* __Nix__ + * Use standard token name correctly ([#3232](https://github.com/PrismJS/prism/issues/3232)) [`5bf6e35f`](https://github.com/PrismJS/prism/commit/5bf6e35f) + * Removed unmatchable token ([#3119](https://github.com/PrismJS/prism/issues/3119)) [`dc1e808f`](https://github.com/PrismJS/prism/commit/dc1e808f) +* __NSIS__ + * Made `comment` greedy ([#3234](https://github.com/PrismJS/prism/issues/3234)) [`969f152a`](https://github.com/PrismJS/prism/commit/969f152a) + * Update regex pattern for variables ([#3266](https://github.com/PrismJS/prism/issues/3266)) [`adcc8784`](https://github.com/PrismJS/prism/commit/adcc8784) + * Update regex for constants pattern ([#3267](https://github.com/PrismJS/prism/issues/3267)) [`55583fb2`](https://github.com/PrismJS/prism/commit/55583fb2) +* __Objective-C__ + * Improved `string` token ([#3235](https://github.com/PrismJS/prism/issues/3235)) [`8e0e95f3`](https://github.com/PrismJS/prism/commit/8e0e95f3) +* __OCaml__ + * Improved tokenization ([#3269](https://github.com/PrismJS/prism/issues/3269)) [`7bcc5da0`](https://github.com/PrismJS/prism/commit/7bcc5da0) + * Removed unmatchable punctuation variant ([#3120](https://github.com/PrismJS/prism/issues/3120)) [`314d6994`](https://github.com/PrismJS/prism/commit/314d6994) +* __Oz__ + * Improved tokenization ([#3240](https://github.com/PrismJS/prism/issues/3240)) [`a3905c04`](https://github.com/PrismJS/prism/commit/a3905c04) +* __Pascal__ + * Added support for asm and directives ([#2653](https://github.com/PrismJS/prism/issues/2653)) [`f053af13`](https://github.com/PrismJS/prism/commit/f053af13) +* __PATROL Scripting Language__ + * Added `boolean` token ([#3248](https://github.com/PrismJS/prism/issues/3248)) [`a5b6c5eb`](https://github.com/PrismJS/prism/commit/a5b6c5eb) +* __Perl__ + * Improved tokenization ([#3241](https://github.com/PrismJS/prism/issues/3241)) [`f22ea9f9`](https://github.com/PrismJS/prism/commit/f22ea9f9) +* __PHP__ + * Removed useless keyword tokens ([#3121](https://github.com/PrismJS/prism/issues/3121)) [`ee62a080`](https://github.com/PrismJS/prism/commit/ee62a080) +* __PHP Extras__ + * Improved `scope` and `this` ([#3243](https://github.com/PrismJS/prism/issues/3243)) [`59ef51db`](https://github.com/PrismJS/prism/commit/59ef51db) +* __PL/SQL__ + * Updated keywords + other improvements ([#3109](https://github.com/PrismJS/prism/issues/3109)) [`e7ba877b`](https://github.com/PrismJS/prism/commit/e7ba877b) +* __PowerQuery__ + * Improved tokenization and use standard tokens correctly ([#3244](https://github.com/PrismJS/prism/issues/3244)) [`5688f487`](https://github.com/PrismJS/prism/commit/5688f487) + * Removed useless `data-type` alternative ([#3122](https://github.com/PrismJS/prism/issues/3122)) [`eeb13996`](https://github.com/PrismJS/prism/commit/eeb13996) +* __PowerShell__ + * Fixed lookbehind + refactoring ([#3245](https://github.com/PrismJS/prism/issues/3245)) [`d30a2da6`](https://github.com/PrismJS/prism/commit/d30a2da6) +* __Processing__ + * Use standard tokens correctly ([#3246](https://github.com/PrismJS/prism/issues/3246)) [`5ee8c557`](https://github.com/PrismJS/prism/commit/5ee8c557) +* __Prolog__ + * Removed variable token + minor improvements ([#3247](https://github.com/PrismJS/prism/issues/3247)) [`bacf9ae3`](https://github.com/PrismJS/prism/commit/bacf9ae3) +* __Pug__ + * Improved filter tokenization ([#3258](https://github.com/PrismJS/prism/issues/3258)) [`0390e644`](https://github.com/PrismJS/prism/commit/0390e644) +* __PureBasic__ + * Fixed token order inside `asm` token ([#3123](https://github.com/PrismJS/prism/issues/3123)) [`f3b25786`](https://github.com/PrismJS/prism/commit/f3b25786) +* __Python__ + * Made `comment` greedy ([#3249](https://github.com/PrismJS/prism/issues/3249)) [`8ecef306`](https://github.com/PrismJS/prism/commit/8ecef306) + * Add `match` and `case` (soft) keywords ([#3142](https://github.com/PrismJS/prism/issues/3142)) [`3f24dc72`](https://github.com/PrismJS/prism/commit/3f24dc72) + * Recognize walrus operator ([#3126](https://github.com/PrismJS/prism/issues/3126)) [`18bd101c`](https://github.com/PrismJS/prism/commit/18bd101c) + * Fixed numbers ending with a dot ([#3106](https://github.com/PrismJS/prism/issues/3106)) [`2c63efa6`](https://github.com/PrismJS/prism/commit/2c63efa6) +* __QML__ + * Made `string` greedy ([#3250](https://github.com/PrismJS/prism/issues/3250)) [`1e6dcb51`](https://github.com/PrismJS/prism/commit/1e6dcb51) +* __React JSX__ + * Move alias property ([#3222](https://github.com/PrismJS/prism/issues/3222)) [`18c92048`](https://github.com/PrismJS/prism/commit/18c92048) +* __React TSX__ + * Removed `parameter` token ([#3090](https://github.com/PrismJS/prism/issues/3090)) [`0a313f4f`](https://github.com/PrismJS/prism/commit/0a313f4f) +* __Reason__ + * Use standard tokens correctly ([#3251](https://github.com/PrismJS/prism/issues/3251)) [`809af0d9`](https://github.com/PrismJS/prism/commit/809af0d9) +* __Regex__ + * Fixed char-class/char-set confusion ([#3124](https://github.com/PrismJS/prism/issues/3124)) [`4dde2e20`](https://github.com/PrismJS/prism/commit/4dde2e20) +* __Ren'py__ + * Improved language + added tests ([#3125](https://github.com/PrismJS/prism/issues/3125)) [`ede55b2c`](https://github.com/PrismJS/prism/commit/ede55b2c) +* __Rip__ + * Use standard `char` token ([#3252](https://github.com/PrismJS/prism/issues/3252)) [`2069ab0c`](https://github.com/PrismJS/prism/commit/2069ab0c) +* __Ruby__ + * Improved tokenization ([#3193](https://github.com/PrismJS/prism/issues/3193)) [`86028adb`](https://github.com/PrismJS/prism/commit/86028adb) +* __Rust__ + * Improved `type-definition` and use standard tokens correctly ([#3253](https://github.com/PrismJS/prism/issues/3253)) [`4049e5c6`](https://github.com/PrismJS/prism/commit/4049e5c6) +* __Scheme__ + * Use standard `char` token ([#3254](https://github.com/PrismJS/prism/issues/3254)) [`7d740c45`](https://github.com/PrismJS/prism/commit/7d740c45) + * Updates syntax for reals ([#3159](https://github.com/PrismJS/prism/issues/3159)) [`4eb81fa1`](https://github.com/PrismJS/prism/commit/4eb81fa1) +* __Smalltalk__ + * Use standard `char` token ([#3255](https://github.com/PrismJS/prism/issues/3255)) [`a7bb3001`](https://github.com/PrismJS/prism/commit/a7bb3001) + * Added `boolean` token ([#3100](https://github.com/PrismJS/prism/issues/3100)) [`51382524`](https://github.com/PrismJS/prism/commit/51382524) +* __Smarty__ + * Improved tokenization ([#3268](https://github.com/PrismJS/prism/issues/3268)) [`acc0bc09`](https://github.com/PrismJS/prism/commit/acc0bc09) +* __SQL__ + * Added identifier token ([#3141](https://github.com/PrismJS/prism/issues/3141)) [`4e00cddd`](https://github.com/PrismJS/prism/commit/4e00cddd) +* __Squirrel__ + * Use standard `char` token ([#3256](https://github.com/PrismJS/prism/issues/3256)) [`58a65bfd`](https://github.com/PrismJS/prism/commit/58a65bfd) +* __Stan__ + * Added missing keywords and HOFs ([#3238](https://github.com/PrismJS/prism/issues/3238)) [`afd77ed1`](https://github.com/PrismJS/prism/commit/afd77ed1) +* __Structured Text (IEC 61131-3)__ + * Structured text: Improved tokenization ([#3213](https://github.com/PrismJS/prism/issues/3213)) [`d04d166d`](https://github.com/PrismJS/prism/commit/d04d166d) +* __Swift__ + * Added support for `isolated` keyword ([#3174](https://github.com/PrismJS/prism/issues/3174)) [`18c828a6`](https://github.com/PrismJS/prism/commit/18c828a6) +* __TAP__ + * Conform to quoted-properties style ([#3127](https://github.com/PrismJS/prism/issues/3127)) [`3ef71533`](https://github.com/PrismJS/prism/commit/3ef71533) +* __Tremor__ + * Use standard `regex` token ([#3257](https://github.com/PrismJS/prism/issues/3257)) [`c56e4bf5`](https://github.com/PrismJS/prism/commit/c56e4bf5) +* __Twig__ + * Improved tokenization ([#3259](https://github.com/PrismJS/prism/issues/3259)) [`e03a7c24`](https://github.com/PrismJS/prism/commit/e03a7c24) +* __TypeScript__ + * Removed duplicate keywords ([#3132](https://github.com/PrismJS/prism/issues/3132)) [`91060fd6`](https://github.com/PrismJS/prism/commit/91060fd6) +* __URI__ + * Fixed IPv4 regex ([#3128](https://github.com/PrismJS/prism/issues/3128)) [`599e30ee`](https://github.com/PrismJS/prism/commit/599e30ee) +* __V__ + * Use standard `char` token ([#3260](https://github.com/PrismJS/prism/issues/3260)) [`e4373256`](https://github.com/PrismJS/prism/commit/e4373256) +* __Verilog__ + * Use standard tokens correctly ([#3261](https://github.com/PrismJS/prism/issues/3261)) [`43124129`](https://github.com/PrismJS/prism/commit/43124129) +* __Visual Basic__ + * Simplify regexes and use more common aliases ([#3262](https://github.com/PrismJS/prism/issues/3262)) [`aa73d448`](https://github.com/PrismJS/prism/commit/aa73d448) +* __Wolfram language__ + * Removed unmatchable punctuation variant ([#3133](https://github.com/PrismJS/prism/issues/3133)) [`a28a86ad`](https://github.com/PrismJS/prism/commit/a28a86ad) +* __Xojo (REALbasic)__ + * Proper token name for directives ([#3263](https://github.com/PrismJS/prism/issues/3263)) [`ffd8343f`](https://github.com/PrismJS/prism/commit/ffd8343f) +* __Zig__ + * Added missing keywords ([#3279](https://github.com/PrismJS/prism/issues/3279)) [`deed35e3`](https://github.com/PrismJS/prism/commit/deed35e3) + * Use standard `char` token ([#3264](https://github.com/PrismJS/prism/issues/3264)) [`c3f9fb70`](https://github.com/PrismJS/prism/commit/c3f9fb70) + * Fixed module comments and astral chars ([#3129](https://github.com/PrismJS/prism/issues/3129)) [`09a0e2ba`](https://github.com/PrismJS/prism/commit/09a0e2ba) + +### Updated plugins + +* __File Highlight__ + * File highlight+data range ([#1813](https://github.com/PrismJS/prism/issues/1813)) [`d38592c5`](https://github.com/PrismJS/prism/commit/d38592c5) +* __Keep Markup__ + * Added `drop-tokens` option class ([#3166](https://github.com/PrismJS/prism/issues/3166)) [`b679cfe6`](https://github.com/PrismJS/prism/commit/b679cfe6) +* __Line Highlight__ + * Expose `highlightLines` function as `Prism.plugins.highlightLines` ([#3086](https://github.com/PrismJS/prism/issues/3086)) [`9f4c0e74`](https://github.com/PrismJS/prism/commit/9f4c0e74) +* __Toolbar__ + * Set `z-index` of `.toolbar` to 10 ([#3163](https://github.com/PrismJS/prism/issues/3163)) [`1cac3559`](https://github.com/PrismJS/prism/commit/1cac3559) + +### Updated themes + +* Coy: Set `z-index` to make shadows visible in colored table cells ([#3161](https://github.com/PrismJS/prism/issues/3161)) [`79f250f3`](https://github.com/PrismJS/prism/commit/79f250f3) +* Coy: Added padding to account for box shadow ([#3143](https://github.com/PrismJS/prism/issues/3143)) [`a6a4ce7e`](https://github.com/PrismJS/prism/commit/a6a4ce7e) + +### Other + +* __Core__ + * Added `setLanguage` util function ([#3167](https://github.com/PrismJS/prism/issues/3167)) [`b631949a`](https://github.com/PrismJS/prism/commit/b631949a) + * Fixed type error on null ([#3057](https://github.com/PrismJS/prism/issues/3057)) [`a80a68ba`](https://github.com/PrismJS/prism/commit/a80a68ba) + * Document `disableWorkerMessageHandler` ([#3088](https://github.com/PrismJS/prism/issues/3088)) [`213cf7be`](https://github.com/PrismJS/prism/commit/213cf7be) +* __Infrastructure__ + * Tests: Added `.html.test` files for replace `.js` language tests ([#3148](https://github.com/PrismJS/prism/issues/3148)) [`2e834c8c`](https://github.com/PrismJS/prism/commit/2e834c8c) + * Added regex coverage ([#3138](https://github.com/PrismJS/prism/issues/3138)) [`5333e281`](https://github.com/PrismJS/prism/commit/5333e281) + * Tests: Added `TestCaseFile` class and generalized `runTestCase` ([#3147](https://github.com/PrismJS/prism/issues/3147)) [`ae8888a0`](https://github.com/PrismJS/prism/commit/ae8888a0) + * Added even more language tests ([#3137](https://github.com/PrismJS/prism/issues/3137)) [`344d0b27`](https://github.com/PrismJS/prism/commit/344d0b27) + * Added more plugin tests ([#1969](https://github.com/PrismJS/prism/issues/1969)) [`a394a14d`](https://github.com/PrismJS/prism/commit/a394a14d) + * Added more language tests ([#3131](https://github.com/PrismJS/prism/issues/3131)) [`2f7f7364`](https://github.com/PrismJS/prism/commit/2f7f7364) + * `package.json`: Added `engines.node` field ([#3108](https://github.com/PrismJS/prism/issues/3108)) [`798ee4f6`](https://github.com/PrismJS/prism/commit/798ee4f6) + * Use tabs in `package(-lock).json` ([#3098](https://github.com/PrismJS/prism/issues/3098)) [`8daebb4a`](https://github.com/PrismJS/prism/commit/8daebb4a) + * Update `eslint-plugin-regexp@1.2.0` ([#3091](https://github.com/PrismJS/prism/issues/3091)) [`e6e1d5ae`](https://github.com/PrismJS/prism/commit/e6e1d5ae) + * Added minified CSS ([#3073](https://github.com/PrismJS/prism/issues/3073)) [`d63d6c0e`](https://github.com/PrismJS/prism/commit/d63d6c0e) +* __Website__ + * Readme: Clarify usage of our build system ([#3239](https://github.com/PrismJS/prism/issues/3239)) [`6f1d904a`](https://github.com/PrismJS/prism/commit/6f1d904a) + * Improved CDN usage URLs ([#3285](https://github.com/PrismJS/prism/issues/3285)) [`6c21b2f7`](https://github.com/PrismJS/prism/commit/6c21b2f7) + * Update download.html [`9d5424b6`](https://github.com/PrismJS/prism/commit/9d5424b6) + * Autoloader: Mention how to load grammars from URLs ([#3218](https://github.com/PrismJS/prism/issues/3218)) [`cefccdd1`](https://github.com/PrismJS/prism/commit/cefccdd1) + * Added PrismJS React and HTML tutorial link ([#3190](https://github.com/PrismJS/prism/issues/3190)) [`0ecdbdce`](https://github.com/PrismJS/prism/commit/0ecdbdce) + * Improved readability ([#3177](https://github.com/PrismJS/prism/issues/3177)) [`4433d7fe`](https://github.com/PrismJS/prism/commit/4433d7fe) + * Fixed red highlighting in Firefox ([#3178](https://github.com/PrismJS/prism/issues/3178)) [`746da79b`](https://github.com/PrismJS/prism/commit/746da79b) + * Use Keep markup to highlight code section ([#3164](https://github.com/PrismJS/prism/issues/3164)) [`ebd59e32`](https://github.com/PrismJS/prism/commit/ebd59e32) + * Document standard tokens and provide examples ([#3104](https://github.com/PrismJS/prism/issues/3104)) [`37551200`](https://github.com/PrismJS/prism/commit/37551200) + * Fixed dead link to third-party tutorial [#3155](https://github.com/PrismJS/prism/issues/3155) ([#3156](https://github.com/PrismJS/prism/issues/3156)) [`31b4c1b8`](https://github.com/PrismJS/prism/commit/31b4c1b8) + * Repositioned theme selector ([#3146](https://github.com/PrismJS/prism/issues/3146)) [`ea361e5a`](https://github.com/PrismJS/prism/commit/ea361e5a) + * Adjusted TOC's line height for better readability ([#3145](https://github.com/PrismJS/prism/issues/3145)) [`c5629706`](https://github.com/PrismJS/prism/commit/c5629706) + * Updated plugin header template ([#3144](https://github.com/PrismJS/prism/issues/3144)) [`faedfe85`](https://github.com/PrismJS/prism/commit/faedfe85) + * Update test and example pages to use Autoloader ([#1936](https://github.com/PrismJS/prism/issues/1936)) [`3d96eedc`](https://github.com/PrismJS/prism/commit/3d96eedc) + +## 1.25.0 (2021-09-16) + +### New components + +* __AviSynth__ ([#3071](https://github.com/PrismJS/prism/issues/3071)) [`746a4b1a`](https://github.com/PrismJS/prism/commit/746a4b1a) +* __Avro IDL__ ([#3051](https://github.com/PrismJS/prism/issues/3051)) [`87e5a376`](https://github.com/PrismJS/prism/commit/87e5a376) +* __Bicep__ ([#3027](https://github.com/PrismJS/prism/issues/3027)) [`c1dce998`](https://github.com/PrismJS/prism/commit/c1dce998) +* __GAP (CAS)__ ([#3054](https://github.com/PrismJS/prism/issues/3054)) [`23cd9b65`](https://github.com/PrismJS/prism/commit/23cd9b65) +* __GN__ ([#3062](https://github.com/PrismJS/prism/issues/3062)) [`4f97b82b`](https://github.com/PrismJS/prism/commit/4f97b82b) +* __Hoon__ ([#2978](https://github.com/PrismJS/prism/issues/2978)) [`ea776756`](https://github.com/PrismJS/prism/commit/ea776756) +* __Kusto__ ([#3068](https://github.com/PrismJS/prism/issues/3068)) [`e008ea05`](https://github.com/PrismJS/prism/commit/e008ea05) +* __Magma (CAS)__ ([#3055](https://github.com/PrismJS/prism/issues/3055)) [`a1b67ce3`](https://github.com/PrismJS/prism/commit/a1b67ce3) +* __MAXScript__ ([#3060](https://github.com/PrismJS/prism/issues/3060)) [`4fbdd2f8`](https://github.com/PrismJS/prism/commit/4fbdd2f8) +* __Mermaid__ ([#3050](https://github.com/PrismJS/prism/issues/3050)) [`148c1eca`](https://github.com/PrismJS/prism/commit/148c1eca) +* __Razor C#__ ([#3064](https://github.com/PrismJS/prism/issues/3064)) [`4433ccfc`](https://github.com/PrismJS/prism/commit/4433ccfc) +* __Systemd configuration file__ ([#3053](https://github.com/PrismJS/prism/issues/3053)) [`8df825e0`](https://github.com/PrismJS/prism/commit/8df825e0) +* __Wren__ ([#3063](https://github.com/PrismJS/prism/issues/3063)) [`6a356d25`](https://github.com/PrismJS/prism/commit/6a356d25) + +### Updated components + +* __Bicep__ + * Added support for multiline and interpolated strings and other improvements ([#3028](https://github.com/PrismJS/prism/issues/3028)) [`748bb9ac`](https://github.com/PrismJS/prism/commit/748bb9ac) +* __C#__ + * Added `with` keyword & improved record support ([#2993](https://github.com/PrismJS/prism/issues/2993)) [`fdd291c0`](https://github.com/PrismJS/prism/commit/fdd291c0) + * Added `record`, `init`, and `nullable` keyword ([#2991](https://github.com/PrismJS/prism/issues/2991)) [`9b561565`](https://github.com/PrismJS/prism/commit/9b561565) + * Added context check for `from` keyword ([#2970](https://github.com/PrismJS/prism/issues/2970)) [`158f25d4`](https://github.com/PrismJS/prism/commit/158f25d4) +* __C++__ + * Fixed generic function false positive ([#3043](https://github.com/PrismJS/prism/issues/3043)) [`5de8947f`](https://github.com/PrismJS/prism/commit/5de8947f) +* __Clojure__ + * Improved tokenization ([#3056](https://github.com/PrismJS/prism/issues/3056)) [`8d0b74b5`](https://github.com/PrismJS/prism/commit/8d0b74b5) +* __Hoon__ + * Fixed mixed-case aura tokenization ([#3002](https://github.com/PrismJS/prism/issues/3002)) [`9c8911bd`](https://github.com/PrismJS/prism/commit/9c8911bd) +* __Liquid__ + * Added all objects from Shopify reference ([#2998](https://github.com/PrismJS/prism/issues/2998)) [`693b7433`](https://github.com/PrismJS/prism/commit/693b7433) + * Added `empty` keyword ([#2997](https://github.com/PrismJS/prism/issues/2997)) [`fe3bc526`](https://github.com/PrismJS/prism/commit/fe3bc526) +* __Log file__ + * Added support for Java stack traces ([#3003](https://github.com/PrismJS/prism/issues/3003)) [`b0365e70`](https://github.com/PrismJS/prism/commit/b0365e70) +* __Markup__ + * Made most patterns greedy ([#3065](https://github.com/PrismJS/prism/issues/3065)) [`52e8cee9`](https://github.com/PrismJS/prism/commit/52e8cee9) + * Fixed ReDoS ([#3078](https://github.com/PrismJS/prism/issues/3078)) [`0ff371bb`](https://github.com/PrismJS/prism/commit/0ff371bb) +* __PureScript__ + * Made `∀` a keyword (alias for `forall`) ([#3005](https://github.com/PrismJS/prism/issues/3005)) [`b38fc89a`](https://github.com/PrismJS/prism/commit/b38fc89a) + * Improved Haskell and PureScript ([#3020](https://github.com/PrismJS/prism/issues/3020)) [`679539ec`](https://github.com/PrismJS/prism/commit/679539ec) +* __Python__ + * Support for underscores in numbers ([#3039](https://github.com/PrismJS/prism/issues/3039)) [`6f5d68f7`](https://github.com/PrismJS/prism/commit/6f5d68f7) +* __Sass__ + * Fixed issues with CSS Extras ([#2994](https://github.com/PrismJS/prism/issues/2994)) [`14fdfe32`](https://github.com/PrismJS/prism/commit/14fdfe32) +* __Shell session__ + * Fixed command false positives ([#3048](https://github.com/PrismJS/prism/issues/3048)) [`35b88fcf`](https://github.com/PrismJS/prism/commit/35b88fcf) + * Added support for the percent sign as shell symbol ([#3010](https://github.com/PrismJS/prism/issues/3010)) [`4492b62b`](https://github.com/PrismJS/prism/commit/4492b62b) +* __Swift__ + * Major improvements ([#3022](https://github.com/PrismJS/prism/issues/3022)) [`8541db2e`](https://github.com/PrismJS/prism/commit/8541db2e) + * Added support for `@propertyWrapper`, `@MainActor`, and `@globalActor` ([#3009](https://github.com/PrismJS/prism/issues/3009)) [`ce5e0f01`](https://github.com/PrismJS/prism/commit/ce5e0f01) + * Added support for new Swift 5.5 keywords ([#2988](https://github.com/PrismJS/prism/issues/2988)) [`bb93fac0`](https://github.com/PrismJS/prism/commit/bb93fac0) +* __TypeScript__ + * Fixed keyword false positives ([#3001](https://github.com/PrismJS/prism/issues/3001)) [`212e0ef2`](https://github.com/PrismJS/prism/commit/212e0ef2) + +### Updated plugins + +* __JSONP Highlight__ + * Refactored JSONP logic ([#3018](https://github.com/PrismJS/prism/issues/3018)) [`5126d1e1`](https://github.com/PrismJS/prism/commit/5126d1e1) +* __Line Highlight__ + * Extend highlight to full line width inside scroll container ([#3011](https://github.com/PrismJS/prism/issues/3011)) [`e289ec60`](https://github.com/PrismJS/prism/commit/e289ec60) +* __Normalize Whitespace__ + * Removed unnecessary checks ([#3017](https://github.com/PrismJS/prism/issues/3017)) [`63edf14c`](https://github.com/PrismJS/prism/commit/63edf14c) +* __Previewers__ + * Ensure popup is visible across themes ([#3080](https://github.com/PrismJS/prism/issues/3080)) [`c7b6a7f6`](https://github.com/PrismJS/prism/commit/c7b6a7f6) + +### Updated themes + +* __Twilight__ + * Increase selector specificities of plugin overrides ([#3081](https://github.com/PrismJS/prism/issues/3081)) [`ffb20439`](https://github.com/PrismJS/prism/commit/ffb20439) + +### Other + +* __Infrastructure__ + * Added benchmark suite ([#2153](https://github.com/PrismJS/prism/issues/2153)) [`44456b21`](https://github.com/PrismJS/prism/commit/44456b21) + * Tests: Insert expected JSON by Default ([#2960](https://github.com/PrismJS/prism/issues/2960)) [`e997dd35`](https://github.com/PrismJS/prism/commit/e997dd35) + * Tests: Improved dection of empty patterns ([#3058](https://github.com/PrismJS/prism/issues/3058)) [`d216e602`](https://github.com/PrismJS/prism/commit/d216e602) +* __Website__ + * Highlight Keywords: More documentation ([#3049](https://github.com/PrismJS/prism/issues/3049)) [`247fd9a3`](https://github.com/PrismJS/prism/commit/247fd9a3) + + +## 1.24.1 (2021-07-03) + +### Updated components + +* __Markdown__ + * Fixed Markdown not working in NodeJS ([#2977](https://github.com/PrismJS/prism/issues/2977)) [`151121cd`](https://github.com/PrismJS/prism/commit/151121cd) + +### Updated plugins + +* __Toolbar__ + * Fixed styles being applies to nested elements ([#2980](https://github.com/PrismJS/prism/issues/2980)) [`748ecddc`](https://github.com/PrismJS/prism/commit/748ecddc) + + +## 1.24.0 (2021-06-27) + +### New components + +* __CFScript__ ([#2771](https://github.com/PrismJS/prism/issues/2771)) [`b0a6ec85`](https://github.com/PrismJS/prism/commit/b0a6ec85) +* __ChaiScript__ ([#2706](https://github.com/PrismJS/prism/issues/2706)) [`3f7d7453`](https://github.com/PrismJS/prism/commit/3f7d7453) +* __COBOL__ ([#2800](https://github.com/PrismJS/prism/issues/2800)) [`7e5f78ff`](https://github.com/PrismJS/prism/commit/7e5f78ff) +* __Coq__ ([#2803](https://github.com/PrismJS/prism/issues/2803)) [`41e25d3c`](https://github.com/PrismJS/prism/commit/41e25d3c) +* __CSV__ ([#2794](https://github.com/PrismJS/prism/issues/2794)) [`f9b69528`](https://github.com/PrismJS/prism/commit/f9b69528) +* __DOT (Graphviz)__ ([#2690](https://github.com/PrismJS/prism/issues/2690)) [`1f91868e`](https://github.com/PrismJS/prism/commit/1f91868e) +* __False__ ([#2802](https://github.com/PrismJS/prism/issues/2802)) [`99a21dc5`](https://github.com/PrismJS/prism/commit/99a21dc5) +* __ICU Message Format__ ([#2745](https://github.com/PrismJS/prism/issues/2745)) [`bf4e7ba9`](https://github.com/PrismJS/prism/commit/bf4e7ba9) +* __Idris__ ([#2755](https://github.com/PrismJS/prism/issues/2755)) [`e9314415`](https://github.com/PrismJS/prism/commit/e9314415) +* __Jexl__ ([#2764](https://github.com/PrismJS/prism/issues/2764)) [`7e51b99c`](https://github.com/PrismJS/prism/commit/7e51b99c) +* __KuMir (КуМир)__ ([#2760](https://github.com/PrismJS/prism/issues/2760)) [`3419fb77`](https://github.com/PrismJS/prism/commit/3419fb77) +* __Log file__ ([#2796](https://github.com/PrismJS/prism/issues/2796)) [`2bc6475b`](https://github.com/PrismJS/prism/commit/2bc6475b) +* __Nevod__ ([#2798](https://github.com/PrismJS/prism/issues/2798)) [`f84c49c5`](https://github.com/PrismJS/prism/commit/f84c49c5) +* __OpenQasm__ ([#2797](https://github.com/PrismJS/prism/issues/2797)) [`1a2347a3`](https://github.com/PrismJS/prism/commit/1a2347a3) +* __PATROL Scripting Language__ ([#2739](https://github.com/PrismJS/prism/issues/2739)) [`18c67b49`](https://github.com/PrismJS/prism/commit/18c67b49) +* __Q#__ ([#2804](https://github.com/PrismJS/prism/issues/2804)) [`1b63cd01`](https://github.com/PrismJS/prism/commit/1b63cd01) +* __Rego__ ([#2624](https://github.com/PrismJS/prism/issues/2624)) [`e38986f9`](https://github.com/PrismJS/prism/commit/e38986f9) +* __Squirrel__ ([#2721](https://github.com/PrismJS/prism/issues/2721)) [`fd1081d2`](https://github.com/PrismJS/prism/commit/fd1081d2) +* __URI__ ([#2708](https://github.com/PrismJS/prism/issues/2708)) [`bbc77d19`](https://github.com/PrismJS/prism/commit/bbc77d19) +* __V__ ([#2687](https://github.com/PrismJS/prism/issues/2687)) [`72962701`](https://github.com/PrismJS/prism/commit/72962701) +* __Wolfram language__ & __Mathematica__ & __Mathematica Notebook__ ([#2921](https://github.com/PrismJS/prism/issues/2921)) [`c4f6b2cc`](https://github.com/PrismJS/prism/commit/c4f6b2cc) + +### Updated components + +* Fixed problems reported by `regexp/no-dupe-disjunctions` ([#2952](https://github.com/PrismJS/prism/issues/2952)) [`f471d2d7`](https://github.com/PrismJS/prism/commit/f471d2d7) +* Fixed some cases of quadratic worst-case runtime ([#2922](https://github.com/PrismJS/prism/issues/2922)) [`79d22182`](https://github.com/PrismJS/prism/commit/79d22182) +* Fixed 2 cases of exponential backtracking ([#2774](https://github.com/PrismJS/prism/issues/2774)) [`d85e30da`](https://github.com/PrismJS/prism/commit/d85e30da) +* __AQL__ + * Update for ArangoDB 3.8 ([#2842](https://github.com/PrismJS/prism/issues/2842)) [`ea82478d`](https://github.com/PrismJS/prism/commit/ea82478d) +* __AutoHotkey__ + * Improved tag pattern ([#2920](https://github.com/PrismJS/prism/issues/2920)) [`fc2a3334`](https://github.com/PrismJS/prism/commit/fc2a3334) +* __Bash__ + * Accept hyphens in function names ([#2832](https://github.com/PrismJS/prism/issues/2832)) [`e4ad22ad`](https://github.com/PrismJS/prism/commit/e4ad22ad) + * Fixed single-quoted strings ([#2792](https://github.com/PrismJS/prism/issues/2792)) [`e5cfdb4a`](https://github.com/PrismJS/prism/commit/e5cfdb4a) +* __C++__ + * Added support for generic functions and made `::` punctuation ([#2814](https://github.com/PrismJS/prism/issues/2814)) [`3df62fd0`](https://github.com/PrismJS/prism/commit/3df62fd0) + * Added missing keywords and modules ([#2763](https://github.com/PrismJS/prism/issues/2763)) [`88fa72cf`](https://github.com/PrismJS/prism/commit/88fa72cf) +* __Dart__ + * Improved support for classes & generics ([#2810](https://github.com/PrismJS/prism/issues/2810)) [`d0bcd074`](https://github.com/PrismJS/prism/commit/d0bcd074) +* __Docker__ + * Improvements ([#2720](https://github.com/PrismJS/prism/issues/2720)) [`93dd83c2`](https://github.com/PrismJS/prism/commit/93dd83c2) +* __Elixir__ + * Added missing keywords ([#2958](https://github.com/PrismJS/prism/issues/2958)) [`114e4626`](https://github.com/PrismJS/prism/commit/114e4626) + * Added missing keyword and other improvements ([#2773](https://github.com/PrismJS/prism/issues/2773)) [`e6c0d298`](https://github.com/PrismJS/prism/commit/e6c0d298) + * Added `defdelagate` keyword and highlighting for function/module names ([#2709](https://github.com/PrismJS/prism/issues/2709)) [`59f725d7`](https://github.com/PrismJS/prism/commit/59f725d7) +* __F#__ + * Fixed comment false positive ([#2703](https://github.com/PrismJS/prism/issues/2703)) [`a5d7178c`](https://github.com/PrismJS/prism/commit/a5d7178c) +* __GraphQL__ + * Fixed `definition-query` and `definition-mutation` tokens ([#2964](https://github.com/PrismJS/prism/issues/2964)) [`bfd7fded`](https://github.com/PrismJS/prism/commit/bfd7fded) + * Added more detailed tokens ([#2939](https://github.com/PrismJS/prism/issues/2939)) [`34f24ac9`](https://github.com/PrismJS/prism/commit/34f24ac9) +* __Handlebars__ + * Added `hbs` alias ([#2874](https://github.com/PrismJS/prism/issues/2874)) [`43976351`](https://github.com/PrismJS/prism/commit/43976351) +* __HTTP__ + * Fixed body not being highlighted ([#2734](https://github.com/PrismJS/prism/issues/2734)) [`1dfc8271`](https://github.com/PrismJS/prism/commit/1dfc8271) + * More granular tokenization ([#2722](https://github.com/PrismJS/prism/issues/2722)) [`6183fd9b`](https://github.com/PrismJS/prism/commit/6183fd9b) + * Allow root path in request line ([#2711](https://github.com/PrismJS/prism/issues/2711)) [`4e7b2a82`](https://github.com/PrismJS/prism/commit/4e7b2a82) +* __Ini__ + * Consistently mimic Win32 INI parsing ([#2779](https://github.com/PrismJS/prism/issues/2779)) [`42d24fa2`](https://github.com/PrismJS/prism/commit/42d24fa2) +* __Java__ + * Improved generics ([#2812](https://github.com/PrismJS/prism/issues/2812)) [`4ec7535c`](https://github.com/PrismJS/prism/commit/4ec7535c) +* __JavaScript__ + * Added support for import assertions ([#2953](https://github.com/PrismJS/prism/issues/2953)) [`ab7c9953`](https://github.com/PrismJS/prism/commit/ab7c9953) + * Added support for RegExp Match Indices ([#2900](https://github.com/PrismJS/prism/issues/2900)) [`415651a0`](https://github.com/PrismJS/prism/commit/415651a0) + * Added hashbang and private getters/setters ([#2815](https://github.com/PrismJS/prism/issues/2815)) [`9c610ae6`](https://github.com/PrismJS/prism/commit/9c610ae6) + * Improved contextual keywords ([#2713](https://github.com/PrismJS/prism/issues/2713)) [`022f90a0`](https://github.com/PrismJS/prism/commit/022f90a0) +* __JS Templates__ + * Added SQL templates ([#2945](https://github.com/PrismJS/prism/issues/2945)) [`abab9104`](https://github.com/PrismJS/prism/commit/abab9104) +* __JSON__ + * Fixed backtracking issue in Safari ([#2691](https://github.com/PrismJS/prism/issues/2691)) [`cf28d1b2`](https://github.com/PrismJS/prism/commit/cf28d1b2) +* __Liquid__ + * Added Markup support, missing tokens, and other improvements ([#2950](https://github.com/PrismJS/prism/issues/2950)) [`ac1d12f9`](https://github.com/PrismJS/prism/commit/ac1d12f9) +* __Log file__ + * Minor improvements ([#2851](https://github.com/PrismJS/prism/issues/2851)) [`45ec4a88`](https://github.com/PrismJS/prism/commit/45ec4a88) +* __Markdown__ + * Improved code snippets ([#2967](https://github.com/PrismJS/prism/issues/2967)) [`e9477d83`](https://github.com/PrismJS/prism/commit/e9477d83) + * Workaround for incorrect highlighting due to double `wrap` hook ([#2719](https://github.com/PrismJS/prism/issues/2719)) [`2b355c98`](https://github.com/PrismJS/prism/commit/2b355c98) +* __Markup__ + * Added support for DOM event attributes ([#2702](https://github.com/PrismJS/prism/issues/2702)) [`8dbbbb35`](https://github.com/PrismJS/prism/commit/8dbbbb35) +* __nginx__ + * Complete rewrite ([#2793](https://github.com/PrismJS/prism/issues/2793)) [`5943f4cb`](https://github.com/PrismJS/prism/commit/5943f4cb) +* __PHP__ + * Fixed functions with namespaces ([#2889](https://github.com/PrismJS/prism/issues/2889)) [`87d79390`](https://github.com/PrismJS/prism/commit/87d79390) + * Fixed string interpolation ([#2864](https://github.com/PrismJS/prism/issues/2864)) [`cf3755cb`](https://github.com/PrismJS/prism/commit/cf3755cb) + * Added missing PHP 7.4 `fn` keyword ([#2858](https://github.com/PrismJS/prism/issues/2858)) [`e0ee93f1`](https://github.com/PrismJS/prism/commit/e0ee93f1) + * Fixed methods with keyword names + minor improvements ([#2818](https://github.com/PrismJS/prism/issues/2818)) [`7e8cd40d`](https://github.com/PrismJS/prism/commit/7e8cd40d) + * Improved constant support for PHP 8.1 enums ([#2770](https://github.com/PrismJS/prism/issues/2770)) [`8019e2f6`](https://github.com/PrismJS/prism/commit/8019e2f6) + * Added support for PHP 8.1 enums ([#2752](https://github.com/PrismJS/prism/issues/2752)) [`f79b0eef`](https://github.com/PrismJS/prism/commit/f79b0eef) + * Class names at the start of a string are now highlighted correctly ([#2731](https://github.com/PrismJS/prism/issues/2731)) [`04ef309c`](https://github.com/PrismJS/prism/commit/04ef309c) + * Numeral syntax improvements ([#2701](https://github.com/PrismJS/prism/issues/2701)) [`01af04ed`](https://github.com/PrismJS/prism/commit/01af04ed) +* __React JSX__ + * Added support for general spread expressions ([#2754](https://github.com/PrismJS/prism/issues/2754)) [`9f59f52d`](https://github.com/PrismJS/prism/commit/9f59f52d) + * Added support for comments inside tags ([#2728](https://github.com/PrismJS/prism/issues/2728)) [`30b0444f`](https://github.com/PrismJS/prism/commit/30b0444f) +* __reST (reStructuredText)__ + * Fixed `inline` pattern ([#2946](https://github.com/PrismJS/prism/issues/2946)) [`a7656de6`](https://github.com/PrismJS/prism/commit/a7656de6) +* __Ruby__ + * Added heredoc literals ([#2885](https://github.com/PrismJS/prism/issues/2885)) [`20b77bff`](https://github.com/PrismJS/prism/commit/20b77bff) + * Added missing regex flags ([#2845](https://github.com/PrismJS/prism/issues/2845)) [`3786f396`](https://github.com/PrismJS/prism/commit/3786f396) + * Added missing regex interpolation ([#2841](https://github.com/PrismJS/prism/issues/2841)) [`f08c2f7f`](https://github.com/PrismJS/prism/commit/f08c2f7f) +* __Scheme__ + * Added support for high Unicode characters ([#2693](https://github.com/PrismJS/prism/issues/2693)) [`0e61a7e1`](https://github.com/PrismJS/prism/commit/0e61a7e1) + * Added bracket support ([#2813](https://github.com/PrismJS/prism/issues/2813)) [`1c6c0bf3`](https://github.com/PrismJS/prism/commit/1c6c0bf3) +* __Shell session__ + * Fixed multi-line commands ([#2872](https://github.com/PrismJS/prism/issues/2872)) [`cda976b1`](https://github.com/PrismJS/prism/commit/cda976b1) + * Commands prefixed with a path are now detected ([#2686](https://github.com/PrismJS/prism/issues/2686)) [`c83fd0b8`](https://github.com/PrismJS/prism/commit/c83fd0b8) +* __SQL__ + * Added `ILIKE` operator ([#2704](https://github.com/PrismJS/prism/issues/2704)) [`6e34771f`](https://github.com/PrismJS/prism/commit/6e34771f) +* __Swift__ + * Added `some` keyword ([#2756](https://github.com/PrismJS/prism/issues/2756)) [`cf354ef5`](https://github.com/PrismJS/prism/commit/cf354ef5) +* __TypeScript__ + * Updated keywords ([#2861](https://github.com/PrismJS/prism/issues/2861)) [`fe98d536`](https://github.com/PrismJS/prism/commit/fe98d536) + * Added support for decorators ([#2820](https://github.com/PrismJS/prism/issues/2820)) [`31cc2142`](https://github.com/PrismJS/prism/commit/31cc2142) +* __VB.Net__ + * Improved strings, comments, and punctuation ([#2782](https://github.com/PrismJS/prism/issues/2782)) [`a68f1fb6`](https://github.com/PrismJS/prism/commit/a68f1fb6) +* __Xojo (REALbasic)__ + * `REM` is no longer highlighted as a keyword in comments ([#2823](https://github.com/PrismJS/prism/issues/2823)) [`ebbbfd47`](https://github.com/PrismJS/prism/commit/ebbbfd47) + * Added last missing Keyword "Selector" ([#2807](https://github.com/PrismJS/prism/issues/2807)) [`e32e043b`](https://github.com/PrismJS/prism/commit/e32e043b) + * Added missing keywords ([#2805](https://github.com/PrismJS/prism/issues/2805)) [`459365ec`](https://github.com/PrismJS/prism/commit/459365ec) + +### Updated plugins + +* Made Match Braces and Custom Class compatible ([#2947](https://github.com/PrismJS/prism/issues/2947)) [`4b55bd6a`](https://github.com/PrismJS/prism/commit/4b55bd6a) +* Consistent Prism check ([#2788](https://github.com/PrismJS/prism/issues/2788)) [`96335642`](https://github.com/PrismJS/prism/commit/96335642) +* __Command Line__ + * Don't modify empty code blocks ([#2896](https://github.com/PrismJS/prism/issues/2896)) [`c81c3319`](https://github.com/PrismJS/prism/commit/c81c3319) +* __Copy to Clipboard__ + * Removed ClipboardJS dependency ([#2784](https://github.com/PrismJS/prism/issues/2784)) [`d5e14e1a`](https://github.com/PrismJS/prism/commit/d5e14e1a) + * Fixed `clipboard.writeText` not working inside iFrames ([#2826](https://github.com/PrismJS/prism/issues/2826)) [`01b7b6f7`](https://github.com/PrismJS/prism/commit/01b7b6f7) + * Added support for custom styles ([#2789](https://github.com/PrismJS/prism/issues/2789)) [`4d7f75b0`](https://github.com/PrismJS/prism/commit/4d7f75b0) + * Make copy-to-clipboard configurable with multiple attributes ([#2723](https://github.com/PrismJS/prism/issues/2723)) [`2cb909e1`](https://github.com/PrismJS/prism/commit/2cb909e1) +* __File Highlight__ + * Fixed Prism check ([#2827](https://github.com/PrismJS/prism/issues/2827)) [`53d34b22`](https://github.com/PrismJS/prism/commit/53d34b22) +* __Line Highlight__ + * Fixed linkable line numbers not being initialized ([#2732](https://github.com/PrismJS/prism/issues/2732)) [`ccc73ab7`](https://github.com/PrismJS/prism/commit/ccc73ab7) +* __Previewers__ + * Use `classList` instead of `className` ([#2787](https://github.com/PrismJS/prism/issues/2787)) [`d298d46e`](https://github.com/PrismJS/prism/commit/d298d46e) + +### Other + +* __Core__ + * Add `tabindex` to code blocks to enable keyboard navigation ([#2799](https://github.com/PrismJS/prism/issues/2799)) [`dbf70515`](https://github.com/PrismJS/prism/commit/dbf70515) + * Fixed greedy rematching reach bug ([#2705](https://github.com/PrismJS/prism/issues/2705)) [`b37987d3`](https://github.com/PrismJS/prism/commit/b37987d3) + * Added support for plaintext ([#2738](https://github.com/PrismJS/prism/issues/2738)) [`970674cf`](https://github.com/PrismJS/prism/commit/970674cf) +* __Infrastructure__ + * Added ESLint + * Added `npm-run-all` to clean up test command ([#2938](https://github.com/PrismJS/prism/issues/2938)) [`5d3d8088`](https://github.com/PrismJS/prism/commit/5d3d8088) + * Added link to Q&A to issue templates ([#2834](https://github.com/PrismJS/prism/issues/2834)) [`7cd9e794`](https://github.com/PrismJS/prism/commit/7cd9e794) + * CI: Run tests with NodeJS 16.x ([#2888](https://github.com/PrismJS/prism/issues/2888)) [`b77317c5`](https://github.com/PrismJS/prism/commit/b77317c5) + * Dangerfile: Trim merge base ([#2761](https://github.com/PrismJS/prism/issues/2761)) [`45b0e82a`](https://github.com/PrismJS/prism/commit/45b0e82a) + * Dangerfile: Fixed how changed files are determined ([#2757](https://github.com/PrismJS/prism/issues/2757)) [`0feb266f`](https://github.com/PrismJS/prism/commit/0feb266f) + * Deps: Updated regex tooling ([#2923](https://github.com/PrismJS/prism/issues/2923)) [`ad9878ad`](https://github.com/PrismJS/prism/commit/ad9878ad) + * Tests: Added `--language` for patterns tests ([#2929](https://github.com/PrismJS/prism/issues/2929)) [`a62ef796`](https://github.com/PrismJS/prism/commit/a62ef796) + * Tests: Fixed polynomial backtracking test ([#2891](https://github.com/PrismJS/prism/issues/2891)) [`8dbf1217`](https://github.com/PrismJS/prism/commit/8dbf1217) + * Tests: Fixed languages test discovery [`a9a199b6`](https://github.com/PrismJS/prism/commit/a9a199b6) + * Tests: Test discovery should ignore unsupported file extensions ([#2886](https://github.com/PrismJS/prism/issues/2886)) [`4492c5ce`](https://github.com/PrismJS/prism/commit/4492c5ce) + * Tests: Exhaustive pattern tests ([#2688](https://github.com/PrismJS/prism/issues/2688)) [`53151404`](https://github.com/PrismJS/prism/commit/53151404) + * Tests: Fixed pretty print incorrectly calculating print width ([#2821](https://github.com/PrismJS/prism/issues/2821)) [`5bc405e7`](https://github.com/PrismJS/prism/commit/5bc405e7) + * Tests: Automatically normalize line ends ([#2934](https://github.com/PrismJS/prism/issues/2934)) [`99f3ddcd`](https://github.com/PrismJS/prism/commit/99f3ddcd) + * Tests: Added `--insert` and `--update` parameters to language test ([#2809](https://github.com/PrismJS/prism/issues/2809)) [`4c8b855d`](https://github.com/PrismJS/prism/commit/4c8b855d) + * Tests: Stricter `components.json` tests ([#2758](https://github.com/PrismJS/prism/issues/2758)) [`933af805`](https://github.com/PrismJS/prism/commit/933af805) +* __Website__ + * Copy to clipboard: Fixed highlighting ([#2725](https://github.com/PrismJS/prism/issues/2725)) [`7a790bf9`](https://github.com/PrismJS/prism/commit/7a790bf9) + * Readme: Mention `npm ci` ([#2899](https://github.com/PrismJS/prism/issues/2899)) [`91f3aaed`](https://github.com/PrismJS/prism/commit/91f3aaed) + * Readme: Added Node and npm version requirements ([#2790](https://github.com/PrismJS/prism/issues/2790)) [`cb220168`](https://github.com/PrismJS/prism/commit/cb220168) + * Readme: Update link to Chinese translation ([#2749](https://github.com/PrismJS/prism/issues/2749)) [`266cc700`](https://github.com/PrismJS/prism/commit/266cc700) + * Replace `my.cdn` in code sample with Handlebars-like placeholder ([#2906](https://github.com/PrismJS/prism/issues/2906)) [`80471181`](https://github.com/PrismJS/prism/commit/80471181) + * Set dummy domain for CDN ([#2905](https://github.com/PrismJS/prism/issues/2905)) [`38f1d289`](https://github.com/PrismJS/prism/commit/38f1d289) + * Added MySQL to "Used by" section ([#2785](https://github.com/PrismJS/prism/issues/2785)) [`9b784ebf`](https://github.com/PrismJS/prism/commit/9b784ebf) + * Improved basic usage section ([#2777](https://github.com/PrismJS/prism/issues/2777)) [`a1209930`](https://github.com/PrismJS/prism/commit/a1209930) + * Updated URL in Autolinker example ([#2751](https://github.com/PrismJS/prism/issues/2751)) [`ec9767d6`](https://github.com/PrismJS/prism/commit/ec9767d6) + * Added React native tutorial ([#2683](https://github.com/PrismJS/prism/issues/2683)) [`1506f345`](https://github.com/PrismJS/prism/commit/1506f345) + + +## 1.23.0 (2020-12-31) + +### New components + +* __Apex__ ([#2622](https://github.com/PrismJS/prism/issues/2622)) [`f0e2b70e`](https://github.com/PrismJS/prism/commit/f0e2b70e) +* __DataWeave__ ([#2659](https://github.com/PrismJS/prism/issues/2659)) [`0803525b`](https://github.com/PrismJS/prism/commit/0803525b) +* __PromQL__ ([#2628](https://github.com/PrismJS/prism/issues/2628)) [`8831c706`](https://github.com/PrismJS/prism/commit/8831c706) + +### Updated components + +* Fixed multiple vulnerable regexes ([#2584](https://github.com/PrismJS/prism/issues/2584)) [`c2f6a644`](https://github.com/PrismJS/prism/commit/c2f6a644) +* __Apache Configuration__ + * Update directive-flag to match `=` ([#2612](https://github.com/PrismJS/prism/issues/2612)) [`00bf00e3`](https://github.com/PrismJS/prism/commit/00bf00e3) +* __C-like__ + * Made all comments greedy ([#2680](https://github.com/PrismJS/prism/issues/2680)) [`0a3932fe`](https://github.com/PrismJS/prism/commit/0a3932fe) +* __C__ + * Better class name and macro name detection ([#2585](https://github.com/PrismJS/prism/issues/2585)) [`129faf5c`](https://github.com/PrismJS/prism/commit/129faf5c) +* __Content-Security-Policy__ + * Added missing directives and keywords ([#2664](https://github.com/PrismJS/prism/issues/2664)) [`f1541342`](https://github.com/PrismJS/prism/commit/f1541342) + * Do not highlight directive names with adjacent hyphens ([#2662](https://github.com/PrismJS/prism/issues/2662)) [`a7ccc16d`](https://github.com/PrismJS/prism/commit/a7ccc16d) +* __CSS__ + * Better HTML `style` attribute tokenization ([#2569](https://github.com/PrismJS/prism/issues/2569)) [`b04cbafe`](https://github.com/PrismJS/prism/commit/b04cbafe) +* __Java__ + * Improved package and class name detection ([#2599](https://github.com/PrismJS/prism/issues/2599)) [`0889bc7c`](https://github.com/PrismJS/prism/commit/0889bc7c) + * Added Java 15 keywords ([#2567](https://github.com/PrismJS/prism/issues/2567)) [`73f81c89`](https://github.com/PrismJS/prism/commit/73f81c89) +* __Java stack trace__ + * Added support stack frame element class loaders and modules ([#2658](https://github.com/PrismJS/prism/issues/2658)) [`0bb4f096`](https://github.com/PrismJS/prism/commit/0bb4f096) +* __Julia__ + * Removed constants that are not exported by default ([#2601](https://github.com/PrismJS/prism/issues/2601)) [`093c8175`](https://github.com/PrismJS/prism/commit/093c8175) +* __Kotlin__ + * Added support for backticks in function names ([#2489](https://github.com/PrismJS/prism/issues/2489)) [`a5107d5c`](https://github.com/PrismJS/prism/commit/a5107d5c) +* __Latte__ + * Fixed exponential backtracking ([#2682](https://github.com/PrismJS/prism/issues/2682)) [`89f1e182`](https://github.com/PrismJS/prism/commit/89f1e182) +* __Markdown__ + * Improved URL tokenization ([#2678](https://github.com/PrismJS/prism/issues/2678)) [`2af3e2c2`](https://github.com/PrismJS/prism/commit/2af3e2c2) + * Added support for YAML front matter ([#2634](https://github.com/PrismJS/prism/issues/2634)) [`5cf9cfbc`](https://github.com/PrismJS/prism/commit/5cf9cfbc) +* __PHP__ + * Added support for PHP 7.4 + other major improvements ([#2566](https://github.com/PrismJS/prism/issues/2566)) [`38808e64`](https://github.com/PrismJS/prism/commit/38808e64) + * Added support for PHP 8.0 features ([#2591](https://github.com/PrismJS/prism/issues/2591)) [`df922d90`](https://github.com/PrismJS/prism/commit/df922d90) + * Removed C-like dependency ([#2619](https://github.com/PrismJS/prism/issues/2619)) [`89ebb0b7`](https://github.com/PrismJS/prism/commit/89ebb0b7) + * Fixed exponential backtracking ([#2684](https://github.com/PrismJS/prism/issues/2684)) [`37b9c9a1`](https://github.com/PrismJS/prism/commit/37b9c9a1) +* __Sass (Scss)__ + * Added support for Sass modules ([#2643](https://github.com/PrismJS/prism/issues/2643)) [`deb238a6`](https://github.com/PrismJS/prism/commit/deb238a6) +* __Scheme__ + * Fixed number pattern ([#2648](https://github.com/PrismJS/prism/issues/2648)) [`e01ecd00`](https://github.com/PrismJS/prism/commit/e01ecd00) + * Fixed function and function-like false positives ([#2611](https://github.com/PrismJS/prism/issues/2611)) [`7951ca24`](https://github.com/PrismJS/prism/commit/7951ca24) +* __Shell session__ + * Fixed false positives because of links in command output ([#2649](https://github.com/PrismJS/prism/issues/2649)) [`8e76a978`](https://github.com/PrismJS/prism/commit/8e76a978) +* __TSX__ + * Temporary fix for the collisions of JSX tags and TS generics ([#2596](https://github.com/PrismJS/prism/issues/2596)) [`25bdb494`](https://github.com/PrismJS/prism/commit/25bdb494) + +### Updated plugins + +* Made Autoloader and Diff Highlight compatible ([#2580](https://github.com/PrismJS/prism/issues/2580)) [`7a74497a`](https://github.com/PrismJS/prism/commit/7a74497a) +* __Copy to Clipboard Button__ + * Set `type="button"` attribute for copy to clipboard plugin ([#2593](https://github.com/PrismJS/prism/issues/2593)) [`f59a85f1`](https://github.com/PrismJS/prism/commit/f59a85f1) +* __File Highlight__ + * Fixed IE compatibility problem ([#2656](https://github.com/PrismJS/prism/issues/2656)) [`3f4ae00d`](https://github.com/PrismJS/prism/commit/3f4ae00d) +* __Line Highlight__ + * Fixed top offset in combination with Line numbers ([#2237](https://github.com/PrismJS/prism/issues/2237)) [`b40f8f4b`](https://github.com/PrismJS/prism/commit/b40f8f4b) + * Fixed print background color ([#2668](https://github.com/PrismJS/prism/issues/2668)) [`cdb24abe`](https://github.com/PrismJS/prism/commit/cdb24abe) +* __Line Numbers__ + * Fixed null reference ([#2605](https://github.com/PrismJS/prism/issues/2605)) [`7cdfe556`](https://github.com/PrismJS/prism/commit/7cdfe556) +* __Treeview__ + * Fixed icons on dark themes ([#2631](https://github.com/PrismJS/prism/issues/2631)) [`7266e32f`](https://github.com/PrismJS/prism/commit/7266e32f) +* __Unescaped Markup__ + * Refactoring ([#2445](https://github.com/PrismJS/prism/issues/2445)) [`fc602822`](https://github.com/PrismJS/prism/commit/fc602822) + +### Other + +* Readme: Added alternative link for Chinese translation [`071232b4`](https://github.com/PrismJS/prism/commit/071232b4) +* Readme: Removed broken icon for Chinese translation ([#2670](https://github.com/PrismJS/prism/issues/2670)) [`2ea202b9`](https://github.com/PrismJS/prism/commit/2ea202b9) +* Readme: Grammar adjustments ([#2629](https://github.com/PrismJS/prism/issues/2629)) [`f217ab75`](https://github.com/PrismJS/prism/commit/f217ab75) +* __Core__ + * Moved pattern matching + lookbehind logic into function ([#2633](https://github.com/PrismJS/prism/issues/2633)) [`24574406`](https://github.com/PrismJS/prism/commit/24574406) + * Fixed bug with greedy matching ([#2632](https://github.com/PrismJS/prism/issues/2632)) [`8fa8dd24`](https://github.com/PrismJS/prism/commit/8fa8dd24) +* __Infrastructure__ + * Migrate from TravisCI -> GitHub Actions ([#2606](https://github.com/PrismJS/prism/issues/2606)) [`69132045`](https://github.com/PrismJS/prism/commit/69132045) + * Added Dangerfile and provide bundle size info ([#2608](https://github.com/PrismJS/prism/issues/2608)) [`9df20c5e`](https://github.com/PrismJS/prism/commit/9df20c5e) + * New `start` script to start local server ([#2491](https://github.com/PrismJS/prism/issues/2491)) [`0604793c`](https://github.com/PrismJS/prism/commit/0604793c) + * Added test for exponential backtracking ([#2590](https://github.com/PrismJS/prism/issues/2590)) [`05afbb10`](https://github.com/PrismJS/prism/commit/05afbb10) + * Added test for polynomial backtracking ([#2597](https://github.com/PrismJS/prism/issues/2597)) [`e644178b`](https://github.com/PrismJS/prism/commit/e644178b) + * Tests: Better pretty print ([#2600](https://github.com/PrismJS/prism/issues/2600)) [`8bfcc819`](https://github.com/PrismJS/prism/commit/8bfcc819) + * Tests: Fixed sorted language list test ([#2623](https://github.com/PrismJS/prism/issues/2623)) [`2d3a1267`](https://github.com/PrismJS/prism/commit/2d3a1267) + * Tests: Stricter pattern for nice-token-names test ([#2588](https://github.com/PrismJS/prism/issues/2588)) [`0df60be1`](https://github.com/PrismJS/prism/commit/0df60be1) + * Tests: Added strict checks for `Prism.languages.extend` ([#2572](https://github.com/PrismJS/prism/issues/2572)) [`8828500e`](https://github.com/PrismJS/prism/commit/8828500e) +* __Website__ + * Test page: Added "Share" option ([#2575](https://github.com/PrismJS/prism/issues/2575)) [`b5f4f10e`](https://github.com/PrismJS/prism/commit/b5f4f10e) + * Test page: Don't trigger ad-blockers with class ([#2677](https://github.com/PrismJS/prism/issues/2677)) [`df0738e9`](https://github.com/PrismJS/prism/commit/df0738e9) + * Thousands -> millions [`9f82de50`](https://github.com/PrismJS/prism/commit/9f82de50) + * Unescaped Markup: More doc regarding comments ([#2652](https://github.com/PrismJS/prism/issues/2652)) [`add3736a`](https://github.com/PrismJS/prism/commit/add3736a) + * Website: Added and updated documentation ([#2654](https://github.com/PrismJS/prism/issues/2654)) [`8e660495`](https://github.com/PrismJS/prism/commit/8e660495) + * Website: Updated and improved guide on "Extending Prism" page ([#2586](https://github.com/PrismJS/prism/issues/2586)) [`8e1f38ff`](https://github.com/PrismJS/prism/commit/8e1f38ff) + +## 1.22.0 (2020-10-10) + +### New components + +* __Birb__ ([#2542](https://github.com/PrismJS/prism/issues/2542)) [`4d31e22a`](https://github.com/PrismJS/prism/commit/4d31e22a) +* __BSL (1C:Enterprise)__ & __OneScript__ ([#2520](https://github.com/PrismJS/prism/issues/2520)) [`5c33f0bb`](https://github.com/PrismJS/prism/commit/5c33f0bb) +* __MongoDB__ ([#2518](https://github.com/PrismJS/prism/issues/2518)) [`004eaa74`](https://github.com/PrismJS/prism/commit/004eaa74) +* __Naninovel Script__ ([#2494](https://github.com/PrismJS/prism/issues/2494)) [`388ad996`](https://github.com/PrismJS/prism/commit/388ad996) +* __PureScript__ ([#2526](https://github.com/PrismJS/prism/issues/2526)) [`ad748a00`](https://github.com/PrismJS/prism/commit/ad748a00) +* __SML__ & __SML/NJ__ ([#2537](https://github.com/PrismJS/prism/issues/2537)) [`cb75d9e2`](https://github.com/PrismJS/prism/commit/cb75d9e2) +* __Stan__ ([#2490](https://github.com/PrismJS/prism/issues/2490)) [`2da2beba`](https://github.com/PrismJS/prism/commit/2da2beba) +* __TypoScript__ & __TSConfig__ ([#2505](https://github.com/PrismJS/prism/issues/2505)) [`bf115f47`](https://github.com/PrismJS/prism/commit/bf115f47) + +### Updated components + +* Removed duplicate alternatives in various languages ([#2524](https://github.com/PrismJS/prism/issues/2524)) [`fa2225ff`](https://github.com/PrismJS/prism/commit/fa2225ff) +* __Haskell__ + * Improvements ([#2535](https://github.com/PrismJS/prism/issues/2535)) [`e023044c`](https://github.com/PrismJS/prism/commit/e023044c) +* __JS Extras__ + * Highlight import and export bindings ([#2533](https://github.com/PrismJS/prism/issues/2533)) [`c51ababb`](https://github.com/PrismJS/prism/commit/c51ababb) + * Added control-flow keywords ([#2529](https://github.com/PrismJS/prism/issues/2529)) [`bcef22af`](https://github.com/PrismJS/prism/commit/bcef22af) +* __PHP__ + * Added `match` keyword (PHP 8.0) ([#2574](https://github.com/PrismJS/prism/issues/2574)) [`1761513e`](https://github.com/PrismJS/prism/commit/1761513e) +* __Processing__ + * Fixed function pattern ([#2564](https://github.com/PrismJS/prism/issues/2564)) [`35cbc02f`](https://github.com/PrismJS/prism/commit/35cbc02f) +* __Regex__ + * Changed how languages embed regexes ([#2532](https://github.com/PrismJS/prism/issues/2532)) [`f62ca787`](https://github.com/PrismJS/prism/commit/f62ca787) +* __Rust__ + * Fixed Unicode char literals ([#2550](https://github.com/PrismJS/prism/issues/2550)) [`3b4f14ca`](https://github.com/PrismJS/prism/commit/3b4f14ca) +* __Scheme__ + * Added support for R7RS syntax ([#2525](https://github.com/PrismJS/prism/issues/2525)) [`e4f6ccac`](https://github.com/PrismJS/prism/commit/e4f6ccac) +* __Shell session__ + * Added aliases ([#2548](https://github.com/PrismJS/prism/issues/2548)) [`bfb36748`](https://github.com/PrismJS/prism/commit/bfb36748) + * Highlight all commands after the start of any Heredoc string ([#2509](https://github.com/PrismJS/prism/issues/2509)) [`6c921801`](https://github.com/PrismJS/prism/commit/6c921801) +* __YAML__ + * Improved key pattern ([#2561](https://github.com/PrismJS/prism/issues/2561)) [`59853a52`](https://github.com/PrismJS/prism/commit/59853a52) + +### Updated plugins + +* __Autoloader__ + * Fixed file detection regexes ([#2549](https://github.com/PrismJS/prism/issues/2549)) [`d36ea993`](https://github.com/PrismJS/prism/commit/d36ea993) +* __Match braces__ + * Fixed JS interpolation punctuation ([#2541](https://github.com/PrismJS/prism/issues/2541)) [`6b47133d`](https://github.com/PrismJS/prism/commit/6b47133d) +* __Show Language__ + * Added title for plain text ([#2555](https://github.com/PrismJS/prism/issues/2555)) [`a409245e`](https://github.com/PrismJS/prism/commit/a409245e) + +### Other + +* Tests: Added an option to accept the actual token stream ([#2515](https://github.com/PrismJS/prism/issues/2515)) [`bafab634`](https://github.com/PrismJS/prism/commit/bafab634) +* __Core__ + * Docs: Minor improvement ([#2513](https://github.com/PrismJS/prism/issues/2513)) [`206dc80f`](https://github.com/PrismJS/prism/commit/206dc80f) +* __Infrastructure__ + * JSDoc: Fixed line ends ([#2523](https://github.com/PrismJS/prism/issues/2523)) [`bf169e5f`](https://github.com/PrismJS/prism/commit/bf169e5f) +* __Website__ + * Website: Added new SB101 tutorial replacing the Crambler one ([#2576](https://github.com/PrismJS/prism/issues/2576)) [`655f985c`](https://github.com/PrismJS/prism/commit/655f985c) + * Website: Fix typo on homepage by adding missing word add ([#2570](https://github.com/PrismJS/prism/issues/2570)) [`8ae6a4ba`](https://github.com/PrismJS/prism/commit/8ae6a4ba) + * Custom class: Improved doc ([#2512](https://github.com/PrismJS/prism/issues/2512)) [`5ad6cb23`](https://github.com/PrismJS/prism/commit/5ad6cb23) + ## 1.21.0 (2020-08-06) ### New components diff --git a/README.md b/README.md index 2478355c9d..711ea63880 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # [Prism](https://prismjs.com/) -[![Build Status](https://travis-ci.org/PrismJS/prism.svg?branch=master)](https://travis-ci.org/PrismJS/prism) +[![Build Status](https://github.com/PrismJS/prism/workflows/CI/badge.svg)](https://github.com/PrismJS/prism/actions) [![npm](https://img.shields.io/npm/dw/prismjs.svg)](https://www.npmjs.com/package/prismjs) -Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/). +Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/). You can learn more on [prismjs.com](https://prismjs.com/). @@ -13,20 +13,28 @@ You can learn more on [prismjs.com](https://prismjs.com/). ## Contribute to Prism! -Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, considering giving back by sending a pull request. Here are a few tips: +Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, consider giving back by sending a pull request. Here are a few tips: - Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible. -- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are also generated automatically by our build system. +- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are generated by our build system (see below). +- Use `npm ci` to install Prism's dependencies. Do not use `npm install` because it will cause non-deterministic builds. - The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. With all of Prism's dependencies installed, you just need to run the command `npm run build`. - Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc. -- Please try to err towards more smaller PRs rather than few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult. -- My time is very limited these days, so it might take a long time to review longer PRs (short ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected. +- Please try to err towards more smaller PRs rather than a few huge PRs. If a PR includes changes that I want to merge and also changes that I don't, handling it becomes difficult. +- My time is very limited these days, so it might take a long time to review bigger PRs (small ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected. - If you contribute a new language definition, you will be responsible for handling bug reports about that language definition. - If you [add a new language definition](https://prismjs.com/extending.html#creating-a-new-language-definition) or plugin, you need to add it to `components.json` as well and rebuild Prism by running `npm run build`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder. - Go to [prism-themes](https://github.com/PrismJS/prism-themes) if you want to add a new theme. Thank you so much for contributing!! +### Software requirements + +Prism will run on [almost any browser](https://prismjs.com/#features-full) and Node.js version but you need the following software to contribute: + +- Node.js >= 10.x +- npm >= 6.x + ## Translations -* [![中文说明](http://awesomes.oss-cn-beijing.aliyuncs.com/readme.png)](https://www.awesomes.cn/repo/PrismJS/prism) +* [简体中文](https://www.awesomes.cn/repo/PrismJS/prism) (if unavailable, see [here](https://deepmind.t-salon.cc/article/113)) diff --git a/assets/code.js b/assets/code.js index e2da68aae8..0415b1bd77 100644 --- a/assets/code.js +++ b/assets/code.js @@ -1,104 +1,103 @@ -(function(){ - -if(!document.body.addEventListener) { - return; -} - -$$('[data-plugin-header]').forEach(function (element) { - var plugin = components.plugins[element.getAttribute('data-plugin-header')]; - element.innerHTML = '
\n' - + '

' + plugin.title + '

\n

' + plugin.description + '

'; -}); - -$$('[data-src][data-type="text/html"]').forEach(function(element) { - var src = element.getAttribute('data-src'), - html = element.getAttribute('data-type') === 'text/html', - contentProperty = html ? 'innerHTML' : 'textContent'; - - $u.xhr({ - url: src, - callback: function(xhr) { - try { - element[contentProperty] = xhr.responseText; - - // Run JS - - $$('script', element).forEach(function (script) { - var after = script.nextSibling, parent = script.parentNode; - parent.removeChild(script); - document.head.appendChild(script); - }); +(function () { + + if (!document.body.addEventListener) { + return; + } + + $$('[data-plugin-header]').forEach(function (element) { + var plugin = components.plugins[element.getAttribute('data-plugin-header')]; + element.innerHTML = '
\n' + + '

' + plugin.title + '

\n

' + plugin.description + '

'; + }); + + $$('[data-src][data-type="text/html"]').forEach(function (element) { + var src = element.getAttribute('data-src'); + var html = element.getAttribute('data-type') === 'text/html'; + var contentProperty = html ? 'innerHTML' : 'textContent'; + + $u.xhr({ + url: src, + callback: function (xhr) { + try { + element[contentProperty] = xhr.responseText; + + // Run JS + + $$('script', element).forEach(function (script) { + var parent = script.parentNode; + parent.removeChild(script); + document.head.appendChild(script); + }); + } catch (e) { /* noop */ } } - catch (e) {} - } + }); }); -}); -})(); +}()); /** * Table of contents */ -(function(){ -var toc = document.createElement('ol'); +(function () { + var toc = document.createElement('ol'); -$$('body > section > h1').forEach(function(h1) { - var section = h1.parentNode, - text = h1.textContent, - id = h1.id || section.id; + $$('body > section > h1').forEach(function (h1) { + var section = h1.parentNode; + var text = h1.textContent; + var id = h1.id || section.id; - // Assign id if one does not exist - if (!id) { - id = text.toLowerCase(); + // Assign id if one does not exist + if (!id) { + id = text.toLowerCase(); - // Replace spaces with hyphens, only keep first 10 words - id = id.split(/\s+/g, 10).join('-'); + // Replace spaces with hyphens, only keep first 10 words + id = id.split(/\s+/g, 10).join('-'); - // Remove non-word characters - id = id.replace(/[^\w-]/g, ''); + // Remove non-word characters + id = id.replace(/[^\w-]/g, ''); - section.id = id; - } + section.id = id; + } - // Linkify heading text - if (h1.children.length === 0) { - h1.innerHTML = ''; + // Linkify heading text + if (h1.children.length === 0) { + h1.innerHTML = ''; - $u.element.create('a', { - properties: { - href: window.location.pathname + '#' + id + $u.element.create('a', { + properties: { + href: window.location.pathname + '#' + id + }, + contents: text, + inside: h1 + }); + } + + $u.element.create('li', { + contents: { + tag: 'a', + properties: { + href: window.location.pathname + '#' + (h1.id || section.id) + }, + contents: text }, - contents: text, - inside: h1 + inside: toc }); - } + }); - $u.element.create('li', { - contents: { - tag: 'a', + if (toc.children.length > 0) { + $u.element.create('section', { properties: { - href: window.location.pathname + '#' + (h1.id || section.id) + id: 'toc' }, - contents: text - }, - inside: toc - }); -}); - -if (toc.children.length > 0) { - $u.element.create('section', { - properties: { - id: 'toc' - }, - contents: [{ - tag: 'h1', - contents: 'On this page' - }, toc], - before: $('body > section') - }); -} + contents: [{ + tag: 'h1', + contents: 'On this page' + }, toc], + before: $('body > section') + }); + } -})(); +}()); /** * Linkify h2 @@ -116,154 +115,133 @@ if (toc.children.length > 0) { inside: h2 }); }); -})(); +}()); // calc() -(function(){ - if(!window.PrefixFree) return; +(function () { + if (!window.PrefixFree) { + return; + } if (PrefixFree.functions.indexOf('calc') == -1) { var style = document.createElement('_').style; - style.width = 'calc(1px + 1%)' + style.width = 'calc(1px + 1%)'; - if(!style.width) { + if (!style.width) { // calc not supported - var header = $('header'), - footer = $('footer'); + var header = $('header'); + var footer = $('footer'); function calculatePadding() { header.style.padding = - footer.style.padding = '30px ' + (innerWidth/2 - 450) + 'px'; + footer.style.padding = '30px ' + (innerWidth / 2 - 450) + 'px'; } addEventListener('resize', calculatePadding); calculatePadding(); } } -})(); +}()); // setTheme is intentionally global, // so it can be accessed from download.js var setTheme; -(function() { -var p = $u.element.create('p', { - properties: { - id: 'theme' - }, - contents: { - tag: 'p', - contents: 'Theme:' - }, - after: '.intro' -}); - -var themes = components.themes; -var current = (location.search.match(/theme=([\w-]+)/) || [])[1]; - -if (!(current in themes)) { - current = undefined; -} - -if (current === undefined) { - var stored = localStorage.getItem('theme'); - - current = stored in themes? stored : 'prism'; -} - -setTheme = function (id) { - var link = $$('link[href^="themes/prism"]')[0]; - - link.href = themes.meta.path.replace(/\{id}/g, id); - localStorage.setItem('theme', id); -}; - -for (var id in themes) { - - if (id === 'meta') { - continue; - } - - $u.element.create('input', { +(function () { + var p = $u.element.create('p', { properties: { - type: 'radio', - name: "theme", - id: 'theme=' + id, - checked: current === id, - value: id, - onclick: function () { - setTheme(this.value); - } + id: 'theme' }, - inside: p - }); - - $u.element.create('label', { - properties: { - htmlFor: 'theme=' + id + contents: { + tag: 'p', + contents: 'Theme:' }, - contents: themes[id].title || themes[id], - inside: p + after: '.intro' }); -} -setTheme(current); -})(); + var themes = components.themes; + var current = (location.search.match(/theme=([\w-]+)/) || [])[1]; -(function(){ + if (!(current in themes)) { + current = undefined; + } + + if (current === undefined) { + var stored = localStorage.getItem('theme'); + + current = stored in themes ? stored : 'prism'; + } -function listPlugins(ul) { - for (var id in components.plugins) { - if (id == 'meta') { + setTheme = function (id) { + var link = $$('link[href^="themes/prism"]')[0]; + + link.href = themes.meta.path.replace(/\{id\}/g, id); + localStorage.setItem('theme', id); + }; + + for (var id in themes) { + + if (id === 'meta') { continue; } - var plugin = components.plugins[id]; - - var li = $u.element.create('li', { - contents: [ - { - tag: 'a', - prop: { - href: 'plugins/' + id - }, - contents: plugin.title || plugin - }, - { - tag: 'br' + $u.element.create('input', { + properties: { + type: 'radio', + name: 'theme', + id: 'theme=' + id, + checked: current === id, + value: id, + onclick: function () { + setTheme(this.value); } - ], - inside: ul + }, + inside: p }); - var desc = document.createElement('div'); - desc.innerHTML = plugin.description; - li.appendChild(desc); + $u.element.create('label', { + properties: { + htmlFor: 'theme=' + id + }, + contents: themes[id].title || themes[id], + inside: p + }); } -} - -$$('.plugin-list').forEach(listPlugins); -// small polyfill for Element#matches -if (!Element.prototype.matches) { - Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; -} + setTheme(current); +}()); -Prism && Prism.hooks.add('complete', function (env) { - var element = env.element; +(function () { - requestAnimationFrame(function () { - if (!element.matches('div.code-toolbar > pre > code')) { - return; - } + function listPlugins(ul) { + for (var id in components.plugins) { + if (id == 'meta') { + continue; + } - var pre = element.parentElement; - var wrapper = pre.parentElement; + var plugin = components.plugins[id]; - // transfer margin of pre to wrapper - wrapper.style.margin = window.getComputedStyle(pre).margin; - pre.style.margin = "0"; + var li = $u.element.create('li', { + contents: [ + { + tag: 'a', + prop: { + href: 'plugins/' + id + }, + contents: plugin.title || plugin + }, + { + tag: 'br' + } + ], + inside: ul + }); + + var desc = document.createElement('div'); + desc.innerHTML = plugin.description; + li.appendChild(desc); + } + } - }); -}); + $$('.plugin-list').forEach(listPlugins); -})(); +}()); diff --git a/assets/download.js b/assets/download.js index cfd1d16a05..9e880c106d 100644 --- a/assets/download.js +++ b/assets/download.js @@ -2,623 +2,628 @@ * Manage downloads */ -(function() { +(function () { -var cache = {}; -var form = $('form'); -var minified = true; + var cache = {}; + var form = $('form'); + var minified = true; -var dependencies = {}; + var dependencies = {}; -var treeURL = 'https://api.github.com/repos/PrismJS/prism/git/trees/master?recursive=1'; -var treePromise = new Promise(function(resolve) { - $u.xhr({ - url: treeURL, - callback: function(xhr) { - if (xhr.status < 400) { - resolve(JSON.parse(xhr.responseText).tree); + var treeURL = 'https://api.github.com/repos/PrismJS/prism/git/trees/master?recursive=1'; + var treePromise = new Promise(function (resolve) { + $u.xhr({ + url: treeURL, + callback: function (xhr) { + if (xhr.status < 400) { + resolve(JSON.parse(xhr.responseText).tree); + } } - } + }); }); -}); -/** - * Converts the given value into an array. - * - * @param {T | T[] | null | undefined} value - * @returns {T[]} - * @template T - */ -function toArray(value) { - if (Array.isArray(value)) { - return value; - } else { - return value == null ? [] : [value]; + /** + * Converts the given value into an array. + * + * @param {T | T[] | null | undefined} value + * @returns {T[]} + * @template T + */ + function toArray(value) { + if (Array.isArray(value)) { + return value; + } else { + return value == null ? [] : [value]; + } } -} - -var hstr = window.location.hash.match(/(?:languages|plugins)=[-+\w]+|themes=[-\w]+/g); -if (hstr) { - hstr.forEach(function(str) { - var kv = str.split('=', 2), - category = kv[0], - ids = kv[1].split('+'); - if (category !== 'meta' && category !== 'core' && components[category]) { - for (var id in components[category]) { - if (components[category][id].option) { - delete components[category][id].option; + + var hstr = window.location.hash.match(/(?:languages|plugins)=[-+\w]+|themes=[-\w]+/g); + if (hstr) { + hstr.forEach(function (str) { + var kv = str.split('=', 2); + var category = kv[0]; + var ids = kv[1].split('+'); + if (category !== 'meta' && category !== 'core' && components[category]) { + for (var id in components[category]) { + if (components[category][id].option) { + delete components[category][id].option; + } } - } - if (category === 'themes' && ids.length) { - var themeInput = $('#theme input[value="' + ids[0] + '"]'); - if (themeInput) { - themeInput.checked = true; + if (category === 'themes' && ids.length) { + var themeInput = $('#theme input[value="' + ids[0] + '"]'); + if (themeInput) { + themeInput.checked = true; + } + // eslint-disable-next-line no-undef + setTheme(ids[0]); } - setTheme(ids[0]); - } - var makeDefault = function (id) { - if (id !== 'meta') { - if (components[category][id]) { - if (components[category][id].option !== 'default') { - if (typeof components[category][id] === 'string') { - components[category][id] = { title: components[category][id] } + var makeDefault = function (id) { + if (id !== 'meta') { + if (components[category][id]) { + if (components[category][id].option !== 'default') { + if (typeof components[category][id] === 'string') { + components[category][id] = { title: components[category][id] }; + } + components[category][id].option = 'default'; } - components[category][id].option = 'default'; - } - toArray(components[category][id].require).forEach(makeDefault); + toArray(components[category][id].require).forEach(makeDefault); + } } - } - }; - ids.forEach(makeDefault); - } - }); -} - -// Stay compatible with old querystring feature -var qstr = window.location.search.match(/(?:languages|plugins)=[-+\w]+|themes=[-\w]+/g); -if (qstr && !hstr) { - window.location.hash = window.location.search.replace(/^\?/, ''); - window.location.search = ''; -} - -var storedTheme = localStorage.getItem('theme'); - -for (var category in components) { - var all = components[category]; - - all.meta.section = $u.element.create('section', { - className: 'options', - id: 'category-' + category, - contents: { - tag: 'h1', - contents: category.charAt(0).toUpperCase() + category.slice(1) - }, - inside: '#components' - }); + }; + ids.forEach(makeDefault); + } + }); + } + + // Stay compatible with old querystring feature + var qstr = window.location.search.match(/(?:languages|plugins)=[-+\w]+|themes=[-\w]+/g); + if (qstr && !hstr) { + window.location.hash = window.location.search.replace(/^\?/, ''); + window.location.search = ''; + } + + var storedTheme = localStorage.getItem('theme'); + + for (var category in components) { + var all = components[category]; - if (all.meta.addCheckAll) { - $u.element.create('label', { - attributes: { - 'data-id': 'check-all-' + category + all.meta.section = $u.element.create('section', { + className: 'options', + id: 'category-' + category, + contents: { + tag: 'h1', + contents: category.charAt(0).toUpperCase() + category.slice(1) }, - contents: [ - { - tag: 'input', - properties: { - type: 'checkbox', - name: 'check-all-' + category, - value: '', - checked: false, - onclick: (function(category, all){ - return function () { - var checkAll = this; - $$('input[name="download-' + category + '"]').forEach(function(input) { - all[input.value].enabled = input.checked = checkAll.checked; - }); - - update(category); - }; - })(category, all) - } - }, - 'Select/unselect all' - ], - inside: all.meta.section + inside: '#components' }); - } - for (var id in all) { - if(id === 'meta') { - continue; + if (all.meta.addCheckAll) { + $u.element.create('label', { + attributes: { + 'data-id': 'check-all-' + category + }, + contents: [ + { + tag: 'input', + properties: { + type: 'checkbox', + name: 'check-all-' + category, + value: '', + checked: false, + onclick: (function (category, all) { + return function () { + var checkAll = this; + $$('input[name="download-' + category + '"]').forEach(function (input) { + all[input.value].enabled = input.checked = checkAll.checked; + }); + + update(category); + }; + }(category, all)) + } + }, + 'Select/unselect all' + ], + inside: all.meta.section + }); } - var checked = false, disabled = false; - var option = all[id].option || all.meta.option; + for (var id in all) { + if (id === 'meta') { + continue; + } - switch (option) { - case 'mandatory': disabled = true; // fallthrough - case 'default': checked = true; - } - if (category === 'themes' && storedTheme) { - checked = id === storedTheme; - } + var checked = false; var disabled = false; + var option = all[id].option || all.meta.option; - var filepath = all.meta.path.replace(/\{id}/g, id); - - var info = all[id] = { - title: all[id].title || all[id], - aliasTitles: all[id].aliasTitles, - noCSS: all[id].noCSS || all.meta.noCSS, - noJS: all[id].noJS || all.meta.noJS, - enabled: checked, - require: toArray(all[id].require), - after: toArray(all[id].after), - modify: toArray(all[id].modify), - owner: all[id].owner, - files: { - minified: { - paths: [], - size: 0 - }, - dev: { - paths: [], - size: 0 - } + switch (option) { + case 'mandatory': disabled = true; // fallthrough + case 'default': checked = true; + } + if (category === 'themes' && storedTheme) { + checked = id === storedTheme; } - }; - info.require.forEach(function (v) { - dependencies[v] = (dependencies[v] || []).concat(id); - }); + var filepath = all.meta.path.replace(/\{id\}/g, id); + + var info = all[id] = { + title: all[id].title || all[id], + aliasTitles: all[id].aliasTitles, + noCSS: all[id].noCSS || all.meta.noCSS, + noJS: all[id].noJS || all.meta.noJS, + enabled: checked, + require: toArray(all[id].require), + after: toArray(all[id].after), + modify: toArray(all[id].modify), + owner: all[id].owner, + files: { + minified: { + paths: [], + size: 0 + }, + dev: { + paths: [], + size: 0 + } + } + }; - if (!all[id].noJS && !/\.css$/.test(filepath)) { - info.files.minified.paths.push(filepath.replace(/(\.js)?$/, '.min.js')); - info.files.dev.paths.push(filepath.replace(/(\.js)?$/, '.js')); - } + info.require.forEach(function (v) { + dependencies[v] = (dependencies[v] || []).concat(id); + }); + if (!all[id].noJS && !/\.css$/.test(filepath)) { + info.files.minified.paths.push(filepath.replace(/(\.js)?$/, '.min.js')); + info.files.dev.paths.push(filepath.replace(/(\.js)?$/, '.js')); + } - if ((!all[id].noCSS && !/\.js$/.test(filepath)) || /\.css$/.test(filepath)) { - var cssFile = filepath.replace(/(\.css)?$/, '.css'); - info.files.minified.paths.push(cssFile); - info.files.dev.paths.push(cssFile); - } + if ((!all[id].noCSS && !/\.js$/.test(filepath)) || /\.css$/.test(filepath)) { + var cssFile = filepath.replace(/(\.css)?$/, '.css'); + var minCSSFile = cssFile.replace(/(?:\.css)$/, '.min.css'); - function getLanguageTitle(lang) { - if (!lang.aliasTitles) - return lang.title; + info.files.minified.paths.push(minCSSFile); + info.files.dev.paths.push(cssFile); + } - var titles = [lang.title]; - for (var alias in lang.aliasTitles) - if (lang.aliasTitles.hasOwnProperty(alias)) - titles.push(lang.aliasTitles[alias]); - return titles.join(" + "); - } + function getLanguageTitle(lang) { + if (!lang.aliasTitles) { + return lang.title; + } - var label = $u.element.create('label', { - attributes: { - 'data-id': id - }, - contents: [ - { - tag: 'input', - properties: { - type: all.meta.exclusive? 'radio' : 'checkbox', - name: 'download-' + category, - value: id, - checked: checked, - disabled: disabled, - onclick: (function(id, category, all){ - return function () { - $$('input[name="' + this.name + '"]').forEach(function(input) { - all[input.value].enabled = input.checked; - }); - - if (all[id].require && this.checked) { - all[id].require.forEach(function(v) { - var input = $('label[data-id="' + v + '"] > input'); - input.checked = true; - - input.onclick(); + var titles = [lang.title]; + for (var alias in lang.aliasTitles) { + if (lang.aliasTitles.hasOwnProperty(alias)) { + titles.push(lang.aliasTitles[alias]); + } + } + return titles.join(' + '); + } + + var label = $u.element.create('label', { + attributes: { + 'data-id': id + }, + contents: [ + { + tag: 'input', + properties: { + type: all.meta.exclusive ? 'radio' : 'checkbox', + name: 'download-' + category, + value: id, + checked: checked, + disabled: disabled, + onclick: (function (id, category, all) { + return function () { + $$('input[name="' + this.name + '"]').forEach(function (input) { + all[input.value].enabled = input.checked; }); - } - if (dependencies[id] && !this.checked) { // It’s required by others - dependencies[id].forEach(function(dependent) { - var input = $('label[data-id="' + dependent + '"] > input'); - input.checked = false; + if (all[id].require && this.checked) { + all[id].require.forEach(function (v) { + var input = $('label[data-id="' + v + '"] > input'); + input.checked = true; - input.onclick(); - }); - } + input.onclick(); + }); + } - update(category, id); - }; - })(id, category, all) - } - }, - all.meta.link? { - tag: 'a', - properties: { - href: all.meta.link.replace(/\{id}/g, id), - className: 'name' + if (dependencies[id] && !this.checked) { // It’s required by others + dependencies[id].forEach(function (dependent) { + var input = $('label[data-id="' + dependent + '"] > input'); + input.checked = false; + + input.onclick(); + }); + } + + update(category, id); + }; + }(id, category, all)) + } }, - contents: info.title - } : { - tag: 'span', - properties: { - className: 'name' + all.meta.link ? { + tag: 'a', + properties: { + href: all.meta.link.replace(/\{id\}/g, id), + className: 'name' + }, + contents: info.title + } : { + tag: 'span', + properties: { + className: 'name' + }, + contents: getLanguageTitle(info) }, - contents: getLanguageTitle(info) - }, - ' ', - all[id].owner? { - tag: 'a', - properties: { - href: 'https://github.com/' + all[id].owner, - className: 'owner', - target: '_blank' - }, - contents: all[id].owner - } : ' ', - { - tag: 'strong', - className: 'filesize' - } - ], - inside: all.meta.section - }); + ' ', + all[id].owner ? { + tag: 'a', + properties: { + href: 'https://github.com/' + all[id].owner, + className: 'owner', + target: '_blank' + }, + contents: all[id].owner + } : ' ', + { + tag: 'strong', + className: 'filesize' + } + ], + inside: all.meta.section + }); - // Add click events on main theme selector too. - (function (label) { - if (category === 'themes') { - var themeInput = $('#theme input[value="' + id + '"]'); - var input = $('input', label); - if (themeInput) { - var themeInputOnclick = themeInput.onclick; - themeInput.onclick = function () { - input.checked = true; - input.onclick(); - themeInputOnclick && themeInputOnclick.call(themeInput); - }; + // Add click events on main theme selector too. + (function (label) { + if (category === 'themes') { + var themeInput = $('#theme input[value="' + id + '"]'); + var input = $('input', label); + if (themeInput) { + var themeInputOnclick = themeInput.onclick; + themeInput.onclick = function () { + input.checked = true; + input.onclick(); + themeInputOnclick && themeInputOnclick.call(themeInput); + }; + } } - } - }(label)); + }(label)); + } } -} -form.elements.compression[0].onclick = -form.elements.compression[1].onclick = function() { - minified = !!+this.value; + form.elements.compression[0].onclick = + form.elements.compression[1].onclick = function () { + minified = !!+this.value; - getFilesSizes(); -}; + getFilesSizes(); + }; -function getFileSize(filepath) { - return treePromise.then(function(tree) { - for(var i=0, l=tree.length; i} - * - * @typedef CodePromiseInfo - * @property {Promise} contentsPromise - * @property {string} id - * @property {string} category - * @property {string} path - * @property {string} type - */ -function buildCode(promises) { - // sort the promises - /** @type {CodePromiseInfo[]} */ - var finalPromises = []; - /** @type {Object} */ - var toSortMap = {}; + $('#download-' + type + ' .download-button').onclick = function () { + saveAs(new Blob([text], { type: 'application/octet-stream;charset=utf-8' }), fileName); + }; + }(type)); + } + }); + } - promises.forEach(function (p) { - if (p.category == "core" || p.category == "themes") { - finalPromises.push(p); - } else { - var infos = toSortMap[p.id]; - if (!infos) { - toSortMap[p.id] = infos = []; + /** + * Returns a promise of the code of the Prism bundle. + * + * @param {CodePromiseInfo[]} promises + * @returns {Promise<{ code: { js: string, css: string }, errors: HTMLElement[] }>} + * + * @typedef CodePromiseInfo + * @property {Promise} contentsPromise + * @property {string} id + * @property {string} category + * @property {string} path + * @property {string} type + */ + function buildCode(promises) { + // sort the promises + + /** @type {CodePromiseInfo[]} */ + var finalPromises = []; + /** @type {Object} */ + var toSortMap = {}; + + promises.forEach(function (p) { + if (p.category == 'core' || p.category == 'themes') { + finalPromises.push(p); + } else { + var infos = toSortMap[p.id]; + if (!infos) { + toSortMap[p.id] = infos = []; + } + infos.push(p); } - infos.push(p); - } - }); + }); - // this assumes that the ids in `toSortMap` are complete under transitive requirements - getLoader(components, Object.keys(toSortMap)).getIds().forEach(function (id) { - if (!toSortMap[id]) { - console.error(id + " not found."); - } - finalPromises.push.apply(finalPromises, toSortMap[id]); - }); - promises = finalPromises; - - // build - var i = 0, - l = promises.length; - var code = {js: '', css: ''}; - var errors = []; - - var f = function(resolve) { - if(i < l) { - var p = promises[i]; - p.contentsPromise.then(function(contents) { - code[p.type] += contents + (p.type === 'js' && !/;\s*$/.test(contents) ? ';' : '') + '\n'; - i++; - f(resolve); - }); - p.contentsPromise['catch'](function() { - errors.push($u.element.create({ - tag: 'p', - prop: { - textContent: 'An error occurred while fetching the file "' + p.path + '".' - } - })); - i++; - f(resolve); - }); - } else { - resolve({code: code, errors: errors}); - } - }; + // this assumes that the ids in `toSortMap` are complete under transitive requirements + getLoader(components, Object.keys(toSortMap)).getIds().forEach(function (id) { + if (!toSortMap[id]) { + console.error(id + ' not found.'); + } + finalPromises.push.apply(finalPromises, toSortMap[id]); + }); + promises = finalPromises; + + // build + var i = 0; + var l = promises.length; + var code = { js: '', css: '' }; + var errors = []; + + var f = function (resolve) { + if (i < l) { + var p = promises[i]; + p.contentsPromise.then(function (contents) { + code[p.type] += contents + (p.type === 'js' && !/;\s*$/.test(contents) ? ';' : '') + '\n'; + i++; + f(resolve); + }); + p.contentsPromise['catch'](function () { + errors.push($u.element.create({ + tag: 'p', + prop: { + textContent: 'An error occurred while fetching the file "' + p.path + '".' + } + })); + i++; + f(resolve); + }); + } else { + resolve({ code: code, errors: errors }); + } + }; - return new Promise(f); -} + return new Promise(f); + } -/** - * @returns {Promise} - */ -function getVersion() { - return getFileContents('./package.json').then(function (jsonStr) { - return JSON.parse(jsonStr).version; - }); -} + /** + * @returns {Promise} + */ + function getVersion() { + return getFileContents('./package.json').then(function (jsonStr) { + return JSON.parse(jsonStr).version; + }); + } -})(); +}()); diff --git a/assets/examples.js b/assets/examples.js index ccf1607ce7..a72b37e8d7 100644 --- a/assets/examples.js +++ b/assets/examples.js @@ -2,239 +2,199 @@ * Manage examples */ -(function() { +(function () { -var examples = {}; + var examples = {}; -var treeURL = 'https://api.github.com/repos/PrismJS/prism/git/trees/master?recursive=1'; -var treePromise = new Promise(function (resolve) { - $u.xhr({ - url: treeURL, - callback: function (xhr) { - if (xhr.status < 400) { - resolve(JSON.parse(xhr.responseText).tree); + var treeURL = 'https://api.github.com/repos/PrismJS/prism/git/trees/master?recursive=1'; + var treePromise = new Promise(function (resolve) { + $u.xhr({ + url: treeURL, + callback: function (xhr) { + if (xhr.status < 400) { + resolve(JSON.parse(xhr.responseText).tree); + } } - } + }); }); -}); -var languages = components.languages; + var languages = components.languages; -Promise.all(Object.keys(languages).filter(function (id) { return id !== 'meta'; }).map(function (id) { - var language = languages[id]; + Promise.all(Object.keys(languages).filter(function (id) { return id !== 'meta'; }).map(function (id) { + var language = languages[id]; - language.enabled = language.option === 'default'; - language.path = languages.meta.path.replace(/\{id}/g, id) + '.js'; - language.examplesPath = languages.meta.examplesPath.replace(/\{id}/g, id) + '.html'; + language.enabled = language.option === 'default'; + language.path = languages.meta.path.replace(/\{id\}/g, id) + '.js'; + language.examplesPath = languages.meta.examplesPath.replace(/\{id\}/g, id) + '.html'; - return fileExists(language.examplesPath).then(function (exists) { - return { id: id, exists: exists }; - }); -})).then(function (values) { - values.forEach(function (result) { - var id = result.id; - var exists = result.exists; - var language = languages[id]; - var checked = language.enabled; - - $u.element.create('label', { - attributes: { - 'data-id': id, - 'title': !exists ? 'No examples are available for this language.' : '' - }, - className: !exists ? 'unavailable' : '', - contents: [ - { - tag: 'input', - properties: { - type: 'checkbox', - name: 'language', - value: id, - checked: checked && exists, - disabled: !exists, - onclick: function () { - $$('input[name="' + this.name + '"]').forEach(function (input) { - languages[input.value].enabled = input.checked; - }); - - update(id); - } - } - }, - language.title - ], - inside: '#languages' + return fileExists(language.examplesPath).then(function (exists) { + return { id: id, exists: exists }; }); - examples[id] = $u.element.create('section', { - 'id': 'language-' + id, - 'className': 'language-' + id, - inside: '#examples' + })).then(function (values) { + values.forEach(function (result) { + var id = result.id; + var exists = result.exists; + var language = languages[id]; + var checked = language.enabled; + + $u.element.create('label', { + attributes: { + 'data-id': id, + 'title': !exists ? 'No examples are available for this language.' : '' + }, + className: !exists ? 'unavailable' : '', + contents: [ + { + tag: 'input', + properties: { + type: 'checkbox', + name: 'language', + value: id, + checked: checked && exists, + disabled: !exists, + onclick: function () { + $$('input[name="' + this.name + '"]').forEach(function (input) { + languages[input.value].enabled = input.checked; + }); + + update(id); + } + } + }, + language.title + ], + inside: '#languages' + }); + examples[id] = $u.element.create('section', { + 'id': 'language-' + id, + 'className': 'language-' + id, + inside: '#examples' + }); + if (checked) { + update(id); + } }); - if (checked) { - update(id); - } }); -}); -function fileExists(filepath) { - return treePromise.then(function (tree) { - for (var i = 0, l = tree.length; i < l; i++) { - if (tree[i].path === filepath) { - return true; + function fileExists(filepath) { + return treePromise.then(function (tree) { + for (var i = 0, l = tree.length; i < l; i++) { + if (tree[i].path === filepath) { + return true; + } } - } - // on localhost: The missing example might be for a new language - if (location.hostname === 'localhost' || location.hostname === '127.0.0.1') { - return getFileContents(filepath).then(function () { return true; }, function () { return false; }); - } + // on localhost: The missing example might be for a new language + if (location.hostname === 'localhost' || location.hostname === '127.0.0.1') { + return getFileContents(filepath).then(function () { return true; }, function () { return false; }); + } - return false; - }); -} + return false; + }); + } -function getFileContents(filepath) { - return new Promise(function (resolve, reject) { - $u.xhr({ - url: filepath, - callback: function (xhr) { - if (xhr.status < 400 && xhr.responseText) { - resolve(xhr.responseText); - } else { - reject(); + function getFileContents(filepath) { + return new Promise(function (resolve, reject) { + $u.xhr({ + url: filepath, + callback: function (xhr) { + if (xhr.status < 400 && xhr.responseText) { + resolve(xhr.responseText); + } else { + reject(); + } } - } + }); }); - }); -} - -function buildContentsHeader(id) { - function toArray(value) { - if (Array.isArray(value)) { - return value; - } else if (value != null) { - return [value]; - } else { - return []; - } } - var language = languages[id]; - var header = '

' + language.title + '

'; - - if (language.alias) { - var alias = toArray(language.alias); + function buildContentsHeader(id) { + function toArray(value) { + if (Array.isArray(value)) { + return value; + } else if (value != null) { + return [value]; + } else { + return []; + } + } - header += '

To use this language, use one of the following classes:

'; - header += '
  • "language-' + id + '"
  • '; - alias.forEach(function (alias) { - header += '
  • "language-' + alias + '"
  • '; - }); - header += '
'; - } else { - header += '

To use this language, use the class "language-' + id + '".

'; - } + var language = languages[id]; + var header = '

' + language.title + '

'; - function wrapCode(text) { - return '' + text + ''; - } + if (language.alias) { + var alias = toArray(language.alias); - var deps = []; - if (language.require) { - deps.push('requires ' + toArray(language.require).map(wrapCode).join(', ')); - } - if (language.optional) { - deps.push('optionally uses ' + toArray(language.optional).map(wrapCode).join(', ')); - } - if (language.modify) { - deps.push('modifies ' + toArray(language.modify).map(wrapCode).join(', ')); - } - if (deps.length) { - header += '

'; - header += 'Dependencies:'; - header += ' This component'; - if (deps.length === 1) { - header += ' ' + deps[0] + '.'; - } else { - header += ':'; - header += '

    '; - deps.forEach(function (text) { - header += '
  • ' + text + '.
  • ' + header += '

    To use this language, use one of the following classes:

    '; + header += '
    • "language-' + id + '"
    • '; + alias.forEach(function (alias) { + header += '
    • "language-' + alias + '"
    • '; }); header += '
    '; + } else { + header += '

    To use this language, use the class "language-' + id + '".

    '; } - header += '

    '; - } - return header; -} - -function update(id) { - var language = languages[id]; - if (language.enabled) { - if (!language.examplesPromise) { - language.examplesPromise = getFileContents(language.examplesPath); + function wrapCode(text) { + return '' + text + ''; } - language.examplesPromise.then(function (contents) { - examples[id].innerHTML = buildContentsHeader(id) + contents; - - loadLanguage(id).then(function () { - Prism.highlightAllUnder(examples[id]); - }); - }); - } else { - examples[id].innerHTML = ''; - } -} -/** - * Loads a language, including all dependencies - * - * @param {string} lang the language to load - * @returns {Promise} the promise which resolves as soon as everything is loaded - */ -function loadLanguage(lang) { - // at first we need to fetch all dependencies for the main language - // Note: we need to do this, even if the main language already is loaded (just to be sure..) - // - // We load an array of all dependencies and call recursively this function on each entry - // - // dependencies is now an (possibly empty) array of loading-promises - var dependencies = getDependenciesOfLanguage(lang).map(loadLanguage); - - // We create a promise, which will resolve, as soon as all dependencies are loaded. - // They need to be fully loaded because the main language may extend them. - return Promise.all(dependencies) - .then(function () { - - // If the main language itself isn't already loaded, load it now - // and return the newly created promise (we chain the promises). - // If the language is already loaded, just do nothing - the next .then() - // will immediately be called - if (!Prism.languages[lang]) { - return new Promise(function (resolve) { - $u.script('components/prism-' + lang + '.js', resolve); + var deps = []; + if (language.require) { + deps.push('requires ' + toArray(language.require).map(wrapCode).join(', ')); + } + if (language.optional) { + deps.push('optionally uses ' + toArray(language.optional).map(wrapCode).join(', ')); + } + if (language.modify) { + deps.push('modifies ' + toArray(language.modify).map(wrapCode).join(', ')); + } + if (deps.length) { + header += '

    '; + header += 'Dependencies:'; + header += ' This component'; + if (deps.length === 1) { + header += ' ' + deps[0] + '.'; + } else { + header += ':'; + header += '

      '; + deps.forEach(function (text) { + header += '
    • ' + text + '.
    • '; }); + header += '
    '; } - }); -} - + header += '

    '; + } -/** - * Returns all dependencies (as identifiers) of a specific language - * - * @param {string} lang - * @returns {string[]} the list of dependencies. Empty if the language has none. - */ -function getDependenciesOfLanguage(lang) { - if (!components.languages[lang] || !components.languages[lang].require) { - return []; + return header; } - return ($u.type(components.languages[lang].require) === "array") - ? components.languages[lang].require - : [components.languages[lang].require]; -} + function update(id) { + var language = languages[id]; + if (language.enabled) { + if (!language.examplesPromise) { + language.examplesPromise = getFileContents(language.examplesPath); + } + language.examplesPromise.then(function (contents) { + examples[id].innerHTML = buildContentsHeader(id) + contents; + + /** @type {HTMLElement} */ + var container = examples[id]; + container.innerHTML = buildContentsHeader(id) + contents; + + // the current language might be an extension of a language + // so to be safe, we explicitly add a dependency to the current language + $$('pre', container).forEach(/** @param {HTMLElement} pre */function (pre) { + var dependencies = (pre.getAttribute('data-dependencies') || '').trim(); + dependencies = dependencies ? dependencies + ',' + id : id; + pre.setAttribute('data-dependencies', dependencies); + }); + Prism.highlightAllUnder(container); + }); + } else { + examples[id].innerHTML = ''; + } + } }()); diff --git a/assets/img/logo-mysql.png b/assets/img/logo-mysql.png new file mode 100644 index 0000000000..d6f1328045 Binary files /dev/null and b/assets/img/logo-mysql.png differ diff --git a/assets/style.css b/assets/style.css index e86e07409a..0ad8a28c43 100644 --- a/assets/style.css +++ b/assets/style.css @@ -75,11 +75,13 @@ p { } section h1, -h2 { +h2, +h3 { margin: 1em 0 .3em; } -h2 { +h2, +h3 { font-weight: normal; } @@ -110,9 +112,12 @@ pre { overflow: auto; } -pre > code.highlight { +mark { outline: .4em solid red; outline-offset: .4em; + margin: .4em 0; + background-color: transparent; + display: inline-block; } header, @@ -127,8 +132,9 @@ header, footer { padding: 30px -webkit-calc(50% - 450px); /* Workaround for bug */ padding: 30px calc(50% - 450px); color: white; - text-shadow: 0 -1px 2px black; - background: url(img/spectrum.png) fixed; + text-shadow: 0 -1px 2px black, 0 0 4px black, + 0 -1px 0 black, 0 1px 0 black, -1px 0 0 black, 1px 0 0 black; + background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)), url(img/spectrum.png) fixed; } header:before, @@ -141,10 +147,6 @@ footer:before { background-repeat: repeat-x; background-image: linear-gradient(45deg, transparent 34%, white 34%, white 66%, transparent 66%), linear-gradient(135deg, transparent 34%, white 34%, white 66%, transparent 66%); -} - -header { - } header .intro, @@ -190,21 +192,23 @@ header { } #features { - width: 66em; - margin-top: 2em; - font-size: 80%; + margin-top: 1.6em; } #features li { - margin: 0 0 2em 0; + margin: 0 0 1.6em 0; list-style: none; display: inline-block; - width: 27em; + width: 49%; + box-sizing: border-box; vertical-align: top; } #features li:nth-child(odd) { - margin-right: 5em; + padding-right: 2em; + } + #features li:nth-child(even) { + padding-left: 2em; } #features li:before { @@ -212,14 +216,14 @@ header { float: left; margin-left: -.8em; color: #7fab14; - font-size: 400%; + font-size: 320%; line-height: 1; } #features li strong { display: block; margin-bottom: .1em; - font-size: 200%; + font-size: 160%; } header .download-button { @@ -231,10 +235,11 @@ header { position: relative; z-index: 1; float: right; - margin-right: -1em; + margin-right: -9em; text-align: center; text-transform: uppercase; letter-spacing: .2em; + text-shadow: 0 -1px 2px black; } #theme > p { @@ -279,6 +284,7 @@ header { #theme > input { position: absolute; + left: 0; clip: rect(0,0,0,0); } @@ -286,11 +292,85 @@ header { background: #7fab14; } + @media (max-width: 1300px) and (min-width: 1051px) { + #theme { + position: relative; + z-index: 1; + float: left; + margin: 1em 0; + width: 100%; + } + #theme + * { + clear: both; + } + + #theme > p { + margin-top: .5em; + } + + #theme > label { + float: left; + font-size: 82.6%; + } + + #theme > label:before { + display: none; + } + + #theme > label:nth-of-type(n+2) { + margin-top: 0; + } + } + + @media (max-width: 1050px) { + #theme { + position: relative; + z-index: 1; + float: left; + margin: 1em 0; + } + #theme + * { + clear: both; + } + + #theme > p { + left: inherit; + right: -1em; + } + + #theme > label { + float: left; + } + + #theme > label:before { + display: none; + } + + #theme > label:nth-of-type(n+2) { + margin-top: 0; + } + #theme > label:nth-of-type(n+5) { + margin-top: -2.5em; + } + #theme > label:nth-of-type(4n+1) { + margin-left: 12.5em; + } + } + + @media (max-width: 800px) { + #theme > label:nth-of-type(4) { + margin-right: 4em; + } + #theme > label:nth-of-type(4n+1) { + margin-left: 4em; + } + } + + footer { margin-top: 2em; background-position: bottom; color: white; - text-shadow: 0 -1px 2px black; } footer:before { @@ -366,6 +446,12 @@ footer { #toc li { list-style: none; + line-height: 1.2; + padding: .2em 0; + } + + #toc li a { + padding: .2em 0; } #logo:before { @@ -431,12 +517,3 @@ ul.plugin-list { ul.plugin-list > li > div { margin-bottom: .5em; } - -/* - * Fix for Toolbar's overflow issue - */ - -div.code-toolbar { - display: block; - overflow: auto; -} diff --git a/assets/templates/header-main.html b/assets/templates/header-main.html index 2db06c85ec..be01eeb48f 100644 --- a/assets/templates/header-main.html +++ b/assets/templates/header-main.html @@ -4,7 +4,7 @@

    Prism

    Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. - It’s used in thousands of websites, including some of those you visit daily. + It’s used in millions of websites, including some of those you visit daily.

    )*>/.source + ].join('|') + ')'; + + var IDInside = { + 'markup': { + pattern: /(^<)[\s\S]+(?=>$)/, + lookbehind: true, + alias: ['language-markup', 'language-html', 'language-xml'], + inside: Prism.languages.markup + } + }; + + /** + * @param {string} source + * @param {string} flags + * @returns {RegExp} + */ + function withID(source, flags) { + return RegExp(source.replace(//g, function () { return ID; }), flags); + } + + Prism.languages.dot = { + 'comment': { + pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m, + greedy: true + }, + 'graph-name': { + pattern: withID(/(\b(?:digraph|graph|subgraph)[ \t\r\n]+)/.source, 'i'), + lookbehind: true, + greedy: true, + alias: 'class-name', + inside: IDInside + }, + 'attr-value': { + pattern: withID(/(=[ \t\r\n]*)/.source), + lookbehind: true, + greedy: true, + inside: IDInside + }, + 'attr-name': { + pattern: withID(/([\[;, \t\r\n])(?=[ \t\r\n]*=)/.source), + lookbehind: true, + greedy: true, + inside: IDInside + }, + 'keyword': /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i, + 'compass-point': { + pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/, + lookbehind: true, + alias: 'builtin' + }, + 'node': { + pattern: withID(/(^|[^-.\w\x80-\uFFFF\\])/.source), + lookbehind: true, + greedy: true, + inside: IDInside + }, + 'operator': /[=:]|-[->]/, + 'punctuation': /[\[\]{};,]/ + }; + + Prism.languages.gv = Prism.languages.dot; + +}(Prism)); diff --git a/components/prism-dot.min.js b/components/prism-dot.min.js new file mode 100644 index 0000000000..457ed17e2c --- /dev/null +++ b/components/prism-dot.min.js @@ -0,0 +1 @@ +!function(e){var n="(?:"+["[a-zA-Z_\\x80-\\uFFFF][\\w\\x80-\\uFFFF]*","-?(?:\\.\\d+|\\d+(?:\\.\\d*)?)",'"[^"\\\\]*(?:\\\\[^][^"\\\\]*)*"',"<(?:[^<>]|(?!\x3c!--)<(?:[^<>\"']|\"[^\"]*\"|'[^']*')+>|\x3c!--(?:[^-]|-(?!->))*--\x3e)*>"].join("|")+")",a={markup:{pattern:/(^<)[\s\S]+(?=>$)/,lookbehind:!0,alias:["language-markup","language-html","language-xml"],inside:e.languages.markup}};function r(e,a){return RegExp(e.replace(//g,function(){return n}),a)}e.languages.dot={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,greedy:!0},"graph-name":{pattern:r("(\\b(?:digraph|graph|subgraph)[ \t\r\n]+)","i"),lookbehind:!0,greedy:!0,alias:"class-name",inside:a},"attr-value":{pattern:r("(=[ \t\r\n]*)"),lookbehind:!0,greedy:!0,inside:a},"attr-name":{pattern:r("([\\[;, \t\r\n])(?=[ \t\r\n]*=)"),lookbehind:!0,greedy:!0,inside:a},keyword:/\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,"compass-point":{pattern:/(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/,lookbehind:!0,alias:"builtin"},node:{pattern:r("(^|[^-.\\w\\x80-\\uFFFF\\\\])"),lookbehind:!0,greedy:!0,inside:a},operator:/[=:]|-[->]/,punctuation:/[\[\]{};,]/},e.languages.gv=e.languages.dot}(Prism); \ No newline at end of file diff --git a/components/prism-ebnf.js b/components/prism-ebnf.js index 0d9fde08bf..2a0717432c 100644 --- a/components/prism-ebnf.js +++ b/components/prism-ebnf.js @@ -11,7 +11,7 @@ Prism.languages.ebnf = { }, 'definition': { - pattern: /^(\s*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im, + pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im, lookbehind: true, alias: ['rule', 'keyword'] }, diff --git a/components/prism-ebnf.min.js b/components/prism-ebnf.min.js index 55889a6824..34b8d157ff 100644 --- a/components/prism-ebnf.min.js +++ b/components/prism-ebnf.min.js @@ -1 +1 @@ -Prism.languages.ebnf={comment:/\(\*[\s\S]*?\*\)/,string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},special:{pattern:/\?[^?\r\n]*\?/,greedy:!0,alias:"class-name"},definition:{pattern:/^(\s*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,lookbehind:!0,alias:["rule","keyword"]},rule:/\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,punctuation:/\([:/]|[:/]\)|[.,;()[\]{}]/,operator:/[-=|*/!]/}; \ No newline at end of file +Prism.languages.ebnf={comment:/\(\*[\s\S]*?\*\)/,string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},special:{pattern:/\?[^?\r\n]*\?/,greedy:!0,alias:"class-name"},definition:{pattern:/^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,lookbehind:!0,alias:["rule","keyword"]},rule:/\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,punctuation:/\([:/]|[:/]\)|[.,;()[\]{}]/,operator:/[-=|*/!]/}; \ No newline at end of file diff --git a/components/prism-editorconfig.js b/components/prism-editorconfig.js index c7c68b0460..297b041769 100644 --- a/components/prism-editorconfig.js +++ b/components/prism-editorconfig.js @@ -1,23 +1,24 @@ Prism.languages.editorconfig = { - // https://editorconfig-specification.readthedocs.io/en/latest/ + // https://editorconfig-specification.readthedocs.io 'comment': /[;#].*/, 'section': { - pattern: /(^[ \t]*)\[.+]/m, + pattern: /(^[ \t]*)\[.+\]/m, lookbehind: true, - alias: 'keyword', + alias: 'selector', inside: { 'regex': /\\\\[\[\]{},!?.*]/, // Escape special characters with '\\' 'operator': /[!?]|\.\.|\*{1,2}/, 'punctuation': /[\[\]{},]/ } }, - 'property': { + 'key': { pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m, - lookbehind: true + lookbehind: true, + alias: 'attr-name' }, 'value': { pattern: /=.*/, - alias: 'string', + alias: 'attr-value', inside: { 'punctuation': /^=/ } diff --git a/components/prism-editorconfig.min.js b/components/prism-editorconfig.min.js index fd7ddd72c4..d98df1685d 100644 --- a/components/prism-editorconfig.min.js +++ b/components/prism-editorconfig.min.js @@ -1 +1 @@ -Prism.languages.editorconfig={comment:/[;#].*/,section:{pattern:/(^[ \t]*)\[.+]/m,lookbehind:!0,alias:"keyword",inside:{regex:/\\\\[\[\]{},!?.*]/,operator:/[!?]|\.\.|\*{1,2}/,punctuation:/[\[\]{},]/}},property:{pattern:/(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,lookbehind:!0},value:{pattern:/=.*/,alias:"string",inside:{punctuation:/^=/}}}; \ No newline at end of file +Prism.languages.editorconfig={comment:/[;#].*/,section:{pattern:/(^[ \t]*)\[.+\]/m,lookbehind:!0,alias:"selector",inside:{regex:/\\\\[\[\]{},!?.*]/,operator:/[!?]|\.\.|\*{1,2}/,punctuation:/[\[\]{},]/}},key:{pattern:/(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/=.*/,alias:"attr-value",inside:{punctuation:/^=/}}}; \ No newline at end of file diff --git a/components/prism-eiffel.js b/components/prism-eiffel.js index 7afd7eeada..a3c3ce9dc0 100644 --- a/components/prism-eiffel.js +++ b/components/prism-eiffel.js @@ -13,19 +13,16 @@ Prism.languages.eiffel = { }, // Single-line string { - pattern: /"(?:%\s*\n\s*%|%.|[^%"\r\n])*"/, + pattern: /"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/, greedy: true } ], // normal char | special char | char code 'char': /'(?:%.|[^%'\r\n])+'/, - 'keyword': /\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i, - 'boolean': /\b(?:True|False)\b/i, + 'keyword': /\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i, + 'boolean': /\b(?:False|True)\b/i, // Convention: class-names are always all upper-case characters - 'class-name': { - 'pattern': /\b[A-Z][\dA-Z_]*\b/, - 'alias': 'builtin' - }, + 'class-name': /\b[A-Z][\dA-Z_]*\b/, 'number': [ // hexa | octal | bin /\b0[xcb][\da-f](?:_*[\da-f])*\b/i, diff --git a/components/prism-eiffel.min.js b/components/prism-eiffel.min.js index 43f7c14b02..17513cf5db 100644 --- a/components/prism-eiffel.min.js +++ b/components/prism-eiffel.min.js @@ -1 +1 @@ -Prism.languages.eiffel={comment:/--.*/,string:[{pattern:/"([^[]*)\[[\s\S]*?\]\1"/,greedy:!0},{pattern:/"([^{]*)\{[\s\S]*?\}\1"/,greedy:!0},{pattern:/"(?:%\s*\n\s*%|%.|[^%"\r\n])*"/,greedy:!0}],char:/'(?:%.|[^%'\r\n])+'/,keyword:/\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,boolean:/\b(?:True|False)\b/i,"class-name":{pattern:/\b[A-Z][\dA-Z_]*\b/,alias:"builtin"},number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}; \ No newline at end of file +Prism.languages.eiffel={comment:/--.*/,string:[{pattern:/"([^[]*)\[[\s\S]*?\]\1"/,greedy:!0},{pattern:/"([^{]*)\{[\s\S]*?\}\1"/,greedy:!0},{pattern:/"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/,greedy:!0}],char:/'(?:%.|[^%'\r\n])+'/,keyword:/\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,boolean:/\b(?:False|True)\b/i,"class-name":/\b[A-Z][\dA-Z_]*\b/,number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}; \ No newline at end of file diff --git a/components/prism-ejs.js b/components/prism-ejs.js index 047f0dd587..cd590b46ef 100644 --- a/components/prism-ejs.js +++ b/components/prism-ejs.js @@ -12,12 +12,12 @@ } }; - Prism.hooks.add('before-tokenize', function(env) { + Prism.hooks.add('before-tokenize', function (env) { var ejsPattern = /<%(?!%)[\s\S]+?%>/g; Prism.languages['markup-templating'].buildPlaceholders(env, 'ejs', ejsPattern); }); - Prism.hooks.add('after-tokenize', function(env) { + Prism.hooks.add('after-tokenize', function (env) { Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ejs'); }); diff --git a/components/prism-elixir.js b/components/prism-elixir.js index 793323c4ea..23fafc0514 100644 --- a/components/prism-elixir.js +++ b/components/prism-elixir.js @@ -1,5 +1,15 @@ Prism.languages.elixir = { - 'comment': /#.*/m, + 'doc': { + pattern: /@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/, + inside: { + 'attribute': /^@\w+/, + 'string': /['"][\s\S]+/ + } + }, + 'comment': { + pattern: /#.*/, + greedy: true + }, // ~r"""foo""" (multi-line), ~r'''foo''' (multi-line), ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r 'regex': { pattern: /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/, @@ -36,14 +46,12 @@ Prism.languages.elixir = { lookbehind: true, alias: 'symbol' }, - // Look-ahead prevents bad highlighting of the :: operator - 'attr-name': /\w+\??:(?!:)/, - 'capture': { - // Look-behind prevents bad highlighting of the && operator - pattern: /(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/, - lookbehind: true, - alias: 'function' + 'module': { + pattern: /\b[A-Z]\w*\b/, + alias: 'class-name' }, + // Look-ahead prevents bad highlighting of the :: operator + 'attr-name': /\b\w+\??:(?!:)/, 'argument': { // Look-behind prevents bad highlighting of the && operator pattern: /(^|[^&])&\d+/, @@ -54,9 +62,10 @@ Prism.languages.elixir = { pattern: /@\w+/, alias: 'variable' }, + 'function': /\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/, 'number': /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i, - 'keyword': /\b(?:after|alias|and|case|catch|cond|def(?:callback|exception|impl|module|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|require|rescue|try|unless|use|when)\b/, - 'boolean': /\b(?:true|false|nil)\b/, + 'keyword': /\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/, + 'boolean': /\b(?:false|nil|true)\b/, 'operator': [ /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/, { @@ -73,7 +82,7 @@ Prism.languages.elixir = { 'punctuation': /<<|>>|[.,%\[\]{}()]/ }; -Prism.languages.elixir.string.forEach(function(o) { +Prism.languages.elixir.string.forEach(function (o) { o.inside = { 'interpolation': { pattern: /#\{[^}]+\}/, diff --git a/components/prism-elixir.min.js b/components/prism-elixir.min.js index 8882992d31..ec0d974d78 100644 --- a/components/prism-elixir.min.js +++ b/components/prism-elixir.min.js @@ -1 +1 @@ -Prism.languages.elixir={comment:/#.*/m,regex:{pattern:/~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,greedy:!0},string:[{pattern:/~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,greedy:!0,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,greedy:!0,inside:{}},{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},"attr-name":/\w+\??:(?!:)/,capture:{pattern:/(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/,lookbehind:!0,alias:"function"},argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@\w+/,alias:"variable"},number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|exception|impl|module|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|require|rescue|try|unless|use|when)\b/,boolean:/\b(?:true|false|nil)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},Prism.languages.elixir.string.forEach(function(e){e.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:Prism.languages.elixir}}}}); \ No newline at end of file +Prism.languages.elixir={doc:{pattern:/@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,inside:{attribute:/^@\w+/,string:/['"][\s\S]+/}},comment:{pattern:/#.*/,greedy:!0},regex:{pattern:/~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,greedy:!0},string:[{pattern:/~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,greedy:!0,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,greedy:!0,inside:{}},{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},module:{pattern:/\b[A-Z]\w*\b/,alias:"class-name"},"attr-name":/\b\w+\??:(?!:)/,argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@\w+/,alias:"variable"},function:/\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,boolean:/\b(?:false|nil|true)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},Prism.languages.elixir.string.forEach(function(e){e.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:Prism.languages.elixir}}}}); \ No newline at end of file diff --git a/components/prism-elm.js b/components/prism-elm.js index 5c9b095151..5c8a559a81 100644 --- a/components/prism-elm.js +++ b/components/prism-elm.js @@ -1,34 +1,35 @@ Prism.languages.elm = { - comment: /--.*|{-[\s\S]*?-}/, - char: { - pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/, + 'comment': /--.*|\{-[\s\S]*?-\}/, + 'char': { + pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/, greedy: true }, - string: [ + 'string': [ { // Multiline strings are wrapped in triple ". Quotes may appear unescaped. pattern: /"""[\s\S]*?"""/, greedy: true }, { - pattern: /"(?:[^\\"\r\n]|\\(?:[abfnrtv\\"]|\d+|x[0-9a-fA-F]+))*"/, + pattern: /"(?:[^\\"\r\n]|\\.)*"/, greedy: true } ], - import_statement: { + 'import-statement': { // The imported or hidden names are not included in this import // statement. This is because we want to highlight those exactly like // we do for the names in the program. - pattern: /^\s*import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m, + pattern: /(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m, + lookbehind: true, inside: { - keyword: /\b(?:import|as|exposing)\b/ + 'keyword': /\b(?:as|exposing|import)\b/ } }, - keyword: /\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/, + 'keyword': /\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/, // These are builtin variables only. Constructors are highlighted later as a constant. - builtin: /\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/, + 'builtin': /\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/, // decimal integers and floating point numbers | hexadecimal integers - number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i, + 'number': /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i, // Most of this is needed because of the meaning of a single '.'. // If it stands alone freely, it is the function composition. // It may also be a separator between a module name and an identifier => no @@ -36,9 +37,9 @@ Prism.languages.elm = { // operator too. // Valid operator characters in 0.18: +-/*=.$<>:&|^?%#@~! // Ref: https://groups.google.com/forum/#!msg/elm-dev/0AHSnDdkSkQ/E0SVU70JEQAJ - operator: /\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/, + 'operator': /\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/, // In Elm, nearly everything is a variable, do not highlight these. - hvariable: /\b(?:[A-Z]\w*\.)*[a-z]\w*\b/, - constant: /\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/, - punctuation: /[{}[\]|(),.:]/ + 'hvariable': /\b(?:[A-Z]\w*\.)*[a-z]\w*\b/, + 'constant': /\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/, + 'punctuation': /[{}[\]|(),.:]/ }; diff --git a/components/prism-elm.min.js b/components/prism-elm.min.js index 4e0838c704..681418de59 100644 --- a/components/prism-elm.min.js +++ b/components/prism-elm.min.js @@ -1 +1 @@ -Prism.languages.elm={comment:/--.*|{-[\s\S]*?-}/,char:{pattern:/'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,greedy:!0},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:[^\\"\r\n]|\\(?:[abfnrtv\\"]|\d+|x[0-9a-fA-F]+))*"/,greedy:!0}],import_statement:{pattern:/^\s*import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,inside:{keyword:/\b(?:import|as|exposing)\b/}},keyword:/\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,builtin:/\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,hvariable:/\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,constant:/\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,punctuation:/[{}[\]|(),.:]/}; \ No newline at end of file +Prism.languages.elm={comment:/--.*|\{-[\s\S]*?-\}/,char:{pattern:/'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/,greedy:!0},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:[^\\"\r\n]|\\.)*"/,greedy:!0}],"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,lookbehind:!0,inside:{keyword:/\b(?:as|exposing|import)\b/}},keyword:/\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,builtin:/\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,hvariable:/\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,constant:/\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,punctuation:/[{}[\]|(),.:]/}; \ No newline at end of file diff --git a/components/prism-erb.js b/components/prism-erb.js index 5e58528b3a..21dd7c228d 100644 --- a/components/prism-erb.js +++ b/components/prism-erb.js @@ -1,19 +1,24 @@ (function (Prism) { - Prism.languages.erb = Prism.languages.extend('ruby', {}); - Prism.languages.insertBefore('erb', 'comment', { + Prism.languages.erb = { 'delimiter': { - pattern: /^<%=?|%>$/, + pattern: /^(\s*)<%=?|%>(?=\s*$)/, + lookbehind: true, alias: 'punctuation' + }, + 'ruby': { + pattern: /\s*\S[\s\S]*/, + alias: 'language-ruby', + inside: Prism.languages.ruby } - }); + }; - Prism.hooks.add('before-tokenize', function(env) { - var erbPattern = /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s[\s\S]*?^=end)+?%>/gm; + Prism.hooks.add('before-tokenize', function (env) { + var erbPattern = /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g; Prism.languages['markup-templating'].buildPlaceholders(env, 'erb', erbPattern); }); - Prism.hooks.add('after-tokenize', function(env) { + Prism.hooks.add('after-tokenize', function (env) { Prism.languages['markup-templating'].tokenizePlaceholders(env, 'erb'); }); diff --git a/components/prism-erb.min.js b/components/prism-erb.min.js index 25d3c27b6b..9e38fee156 100644 --- a/components/prism-erb.min.js +++ b/components/prism-erb.min.js @@ -1 +1 @@ -!function(n){n.languages.erb=n.languages.extend("ruby",{}),n.languages.insertBefore("erb","comment",{delimiter:{pattern:/^<%=?|%>$/,alias:"punctuation"}}),n.hooks.add("before-tokenize",function(e){n.languages["markup-templating"].buildPlaceholders(e,"erb",/<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s[\s\S]*?^=end)+?%>/gm)}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"erb")})}(Prism); \ No newline at end of file +!function(n){n.languages.erb={delimiter:{pattern:/^(\s*)<%=?|%>(?=\s*$)/,lookbehind:!0,alias:"punctuation"},ruby:{pattern:/\s*\S[\s\S]*/,alias:"language-ruby",inside:n.languages.ruby}},n.hooks.add("before-tokenize",function(e){n.languages["markup-templating"].buildPlaceholders(e,"erb",/<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g)}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"erb")})}(Prism); \ No newline at end of file diff --git a/components/prism-erlang.js b/components/prism-erlang.js index 286c8a5cc7..fba6254b2c 100644 --- a/components/prism-erlang.js +++ b/components/prism-erlang.js @@ -12,12 +12,12 @@ Prism.languages.erlang = { pattern: /'(?:\\.|[^\\'\r\n])+'/, alias: 'atom' }, - 'boolean': /\b(?:true|false)\b/, - 'keyword': /\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/, + 'boolean': /\b(?:false|true)\b/, + 'keyword': /\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/, 'number': [ /\$\\?./, - /\d+#[a-z0-9]+/i, - /(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i + /\b\d+#[a-z0-9]+/i, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i ], 'function': /\b[a-z][\w@]*(?=\()/, 'variable': { @@ -26,7 +26,7 @@ Prism.languages.erlang = { lookbehind: true }, 'operator': [ - /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/, + /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/, { // We don't want to match << pattern: /(^|[^<])<(?!<)/, @@ -41,4 +41,4 @@ Prism.languages.erlang = { 'atom': /\b[a-z][\w@]*/, 'punctuation': /[()[\]{}:;,.#|]|<<|>>/ -}; \ No newline at end of file +}; diff --git a/components/prism-erlang.min.js b/components/prism-erlang.min.js index e9482520bc..7d041ab6f2 100644 --- a/components/prism-erlang.min.js +++ b/components/prism-erlang.min.js @@ -1 +1 @@ -Prism.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\d+#[a-z0-9]+/i,/(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}; \ No newline at end of file +Prism.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:false|true)\b/,keyword:/\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/,number:[/\$\\?./,/\b\d+#[a-z0-9]+/i,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}; \ No newline at end of file diff --git a/components/prism-excel-formula.js b/components/prism-excel-formula.js index c5444d8e47..5b298ac0e1 100644 --- a/components/prism-excel-formula.js +++ b/components/prism-excel-formula.js @@ -58,7 +58,7 @@ Prism.languages['excel-formula'] = { alias: 'property' }, 'number': /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i, - 'boolean': /\b(?:TRUE|FALSE)\b/i, + 'boolean': /\b(?:FALSE|TRUE)\b/i, 'operator': /[-+*/^%=&,]|<[=>]?|>=?/, 'punctuation': /[[\]();{}|]/ }; diff --git a/components/prism-excel-formula.min.js b/components/prism-excel-formula.min.js index c165540253..1f012d96f3 100644 --- a/components/prism-excel-formula.min.js +++ b/components/prism-excel-formula.min.js @@ -1 +1 @@ -Prism.languages["excel-formula"]={comment:{pattern:/(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},reference:{pattern:/(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,greedy:!0,alias:"string",inside:{operator:/!$/,punctuation:/'/,sheet:{pattern:/[^[\]]+$/,alias:"function"},file:{pattern:/\[[^[\]]+\]$/,inside:{punctuation:/[[\]]/}},path:/[\s\S]+/}},"function-name":{pattern:/\b[A-Z]\w*(?=\()/i,alias:"keyword"},range:{pattern:/\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,alias:"property",inside:{operator:/:/,cell:/\$?[A-Z]+\$?\d+/i,column:/\$?[A-Z]+/i,row:/\$?\d+/}},cell:{pattern:/\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,alias:"property"},number:/(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,boolean:/\b(?:TRUE|FALSE)\b/i,operator:/[-+*/^%=&,]|<[=>]?|>=?/,punctuation:/[[\]();{}|]/},Prism.languages.xlsx=Prism.languages.xls=Prism.languages["excel-formula"]; \ No newline at end of file +Prism.languages["excel-formula"]={comment:{pattern:/(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},reference:{pattern:/(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,greedy:!0,alias:"string",inside:{operator:/!$/,punctuation:/'/,sheet:{pattern:/[^[\]]+$/,alias:"function"},file:{pattern:/\[[^[\]]+\]$/,inside:{punctuation:/[[\]]/}},path:/[\s\S]+/}},"function-name":{pattern:/\b[A-Z]\w*(?=\()/i,alias:"keyword"},range:{pattern:/\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,alias:"property",inside:{operator:/:/,cell:/\$?[A-Z]+\$?\d+/i,column:/\$?[A-Z]+/i,row:/\$?\d+/}},cell:{pattern:/\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,alias:"property"},number:/(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,boolean:/\b(?:FALSE|TRUE)\b/i,operator:/[-+*/^%=&,]|<[=>]?|>=?/,punctuation:/[[\]();{}|]/},Prism.languages.xlsx=Prism.languages.xls=Prism.languages["excel-formula"]; \ No newline at end of file diff --git a/components/prism-factor.js b/components/prism-factor.js index 3e555c1d8c..8db7bd3a9b 100644 --- a/components/prism-factor.js +++ b/components/prism-factor.js @@ -1,7 +1,7 @@ (function (Prism) { var comment_inside = { - 'function': /\b(?:TODOS?|FIX(?:MES?)?|NOTES?|BUGS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/ + 'function': /\b(?:BUGS?|FIX(?:MES?)?|NOTES?|TODOS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/ }; var string_inside = { 'number': /\\[^\s']|%\w/ @@ -84,7 +84,7 @@ // R/ regexp?\/\\/ 'regexp': { - pattern: /(^|\s)R\/\s+(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/, + pattern: /(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/, lookbehind: true, alias: 'number', inside: { @@ -124,7 +124,7 @@ 'number': string_inside.number, // trailing semicolon on its own line 'semicolon-or-setlocal': { - pattern: /((?:\n|\r\n)\s*);(?=\s|$)/, + pattern: /([\r\n][ \t]*);(?=\s|$)/, lookbehind: true, alias: 'function' } @@ -182,7 +182,7 @@ 'stack-effect-delimiter': [ { // opening parenthesis - pattern: /(^|\s)(?:call|execute|eval)?\((?=\s)/, + pattern: /(^|\s)(?:call|eval|execute)?\((?=\s)/, lookbehind: true, alias: 'operator' }, @@ -265,7 +265,7 @@ see */ 'conventionally-named-word': { - pattern: /(^|\s)(?!")(?:(?:set|change|with|new)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/, + pattern: /(^|\s)(?!")(?:(?:change|new|set|with)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/, lookbehind: true, alias: 'keyword' }, @@ -346,7 +346,7 @@ }; var escape = function (str) { - return (str+'').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1'); + return (str + '').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1'); }; var arrToWordsRegExp = function (arr) { @@ -375,7 +375,7 @@ }; Object.keys(builtins).forEach(function (k) { - factor[k].pattern = arrToWordsRegExp( builtins[k] ); + factor[k].pattern = arrToWordsRegExp(builtins[k]); }); var combinators = [ @@ -400,4 +400,4 @@ Prism.languages.factor = factor; -})(Prism); +}(Prism)); diff --git a/components/prism-factor.min.js b/components/prism-factor.min.js index b8a948f6e5..58a01e35ba 100644 --- a/components/prism-factor.min.js +++ b/components/prism-factor.min.js @@ -1 +1 @@ -!function(e){var t={function:/\b(?:TODOS?|FIX(?:MES?)?|NOTES?|BUGS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/},s={number:/\\[^\s']|%\w/},i={comment:[{pattern:/(^|\s)(?:! .*|!$)/,lookbehind:!0,inside:t},{pattern:/(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,lookbehind:!0,greedy:!0,inside:t},{pattern:/(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,inside:t}],number:[{pattern:/(^|\s)[+-]?\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)-\d+-\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,lookbehind:!0}],regexp:{pattern:/(^|\s)R\/\s+(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,lookbehind:!0,alias:"number",inside:{variable:/\\\S/,keyword:/[+?*\[\]^$(){}.|]/,operator:{pattern:/(\/)[idmsr]+(?:-[idmsr]+)?/,lookbehind:!0}}},boolean:{pattern:/(^|\s)[tf](?=\s|$)/,lookbehind:!0},"custom-string":{pattern:/(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:/\\\S|%\w|\//}},"multiline-string":[{pattern:/(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:s.number,"semicolon-or-setlocal":{pattern:/((?:\n|\r\n)\s*);(?=\s|$)/,lookbehind:!0,alias:"function"}}},{pattern:/(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:s},{pattern:/(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:s}],"special-using":{pattern:/(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,lookbehind:!0,alias:"function",inside:{string:{pattern:/(\s)[^:\s]+/,lookbehind:!0}}},"stack-effect-delimiter":[{pattern:/(^|\s)(?:call|execute|eval)?\((?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)--(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\)(?=\s|$)/,lookbehind:!0,alias:"operator"}],combinators:{pattern:null,lookbehind:!0,alias:"keyword"},"kernel-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"sequences-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"math-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"constructor-word":{pattern:/(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,lookbehind:!0,alias:"keyword"},"other-builtin-syntax":{pattern:null,lookbehind:!0,alias:"operator"},"conventionally-named-word":{pattern:/(^|\s)(?!")(?:(?:set|change|with|new)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,lookbehind:!0,alias:"keyword"},"colon-syntax":{pattern:/(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"function"},"semicolon-or-setlocal":{pattern:/(\s)(?:;|:>)(?=\s|$)/,lookbehind:!0,alias:"function"},"curly-brace-literal-delimiter":[{pattern:/(^|\s)[a-z]*\{(?=\s)/i,lookbehind:!0,alias:"operator"},{pattern:/(\s)\}(?=\s|$)/,lookbehind:!0,alias:"operator"}],"quotation-delimiter":[{pattern:/(^|\s)\[(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\](?=\s|$)/,lookbehind:!0,alias:"operator"}],"normal-word":{pattern:/(^|\s)[^"\s]\S*(?=\s|$)/,lookbehind:!0},string:{pattern:/"(?:\\\S|[^"\\])*"/,greedy:!0,inside:s}},n=function(e){return(e+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")},r=function(e){return new RegExp("(^|\\s)(?:"+e.map(n).join("|")+")(?=\\s|$)")},a={"kernel-builtin":["or","2nipd","4drop","tuck","wrapper","nip","wrapper?","callstack>array","die","dupd","callstack","callstack?","3dup","hashcode","pick","4nip","build",">boolean","nipd","clone","5nip","eq?","?","=","swapd","2over","clear","2dup","get-retainstack","not","tuple?","dup","3nipd","call","-rotd","object","drop","assert=","assert?","-rot","execute","boa","get-callstack","curried?","3drop","pickd","overd","over","roll","3nip","swap","and","2nip","rotd","throw","(clone)","hashcode*","spin","reach","4dup","equal?","get-datastack","assert","2drop","","boolean?","identity-hashcode","identity-tuple?","null","composed?","new","5drop","rot","-roll","xor","identity-tuple","boolean"],"other-builtin-syntax":["=======","recursive","flushable",">>","<<<<<<","M\\","B","PRIVATE>","\\","======","final","inline","delimiter","deprecated",">>>>>","<<<<<<<","parse-complex","malformed-complex","read-only",">>>>>>>","call-next-method","<<","foldable","$","$[","${"],"sequences-builtin":["member-eq?","mismatch","append","assert-sequence=","longer","repetition","clone-like","3sequence","assert-sequence?","last-index-from","reversed","index-from","cut*","pad-tail","join-as","remove-eq!","concat-as","but-last","snip","nths","nth","sequence","longest","slice?","","remove-nth","tail-slice","empty?","tail*","member?","virtual-sequence?","set-length","drop-prefix","iota","unclip","bounds-error?","unclip-last-slice","non-negative-integer-expected","non-negative-integer-expected?","midpoint@","longer?","?set-nth","?first","rest-slice","prepend-as","prepend","fourth","sift","subseq-start","new-sequence","?last","like","first4","1sequence","reverse","slice","virtual@","repetition?","set-last","index","4sequence","max-length","set-second","immutable-sequence","first2","first3","supremum","unclip-slice","suffix!","insert-nth","tail","3append","short","suffix","concat","flip","immutable?","reverse!","2sequence","sum","delete-all","indices","snip-slice","","check-slice","sequence?","head","append-as","halves","sequence=","collapse-slice","?second","slice-error?","product","bounds-check?","bounds-check","immutable","virtual-exemplar","harvest","remove","pad-head","last","set-fourth","cartesian-product","remove-eq","shorten","shorter","reversed?","shorter?","shortest","head-slice","pop*","tail-slice*","but-last-slice","iota?","append!","cut-slice","new-resizable","head-slice*","sequence-hashcode","pop","set-nth","?nth","second","join","immutable-sequence?","","3append-as","virtual-sequence","subseq?","remove-nth!","length","last-index","lengthen","assert-sequence","copy","move","third","first","tail?","set-first","prefix","bounds-error","","exchange","surround","cut","min-length","set-third","push-all","head?","subseq-start-from","delete-slice","rest","sum-lengths","head*","infimum","remove!","glue","slice-error","subseq","push","replace-slice","subseq-as","unclip-last"],"math-builtin":["number=","next-power-of-2","?1+","fp-special?","imaginary-part","float>bits","number?","fp-infinity?","bignum?","fp-snan?","denominator","gcd","*","+","fp-bitwise=","-","u>=","/",">=","bitand","power-of-2?","log2-expects-positive","neg?","<","log2",">","integer?","number","bits>double","2/","zero?","bits>float","float?","shift","ratio?","rect>","even?","ratio","fp-sign","bitnot",">fixnum","complex?","/i","integer>fixnum","/f","sgn",">bignum","next-float","u<","u>","mod","recip","rational",">float","2^","integer","fixnum?","neg","fixnum","sq","bignum",">rect","bit?","fp-qnan?","simple-gcd","complex","","real",">fraction","double>bits","bitor","rem","fp-nan-payload","real-part","log2-expects-positive?","prev-float","align","unordered?","float","fp-nan?","abs","bitxor","integer>fixnum-strict","u<=","odd?","<=","/mod",">integer","real?","rational?","numerator"]};Object.keys(a).forEach(function(e){i[e].pattern=r(a[e])});i.combinators.pattern=r(["2bi","while","2tri","bi*","4dip","both?","same?","tri@","curry","prepose","3bi","?if","tri*","2keep","3keep","curried","2keepd","when","2bi*","2tri*","4keep","bi@","keepdd","do","unless*","tri-curry","if*","loop","bi-curry*","when*","2bi@","2tri@","with","2with","either?","bi","until","3dip","3curry","tri-curry*","tri-curry@","bi-curry","keepd","compose","2dip","if","3tri","unless","tuple","keep","2curry","tri","most","while*","dip","composed","bi-curry@","find-last-from","trim-head-slice","map-as","each-from","none?","trim-tail","partition","if-empty","accumulate*","reject!","find-from","accumulate-as","collector-for-as","reject","map","map-sum","accumulate!","2each-from","follow","supremum-by","map!","unless-empty","collector","padding","reduce-index","replicate-as","infimum-by","trim-tail-slice","count","find-index","filter","accumulate*!","reject-as","map-integers","map-find","reduce","selector","interleave","2map","filter-as","binary-reduce","map-index-as","find","produce","filter!","replicate","cartesian-map","cartesian-each","find-index-from","map-find-last","3map-as","3map","find-last","selector-as","2map-as","2map-reduce","accumulate","each","each-index","accumulate*-as","when-empty","all?","collector-as","push-either","new-like","collector-for","2selector","push-if","2all?","map-reduce","3each","any?","trim-slice","2reduce","change-nth","produce-as","2each","trim","trim-head","cartesian-find","map-index","if-zero","each-integer","unless-zero","(find-integer)","when-zero","find-last-integer","(all-integers?)","times","(each-integer)","find-integer","all-integers?","unless-negative","if-positive","when-positive","when-negative","unless-positive","if-negative","case","2cleave","cond>quot","case>quot","3cleave","wrong-values","to-fixed-point","alist>quot","cond","cleave","call-effect","recursive-hashcode","spread","deep-spread>quot","2||","0||","n||","0&&","2&&","3||","1||","1&&","n&&","3&&","smart-unless*","keep-inputs","reduce-outputs","smart-when*","cleave>array","smart-with","smart-apply","smart-if","inputs/outputs","output>sequence-n","map-outputs","map-reduce-outputs","dropping","output>array","smart-map-reduce","smart-2map-reduce","output>array-n","nullary","inputsequence"]),e.languages.factor=i}(Prism); \ No newline at end of file +!function(e){var t={function:/\b(?:BUGS?|FIX(?:MES?)?|NOTES?|TODOS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/},s={number:/\\[^\s']|%\w/},i={comment:[{pattern:/(^|\s)(?:! .*|!$)/,lookbehind:!0,inside:t},{pattern:/(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,lookbehind:!0,greedy:!0,inside:t},{pattern:/(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,inside:t}],number:[{pattern:/(^|\s)[+-]?\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)-\d+-\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,lookbehind:!0}],regexp:{pattern:/(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,lookbehind:!0,alias:"number",inside:{variable:/\\\S/,keyword:/[+?*\[\]^$(){}.|]/,operator:{pattern:/(\/)[idmsr]+(?:-[idmsr]+)?/,lookbehind:!0}}},boolean:{pattern:/(^|\s)[tf](?=\s|$)/,lookbehind:!0},"custom-string":{pattern:/(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:/\\\S|%\w|\//}},"multiline-string":[{pattern:/(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:s.number,"semicolon-or-setlocal":{pattern:/([\r\n][ \t]*);(?=\s|$)/,lookbehind:!0,alias:"function"}}},{pattern:/(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:s},{pattern:/(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:s}],"special-using":{pattern:/(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,lookbehind:!0,alias:"function",inside:{string:{pattern:/(\s)[^:\s]+/,lookbehind:!0}}},"stack-effect-delimiter":[{pattern:/(^|\s)(?:call|eval|execute)?\((?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)--(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\)(?=\s|$)/,lookbehind:!0,alias:"operator"}],combinators:{pattern:null,lookbehind:!0,alias:"keyword"},"kernel-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"sequences-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"math-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"constructor-word":{pattern:/(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,lookbehind:!0,alias:"keyword"},"other-builtin-syntax":{pattern:null,lookbehind:!0,alias:"operator"},"conventionally-named-word":{pattern:/(^|\s)(?!")(?:(?:change|new|set|with)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,lookbehind:!0,alias:"keyword"},"colon-syntax":{pattern:/(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"function"},"semicolon-or-setlocal":{pattern:/(\s)(?:;|:>)(?=\s|$)/,lookbehind:!0,alias:"function"},"curly-brace-literal-delimiter":[{pattern:/(^|\s)[a-z]*\{(?=\s)/i,lookbehind:!0,alias:"operator"},{pattern:/(\s)\}(?=\s|$)/,lookbehind:!0,alias:"operator"}],"quotation-delimiter":[{pattern:/(^|\s)\[(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\](?=\s|$)/,lookbehind:!0,alias:"operator"}],"normal-word":{pattern:/(^|\s)[^"\s]\S*(?=\s|$)/,lookbehind:!0},string:{pattern:/"(?:\\\S|[^"\\])*"/,greedy:!0,inside:s}},n=function(e){return(e+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")},r=function(e){return new RegExp("(^|\\s)(?:"+e.map(n).join("|")+")(?=\\s|$)")},a={"kernel-builtin":["or","2nipd","4drop","tuck","wrapper","nip","wrapper?","callstack>array","die","dupd","callstack","callstack?","3dup","hashcode","pick","4nip","build",">boolean","nipd","clone","5nip","eq?","?","=","swapd","2over","clear","2dup","get-retainstack","not","tuple?","dup","3nipd","call","-rotd","object","drop","assert=","assert?","-rot","execute","boa","get-callstack","curried?","3drop","pickd","overd","over","roll","3nip","swap","and","2nip","rotd","throw","(clone)","hashcode*","spin","reach","4dup","equal?","get-datastack","assert","2drop","","boolean?","identity-hashcode","identity-tuple?","null","composed?","new","5drop","rot","-roll","xor","identity-tuple","boolean"],"other-builtin-syntax":["=======","recursive","flushable",">>","<<<<<<","M\\","B","PRIVATE>","\\","======","final","inline","delimiter","deprecated",">>>>>","<<<<<<<","parse-complex","malformed-complex","read-only",">>>>>>>","call-next-method","<<","foldable","$","$[","${"],"sequences-builtin":["member-eq?","mismatch","append","assert-sequence=","longer","repetition","clone-like","3sequence","assert-sequence?","last-index-from","reversed","index-from","cut*","pad-tail","join-as","remove-eq!","concat-as","but-last","snip","nths","nth","sequence","longest","slice?","","remove-nth","tail-slice","empty?","tail*","member?","virtual-sequence?","set-length","drop-prefix","iota","unclip","bounds-error?","unclip-last-slice","non-negative-integer-expected","non-negative-integer-expected?","midpoint@","longer?","?set-nth","?first","rest-slice","prepend-as","prepend","fourth","sift","subseq-start","new-sequence","?last","like","first4","1sequence","reverse","slice","virtual@","repetition?","set-last","index","4sequence","max-length","set-second","immutable-sequence","first2","first3","supremum","unclip-slice","suffix!","insert-nth","tail","3append","short","suffix","concat","flip","immutable?","reverse!","2sequence","sum","delete-all","indices","snip-slice","","check-slice","sequence?","head","append-as","halves","sequence=","collapse-slice","?second","slice-error?","product","bounds-check?","bounds-check","immutable","virtual-exemplar","harvest","remove","pad-head","last","set-fourth","cartesian-product","remove-eq","shorten","shorter","reversed?","shorter?","shortest","head-slice","pop*","tail-slice*","but-last-slice","iota?","append!","cut-slice","new-resizable","head-slice*","sequence-hashcode","pop","set-nth","?nth","second","join","immutable-sequence?","","3append-as","virtual-sequence","subseq?","remove-nth!","length","last-index","lengthen","assert-sequence","copy","move","third","first","tail?","set-first","prefix","bounds-error","","exchange","surround","cut","min-length","set-third","push-all","head?","subseq-start-from","delete-slice","rest","sum-lengths","head*","infimum","remove!","glue","slice-error","subseq","push","replace-slice","subseq-as","unclip-last"],"math-builtin":["number=","next-power-of-2","?1+","fp-special?","imaginary-part","float>bits","number?","fp-infinity?","bignum?","fp-snan?","denominator","gcd","*","+","fp-bitwise=","-","u>=","/",">=","bitand","power-of-2?","log2-expects-positive","neg?","<","log2",">","integer?","number","bits>double","2/","zero?","bits>float","float?","shift","ratio?","rect>","even?","ratio","fp-sign","bitnot",">fixnum","complex?","/i","integer>fixnum","/f","sgn",">bignum","next-float","u<","u>","mod","recip","rational",">float","2^","integer","fixnum?","neg","fixnum","sq","bignum",">rect","bit?","fp-qnan?","simple-gcd","complex","","real",">fraction","double>bits","bitor","rem","fp-nan-payload","real-part","log2-expects-positive?","prev-float","align","unordered?","float","fp-nan?","abs","bitxor","integer>fixnum-strict","u<=","odd?","<=","/mod",">integer","real?","rational?","numerator"]};Object.keys(a).forEach(function(e){i[e].pattern=r(a[e])});i.combinators.pattern=r(["2bi","while","2tri","bi*","4dip","both?","same?","tri@","curry","prepose","3bi","?if","tri*","2keep","3keep","curried","2keepd","when","2bi*","2tri*","4keep","bi@","keepdd","do","unless*","tri-curry","if*","loop","bi-curry*","when*","2bi@","2tri@","with","2with","either?","bi","until","3dip","3curry","tri-curry*","tri-curry@","bi-curry","keepd","compose","2dip","if","3tri","unless","tuple","keep","2curry","tri","most","while*","dip","composed","bi-curry@","find-last-from","trim-head-slice","map-as","each-from","none?","trim-tail","partition","if-empty","accumulate*","reject!","find-from","accumulate-as","collector-for-as","reject","map","map-sum","accumulate!","2each-from","follow","supremum-by","map!","unless-empty","collector","padding","reduce-index","replicate-as","infimum-by","trim-tail-slice","count","find-index","filter","accumulate*!","reject-as","map-integers","map-find","reduce","selector","interleave","2map","filter-as","binary-reduce","map-index-as","find","produce","filter!","replicate","cartesian-map","cartesian-each","find-index-from","map-find-last","3map-as","3map","find-last","selector-as","2map-as","2map-reduce","accumulate","each","each-index","accumulate*-as","when-empty","all?","collector-as","push-either","new-like","collector-for","2selector","push-if","2all?","map-reduce","3each","any?","trim-slice","2reduce","change-nth","produce-as","2each","trim","trim-head","cartesian-find","map-index","if-zero","each-integer","unless-zero","(find-integer)","when-zero","find-last-integer","(all-integers?)","times","(each-integer)","find-integer","all-integers?","unless-negative","if-positive","when-positive","when-negative","unless-positive","if-negative","case","2cleave","cond>quot","case>quot","3cleave","wrong-values","to-fixed-point","alist>quot","cond","cleave","call-effect","recursive-hashcode","spread","deep-spread>quot","2||","0||","n||","0&&","2&&","3||","1||","1&&","n&&","3&&","smart-unless*","keep-inputs","reduce-outputs","smart-when*","cleave>array","smart-with","smart-apply","smart-if","inputs/outputs","output>sequence-n","map-outputs","map-reduce-outputs","dropping","output>array","smart-map-reduce","smart-2map-reduce","output>array-n","nullary","inputsequence"]),e.languages.factor=i}(Prism); \ No newline at end of file diff --git a/components/prism-false.js b/components/prism-false.js new file mode 100644 index 0000000000..ad1e4943b1 --- /dev/null +++ b/components/prism-false.js @@ -0,0 +1,32 @@ +(function (Prism) { + /** + * Based on the manual by Wouter van Oortmerssen. + * + * @see {@link https://github.com/PrismJS/prism/issues/2801#issue-829717504} + */ + Prism.languages['false'] = { + 'comment': { + pattern: /\{[^}]*\}/ + }, + 'string': { + pattern: /"[^"]*"/, + greedy: true + }, + 'character-code': { + pattern: /'(?:[^\r]|\r\n?)/, + alias: 'number' + }, + 'assembler-code': { + pattern: /\d+`/, + alias: 'important' + }, + 'number': /\d+/, + 'operator': /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/, + 'punctuation': /\[|\]/, + 'variable': /[a-z]/, + 'non-standard': { + pattern: /[()?@\\^_`|~ßø]/,punctuation:/\[|\]/,variable:/[a-z]/,"non-standard":{pattern:/[()!=]=?|[-+*/%=]|\b(?:in|is)\b/, + 'operator': /&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/, }); delete Prism.languages['firestore-security-rules']['class-name']; @@ -20,7 +20,7 @@ Prism.languages.insertBefore('firestore-security-rules', 'keyword', { 'punctuation': /[.$(){}]/ } }, - 'punctuation': /[/]/ + 'punctuation': /\// } }, 'method': { diff --git a/components/prism-firestore-security-rules.min.js b/components/prism-firestore-security-rules.min.js index e9171f42ae..1ddf9d3f94 100644 --- a/components/prism-firestore-security-rules.min.js +++ b/components/prism-firestore-security-rules.min.js @@ -1 +1 @@ -Prism.languages["firestore-security-rules"]=Prism.languages.extend("clike",{comment:/\/\/.*/,keyword:/\b(?:allow|function|if|match|null|return|rules_version|service)\b/,operator:/&&|\|\||[<>!=]=?|[-+*/%=]|\b(?:in|is)\b/}),delete Prism.languages["firestore-security-rules"]["class-name"],Prism.languages.insertBefore("firestore-security-rules","keyword",{path:{pattern:/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,inside:{operator:/=/,keyword:/\*\*/,punctuation:/[.$(){}]/}},punctuation:/[/]/}},method:{pattern:/(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,lookbehind:!0,alias:"builtin",inside:{punctuation:/,/}}}); \ No newline at end of file +Prism.languages["firestore-security-rules"]=Prism.languages.extend("clike",{comment:/\/\/.*/,keyword:/\b(?:allow|function|if|match|null|return|rules_version|service)\b/,operator:/&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/}),delete Prism.languages["firestore-security-rules"]["class-name"],Prism.languages.insertBefore("firestore-security-rules","keyword",{path:{pattern:/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,inside:{operator:/=/,keyword:/\*\*/,punctuation:/[.$(){}]/}},punctuation:/\//}},method:{pattern:/(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,lookbehind:!0,alias:"builtin",inside:{punctuation:/,/}}}); \ No newline at end of file diff --git a/components/prism-flow.js b/components/prism-flow.js index 5ca30ffab6..f25ac018f0 100644 --- a/components/prism-flow.js +++ b/components/prism-flow.js @@ -4,12 +4,12 @@ Prism.languages.insertBefore('flow', 'keyword', { 'type': [ { - pattern: /\b(?:[Nn]umber|[Ss]tring|[Bb]oolean|Function|any|mixed|null|void)\b/, + pattern: /\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|any|mixed|null|void)\b/, alias: 'tag' } ] }); - Prism.languages.flow['function-variable'].pattern = /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i; + Prism.languages.flow['function-variable'].pattern = /(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i; delete Prism.languages.flow['parameter']; Prism.languages.insertBefore('flow', 'operator', { @@ -24,11 +24,11 @@ } Prism.languages.flow.keyword.unshift( { - pattern: /(^|[^$]\b)(?:type|opaque|declare|Class)\b(?!\$)/, + pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/, lookbehind: true }, { - pattern: /(^|[^$]\B)\$(?:await|Diff|Exact|Keys|ObjMap|PropertyType|Shape|Record|Supertype|Subtype|Enum)\b(?!\$)/, + pattern: /(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/, lookbehind: true } ); diff --git a/components/prism-flow.min.js b/components/prism-flow.min.js index 4a873974a3..98b046b4f3 100644 --- a/components/prism-flow.min.js +++ b/components/prism-flow.min.js @@ -1 +1 @@ -!function(a){a.languages.flow=a.languages.extend("javascript",{}),a.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Nn]umber|[Ss]tring|[Bb]oolean|Function|any|mixed|null|void)\b/,alias:"tag"}]}),a.languages.flow["function-variable"].pattern=/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,delete a.languages.flow.parameter,a.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(a.languages.flow.keyword)||(a.languages.flow.keyword=[a.languages.flow.keyword]),a.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:type|opaque|declare|Class)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:await|Diff|Exact|Keys|ObjMap|PropertyType|Shape|Record|Supertype|Subtype|Enum)\b(?!\$)/,lookbehind:!0})}(Prism); \ No newline at end of file +!function(a){a.languages.flow=a.languages.extend("javascript",{}),a.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|any|mixed|null|void)\b/,alias:"tag"}]}),a.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete a.languages.flow.parameter,a.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(a.languages.flow.keyword)||(a.languages.flow.keyword=[a.languages.flow.keyword]),a.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(Prism); \ No newline at end of file diff --git a/components/prism-fortran.js b/components/prism-fortran.js index ecee42d828..6d3dbc592e 100644 --- a/components/prism-fortran.js +++ b/components/prism-fortran.js @@ -4,7 +4,7 @@ Prism.languages.fortran = { alias: 'number' }, 'string': { - pattern: /(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/, + pattern: /(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/, inside: { 'comment': { pattern: /(&(?:\r\n?|\n)\s*)!.*/, @@ -16,20 +16,20 @@ Prism.languages.fortran = { pattern: /!.*/, greedy: true }, - 'boolean': /\.(?:TRUE|FALSE)\.(?:_\w+)?/i, + 'boolean': /\.(?:FALSE|TRUE)\.(?:_\w+)?/i, 'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i, 'keyword': [ // Types - /\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i, + /\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i, // END statements /\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i, // Statements /\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i, // Others - /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i + /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i ], 'operator': [ - /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i, + /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i, { // Use lookbehind to prevent confusion with (/ /) pattern: /(^|(?!\().)\/(?!\))/, @@ -37,4 +37,4 @@ Prism.languages.fortran = { } ], 'punctuation': /\(\/|\/\)|[(),;:&]/ -}; \ No newline at end of file +}; diff --git a/components/prism-fortran.min.js b/components/prism-fortran.min.js index 6fc0847769..f817c769c9 100644 --- a/components/prism-fortran.min.js +++ b/components/prism-fortran.min.js @@ -1 +1 @@ -Prism.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:{pattern:/!.*/,greedy:!0},boolean:/\.(?:TRUE|FALSE)\.(?:_\w+)?/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}; \ No newline at end of file +Prism.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:{pattern:/!.*/,greedy:!0},boolean:/\.(?:FALSE|TRUE)\.(?:_\w+)?/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}; \ No newline at end of file diff --git a/components/prism-fsharp.js b/components/prism-fsharp.js index 83fb2a79a2..0dcb147392 100644 --- a/components/prism-fsharp.js +++ b/components/prism-fsharp.js @@ -1,16 +1,18 @@ Prism.languages.fsharp = Prism.languages.extend('clike', { 'comment': [ { - pattern: /(^|[^\\])\(\*[\s\S]*?\*\)/, - lookbehind: true + pattern: /(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/, + lookbehind: true, + greedy: true }, { pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true + lookbehind: true, + greedy: true } ], 'string': { - pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?|'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/, + pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/, greedy: true }, 'class-name': { @@ -21,22 +23,23 @@ Prism.languages.fsharp = Prism.languages.extend('clike', { 'punctuation': /\./ } }, - 'keyword': /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/, + 'keyword': /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/, 'number': [ - /\b0x[\da-fA-F]+(?:un|lf|LF)?\b/, - /\b0b[01]+(?:y|uy)?\b/, - /(?:\b\d+\.?\d*|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i, - /\b\d+(?:[IlLsy]|u[lsy]?|UL)?\b/ + /\b0x[\da-fA-F]+(?:LF|lf|un)?\b/, + /\b0b[01]+(?:uy|y)?\b/, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i, + /\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/ ], 'operator': /([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/ }); Prism.languages.insertBefore('fsharp', 'keyword', { 'preprocessor': { - pattern: /^[^\r\n\S]*#.*/m, + pattern: /(^[\t ]*)#.*/m, + lookbehind: true, alias: 'property', inside: { 'directive': { - pattern: /(\s*#)\b(?:else|endif|if|light|line|nowarn)\b/, + pattern: /(^#)\b(?:else|endif|if|light|line|nowarn)\b/, lookbehind: true, alias: 'keyword' } @@ -45,13 +48,14 @@ Prism.languages.insertBefore('fsharp', 'keyword', { }); Prism.languages.insertBefore('fsharp', 'punctuation', { 'computation-expression': { - pattern: /[_a-z]\w*(?=\s*\{)/i, + pattern: /\b[_a-z]\w*(?=\s*\{)/i, alias: 'keyword' } }); Prism.languages.insertBefore('fsharp', 'string', { 'annotation': { pattern: /\[<.+?>\]/, + greedy: true, inside: { 'punctuation': /^\[<|>\]$/, 'class-name': { @@ -63,5 +67,9 @@ Prism.languages.insertBefore('fsharp', 'string', { inside: Prism.languages.fsharp } } + }, + 'char': { + pattern: /'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/, + greedy: true } }); diff --git a/components/prism-fsharp.min.js b/components/prism-fsharp.min.js index a069ec369c..73fa5e2098 100644 --- a/components/prism-fsharp.min.js +++ b/components/prism-fsharp.min.js @@ -1 +1 @@ -Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*[\s\S]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?|'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,greedy:!0},"class-name":{pattern:/(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/,lookbehind:!0,inside:{operator:/->|\*/,punctuation:/\./}},keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,number:[/\b0x[\da-fA-F]+(?:un|lf|LF)?\b/,/\b0b[01]+(?:y|uy)?\b/,/(?:\b\d+\.?\d*|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i,/\b\d+(?:[IlLsy]|u[lsy]?|UL)?\b/],operator:/([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/}),Prism.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/^[^\r\n\S]*#.*/m,alias:"property",inside:{directive:{pattern:/(\s*#)\b(?:else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}),Prism.languages.insertBefore("fsharp","punctuation",{"computation-expression":{pattern:/[_a-z]\w*(?=\s*\{)/i,alias:"keyword"}}),Prism.languages.insertBefore("fsharp","string",{annotation:{pattern:/\[<.+?>\]/,inside:{punctuation:/^\[<|>\]$/,"class-name":{pattern:/^\w+$|(^|;\s*)[A-Z]\w*(?=\()/,lookbehind:!0},"annotation-content":{pattern:/[\s\S]+/,inside:Prism.languages.fsharp}}}}); \ No newline at end of file +Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/,greedy:!0},"class-name":{pattern:/(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/,lookbehind:!0,inside:{operator:/->|\*/,punctuation:/\./}},keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/,number:[/\b0x[\da-fA-F]+(?:LF|lf|un)?\b/,/\b0b[01]+(?:uy|y)?\b/,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i,/\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/],operator:/([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/}),Prism.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(^#)\b(?:else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}),Prism.languages.insertBefore("fsharp","punctuation",{"computation-expression":{pattern:/\b[_a-z]\w*(?=\s*\{)/i,alias:"keyword"}}),Prism.languages.insertBefore("fsharp","string",{annotation:{pattern:/\[<.+?>\]/,greedy:!0,inside:{punctuation:/^\[<|>\]$/,"class-name":{pattern:/^\w+$|(^|;\s*)[A-Z]\w*(?=\()/,lookbehind:!0},"annotation-content":{pattern:/[\s\S]+/,inside:Prism.languages.fsharp}}},char:{pattern:/'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,greedy:!0}}); \ No newline at end of file diff --git a/components/prism-ftl.js b/components/prism-ftl.js index 85c039f727..bc1984880a 100644 --- a/components/prism-ftl.js +++ b/components/prism-ftl.js @@ -18,11 +18,11 @@ greedy: true }, { - pattern: RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:)*?\})*\1/.source.replace(//g, function () { return FTL_EXPR; })), + pattern: RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:))*\})*\1/.source.replace(//g, function () { return FTL_EXPR; })), greedy: true, inside: { 'interpolation': { - pattern: RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:)*?\}/.source.replace(//g, function () { return FTL_EXPR; })), + pattern: RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:))*\}/.source.replace(//g, function () { return FTL_EXPR; })), lookbehind: true, inside: { 'interpolation-punctuation': { @@ -36,14 +36,14 @@ } ], 'keyword': /\b(?:as)\b/, - 'boolean': /\b(?:true|false)\b/, + 'boolean': /\b(?:false|true)\b/, 'builtin-function': { pattern: /((?:^|[^?])\?\s*)\w+/, lookbehind: true, alias: 'function' }, - 'function': /\w+(?=\s*\()/, - 'number': /\d+(?:\.\d+)?/, + 'function': /\b\w+(?=\s*\()/, + 'number': /\b\d+(?:\.\d+)?\b/, 'operator': /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/, 'punctuation': /[,;.:()[\]{}]/ }; @@ -66,7 +66,7 @@ }, 'punctuation': /^<\/?|\/?>$/, 'content': { - pattern: /[\s\S]*\S[\s\S]*/, + pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: ftl } @@ -77,7 +77,7 @@ inside: { 'punctuation': /^\$\{|\}$/, 'content': { - pattern: /[\s\S]*\S[\s\S]*/, + pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: ftl } @@ -86,6 +86,7 @@ }; Prism.hooks.add('before-tokenize', function (env) { + // eslint-disable-next-line regexp/no-useless-lazy var pattern = RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:)*?>|\$\{(?:)*?\}/.source.replace(//g, function () { return FTL_EXPR; }), 'gi'); Prism.languages['markup-templating'].buildPlaceholders(env, 'ftl', pattern); }); diff --git a/components/prism-ftl.min.js b/components/prism-ftl.min.js index 8918cb7d84..ce9b3b69b5 100644 --- a/components/prism-ftl.min.js +++ b/components/prism-ftl.min.js @@ -1 +1 @@ -!function(n){for(var i="[^<()\"']|\\((?:)*\\)|<(?!#--)|<#--(?:[^-]|-(?!->))*--\x3e|\"(?:[^\\\\\"]|\\\\.)*\"|'(?:[^\\\\']|\\\\.)*'",e=0;e<2;e++)i=i.replace(//g,function(){return i});i=i.replace(//g,"[^\\s\\S]");var t={comment:/<#--[\s\S]*?-->/,string:[{pattern:/\br("|')(?:(?!\1)[^\\]|\\.)*\1/,greedy:!0},{pattern:RegExp("(\"|')(?:(?!\\1|\\$\\{)[^\\\\]|\\\\.|\\$\\{(?:)*?\\})*\\1".replace(//g,function(){return i})),greedy:!0,inside:{interpolation:{pattern:RegExp("((?:^|[^\\\\])(?:\\\\\\\\)*)\\$\\{(?:)*?\\}".replace(//g,function(){return i})),lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:null}}}}],keyword:/\b(?:as)\b/,boolean:/\b(?:true|false)\b/,"builtin-function":{pattern:/((?:^|[^?])\?\s*)\w+/,lookbehind:!0,alias:"function"},function:/\w+(?=\s*\()/,number:/\d+(?:\.\d+)?/,operator:/\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,punctuation:/[,;.:()[\]{}]/};t.string[1].inside.interpolation.inside.rest=t,n.languages.ftl={"ftl-comment":{pattern:/^<#--[\s\S]*/,alias:"comment"},"ftl-directive":{pattern:/^<[\s\S]+>$/,inside:{directive:{pattern:/(^<\/?)[#@][a-z]\w*/i,lookbehind:!0,alias:"keyword"},punctuation:/^<\/?|\/?>$/,content:{pattern:/[\s\S]*\S[\s\S]*/,alias:"ftl",inside:t}}},"ftl-interpolation":{pattern:/^\$\{[\s\S]*\}$/,inside:{punctuation:/^\$\{|\}$/,content:{pattern:/[\s\S]*\S[\s\S]*/,alias:"ftl",inside:t}}}},n.hooks.add("before-tokenize",function(e){var t=RegExp("<#--[^]*?--\x3e|)*?>|\\$\\{(?:)*?\\}".replace(//g,function(){return i}),"gi");n.languages["markup-templating"].buildPlaceholders(e,"ftl",t)}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"ftl")})}(Prism); \ No newline at end of file +!function(n){for(var i="[^<()\"']|\\((?:)*\\)|<(?!#--)|<#--(?:[^-]|-(?!->))*--\x3e|\"(?:[^\\\\\"]|\\\\.)*\"|'(?:[^\\\\']|\\\\.)*'",e=0;e<2;e++)i=i.replace(//g,function(){return i});i=i.replace(//g,"[^\\s\\S]");var t={comment:/<#--[\s\S]*?-->/,string:[{pattern:/\br("|')(?:(?!\1)[^\\]|\\.)*\1/,greedy:!0},{pattern:RegExp("(\"|')(?:(?!\\1|\\$\\{)[^\\\\]|\\\\.|\\$\\{(?:(?!\\})(?:))*\\})*\\1".replace(//g,function(){return i})),greedy:!0,inside:{interpolation:{pattern:RegExp("((?:^|[^\\\\])(?:\\\\\\\\)*)\\$\\{(?:(?!\\})(?:))*\\}".replace(//g,function(){return i})),lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:null}}}}],keyword:/\b(?:as)\b/,boolean:/\b(?:false|true)\b/,"builtin-function":{pattern:/((?:^|[^?])\?\s*)\w+/,lookbehind:!0,alias:"function"},function:/\b\w+(?=\s*\()/,number:/\b\d+(?:\.\d+)?\b/,operator:/\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,punctuation:/[,;.:()[\]{}]/};t.string[1].inside.interpolation.inside.rest=t,n.languages.ftl={"ftl-comment":{pattern:/^<#--[\s\S]*/,alias:"comment"},"ftl-directive":{pattern:/^<[\s\S]+>$/,inside:{directive:{pattern:/(^<\/?)[#@][a-z]\w*/i,lookbehind:!0,alias:"keyword"},punctuation:/^<\/?|\/?>$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:t}}},"ftl-interpolation":{pattern:/^\$\{[\s\S]*\}$/,inside:{punctuation:/^\$\{|\}$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:t}}}},n.hooks.add("before-tokenize",function(e){var t=RegExp("<#--[^]*?--\x3e|)*?>|\\$\\{(?:)*?\\}".replace(//g,function(){return i}),"gi");n.languages["markup-templating"].buildPlaceholders(e,"ftl",t)}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"ftl")})}(Prism); \ No newline at end of file diff --git a/components/prism-gap.js b/components/prism-gap.js new file mode 100644 index 0000000000..be53a6eca7 --- /dev/null +++ b/components/prism-gap.js @@ -0,0 +1,54 @@ +// https://www.gap-system.org/Manuals/doc/ref/chap4.html +// https://www.gap-system.org/Manuals/doc/ref/chap27.html + +Prism.languages.gap = { + 'shell': { + pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m, + greedy: true, + inside: { + 'gap': { + pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/, + lookbehind: true, + inside: null // see below + }, + 'punctuation': /^gap>/ + } + }, + + 'comment': { + pattern: /#.*/, + greedy: true + }, + 'string': { + pattern: /(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/, + lookbehind: true, + greedy: true, + inside: { + 'continuation': { + pattern: /([\r\n])>/, + lookbehind: true, + alias: 'punctuation' + } + } + }, + + 'keyword': /\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/, + 'boolean': /\b(?:false|true)\b/, + + 'function': /\b[a-z_]\w*(?=\s*\()/i, + + 'number': { + pattern: /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, + lookbehind: true + }, + + 'continuation': { + pattern: /([\r\n])>/, + lookbehind: true, + alias: 'punctuation' + }, + 'operator': /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./, + 'punctuation': /[()[\]{},;.:]/ +}; + +Prism.languages.gap.shell.inside.gap.inside = Prism.languages.gap; diff --git a/components/prism-gap.min.js b/components/prism-gap.min.js new file mode 100644 index 0000000000..af65ff2eb4 --- /dev/null +++ b/components/prism-gap.min.js @@ -0,0 +1 @@ +Prism.languages.gap={shell:{pattern:/^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m,greedy:!0,inside:{gap:{pattern:/^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/,lookbehind:!0,inside:null},punctuation:/^gap>/}},comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/,lookbehind:!0,greedy:!0,inside:{continuation:{pattern:/([\r\n])>/,lookbehind:!0,alias:"punctuation"}}},keyword:/\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:{pattern:/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,lookbehind:!0},continuation:{pattern:/([\r\n])>/,lookbehind:!0,alias:"punctuation"},operator:/->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./,punctuation:/[()[\]{},;.:]/},Prism.languages.gap.shell.inside.gap.inside=Prism.languages.gap; \ No newline at end of file diff --git a/components/prism-gcode.js b/components/prism-gcode.js index d093878720..a41bc7989a 100644 --- a/components/prism-gcode.js +++ b/components/prism-gcode.js @@ -7,9 +7,10 @@ Prism.languages.gcode = { 'keyword': /\b[GM]\d+(?:\.\d+)?\b/, 'property': /\b[A-Z]/, 'checksum': { - pattern: /\*\d+/, - alias: 'punctuation' + pattern: /(\*)\d+/, + lookbehind: true, + alias: 'number' }, // T0:0:0 - 'punctuation': /:/ + 'punctuation': /[:*]/ }; diff --git a/components/prism-gcode.min.js b/components/prism-gcode.min.js index 85e2c52826..54464dfb41 100644 --- a/components/prism-gcode.min.js +++ b/components/prism-gcode.min.js @@ -1 +1 @@ -Prism.languages.gcode={comment:/;.*|\B\(.*?\)\B/,string:{pattern:/"(?:""|[^"])*"/,greedy:!0},keyword:/\b[GM]\d+(?:\.\d+)?\b/,property:/\b[A-Z]/,checksum:{pattern:/\*\d+/,alias:"punctuation"},punctuation:/:/}; \ No newline at end of file +Prism.languages.gcode={comment:/;.*|\B\(.*?\)\B/,string:{pattern:/"(?:""|[^"])*"/,greedy:!0},keyword:/\b[GM]\d+(?:\.\d+)?\b/,property:/\b[A-Z]/,checksum:{pattern:/(\*)\d+/,lookbehind:!0,alias:"number"},punctuation:/[:*]/}; \ No newline at end of file diff --git a/components/prism-gdscript.js b/components/prism-gdscript.js index 3db862f29e..b49d802b41 100644 --- a/components/prism-gdscript.js +++ b/components/prism-gdscript.js @@ -10,11 +10,11 @@ Prism.languages.gdscript = { // as Node // const FOO: int = 9, var bar: bool = true // func add(reference: Item, amount: int) -> Item: - pattern: /(^(?:class_name|class|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m, + pattern: /(^(?:class|class_name|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m, lookbehind: true }, 'keyword': /\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/, - 'function': /[a-z_]\w*(?=[ \t]*\()/i, + 'function': /\b[a-z_]\w*(?=[ \t]*\()/i, 'variable': /\$\w+/, 'number': [ /\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/, diff --git a/components/prism-gdscript.min.js b/components/prism-gdscript.min.js index 5746fed602..e9a5a232e8 100644 --- a/components/prism-gdscript.min.js +++ b/components/prism-gdscript.min.js @@ -1 +1 @@ -Prism.languages.gdscript={comment:/#.*/,string:{pattern:/@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,greedy:!0},"class-name":{pattern:/(^(?:class_name|class|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,lookbehind:!0},keyword:/\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,function:/[a-z_]\w*(?=[ \t]*\()/i,variable:/\$\w+/,number:[/\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,/\b(?:INF|NAN|PI|TAU)\b/],constant:/\b[A-Z][A-Z_\d]*\b/,boolean:/\b(?:false|true)\b/,operator:/->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,punctuation:/[.:,;()[\]{}]/}; \ No newline at end of file +Prism.languages.gdscript={comment:/#.*/,string:{pattern:/@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,greedy:!0},"class-name":{pattern:/(^(?:class|class_name|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,lookbehind:!0},keyword:/\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,function:/\b[a-z_]\w*(?=[ \t]*\()/i,variable:/\$\w+/,number:[/\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,/\b(?:INF|NAN|PI|TAU)\b/],constant:/\b[A-Z][A-Z_\d]*\b/,boolean:/\b(?:false|true)\b/,operator:/->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,punctuation:/[.:,;()[\]{}]/}; \ No newline at end of file diff --git a/components/prism-gedcom.js b/components/prism-gedcom.js index d5dd103774..7fbbc3ddc5 100644 --- a/components/prism-gedcom.js +++ b/components/prism-gedcom.js @@ -1,7 +1,7 @@ Prism.languages.gedcom = { 'line-value': { // Preceded by level, optional pointer, and tag - pattern: /(^\s*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ +).+/m, + pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m, lookbehind: true, inside: { 'pointer': { @@ -12,12 +12,12 @@ Prism.languages.gedcom = { }, 'tag': { // Preceded by level and optional pointer - pattern: /(^\s*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, + pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, lookbehind: true, alias: 'string' }, 'level': { - pattern: /(^\s*)\d+/m, + pattern: /(^[\t ]*)\d+/m, lookbehind: true, alias: 'number' }, @@ -25,4 +25,4 @@ Prism.languages.gedcom = { pattern: /@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/, alias: 'variable' } -}; \ No newline at end of file +}; diff --git a/components/prism-gedcom.min.js b/components/prism-gedcom.min.js index 5bde09eadd..9b199672c2 100644 --- a/components/prism-gedcom.min.js +++ b/components/prism-gedcom.min.js @@ -1 +1 @@ -Prism.languages.gedcom={"line-value":{pattern:/(^\s*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ +).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},tag:{pattern:/(^\s*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"string"},level:{pattern:/(^\s*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}; \ No newline at end of file +Prism.languages.gedcom={"line-value":{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},tag:{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"string"},level:{pattern:/(^[\t ]*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}; \ No newline at end of file diff --git a/components/prism-gherkin.js b/components/prism-gherkin.js index 9d90042594..850d2ca934 100644 --- a/components/prism-gherkin.js +++ b/components/prism-gherkin.js @@ -1,6 +1,6 @@ (function (Prism) { - var tableRow = /(?:\r?\n|\r)[ \t]*\|.+\|.*/.source; + var tableRow = /(?:\r?\n|\r)[ \t]*\|.+\|(?:(?!\|).)*/.source; Prism.languages.gherkin = { 'pystring': { @@ -16,7 +16,7 @@ lookbehind: true }, 'feature': { - pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:]+(?:\r?\n|\r|$))*/, + pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/, lookbehind: true, inside: { 'important': { @@ -27,7 +27,7 @@ } }, 'scenario': { - pattern: /(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m, + pattern: /(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram Senaryo|Dyagram senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan Senaryo|Plan senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|Swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m, lookbehind: true, inside: { 'important': { @@ -43,7 +43,7 @@ lookbehind: true, inside: { 'outline': { - pattern: /<[^>]+?>/, + pattern: /<[^>]+>/, alias: 'variable' }, 'td': { @@ -64,20 +64,20 @@ } }, 'atrule': { - pattern: /(^[ \t]+)(?:'ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m, + pattern: /(^[ \t]+)(?:'a|'ach|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cand|Cando|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kad|Kada|Kadar|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|Un|Und|ugeholl|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadan|Zadani|Zadano|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m, lookbehind: true }, 'string': { pattern: /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/, inside: { 'outline': { - pattern: /<[^>]+?>/, + pattern: /<[^>]+>/, alias: 'variable' } } }, 'outline': { - pattern: /<[^>]+?>/, + pattern: /<[^>]+>/, alias: 'variable' } }; diff --git a/components/prism-gherkin.min.js b/components/prism-gherkin.min.js index 0d8ff6acf5..3a702b6db1 100644 --- a/components/prism-gherkin.min.js +++ b/components/prism-gherkin.min.js @@ -1 +1 @@ -!function(a){var n="(?:\r?\n|\r)[ \t]*\\|.+\\|.*";Prism.languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},tag:{pattern:/(^[ \t]*)@\S*/m,lookbehind:!0},feature:{pattern:/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:RegExp("("+n+")(?:"+n+")+"),lookbehind:!0,inside:{outline:{pattern:/<[^>]+?>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:RegExp(n),inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/(^[ \t]+)(?:'ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,inside:{outline:{pattern:/<[^>]+?>/,alias:"variable"}}},outline:{pattern:/<[^>]+?>/,alias:"variable"}}}(); \ No newline at end of file +!function(a){var n="(?:\r?\n|\r)[ \t]*\\|.+\\|(?:(?!\\|).)*";Prism.languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},tag:{pattern:/(^[ \t]*)@\S*/m,lookbehind:!0},feature:{pattern:/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram Senaryo|Dyagram senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan Senaryo|Plan senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|Swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:RegExp("("+n+")(?:"+n+")+"),lookbehind:!0,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:RegExp(n),inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/(^[ \t]+)(?:'a|'ach|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cand|Cando|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kad|Kada|Kadar|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|Un|Und|ugeholl|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadan|Zadani|Zadano|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"}}},outline:{pattern:/<[^>]+>/,alias:"variable"}}}(); \ No newline at end of file diff --git a/components/prism-git.js b/components/prism-git.js index 54f5ea77a6..365a5c771e 100644 --- a/components/prism-git.js +++ b/components/prism-git.js @@ -19,7 +19,7 @@ Prism.languages.git = { /* * a string (double and simple quote) */ - 'string': /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m, + 'string': /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, /* * a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters @@ -35,7 +35,7 @@ Prism.languages.git = { * $ git diff --cached * $ git log -p */ - 'parameter': /\s--?\w+/m + 'parameter': /\s--?\w+/ } }, @@ -64,5 +64,5 @@ Prism.languages.git = { * * Add of a new line */ - 'commit_sha1': /^commit \w{40}$/m + 'commit-sha1': /^commit \w{40}$/m }; diff --git a/components/prism-git.min.js b/components/prism-git.min.js index 8166591050..b472661960 100644 --- a/components/prism-git.min.js +++ b/components/prism-git.min.js @@ -1 +1 @@ -Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,commit_sha1:/^commit \w{40}$/m}; \ No newline at end of file +Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m}; \ No newline at end of file diff --git a/components/prism-glsl.js b/components/prism-glsl.js index 9db2b2e096..eed2d7e208 100644 --- a/components/prism-glsl.js +++ b/components/prism-glsl.js @@ -1,3 +1,3 @@ Prism.languages.glsl = Prism.languages.extend('c', { - 'keyword': /\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/ + 'keyword': /\b(?:active|asm|atomic_uint|attribute|[ibdu]?vec[234]|bool|break|buffer|case|cast|centroid|class|coherent|common|const|continue|d?mat[234](?:x[234])?|default|discard|do|double|else|enum|extern|external|false|filter|fixed|flat|float|for|fvec[234]|goto|half|highp|hvec[234]|[iu]?sampler2DMS(?:Array)?|[iu]?sampler2DRect|[iu]?samplerBuffer|[iu]?samplerCube|[iu]?samplerCubeArray|[iu]?sampler[123]D|[iu]?sampler[12]DArray|[iu]?image2DMS(?:Array)?|[iu]?image2DRect|[iu]?imageBuffer|[iu]?imageCube|[iu]?imageCubeArray|[iu]?image[123]D|[iu]?image[12]DArray|if|in|inline|inout|input|int|interface|invariant|layout|long|lowp|mediump|namespace|noinline|noperspective|out|output|partition|patch|precise|precision|public|readonly|resource|restrict|return|sample|sampler[12]DArrayShadow|sampler[12]DShadow|sampler2DRectShadow|sampler3DRect|samplerCubeArrayShadow|samplerCubeShadow|shared|short|sizeof|smooth|static|struct|subroutine|superp|switch|template|this|true|typedef|uint|uniform|union|unsigned|using|varying|void|volatile|while|writeonly)\b/ }); diff --git a/components/prism-glsl.min.js b/components/prism-glsl.min.js index f33decf696..655b92dac0 100644 --- a/components/prism-glsl.min.js +++ b/components/prism-glsl.min.js @@ -1 +1 @@ -Prism.languages.glsl=Prism.languages.extend("c",{keyword:/\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/}); \ No newline at end of file +Prism.languages.glsl=Prism.languages.extend("c",{keyword:/\b(?:active|asm|atomic_uint|attribute|[ibdu]?vec[234]|bool|break|buffer|case|cast|centroid|class|coherent|common|const|continue|d?mat[234](?:x[234])?|default|discard|do|double|else|enum|extern|external|false|filter|fixed|flat|float|for|fvec[234]|goto|half|highp|hvec[234]|[iu]?sampler2DMS(?:Array)?|[iu]?sampler2DRect|[iu]?samplerBuffer|[iu]?samplerCube|[iu]?samplerCubeArray|[iu]?sampler[123]D|[iu]?sampler[12]DArray|[iu]?image2DMS(?:Array)?|[iu]?image2DRect|[iu]?imageBuffer|[iu]?imageCube|[iu]?imageCubeArray|[iu]?image[123]D|[iu]?image[12]DArray|if|in|inline|inout|input|int|interface|invariant|layout|long|lowp|mediump|namespace|noinline|noperspective|out|output|partition|patch|precise|precision|public|readonly|resource|restrict|return|sample|sampler[12]DArrayShadow|sampler[12]DShadow|sampler2DRectShadow|sampler3DRect|samplerCubeArrayShadow|samplerCubeShadow|shared|short|sizeof|smooth|static|struct|subroutine|superp|switch|template|this|true|typedef|uint|uniform|union|unsigned|using|varying|void|volatile|while|writeonly)\b/}); \ No newline at end of file diff --git a/components/prism-gml.js b/components/prism-gml.js index c1bf77e3b6..63e3e9883c 100644 --- a/components/prism-gml.js +++ b/components/prism-gml.js @@ -1,7 +1,7 @@ Prism.languages.gamemakerlanguage = Prism.languages.gml = Prism.languages.extend('clike', { - 'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i, - 'keyword': /\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/, - 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor|not)\b/, - 'constant': /\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/, - 'variable': /\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/ + 'keyword': /\b(?:break|case|continue|default|do|else|enum|exit|for|globalvar|if|repeat|return|switch|until|var|while)\b/, + 'number': /(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i, + 'operator': /--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:and|at|not|or|with|xor)\b/, + 'constant': /\b(?:GM_build_date|GM_version|action_(?:continue|restart|reverse|stop)|all|gamespeed_(?:fps|microseconds)|global|local|noone|other|pi|pointer_(?:invalid|null)|self|timezone_(?:local|utc)|undefined|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|post|pre)|keypress|keyrelease|trigger|(?:left|middle|no|right)_button|(?:left|middle|right)_press|(?:left|middle|right)_release|mouse_(?:enter|leave|wheel_down|wheel_up)|global_(?:left|middle|right)_button|global_(?:left|middle|right)_press|global_(?:left|middle|right)_release|joystick(?:1|2)_(?:button1|button2|button3|button4|button5|button6|button7|button8|down|left|right|up)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|gui|gui_begin|gui_end|step_(?:begin|end|normal))|vk_(?:alt|anykey|backspace|control|delete|down|end|enter|escape|home|insert|left|nokey|pagedown|pageup|pause|printscreen|return|right|shift|space|tab|up|f\d|numpad\d|add|decimal|divide|lalt|lcontrol|lshift|multiply|ralt|rcontrol|rshift|subtract)|achievement_(?:filter_(?:all_players|favorites_only|friends_only)|friends_info|info|leaderboard_info|our_info|pic_loaded|show_(?:achievement|bank|friend_picker|leaderboard|profile|purchase_prompt|ui)|type_challenge|type_score_challenge)|asset_(?:font|object|path|room|script|shader|sound|sprite|tiles|timeline|unknown)|audio_(?:3d|falloff_(?:exponent_distance|exponent_distance_clamped|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|none)|mono|new_system|old_system|stereo)|bm_(?:add|complex|dest_alpha|dest_color|dest_colour|inv_dest_alpha|inv_dest_color|inv_dest_colour|inv_src_alpha|inv_src_color|inv_src_colour|max|normal|one|src_alpha|src_alpha_sat|src_color|src_colour|subtract|zero)|browser_(?:chrome|firefox|ie|ie_mobile|not_a_browser|opera|safari|safari_mobile|tizen|unknown|windows_store)|buffer_(?:bool|f16|f32|f64|fast|fixed|generalerror|grow|invalidtype|network|outofbounds|outofspace|s16|s32|s8|seek_end|seek_relative|seek_start|string|text|u16|u32|u64|u8|vbuffer|wrap)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|cmpfunc_(?:always|equal|greater|greaterequal|less|lessequal|never|notequal)|cr_(?:appstart|arrow|beam|cross|default|drag|handpoint|hourglass|none|size_all|size_nesw|size_ns|size_nwse|size_we|uparrow)|cull_(?:clockwise|counterclockwise|noculling)|device_(?:emulator|tablet)|device_ios_(?:ipad|ipad_retina|iphone|iphone5|iphone6|iphone6plus|iphone_retina|unknown)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|dll_(?:cdecl|cdel|stdcall)|ds_type_(?:grid|list|map|priority|queue|stack)|ef_(?:cloud|ellipse|explosion|firework|flare|rain|ring|smoke|smokeup|snow|spark|star)|fa_(?:archive|bottom|center|directory|hidden|left|middle|readonly|right|sysfile|top|volumeid)|fb_login_(?:default|fallback_to_webview|forcing_safari|forcing_webview|no_fallback_to_webview|use_system_account)|iap_(?:available|canceled|ev_consume|ev_product|ev_purchase|ev_restore|ev_storeload|failed|purchased|refunded|status_available|status_loading|status_processing|status_restoring|status_unavailable|status_uninitialised|storeload_failed|storeload_ok|unavailable)|leaderboard_type_(?:number|time_mins_secs)|lighttype_(?:dir|point)|matrix_(?:projection|view|world)|mb_(?:any|left|middle|none|right)|network_(?:config_(?:connect_timeout|disable_reliable_udp|enable_reliable_udp|use_non_blocking_socket)|socket_(?:bluetooth|tcp|udp)|type_(?:connect|data|disconnect|non_blocking_connect))|of_challenge_(?:lose|tie|win)|os_(?:android|ios|linux|macosx|ps3|ps4|psvita|unknown|uwp|win32|win8native|windows|winphone|xboxone)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|angle|angle_limits|damping_ratio|frequency|length_1|length_2|lower_angle_limit|max_force|max_length|max_motor_force|max_motor_torque|max_torque|motor_force|motor_speed|motor_torque|reaction_force_x|reaction_force_y|reaction_torque|speed|translation|upper_angle_limit)|phy_particle_data_flag_(?:category|color|colour|position|typeflags|velocity)|phy_particle_flag_(?:colormixing|colourmixing|elastic|powder|spring|tensile|viscous|wall|water|zombie)|phy_particle_group_flag_(?:rigid|solid)|pr_(?:linelist|linestrip|pointlist|trianglefan|trianglelist|trianglestrip)|ps_(?:distr|shape)_(?:diamond|ellipse|gaussian|invgaussian|line|linear|rectangle)|pt_shape_(?:circle|cloud|disk|explosion|flare|line|pixel|ring|smoke|snow|spark|sphere|square|star)|ty_(?:real|string)|gp_(?:face\d|axislh|axislv|axisrh|axisrv|padd|padl|padr|padu|select|shoulderl|shoulderlb|shoulderr|shoulderrb|start|stickl|stickr)|lb_disp_(?:none|numeric|time_ms|time_sec)|lb_sort_(?:ascending|descending|none)|ov_(?:achievements|community|friends|gamegroup|players|settings)|ugc_(?:filetype_(?:community|microtrans)|list_(?:Favorited|Followed|Published|Subscribed|UsedOrPlayed|VotedDown|VotedOn|VotedUp|WillVoteLater)|match_(?:AllGuides|Artwork|Collections|ControllerBindings|IntegratedGuides|Items|Items_Mtx|Items_ReadyToUse|Screenshots|UsableInGame|Videos|WebGuides)|query_(?:AcceptedForGameRankedByAcceptanceDate|CreatedByFriendsRankedByPublicationDate|FavoritedByFriendsRankedByPublicationDate|NotYetRated)|query_RankedBy(?:NumTimesReported|PublicationDate|TextSearch|TotalVotesAsc|Trend|Vote|VotesUp)|result_success|sortorder_CreationOrder(?:Asc|Desc)|sortorder_(?:ForModeration|LastUpdatedDesc|SubscriptionDateDesc|TitleAsc|VoteScoreDesc)|visibility_(?:friends_only|private|public))|vertex_usage_(?:binormal|blendindices|blendweight|color|colour|depth|fog|normal|position|psize|sample|tangent|texcoord|textcoord)|vertex_type_(?:float\d|color|colour|ubyte4)|input_type|layerelementtype_(?:background|instance|oldtilemap|particlesystem|sprite|tile|tilemap|undefined)|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|tile_(?:flip|index_mask|mirror|rotate)|(?:obj|rm|scr|spr)\w+)\b/, + 'variable': /\b(?:alarm|application_surface|async_load|background_(?:alpha|blend|color|colour|foreground|height|hspeed|htiled|index|showcolor|showcolour|visible|vspeed|vtiled|width|x|xscale|y|yscale)|bbox_(?:bottom|left|right|top)|browser_(?:height|width)|caption_(?:health|lives|score)|current_(?:day|hour|minute|month|second|time|weekday|year)|cursor_sprite|debug_mode|delta_time|direction|display_aa|error_(?:last|occurred)|event_(?:action|number|object|type)|fps|fps_real|friction|game_(?:display|project|save)_(?:id|name)|gamemaker_(?:pro|registered|version)|gravity|gravity_direction|(?:h|v)speed|health|iap_data|id|image_(?:alpha|angle|blend|depth|index|number|speed|xscale|yscale)|instance_(?:count|id)|keyboard_(?:key|lastchar|lastkey|string)|layer|lives|mask_index|mouse_(?:button|lastbutton|x|y)|object_index|os_(?:browser|device|type|version)|path_(?:endaction|index|orientation|position|positionprevious|scale|speed)|persistent|phy_(?:rotation|(?:col_normal|collision|com|linear_velocity|position|speed)_(?:x|y)|angular_(?:damping|velocity)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|pointer_(?:invalid|null)|room|room_(?:caption|first|height|last|persistent|speed|width)|score|secure_mode|show_(?:health|lives|score)|solid|speed|sprite_(?:height|index|width|xoffset|yoffset)|temp_directory|timeline_(?:index|loop|position|running|speed)|transition_(?:color|kind|steps)|undefined|view_(?:angle|current|enabled|(?:h|v)(?:border|speed)|(?:h|w|x|y)port|(?:h|w|x|y)view|object|surface_id|visible)|visible|webgl_enabled|working_directory|(?:x|y)(?:previous|start)|x|y|argument(?:_relitive|_count|\d)|argument|global|local|other|self)\b/ }); diff --git a/components/prism-gml.min.js b/components/prism-gml.min.js index a4a662c656..42b508de75 100644 --- a/components/prism-gml.min.js +++ b/components/prism-gml.min.js @@ -1 +1 @@ -Prism.languages.gamemakerlanguage=Prism.languages.gml=Prism.languages.extend("clike",{number:/(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i,keyword:/\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor|not)\b/,constant:/\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/,variable:/\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/}); \ No newline at end of file +Prism.languages.gamemakerlanguage=Prism.languages.gml=Prism.languages.extend("clike",{keyword:/\b(?:break|case|continue|default|do|else|enum|exit|for|globalvar|if|repeat|return|switch|until|var|while)\b/,number:/(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i,operator:/--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:and|at|not|or|with|xor)\b/,constant:/\b(?:GM_build_date|GM_version|action_(?:continue|restart|reverse|stop)|all|gamespeed_(?:fps|microseconds)|global|local|noone|other|pi|pointer_(?:invalid|null)|self|timezone_(?:local|utc)|undefined|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|post|pre)|keypress|keyrelease|trigger|(?:left|middle|no|right)_button|(?:left|middle|right)_press|(?:left|middle|right)_release|mouse_(?:enter|leave|wheel_down|wheel_up)|global_(?:left|middle|right)_button|global_(?:left|middle|right)_press|global_(?:left|middle|right)_release|joystick(?:1|2)_(?:button1|button2|button3|button4|button5|button6|button7|button8|down|left|right|up)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|gui|gui_begin|gui_end|step_(?:begin|end|normal))|vk_(?:alt|anykey|backspace|control|delete|down|end|enter|escape|home|insert|left|nokey|pagedown|pageup|pause|printscreen|return|right|shift|space|tab|up|f\d|numpad\d|add|decimal|divide|lalt|lcontrol|lshift|multiply|ralt|rcontrol|rshift|subtract)|achievement_(?:filter_(?:all_players|favorites_only|friends_only)|friends_info|info|leaderboard_info|our_info|pic_loaded|show_(?:achievement|bank|friend_picker|leaderboard|profile|purchase_prompt|ui)|type_challenge|type_score_challenge)|asset_(?:font|object|path|room|script|shader|sound|sprite|tiles|timeline|unknown)|audio_(?:3d|falloff_(?:exponent_distance|exponent_distance_clamped|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|none)|mono|new_system|old_system|stereo)|bm_(?:add|complex|dest_alpha|dest_color|dest_colour|inv_dest_alpha|inv_dest_color|inv_dest_colour|inv_src_alpha|inv_src_color|inv_src_colour|max|normal|one|src_alpha|src_alpha_sat|src_color|src_colour|subtract|zero)|browser_(?:chrome|firefox|ie|ie_mobile|not_a_browser|opera|safari|safari_mobile|tizen|unknown|windows_store)|buffer_(?:bool|f16|f32|f64|fast|fixed|generalerror|grow|invalidtype|network|outofbounds|outofspace|s16|s32|s8|seek_end|seek_relative|seek_start|string|text|u16|u32|u64|u8|vbuffer|wrap)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|cmpfunc_(?:always|equal|greater|greaterequal|less|lessequal|never|notequal)|cr_(?:appstart|arrow|beam|cross|default|drag|handpoint|hourglass|none|size_all|size_nesw|size_ns|size_nwse|size_we|uparrow)|cull_(?:clockwise|counterclockwise|noculling)|device_(?:emulator|tablet)|device_ios_(?:ipad|ipad_retina|iphone|iphone5|iphone6|iphone6plus|iphone_retina|unknown)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|dll_(?:cdecl|cdel|stdcall)|ds_type_(?:grid|list|map|priority|queue|stack)|ef_(?:cloud|ellipse|explosion|firework|flare|rain|ring|smoke|smokeup|snow|spark|star)|fa_(?:archive|bottom|center|directory|hidden|left|middle|readonly|right|sysfile|top|volumeid)|fb_login_(?:default|fallback_to_webview|forcing_safari|forcing_webview|no_fallback_to_webview|use_system_account)|iap_(?:available|canceled|ev_consume|ev_product|ev_purchase|ev_restore|ev_storeload|failed|purchased|refunded|status_available|status_loading|status_processing|status_restoring|status_unavailable|status_uninitialised|storeload_failed|storeload_ok|unavailable)|leaderboard_type_(?:number|time_mins_secs)|lighttype_(?:dir|point)|matrix_(?:projection|view|world)|mb_(?:any|left|middle|none|right)|network_(?:config_(?:connect_timeout|disable_reliable_udp|enable_reliable_udp|use_non_blocking_socket)|socket_(?:bluetooth|tcp|udp)|type_(?:connect|data|disconnect|non_blocking_connect))|of_challenge_(?:lose|tie|win)|os_(?:android|ios|linux|macosx|ps3|ps4|psvita|unknown|uwp|win32|win8native|windows|winphone|xboxone)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|angle|angle_limits|damping_ratio|frequency|length_1|length_2|lower_angle_limit|max_force|max_length|max_motor_force|max_motor_torque|max_torque|motor_force|motor_speed|motor_torque|reaction_force_x|reaction_force_y|reaction_torque|speed|translation|upper_angle_limit)|phy_particle_data_flag_(?:category|color|colour|position|typeflags|velocity)|phy_particle_flag_(?:colormixing|colourmixing|elastic|powder|spring|tensile|viscous|wall|water|zombie)|phy_particle_group_flag_(?:rigid|solid)|pr_(?:linelist|linestrip|pointlist|trianglefan|trianglelist|trianglestrip)|ps_(?:distr|shape)_(?:diamond|ellipse|gaussian|invgaussian|line|linear|rectangle)|pt_shape_(?:circle|cloud|disk|explosion|flare|line|pixel|ring|smoke|snow|spark|sphere|square|star)|ty_(?:real|string)|gp_(?:face\d|axislh|axislv|axisrh|axisrv|padd|padl|padr|padu|select|shoulderl|shoulderlb|shoulderr|shoulderrb|start|stickl|stickr)|lb_disp_(?:none|numeric|time_ms|time_sec)|lb_sort_(?:ascending|descending|none)|ov_(?:achievements|community|friends|gamegroup|players|settings)|ugc_(?:filetype_(?:community|microtrans)|list_(?:Favorited|Followed|Published|Subscribed|UsedOrPlayed|VotedDown|VotedOn|VotedUp|WillVoteLater)|match_(?:AllGuides|Artwork|Collections|ControllerBindings|IntegratedGuides|Items|Items_Mtx|Items_ReadyToUse|Screenshots|UsableInGame|Videos|WebGuides)|query_(?:AcceptedForGameRankedByAcceptanceDate|CreatedByFriendsRankedByPublicationDate|FavoritedByFriendsRankedByPublicationDate|NotYetRated)|query_RankedBy(?:NumTimesReported|PublicationDate|TextSearch|TotalVotesAsc|Trend|Vote|VotesUp)|result_success|sortorder_CreationOrder(?:Asc|Desc)|sortorder_(?:ForModeration|LastUpdatedDesc|SubscriptionDateDesc|TitleAsc|VoteScoreDesc)|visibility_(?:friends_only|private|public))|vertex_usage_(?:binormal|blendindices|blendweight|color|colour|depth|fog|normal|position|psize|sample|tangent|texcoord|textcoord)|vertex_type_(?:float\d|color|colour|ubyte4)|input_type|layerelementtype_(?:background|instance|oldtilemap|particlesystem|sprite|tile|tilemap|undefined)|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|tile_(?:flip|index_mask|mirror|rotate)|(?:obj|rm|scr|spr)\w+)\b/,variable:/\b(?:alarm|application_surface|async_load|background_(?:alpha|blend|color|colour|foreground|height|hspeed|htiled|index|showcolor|showcolour|visible|vspeed|vtiled|width|x|xscale|y|yscale)|bbox_(?:bottom|left|right|top)|browser_(?:height|width)|caption_(?:health|lives|score)|current_(?:day|hour|minute|month|second|time|weekday|year)|cursor_sprite|debug_mode|delta_time|direction|display_aa|error_(?:last|occurred)|event_(?:action|number|object|type)|fps|fps_real|friction|game_(?:display|project|save)_(?:id|name)|gamemaker_(?:pro|registered|version)|gravity|gravity_direction|(?:h|v)speed|health|iap_data|id|image_(?:alpha|angle|blend|depth|index|number|speed|xscale|yscale)|instance_(?:count|id)|keyboard_(?:key|lastchar|lastkey|string)|layer|lives|mask_index|mouse_(?:button|lastbutton|x|y)|object_index|os_(?:browser|device|type|version)|path_(?:endaction|index|orientation|position|positionprevious|scale|speed)|persistent|phy_(?:rotation|(?:col_normal|collision|com|linear_velocity|position|speed)_(?:x|y)|angular_(?:damping|velocity)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|pointer_(?:invalid|null)|room|room_(?:caption|first|height|last|persistent|speed|width)|score|secure_mode|show_(?:health|lives|score)|solid|speed|sprite_(?:height|index|width|xoffset|yoffset)|temp_directory|timeline_(?:index|loop|position|running|speed)|transition_(?:color|kind|steps)|undefined|view_(?:angle|current|enabled|(?:h|v)(?:border|speed)|(?:h|w|x|y)port|(?:h|w|x|y)view|object|surface_id|visible)|visible|webgl_enabled|working_directory|(?:x|y)(?:previous|start)|x|y|argument(?:_relitive|_count|\d)|argument|global|local|other|self)\b/}); \ No newline at end of file diff --git a/components/prism-gn.js b/components/prism-gn.js new file mode 100644 index 0000000000..0fcb05ac5f --- /dev/null +++ b/components/prism-gn.js @@ -0,0 +1,51 @@ +// https://gn.googlesource.com/gn/+/refs/heads/main/docs/reference.md#grammar + +Prism.languages.gn = { + 'comment': { + pattern: /#.*/, + greedy: true + }, + 'string-literal': { + pattern: /(^|[^\\"])"(?:[^\r\n"\\]|\\.)*"/, + lookbehind: true, + greedy: true, + inside: { + 'interpolation': { + pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\{[\s\S]*?\}|[a-zA-Z_]\w*|0x[a-fA-F0-9]{2})/, + lookbehind: true, + inside: { + 'number': /^\$0x[\s\S]{2}$/, + 'variable': /^\$\w+$/, + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation' + }, + 'expression': { + pattern: /[\s\S]+/, + inside: null // see below + } + } + }, + 'string': /[\s\S]+/ + } + }, + + 'keyword': /\b(?:else|if)\b/, + 'boolean': /\b(?:false|true)\b/, + 'builtin-function': { + // a few functions get special highlighting to improve readability + pattern: /\b(?:assert|defined|foreach|import|pool|print|template|tool|toolchain)(?=\s*\()/i, + alias: 'keyword' + }, + 'function': /\b[a-z_]\w*(?=\s*\()/i, + 'constant': /\b(?:current_cpu|current_os|current_toolchain|default_toolchain|host_cpu|host_os|root_build_dir|root_gen_dir|root_out_dir|target_cpu|target_gen_dir|target_os|target_out_dir)\b/, + + 'number': /-?\b\d+\b/, + + 'operator': /[-+!=<>]=?|&&|\|\|/, + 'punctuation': /[(){}[\],.]/ +}; + +Prism.languages.gn['string-literal'].inside['interpolation'].inside['expression'].inside = Prism.languages.gn; + +Prism.languages.gni = Prism.languages.gn; diff --git a/components/prism-gn.min.js b/components/prism-gn.min.js new file mode 100644 index 0000000000..c8208cc5c6 --- /dev/null +++ b/components/prism-gn.min.js @@ -0,0 +1 @@ +Prism.languages.gn={comment:{pattern:/#.*/,greedy:!0},"string-literal":{pattern:/(^|[^\\"])"(?:[^\r\n"\\]|\\.)*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\{[\s\S]*?\}|[a-zA-Z_]\w*|0x[a-fA-F0-9]{2})/,lookbehind:!0,inside:{number:/^\$0x[\s\S]{2}$/,variable:/^\$\w+$/,"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}},string:/[\s\S]+/}},keyword:/\b(?:else|if)\b/,boolean:/\b(?:false|true)\b/,"builtin-function":{pattern:/\b(?:assert|defined|foreach|import|pool|print|template|tool|toolchain)(?=\s*\()/i,alias:"keyword"},function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:current_cpu|current_os|current_toolchain|default_toolchain|host_cpu|host_os|root_build_dir|root_gen_dir|root_out_dir|target_cpu|target_gen_dir|target_os|target_out_dir)\b/,number:/-?\b\d+\b/,operator:/[-+!=<>]=?|&&|\|\|/,punctuation:/[(){}[\],.]/},Prism.languages.gn["string-literal"].inside.interpolation.inside.expression.inside=Prism.languages.gn,Prism.languages.gni=Prism.languages.gn; \ No newline at end of file diff --git a/components/prism-go-module.js b/components/prism-go-module.js new file mode 100644 index 0000000000..c02761a7bc --- /dev/null +++ b/components/prism-go-module.js @@ -0,0 +1,24 @@ +// https://go.dev/ref/mod#go-mod-file-module + +Prism.languages['go-mod'] = Prism.languages['go-module'] = { + 'comment': { + pattern: /\/\/.*/, + greedy: true + }, + 'version': { + pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/, + lookbehind: true, + alias: 'number' + }, + 'go-version': { + pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/, + lookbehind: true, + alias: 'number' + }, + 'keyword': { + pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m, + lookbehind: true + }, + 'operator': /=>/, + 'punctuation': /[()[\],]/ +}; diff --git a/components/prism-go-module.min.js b/components/prism-go-module.min.js new file mode 100644 index 0000000000..0a0974216f --- /dev/null +++ b/components/prism-go-module.min.js @@ -0,0 +1 @@ +Prism.languages["go-mod"]=Prism.languages["go-module"]={comment:{pattern:/\/\/.*/,greedy:!0},version:{pattern:/(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/,lookbehind:!0,alias:"number"},"go-version":{pattern:/((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/,lookbehind:!0,alias:"number"},keyword:{pattern:/^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m,lookbehind:!0},operator:/=>/,punctuation:/[()[\],]/}; \ No newline at end of file diff --git a/components/prism-go.js b/components/prism-go.js index 5ea98ba86a..9a89ea62a5 100644 --- a/components/prism-go.js +++ b/components/prism-go.js @@ -1,12 +1,28 @@ Prism.languages.go = Prism.languages.extend('clike', { + 'string': { + pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/, + lookbehind: true, + greedy: true + }, 'keyword': /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, - 'builtin': /\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/, - 'boolean': /\b(?:_|iota|nil|true|false)\b/, + 'boolean': /\b(?:_|false|iota|nil|true)\b/, + 'number': [ + // binary and octal integers + /\b0(?:b[01_]+|o[0-7_]+)i?\b/i, + // hexadecimal integers and floats + /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i, + // decimal integers and floats + /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i + ], 'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, - 'number': /(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i, - 'string': { - pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/, + 'builtin': /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/ +}); + +Prism.languages.insertBefore('go', 'string', { + 'char': { + pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/, greedy: true } }); + delete Prism.languages.go['class-name']; diff --git a/components/prism-go.min.js b/components/prism-go.min.js index aa9f4f42f0..9cc2699ba3 100644 --- a/components/prism-go.min.js +++ b/components/prism-go.min.js @@ -1 +1 @@ -Prism.languages.go=Prism.languages.extend("clike",{keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i,string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0}}),delete Prism.languages.go["class-name"]; \ No newline at end of file +Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]; \ No newline at end of file diff --git a/components/prism-graphql.js b/components/prism-graphql.js index d276c3f4c0..988f4e606a 100644 --- a/components/prism-graphql.js +++ b/components/prism-graphql.js @@ -17,18 +17,24 @@ Prism.languages.graphql = { greedy: true }, 'number': /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, - 'boolean': /\b(?:true|false)\b/, + 'boolean': /\b(?:false|true)\b/, 'variable': /\$[a-z_]\w*/i, 'directive': { pattern: /@[a-z_]\w*/i, alias: 'function' }, 'attr-name': { - pattern: /[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i, + pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i, greedy: true }, + 'atom-input': { + pattern: /\b[A-Z]\w*Input\b/, + alias: 'class-name' + }, + 'scalar': /\b(?:Boolean|Float|ID|Int|String)\b/, + 'constant': /\b[A-Z][A-Z_\d]*\b/, 'class-name': { - pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*)[a-zA-Z_]\w*/, + pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/, lookbehind: true }, 'fragment': { @@ -36,8 +42,170 @@ Prism.languages.graphql = { lookbehind: true, alias: 'function' }, + 'definition-mutation': { + pattern: /(\bmutation\s+)[a-zA-Z_]\w*/, + lookbehind: true, + alias: 'function' + }, + 'definition-query': { + pattern: /(\bquery\s+)[a-zA-Z_]\w*/, + lookbehind: true, + alias: 'function' + }, 'keyword': /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/, 'operator': /[!=|&]|\.{3}/, + 'property-query': /\w+(?=\s*\()/, + 'object': /\w+(?=\s*\{)/, 'punctuation': /[!(){}\[\]:=,]/, - 'constant': /\b(?!ID\b)[A-Z][A-Z_\d]*\b/ + 'property': /\w+/ }; + +Prism.hooks.add('after-tokenize', function afterTokenizeGraphql(env) { + if (env.language !== 'graphql') { + return; + } + + /** + * get the graphql token stream that we want to customize + * + * @typedef {InstanceType} Token + * @type {Token[]} + */ + var validTokens = env.tokens.filter(function (token) { + return typeof token !== 'string' && token.type !== 'comment' && token.type !== 'scalar'; + }); + + var currentIndex = 0; + + /** + * Returns whether the token relative to the current index has the given type. + * + * @param {number} offset + * @returns {Token | undefined} + */ + function getToken(offset) { + return validTokens[currentIndex + offset]; + } + + /** + * Returns whether the token relative to the current index has the given type. + * + * @param {readonly string[]} types + * @param {number} [offset=0] + * @returns {boolean} + */ + function isTokenType(types, offset) { + offset = offset || 0; + for (var i = 0; i < types.length; i++) { + var token = getToken(i + offset); + if (!token || token.type !== types[i]) { + return false; + } + } + return true; + } + + /** + * Returns the index of the closing bracket to an opening bracket. + * + * It is assumed that `token[currentIndex - 1]` is an opening bracket. + * + * If no closing bracket could be found, `-1` will be returned. + * + * @param {RegExp} open + * @param {RegExp} close + * @returns {number} + */ + function findClosingBracket(open, close) { + var stackHeight = 1; + + for (var i = currentIndex; i < validTokens.length; i++) { + var token = validTokens[i]; + var content = token.content; + + if (token.type === 'punctuation' && typeof content === 'string') { + if (open.test(content)) { + stackHeight++; + } else if (close.test(content)) { + stackHeight--; + + if (stackHeight === 0) { + return i; + } + } + } + } + + return -1; + } + + /** + * Adds an alias to the given token. + * + * @param {Token} token + * @param {string} alias + * @returns {void} + */ + function addAlias(token, alias) { + var aliases = token.alias; + if (!aliases) { + token.alias = aliases = []; + } else if (!Array.isArray(aliases)) { + token.alias = aliases = [aliases]; + } + aliases.push(alias); + } + + for (; currentIndex < validTokens.length;) { + var startToken = validTokens[currentIndex++]; + + // add special aliases for mutation tokens + if (startToken.type === 'keyword' && startToken.content === 'mutation') { + // any array of the names of all input variables (if any) + var inputVariables = []; + + if (isTokenType(['definition-mutation', 'punctuation']) && getToken(1).content === '(') { + // definition + + currentIndex += 2; // skip 'definition-mutation' and 'punctuation' + + var definitionEnd = findClosingBracket(/^\($/, /^\)$/); + if (definitionEnd === -1) { + continue; + } + + // find all input variables + for (; currentIndex < definitionEnd; currentIndex++) { + var t = getToken(0); + if (t.type === 'variable') { + addAlias(t, 'variable-input'); + inputVariables.push(t.content); + } + } + + currentIndex = definitionEnd + 1; + } + + if (isTokenType(['punctuation', 'property-query']) && getToken(0).content === '{') { + currentIndex++; // skip opening bracket + + addAlias(getToken(0), 'property-mutation'); + + if (inputVariables.length > 0) { + var mutationEnd = findClosingBracket(/^\{$/, /^\}$/); + if (mutationEnd === -1) { + continue; + } + + // give references to input variables a special alias + for (var i = currentIndex; i < mutationEnd; i++) { + var varToken = validTokens[i]; + if (varToken.type === 'variable' && inputVariables.indexOf(varToken.content) >= 0) { + addAlias(varToken, 'variable-input'); + } + } + } + } + } + } +}); diff --git a/components/prism-graphql.min.js b/components/prism-graphql.min.js index 00b1dfc53a..b60589c308 100644 --- a/components/prism-graphql.min.js +++ b/components/prism-graphql.min.js @@ -1 +1 @@ -Prism.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Prism.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*)[a-zA-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,punctuation:/[!(){}\[\]:=,]/,constant:/\b(?!ID\b)[A-Z][A-Z_\d]*\b/}; \ No newline at end of file +Prism.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Prism.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Prism.hooks.add("after-tokenize",function(n){if("graphql"===n.language)for(var o=n.tokens.filter(function(n){return"string"!=typeof n&&"comment"!==n.type&&"scalar"!==n.type}),s=0;s]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, lookbehind: true }, - 'punctuation': /\.+|[{}[\];(),.:$]/ + 'punctuation': /\.+|[{}[\];(),:$]/ }); Prism.languages.insertBefore('groovy', 'string', { @@ -29,7 +29,7 @@ Prism.languages.insertBefore('groovy', 'string', { }); Prism.languages.insertBefore('groovy', 'punctuation', { - 'spock-block': /\b(?:setup|given|when|then|and|cleanup|expect|where):/ + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/ }); Prism.languages.insertBefore('groovy', 'function', { @@ -41,7 +41,7 @@ Prism.languages.insertBefore('groovy', 'function', { }); // Handle string interpolation -Prism.hooks.add('wrap', function(env) { +Prism.hooks.add('wrap', function (env) { if (env.language === 'groovy' && env.type === 'string') { var delimiter = env.content[0]; diff --git a/components/prism-groovy.min.js b/components/prism-groovy.min.js index 726bcb6eb1..fa3203b359 100644 --- a/components/prism-groovy.min.js +++ b/components/prism-groovy.min.js @@ -1 +1 @@ -Prism.languages.groovy=Prism.languages.extend("clike",{string:[{pattern:/("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0},{pattern:/(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],keyword:/\b(?:as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),.:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;"$"===t&&(n=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),e.content=e.content.replace(/</g,"<").replace(/&/g,"&"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}}); \ No newline at end of file +Prism.languages.groovy=Prism.languages.extend("clike",{string:[{pattern:/("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0},{pattern:/(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(?:\$(?:\{.*?\}|[\w.]+))/;"$"===t&&(n=/([^\$])(?:\$(?:\{.*?\}|[\w.]+))/),e.content=e.content.replace(/</g,"<").replace(/&/g,"&"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}}); \ No newline at end of file diff --git a/components/prism-haml.js b/components/prism-haml.js index 8ac9900ade..ac7f37be60 100644 --- a/components/prism-haml.js +++ b/components/prism-haml.js @@ -5,25 +5,25 @@ code | */ -(function(Prism) { +(function (Prism) { Prism.languages.haml = { // Multiline stuff should appear before the rest 'multiline-comment': { - pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ]+.+)*/, + pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/, lookbehind: true, alias: 'comment' }, 'multiline-code': [ { - pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ]+.+)/, + pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/, lookbehind: true, inside: Prism.languages.ruby }, { - pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*\|[\t ]*)*/, + pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/, lookbehind: true, inside: Prism.languages.ruby } @@ -31,12 +31,12 @@ // See at the end of the file for known filters 'filter': { - pattern: /((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/, + pattern: /((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/, lookbehind: true, inside: { 'filter-name': { pattern: /^:[\w-]+/, - alias: 'variable' + alias: 'symbol' } } }, @@ -52,14 +52,14 @@ }, 'tag': { // Allows for one nested group of braces - pattern: /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/, + pattern: /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/, lookbehind: true, inside: { 'attributes': [ { // Lookbehind tries to prevent interpolations from breaking it all // Allows for one nested group of braces - pattern: /(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/, + pattern: /(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/, lookbehind: true, inside: Prism.languages.ruby }, @@ -95,7 +95,10 @@ pattern: /^#\{|\}$/, alias: 'punctuation' }, - rest: Prism.languages.ruby + 'ruby': { + pattern: /[\s\S]+/, + inside: Prism.languages.ruby + } } }, 'punctuation': { @@ -104,12 +107,12 @@ } }; - var filter_pattern = '((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ]+.+|\\s*?(?=\\r?\\n|\\r)))+'; + var filter_pattern = '((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+'; // Non exhaustive list of available filters and associated languages var filters = [ 'css', - {filter:'coffee',language:'coffeescript'}, + { filter: 'coffee', language: 'coffeescript' }, 'erb', 'javascript', 'less', @@ -121,7 +124,7 @@ var all_filters = {}; for (var i = 0, l = filters.length; i < l; i++) { var filter = filters[i]; - filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter; + filter = typeof filter === 'string' ? { filter: filter, language: filter } : filter; if (Prism.languages[filter.language]) { all_filters['filter-' + filter.filter] = { pattern: RegExp(filter_pattern.replace('{{filter_name}}', function () { return filter.filter; })), @@ -129,11 +132,15 @@ inside: { 'filter-name': { pattern: /^:[\w-]+/, - alias: 'variable' + alias: 'symbol' }, - rest: Prism.languages[filter.language] + 'text': { + pattern: /[\s\S]+/, + alias: [filter.language, 'language-' + filter.language], + inside: Prism.languages[filter.language] + } } - } + }; } } diff --git a/components/prism-haml.min.js b/components/prism-haml.min.js index 86a04dcc11..db9c658fa5 100644 --- a/components/prism-haml.min.js +++ b/components/prism-haml.min.js @@ -1 +1 @@ -!function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ]+.+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ]+.+)/,lookbehind:!0,inside:e.languages.ruby},{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*\|[\t ]*)*/,lookbehind:!0,inside:e.languages.ruby}],filter:{pattern:/((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},markup:{pattern:/((?:^|\r?\n|\r)[\t ]*)<.+/,lookbehind:!0,inside:e.languages.markup},doctype:{pattern:/((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,lookbehind:!0},tag:{pattern:/((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/,lookbehind:!0,inside:e.languages.ruby},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:e.languages.ruby}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:e.languages.ruby},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.ruby}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var t=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],n={},r=0,a=t.length;r]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/,lookbehind:!0,inside:n.languages.ruby},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:n.languages.ruby}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:n.languages.ruby},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},ruby:{pattern:/[\s\S]+/,inside:n.languages.ruby}}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var e=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],t={},r=0,a=e.length;r@\[\\\]^`{|}~\s]+/ }; - Prism.hooks.add('before-tokenize', function(env) { + Prism.hooks.add('before-tokenize', function (env) { var handlebarsPattern = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g; Prism.languages['markup-templating'].buildPlaceholders(env, 'handlebars', handlebarsPattern); }); - Prism.hooks.add('after-tokenize', function(env) { + Prism.hooks.add('after-tokenize', function (env) { Prism.languages['markup-templating'].tokenizePlaceholders(env, 'handlebars'); }); + Prism.languages.hbs = Prism.languages.handlebars; + }(Prism)); diff --git a/components/prism-handlebars.min.js b/components/prism-handlebars.min.js index 4c8151f3ba..bcad7a26e4 100644 --- a/components/prism-handlebars.min.js +++ b/components/prism-handlebars.min.js @@ -1 +1 @@ -!function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",function(a){e.languages["markup-templating"].buildPlaceholders(a,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)}),e.hooks.add("after-tokenize",function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"handlebars")})}(Prism); \ No newline at end of file +!function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",function(a){e.languages["markup-templating"].buildPlaceholders(a,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)}),e.hooks.add("after-tokenize",function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"handlebars")}),e.languages.hbs=e.languages.handlebars}(Prism); \ No newline at end of file diff --git a/components/prism-haskell.js b/components/prism-haskell.js index 2931b8f827..e3f600707b 100644 --- a/components/prism-haskell.js +++ b/components/prism-haskell.js @@ -1,37 +1,65 @@ Prism.languages.haskell = { 'comment': { - pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\s\S]*?-})/m, + pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m, lookbehind: true }, - 'char': /'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, + 'char': { + pattern: /'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|ACK|BEL|BS|CAN|CR|DC1|DC2|DC3|DC4|DEL|DLE|EM|ENQ|EOT|ESC|ETB|ETX|FF|FS|GS|HT|LF|NAK|NUL|RS|SI|SO|SOH|SP|STX|SUB|SYN|US|VT|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, + alias: 'string' + }, 'string': { - pattern: /"(?:[^\\"]|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/, + pattern: /"(?:[^\\"]|\\(?:\S|\s+\\))*"/, greedy: true }, 'keyword': /\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/, - 'import_statement': { + 'import-statement': { // The imported or hidden names are not included in this import // statement. This is because we want to highlight those exactly like // we do for the names in the program. - pattern: /((?:\r?\n|\r|^)\s*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][_a-zA-Z0-9']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m, + pattern: /(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m, lookbehind: true, inside: { - 'keyword': /\b(?:import|qualified|as|hiding)\b/ + 'keyword': /\b(?:as|hiding|import|qualified)\b/, + 'punctuation': /\./ } }, // These are builtin variables only. Constructors are highlighted later as a constant. 'builtin': /\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/, // decimal integers and floating point numbers | octal integers | hexadecimal integers 'number': /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i, - // Most of this is needed because of the meaning of a single '.'. - // If it stands alone freely, it is the function composition. - // It may also be a separator between a module name and an identifier => no - // operator. If it comes together with other special characters it is an - // operator too. - 'operator': /\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/, + 'operator': [ + { + // infix operator + pattern: /`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/, + greedy: true + }, + { + // function composition + pattern: /(\s)\.(?=\s)/, + lookbehind: true + }, + // Most of this is needed because of the meaning of a single '.'. + // If it stands alone freely, it is the function composition. + // It may also be a separator between a module name and an identifier => no + // operator. If it comes together with other special characters it is an + // operator too. + // + // This regex means: /[-!#$%*+=?&@|~.:<>^\\\/]+/ without /\./. + /[-!#$%*+=?&@|~:<>^\\\/][-!#$%*+=?&@|~.:<>^\\\/]*|\.[-!#$%*+=?&@|~.:<>^\\\/]+/, + ], // In Haskell, nearly everything is a variable, do not highlight these. - 'hvariable': /\b(?:[A-Z][\w']*\.)*[_a-z][\w']*\b/, - 'constant': /\b(?:[A-Z][\w']*\.)*[A-Z][\w']*\b/, + 'hvariable': { + pattern: /\b(?:[A-Z][\w']*\.)*[_a-z][\w']*/, + inside: { + 'punctuation': /\./ + } + }, + 'constant': { + pattern: /\b(?:[A-Z][\w']*\.)*[A-Z][\w']*/, + inside: { + 'punctuation': /\./ + } + }, 'punctuation': /[{}[\];(),.:]/ }; diff --git a/components/prism-haskell.min.js b/components/prism-haskell.min.js index 49010de8d7..4753b0d27e 100644 --- a/components/prism-haskell.min.js +++ b/components/prism-haskell.min.js @@ -1 +1 @@ -Prism.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\s\S]*?-})/m,lookbehind:!0},char:/'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,string:{pattern:/"(?:[^\\"]|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,greedy:!0},keyword:/\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,import_statement:{pattern:/((?:\r?\n|\r|^)\s*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][_a-zA-Z0-9']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|qualified|as|hiding)\b/}},builtin:/\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,hvariable:/\b(?:[A-Z][\w']*\.)*[_a-z][\w']*\b/,constant:/\b(?:[A-Z][\w']*\.)*[A-Z][\w']*\b/,punctuation:/[{}[\];(),.:]/},Prism.languages.hs=Prism.languages.haskell; \ No newline at end of file +Prism.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m,lookbehind:!0},char:{pattern:/'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|ACK|BEL|BS|CAN|CR|DC1|DC2|DC3|DC4|DEL|DLE|EM|ENQ|EOT|ESC|ETB|ETX|FF|FS|GS|HT|LF|NAK|NUL|RS|SI|SO|SOH|SP|STX|SUB|SYN|US|VT|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,alias:"string"},string:{pattern:/"(?:[^\\"]|\\(?:\S|\s+\\))*"/,greedy:!0},keyword:/\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:as|hiding|import|qualified)\b/,punctuation:/\./}},builtin:/\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:[{pattern:/`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,greedy:!0},{pattern:/(\s)\.(?=\s)/,lookbehind:!0},/[-!#$%*+=?&@|~:<>^\\\/][-!#$%*+=?&@|~.:<>^\\\/]*|\.[-!#$%*+=?&@|~.:<>^\\\/]+/],hvariable:{pattern:/\b(?:[A-Z][\w']*\.)*[_a-z][\w']*/,inside:{punctuation:/\./}},constant:{pattern:/\b(?:[A-Z][\w']*\.)*[A-Z][\w']*/,inside:{punctuation:/\./}},punctuation:/[{}[\];(),.:]/},Prism.languages.hs=Prism.languages.haskell; \ No newline at end of file diff --git a/components/prism-haxe.js b/components/prism-haxe.js index 7cb6c37b66..fffef0228d 100644 --- a/components/prism-haxe.js +++ b/components/prism-haxe.js @@ -1,45 +1,78 @@ Prism.languages.haxe = Prism.languages.extend('clike', { - // Strings can be multi-line 'string': { - pattern: /(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/, + // Strings can be multi-line + pattern: /"(?:[^"\\]|\\[\s\S])*"/, + greedy: true + }, + 'class-name': [ + { + pattern: /(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/, + lookbehind: true, + }, + // based on naming convention + /\b[A-Z]\w*/ + ], + // The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr" + 'keyword': /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/, + 'function': { + pattern: /\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i, + greedy: true + }, + 'operator': /\.{3}|\+\+|--|&&|\|\||->|=>|(?:<{1,3}|[-+*/%!=&|^])=?|[?:~]/ +}); + +Prism.languages.insertBefore('haxe', 'string', { + 'string-interpolation': { + pattern: /'(?:[^'\\]|\\[\s\S])*'/, greedy: true, inside: { 'interpolation': { - pattern: /(^|[^\\])\$(?:\w+|\{[^}]+\})/, + pattern: /(^|[^\\])\$(?:\w+|\{[^{}]+\})/, lookbehind: true, inside: { - 'interpolation': { - pattern: /^\$\w*/, - alias: 'variable' - } - // See rest below + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation' + }, + 'expression': { + pattern: /[\s\S]+/, + inside: Prism.languages.haxe + }, } - } + }, + 'string': /[\s\S]+/ } - }, - // The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr" - 'keyword': /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/, - 'operator': /\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/ + } }); + Prism.languages.insertBefore('haxe', 'class-name', { 'regex': { - pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/, - greedy: true + pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/, + greedy: true, + inside: { + 'regex-flags': /\b[a-z]+$/, + 'regex-source': { + pattern: /^(~\/)[\s\S]+(?=\/$)/, + lookbehind: true, + alias: 'language-regex', + inside: Prism.languages.regex + }, + 'regex-delimiter': /^~\/|\/$/, + } } }); + Prism.languages.insertBefore('haxe', 'keyword', { 'preprocessor': { - pattern: /#\w+/, - alias: 'builtin' + pattern: /#(?:else|elseif|end|if)\b.*/, + alias: 'property' }, 'metadata': { - pattern: /@:?\w+/, + pattern: /@:?[\w.]+/, alias: 'symbol' }, 'reification': { pattern: /\$(?:\w+|(?=\{))/, - alias: 'variable' + alias: 'important' } }); -Prism.languages.haxe['string'].inside['interpolation'].inside.rest = Prism.languages.haxe; -delete Prism.languages.haxe['class-name']; \ No newline at end of file diff --git a/components/prism-haxe.min.js b/components/prism-haxe.min.js index 0b94df4eb6..bc64bbb3a5 100644 --- a/components/prism-haxe.min.js +++ b/components/prism-haxe.min.js @@ -1 +1 @@ -Prism.languages.haxe=Prism.languages.extend("clike",{string:{pattern:/(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^}]+\})/,lookbehind:!0,inside:{interpolation:{pattern:/^\$\w*/,alias:"variable"}}}}},keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/,operator:/\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/}),Prism.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/,greedy:!0}}),Prism.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#\w+/,alias:"builtin"},metadata:{pattern:/@:?\w+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"variable"}}),Prism.languages.haxe.string.inside.interpolation.inside.rest=Prism.languages.haxe,delete Prism.languages.haxe["class-name"]; \ No newline at end of file +Prism.languages.haxe=Prism.languages.extend("clike",{string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},"class-name":[{pattern:/(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/,function:{pattern:/\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i,greedy:!0},operator:/\.{3}|\+\+|--|&&|\|\||->|=>|(?:<{1,3}|[-+*/%!=&|^])=?|[?:~]/}),Prism.languages.insertBefore("haxe","string",{"string-interpolation":{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^{}]+\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:Prism.languages.haxe}}},string:/[\s\S]+/}}}),Prism.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/,greedy:!0,inside:{"regex-flags":/\b[a-z]+$/,"regex-source":{pattern:/^(~\/)[\s\S]+(?=\/$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^~\/|\/$/}}}),Prism.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#(?:else|elseif|end|if)\b.*/,alias:"property"},metadata:{pattern:/@:?[\w.]+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"important"}}); \ No newline at end of file diff --git a/components/prism-hcl.js b/components/prism-hcl.js index d614c7c80b..bd12c84666 100644 --- a/components/prism-hcl.js +++ b/components/prism-hcl.js @@ -1,13 +1,13 @@ Prism.languages.hcl = { 'comment': /(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/, 'heredoc': { - pattern: /<<-?(\w+)[\s\S]*?^\s*\1/m, + pattern: /<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m, greedy: true, alias: 'string' }, 'keyword': [ { - pattern: /(?:resource|data)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+{)/i, + pattern: /(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i, inside: { 'type': { pattern: /(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i, @@ -17,23 +17,23 @@ Prism.languages.hcl = { } }, { - pattern: /(?:provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?={)/i, + pattern: /(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i, inside: { 'type': { - pattern: /(provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i, + pattern: /(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i, lookbehind: true, alias: 'variable' } } }, - /[\w-]+(?=\s+{)/ + /[\w-]+(?=\s+\{)/ ], 'property': [ - /[\w-\.]+(?=\s*=(?!=))/, + /[-\w\.]+(?=\s*=(?!=))/, /"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/, ], 'string': { - pattern: /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/, + pattern: /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/, greedy: true, inside: { 'interpolation': { @@ -41,23 +41,23 @@ Prism.languages.hcl = { lookbehind: true, inside: { 'type': { - pattern: /(\b(?:terraform|var|self|count|module|path|data|local)\b\.)[\w\*]+/i, + pattern: /(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i, lookbehind: true, alias: 'variable' }, - 'keyword': /\b(?:terraform|var|self|count|module|path|data|local)\b/i, + 'keyword': /\b(?:count|data|local|module|path|self|terraform|var)\b/i, 'function': /\w+(?=\()/, 'string': { pattern: /"(?:\\[\s\S]|[^\\"])*"/, greedy: true, }, - 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i, + 'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i, 'punctuation': /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/, } }, } }, - 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i, - 'boolean': /\b(?:true|false)\b/i, + 'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i, + 'boolean': /\b(?:false|true)\b/i, 'punctuation': /[=\[\]{}]/, }; diff --git a/components/prism-hcl.min.js b/components/prism-hcl.min.js index c2d7b19290..2ed0a9b993 100644 --- a/components/prism-hcl.min.js +++ b/components/prism-hcl.min.js @@ -1 +1 @@ -Prism.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+)[\s\S]*?^\s*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:resource|data)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehind:!0,alias:"variable"}}},{pattern:/(?:provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?={)/i,inside:{type:{pattern:/(provider|provisioner|variable|output|module|backend)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,lookbehind:!0,alias:"variable"}}},/[\w-]+(?=\s+{)/],property:[/[\w-\.]+(?=\s*=(?!=))/,/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],string:{pattern:/"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,greedy:!0,inside:{interpolation:{pattern:/(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,lookbehind:!0,inside:{type:{pattern:/(\b(?:terraform|var|self|count|module|path|data|local)\b\.)[\w\*]+/i,lookbehind:!0,alias:"variable"},keyword:/\b(?:terraform|var|self|count|module|path|data|local)\b/i,function:/\w+(?=\()/,string:{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0},number:/\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i,punctuation:/[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/}}}},number:/\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i,boolean:/\b(?:true|false)\b/i,punctuation:/[=\[\]{}]/}; \ No newline at end of file +Prism.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehind:!0,alias:"variable"}}},{pattern:/(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,inside:{type:{pattern:/(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,lookbehind:!0,alias:"variable"}}},/[\w-]+(?=\s+\{)/],property:[/[-\w\.]+(?=\s*=(?!=))/,/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],string:{pattern:/"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,greedy:!0,inside:{interpolation:{pattern:/(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,lookbehind:!0,inside:{type:{pattern:/(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i,lookbehind:!0,alias:"variable"},keyword:/\b(?:count|data|local|module|path|self|terraform|var)\b/i,function:/\w+(?=\()/,string:{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/}}}},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,boolean:/\b(?:false|true)\b/i,punctuation:/[=\[\]{}]/}; \ No newline at end of file diff --git a/components/prism-hlsl.js b/components/prism-hlsl.js index 460bf7a1e3..3dd1844d48 100644 --- a/components/prism-hlsl.js +++ b/components/prism-hlsl.js @@ -6,7 +6,7 @@ Prism.languages.hlsl = Prism.languages.extend('c', { // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-reserved-words 'class-name': [ Prism.languages.c['class-name'], - /\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RasterizerState|RenderTargetView|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/ + /\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|RasterizerState|RenderTargetView|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/ ], 'keyword': [ // HLSL keyword @@ -15,6 +15,6 @@ Prism.languages.hlsl = Prism.languages.extend('c', { /\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/ ], // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-grammar#floating-point-numbers - 'number': /(?:(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/, + 'number': /(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/, 'boolean': /\b(?:false|true)\b/ }); diff --git a/components/prism-hlsl.min.js b/components/prism-hlsl.min.js index b1c7ff37ac..364778c8f4 100644 --- a/components/prism-hlsl.min.js +++ b/components/prism-hlsl.min.js @@ -1 +1 @@ -Prism.languages.hlsl=Prism.languages.extend("c",{"class-name":[Prism.languages.c["class-name"],/\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RasterizerState|RenderTargetView|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/],keyword:[/\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/,/\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/],number:/(?:(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/,boolean:/\b(?:false|true)\b/}); \ No newline at end of file +Prism.languages.hlsl=Prism.languages.extend("c",{"class-name":[Prism.languages.c["class-name"],/\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|RasterizerState|RenderTargetView|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/],keyword:[/\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/,/\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/],number:/(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/,boolean:/\b(?:false|true)\b/}); \ No newline at end of file diff --git a/components/prism-hoon.js b/components/prism-hoon.js new file mode 100644 index 0000000000..400a1bd290 --- /dev/null +++ b/components/prism-hoon.js @@ -0,0 +1,14 @@ +Prism.languages.hoon = { + 'comment': { + pattern: /::.*/, + greedy: true + }, + 'string': { + pattern: /"[^"]*"|'[^']*'/, + greedy: true + }, + 'constant': /%(?:\.[ny]|[\w-]+)/, + 'class-name': /@(?:[a-z0-9-]*[a-z0-9])?|\*/i, + 'function': /(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/, + 'keyword': /\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/ +}; diff --git a/components/prism-hoon.min.js b/components/prism-hoon.min.js new file mode 100644 index 0000000000..168915a445 --- /dev/null +++ b/components/prism-hoon.min.js @@ -0,0 +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 diff --git a/components/prism-hpkp.js b/components/prism-hpkp.js index 1db02643d2..e3f15b5064 100644 --- a/components/prism-hpkp.js +++ b/components/prism-hpkp.js @@ -6,15 +6,9 @@ Prism.languages.hpkp = { 'directive': { - pattern: /\b(?:(?:includeSubDomains|preload|strict)(?: |;)|pin-sha256="[a-zA-Z\d+=/]+"|(?:max-age|report-uri)=|report-to )/, - alias: 'keyword' + pattern: /\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i, + alias: 'property' }, - 'safe': { - pattern: /\b\d{7,}\b/, - alias: 'selector' - }, - 'unsafe': { - pattern: /\b\d{1,6}\b/, - alias: 'function' - } + 'operator': /=/, + 'punctuation': /;/ }; diff --git a/components/prism-hpkp.min.js b/components/prism-hpkp.min.js index 099dfdea14..50ca60cc19 100644 --- a/components/prism-hpkp.min.js +++ b/components/prism-hpkp.min.js @@ -1 +1 @@ -Prism.languages.hpkp={directive:{pattern:/\b(?:(?:includeSubDomains|preload|strict)(?: |;)|pin-sha256="[a-zA-Z\d+=/]+"|(?:max-age|report-uri)=|report-to )/,alias:"keyword"},safe:{pattern:/\b\d{7,}\b/,alias:"selector"},unsafe:{pattern:/\b\d{1,6}\b/,alias:"function"}}; \ No newline at end of file +Prism.languages.hpkp={directive:{pattern:/\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i,alias:"property"},operator:/=/,punctuation:/;/}; \ No newline at end of file diff --git a/components/prism-hsts.js b/components/prism-hsts.js index 4d56433fd0..e2276a1908 100644 --- a/components/prism-hsts.js +++ b/components/prism-hsts.js @@ -6,15 +6,9 @@ Prism.languages.hsts = { 'directive': { - pattern: /\b(?:max-age=|includeSubDomains|preload)/, - alias: 'keyword' + pattern: /\b(?:includeSubDomains|max-age|preload)(?=[\s;=]|$)/i, + alias: 'property' }, - 'safe': { - pattern: /\b\d{8,}\b/, - alias: 'selector' - }, - 'unsafe': { - pattern: /\b\d{1,7}\b/, - alias: 'function' - } + 'operator': /=/, + 'punctuation': /;/ }; diff --git a/components/prism-hsts.min.js b/components/prism-hsts.min.js index b92d756c52..3faeef2003 100644 --- a/components/prism-hsts.min.js +++ b/components/prism-hsts.min.js @@ -1 +1 @@ -Prism.languages.hsts={directive:{pattern:/\b(?:max-age=|includeSubDomains|preload)/,alias:"keyword"},safe:{pattern:/\b\d{8,}\b/,alias:"selector"},unsafe:{pattern:/\b\d{1,7}\b/,alias:"function"}}; \ No newline at end of file +Prism.languages.hsts={directive:{pattern:/\b(?:includeSubDomains|max-age|preload)(?=[\s;=]|$)/i,alias:"property"},operator:/=/,punctuation:/;/}; \ No newline at end of file diff --git a/components/prism-http.js b/components/prism-http.js index cc16771fde..d14eb379a4 100644 --- a/components/prism-http.js +++ b/components/prism-http.js @@ -1,28 +1,92 @@ (function (Prism) { + + /** + * @param {string} name + * @returns {RegExp} + */ + function headerValueOf(name) { + return RegExp('(^(?:' + name + '):[ \t]*(?![ \t]))[^]+', 'i'); + } + Prism.languages.http = { 'request-line': { - pattern: /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\s(?:https?:\/\/|\/)\S+\sHTTP\/[0-9.]+/m, + pattern: /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m, inside: { - // HTTP Verb - 'property': /^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/, - // Path or query argument - 'attr-name': /:\w+/ + // HTTP Method + 'method': { + pattern: /^[A-Z]+\b/, + alias: 'property' + }, + // Request Target e.g. http://example.com, /path/to/file + 'request-target': { + pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/, + lookbehind: true, + alias: 'url', + inside: Prism.languages.uri + }, + // HTTP Version + 'http-version': { + pattern: /^(\s)HTTP\/[\d.]+/, + lookbehind: true, + alias: 'property' + }, } }, 'response-status': { - pattern: /^HTTP\/1.[01] \d+.*/m, + pattern: /^HTTP\/[\d.]+ \d+ .+/m, inside: { - // Status, e.g. 200 OK - 'property': { - pattern: /(^HTTP\/1.[01] )\d+.*/i, - lookbehind: true + // HTTP Version + 'http-version': { + pattern: /^HTTP\/[\d.]+/, + alias: 'property' + }, + // Status Code + 'status-code': { + pattern: /^(\s)\d+(?=\s)/, + lookbehind: true, + alias: 'number' + }, + // Reason Phrase + 'reason-phrase': { + pattern: /^(\s).+/, + lookbehind: true, + alias: 'string' } } }, - // HTTP header name - 'header-name': { - pattern: /^[\w-]+:(?=.)/m, - alias: 'keyword' + 'header': { + pattern: /^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m, + inside: { + 'header-value': [ + { + pattern: headerValueOf(/Content-Security-Policy/.source), + lookbehind: true, + alias: ['csp', 'languages-csp'], + inside: Prism.languages.csp + }, + { + pattern: headerValueOf(/Public-Key-Pins(?:-Report-Only)?/.source), + lookbehind: true, + alias: ['hpkp', 'languages-hpkp'], + inside: Prism.languages.hpkp + }, + { + pattern: headerValueOf(/Strict-Transport-Security/.source), + lookbehind: true, + alias: ['hsts', 'languages-hsts'], + inside: Prism.languages.hsts + }, + { + pattern: headerValueOf(/[^:]+/.source), + lookbehind: true + } + ], + 'header-name': { + pattern: /^[^:]+/, + alias: 'keyword' + }, + 'punctuation': /^:/ + } } }; @@ -34,7 +98,8 @@ 'application/xml': langs.xml, 'text/xml': langs.xml, 'text/html': langs.html, - 'text/css': langs.css + 'text/css': langs.css, + 'text/plain': langs.plain }; // Declare which types can also be suffixes @@ -64,14 +129,23 @@ var pattern = suffixTypes[contentType] ? getSuffixPattern(contentType) : contentType; options[contentType.replace(/\//g, '-')] = { - pattern: RegExp('(content-type:\\s*' + pattern + '[\\s\\S]*?)(?:\\r?\\n|\\r){2}[\\s\\S]*', 'i'), + pattern: RegExp( + '(' + /content-type:\s*/.source + pattern + /(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source + ')' + + // This is a little interesting: + // The HTTP format spec required 1 empty line before the body to make everything unambiguous. + // However, when writing code by hand (e.g. to display on a website) people can forget about this, + // so we want to be liberal here. We will allow the empty line to be omitted if the first line of + // the body does not start with a [\w-] character (as headers do). + /[^ \t\w-][\s\S]*/.source, + 'i' + ), lookbehind: true, inside: httpLanguages[contentType] }; } } if (options) { - Prism.languages.insertBefore('http', 'header-name', options); + Prism.languages.insertBefore('http', 'header', options); } }(Prism)); diff --git a/components/prism-http.min.js b/components/prism-http.min.js index 8ce53d6730..91df7ec8e4 100644 --- a/components/prism-http.min.js +++ b/components/prism-http.min.js @@ -1 +1 @@ -!function(t){t.languages.http={"request-line":{pattern:/^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\s(?:https?:\/\/|\/)\S+\sHTTP\/[0-9.]+/m,inside:{property:/^(?:POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,"attr-name":/:\w+/}},"response-status":{pattern:/^HTTP\/1.[01] \d+.*/m,inside:{property:{pattern:/(^HTTP\/1.[01] )\d+.*/i,lookbehind:!0}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var a,e,n,i=t.languages,p={"application/javascript":i.javascript,"application/json":i.json||i.javascript,"application/xml":i.xml,"text/xml":i.xml,"text/html":i.html,"text/css":i.css},s={"application/json":!0,"application/xml":!0};for(var r in p)if(p[r]){a=a||{};var T=s[r]?(void 0,n=(e=r).replace(/^[a-z]+\//,""),"(?:"+e+"|\\w+/(?:[\\w.-]+\\+)+"+n+"(?![+\\w.-]))"):r;a[r.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+T+"[\\s\\S]*?)(?:\\r?\\n|\\r){2}[\\s\\S]*","i"),lookbehind:!0,inside:p[r]}}a&&t.languages.insertBefore("http","header-name",a)}(Prism); \ No newline at end of file +!function(t){function a(t){return RegExp("(^(?:"+t+"):[ \t]*(?![ \t]))[^]+","i")}t.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:t.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:a("Content-Security-Policy"),lookbehind:!0,alias:["csp","languages-csp"],inside:t.languages.csp},{pattern:a("Public-Key-Pins(?:-Report-Only)?"),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:t.languages.hpkp},{pattern:a("Strict-Transport-Security"),lookbehind:!0,alias:["hsts","languages-hsts"],inside:t.languages.hsts},{pattern:a("[^:]+"),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var e,n,s,i=t.languages,p={"application/javascript":i.javascript,"application/json":i.json||i.javascript,"application/xml":i.xml,"text/xml":i.xml,"text/html":i.html,"text/css":i.css,"text/plain":i.plain},r={"application/json":!0,"application/xml":!0};for(var l in p)if(p[l]){e=e||{};var o=r[l]?(void 0,s=(n=l).replace(/^[a-z]+\//,""),"(?:"+n+"|\\w+/(?:[\\w.-]+\\+)+"+s+"(?![+\\w.-]))"):l;e[l.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+o+"(?:(?:\r\n?|\n)[\\w-].*)*(?:\r(?:\n|(?!\n))|\n))[^ \t\\w-][^]*","i"),lookbehind:!0,inside:p[l]}}e&&t.languages.insertBefore("http","header",e)}(Prism); \ No newline at end of file diff --git a/components/prism-ichigojam.js b/components/prism-ichigojam.js index 154ce49fc0..84cfd42d47 100644 --- a/components/prism-ichigojam.js +++ b/components/prism-ichigojam.js @@ -3,13 +3,13 @@ Prism.languages.ichigojam = { 'comment': /(?:\B'|REM)(?:[^\n\r]*)/i, 'string': { - pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i, + pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, greedy: true }, - 'number': /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+\.?\d*|\B\.\d+)(?:E[+-]?\d+)?/i, - 'keyword': /\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GSB|GOTO|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|RIGHT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i, + 'number': /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + 'keyword': /\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i, 'function': /\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i, - 'label': /(?:\B@[^\s]+)/i, + 'label': /(?:\B@\S+)/, 'operator': /<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i, 'punctuation': /[\[,;:()\]]/ -}; \ No newline at end of file +}; diff --git a/components/prism-ichigojam.min.js b/components/prism-ichigojam.min.js index cce832c064..445d2db436 100644 --- a/components/prism-ichigojam.min.js +++ b/components/prism-ichigojam.min.js @@ -1 +1 @@ -Prism.languages.ichigojam={comment:/(?:\B'|REM)(?:[^\n\r]*)/i,string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i,greedy:!0},number:/\B#[0-9A-F]+|\B`[01]+|(?:\b\d+\.?\d*|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GSB|GOTO|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|RIGHT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,function:/\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,label:/(?:\B@[^\s]+)/i,operator:/<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,punctuation:/[\[,;:()\]]/}; \ No newline at end of file +Prism.languages.ichigojam={comment:/(?:\B'|REM)(?:[^\n\r]*)/i,string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,function:/\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,label:/(?:\B@\S+)/,operator:/<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,punctuation:/[\[,;:()\]]/}; \ No newline at end of file diff --git a/components/prism-icon.js b/components/prism-icon.js index 4745f3c431..ad4a1ac5ca 100644 --- a/components/prism-icon.js +++ b/components/prism-icon.js @@ -14,7 +14,7 @@ Prism.languages.icon = { alias: 'builtin' }, 'keyword': /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/, - 'function': /(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/, + 'function': /\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/, 'operator': /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/, 'punctuation': /[\[\](){},;]/ -}; \ No newline at end of file +}; diff --git a/components/prism-icon.min.js b/components/prism-icon.min.js index 669a4b0250..c9b0f22d0e 100644 --- a/components/prism-icon.min.js +++ b/components/prism-icon.min.js @@ -1 +1 @@ -Prism.languages.icon={comment:/#.*/,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,greedy:!0},number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,function:/(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}; \ No newline at end of file +Prism.languages.icon={comment:/#.*/,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,greedy:!0},number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,function:/\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}; \ No newline at end of file diff --git a/components/prism-icu-message-format.js b/components/prism-icu-message-format.js new file mode 100644 index 0000000000..a4de0db52f --- /dev/null +++ b/components/prism-icu-message-format.js @@ -0,0 +1,148 @@ +// https://unicode-org.github.io/icu/userguide/format_parse/messages/ +// https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/MessageFormat.html + +(function (Prism) { + + /** + * @param {string} source + * @param {number} level + * @returns {string} + */ + function nested(source, level) { + if (level <= 0) { + return /[]/.source; + } else { + return source.replace(//g, function () { return nested(source, level - 1); }); + } + } + + var stringPattern = /'[{}:=,](?:[^']|'')*'(?!')/; + + var escape = { + pattern: /''/, + greedy: true, + alias: 'operator' + }; + var string = { + pattern: stringPattern, + greedy: true, + inside: { + 'escape': escape + } + }; + + var argumentSource = nested( + /\{(?:[^{}']|'(?![{},'])|''||)*\}/.source + .replace(//g, function () { return stringPattern.source; }), + 8 + ); + + var nestedMessage = { + pattern: RegExp(argumentSource), + inside: { + 'message': { + pattern: /^(\{)[\s\S]+(?=\}$)/, + lookbehind: true, + inside: null // see below + }, + 'message-delimiter': { + pattern: /./, + alias: 'punctuation' + } + } + }; + + Prism.languages['icu-message-format'] = { + 'argument': { + pattern: RegExp(argumentSource), + greedy: true, + inside: { + 'content': { + pattern: /^(\{)[\s\S]+(?=\}$)/, + lookbehind: true, + inside: { + 'argument-name': { + pattern: /^(\s*)[^{}:=,\s]+/, + lookbehind: true + }, + 'choice-style': { + // https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ChoiceFormat.html#details + pattern: /^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + inside: { + 'punctuation': /\|/, + 'range': { + pattern: /^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/, + lookbehind: true, + inside: { + 'operator': /[<#\u2264]/, + 'number': /\S+/ + } + }, + rest: null // see below + } + }, + 'plural-style': { + // https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/PluralFormat.html#:~:text=Patterns%20and%20Their%20Interpretation + pattern: /^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + inside: { + 'offset': /^offset:\s*\d+/, + 'nested-message': nestedMessage, + 'selector': { + pattern: /=\d+|[^{}:=,\s]+/, + inside: { + 'keyword': /^(?:few|many|one|other|two|zero)$/ + } + } + } + }, + 'select-style': { + // https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/SelectFormat.html#:~:text=Patterns%20and%20Their%20Interpretation + pattern: /^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + inside: { + 'nested-message': nestedMessage, + 'selector': { + pattern: /[^{}:=,\s]+/, + inside: { + 'keyword': /^other$/ + } + } + } + }, + 'keyword': /\b(?:choice|plural|select|selectordinal)\b/, + 'arg-type': { + pattern: /\b(?:date|duration|number|ordinal|spellout|time)\b/, + alias: 'keyword' + }, + 'arg-skeleton': { + pattern: /(,\s*)::[^{}:=,\s]+/, + lookbehind: true + }, + 'arg-style': { + pattern: /(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/, + lookbehind: true + }, + 'arg-style-text': { + pattern: RegExp(/(^\s*,\s*(?=\S))/.source + nested(/(?:[^{}']|'[^']*'|\{(?:)?\})+/.source, 8) + '$'), + lookbehind: true, + alias: 'string' + }, + 'punctuation': /,/ + } + }, + 'argument-delimiter': { + pattern: /./, + alias: 'operator' + } + } + }, + 'escape': escape, + 'string': string + }; + + nestedMessage.inside.message.inside = Prism.languages['icu-message-format']; + Prism.languages['icu-message-format'].argument.inside.content.inside['choice-style'].inside.rest = Prism.languages['icu-message-format']; + +}(Prism)); diff --git a/components/prism-icu-message-format.min.js b/components/prism-icu-message-format.min.js new file mode 100644 index 0000000000..7849a573ff --- /dev/null +++ b/components/prism-icu-message-format.min.js @@ -0,0 +1 @@ +!function(e){function s(e,t){return t<=0?"[]":e.replace(//g,function(){return s(e,t-1)})}var t=/'[{}:=,](?:[^']|'')*'(?!')/,n={pattern:/''/,greedy:!0,alias:"operator"},r={pattern:t,greedy:!0,inside:{escape:n}},a=s("\\{(?:[^{}']|'(?![{},'])|''||)*\\}".replace(//g,function(){return t.source}),8),i={pattern:RegExp(a),inside:{message:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:null},"message-delimiter":{pattern:/./,alias:"punctuation"}}};e.languages["icu-message-format"]={argument:{pattern:RegExp(a),greedy:!0,inside:{content:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:{"argument-name":{pattern:/^(\s*)[^{}:=,\s]+/,lookbehind:!0},"choice-style":{pattern:/^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{punctuation:/\|/,range:{pattern:/^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,lookbehind:!0,inside:{operator:/[<#\u2264]/,number:/\S+/}},rest:null}},"plural-style":{pattern:/^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{offset:/^offset:\s*\d+/,"nested-message":i,selector:{pattern:/=\d+|[^{}:=,\s]+/,inside:{keyword:/^(?:few|many|one|other|two|zero)$/}}}},"select-style":{pattern:/^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{"nested-message":i,selector:{pattern:/[^{}:=,\s]+/,inside:{keyword:/^other$/}}}},keyword:/\b(?:choice|plural|select|selectordinal)\b/,"arg-type":{pattern:/\b(?:date|duration|number|ordinal|spellout|time)\b/,alias:"keyword"},"arg-skeleton":{pattern:/(,\s*)::[^{}:=,\s]+/,lookbehind:!0},"arg-style":{pattern:/(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/,lookbehind:!0},"arg-style-text":{pattern:RegExp("(^\\s*,\\s*(?=\\S))"+s("(?:[^{}']|'[^']*'|\\{(?:)?\\})+",8)+"$"),lookbehind:!0,alias:"string"},punctuation:/,/}},"argument-delimiter":{pattern:/./,alias:"operator"}}},escape:n,string:r},i.inside.message.inside=e.languages["icu-message-format"],e.languages["icu-message-format"].argument.inside.content.inside["choice-style"].inside.rest=e.languages["icu-message-format"]}(Prism); \ No newline at end of file diff --git a/components/prism-idris.js b/components/prism-idris.js new file mode 100644 index 0000000000..3717ea02ab --- /dev/null +++ b/components/prism-idris.js @@ -0,0 +1,19 @@ +Prism.languages.idris = Prism.languages.extend('haskell', { + 'comment': { + pattern: /(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m, + }, + 'keyword': /\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/, + 'builtin': undefined +}); + +Prism.languages.insertBefore('idris', 'keyword', { + 'import-statement': { + pattern: /(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m, + lookbehind: true, + inside: { + 'punctuation': /\./ + } + } +}); + +Prism.languages.idr = Prism.languages.idris; diff --git a/components/prism-idris.min.js b/components/prism-idris.min.js new file mode 100644 index 0000000000..5e2bd727ab --- /dev/null +++ b/components/prism-idris.min.js @@ -0,0 +1 @@ +Prism.languages.idris=Prism.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,builtin:void 0}),Prism.languages.insertBefore("idris","keyword",{"import-statement":{pattern:/(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0,inside:{punctuation:/\./}}}),Prism.languages.idr=Prism.languages.idris; \ No newline at end of file diff --git a/components/prism-iecst.js b/components/prism-iecst.js index bf4d1d50bf..3e0fb97fca 100644 --- a/components/prism-iecst.js +++ b/components/prism-iecst.js @@ -3,6 +3,7 @@ Prism.languages.iecst = { { pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/, lookbehind: true, + greedy: true, }, { pattern: /(^|[^\\:])\/\/.*/, @@ -14,17 +15,18 @@ Prism.languages.iecst = { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: true, }, - 'class-name': /\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:GLOBAL|INPUT|PUTPUT|IN_OUT|ACCESS|TEMP|EXTERNAL|CONFIG)|VAR|METHOD|PROPERTY)\b/i, - 'keyword': /\b(?:(?:END_)?(?:IF|WHILE|REPEAT|CASE|FOR)|ELSE|FROM|THEN|ELSIF|DO|TO|BY|PRIVATE|PUBLIC|PROTECTED|CONSTANT|RETURN|EXIT|CONTINUE|GOTO|JMP|AT|RETAIN|NON_RETAIN|TASK|WITH|UNTIL|USING|EXTENDS|IMPLEMENTS|GET|SET|__TRY|__CATCH|__FINALLY|__ENDTRY)\b/, - 'variable': /\b(?:AT|BOOL|BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT|L?REAL|TIME(?:_OF_DAY)?|TOD|DT|DATE(?:_AND_TIME)?|STRING|ARRAY|ANY|POINTER)\b/, - 'symbol': /%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/, - 'number': /\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:T|D|DT|TOD)#[\d_shmd:]*|\b[A-Z]*\#[\d.,_]*|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, - 'boolean': /\b(?:TRUE|FALSE|NULL)\b/, - 'function': /\w+(?=\()/, - 'operator': /(?:S?R?:?=>?|&&?|\*\*?|<=?|>=?|[-:^/+])|\b(?:OR|AND|MOD|NOT|XOR|LE|GE|EQ|NE|GE|LT)\b/, - 'punctuation': /[();]/, - 'type': { - 'pattern': /#/, - 'alias': 'selector', + 'keyword': [ + /\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:ACCESS|CONFIG|EXTERNAL|GLOBAL|INPUT|IN_OUT|OUTPUT|TEMP)|VAR|METHOD|PROPERTY)\b/i, + /\b(?:AT|BY|(?:END_)?(?:CASE|FOR|IF|REPEAT|WHILE)|CONSTANT|CONTINUE|DO|ELSE|ELSIF|EXIT|EXTENDS|FROM|GET|GOTO|IMPLEMENTS|JMP|NON_RETAIN|OF|PRIVATE|PROTECTED|PUBLIC|RETAIN|RETURN|SET|TASK|THEN|TO|UNTIL|USING|WITH|__CATCH|__ENDTRY|__FINALLY|__TRY)\b/ + ], + 'class-name': /\b(?:ANY|ARRAY|BOOL|BYTE|U?(?:D|L|S)?INT|(?:D|L)?WORD|DATE(?:_AND_TIME)?|DT|L?REAL|POINTER|STRING|TIME(?:_OF_DAY)?|TOD)\b/, + 'address': { + pattern: /%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/, + alias: 'symbol' }, + 'number': /\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:D|DT|T|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + 'boolean': /\b(?:FALSE|NULL|TRUE)\b/, + 'operator': /S?R?:?=>?|&&?|\*\*?|<[=>]?|>=?|[-:^/+#]|\b(?:AND|EQ|EXPT|GE|GT|LE|LT|MOD|NE|NOT|OR|XOR)\b/, + 'function': /\b[a-z_]\w*(?=\s*\()/i, + 'punctuation': /[()[\].,;]/, }; diff --git a/components/prism-iecst.min.js b/components/prism-iecst.min.js index 2356700a40..270815bcec 100644 --- a/components/prism-iecst.min.js +++ b/components/prism-iecst.min.js @@ -1 +1 @@ -Prism.languages.iecst={comment:[{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":/\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:GLOBAL|INPUT|PUTPUT|IN_OUT|ACCESS|TEMP|EXTERNAL|CONFIG)|VAR|METHOD|PROPERTY)\b/i,keyword:/\b(?:(?:END_)?(?:IF|WHILE|REPEAT|CASE|FOR)|ELSE|FROM|THEN|ELSIF|DO|TO|BY|PRIVATE|PUBLIC|PROTECTED|CONSTANT|RETURN|EXIT|CONTINUE|GOTO|JMP|AT|RETAIN|NON_RETAIN|TASK|WITH|UNTIL|USING|EXTENDS|IMPLEMENTS|GET|SET|__TRY|__CATCH|__FINALLY|__ENDTRY)\b/,variable:/\b(?:AT|BOOL|BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT|L?REAL|TIME(?:_OF_DAY)?|TOD|DT|DATE(?:_AND_TIME)?|STRING|ARRAY|ANY|POINTER)\b/,symbol:/%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/,number:/\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:T|D|DT|TOD)#[\d_shmd:]*|\b[A-Z]*\#[\d.,_]*|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/,function:/\w+(?=\()/,operator:/(?:S?R?:?=>?|&&?|\*\*?|<=?|>=?|[-:^/+])|\b(?:OR|AND|MOD|NOT|XOR|LE|GE|EQ|NE|GE|LT)\b/,punctuation:/[();]/,type:{pattern:/#/,alias:"selector"}}; \ No newline at end of file +Prism.languages.iecst={comment:[{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:[/\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:ACCESS|CONFIG|EXTERNAL|GLOBAL|INPUT|IN_OUT|OUTPUT|TEMP)|VAR|METHOD|PROPERTY)\b/i,/\b(?:AT|BY|(?:END_)?(?:CASE|FOR|IF|REPEAT|WHILE)|CONSTANT|CONTINUE|DO|ELSE|ELSIF|EXIT|EXTENDS|FROM|GET|GOTO|IMPLEMENTS|JMP|NON_RETAIN|OF|PRIVATE|PROTECTED|PUBLIC|RETAIN|RETURN|SET|TASK|THEN|TO|UNTIL|USING|WITH|__CATCH|__ENDTRY|__FINALLY|__TRY)\b/],"class-name":/\b(?:ANY|ARRAY|BOOL|BYTE|U?(?:D|L|S)?INT|(?:D|L)?WORD|DATE(?:_AND_TIME)?|DT|L?REAL|POINTER|STRING|TIME(?:_OF_DAY)?|TOD)\b/,address:{pattern:/%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/,alias:"symbol"},number:/\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:D|DT|T|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/,operator:/S?R?:?=>?|&&?|\*\*?|<[=>]?|>=?|[-:^/+#]|\b(?:AND|EQ|EXPT|GE|GT|LE|LT|MOD|NE|NOT|OR|XOR)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,punctuation:/[()[\].,;]/}; \ No newline at end of file diff --git a/components/prism-ignore.js b/components/prism-ignore.js index 597516be8f..b81ac28d2c 100644 --- a/components/prism-ignore.js +++ b/components/prism-ignore.js @@ -16,8 +16,8 @@ } }; - Prism.languages.gitignore = Prism.languages.ignore - Prism.languages.hgignore = Prism.languages.ignore - Prism.languages.npmignore = Prism.languages.ignore + Prism.languages.gitignore = Prism.languages.ignore; + Prism.languages.hgignore = Prism.languages.ignore; + Prism.languages.npmignore = Prism.languages.ignore; }(Prism)); diff --git a/components/prism-inform7.js b/components/prism-inform7.js index 60518891e5..1c63d7a5a3 100644 --- a/components/prism-inform7.js +++ b/components/prism-inform7.js @@ -3,10 +3,10 @@ Prism.languages.inform7 = { pattern: /"[^"]*"/, inside: { 'substitution': { - pattern: /\[[^\]]+\]/, + pattern: /\[[^\[\]]+\]/, inside: { 'delimiter': { - pattern:/\[|\]/, + pattern: /\[|\]/, alias: 'punctuation' } // See rest below @@ -15,28 +15,28 @@ Prism.languages.inform7 = { } }, 'comment': { - pattern: /\[[^\]]+\]/, + pattern: /\[[^\[\]]+\]/, greedy: true }, 'title': { - pattern: /^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im, + pattern: /^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im, alias: 'important' }, 'number': { - pattern: /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i, + pattern: /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i, lookbehind: true }, 'verb': { - pattern: /(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i, + pattern: /(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i, lookbehind: true, alias: 'operator' }, 'keyword': { - pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i, + pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i, lookbehind: true }, 'property': { - pattern: /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i, + pattern: /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i, lookbehind: true, alias: 'symbol' }, @@ -46,7 +46,7 @@ Prism.languages.inform7 = { alias: 'keyword' }, 'type': { - pattern: /(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i, + pattern: /(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i, lookbehind: true, alias: 'variable' }, @@ -58,4 +58,4 @@ Prism.languages.inform7['string'].inside['substitution'].inside.rest = Prism.lan Prism.languages.inform7['string'].inside['substitution'].inside.rest.text = { pattern: /\S(?:\s*\S)*/, alias: 'comment' -}; \ No newline at end of file +}; diff --git a/components/prism-inform7.min.js b/components/prism-inform7.min.js index 9dd5d82b66..cffd948555 100644 --- a/components/prism-inform7.min.js +++ b/components/prism-inform7.min.js @@ -1 +1 @@ -Prism.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:{pattern:/\[[^\]]+\]/,greedy:!0},title:{pattern:/^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},Prism.languages.inform7.string.inside.substitution.inside.rest=Prism.languages.inform7,Prism.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}; \ No newline at end of file +Prism.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\[\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:{pattern:/\[[^\[\]]+\]/,greedy:!0},title:{pattern:/^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},Prism.languages.inform7.string.inside.substitution.inside.rest=Prism.languages.inform7,Prism.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}; \ No newline at end of file diff --git a/components/prism-ini.js b/components/prism-ini.js index c7b45a8ba4..4a40140c4a 100644 --- a/components/prism-ini.js +++ b/components/prism-ini.js @@ -1,11 +1,42 @@ -Prism.languages.ini= { - 'comment': /^[ \t]*[;#].*$/m, - 'selector': /^[ \t]*\[.*?\]/m, - 'constant': /^[ \t]*[^\s=]+?(?=[ \t]*=)/m, - 'attr-value': { - pattern: /=.*/, +Prism.languages.ini = { + + /** + * The component mimics the behavior of the Win32 API parser. + * + * @see {@link https://github.com/PrismJS/prism/issues/2775#issuecomment-787477723} + */ + + 'comment': { + pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m, + lookbehind: true + }, + 'section': { + pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m, + lookbehind: true, inside: { - 'punctuation': /^[=]/ + 'section-name': { + pattern: /(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/, + lookbehind: true, + alias: 'selector' + }, + 'punctuation': /\[|\]/ } - } + }, + 'key': { + pattern: /(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m, + lookbehind: true, + alias: 'attr-name' + }, + 'value': { + pattern: /(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/, + lookbehind: true, + alias: 'attr-value', + inside: { + 'inner-value': { + pattern: /^("|').+(?=\1$)/, + lookbehind: true + } + } + }, + 'punctuation': /=/ }; diff --git a/components/prism-ini.min.js b/components/prism-ini.min.js index 620cdb55b4..7e16e987bd 100644 --- a/components/prism-ini.min.js +++ b/components/prism-ini.min.js @@ -1 +1 @@ -Prism.languages.ini={comment:/^[ \t]*[;#].*$/m,selector:/^[ \t]*\[.*?\]/m,constant:/^[ \t]*[^\s=]+?(?=[ \t]*=)/m,"attr-value":{pattern:/=.*/,inside:{punctuation:/^[=]/}}}; \ No newline at end of file +Prism.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}; \ No newline at end of file diff --git a/components/prism-io.js b/components/prism-io.js index c259eaa010..3bfd2cccf6 100644 --- a/components/prism-io.js +++ b/components/prism-io.js @@ -1,18 +1,9 @@ Prism.languages.io = { - 'comment': [ - { - pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, - lookbehind: true - }, - { - pattern: /(^|[^\\])\/\/.*/, - lookbehind: true - }, - { - pattern: /(^|[^\\])#.*/, - lookbehind: true - } - ], + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*|#.*)/, + lookbehind: true, + greedy: true + }, 'triple-quoted-string': { pattern: /"""(?:\\[\s\S]|(?!""")[^\\])*"""/, greedy: true, @@ -22,10 +13,10 @@ Prism.languages.io = { pattern: /"(?:\\.|[^\\\r\n"])*"/, greedy: true }, - 'keyword': /\b(?:activate|activeCoroCount|asString|block|break|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getSlot|getEnvironmentVariable|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|call|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/, - 'builtin':/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum|Sequence)\b/, - 'boolean': /\b(?:true|false|nil)\b/, - 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e-?\d+)?/i, - 'operator': /[=!*/%+\-^&|]=|>>?=?|<>?=?|<>?=?|<>?=?|<+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/, alias: 'keyword' }, - 'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/, + 'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/, 'adverb': { pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/, alias: 'builtin' diff --git a/components/prism-j.min.js b/components/prism-j.min.js index a7b71721ca..cc08850579 100644 --- a/components/prism-j.min.js +++ b/components/prism-j.min.js @@ -1 +1 @@ -Prism.languages.j={comment:/\bNB\..*/,string:{pattern:/'(?:''|[^'\r\n])*'/,greedy:!0},keyword:/\b(?:(?:adverb|conjunction|CR|def|define|dyad|LF|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,verb:{pattern:/(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}; \ No newline at end of file +Prism.languages.j={comment:{pattern:/\bNB\..*/,greedy:!0},string:{pattern:/'(?:''|[^'\r\n])*'/,greedy:!0},keyword:/\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,verb:{pattern:/(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}; \ No newline at end of file diff --git a/components/prism-java.js b/components/prism-java.js index 498b7a32f2..9fe9f695f9 100644 --- a/components/prism-java.js +++ b/components/prism-java.js @@ -1,27 +1,50 @@ (function (Prism) { - var keywords = /\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|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; + var keywords = /\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|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; + + // full package (optional) + parent classes (optional) + var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source; // based on the java naming conventions - var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/; + var className = { + pattern: RegExp(classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), + lookbehind: true, + inside: { + 'namespace': { + pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, + inside: { + 'punctuation': /\./ + } + }, + 'punctuation': /\./ + } + }; Prism.languages.java = Prism.languages.extend('clike', { + 'string': { + pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/, + lookbehind: true, + greedy: true + }, 'class-name': [ className, - - // variables and parameters - // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) - /\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/ + { + // variables and parameters + // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) + pattern: RegExp(classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source), + lookbehind: true, + inside: className.inside + } ], 'keyword': keywords, 'function': [ Prism.languages.clike.function, { - pattern: /(\:\:)[a-z_]\w*/, + pattern: /(::\s*)[a-z_]\w*/, lookbehind: true } ], - 'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, + '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: true @@ -34,32 +57,36 @@ pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, greedy: true, alias: 'string' + }, + 'char': { + pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/, + greedy: true } }); Prism.languages.insertBefore('java', 'class-name', { 'annotation': { - alias: 'punctuation', - pattern: /(^|[^.])@\w+/, - lookbehind: true - }, - '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*)*\.?/ - .source.replace(//g, function () { return keywords.source; })), + pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/, lookbehind: true, - inside: { - 'punctuation': /\./, - } + alias: 'punctuation' }, 'generics': { - pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, + pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, inside: { 'class-name': className, 'keyword': keywords, 'punctuation': /[<>(),.:]/, 'operator': /[?&|]/ } + }, + '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*)*\.?/ + .source.replace(//g, function () { return keywords.source; })), + lookbehind: true, + inside: { + 'punctuation': /\./, + } } }); }(Prism)); diff --git a/components/prism-java.min.js b/components/prism-java.min.js index 818fd8ec78..897da4e88c 100644 --- a/components/prism-java.min.js +++ b/components/prism-java.min.js @@ -1 +1 @@ -!function(e){var t=/\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|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,a=/\b[A-Z](?:\w*[a-z]\w*)?\b/;e.languages.java=e.languages.extend("clike",{"class-name":[a,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:t,function:[e.languages.clike.function,{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\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"}}),e.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},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 t.source})),lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(Prism); \ No newline at end of file +!function(e){var t=/\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|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n="(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",a={pattern:RegExp(n+"[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":[a,{pattern:RegExp(n+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])"),lookbehind:!0,inside:a.inside}],keyword:t,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":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},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 t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism); \ No newline at end of file diff --git a/components/prism-javadoc.js b/components/prism-javadoc.js index de38724ece..c16a1c1479 100644 --- a/components/prism-javadoc.js +++ b/components/prism-javadoc.js @@ -1,14 +1,14 @@ (function (Prism) { - var codeLinePattern = /(^(?:\s*(?:\*\s*)*)).*[^*\s].*$/m; + var codeLinePattern = /(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m; var memberReference = /#\s*\w+(?:\s*\([^()]*\))?/.source; - var reference = /(?:[a-zA-Z]\w+\s*\.\s*)*[A-Z]\w*(?:\s*)?|/.source.replace(//g, function () { return memberReference }); + var reference = /(?:\b[a-zA-Z]\w+\s*\.\s*)*\b[A-Z]\w*(?:\s*)?|/.source.replace(//g, function () { return memberReference; }); Prism.languages.javadoc = Prism.languages.extend('javadoclike', {}); Prism.languages.insertBefore('javadoc', 'keyword', { 'reference': { - pattern: RegExp(/(@(?:exception|throws|see|link|linkplain|value)\s+(?:\*\s*)?)/.source + '(?:' + reference + ')'), + pattern: RegExp(/(@(?:exception|link|linkplain|see|throws|value)\s+(?:\*\s*)?)/.source + '(?:' + reference + ')'), lookbehind: true, inside: { 'function': { @@ -40,7 +40,7 @@ }, 'code-section': [ { - pattern: /(\{@code\s+)(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+?(?=\s*\})/, + pattern: /(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/, lookbehind: true, inside: { 'code': { @@ -53,7 +53,7 @@ } }, { - pattern: /(<(code|pre|tt)>(?!)\s*)[\s\S]+?(?=\s*<\/\2>)/, + pattern: /(<(code|pre|tt)>(?!)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/, lookbehind: true, inside: { 'line': { diff --git a/components/prism-javadoc.min.js b/components/prism-javadoc.min.js index 18d7f9c7e4..5cdc8bfcb3 100644 --- a/components/prism-javadoc.min.js +++ b/components/prism-javadoc.min.js @@ -1 +1 @@ -!function(a){var e=/(^(?:\s*(?:\*\s*)*)).*[^*\s].*$/m,n="(?:[a-zA-Z]\\w+\\s*\\.\\s*)*[A-Z]\\w*(?:\\s*)?|".replace(//g,function(){return"#\\s*\\w+(?:\\s*\\([^()]*\\))?"});a.languages.javadoc=a.languages.extend("javadoclike",{}),a.languages.insertBefore("javadoc","keyword",{reference:{pattern:RegExp("(@(?:exception|throws|see|link|linkplain|value)\\s+(?:\\*\\s*)?)(?:"+n+")"),lookbehind:!0,inside:{function:{pattern:/(#\s*)\w+(?=\s*\()/,lookbehind:!0},field:{pattern:/(#\s*)\w+/,lookbehind:!0},namespace:{pattern:/\b(?:[a-z]\w*\s*\.\s*)+/,inside:{punctuation:/\./}},"class-name":/\b[A-Z]\w*/,keyword:a.languages.java.keyword,punctuation:/[#()[\],.]/}},"class-name":{pattern:/(@param\s+)<[A-Z]\w*>/,lookbehind:!0,inside:{punctuation:/[.<>]/}},"code-section":[{pattern:/(\{@code\s+)(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+?(?=\s*\})/,lookbehind:!0,inside:{code:{pattern:e,lookbehind:!0,inside:a.languages.java,alias:"language-java"}}},{pattern:/(<(code|pre|tt)>(?!)\s*)[\s\S]+?(?=\s*<\/\2>)/,lookbehind:!0,inside:{line:{pattern:e,lookbehind:!0,inside:{tag:a.languages.markup.tag,entity:a.languages.markup.entity,code:{pattern:/.+/,inside:a.languages.java,alias:"language-java"}}}}}],tag:a.languages.markup.tag,entity:a.languages.markup.entity}),a.languages.javadoclike.addSupport("java",a.languages.javadoc)}(Prism); \ No newline at end of file +!function(a){var e=/(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m,n="(?:\\b[a-zA-Z]\\w+\\s*\\.\\s*)*\\b[A-Z]\\w*(?:\\s*)?|".replace(//g,function(){return"#\\s*\\w+(?:\\s*\\([^()]*\\))?"});a.languages.javadoc=a.languages.extend("javadoclike",{}),a.languages.insertBefore("javadoc","keyword",{reference:{pattern:RegExp("(@(?:exception|link|linkplain|see|throws|value)\\s+(?:\\*\\s*)?)(?:"+n+")"),lookbehind:!0,inside:{function:{pattern:/(#\s*)\w+(?=\s*\()/,lookbehind:!0},field:{pattern:/(#\s*)\w+/,lookbehind:!0},namespace:{pattern:/\b(?:[a-z]\w*\s*\.\s*)+/,inside:{punctuation:/\./}},"class-name":/\b[A-Z]\w*/,keyword:a.languages.java.keyword,punctuation:/[#()[\],.]/}},"class-name":{pattern:/(@param\s+)<[A-Z]\w*>/,lookbehind:!0,inside:{punctuation:/[.<>]/}},"code-section":[{pattern:/(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/,lookbehind:!0,inside:{code:{pattern:e,lookbehind:!0,inside:a.languages.java,alias:"language-java"}}},{pattern:/(<(code|pre|tt)>(?!)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/,lookbehind:!0,inside:{line:{pattern:e,lookbehind:!0,inside:{tag:a.languages.markup.tag,entity:a.languages.markup.entity,code:{pattern:/.+/,inside:a.languages.java,alias:"language-java"}}}}}],tag:a.languages.markup.tag,entity:a.languages.markup.entity}),a.languages.javadoclike.addSupport("java",a.languages.javadoc)}(Prism); \ No newline at end of file diff --git a/components/prism-javadoclike.js b/components/prism-javadoclike.js index 4768140937..187d2cd74a 100644 --- a/components/prism-javadoclike.js +++ b/components/prism-javadoclike.js @@ -2,13 +2,13 @@ var javaDocLike = Prism.languages.javadoclike = { 'parameter': { - pattern: /(^\s*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m, + pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m, lookbehind: true }, 'keyword': { // keywords are the first word in a line preceded be an `@` or surrounded by curly braces. // @word, {@word} - pattern: /(^\s*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m, + pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m, lookbehind: true }, 'punctuation': /[{}]/ diff --git a/components/prism-javadoclike.min.js b/components/prism-javadoclike.min.js index 1b2962c61d..52e19ba937 100644 --- a/components/prism-javadoclike.min.js +++ b/components/prism-javadoclike.min.js @@ -1 +1 @@ -!function(p){var a=p.languages.javadoclike={parameter:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(a,"addSupport",{value:function(a,e){"string"==typeof a&&(a=[a]),a.forEach(function(a){!function(a,e){var n="doc-comment",t=p.languages[a];if(t){var r=t[n];if(!r){var o={"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}};r=(t=p.languages.insertBefore(a,"comment",o))[n]}if(r instanceof RegExp&&(r=t[n]={pattern:r}),Array.isArray(r))for(var i=0,s=r.length;i|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }); -Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; +Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/; Prism.languages.insertBefore('javascript', 'keyword', { 'regex': { - pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + // eslint-disable-next-line regexp/no-dupe-characters-character-class + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, lookbehind: true, - greedy: true + greedy: true, + inside: { + 'regex-source': { + pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, + lookbehind: true, + alias: 'language-regex', + inside: Prism.languages.regex + }, + 'regex-delimiter': /^\/|\/$/, + 'regex-flags': /^[a-z]+$/, + } }, // This must be declared before keyword because we use "function" inside the look-forward 'function-variable': { - pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, + pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, alias: 'function' }, 'parameter': [ { - pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, + pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: true, inside: Prism.languages.javascript }, { - pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, + pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, + lookbehind: true, inside: Prism.languages.javascript }, { - pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, + pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: true, inside: Prism.languages.javascript }, { - pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, + pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, lookbehind: true, inside: Prism.languages.javascript } @@ -60,8 +99,13 @@ Prism.languages.insertBefore('javascript', 'keyword', { }); Prism.languages.insertBefore('javascript', 'string', { + 'hashbang': { + pattern: /^#!.*/, + greedy: true, + alias: 'comment' + }, 'template-string': { - pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/, + pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: true, inside: { 'template-punctuation': { @@ -69,11 +113,11 @@ Prism.languages.insertBefore('javascript', 'string', { alias: 'string' }, 'interpolation': { - pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/, + pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: true, inside: { 'interpolation-punctuation': { - pattern: /^\${|}$/, + pattern: /^\$\{|\}$/, alias: 'punctuation' }, rest: Prism.languages.javascript @@ -81,11 +125,32 @@ Prism.languages.insertBefore('javascript', 'string', { }, 'string': /[\s\S]+/ } + }, + 'string-property': { + pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, + lookbehind: true, + greedy: true, + alias: 'property' } }); +Prism.languages.insertBefore('javascript', 'operator', { + 'literal-property': { + pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, + lookbehind: true, + alias: 'property' + }, +}); + if (Prism.languages.markup) { Prism.languages.markup.tag.addInlined('script', 'javascript'); + + // add attribute support for all DOM events. + // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events + Prism.languages.markup.tag.addAttribute( + /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, + 'javascript' + ); } Prism.languages.js = Prism.languages.javascript; diff --git a/components/prism-javascript.min.js b/components/prism-javascript.min.js index 0faf69afcc..cfd9412ef9 100644 --- a/components/prism-javascript.min.js +++ b/components/prism-javascript.min.js @@ -1 +1 @@ -Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript; \ No newline at end of file +Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),Prism.languages.js=Prism.languages.javascript; \ No newline at end of file diff --git a/components/prism-javastacktrace.js b/components/prism-javastacktrace.js index 8c1b128ea1..b6cca6f7ca 100644 --- a/components/prism-javastacktrace.js +++ b/components/prism-javastacktrace.js @@ -1,3 +1,6 @@ +// Specification: +// https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/Throwable.html#printStackTrace() + Prism.languages.javastacktrace = { // java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...] @@ -6,10 +9,11 @@ Prism.languages.javastacktrace = { // Caused by: MidLevelException: LowLevelException // Suppressed: Resource$CloseFailException: Resource ID = 0 'summary': { - pattern: /^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?:\:.*)?$/m, + pattern: /^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m, + lookbehind: true, inside: { 'keyword': { - pattern: /^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m, + pattern: /^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m, lookbehind: true }, @@ -22,9 +26,9 @@ Prism.languages.javastacktrace = { pattern: /^(:?\s*)[\w$.]+(?=:|$)/, lookbehind: true, inside: { - 'class-name': /[\w$]+(?=$|:)/, - 'namespace': /[a-z]\w*/, - 'punctuation': /[.:]/ + 'class-name': /[\w$]+$/, + 'namespace': /\b[a-z]\w*\b/, + 'punctuation': /\./ } }, 'message': { @@ -32,31 +36,50 @@ Prism.languages.javastacktrace = { lookbehind: true, alias: 'string' }, - 'punctuation': /[:]/ + 'punctuation': /:/ } }, // at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) // at org.hsqldb.jdbc.Util.throwError(Unknown Source) here could be some notes + // at java.base/java.lang.Class.forName0(Native Method) // at Util.(Unknown Source) + // at com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101) + // at com.foo.loader//com.foo.bar.App.run(App.java:12) + // at acme@2.1/org.acme.Lib.test(Lib.java:80) + // at MyClass.mash(MyClass.java:9) + // + // More information: + // https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/StackTraceElement.html#toString() + // + // A valid Java module name is defined as: + // "A module name consists of one or more Java identifiers (§3.8) separated by "." tokens." + // https://docs.oracle.com/javase/specs/jls/se9/html/jls-6.html#jls-ModuleName + // + // A Java module version is defined by this class: + // https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleDescriptor.Version.html + // This is the implementation of the `parse` method in JDK13: + // https://github.com/matcdac/jdk/blob/2305df71d1b7710266ae0956d73927a225132c0f/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java#L1108 + // However, to keep this simple, a version will be matched by the pattern /@[\w$.+-]*/. 'stack-frame': { - pattern: /^[\t ]*at [\w$.]+(?:)?\([^()]*\)/m, + pattern: /^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m, + lookbehind: true, inside: { 'keyword': { - pattern: /^(\s*)at/, + pattern: /^(\s*)at(?= )/, lookbehind: true }, 'source': [ // (Main.java:15) // (Main.scala:15) { - pattern: /(\()\w+.\w+:\d+(?=\))/, + pattern: /(\()\w+\.\w+:\d+(?=\))/, lookbehind: true, inside: { 'file': /^\w+\.\w+/, 'punctuation': /:/, 'line-number': { - pattern: /\d+/, + pattern: /\b\d+\b/, alias: 'number' } } @@ -68,21 +91,47 @@ Prism.languages.javastacktrace = { pattern: /(\()[^()]*(?=\))/, lookbehind: true, inside: { - 'keyword': /^(?:Unknown Source|Native Method)$/ + 'keyword': /^(?:Native Method|Unknown Source)$/ } } ], 'class-name': /[\w$]+(?=\.(?:|[\w$]+)\()/, 'function': /(?:|[\w$]+)(?=\()/, - 'namespace': /[a-z]\w*/, - 'punctuation': /[.()]/ + 'class-loader': { + pattern: /(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/, + lookbehind: true, + alias: 'namespace', + inside: { + 'punctuation': /\./ + } + }, + 'module': { + pattern: /([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/, + lookbehind: true, + inside: { + 'version': { + pattern: /(@)[\s\S]+/, + lookbehind: true, + alias: 'number' + }, + 'punctuation': /[@.]/ + } + }, + 'namespace': { + pattern: /(?:\b[a-z]\w*\.)+/, + inside: { + 'punctuation': /\./ + } + }, + 'punctuation': /[()/.]/ } }, // ... 32 more // ... 32 common frames omitted 'more': { - pattern: /^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m, + pattern: /^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m, + lookbehind: true, inside: { 'punctuation': /\.{3}/, 'number': /\d+/, diff --git a/components/prism-javastacktrace.min.js b/components/prism-javastacktrace.min.js index fe64b1c2aa..0c5949c69d 100644 --- a/components/prism-javastacktrace.min.js +++ b/components/prism-javastacktrace.min.js @@ -1 +1 @@ -Prism.languages.javastacktrace={summary:{pattern:/^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?:\:.*)?$/m,inside:{keyword:{pattern:/^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+(?=$|:)/,namespace:/[a-z]\w*/,punctuation:/[.:]/}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/[:]/}},"stack-frame":{pattern:/^[\t ]*at [\w$.]+(?:)?\([^()]*\)/m,inside:{keyword:{pattern:/^(\s*)at/,lookbehind:!0},source:[{pattern:/(\()\w+.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\d+/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Unknown Source|Native Method)$/}}],"class-name":/[\w$]+(?=\.(?:|[\w$]+)\()/,function:/(?:|[\w$]+)(?=\()/,namespace:/[a-z]\w*/,punctuation:/[.()]/}},more:{pattern:/^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}}; \ No newline at end of file +Prism.languages.javastacktrace={summary:{pattern:/^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,lookbehind:!0,inside:{keyword:{pattern:/^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+$/,namespace:/\b[a-z]\w*\b/,punctuation:/\./}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/:/}},"stack-frame":{pattern:/^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m,lookbehind:!0,inside:{keyword:{pattern:/^(\s*)at(?= )/,lookbehind:!0},source:[{pattern:/(\()\w+\.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\b\d+\b/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Native Method|Unknown Source)$/}}],"class-name":/[\w$]+(?=\.(?:|[\w$]+)\()/,function:/(?:|[\w$]+)(?=\()/,"class-loader":{pattern:/(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,lookbehind:!0,alias:"namespace",inside:{punctuation:/\./}},module:{pattern:/([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,lookbehind:!0,inside:{version:{pattern:/(@)[\s\S]+/,lookbehind:!0,alias:"number"},punctuation:/[@.]/}},namespace:{pattern:/(?:\b[a-z]\w*\.)+/,inside:{punctuation:/\./}},punctuation:/[()/.]/}},more:{pattern:/^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m,lookbehind:!0,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}}; \ No newline at end of file diff --git a/components/prism-jexl.js b/components/prism-jexl.js new file mode 100644 index 0000000000..6268ae2a80 --- /dev/null +++ b/components/prism-jexl.js @@ -0,0 +1,14 @@ +Prism.languages.jexl = { + 'string': /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/, + 'transform': { + pattern: /(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/, + alias: 'function', + lookbehind: true + }, + 'function': /[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/, + 'number': /\b\d+(?:\.\d+)?\b|\B\.\d+\b/, + 'operator': /[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/, + 'boolean': /\b(?:false|true)\b/, + 'keyword': /\bin\b/, + 'punctuation': /[{}[\](),.]/, +}; diff --git a/components/prism-jexl.min.js b/components/prism-jexl.min.js new file mode 100644 index 0000000000..0586edfa19 --- /dev/null +++ b/components/prism-jexl.min.js @@ -0,0 +1 @@ +Prism.languages.jexl={string:/(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,transform:{pattern:/(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,alias:"function",lookbehind:!0},function:/[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,number:/\b\d+(?:\.\d+)?\b|\B\.\d+\b/,operator:/[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,boolean:/\b(?:false|true)\b/,keyword:/\bin\b/,punctuation:/[{}[\](),.]/}; \ No newline at end of file diff --git a/components/prism-jolie.js b/components/prism-jolie.js index 9d2c698d27..6b54f86472 100644 --- a/components/prism-jolie.js +++ b/components/prism-jolie.js @@ -1,55 +1,41 @@ Prism.languages.jolie = Prism.languages.extend('clike', { - 'keyword': /\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/, - 'builtin': /\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/, - 'number': /(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?l?/i, - 'operator': /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/, - 'symbol': /[|;@]/, - 'punctuation': /[,.]/, 'string': { - pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + pattern: /(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/, + lookbehind: true, greedy: true - } -}); - -delete Prism.languages.jolie['class-name']; - -Prism.languages.insertBefore( 'jolie', 'keyword', { - 'function': - { - pattern: /((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/, + }, + 'class-name': { + pattern: /((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/, lookbehind: true }, + 'keyword': /\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/, + 'function': /\b[a-z_]\w*(?=[ \t]*[@(])/i, + 'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i, + 'operator': /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/, + 'punctuation': /[()[\]{},;.:]/, + 'builtin': /\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/ +}); + +Prism.languages.insertBefore('jolie', 'keyword', { 'aggregates': { pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/, lookbehind: true, inside: { - 'with-extension': { - pattern: /\bwith\s+\w+/, - inside: { - 'keyword' : /\bwith\b/ - } - }, - 'function': { - pattern: /\w+/ - }, - 'punctuation': { - pattern: /,/ - } + 'keyword': /\bwith\b/, + 'class-name': /\w+/, + 'punctuation': /,/ } }, 'redirects': { pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/, lookbehind: true, inside: { - 'punctuation': { - pattern: /,/ - }, - 'function': { - pattern: /\w+/ - }, - 'symbol': { - pattern: /=>/ - } + 'punctuation': /,/, + 'class-name': /\w+/, + 'operator': /=>/ } + }, + 'property': { + pattern: /\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/ } }); diff --git a/components/prism-jolie.min.js b/components/prism-jolie.min.js index 2d590be980..1ee8f0f3df 100644 --- a/components/prism-jolie.min.js +++ b/components/prism-jolie.min.js @@ -1 +1 @@ -Prism.languages.jolie=Prism.languages.extend("clike",{keyword:/\b(?:include|define|is_defined|undef|main|init|outputPort|inputPort|Location|Protocol|Interfaces|RequestResponse|OneWay|type|interface|extender|throws|cset|csets|forward|Aggregates|Redirects|embedded|courier|execution|sequential|concurrent|single|scope|install|throw|comp|cH|default|global|linkIn|linkOut|synchronized|this|new|for|if|else|while|in|Jolie|Java|Javascript|nullProcess|spawn|constants|with|provide|until|exit|foreach|instanceof|over|service)\b/,builtin:/\b(?:undefined|string|int|void|long|Byte|bool|double|float|char|any)\b/,number:/(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?l?/i,operator:/-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[:?\/%^]/,symbol:/[|;@]/,punctuation:/[,.]/,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0}}),delete Prism.languages.jolie["class-name"],Prism.languages.insertBefore("jolie","keyword",{function:{pattern:/((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,lookbehind:!0},aggregates:{pattern:/(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,lookbehind:!0,inside:{"with-extension":{pattern:/\bwith\s+\w+/,inside:{keyword:/\bwith\b/}},function:{pattern:/\w+/},punctuation:{pattern:/,/}}},redirects:{pattern:/(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,lookbehind:!0,inside:{punctuation:{pattern:/,/},function:{pattern:/\w+/},symbol:{pattern:/=>/}}}}); \ No newline at end of file +Prism.languages.jolie=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/,lookbehind:!0,greedy:!0},"class-name":{pattern:/((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/,lookbehind:!0},keyword:/\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/,function:/\b[a-z_]\w*(?=[ \t]*[@(])/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i,operator:/-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/,punctuation:/[()[\]{},;.:]/,builtin:/\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/}),Prism.languages.insertBefore("jolie","keyword",{aggregates:{pattern:/(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,lookbehind:!0,inside:{keyword:/\bwith\b/,"class-name":/\w+/,punctuation:/,/}},redirects:{pattern:/(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,lookbehind:!0,inside:{punctuation:/,/,"class-name":/\w+/,operator:/=>/}},property:{pattern:/\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/}}); \ No newline at end of file diff --git a/components/prism-jq.js b/components/prism-jq.js index ee44b3a0c3..3cc030e72f 100644 --- a/components/prism-jq.js +++ b/components/prism-jq.js @@ -1,7 +1,7 @@ (function (Prism) { var interpolation = /\\\((?:[^()]|\([^()]*\))*\)/.source; - var string = RegExp(/"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g, function () { return interpolation; })); + var string = RegExp(/(^|[^\\])"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g, function () { return interpolation; })); var stringInterpolation = { 'interpolation': { pattern: RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + interpolation), @@ -21,11 +21,13 @@ 'comment': /#.*/, 'property': { pattern: RegExp(string.source + /(?=\s*:(?!:))/.source), + lookbehind: true, greedy: true, inside: stringInterpolation }, 'string': { pattern: string, + lookbehind: true, greedy: true, inside: stringInterpolation }, @@ -41,7 +43,7 @@ alias: 'property' }, 'keyword': /\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/, - 'boolean': /\b(?:true|false)\b/, + 'boolean': /\b(?:false|true)\b/, 'number': /(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/, 'operator': [ @@ -49,7 +51,7 @@ pattern: /\|=?/, alias: 'pipe' }, - /\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|or|not)\b/ + /\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/ ], 'c-style-function': { pattern: /\b[a-z_]\w*(?=\s*\()/i, @@ -60,7 +62,7 @@ pattern: /\./, alias: 'important' } - } + }; stringInterpolation.interpolation.inside.content.inside = jq; diff --git a/components/prism-jq.min.js b/components/prism-jq.min.js index 9ace5cf92c..e96a55f710 100644 --- a/components/prism-jq.min.js +++ b/components/prism-jq.min.js @@ -1 +1 @@ -!function(e){var n="\\\\\\((?:[^()]|\\([^()]*\\))*\\)",t=RegExp('"(?:[^"\r\n\\\\]|\\\\[^\r\n(]|__)*"'.replace(/__/g,function(){return n})),i={interpolation:{pattern:RegExp("((?:^|[^\\\\])(?:\\\\{2})*)"+n),lookbehind:!0,inside:{content:{pattern:/^(\\\()[\s\S]+(?=\)$)/,lookbehind:!0,inside:null},punctuation:/^\\\(|\)$/}}},a=e.languages.jq={comment:/#.*/,property:{pattern:RegExp(t.source+"(?=\\s*:(?!:))"),greedy:!0,inside:i},string:{pattern:t,greedy:!0,inside:i},function:{pattern:/(\bdef\s+)[a-z_]\w+/i,lookbehind:!0},variable:/\B\$\w+/,"property-literal":{pattern:/\b[a-z_]\w*(?=\s*:(?!:))/i,alias:"property"},keyword:/\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/,boolean:/\b(?:true|false)\b/,number:/(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/,operator:[{pattern:/\|=?/,alias:"pipe"},/\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|or|not)\b/],"c-style-function":{pattern:/\b[a-z_]\w*(?=\s*\()/i,alias:"function"},punctuation:/::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/,dot:{pattern:/\./,alias:"important"}};i.interpolation.inside.content.inside=a}(Prism); \ No newline at end of file +!function(e){var n="\\\\\\((?:[^()]|\\([^()]*\\))*\\)",t=RegExp('(^|[^\\\\])"(?:[^"\r\n\\\\]|\\\\[^\r\n(]|__)*"'.replace(/__/g,function(){return n})),i={interpolation:{pattern:RegExp("((?:^|[^\\\\])(?:\\\\{2})*)"+n),lookbehind:!0,inside:{content:{pattern:/^(\\\()[\s\S]+(?=\)$)/,lookbehind:!0,inside:null},punctuation:/^\\\(|\)$/}}},a=e.languages.jq={comment:/#.*/,property:{pattern:RegExp(t.source+"(?=\\s*:(?!:))"),lookbehind:!0,greedy:!0,inside:i},string:{pattern:t,lookbehind:!0,greedy:!0,inside:i},function:{pattern:/(\bdef\s+)[a-z_]\w+/i,lookbehind:!0},variable:/\B\$\w+/,"property-literal":{pattern:/\b[a-z_]\w*(?=\s*:(?!:))/i,alias:"property"},keyword:/\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/,boolean:/\b(?:false|true)\b/,number:/(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/,operator:[{pattern:/\|=?/,alias:"pipe"},/\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/],"c-style-function":{pattern:/\b[a-z_]\w*(?=\s*\()/i,alias:"function"},punctuation:/::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/,dot:{pattern:/\./,alias:"important"}};i.interpolation.inside.content.inside=a}(Prism); \ No newline at end of file diff --git a/components/prism-js-extras.js b/components/prism-js-extras.js index 2b8a77eae9..64cac5af9b 100644 --- a/components/prism-js-extras.js +++ b/components/prism-js-extras.js @@ -21,7 +21,7 @@ { // standard built-ins // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - pattern: /\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/, + pattern: /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/, alias: 'class-name' }, { @@ -32,11 +32,42 @@ ] }); + /** + * Replaces the `` placeholder in the given pattern with a pattern for general JS identifiers. + * + * @param {string} source + * @param {string} [flags] + * @returns {RegExp} + */ + function withId(source, flags) { + return RegExp( + source.replace(//g, function () { return /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source; }), + flags); + } + Prism.languages.insertBefore('javascript', 'keyword', { + 'imports': { + // https://tc39.es/ecma262/#sec-imports + pattern: withId(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source), + lookbehind: true, + inside: Prism.languages.javascript + }, + 'exports': { + // https://tc39.es/ecma262/#sec-exports + pattern: withId(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source), + lookbehind: true, + inside: Prism.languages.javascript + } + }); + Prism.languages.javascript['keyword'].unshift( { pattern: /\b(?:as|default|export|from|import)\b/, alias: 'module' }, + { + pattern: /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/, + alias: 'control-flow' + }, { pattern: /\bnull\b/, alias: ['null', 'nil'] @@ -60,7 +91,7 @@ Prism.languages.insertBefore('javascript', 'punctuation', { 'property-access': { - pattern: /(\.\s*)#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/, + pattern: withId(/(\.\s*)#?/.source), lookbehind: true }, 'maybe-class-name': { @@ -69,7 +100,7 @@ }, 'dom': { // this contains only a few commonly used DOM variables - pattern: /\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/, + pattern: /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/, alias: 'variable' }, 'console': { diff --git a/components/prism-js-extras.min.js b/components/prism-js-extras.min.js index 7a5aa0fce6..390d8edd4f 100644 --- a/components/prism-js-extras.min.js +++ b/components/prism-js-extras.min.js @@ -1 +1 @@ -!function(a){a.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+a.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),a.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+a.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),a.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),a.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),a.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),a.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:/(\.\s*)#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/,lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var e=["function","function-variable","method","method-variable","property-access"],t=0;t/g,function(){return"(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*"}),e)}a.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+a.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),a.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+a.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),a.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),a.languages.insertBefore("javascript","keyword",{imports:{pattern:e("(\\bimport\\b\\s*)(?:(?:\\s*,\\s*(?:\\*\\s*as\\s+|\\{[^{}]*\\}))?|\\*\\s*as\\s+|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)"),lookbehind:!0,inside:a.languages.javascript},exports:{pattern:e("(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})"),lookbehind:!0,inside:a.languages.javascript}}),a.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),a.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),a.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e("(\\.\\s*)#?"),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var t=["function","function-variable","method","method-variable","property-access"],r=0;r=v.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=v[f],i="string"==typeof r?r:r.content,o=i.indexOf(a);if(-1!==o){++f;var s=i.substring(0,o),p=d(y[a]),l=i.substring(o+a.length),g=[];if(s&&g.push(s),g.push(p),l){var u=[l];e(u),g.push.apply(g,u)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(g)),n+=g.length-1):r.content=g}}else{var c=r.content;Array.isArray(c)?e(c):e([c])}}}(n),new u.Token(i,n,"language-"+i,a)}u.languages.javascript["template-string"]=[t("css","\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)"),t("html","\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?="),t("svg","\\bsvg"),t("markdown","\\b(?:md|markdown)"),t("graphql","\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)"),e].filter(Boolean);var s={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}u.hooks.add("after-tokenize",function(e){e.language in s&&!function e(t){for(var n=0,r=t.length;n=v.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=v[f],i="string"==typeof r?r:r.content,s=i.indexOf(a);if(-1!==s){++f;var o=i.substring(0,s),p=d(y[a]),l=i.substring(s+a.length),g=[];if(o&&g.push(o),g.push(p),l){var u=[l];e(u),g.push.apply(g,u)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(g)),n+=g.length-1):r.content=g}}else{var c=r.content;Array.isArray(c)?e(c):e([c])}}}(n),new u.Token(i,n,"language-"+i,a)}u.languages.javascript["template-string"]=[t("css","\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)"),t("html","\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?="),t("svg","\\bsvg"),t("markdown","\\b(?:markdown|md)"),t("graphql","\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)"),t("sql","\\bsql"),e].filter(Boolean);var o={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}u.hooks.add("after-tokenize",function(e){e.language in o&&!function e(t){for(var n=0,r=t.length;n\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g, function () { return type; })), + pattern: RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g, function () { return type; })), lookbehind: true, inside: { 'punctuation': /\./ @@ -60,11 +60,11 @@ } ], 'example': { - pattern: /(@example\s+)[^@]+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/, + pattern: /(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/, lookbehind: true, inside: { 'code': { - pattern: /^(\s*(?:\*\s*)?).+$/m, + pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m, lookbehind: true, inside: javascript, alias: 'language-javascript' diff --git a/components/prism-jsdoc.min.js b/components/prism-jsdoc.min.js index 877255c533..66a5557f43 100644 --- a/components/prism-jsdoc.min.js +++ b/components/prism-jsdoc.min.js @@ -1 +1 @@ -!function(e){var a=e.languages.javascript,n="{(?:[^{}]|{(?:[^{}]|{[^{}]*})*})+}",t="(@(?:param|arg|argument|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(t+"[$\\w\\xA0-\\uFFFF.]+(?=\\s|$)"),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(t+"\\[[$\\w\\xA0-\\uFFFF.]+(?:=[^[\\]]+)?\\](?=\\s|$)"),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:a,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp("(@(?:augments|extends|class|interface|memberof!?|template|this|typedef)\\s+(?:\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*".replace(//g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:a.string,number:a.number,boolean:a.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+)[^@]+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^(\s*(?:\*\s*)?).+$/m,lookbehind:!0,inside:a,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(Prism); \ No newline at end of file +!function(e){var a=e.languages.javascript,n="\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}",t="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(t+"(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)"),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(t+"\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)"),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:a,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp("(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*".replace(//g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:a.string,number:a.number,boolean:a.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:a,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(Prism); \ No newline at end of file diff --git a/components/prism-json.js b/components/prism-json.js index 07c4ea5dac..e1fe04dbe3 100644 --- a/components/prism-json.js +++ b/components/prism-json.js @@ -1,11 +1,13 @@ // https://www.json.org/json-en.html Prism.languages.json = { 'property': { - pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, + pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, + lookbehind: true, greedy: true }, 'string': { - pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, + pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, + lookbehind: true, greedy: true }, 'comment': { @@ -15,7 +17,7 @@ Prism.languages.json = { 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, 'punctuation': /[{}[\],]/, 'operator': /:/, - 'boolean': /\b(?:true|false)\b/, + 'boolean': /\b(?:false|true)\b/, 'null': { pattern: /\bnull\b/, alias: 'keyword' diff --git a/components/prism-json.min.js b/components/prism-json.min.js index 8315a59a24..4256f8200d 100644 --- a/components/prism-json.min.js +++ b/components/prism-json.min.js @@ -1 +1 @@ -Prism.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json; \ No newline at end of file +Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json; \ No newline at end of file diff --git a/components/prism-json5.js b/components/prism-json5.js index 7b8858fab5..c8cccad9ce 100644 --- a/components/prism-json5.js +++ b/components/prism-json5.js @@ -1,6 +1,6 @@ (function (Prism) { - var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/ + var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/; Prism.languages.json5 = Prism.languages.extend('json', { 'property': [ @@ -9,7 +9,7 @@ greedy: true }, { - pattern: /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*:)/, + pattern: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/, alias: 'unquoted' } ], @@ -17,7 +17,7 @@ pattern: string, greedy: true }, - 'number': /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+\b)?/ + 'number': /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/ }); }(Prism)); diff --git a/components/prism-json5.min.js b/components/prism-json5.min.js index b557751432..359d02f2d1 100644 --- a/components/prism-json5.min.js +++ b/components/prism-json5.min.js @@ -1 +1 @@ -!function(n){var e=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;n.languages.json5=n.languages.extend("json",{property:[{pattern:RegExp(e.source+"(?=\\s*:)"),greedy:!0},{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*:)/,alias:"unquoted"}],string:{pattern:e,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}(Prism); \ No newline at end of file +!function(n){var e=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;n.languages.json5=n.languages.extend("json",{property:[{pattern:RegExp(e.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:e,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}(Prism); \ No newline at end of file diff --git a/components/prism-jsonp.js b/components/prism-jsonp.js index c942015776..c910aae09b 100644 --- a/components/prism-jsonp.js +++ b/components/prism-jsonp.js @@ -3,5 +3,5 @@ Prism.languages.jsonp = Prism.languages.extend('json', { }); Prism.languages.insertBefore('jsonp', 'punctuation', { - 'function': /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/ + 'function': /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/ }); diff --git a/components/prism-jsonp.min.js b/components/prism-jsonp.min.js index 6cc59d6db2..9717ded0ea 100644 --- a/components/prism-jsonp.min.js +++ b/components/prism-jsonp.min.js @@ -1 +1 @@ -Prism.languages.jsonp=Prism.languages.extend("json",{punctuation:/[{}[\]();,.]/}),Prism.languages.insertBefore("jsonp","punctuation",{function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/}); \ No newline at end of file +Prism.languages.jsonp=Prism.languages.extend("json",{punctuation:/[{}[\]();,.]/}),Prism.languages.insertBefore("jsonp","punctuation",{function:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/}); \ No newline at end of file diff --git a/components/prism-jsstacktrace.js b/components/prism-jsstacktrace.js index 161c3546fc..690fe7b56d 100644 --- a/components/prism-jsstacktrace.js +++ b/components/prism-jsstacktrace.js @@ -3,46 +3,47 @@ Prism.languages.jsstacktrace = { pattern: /^\S.*/m, alias: 'string' }, - + 'stack-frame': { - pattern: /^[ \t]+at[ \t]+.*/m, + pattern: /(^[ \t]+)at[ \t].*/m, + lookbehind: true, inside: { 'not-my-code': { - pattern: /[ \t]+at[ \t]+(?:node\.js|\|.*(?:node_modules|\(\\)|\(\|\$|\(internal\/|\(node\.js)).*/m, + pattern: /^at[ \t]+(?!\s)(?:node\.js||.*(?:node_modules|\(\)|\(|$|\(internal\/|\(node\.js)).*/m, alias: 'comment' }, - + 'filename': { - pattern: /(\bat\s+|\()(?:[a-zA-Z]:)?[^():]+(?=:)/, + pattern: /(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/, lookbehind: true, alias: 'url' }, - + 'function': { - pattern: /(at\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, + pattern: /(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, lookbehind: true, inside: { 'punctuation': /\./ } }, - + 'punctuation': /[()]/, - + 'keyword': /\b(?:at|new)\b/, - + 'alias': { - pattern: /\[(?:as\s+)?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/, + pattern: /\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/, alias: 'variable' }, - + 'line-number': { - pattern: /:[0-9]+(?::[0-9]+)?\b/, + pattern: /:\d+(?::\d+)?\b/, alias: 'number', inside: { 'punctuation': /:/ } }, - + } } -} +}; diff --git a/components/prism-jsstacktrace.min.js b/components/prism-jsstacktrace.min.js index caad56d23d..328156a476 100644 --- a/components/prism-jsstacktrace.min.js +++ b/components/prism-jsstacktrace.min.js @@ -1 +1 @@ -Prism.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/^[ \t]+at[ \t]+.*/m,inside:{"not-my-code":{pattern:/[ \t]+at[ \t]+(?:node\.js|\|.*(?:node_modules|\(\\)|\(\|\$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(at\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:[0-9]+(?::[0-9]+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}; \ No newline at end of file +Prism.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/(^[ \t]+)at[ \t].*/m,lookbehind:!0,inside:{"not-my-code":{pattern:/^at[ \t]+(?!\s)(?:node\.js||.*(?:node_modules|\(\)|\(|$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:\d+(?::\d+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}; \ No newline at end of file diff --git a/components/prism-jsx.js b/components/prism-jsx.js index 30e6e3f4c6..ac6c2d6424 100644 --- a/components/prism-jsx.js +++ b/components/prism-jsx.js @@ -1,126 +1,145 @@ -(function(Prism) { +(function (Prism) { + + var javascript = Prism.util.clone(Prism.languages.javascript); + + var space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source; + var braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source; + var spread = /(?:\{*\.{3}(?:[^{}]|)*\})/.source; + + /** + * @param {string} source + * @param {string} [flags] + */ + function re(source, flags) { + source = source + .replace(//g, function () { return space; }) + .replace(//g, function () { return braces; }) + .replace(//g, function () { return spread; }); + return RegExp(source, flags); + } + + spread = re(spread).source; -var javascript = Prism.util.clone(Prism.languages.javascript); -Prism.languages.jsx = Prism.languages.extend('markup', javascript); -Prism.languages.jsx.tag.pattern= /<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:$-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i; + Prism.languages.jsx = Prism.languages.extend('markup', javascript); + Prism.languages.jsx.tag.pattern = re( + /<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source + ); -Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i; -Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i; -Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/; + Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/; + Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/; + Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/; + Prism.languages.jsx.tag.inside['comment'] = javascript['comment']; -Prism.languages.insertBefore('inside', 'attr-name', { - 'spread': { - pattern: /\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}/, - inside: { - 'punctuation': /\.{3}|[{}.]/, - 'attr-value': /\w+/ + Prism.languages.insertBefore('inside', 'attr-name', { + 'spread': { + pattern: re(//.source), + inside: Prism.languages.jsx } - } -}, Prism.languages.jsx.tag); - -Prism.languages.insertBefore('inside', 'attr-value',{ - 'script': { - // Allow for two levels of nesting - pattern: /=(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/i, - inside: { - 'script-punctuation': { - pattern: /^=(?={)/, - alias: 'punctuation' + }, Prism.languages.jsx.tag); + + Prism.languages.insertBefore('inside', 'special-attr', { + 'script': { + // Allow for two levels of nesting + pattern: re(/=/.source), + alias: 'language-javascript', + inside: { + 'script-punctuation': { + pattern: /^=(?=\{)/, + alias: 'punctuation' + }, + rest: Prism.languages.jsx }, - rest: Prism.languages.jsx - }, - 'alias': 'language-javascript' - } -}, Prism.languages.jsx.tag); + } + }, Prism.languages.jsx.tag); -// The following will handle plain text inside tags -var stringifyToken = function (token) { - if (!token) { - return ''; - } - if (typeof token === 'string') { - return token; - } - if (typeof token.content === 'string') { - return token.content; - } - return token.content.map(stringifyToken).join(''); -}; - -var walkTokens = function (tokens) { - var openedTags = []; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - var notTagNorBrace = false; - - if (typeof token !== 'string') { - if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') { - // We found a tag, now find its kind - - if (token.content[0].content[0].content === ' 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) { - // Pop matching opening tag - openedTags.pop(); - } - } else { - if (token.content[token.content.length - 1].content === '/>') { - // Autoclosed tag, ignore + // The following will handle plain text inside tags + var stringifyToken = function (token) { + if (!token) { + return ''; + } + if (typeof token === 'string') { + return token; + } + if (typeof token.content === 'string') { + return token.content; + } + return token.content.map(stringifyToken).join(''); + }; + + var walkTokens = function (tokens) { + var openedTags = []; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + var notTagNorBrace = false; + + if (typeof token !== 'string') { + if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') { + // We found a tag, now find its kind + + if (token.content[0].content[0].content === ' 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) { + // Pop matching opening tag + openedTags.pop(); + } } else { - // Opening tag - openedTags.push({ - tagName: stringifyToken(token.content[0].content[1]), - openedBraces: 0 - }); + if (token.content[token.content.length - 1].content === '/>') { + // Autoclosed tag, ignore + } else { + // Opening tag + openedTags.push({ + tagName: stringifyToken(token.content[0].content[1]), + openedBraces: 0 + }); + } } - } - } else if (openedTags.length > 0 && token.type === 'punctuation' && token.content === '{') { + } else if (openedTags.length > 0 && token.type === 'punctuation' && token.content === '{') { - // Here we might have entered a JSX context inside a tag - openedTags[openedTags.length - 1].openedBraces++; + // Here we might have entered a JSX context inside a tag + openedTags[openedTags.length - 1].openedBraces++; - } else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') { + } else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') { - // Here we might have left a JSX context inside a tag - openedTags[openedTags.length - 1].openedBraces--; + // Here we might have left a JSX context inside a tag + openedTags[openedTags.length - 1].openedBraces--; - } else { - notTagNorBrace = true - } - } - if (notTagNorBrace || typeof token === 'string') { - if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) { - // Here we are inside a tag, and not inside a JSX context. - // That's plain text: drop any tokens matched. - var plainText = stringifyToken(token); - - // And merge text with adjacent text - if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) { - plainText += stringifyToken(tokens[i + 1]); - tokens.splice(i + 1, 1); + } else { + notTagNorBrace = true; } - if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) { - plainText = stringifyToken(tokens[i - 1]) + plainText; - tokens.splice(i - 1, 1); - i--; + } + if (notTagNorBrace || typeof token === 'string') { + if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) { + // Here we are inside a tag, and not inside a JSX context. + // That's plain text: drop any tokens matched. + var plainText = stringifyToken(token); + + // And merge text with adjacent text + if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) { + plainText += stringifyToken(tokens[i + 1]); + tokens.splice(i + 1, 1); + } + if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) { + plainText = stringifyToken(tokens[i - 1]) + plainText; + tokens.splice(i - 1, 1); + i--; + } + + tokens[i] = new Prism.Token('plain-text', plainText, null, plainText); } + } - tokens[i] = new Prism.Token('plain-text', plainText, null, plainText); + if (token.content && typeof token.content !== 'string') { + walkTokens(token.content); } } + }; - if (token.content && typeof token.content !== 'string') { - walkTokens(token.content); + Prism.hooks.add('after-tokenize', function (env) { + if (env.language !== 'jsx' && env.language !== 'tsx') { + return; } - } -}; - -Prism.hooks.add('after-tokenize', function (env) { - if (env.language !== 'jsx' && env.language !== 'tsx') { - return; - } - walkTokens(env.tokens); -}); + walkTokens(env.tokens); + }); }(Prism)); diff --git a/components/prism-jsx.min.js b/components/prism-jsx.min.js index 81390211bc..0534a54e86 100644 --- a/components/prism-jsx.min.js +++ b/components/prism-jsx.min.js @@ -1 +1 @@ -!function(i){var t=i.util.clone(i.languages.javascript);i.languages.jsx=i.languages.extend("markup",t),i.languages.jsx.tag.pattern=/<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:$-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i,i.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,i.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i,i.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,i.languages.insertBefore("inside","attr-name",{spread:{pattern:/\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}/,inside:{punctuation:/\.{3}|[{}.]/,"attr-value":/\w+/}}},i.languages.jsx.tag),i.languages.insertBefore("inside","attr-value",{script:{pattern:/=(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/i,inside:{"script-punctuation":{pattern:/^=(?={)/,alias:"punctuation"},rest:i.languages.jsx},alias:"language-javascript"}},i.languages.jsx.tag);var o=function(t){return t?"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(o).join(""):""},p=function(t){for(var n=[],e=0;e"===a.content[a.content.length-1].content||n.push({tagName:o(a.content[0].content[1]),openedBraces:0}):0*\\.{3}(?:[^{}]|)*\\})";function n(t,n){return t=t.replace(//g,function(){return"(?:\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))\\*/)"}).replace(//g,function(){return"(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})"}).replace(//g,function(){return e}),RegExp(t,n)}e=n(e).source,o.languages.jsx=o.languages.extend("markup",t),o.languages.jsx.tag.pattern=n("+(?:[\\w.:$-]+(?:=(?:\"(?:\\\\[^]|[^\\\\\"])*\"|'(?:\\\\[^]|[^\\\\'])*'|[^\\s{'\"/>=]+|))?|))**/?)?>"),o.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,o.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,o.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,o.languages.jsx.tag.inside.comment=t.comment,o.languages.insertBefore("inside","attr-name",{spread:{pattern:n(""),inside:o.languages.jsx}},o.languages.jsx.tag),o.languages.insertBefore("inside","special-attr",{script:{pattern:n("="),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:o.languages.jsx}}},o.languages.jsx.tag);var i=function(t){return t?"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(i).join(""):""},r=function(t){for(var n=[],e=0;e"===a.content[a.content.length-1].content||n.push({tagName:i(a.content[0].content[1]),openedBraces:0}):0]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/, 'punctuation': /::?|[{}[\]();,.?]/, // https://docs.julialang.org/en/v1/base/numbers/#Base.im - 'constant': /\b(?:(?:NaN|Inf)(?:16|32|64)?|im|pi|e|catalan|eulergamma|golden)\b|[πℯγφ]/ + 'constant': /\b(?:(?:Inf|NaN)(?:16|32|64)?|im|pi)\b|[πℯ]/ }; diff --git a/components/prism-julia.min.js b/components/prism-julia.min.js index 7bed6d84a3..b677d30824 100644 --- a/components/prism-julia.min.js +++ b/components/prism-julia.min.js @@ -1 +1 @@ -Prism.languages.julia={comment:{pattern:/(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,lookbehind:!0},regex:{pattern:/r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,greedy:!0},string:{pattern:/"""[\s\S]+?"""|\w*"(?:\\.|[^"\\\r\n])*"|(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'|`(?:[^\\`\r\n]|\\.)*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,boolean:/\b(?:true|false)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*\.?(?:\d+(?:_\d+)*)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,operator:/&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,punctuation:/::?|[{}[\]();,.?]/,constant:/\b(?:(?:NaN|Inf)(?:16|32|64)?|im|pi|e|catalan|eulergamma|golden)\b|[πℯγφ]/}; \ No newline at end of file +Prism.languages.julia={comment:{pattern:/(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,lookbehind:!0},regex:{pattern:/r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,greedy:!0},string:{pattern:/"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|`(?:[^\\`\r\n]|\\.)*`/,greedy:!0},char:{pattern:/(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'/,lookbehind:!0,greedy:!0},keyword:/\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,boolean:/\b(?:false|true)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,operator:/&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,punctuation:/::?|[{}[\]();,.?]/,constant:/\b(?:(?:Inf|NaN)(?:16|32|64)?|im|pi)\b|[πℯ]/}; \ No newline at end of file diff --git a/components/prism-keepalived.js b/components/prism-keepalived.js new file mode 100644 index 0000000000..70a99944ba --- /dev/null +++ b/components/prism-keepalived.js @@ -0,0 +1,51 @@ +Prism.languages.keepalived = { + 'comment': { + pattern: /[#!].*/, + greedy: true + }, + 'string': { + pattern: /(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/, + lookbehind: true, + greedy: true + }, + + // support IPv4, IPv6, subnet mask + 'ip': { + pattern: RegExp( + /\b(?:(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){5}:(?:[\da-f]{1,4}:)?[\da-f]{1,4}|(?:[\da-f]{1,4}:){4}:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4}|(?:[\da-f]{1,4}:){3}:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4}|(?:[\da-f]{1,4}:){2}:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}|(?:[\da-f]{1,4}:){0,5}:|::(?:[\da-f]{1,4}:){0,5}|[\da-f]{1,4}::(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4}|::(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:)(?:\/\d{1,3})?|(?:\/\d{1,2})?)\b/.source + .replace(//g, function () { return /(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d))/.source; }), + 'i' + ), + alias: 'number' + }, + + // support *nix / Windows, directory / file + 'path': { + pattern: /(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/, + lookbehind: true, + alias: 'string', + }, + 'variable': /\$\{?\w+\}?/, + 'email': { + pattern: /[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/, + alias: 'string', + }, + 'conditional-configuration': { + pattern: /@\^?[\w-]+/, + alias: 'variable' + }, + 'operator': /=/, + + 'property': /\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/, + + 'constant': /\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/, + + 'number': { + pattern: /(^|[^\w.-])-?\d+(?:\.\d+)?/, + lookbehind: true + }, + + 'boolean': /\b(?:false|no|off|on|true|yes)\b/, + + 'punctuation': /[\{\}]/ +}; diff --git a/components/prism-keepalived.min.js b/components/prism-keepalived.min.js new file mode 100644 index 0000000000..e5eb79b5f3 --- /dev/null +++ b/components/prism-keepalived.min.js @@ -0,0 +1 @@ +Prism.languages.keepalived={comment:{pattern:/[#!].*/,greedy:!0},string:{pattern:/(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,lookbehind:!0,greedy:!0},ip:{pattern:RegExp("\\b(?:(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){5}:(?:[\\da-f]{1,4}:)?[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){4}:(?:[\\da-f]{1,4}:){0,2}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){3}:(?:[\\da-f]{1,4}:){0,3}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){2}:(?:[\\da-f]{1,4}:){0,4}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){6}|(?:[\\da-f]{1,4}:){0,5}:|::(?:[\\da-f]{1,4}:){0,5}|[\\da-f]{1,4}::(?:[\\da-f]{1,4}:){0,5}[\\da-f]{1,4}|::(?:[\\da-f]{1,4}:){0,6}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:)(?:/\\d{1,3})?|(?:/\\d{1,2})?)\\b".replace(//g,function(){return"(?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d))"}),"i"),alias:"number"},path:{pattern:/(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/,lookbehind:!0,alias:"string"},variable:/\$\{?\w+\}?/,email:{pattern:/[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/,alias:"string"},"conditional-configuration":{pattern:/@\^?[\w-]+/,alias:"variable"},operator:/=/,property:/\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/,constant:/\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/,number:{pattern:/(^|[^\w.-])-?\d+(?:\.\d+)?/,lookbehind:!0},boolean:/\b(?:false|no|off|on|true|yes)\b/,punctuation:/[\{\}]/}; \ No newline at end of file diff --git a/components/prism-keyman.js b/components/prism-keyman.js index 5a1df8b7d1..55f76c96e9 100644 --- a/components/prism-keyman.js +++ b/components/prism-keyman.js @@ -1,14 +1,44 @@ Prism.languages.keyman = { - 'comment': /\bc\s.*/i, - 'function': /\[\s*(?:(?:CTRL|SHIFT|ALT|LCTRL|RCTRL|LALT|RALT|CAPS|NCAPS)\s+)*(?:[TKU]_[\w?]+|".+?"|'.+?')\s*\]/i, // virtual key - 'string': /("|').*?\1/, - 'bold': [ // header statements, system stores and variable system stores - /&(?:baselayout|bitmap|capsononly|capsalwaysoff|shiftfreescaps|copyright|ethnologuecode|hotkey|includecodes|keyboardversion|kmw_embedcss|kmw_embedjs|kmw_helpfile|kmw_helptext|kmw_rtl|language|layer|layoutfile|message|mnemoniclayout|name|oldcharposmatching|platform|targets|version|visualkeyboard|windowslanguages)\b/i, - /\b(?:bitmap|bitmaps|caps on only|caps always off|shift frees caps|copyright|hotkey|language|layout|message|name|version)\b/i - ], - 'keyword': /\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|return|reset|save|set|store|use)\b/i, // rule keywords - 'atrule': /\b(?:ansi|begin|unicode|group|using keys|match|nomatch)\b/i, // structural keywords - 'number': /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i, // U+####, x###, d### characters and numbers - 'operator': /[+>\\,()]/, - 'tag': /\$(?:keyman|kmfl|weaver|keymanweb|keymanonly):/i // prefixes -}; \ No newline at end of file + 'comment': { + pattern: /\bc .*/i, + greedy: true + }, + 'string': { + pattern: /"[^"\r\n]*"|'[^'\r\n]*'/, + greedy: true + }, + 'virtual-key': { + pattern: /\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i, + greedy: true, + alias: 'function' // alias for styles + }, + + // https://help.keyman.com/developer/language/guide/headers + 'header-keyword': { + pattern: /&\w+/, + alias: 'bold' // alias for styles + }, + 'header-statement': { + pattern: /\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i, + alias: 'bold' // alias for styles + }, + + 'rule-keyword': { + pattern: /\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i, + alias: 'keyword' + }, + 'structural-keyword': { + pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i, + alias: 'keyword' + }, + + 'compile-target': { + pattern: /\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i, + alias: 'property' + }, + + // U+####, x###, d### characters and numbers + 'number': /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i, + 'operator': /[+>\\$]|\.\./, + 'punctuation': /[()=,]/ +}; diff --git a/components/prism-keyman.min.js b/components/prism-keyman.min.js index 224ce03b2a..749507f544 100644 --- a/components/prism-keyman.min.js +++ b/components/prism-keyman.min.js @@ -1 +1 @@ -Prism.languages.keyman={comment:/\bc\s.*/i,function:/\[\s*(?:(?:CTRL|SHIFT|ALT|LCTRL|RCTRL|LALT|RALT|CAPS|NCAPS)\s+)*(?:[TKU]_[\w?]+|".+?"|'.+?')\s*\]/i,string:/("|').*?\1/,bold:[/&(?:baselayout|bitmap|capsononly|capsalwaysoff|shiftfreescaps|copyright|ethnologuecode|hotkey|includecodes|keyboardversion|kmw_embedcss|kmw_embedjs|kmw_helpfile|kmw_helptext|kmw_rtl|language|layer|layoutfile|message|mnemoniclayout|name|oldcharposmatching|platform|targets|version|visualkeyboard|windowslanguages)\b/i,/\b(?:bitmap|bitmaps|caps on only|caps always off|shift frees caps|copyright|hotkey|language|layout|message|name|version)\b/i],keyword:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|return|reset|save|set|store|use)\b/i,atrule:/\b(?:ansi|begin|unicode|group|using keys|match|nomatch)\b/i,number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\,()]/,tag:/\$(?:keyman|kmfl|weaver|keymanweb|keymanonly):/i}; \ No newline at end of file +Prism.languages.keyman={comment:{pattern:/\bc .*/i,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},"virtual-key":{pattern:/\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i,greedy:!0,alias:"function"},"header-keyword":{pattern:/&\w+/,alias:"bold"},"header-statement":{pattern:/\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i,alias:"bold"},"rule-keyword":{pattern:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i,alias:"keyword"},"structural-keyword":{pattern:/\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i,alias:"keyword"},"compile-target":{pattern:/\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i,alias:"property"},number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\$]|\.\./,punctuation:/[()=,]/}; \ No newline at end of file diff --git a/components/prism-kotlin.js b/components/prism-kotlin.js index ae1a864e7d..3b45dcbf57 100644 --- a/components/prism-kotlin.js +++ b/components/prism-kotlin.js @@ -6,59 +6,83 @@ lookbehind: true }, 'function': [ - /\w+(?=\s*\()/, { - pattern: /(\.)\w+(?=\s*\{)/, - lookbehind: true + pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/, + greedy: true + }, + { + pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/, + lookbehind: true, + greedy: true } ], 'number': /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/, 'operator': /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/ }); - delete Prism.languages.kotlin["class-name"]; + delete Prism.languages.kotlin['class-name']; + + var interpolationInside = { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation' + }, + 'expression': { + pattern: /[\s\S]+/, + inside: Prism.languages.kotlin + } + }; Prism.languages.insertBefore('kotlin', 'string', { - 'raw-string': { - pattern: /("""|''')[\s\S]*?\1/, - alias: 'string' - // See interpolation below + // https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions + 'string-literal': [ + { + pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/, + alias: 'multiline', + inside: { + 'interpolation': { + pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i, + inside: interpolationInside + }, + 'string': /[\s\S]+/ + } + }, + { + pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/, + alias: 'singleline', + inside: { + 'interpolation': { + pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i, + lookbehind: true, + inside: interpolationInside + }, + 'string': /[\s\S]+/ + } + } + ], + 'char': { + // https://kotlinlang.org/spec/expressions.html#character-literals + pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/, + greedy: true } }); + + delete Prism.languages.kotlin['string']; + Prism.languages.insertBefore('kotlin', 'keyword', { 'annotation': { pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/, alias: 'builtin' } }); + Prism.languages.insertBefore('kotlin', 'function', { 'label': { - pattern: /\w+@|@\w+/, + pattern: /\b\w+@|@\w+\b/, alias: 'symbol' } }); - var interpolation = [ - { - pattern: /\$\{[^}]+\}/, - inside: { - 'delimiter': { - pattern: /^\$\{|\}$/, - alias: 'variable' - }, - rest: Prism.languages.kotlin - } - }, - { - pattern: /\$\w+/, - alias: 'variable' - } - ]; - - Prism.languages.kotlin['string'].inside = Prism.languages.kotlin['raw-string'].inside = { - interpolation: interpolation - }; - Prism.languages.kt = Prism.languages.kotlin; Prism.languages.kts = Prism.languages.kotlin; }(Prism)); diff --git a/components/prism-kotlin.min.js b/components/prism-kotlin.min.js index 45b197e7a0..78a9057188 100644 --- a/components/prism-kotlin.min.js +++ b/components/prism-kotlin.min.js @@ -1 +1 @@ -!function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[/\w+(?=\s*\()/,{pattern:/(\.)\w+(?=\s*\{)/,lookbehind:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"],n.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/("""|''')[\s\S]*?\1/,alias:"string"}}),n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\w+@|@\w+/,alias:"symbol"}});var e=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:n.languages.kotlin}},{pattern:/\$\w+/,alias:"variable"}];n.languages.kotlin.string.inside=n.languages.kotlin["raw-string"].inside={interpolation:e},n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin}(Prism); \ No newline at end of file +!function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin}(Prism); \ No newline at end of file diff --git a/components/prism-kumir.js b/components/prism-kumir.js new file mode 100644 index 0000000000..679574078b --- /dev/null +++ b/components/prism-kumir.js @@ -0,0 +1,106 @@ +/* eslint-disable regexp/no-dupe-characters-character-class */ +(function (Prism) { + + /** + * Regular expression for characters that are not allowed in identifiers. + * + * @type {string} + */ + var nonId = /\s\x00-\x1f\x22-\x2f\x3a-\x3f\x5b-\x5e\x60\x7b-\x7e/.source; + + /** + * Surround a regular expression for IDs with patterns for non-ID sequences. + * + * @param {string} pattern A regular expression for identifiers. + * @param {string} [flags] The regular expression flags. + * @returns {RegExp} A wrapped regular expression for identifiers. + */ + function wrapId(pattern, flags) { + return RegExp(pattern.replace(//g, nonId), flags); + } + + Prism.languages.kumir = { + 'comment': { + pattern: /\|.*/ + }, + + 'prolog': { + pattern: /#.*/, + greedy: true + }, + + 'string': { + pattern: /"[^\n\r"]*"|'[^\n\r']*'/, + greedy: true + }, + + 'boolean': { + pattern: wrapId(/(^|[])(?:да|нет)(?=[]|$)/.source), + lookbehind: true + }, + + 'operator-word': { + pattern: wrapId(/(^|[])(?:и|или|не)(?=[]|$)/.source), + lookbehind: true, + alias: 'keyword' + }, + + 'system-variable': { + pattern: wrapId(/(^|[])знач(?=[]|$)/.source), + lookbehind: true, + alias: 'keyword' + }, + + 'type': [ + { + pattern: wrapId(/(^|[])(?:вещ|лит|лог|сим|цел)(?:\x20*таб)?(?=[]|$)/.source), + lookbehind: true, + alias: 'builtin' + }, + { + pattern: wrapId(/(^|[])(?:компл|сканкод|файл|цвет)(?=[]|$)/.source), + lookbehind: true, + alias: 'important' + } + ], + + /** + * Should be performed after searching for type names because of "таб". + * "таб" is a reserved word, but never used without a preceding type name. + * "НАЗНАЧИТЬ", "Фввод", and "Фвывод" are not reserved words. + */ + 'keyword': { + pattern: wrapId(/(^|[])(?:алг|арг(?:\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\x20+|_)исп)?|кц(?:(?:\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[]|$)/.source), + lookbehind: true + }, + + /** Should be performed after searching for reserved words. */ + 'name': { + // eslint-disable-next-line regexp/no-super-linear-backtracking + pattern: wrapId(/(^|[])[^\d][^]*(?:\x20+[^]+)*(?=[]|$)/.source), + lookbehind: true + }, + + /** Should be performed after searching for names. */ + 'number': { + pattern: wrapId(/(^|[])(?:\B\$[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?=[]|$)/.source, 'i'), + lookbehind: true + }, + + /** Should be performed after searching for words. */ + 'punctuation': /:=|[(),:;\[\]]/, + + /** + * Should be performed after searching for + * - numeric constants (because of "+" and "-"); + * - punctuation marks (because of ":=" and "="). + */ + 'operator-char': { + pattern: /\*\*?|<[=>]?|>=?|[-+/=]/, + alias: 'operator' + } + }; + + Prism.languages.kum = Prism.languages.kumir; + +}(Prism)); diff --git a/components/prism-kumir.min.js b/components/prism-kumir.min.js new file mode 100644 index 0000000000..ec3a4df13b --- /dev/null +++ b/components/prism-kumir.min.js @@ -0,0 +1 @@ +!function(n){function o(n,o){return RegExp(n.replace(//g,"\\s\\x00-\\x1f\\x22-\\x2f\\x3a-\\x3f\\x5b-\\x5e\\x60\\x7b-\\x7e"),o)}n.languages.kumir={comment:{pattern:/\|.*/},prolog:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^\n\r"]*"|'[^\n\r']*'/,greedy:!0},boolean:{pattern:o("(^|[])(?:да|нет)(?=[]|$)"),lookbehind:!0},"operator-word":{pattern:o("(^|[])(?:и|или|не)(?=[]|$)"),lookbehind:!0,alias:"keyword"},"system-variable":{pattern:o("(^|[])знач(?=[]|$)"),lookbehind:!0,alias:"keyword"},type:[{pattern:o("(^|[])(?:вещ|лит|лог|сим|цел)(?:\\x20*таб)?(?=[]|$)"),lookbehind:!0,alias:"builtin"},{pattern:o("(^|[])(?:компл|сканкод|файл|цвет)(?=[]|$)"),lookbehind:!0,alias:"important"}],keyword:{pattern:o("(^|[])(?:алг|арг(?:\\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\\x20+|_)исп)?|кц(?:(?:\\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[]|$)"),lookbehind:!0},name:{pattern:o("(^|[])[^\\d][^]*(?:\\x20+[^]+)*(?=[]|$)"),lookbehind:!0},number:{pattern:o("(^|[])(?:\\B\\$[\\da-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?)(?=[]|$)","i"),lookbehind:!0},punctuation:/:=|[(),:;\[\]]/,"operator-char":{pattern:/\*\*?|<[=>]?|>=?|[-+/=]/,alias:"operator"}},n.languages.kum=n.languages.kumir}(Prism); \ No newline at end of file diff --git a/components/prism-kusto.js b/components/prism-kusto.js new file mode 100644 index 0000000000..e4c9bc15b9 --- /dev/null +++ b/components/prism-kusto.js @@ -0,0 +1,44 @@ +Prism.languages.kusto = { + 'comment': { + pattern: /\/\/.*/, + greedy: true + }, + 'string': { + pattern: /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/, + greedy: true + }, + + 'verb': { + pattern: /(\|\s*)[a-z][\w-]*/i, + lookbehind: true, + alias: 'keyword' + }, + + 'command': { + pattern: /\.[a-z][a-z\d-]*\b/, + alias: 'keyword' + }, + + 'class-name': /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/, + 'keyword': /\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/, + 'boolean': /\b(?:false|null|true)\b/, + + 'function': /\b[a-z_]\w*(?=\s*\()/, + + 'datetime': [ + { + // RFC 822 + RFC 850 + pattern: /\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/, + alias: 'number' + }, + { + // ISO 8601 + pattern: /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/, + alias: 'number' + } + ], + 'number': /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/, + + 'operator': /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./, + 'punctuation': /[()\[\]{},;.:]/ +}; diff --git a/components/prism-kusto.min.js b/components/prism-kusto.min.js new file mode 100644 index 0000000000..780789653c --- /dev/null +++ b/components/prism-kusto.min.js @@ -0,0 +1 @@ +Prism.languages.kusto={comment:{pattern:/\/\/.*/,greedy:!0},string:{pattern:/```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/,greedy:!0},verb:{pattern:/(\|\s*)[a-z][\w-]*/i,lookbehind:!0,alias:"keyword"},command:{pattern:/\.[a-z][a-z\d-]*\b/,alias:"keyword"},"class-name":/\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/,keyword:/\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/,boolean:/\b(?:false|null|true)\b/,function:/\b[a-z_]\w*(?=\s*\()/,datetime:[{pattern:/\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/,alias:"number"},{pattern:/[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/,alias:"number"}],number:/\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/,operator:/=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./,punctuation:/[()\[\]{},;.:]/}; \ No newline at end of file diff --git a/components/prism-latex.js b/components/prism-latex.js index 68a45b611c..ec2361468b 100644 --- a/components/prism-latex.js +++ b/components/prism-latex.js @@ -8,10 +8,10 @@ }; Prism.languages.latex = { - 'comment': /%.*/m, + 'comment': /%.*/, // the verbatim environment prints whitespace to the document 'cdata': { - pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/, lookbehind: true }, /* @@ -25,7 +25,7 @@ alias: 'string' }, { - pattern: /(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/, lookbehind: true, inside: insideEqu, alias: 'string' @@ -36,7 +36,7 @@ * as keywords */ 'keyword': { - pattern: /(\\(?:begin|end|ref|cite|label|usepackage|documentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/, lookbehind: true }, 'url': { @@ -48,7 +48,7 @@ * they stand out more */ 'headline': { - pattern: /(\\(?:part|chapter|section|subsection|frametitle|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\}(?:\[[^\]]+\])?)/, + pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/, lookbehind: true, alias: 'class-name' }, @@ -61,4 +61,4 @@ Prism.languages.tex = Prism.languages.latex; Prism.languages.context = Prism.languages.latex; -})(Prism); +}(Prism)); diff --git a/components/prism-latex.min.js b/components/prism-latex.min.js index 261cae4e39..38fe507362 100644 --- a/components/prism-latex.min.js +++ b/components/prism-latex.min.js @@ -1 +1 @@ -!function(a){var e=/\\(?:[^a-z()[\]]|[a-z*]+)/i,n={"equation-command":{pattern:e,alias:"regex"}};a.languages.latex={comment:/%.*/m,cdata:{pattern:/(\\begin\{((?:verbatim|lstlisting)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:n,alias:"string"},{pattern:/(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:n,alias:"string"}],keyword:{pattern:/(\\(?:begin|end|ref|cite|label|usepackage|documentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:part|chapter|section|subsection|frametitle|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\}(?:\[[^\]]+\])?)/,lookbehind:!0,alias:"class-name"},function:{pattern:e,alias:"selector"},punctuation:/[[\]{}&]/},a.languages.tex=a.languages.latex,a.languages.context=a.languages.latex}(Prism); \ No newline at end of file +!function(a){var e=/\\(?:[^a-z()[\]]|[a-z*]+)/i,n={"equation-command":{pattern:e,alias:"regex"}};a.languages.latex={comment:/%.*/,cdata:{pattern:/(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:n,alias:"string"},{pattern:/(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:n,alias:"string"}],keyword:{pattern:/(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:e,alias:"selector"},punctuation:/[[\]{}&]/},a.languages.tex=a.languages.latex,a.languages.context=a.languages.latex}(Prism); \ No newline at end of file diff --git a/components/prism-latte.js b/components/prism-latte.js index 9bf1242c00..dd877a2323 100644 --- a/components/prism-latte.js +++ b/components/prism-latte.js @@ -1,21 +1,15 @@ (function (Prism) { Prism.languages.latte = { 'comment': /^\{\*[\s\S]*/, - 'ld': { - pattern: /^\{(?:[=_]|\/?(?!\d|\w+\()\w+|)/, - inside: { - 'punctuation': /^\{\/?/, - 'tag': { - pattern: /.+/, - alias: 'important' - } - } + 'latte-tag': { + // https://latte.nette.org/en/tags + pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i, + lookbehind: true, + alias: 'important' }, - 'rd': { - pattern: /\}$/, - inside: { - 'punctuation': /.+/ - } + 'delimiter': { + pattern: /^\{\/?|\}$/, + alias: 'punctuation' }, 'php': { pattern: /\S(?:[\s\S]*\S)?/, @@ -53,16 +47,16 @@ }, }, markupLatte.tag); - Prism.hooks.add('before-tokenize', function(env) { + Prism.hooks.add('before-tokenize', function (env) { if (env.language !== 'latte') { return; } - var lattePattern = /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*[\s\S]*?\*\/)*?\}/g; + var lattePattern = /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g; Prism.languages['markup-templating'].buildPlaceholders(env, 'latte', lattePattern); env.grammar = markupLatte; }); - Prism.hooks.add('after-tokenize', function(env) { + Prism.hooks.add('after-tokenize', function (env) { Prism.languages['markup-templating'].tokenizePlaceholders(env, 'latte'); }); diff --git a/components/prism-latte.min.js b/components/prism-latte.min.js index 11730622e1..5f19298508 100644 --- a/components/prism-latte.min.js +++ b/components/prism-latte.min.js @@ -1 +1 @@ -!function(t){t.languages.latte={comment:/^\{\*[\s\S]*/,ld:{pattern:/^\{(?:[=_]|\/?(?!\d|\w+\()\w+|)/,inside:{punctuation:/^\{\/?/,tag:{pattern:/.+/,alias:"important"}}},rd:{pattern:/\}$/,inside:{punctuation:/.+/}},php:{pattern:/\S(?:[\s\S]*\S)?/,alias:"language-php",inside:t.languages.php}};var e=t.languages.extend("markup",{});t.languages.insertBefore("inside","attr-value",{"n-attr":{pattern:/n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,inside:{"attr-name":{pattern:/^[^\s=]+/,alias:"important"},"attr-value":{pattern:/=[\s\S]+/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}],php:{pattern:/\S(?:[\s\S]*\S)?/,inside:t.languages.php}}}}}},e.tag),t.hooks.add("before-tokenize",function(a){if("latte"===a.language){t.languages["markup-templating"].buildPlaceholders(a,"latte",/\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*[\s\S]*?\*\/)*?\}/g),a.grammar=e}}),t.hooks.add("after-tokenize",function(a){t.languages["markup-templating"].tokenizePlaceholders(a,"latte")})}(Prism); \ No newline at end of file +!function(t){t.languages.latte={comment:/^\{\*[\s\S]*/,"latte-tag":{pattern:/(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i,lookbehind:!0,alias:"important"},delimiter:{pattern:/^\{\/?|\}$/,alias:"punctuation"},php:{pattern:/\S(?:[\s\S]*\S)?/,alias:"language-php",inside:t.languages.php}};var e=t.languages.extend("markup",{});t.languages.insertBefore("inside","attr-value",{"n-attr":{pattern:/n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,inside:{"attr-name":{pattern:/^[^\s=]+/,alias:"important"},"attr-value":{pattern:/=[\s\S]+/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}],php:{pattern:/\S(?:[\s\S]*\S)?/,inside:t.languages.php}}}}}},e.tag),t.hooks.add("before-tokenize",function(a){if("latte"===a.language){t.languages["markup-templating"].buildPlaceholders(a,"latte",/\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g),a.grammar=e}}),t.hooks.add("after-tokenize",function(a){t.languages["markup-templating"].tokenizePlaceholders(a,"latte")})}(Prism); \ No newline at end of file diff --git a/components/prism-less.js b/components/prism-less.js index 0521d2c9b7..bdbc7e3b38 100644 --- a/components/prism-less.js +++ b/components/prism-less.js @@ -15,21 +15,21 @@ Prism.languages.less = Prism.languages.extend('css', { } ], 'atrule': { - pattern: /@[\w-]+?(?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};])*?(?=\s*\{)/, + pattern: /@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/, inside: { 'punctuation': /[:()]/ } }, // selectors and mixins are considered the same 'selector': { - pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@])*?(?=\s*\{)/, + pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/, inside: { // mixin parameters 'variable': /@+[\w-]+/ } }, - 'property': /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i, + 'property': /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/, 'operator': /[+\-*\/]/ }); @@ -39,7 +39,7 @@ Prism.languages.insertBefore('less', 'property', { { pattern: /@[\w-]+\s*:/, inside: { - "punctuation": /:/ + 'punctuation': /:/ } }, @@ -47,7 +47,7 @@ Prism.languages.insertBefore('less', 'property', { /@@?[\w-]+/ ], 'mixin-usage': { - pattern: /([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/, + pattern: /([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/, lookbehind: true, alias: 'function' } diff --git a/components/prism-less.min.js b/components/prism-less.min.js index 5c3aa7d58d..f4a10f66a1 100644 --- a/components/prism-less.min.js +++ b/components/prism-less.min.js @@ -1 +1 @@ -Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-]+?(?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};])*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@])*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,lookbehind:!0,alias:"function"}}); \ No newline at end of file +Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}); \ No newline at end of file diff --git a/components/prism-liquid.js b/components/prism-liquid.js index bb403a9103..8b9981a7a6 100644 --- a/components/prism-liquid.js +++ b/components/prism-liquid.js @@ -1,12 +1,66 @@ Prism.languages.liquid = { - 'keyword': /\b(?:comment|endcomment|if|elsif|else|endif|unless|endunless|for|endfor|case|endcase|when|in|break|assign|continue|limit|offset|range|reversed|raw|endraw|capture|endcapture|tablerow|endtablerow)\b/, - 'number': /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp-]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?[df]?/i, - 'operator': { - pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, + 'comment': { + pattern: /(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/, lookbehind: true }, - 'function': { - pattern: /(^|[\s;|&])(?:append|prepend|capitalize|cycle|cols|increment|decrement|abs|at_least|at_most|ceil|compact|concat|date|default|divided_by|downcase|escape|escape_once|first|floor|join|last|lstrip|map|minus|modulo|newline_to_br|plus|remove|remove_first|replace|replace_first|reverse|round|rstrip|size|slice|sort|sort_natural|split|strip|strip_html|strip_newlines|times|truncate|truncatewords|uniq|upcase|url_decode|url_encode|include|paginate)(?=$|[\s;|&])/, - lookbehind: true - } + 'delimiter': { + pattern: /^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/, + alias: 'punctuation' + }, + 'string': { + pattern: /"[^"]*"|'[^']*'/, + greedy: true + }, + 'keyword': /\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/, + 'object': /\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/, + 'function': [ + { + pattern: /(\|\s*)\w+/, + lookbehind: true, + alias: 'filter' + }, + { + // array functions + pattern: /(\.\s*)(?:first|last|size)/, + lookbehind: true + } + ], + 'boolean': /\b(?:false|nil|true)\b/, + 'range': { + pattern: /\.\./, + alias: 'operator' + }, + // https://github.com/Shopify/liquid/blob/698f5e0d967423e013f6169d9111bd969bd78337/lib/liquid/lexer.rb#L21 + 'number': /\b\d+(?:\.\d+)?\b/, + 'operator': /[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/, + 'punctuation': /[.,\[\]()]/, + 'empty': { + pattern: /\bempty\b/, + alias: 'keyword' + }, }; + +Prism.hooks.add('before-tokenize', function (env) { + var liquidPattern = /\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g; + var insideRaw = false; + + Prism.languages['markup-templating'].buildPlaceholders(env, 'liquid', liquidPattern, function (match) { + var tagMatch = /^\{%-?\s*(\w+)/.exec(match); + if (tagMatch) { + var tag = tagMatch[1]; + if (tag === 'raw' && !insideRaw) { + insideRaw = true; + return true; + } else if (tag === 'endraw') { + insideRaw = false; + return true; + } + } + + return !insideRaw; + }); +}); + +Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'liquid'); +}); diff --git a/components/prism-liquid.min.js b/components/prism-liquid.min.js index e438ffe9fe..a405414fac 100644 --- a/components/prism-liquid.min.js +++ b/components/prism-liquid.min.js @@ -1 +1 @@ -Prism.languages.liquid={keyword:/\b(?:comment|endcomment|if|elsif|else|endif|unless|endunless|for|endfor|case|endcase|when|in|break|assign|continue|limit|offset|range|reversed|raw|endraw|capture|endcapture|tablerow|endtablerow)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp-]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?[df]?/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0},function:{pattern:/(^|[\s;|&])(?:append|prepend|capitalize|cycle|cols|increment|decrement|abs|at_least|at_most|ceil|compact|concat|date|default|divided_by|downcase|escape|escape_once|first|floor|join|last|lstrip|map|minus|modulo|newline_to_br|plus|remove|remove_first|replace|replace_first|reverse|round|rstrip|size|slice|sort|sort_natural|split|strip|strip_html|strip_newlines|times|truncate|truncatewords|uniq|upcase|url_decode|url_encode|include|paginate)(?=$|[\s;|&])/,lookbehind:!0}}; \ No newline at end of file +Prism.languages.liquid={comment:{pattern:/(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/,lookbehind:!0},delimiter:{pattern:/^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/,alias:"punctuation"},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},keyword:/\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,object:/\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/,function:[{pattern:/(\|\s*)\w+/,lookbehind:!0,alias:"filter"},{pattern:/(\.\s*)(?:first|last|size)/,lookbehind:!0}],boolean:/\b(?:false|nil|true)\b/,range:{pattern:/\.\./,alias:"operator"},number:/\b\d+(?:\.\d+)?\b/,operator:/[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/,punctuation:/[.,\[\]()]/,empty:{pattern:/\bempty\b/,alias:"keyword"}},Prism.hooks.add("before-tokenize",function(e){var i=!1;Prism.languages["markup-templating"].buildPlaceholders(e,"liquid",/\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g,function(e){var t=/^\{%-?\s*(\w+)/.exec(e);if(t){var n=t[1];if("raw"===n&&!i)return i=!0;if("endraw"===n)return!(i=!1)}return!i})}),Prism.hooks.add("after-tokenize",function(e){Prism.languages["markup-templating"].tokenizePlaceholders(e,"liquid")}); \ No newline at end of file diff --git a/components/prism-lisp.js b/components/prism-lisp.js index 3ac0710421..e0e2392fde 100644 --- a/components/prism-lisp.js +++ b/components/prism-lisp.js @@ -1,20 +1,29 @@ (function (Prism) { - // Functions to construct regular expressions - // simple form - // e.g. (interactive ... or (interactive) + /** + * Functions to construct regular expressions + * e.g. (interactive ... or (interactive) + * + * @param {string} name + * @returns {RegExp} + */ function simple_form(name) { - return RegExp('(\\()' + name + '(?=[\\s\\)])'); + return RegExp(/(\()/.source + '(?:' + name + ')' + /(?=[\s\)])/.source); } - // booleans and numbers + /** + * booleans and numbers + * + * @param {string} pattern + * @returns {RegExp} + */ function primitive(pattern) { - return RegExp('([\\s([])' + pattern + '(?=[\\s)])'); + return RegExp(/([\s([])/.source + '(?:' + pattern + ')' + /(?=[\s)])/.source); } // Patterns in regular expressions // Symbol name. See https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html // & and : are excluded as they are usually used for special purposes - var symbol = '[-+*/_~!@$%^=<>{}\\w]+'; + var symbol = /(?!\d)[-+*/~!@$%^=<>{}\w]+/.source; // symbol starting with & used in function arguments var marker = '&' + symbol; // Open parenthesis for look-behind @@ -22,6 +31,7 @@ var endpar = '(?=\\))'; // End the pattern with look-ahead space var space = '(?=\\s)'; + var nestedPar = /(?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\))*\))*\))*/.source; var language = { // Three or four semicolons are considered a heading. @@ -55,38 +65,38 @@ { pattern: RegExp( par + - '(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)' + + '(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)' + space ), lookbehind: true }, { pattern: RegExp( - par + '(?:for|do|collect|return|finally|append|concat|in|by)' + space + par + '(?:append|by|collect|concat|do|finally|for|in|return)' + space ), lookbehind: true }, ], declare: { - pattern: simple_form('declare'), + pattern: simple_form(/declare/.source), lookbehind: true, alias: 'keyword' }, interactive: { - pattern: simple_form('interactive'), + pattern: simple_form(/interactive/.source), lookbehind: true, alias: 'keyword' }, boolean: { - pattern: primitive('(?:t|nil)'), + pattern: primitive(/nil|t/.source), lookbehind: true }, number: { - pattern: primitive('[-+]?\\d+(?:\\.\\d*)?'), + pattern: primitive(/[-+]?\d+(?:\.\d*)?/.source), lookbehind: true }, defvar: { - pattern: RegExp(par + 'def(?:var|const|custom|group)\\s+' + symbol), + pattern: RegExp(par + 'def(?:const|custom|group|var)\\s+' + symbol), lookbehind: true, inside: { keyword: /^def[a-z]+/, @@ -94,13 +104,9 @@ } }, defun: { - pattern: RegExp( - par + - '(?:cl-)?(?:defun\\*?|defmacro)\\s+' + - symbol + - '\\s+\\([\\s\\S]*?\\)' - ), + pattern: RegExp(par + /(?:cl-)?(?:defmacro|defun\*?)\s+/.source + symbol + /\s+\(/.source + nestedPar + /\)/.source), lookbehind: true, + greedy: true, inside: { keyword: /^(?:cl-)?def\S+/, // See below, this property needs to be defined later so that it can @@ -114,8 +120,9 @@ } }, lambda: { - pattern: RegExp(par + 'lambda\\s+\\((?:&?' + symbol + '\\s*)*\\)'), + pattern: RegExp(par + 'lambda\\s+\\(\\s*(?:&?' + symbol + '(?:\\s+&?' + symbol + ')*\\s*)?\\)'), lookbehind: true, + greedy: true, inside: { keyword: /^lambda/, // See below, this property needs to be defined later so that it can @@ -141,37 +148,30 @@ var arg = { 'lisp-marker': RegExp(marker), - rest: { - argument: { - pattern: RegExp(symbol), - alias: 'variable' - }, - varform: { - pattern: RegExp(par + symbol + '\\s+\\S[\\s\\S]*' + endpar), - lookbehind: true, - inside: { - string: language.string, - boolean: language.boolean, - number: language.number, - symbol: language.symbol, - punctuation: /[()]/ - } - } - } + 'varform': { + pattern: RegExp(/\(/.source + symbol + /\s+(?=\S)/.source + nestedPar + /\)/.source), + inside: language + }, + 'argument': { + pattern: RegExp(/(^|[\s(])/.source + symbol), + lookbehind: true, + alias: 'variable' + }, + rest: language }; var forms = '\\S+(?:\\s+\\S+)*'; var arglist = { - pattern: RegExp(par + '[\\s\\S]*' + endpar), + pattern: RegExp(par + nestedPar + endpar), lookbehind: true, inside: { 'rest-vars': { - pattern: RegExp('&(?:rest|body)\\s+' + forms), + pattern: RegExp('&(?:body|rest)\\s+' + forms), inside: arg }, 'other-marker-vars': { - pattern: RegExp('&(?:optional|aux)\\s+' + forms), + pattern: RegExp('&(?:aux|optional)\\s+' + forms), inside: arg }, keys: { diff --git a/components/prism-lisp.min.js b/components/prism-lisp.min.js index 6f721b69b6..4ee5290b13 100644 --- a/components/prism-lisp.min.js +++ b/components/prism-lisp.min.js @@ -1 +1 @@ -!function(e){function n(e){return RegExp("(\\()"+e+"(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])"+e+"(?=[\\s)])")}var t="[-+*/_~!@$%^=<>{}\\w]+",r="(\\()",i="(?=\\))",s="(?=\\s)",o={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+t+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+t),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+t),alias:"property"},splice:{pattern:RegExp(",@?"+t),alias:["symbol","variable"]},keyword:[{pattern:RegExp(r+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+s),lookbehind:!0},{pattern:RegExp(r+"(?:for|do|collect|return|finally|append|concat|in|by)"+s),lookbehind:!0}],declare:{pattern:n("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:n("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:a("(?:t|nil)"),lookbehind:!0},number:{pattern:a("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(r+"def(?:var|const|custom|group)\\s+"+t),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(t)}},defun:{pattern:RegExp(r+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+t+"\\s+\\([\\s\\S]*?\\)"),lookbehind:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+t),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(r+"lambda\\s+\\((?:&?"+t+"\\s*)*\\)"),lookbehind:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(r+t),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},l={"lisp-marker":RegExp("&[-+*/_~!@$%^=<>{}\\w]+"),rest:{argument:{pattern:RegExp(t),alias:"variable"},varform:{pattern:RegExp(r+t+"\\s+\\S[\\s\\S]*"+i),lookbehind:!0,inside:{string:o.string,boolean:o.boolean,number:o.number,symbol:o.symbol,punctuation:/[()]/}}}},p="\\S+(?:\\s+\\S+)*",d={pattern:RegExp(r+"[\\s\\S]*"+i),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+p),inside:l},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+p),inside:l},keys:{pattern:RegExp("&key\\s+"+p+"(?:\\s+&allow-other-keys)?"),inside:l},argument:{pattern:RegExp(t),alias:"variable"},punctuation:/[()]/}};o.lambda.inside.arguments=d,o.defun.inside.arguments=e.util.clone(d),o.defun.inside.arguments.inside.sublist=d,e.languages.lisp=o,e.languages.elisp=o,e.languages.emacs=o,e.languages["emacs-lisp"]=o}(Prism); \ No newline at end of file +!function(e){function n(e){return RegExp("(\\()(?:"+e+")(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])(?:"+e+")(?=[\\s)])")}var t="(?!\\d)[-+*/~!@$%^=<>{}\\w]+",r="(\\()",i="(?=\\s)",s="(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))*\\))*",l={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+t+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+t),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+t),alias:"property"},splice:{pattern:RegExp(",@?"+t),alias:["symbol","variable"]},keyword:[{pattern:RegExp(r+"(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)"+i),lookbehind:!0},{pattern:RegExp(r+"(?:append|by|collect|concat|do|finally|for|in|return)"+i),lookbehind:!0}],declare:{pattern:n("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:n("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:a("nil|t"),lookbehind:!0},number:{pattern:a("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(r+"def(?:const|custom|group|var)\\s+"+t),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(t)}},defun:{pattern:RegExp(r+"(?:cl-)?(?:defmacro|defun\\*?)\\s+"+t+"\\s+\\("+s+"\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+t),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(r+"lambda\\s+\\(\\s*(?:&?"+t+"(?:\\s+&?"+t+")*\\s*)?\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(r+t),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},o={"lisp-marker":RegExp("&(?!\\d)[-+*/~!@$%^=<>{}\\w]+"),varform:{pattern:RegExp("\\("+t+"\\s+(?=\\S)"+s+"\\)"),inside:l},argument:{pattern:RegExp("(^|[\\s(])"+t),lookbehind:!0,alias:"variable"},rest:l},p="\\S+(?:\\s+\\S+)*",d={pattern:RegExp(r+s+"(?=\\))"),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:body|rest)\\s+"+p),inside:o},"other-marker-vars":{pattern:RegExp("&(?:aux|optional)\\s+"+p),inside:o},keys:{pattern:RegExp("&key\\s+"+p+"(?:\\s+&allow-other-keys)?"),inside:o},argument:{pattern:RegExp(t),alias:"variable"},punctuation:/[()]/}};l.lambda.inside.arguments=d,l.defun.inside.arguments=e.util.clone(d),l.defun.inside.arguments.inside.sublist=d,e.languages.lisp=l,e.languages.elisp=l,e.languages.emacs=l,e.languages["emacs-lisp"]=l}(Prism); \ No newline at end of file diff --git a/components/prism-livescript.js b/components/prism-livescript.js index bc0c157ca5..d91a7caa66 100644 --- a/components/prism-livescript.js +++ b/components/prism-livescript.js @@ -66,7 +66,7 @@ Prism.languages.livescript = { lookbehind: true }, 'keyword-operator': { - pattern: /(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?:nt| not)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m, + pattern: /(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?: not|nt)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m, lookbehind: true, alias: 'operator' }, diff --git a/components/prism-livescript.min.js b/components/prism-livescript.min.js index be566cf888..c639e5f396 100644 --- a/components/prism-livescript.min.js +++ b/components/prism-livescript.min.js @@ -1 +1 @@ -Prism.languages.livescript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"interpolated-string":{pattern:/(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m,lookbehind:!0},interpolation:{pattern:/(^|[^\\])#\{[^}]+\}/m,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^#\{|\}$/,alias:"variable"}}},string:/[\s\S]+/}},string:[{pattern:/('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/<\[[\s\S]*?\]>/,greedy:!0},/\\[^\s,;\])}]+/],regex:[{pattern:/\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/,greedy:!0,inside:{comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0}}},{pattern:/\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/,greedy:!0}],keyword:{pattern:/(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,lookbehind:!0},"keyword-operator":{pattern:/(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?:nt| not)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,lookbehind:!0,alias:"operator"},boolean:{pattern:/(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,lookbehind:!0},argument:{pattern:/(^|(?!\.&\.)[^&])&(?!&)\d*/m,lookbehind:!0,alias:"variable"},number:/\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,identifier:/[a-z_](?:-?[a-z]|[\d_])*/i,operator:[{pattern:/( )\.(?= )/,lookbehind:!0},/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/],punctuation:/[(){}\[\]|.,:;`]/},Prism.languages.livescript["interpolated-string"].inside.interpolation.inside.rest=Prism.languages.livescript; \ No newline at end of file +Prism.languages.livescript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"interpolated-string":{pattern:/(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m,lookbehind:!0},interpolation:{pattern:/(^|[^\\])#\{[^}]+\}/m,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^#\{|\}$/,alias:"variable"}}},string:/[\s\S]+/}},string:[{pattern:/('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/<\[[\s\S]*?\]>/,greedy:!0},/\\[^\s,;\])}]+/],regex:[{pattern:/\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/,greedy:!0,inside:{comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0}}},{pattern:/\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/,greedy:!0}],keyword:{pattern:/(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,lookbehind:!0},"keyword-operator":{pattern:/(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?: not|nt)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,lookbehind:!0,alias:"operator"},boolean:{pattern:/(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,lookbehind:!0},argument:{pattern:/(^|(?!\.&\.)[^&])&(?!&)\d*/m,lookbehind:!0,alias:"variable"},number:/\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,identifier:/[a-z_](?:-?[a-z]|[\d_])*/i,operator:[{pattern:/( )\.(?= )/,lookbehind:!0},/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/],punctuation:/[(){}\[\]|.,:;`]/},Prism.languages.livescript["interpolated-string"].inside.interpolation.inside.rest=Prism.languages.livescript; \ No newline at end of file diff --git a/components/prism-llvm.js b/components/prism-llvm.js index 36f85d37a7..e7ab85d6f3 100644 --- a/components/prism-llvm.js +++ b/components/prism-llvm.js @@ -1,11 +1,11 @@ -(function(Prism) { +(function (Prism) { Prism.languages.llvm = { 'comment': /;.*/, 'string': { pattern: /"[^"]*"/, greedy: true, }, - 'boolean': /\b(?:true|false)\b/, + 'boolean': /\b(?:false|true)\b/, 'variable': /[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i, 'label': /(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i, 'type': { diff --git a/components/prism-llvm.min.js b/components/prism-llvm.min.js index e0b0636b27..7e178801b5 100644 --- a/components/prism-llvm.min.js +++ b/components/prism-llvm.min.js @@ -1 +1 @@ -Prism.languages.llvm={comment:/;.*/,string:{pattern:/"[^"]*"/,greedy:!0},boolean:/\b(?:true|false)\b/,variable:/[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,label:/(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,type:{pattern:/\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,alias:"class-name"},keyword:/\b[a-z_][a-z_0-9]*\b/,number:/[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,punctuation:/[{}[\];(),.!*=<>]/}; \ No newline at end of file +Prism.languages.llvm={comment:/;.*/,string:{pattern:/"[^"]*"/,greedy:!0},boolean:/\b(?:false|true)\b/,variable:/[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,label:/(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,type:{pattern:/\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,alias:"class-name"},keyword:/\b[a-z_][a-z_0-9]*\b/,number:/[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,punctuation:/[{}[\];(),.!*=<>]/}; \ No newline at end of file diff --git a/components/prism-log.js b/components/prism-log.js new file mode 100644 index 0000000000..d84defcb70 --- /dev/null +++ b/components/prism-log.js @@ -0,0 +1,120 @@ +// This is a language definition for generic log files. +// Since there is no one log format, this language definition has to support all formats to some degree. +// +// Based on https://github.com/MTDL9/vim-log-highlighting + +Prism.languages.log = { + 'string': { + // Single-quoted strings must not be confused with plain text. E.g. Can't isn't Susan's Chris' toy + pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/, + greedy: true, + }, + + 'exception': { + pattern: /(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/, + lookbehind: true, + greedy: true, + alias: ['javastacktrace', 'language-javastacktrace'], + inside: Prism.languages['javastacktrace'] || { + 'keyword': /\bat\b/, + 'function': /[a-z_][\w$]*(?=\()/, + 'punctuation': /[.:()]/ + } + }, + + 'level': [ + { + pattern: /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/, + alias: ['error', 'important'] + }, + { + pattern: /\b(?:WARN|WARNING|WRN)\b/, + alias: ['warning', 'important'] + }, + { + pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/, + alias: ['info', 'keyword'] + }, + { + pattern: /\b(?:DBG|DEBUG|FINE)\b/, + alias: ['debug', 'keyword'] + }, + { + pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/, + alias: ['trace', 'comment'] + } + ], + + 'property': { + pattern: /((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im, + lookbehind: true + }, + + 'separator': { + pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m, + lookbehind: true, + alias: 'comment' + }, + + 'url': /\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/, + 'email': { + pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/, + lookbehind: true, + alias: 'url' + }, + + 'ip-address': { + pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/, + alias: 'constant' + }, + 'mac-address': { + pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i, + alias: 'constant' + }, + 'domain': { + pattern: /(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/, + lookbehind: true, + alias: 'constant' + }, + + 'uuid': { + pattern: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i, + alias: 'constant' + }, + 'hash': { + pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i, + alias: 'constant' + }, + + 'file-path': { + pattern: /\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i, + lookbehind: true, + greedy: true, + alias: 'string' + }, + + 'date': { + pattern: RegExp( + /\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source + + '|' + + /\b\d{1,4}[-/ ](?:\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\d{2,4}T?\b/.source + + '|' + + /\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\s{1,2}\d{1,2}\b/.source, + 'i' + ), + alias: 'number' + }, + 'time': { + pattern: /\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/, + alias: 'number' + }, + + 'boolean': /\b(?:false|null|true)\b/i, + 'number': { + pattern: /(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i, + lookbehind: true + }, + + 'operator': /[;:?<=>~/@!$%&+\-|^(){}*#]/, + 'punctuation': /[\[\].,]/ +}; diff --git a/components/prism-log.min.js b/components/prism-log.min.js new file mode 100644 index 0000000000..c93bd90775 --- /dev/null +++ b/components/prism-log.min.js @@ -0,0 +1 @@ +Prism.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Prism.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/}; \ No newline at end of file diff --git a/components/prism-lolcode.js b/components/prism-lolcode.js index 4703535e18..16477981d4 100644 --- a/components/prism-lolcode.js +++ b/components/prism-lolcode.js @@ -1,6 +1,6 @@ Prism.languages.lolcode = { 'comment': [ - /\bOBTW\s+[\s\S]*?\s+TLDR\b/, + /\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/ ], 'string': { @@ -15,9 +15,9 @@ Prism.languages.lolcode = { }, greedy: true }, - 'number': /(?:\B-)?(?:\b\d+\.?\d*|\B\.\d+)/, + 'number': /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/, 'symbol': { - pattern: /(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/, + pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/, lookbehind: true, inside: { 'keyword': /A(?=\s)/ @@ -29,18 +29,18 @@ Prism.languages.lolcode = { alias: 'string' }, 'function': { - pattern: /((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/, + pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/, lookbehind: true }, 'keyword': [ { - pattern: /(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/, + pattern: /(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/, lookbehind: true }, /'Z(?=\s|,|$)/ ], 'boolean': { - pattern: /(^|\s)(?:WIN|FAIL)(?=\s|,|$)/, + pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/, lookbehind: true }, 'variable': { @@ -48,7 +48,7 @@ Prism.languages.lolcode = { lookbehind: true }, 'operator': { - pattern: /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/, + pattern: /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/, lookbehind: true }, 'punctuation': /\.{3}|…|,|!/ diff --git a/components/prism-lolcode.min.js b/components/prism-lolcode.min.js index f9d3502e67..3df52aba6a 100644 --- a/components/prism-lolcode.min.js +++ b/components/prism-lolcode.min.js @@ -1 +1 @@ -Prism.languages.lolcode={comment:[/\bOBTW\s+[\s\S]*?\s+TLDR\b/,/\bBTW.+/],string:{pattern:/"(?::.|[^":])*"/,inside:{variable:/:\{[^}]+\}/,symbol:[/:\([a-f\d]+\)/i,/:\[[^\]]+\]/,/:[)>o":]/]},greedy:!0},number:/(?:\B-)?(?:\b\d+\.?\d*|\B\.\d+)/,symbol:{pattern:/(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/,lookbehind:!0,inside:{keyword:/A(?=\s)/}},label:{pattern:/((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,lookbehind:!0,alias:"string"},function:{pattern:/((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/,lookbehind:!0},keyword:[{pattern:/(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/,lookbehind:!0},/'Z(?=\s|,|$)/],boolean:{pattern:/(^|\s)(?:WIN|FAIL)(?=\s|,|$)/,lookbehind:!0},variable:{pattern:/(^|\s)IT(?=\s|,|$)/,lookbehind:!0},operator:{pattern:/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/,lookbehind:!0},punctuation:/\.{3}|…|,|!/}; \ No newline at end of file +Prism.languages.lolcode={comment:[/\bOBTW\s[\s\S]*?\sTLDR\b/,/\bBTW.+/],string:{pattern:/"(?::.|[^":])*"/,inside:{variable:/:\{[^}]+\}/,symbol:[/:\([a-f\d]+\)/i,/:\[[^\]]+\]/,/:[)>o":]/]},greedy:!0},number:/(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,symbol:{pattern:/(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/,lookbehind:!0,inside:{keyword:/A(?=\s)/}},label:{pattern:/((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,lookbehind:!0,alias:"string"},function:{pattern:/((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,lookbehind:!0},keyword:[{pattern:/(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/,lookbehind:!0},/'Z(?=\s|,|$)/],boolean:{pattern:/(^|\s)(?:FAIL|WIN)(?=\s|,|$)/,lookbehind:!0},variable:{pattern:/(^|\s)IT(?=\s|,|$)/,lookbehind:!0},operator:{pattern:/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,lookbehind:!0},punctuation:/\.{3}|…|,|!/}; \ No newline at end of file diff --git a/components/prism-lua.js b/components/prism-lua.js index 5e0752b2aa..9dedacca11 100644 --- a/components/prism-lua.js +++ b/components/prism-lua.js @@ -2,10 +2,10 @@ Prism.languages.lua = { 'comment': /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, // \z may be used to skip the following space 'string': { - pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, + pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, greedy: true }, - 'number': /\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i, + 'number': /\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i, 'keyword': /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, 'function': /(?!\d)\w+(?=\s*(?:[({]))/, 'operator': [ @@ -17,4 +17,4 @@ Prism.languages.lua = { } ], 'punctuation': /[\[\](){},;]|\.+|:+/ -}; \ No newline at end of file +}; diff --git a/components/prism-lua.min.js b/components/prism-lua.min.js index 064e86297e..cd94e29ef4 100644 --- a/components/prism-lua.min.js +++ b/components/prism-lua.min.js @@ -1 +1 @@ -Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}; \ No newline at end of file +Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}; \ No newline at end of file diff --git a/components/prism-magma.js b/components/prism-magma.js new file mode 100644 index 0000000000..ddfda80efb --- /dev/null +++ b/components/prism-magma.js @@ -0,0 +1,35 @@ +Prism.languages.magma = { + 'output': { + pattern: /^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m, + lookbehind: true, + greedy: true + }, + + 'comment': { + pattern: /\/\/.*|\/\*[\s\S]*?\*\//, + greedy: true + }, + 'string': { + pattern: /(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/, + lookbehind: true, + greedy: true + }, + + // http://magma.maths.usyd.edu.au/magma/handbook/text/82 + 'keyword': /\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/, + 'boolean': /\b(?:false|true)\b/, + + 'generator': { + pattern: /\b[a-z_]\w*(?=\s*<)/i, + alias: 'class-name' + }, + 'function': /\b[a-z_]\w*(?=\s*\()/i, + + 'number': { + pattern: /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, + lookbehind: true + }, + + 'operator': /->|[-+*/^~!|#=]|:=|\.\./, + 'punctuation': /[()[\]{}<>,;.:]/ +}; diff --git a/components/prism-magma.min.js b/components/prism-magma.min.js new file mode 100644 index 0000000000..93898f77ab --- /dev/null +++ b/components/prism-magma.min.js @@ -0,0 +1 @@ +Prism.languages.magma={output:{pattern:/^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/,lookbehind:!0,greedy:!0},keyword:/\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/,boolean:/\b(?:false|true)\b/,generator:{pattern:/\b[a-z_]\w*(?=\s*<)/i,alias:"class-name"},function:/\b[a-z_]\w*(?=\s*\()/i,number:{pattern:/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,lookbehind:!0},operator:/->|[-+*/^~!|#=]|:=|\.\./,punctuation:/[()[\]{}<>,;.:]/}; \ No newline at end of file diff --git a/components/prism-makefile.js b/components/prism-makefile.js index 5a086fc8f9..64a1dee6ee 100644 --- a/components/prism-makefile.js +++ b/components/prism-makefile.js @@ -8,27 +8,27 @@ Prism.languages.makefile = { greedy: true }, - // Built-in target names - 'builtin': /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/, + 'builtin-target': { + pattern: /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/, + alias: 'builtin' + }, - // Targets - 'symbol': { - pattern: /^[^:=\r\n]+(?=\s*:(?!=))/m, + 'target': { + pattern: /^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m, + alias: 'symbol', inside: { - 'variable': /\$+(?:[^(){}:#=\s]+|(?=[({]))/ + 'variable': /\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/ } }, - 'variable': /\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/, + 'variable': /\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/, - 'keyword': [ - // Directives - /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/, - // Functions - { - pattern: /(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/, - lookbehind: true - } - ], + // Directives + 'keyword': /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/, + + 'function': { + pattern: /(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/, + lookbehind: true + }, 'operator': /(?:::|[?:+!])?=|[|@]/, 'punctuation': /[:;(){}]/ -}; \ No newline at end of file +}; diff --git a/components/prism-makefile.min.js b/components/prism-makefile.min.js index 6f54658074..43f317782f 100644 --- a/components/prism-makefile.min.js +++ b/components/prism-makefile.min.js @@ -1 +1 @@ -Prism.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^[^:=\r\n]+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}; \ No newline at end of file +Prism.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}; \ No newline at end of file diff --git a/components/prism-markdown.js b/components/prism-markdown.js index 75bc6deacf..438f8ed8fc 100644 --- a/components/prism-markdown.js +++ b/components/prism-markdown.js @@ -1,7 +1,7 @@ (function (Prism) { // Allow only one line break - var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?!\n|\r\n?))/.source; + var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source; /** * This function is intended for the creation of the bold or italic pattern. @@ -20,12 +20,25 @@ var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source; - var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|$)/.source.replace(/__/g, function () { return tableCell; }); + var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function () { return tableCell; }); var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source; Prism.languages.markdown = Prism.languages.extend('markup', {}); Prism.languages.insertBefore('markdown', 'prolog', { + 'front-matter-block': { + pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, + lookbehind: true, + greedy: true, + inside: { + 'punctuation': /^---|---$/, + 'front-matter': { + pattern: /\S+(?:\s+\S+)*/, + alias: ['yaml', 'language-yaml'], + inside: Prism.languages.yaml + } + } + }, 'blockquote': { // > ... pattern: /^>(?:[\t ]*>)*/m, @@ -72,12 +85,6 @@ lookbehind: true, alias: 'keyword' }, - { - // `code` - // ``code`` - pattern: /``.+?``|`[^`\r\n]+`/, - alias: 'keyword' - }, { // ```optional language // code block @@ -113,7 +120,7 @@ { // # title 1 // ###### title 6 - pattern: /(^\s*)#+.+/m, + pattern: /(^\s*)#.+/m, lookbehind: true, alias: 'important', inside: { @@ -192,7 +199,8 @@ 'strike': { // ~~strike through~~ // ~strike~ - pattern: createInline(/(~~?)(?:(?!~))+?\2/.source), + // eslint-disable-next-line regexp/strict + pattern: createInline(/(~~?)(?:(?!~))+\2/.source), lookbehind: true, greedy: true, inside: { @@ -204,32 +212,46 @@ 'punctuation': /~~?/ } }, + 'code-snippet': { + // `code` + // ``code`` + pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, + lookbehind: true, + greedy: true, + alias: ['code', 'keyword'] + }, 'url': { // [example](http://example.com "Optional title") // [example][id] // [example] [id] - pattern: createInline(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\]))+\])/.source), + pattern: createInline(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source), lookbehind: true, greedy: true, inside: { - 'variable': { - pattern: /(\[)[^\]]+(?=\]$)/, - lookbehind: true - }, + 'operator': /^!/, 'content': { - pattern: /(^!?\[)[^\]]+(?=\])/, + pattern: /(^\[)[^\]]+(?=\])/, lookbehind: true, inside: {} // see below }, + 'variable': { + pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, + lookbehind: true + }, + 'url': { + pattern: /(^\]\()[^\s)]+/, + lookbehind: true + }, 'string': { - pattern: /"(?:\\.|[^"\\])*"(?=\)$)/ + pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, + lookbehind: true } } } }); ['url', 'bold', 'italic', 'strike'].forEach(function (token) { - ['url', 'bold', 'italic', 'strike'].forEach(function (inside) { + ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (inside) { if (token !== inside) { Prism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside]; } @@ -278,7 +300,7 @@ // this might be a language that Prism does not support // do some replacements to support C++, C#, and F# - var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp') + var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp'); // only use the first word lang = (/[a-z][\w-]*/i.exec(lang) || [''])[0].toLowerCase(); var alias = 'language-' + lang; @@ -328,13 +350,66 @@ }); } } else { - // reverse Prism.util.encode - var code = env.content.replace(/</g, '<').replace(/&/g, '&'); - - env.content = Prism.highlight(code, grammar, codeLang); + env.content = Prism.highlight(textContent(env.content), grammar, codeLang); } }); + var tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi'); + + /** + * A list of known entity names. + * + * This will always be incomplete to save space. The current list is the one used by lowdash's unescape function. + * + * @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2} + */ + var KNOWN_ENTITY_NAMES = { + 'amp': '&', + 'lt': '<', + 'gt': '>', + 'quot': '"', + }; + + // IE 11 doesn't support `String.fromCodePoint` + var fromCodePoint = String.fromCodePoint || String.fromCharCode; + + /** + * Returns the text content of a given HTML source code string. + * + * @param {string} html + * @returns {string} + */ + function textContent(html) { + // remove all tags + var text = html.replace(tagPattern, ''); + + // decode known entities + text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (m, code) { + code = code.toLowerCase(); + + if (code[0] === '#') { + var value; + if (code[1] === 'x') { + value = parseInt(code.slice(2), 16); + } else { + value = Number(code.slice(1)); + } + + return fromCodePoint(value); + } else { + var known = KNOWN_ENTITY_NAMES[code]; + if (known) { + return known; + } + + // unable to decode + return m; + } + }); + + return text; + } + Prism.languages.md = Prism.languages.markdown; }(Prism)); diff --git a/components/prism-markdown.min.js b/components/prism-markdown.min.js index f4a6da225f..cc9f7b28da 100644 --- a/components/prism-markdown.min.js +++ b/components/prism-markdown.min.js @@ -1 +1 @@ -!function(d){function n(n){return n=n.replace(//g,function(){return"(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?!\n|\r\n?))"}),RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+n+")")}var e="(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+",t="\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|$)".replace(/__/g,function(){return e}),a="\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)";d.languages.markdown=d.languages.extend("markup",{}),d.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+t+a+"(?:"+t+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+t+a+")(?:"+t+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(e),inside:d.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+t+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+t+"$"),inside:{"table-header":{pattern:RegExp(e),alias:"important",inside:d.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\r\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n("\\b__(?:(?!_)|_(?:(?!_))+_)+__\\b|\\*\\*(?:(?!\\*)|\\*(?:(?!\\*))+\\*)+\\*\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n("\\b_(?:(?!_)|__(?:(?!_))+__)+_\\b|\\*(?:(?!\\*)|\\*\\*(?:(?!\\*))+\\*\\*)+\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n("(~~?)(?:(?!~))+?\\2"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:n('!?\\[(?:(?!\\]))+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)| ?\\[(?:(?!\\]))+\\])'),lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(\[)[^\]]+(?=\]$)/,lookbehind:!0},content:{pattern:/(^!?\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["url","bold","italic","strike"].forEach(function(e){["url","bold","italic","strike"].forEach(function(n){e!==n&&(d.languages.markdown[e].inside.content.inside[n]=d.languages.markdown[n])})}),d.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||!function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t/g,function(){return"(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?![\r\n]))"}),RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+n+")")}var e="(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+",t="\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))".replace(/__/g,function(){return e}),a="\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)";s.languages.markdown=s.languages.extend("markup",{}),s.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:s.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+t+a+"(?:"+t+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+t+a+")(?:"+t+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(e),inside:s.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+t+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+t+"$"),inside:{"table-header":{pattern:RegExp(e),alias:"important",inside:s.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n("\\b__(?:(?!_)|_(?:(?!_))+_)+__\\b|\\*\\*(?:(?!\\*)|\\*(?:(?!\\*))+\\*)+\\*\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n("\\b_(?:(?!_)|__(?:(?!_))+__)+_\\b|\\*(?:(?!\\*)|\\*\\*(?:(?!\\*))+\\*\\*)+\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n("(~~?)(?:(?!~))+\\2"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n('!?\\[(?:(?!\\]))+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \t]?\\[(?:(?!\\]))+\\])'),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(e){["url","bold","italic","strike","code-snippet"].forEach(function(n){e!==n&&(s.languages.markdown[e].inside.content.inside[n]=s.languages.markdown[n])})}),s.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||!function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t",quot:'"'},u=String.fromCodePoint||String.fromCharCode;s.languages.md=s.languages.markdown}(Prism); \ No newline at end of file diff --git a/components/prism-markup-templating.js b/components/prism-markup-templating.js index 1c22f943b1..2855b7c059 100644 --- a/components/prism-markup-templating.js +++ b/components/prism-markup-templating.js @@ -39,8 +39,9 @@ var placeholder; // Check for existing strings - while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) + while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) { ++i; + } // Create a sparse array tokenStack[i] = match; diff --git a/components/prism-markup.js b/components/prism-markup.js index 63dbf16c46..7d4d2e2b4f 100644 --- a/components/prism-markup.js +++ b/components/prism-markup.js @@ -1,13 +1,19 @@ Prism.languages.markup = { - 'comment': //, - 'prolog': /<\?[\s\S]+?\?>/, + 'comment': { + pattern: //, + greedy: true + }, + 'prolog': { + pattern: /<\?[\s\S]+?\?>/, + greedy: true + }, 'doctype': { // https://www.w3.org/TR/xml/#NT-doctypedecl pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, greedy: true, inside: { 'internal-subset': { - pattern: /(\[)[\s\S]+(?=\]>$)/, + pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: true, greedy: true, inside: null // see below @@ -17,11 +23,14 @@ Prism.languages.markup = { greedy: true }, 'punctuation': /^$|[[\]]/, - 'doctype-tag': /^DOCTYPE/, + 'doctype-tag': /^DOCTYPE/i, 'name': /[^\s<>'"]+/ } }, - 'cdata': //i, + 'cdata': { + pattern: //i, + greedy: true + }, 'tag': { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: true, @@ -33,6 +42,7 @@ Prism.languages.markup = { 'namespace': /^[^\s>\/:]+:/ } }, + 'special-attr': [], 'attr-value': { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { @@ -110,7 +120,7 @@ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { var def = {}; def[tagName] = { - pattern: RegExp(/(<__[\s\S]*?>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { return tagName; }), 'i'), + pattern: RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { return tagName; }), 'i'), lookbehind: true, greedy: true, inside: inside @@ -119,6 +129,49 @@ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { Prism.languages.insertBefore('markup', 'cdata', def); } }); +Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', { + /** + * Adds an pattern to highlight languages embedded in HTML attributes. + * + * An example of an inlined language is CSS with `style` attributes. + * + * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as + * case insensitive. + * @param {string} lang The language key. + * @example + * addAttribute('style', 'css'); + */ + value: function (attrName, lang) { + Prism.languages.markup.tag.inside['special-attr'].push({ + pattern: RegExp( + /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, + 'i' + ), + lookbehind: true, + inside: { + 'attr-name': /^[^\s=]+/, + 'attr-value': { + pattern: /=[\s\S]+/, + inside: { + 'value': { + pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, + lookbehind: true, + alias: [lang, 'language-' + lang], + inside: Prism.languages[lang] + }, + 'punctuation': [ + { + pattern: /^=/, + alias: 'attr-equals' + }, + /"|'/ + ] + } + } + } + }); + } +}); Prism.languages.html = Prism.languages.markup; Prism.languages.mathml = Prism.languages.markup; diff --git a/components/prism-markup.min.js b/components/prism-markup.min.js index 1882d5795e..738b2decd8 100644 --- a/components/prism-markup.min.js +++ b/components/prism-markup.min.js @@ -1 +1 @@ -Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,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/,name:/[^\s<>'"]+/}},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"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 n={"included-cdata":{pattern://i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var t={};t[a]={pattern:RegExp("(<__[^]*?>)(?:))*\\]\\]>|(?!)".replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",t)}}),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"},/"|'/]}},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-matlab.js b/components/prism-matlab.js index e7788fc7aa..01cca55975 100644 --- a/components/prism-matlab.js +++ b/components/prism-matlab.js @@ -8,9 +8,9 @@ Prism.languages.matlab = { greedy: true }, // FIXME We could handle imaginary numbers as a whole - 'number': /(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/, - 'keyword': /\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/, - 'function': /(?!\d)\w+(?=\s*\()/, + 'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/, + 'keyword': /\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/, + 'function': /\b(?!\d)\w+(?=\s*\()/, 'operator': /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/, 'punctuation': /\.{3}|[.,;\[\](){}!]/ -}; \ No newline at end of file +}; diff --git a/components/prism-matlab.min.js b/components/prism-matlab.min.js index e64b373e08..06d3a98112 100644 --- a/components/prism-matlab.min.js +++ b/components/prism-matlab.min.js @@ -1 +1 @@ -Prism.languages.matlab={comment:[/%\{[\s\S]*?\}%/,/%.+/],string:{pattern:/\B'(?:''|[^'\r\n])*'/,greedy:!0},number:/(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,keyword:/\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,function:/(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}; \ No newline at end of file +Prism.languages.matlab={comment:[/%\{[\s\S]*?\}%/,/%.+/],string:{pattern:/\B'(?:''|[^'\r\n])*'/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,keyword:/\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/,function:/\b(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}; \ No newline at end of file diff --git a/components/prism-maxscript.js b/components/prism-maxscript.js new file mode 100644 index 0000000000..ba0a2b218b --- /dev/null +++ b/components/prism-maxscript.js @@ -0,0 +1,91 @@ +(function (Prism) { + + var keywords = /\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i; + + + Prism.languages.maxscript = { + 'comment': { + pattern: /\/\*[\s\S]*?(?:\*\/|$)|--.*/, + greedy: true + }, + 'string': { + pattern: /(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/, + lookbehind: true, + greedy: true + }, + 'path': { + pattern: /\$(?:[\w/\\.*?]|'[^']*')*/, + greedy: true, + alias: 'string' + }, + + 'function-call': { + pattern: RegExp( + '((?:' + ( + // start of line + /^/.source + + '|' + + // operators and other language constructs + /[;=<>+\-*/^({\[]/.source + + '|' + + // keywords as part of statements + /\b(?:and|by|case|catch|collect|do|else|if|in|not|or|return|then|to|try|where|while|with)\b/.source + ) + ')[ \t]*)' + + + '(?!' + keywords.source + ')' + /[a-z_]\w*\b/.source + + + '(?=[ \t]*(?:' + ( + // variable + '(?!' + keywords.source + ')' + /[a-z_]/.source + + '|' + + // number + /\d|-\.?\d/.source + + '|' + + // other expressions or literals + /[({'"$@#?]/.source + ) + '))', + 'im' + ), + lookbehind: true, + greedy: true, + alias: 'function' + }, + + 'function-definition': { + pattern: /(\b(?:fn|function)\s+)\w+\b/i, + lookbehind: true, + alias: 'function' + }, + + 'argument': { + pattern: /\b[a-z_]\w*(?=:)/i, + alias: 'attr-name' + }, + + 'keyword': keywords, + 'boolean': /\b(?:false|true)\b/, + + 'time': { + pattern: /(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/, + lookbehind: true, + alias: 'number' + }, + 'number': [ + { + pattern: /(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/, + lookbehind: true + }, + /\b(?:e|pi)\b/ + ], + + 'constant': /\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/, + 'color': { + pattern: /\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/i, + alias: 'constant' + }, + + 'operator': /[-+*/<>=!]=?|[&^?]|#(?!\()/, + 'punctuation': /[()\[\]{}.:,;]|#(?=\()|\\$/m + }; + +}(Prism)); diff --git a/components/prism-maxscript.min.js b/components/prism-maxscript.min.js new file mode 100644 index 0000000000..910dcb0845 --- /dev/null +++ b/components/prism-maxscript.min.js @@ -0,0 +1 @@ +!function(t){var e=/\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i;Prism.languages.maxscript={comment:{pattern:/\/\*[\s\S]*?(?:\*\/|$)|--.*/,greedy:!0},string:{pattern:/(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/,lookbehind:!0,greedy:!0},path:{pattern:/\$(?:[\w/\\.*?]|'[^']*')*/,greedy:!0,alias:"string"},"function-call":{pattern:RegExp("((?:^|[;=<>+\\-*/^({\\[]|\\b(?:and|by|case|catch|collect|do|else|if|in|not|or|return|then|to|try|where|while|with)\\b)[ \t]*)(?!"+e.source+")[a-z_]\\w*\\b(?=[ \t]*(?:(?!"+e.source+")[a-z_]|\\d|-\\.?\\d|[({'\"$@#?]))","im"),lookbehind:!0,greedy:!0,alias:"function"},"function-definition":{pattern:/(\b(?:fn|function)\s+)\w+\b/i,lookbehind:!0,alias:"function"},argument:{pattern:/\b[a-z_]\w*(?=:)/i,alias:"attr-name"},keyword:e,boolean:/\b(?:false|true)\b/,time:{pattern:/(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/,lookbehind:!0,alias:"number"},number:[{pattern:/(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/,lookbehind:!0},/\b(?:e|pi)\b/],constant:/\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/,color:{pattern:/\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/i,alias:"constant"},operator:/[-+*/<>=!]=?|[&^?]|#(?!\()/,punctuation:/[()\[\]{}.:,;]|#(?=\()|\\$/m}}(); \ No newline at end of file diff --git a/components/prism-mel.js b/components/prism-mel.js index fb8d10df4a..13a5947b00 100644 --- a/components/prism-mel.js +++ b/components/prism-mel.js @@ -17,14 +17,14 @@ Prism.languages.mel = { greedy: true }, 'variable': /\$\w+/, - 'number': /\b0x[\da-fA-F]+\b|\b\d+\.?\d*|\B\.\d+/, + 'number': /\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/, 'flag': { pattern: /-[^\d\W]\w*/, alias: 'operator' }, 'keyword': /\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/, - 'function': /\w+(?=\()|\b(?:about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|CBG|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|Mayatomr|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/, - + 'function': /\b\w+(?=\()|\b(?:CBG|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|Mayatomr|about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/, + 'operator': [ /\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/, { @@ -40,4 +40,4 @@ Prism.languages.mel = { ], 'punctuation': /<<|>>|[.,:;?\[\](){}]/ }; -Prism.languages.mel['code'].inside.rest = Prism.languages.mel; \ No newline at end of file +Prism.languages.mel['code'].inside.rest = Prism.languages.mel; diff --git a/components/prism-mel.min.js b/components/prism-mel.min.js index 2a9299e025..0fda416934 100644 --- a/components/prism-mel.min.js +++ b/components/prism-mel.min.js @@ -1 +1 @@ -Prism.languages.mel={comment:/\/\/.*/,code:{pattern:/`(?:\\.|[^\\`\r\n])*`/,greedy:!0,alias:"italic",inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},variable:/\$\w+/,number:/\b0x[\da-fA-F]+\b|\b\d+\.?\d*|\B\.\d+/,flag:{pattern:/-[^\d\W]\w*/,alias:"operator"},keyword:/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,function:/\w+(?=\()|\b(?:about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|CBG|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|Mayatomr|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/,operator:[/\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,:;?\[\](){}]/},Prism.languages.mel.code.inside.rest=Prism.languages.mel; \ No newline at end of file +Prism.languages.mel={comment:/\/\/.*/,code:{pattern:/`(?:\\.|[^\\`\r\n])*`/,greedy:!0,alias:"italic",inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},variable:/\$\w+/,number:/\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/,flag:{pattern:/-[^\d\W]\w*/,alias:"operator"},keyword:/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,function:/\b\w+(?=\()|\b(?:CBG|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|Mayatomr|about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/,operator:[/\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,:;?\[\](){}]/},Prism.languages.mel.code.inside.rest=Prism.languages.mel; \ No newline at end of file diff --git a/components/prism-mermaid.js b/components/prism-mermaid.js new file mode 100644 index 0000000000..4950ebf1ae --- /dev/null +++ b/components/prism-mermaid.js @@ -0,0 +1,113 @@ +Prism.languages.mermaid = { + 'comment': { + pattern: /%%.*/, + greedy: true + }, + + 'style': { + pattern: /^([ \t]*(?:classDef|linkStyle|style)[ \t]+[\w$-]+[ \t]+)\w.*[^\s;]/m, + lookbehind: true, + inside: { + 'property': /\b\w[\w-]*(?=[ \t]*:)/, + 'operator': /:/, + 'punctuation': /,/ + } + }, + + 'inter-arrow-label': { + pattern: /([^<>ox.=-])(?:-[-.]|==)(?![<>ox.=-])[ \t]*(?:"[^"\r\n]*"|[^\s".=-](?:[^\r\n.=-]*[^\s.=-])?)[ \t]*(?:\.+->?|--+[->]|==+[=>])(?![<>ox.=-])/, + lookbehind: true, + greedy: true, + inside: { + 'arrow': { + pattern: /(?:\.+->?|--+[->]|==+[=>])$/, + alias: 'operator' + }, + 'label': { + pattern: /^([\s\S]{2}[ \t]*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + alias: 'property' + }, + 'arrow-head': { + pattern: /^\S+/, + alias: ['arrow', 'operator'] + } + } + }, + + 'arrow': [ + // This might look complex but it really isn't. + // There are many possible arrows (see tests) and it's impossible to fit all of them into one pattern. The + // problem is that we only have one lookbehind per pattern. However, we cannot disallow too many arrow + // characters in the one lookbehind because that would create too many false negatives. So we have to split the + // arrows into different patterns. + { + // ER diagram + pattern: /(^|[^{}|o.-])[|}][|o](?:--|\.\.)[|o][|{](?![{}|o.-])/, + lookbehind: true, + alias: 'operator' + }, + { + // flow chart + // (?:==+|--+|-\.*-) + pattern: /(^|[^<>ox.=-])(?:[ox]?|(?:==+|--+|-\.*-)[>ox]|===+|---+|-\.+-)(?![<>ox.=-])/, + lookbehind: true, + alias: 'operator' + }, + { + // sequence diagram + pattern: /(^|[^<>()x-])(?:--?(?:>>|[x>)])(?![<>()x])|(?:<<|[x<(])--?(?!-))/, + lookbehind: true, + alias: 'operator' + }, + { + // class diagram + pattern: /(^|[^<>|*o.-])(?:[*o]--|--[*o]|<\|?(?:--|\.\.)|(?:--|\.\.)\|?>|--|\.\.)(?![<>|*o.-])/, + lookbehind: true, + alias: 'operator' + }, + ], + + 'label': { + pattern: /(^|[^|<])\|(?:[^\r\n"|]|"[^"\r\n]*")+\|/, + lookbehind: true, + greedy: true, + alias: 'property' + }, + + 'text': { + pattern: /(?:[(\[{]+|\b>)(?:[^\r\n"()\[\]{}]|"[^"\r\n]*")+(?:[)\]}]+|>)/, + alias: 'string' + }, + 'string': { + pattern: /"[^"\r\n]*"/, + greedy: true + }, + + 'annotation': { + pattern: /<<(?:abstract|choice|enumeration|fork|interface|join|service)>>|\[\[(?:choice|fork|join)\]\]/i, + alias: 'important' + }, + + 'keyword': [ + // This language has both case-sensitive and case-insensitive keywords + { + pattern: /(^[ \t]*)(?:action|callback|class|classDef|classDiagram|click|direction|erDiagram|flowchart|gantt|gitGraph|graph|journey|link|linkStyle|pie|requirementDiagram|sequenceDiagram|stateDiagram|stateDiagram-v2|style|subgraph)(?![\w$-])/m, + lookbehind: true, + greedy: true + }, + { + pattern: /(^[ \t]*)(?:activate|alt|and|as|autonumber|deactivate|else|end(?:[ \t]+note)?|loop|opt|par|participant|rect|state|note[ \t]+(?:over|(?:left|right)[ \t]+of))(?![\w$-])/im, + lookbehind: true, + greedy: true + } + ], + + 'entity': /#[a-z0-9]+;/, + + 'operator': { + pattern: /(\w[ \t]*)&(?=[ \t]*\w)|:::|:/, + lookbehind: true + }, + 'punctuation': /[(){};]/ +}; diff --git a/components/prism-mermaid.min.js b/components/prism-mermaid.min.js new file mode 100644 index 0000000000..054b4350b0 --- /dev/null +++ b/components/prism-mermaid.min.js @@ -0,0 +1 @@ +Prism.languages.mermaid={comment:{pattern:/%%.*/,greedy:!0},style:{pattern:/^([ \t]*(?:classDef|linkStyle|style)[ \t]+[\w$-]+[ \t]+)\w.*[^\s;]/m,lookbehind:!0,inside:{property:/\b\w[\w-]*(?=[ \t]*:)/,operator:/:/,punctuation:/,/}},"inter-arrow-label":{pattern:/([^<>ox.=-])(?:-[-.]|==)(?![<>ox.=-])[ \t]*(?:"[^"\r\n]*"|[^\s".=-](?:[^\r\n.=-]*[^\s.=-])?)[ \t]*(?:\.+->?|--+[->]|==+[=>])(?![<>ox.=-])/,lookbehind:!0,greedy:!0,inside:{arrow:{pattern:/(?:\.+->?|--+[->]|==+[=>])$/,alias:"operator"},label:{pattern:/^([\s\S]{2}[ \t]*)\S(?:[\s\S]*\S)?/,lookbehind:!0,alias:"property"},"arrow-head":{pattern:/^\S+/,alias:["arrow","operator"]}}},arrow:[{pattern:/(^|[^{}|o.-])[|}][|o](?:--|\.\.)[|o][|{](?![{}|o.-])/,lookbehind:!0,alias:"operator"},{pattern:/(^|[^<>ox.=-])(?:[ox]?|(?:==+|--+|-\.*-)[>ox]|===+|---+|-\.+-)(?![<>ox.=-])/,lookbehind:!0,alias:"operator"},{pattern:/(^|[^<>()x-])(?:--?(?:>>|[x>)])(?![<>()x])|(?:<<|[x<(])--?(?!-))/,lookbehind:!0,alias:"operator"},{pattern:/(^|[^<>|*o.-])(?:[*o]--|--[*o]|<\|?(?:--|\.\.)|(?:--|\.\.)\|?>|--|\.\.)(?![<>|*o.-])/,lookbehind:!0,alias:"operator"}],label:{pattern:/(^|[^|<])\|(?:[^\r\n"|]|"[^"\r\n]*")+\|/,lookbehind:!0,greedy:!0,alias:"property"},text:{pattern:/(?:[(\[{]+|\b>)(?:[^\r\n"()\[\]{}]|"[^"\r\n]*")+(?:[)\]}]+|>)/,alias:"string"},string:{pattern:/"[^"\r\n]*"/,greedy:!0},annotation:{pattern:/<<(?:abstract|choice|enumeration|fork|interface|join|service)>>|\[\[(?:choice|fork|join)\]\]/i,alias:"important"},keyword:[{pattern:/(^[ \t]*)(?:action|callback|class|classDef|classDiagram|click|direction|erDiagram|flowchart|gantt|gitGraph|graph|journey|link|linkStyle|pie|requirementDiagram|sequenceDiagram|stateDiagram|stateDiagram-v2|style|subgraph)(?![\w$-])/m,lookbehind:!0,greedy:!0},{pattern:/(^[ \t]*)(?:activate|alt|and|as|autonumber|deactivate|else|end(?:[ \t]+note)?|loop|opt|par|participant|rect|state|note[ \t]+(?:over|(?:left|right)[ \t]+of))(?![\w$-])/im,lookbehind:!0,greedy:!0}],entity:/#[a-z0-9]+;/,operator:{pattern:/(\w[ \t]*)&(?=[ \t]*\w)|:::|:/,lookbehind:!0},punctuation:/[(){};]/}; \ No newline at end of file diff --git a/components/prism-mizar.js b/components/prism-mizar.js index 1c5d18b031..9e19e7afdd 100644 --- a/components/prism-mizar.js +++ b/components/prism-mizar.js @@ -1,12 +1,12 @@ Prism.languages.mizar = { 'comment': /::.+/, - 'keyword': /@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|equals|end|environ|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:y|ies)|when|where|with|wrt)\b/, + 'keyword': /@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|end|environ|equals|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:ies|y)|when|where|with|wrt)\b/, 'parameter': { pattern: /\$(?:10|\d)/, alias: 'variable' }, - 'variable': /\w+(?=:)/, + 'variable': /\b\w+(?=:)/, 'number': /(?:\b|-)\d+\b/, 'operator': /\.\.\.|->|&|\.?=/, 'punctuation': /\(#|#\)|[,:;\[\](){}]/ -}; \ No newline at end of file +}; diff --git a/components/prism-mizar.min.js b/components/prism-mizar.min.js index bf0c962544..dd38293b61 100644 --- a/components/prism-mizar.min.js +++ b/components/prism-mizar.min.js @@ -1 +1 @@ -Prism.languages.mizar={comment:/::.+/,keyword:/@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|equals|end|environ|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:y|ies)|when|where|with|wrt)\b/,parameter:{pattern:/\$(?:10|\d)/,alias:"variable"},variable:/\w+(?=:)/,number:/(?:\b|-)\d+\b/,operator:/\.\.\.|->|&|\.?=/,punctuation:/\(#|#\)|[,:;\[\](){}]/}; \ No newline at end of file +Prism.languages.mizar={comment:/::.+/,keyword:/@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|end|environ|equals|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:ies|y)|when|where|with|wrt)\b/,parameter:{pattern:/\$(?:10|\d)/,alias:"variable"},variable:/\b\w+(?=:)/,number:/(?:\b|-)\d+\b/,operator:/\.\.\.|->|&|\.?=/,punctuation:/\(#|#\)|[,:;\[\](){}]/}; \ No newline at end of file diff --git a/components/prism-mongodb.js b/components/prism-mongodb.js new file mode 100644 index 0000000000..9a4e1d06d0 --- /dev/null +++ b/components/prism-mongodb.js @@ -0,0 +1,97 @@ +(function (Prism) { + + var operators = [ + // query and projection + '$eq', '$gt', '$gte', '$in', '$lt', '$lte', '$ne', '$nin', '$and', '$not', '$nor', '$or', + '$exists', '$type', '$expr', '$jsonSchema', '$mod', '$regex', '$text', '$where', '$geoIntersects', + '$geoWithin', '$near', '$nearSphere', '$all', '$elemMatch', '$size', '$bitsAllClear', '$bitsAllSet', + '$bitsAnyClear', '$bitsAnySet', '$comment', '$elemMatch', '$meta', '$slice', + + // update + '$currentDate', '$inc', '$min', '$max', '$mul', '$rename', '$set', '$setOnInsert', '$unset', + '$addToSet', '$pop', '$pull', '$push', '$pullAll', '$each', '$position', '$slice', '$sort', '$bit', + + // aggregation pipeline stages + '$addFields', '$bucket', '$bucketAuto', '$collStats', '$count', '$currentOp', '$facet', '$geoNear', + '$graphLookup', '$group', '$indexStats', '$limit', '$listLocalSessions', '$listSessions', '$lookup', + '$match', '$merge', '$out', '$planCacheStats', '$project', '$redact', '$replaceRoot', '$replaceWith', + '$sample', '$set', '$skip', '$sort', '$sortByCount', '$unionWith', '$unset', '$unwind', '$setWindowFields', + + // aggregation pipeline operators + '$abs', '$accumulator', '$acos', '$acosh', '$add', '$addToSet', '$allElementsTrue', '$and', + '$anyElementTrue', '$arrayElemAt', '$arrayToObject', '$asin', '$asinh', '$atan', '$atan2', + '$atanh', '$avg', '$binarySize', '$bsonSize', '$ceil', '$cmp', '$concat', '$concatArrays', '$cond', + '$convert', '$cos', '$dateFromParts', '$dateToParts', '$dateFromString', '$dateToString', '$dayOfMonth', + '$dayOfWeek', '$dayOfYear', '$degreesToRadians', '$divide', '$eq', '$exp', '$filter', '$first', + '$floor', '$function', '$gt', '$gte', '$hour', '$ifNull', '$in', '$indexOfArray', '$indexOfBytes', + '$indexOfCP', '$isArray', '$isNumber', '$isoDayOfWeek', '$isoWeek', '$isoWeekYear', '$last', + '$last', '$let', '$literal', '$ln', '$log', '$log10', '$lt', '$lte', '$ltrim', '$map', '$max', + '$mergeObjects', '$meta', '$min', '$millisecond', '$minute', '$mod', '$month', '$multiply', '$ne', + '$not', '$objectToArray', '$or', '$pow', '$push', '$radiansToDegrees', '$range', '$reduce', + '$regexFind', '$regexFindAll', '$regexMatch', '$replaceOne', '$replaceAll', '$reverseArray', '$round', + '$rtrim', '$second', '$setDifference', '$setEquals', '$setIntersection', '$setIsSubset', '$setUnion', + '$size', '$sin', '$slice', '$split', '$sqrt', '$stdDevPop', '$stdDevSamp', '$strcasecmp', '$strLenBytes', + '$strLenCP', '$substr', '$substrBytes', '$substrCP', '$subtract', '$sum', '$switch', '$tan', + '$toBool', '$toDate', '$toDecimal', '$toDouble', '$toInt', '$toLong', '$toObjectId', '$toString', + '$toLower', '$toUpper', '$trim', '$trunc', '$type', '$week', '$year', '$zip', '$count', '$dateAdd', + '$dateDiff', '$dateSubtract', '$dateTrunc', '$getField', '$rand', '$sampleRate', '$setField', '$unsetField', + + // aggregation pipeline query modifiers + '$comment', '$explain', '$hint', '$max', '$maxTimeMS', '$min', '$orderby', '$query', + '$returnKey', '$showDiskLoc', '$natural', + ]; + + var builtinFunctions = [ + 'ObjectId', + 'Code', + 'BinData', + 'DBRef', + 'Timestamp', + 'NumberLong', + 'NumberDecimal', + 'MaxKey', + 'MinKey', + 'RegExp', + 'ISODate', + 'UUID', + ]; + + operators = operators.map(function (operator) { + return operator.replace('$', '\\$'); + }); + + var operatorsSource = '(?:' + operators.join('|') + ')\\b'; + + Prism.languages.mongodb = Prism.languages.extend('javascript', {}); + + Prism.languages.insertBefore('mongodb', 'string', { + 'property': { + pattern: /(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/, + greedy: true, + inside: { + 'keyword': RegExp('^([\'"])?' + operatorsSource + '(?:\\1)?$') + } + } + }); + + Prism.languages.mongodb.string.inside = { + url: { + // url pattern + pattern: /https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i, + greedy: true + }, + entity: { + // ipv4 + pattern: /\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/, + greedy: true + } + }; + + Prism.languages.insertBefore('mongodb', 'constant', { + 'builtin': { + pattern: RegExp('\\b(?:' + builtinFunctions.join('|') + ')\\b'), + alias: 'keyword' + } + }); + +}(Prism)); diff --git a/components/prism-mongodb.min.js b/components/prism-mongodb.min.js new file mode 100644 index 0000000000..52c6572b22 --- /dev/null +++ b/components/prism-mongodb.min.js @@ -0,0 +1 @@ +!function($){var e=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$and","$not","$nor","$or","$exists","$type","$expr","$jsonSchema","$mod","$regex","$text","$where","$geoIntersects","$geoWithin","$near","$nearSphere","$all","$elemMatch","$size","$bitsAllClear","$bitsAllSet","$bitsAnyClear","$bitsAnySet","$comment","$elemMatch","$meta","$slice","$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$each","$position","$slice","$sort","$bit","$addFields","$bucket","$bucketAuto","$collStats","$count","$currentOp","$facet","$geoNear","$graphLookup","$group","$indexStats","$limit","$listLocalSessions","$listSessions","$lookup","$match","$merge","$out","$planCacheStats","$project","$redact","$replaceRoot","$replaceWith","$sample","$set","$skip","$sort","$sortByCount","$unionWith","$unset","$unwind","$setWindowFields","$abs","$accumulator","$acos","$acosh","$add","$addToSet","$allElementsTrue","$and","$anyElementTrue","$arrayElemAt","$arrayToObject","$asin","$asinh","$atan","$atan2","$atanh","$avg","$binarySize","$bsonSize","$ceil","$cmp","$concat","$concatArrays","$cond","$convert","$cos","$dateFromParts","$dateToParts","$dateFromString","$dateToString","$dayOfMonth","$dayOfWeek","$dayOfYear","$degreesToRadians","$divide","$eq","$exp","$filter","$first","$floor","$function","$gt","$gte","$hour","$ifNull","$in","$indexOfArray","$indexOfBytes","$indexOfCP","$isArray","$isNumber","$isoDayOfWeek","$isoWeek","$isoWeekYear","$last","$last","$let","$literal","$ln","$log","$log10","$lt","$lte","$ltrim","$map","$max","$mergeObjects","$meta","$min","$millisecond","$minute","$mod","$month","$multiply","$ne","$not","$objectToArray","$or","$pow","$push","$radiansToDegrees","$range","$reduce","$regexFind","$regexFindAll","$regexMatch","$replaceOne","$replaceAll","$reverseArray","$round","$rtrim","$second","$setDifference","$setEquals","$setIntersection","$setIsSubset","$setUnion","$size","$sin","$slice","$split","$sqrt","$stdDevPop","$stdDevSamp","$strcasecmp","$strLenBytes","$strLenCP","$substr","$substrBytes","$substrCP","$subtract","$sum","$switch","$tan","$toBool","$toDate","$toDecimal","$toDouble","$toInt","$toLong","$toObjectId","$toString","$toLower","$toUpper","$trim","$trunc","$type","$week","$year","$zip","$count","$dateAdd","$dateDiff","$dateSubtract","$dateTrunc","$getField","$rand","$sampleRate","$setField","$unsetField","$comment","$explain","$hint","$max","$maxTimeMS","$min","$orderby","$query","$returnKey","$showDiskLoc","$natural"],t="(?:"+(e=e.map(function($){return $.replace("$","\\$")})).join("|")+")\\b";$.languages.mongodb=$.languages.extend("javascript",{}),$.languages.insertBefore("mongodb","string",{property:{pattern:/(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/,greedy:!0,inside:{keyword:RegExp("^(['\"])?"+t+"(?:\\1)?$")}}}),$.languages.mongodb.string.inside={url:{pattern:/https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i,greedy:!0},entity:{pattern:/\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/,greedy:!0}},$.languages.insertBefore("mongodb","constant",{builtin:{pattern:RegExp("\\b(?:"+["ObjectId","Code","BinData","DBRef","Timestamp","NumberLong","NumberDecimal","MaxKey","MinKey","RegExp","ISODate","UUID"].join("|")+")\\b"),alias:"keyword"}})}(Prism); \ No newline at end of file diff --git a/components/prism-monkey.js b/components/prism-monkey.js index be3cc789d2..c5b7f6118a 100644 --- a/components/prism-monkey.js +++ b/components/prism-monkey.js @@ -1,31 +1,29 @@ Prism.languages.monkey = { - 'string': /"[^"\r\n]*"/, - 'comment': [ - { - pattern: /^#Rem\s+[\s\S]*?^#End/im, - greedy: true - }, - { - pattern: /'.+/, - greedy: true - } - ], + 'comment': { + pattern: /^#Rem\s[\s\S]*?^#End|'.+/im, + greedy: true + }, + 'string': { + pattern: /"[^"\r\n]*"/, + greedy: true, + }, 'preprocessor': { pattern: /(^[ \t]*)#.+/m, lookbehind: true, - alias: 'comment' + greedy: true, + alias: 'property' }, - 'function': /\w+(?=\()/, + + 'function': /\b\w+(?=\()/, 'type-char': { - pattern: /(\w)[?%#$]/, - lookbehind: true, - alias: 'variable' + pattern: /\b[?%#$]/, + alias: 'class-name' }, 'number': { pattern: /((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i, lookbehind: true }, - 'keyword': /\b(?:Void|Strict|Public|Private|Property|Bool|Int|Float|String|Array|Object|Continue|Exit|Import|Extern|New|Self|Super|Try|Catch|Eachin|True|False|Extends|Abstract|Final|Select|Case|Default|Const|Local|Global|Field|Method|Function|Class|End|If|Then|Else|ElseIf|EndIf|While|Wend|Repeat|Until|Forever|For|To|Step|Next|Return|Module|Interface|Implements|Inline|Throw|Null)\b/i, + 'keyword': /\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i, 'operator': /\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i, 'punctuation': /[.,:;()\[\]]/ -}; \ No newline at end of file +}; diff --git a/components/prism-monkey.min.js b/components/prism-monkey.min.js index eb756a89bb..5908950a50 100644 --- a/components/prism-monkey.min.js +++ b/components/prism-monkey.min.js @@ -1 +1 @@ -Prism.languages.monkey={string:/"[^"\r\n]*"/,comment:[{pattern:/^#Rem\s+[\s\S]*?^#End/im,greedy:!0},{pattern:/'.+/,greedy:!0}],preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,alias:"comment"},function:/\w+(?=\()/,"type-char":{pattern:/(\w)[?%#$]/,lookbehind:!0,alias:"variable"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Void|Strict|Public|Private|Property|Bool|Int|Float|String|Array|Object|Continue|Exit|Import|Extern|New|Self|Super|Try|Catch|Eachin|True|False|Extends|Abstract|Final|Select|Case|Default|Const|Local|Global|Field|Method|Function|Class|End|If|Then|Else|ElseIf|EndIf|While|Wend|Repeat|Until|Forever|For|To|Step|Next|Return|Module|Interface|Implements|Inline|Throw|Null)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}; \ No newline at end of file +Prism.languages.monkey={comment:{pattern:/^#Rem\s[\s\S]*?^#End|'.+/im,greedy:!0},string:{pattern:/"[^"\r\n]*"/,greedy:!0},preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,greedy:!0,alias:"property"},function:/\b\w+(?=\()/,"type-char":{pattern:/\b[?%#$]/,alias:"class-name"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}; \ No newline at end of file diff --git a/components/prism-moonscript.js b/components/prism-moonscript.js index 22d6b98036..ee10233134 100644 --- a/components/prism-moonscript.js +++ b/components/prism-moonscript.js @@ -41,7 +41,7 @@ Prism.languages.moonscript = { lookbehind: true }, 'function': { - pattern: /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:running|create|resume|status|wrap|yield)|debug\.(?:debug|gethook|getinfo|getlocal|getupvalue|setlocal|setupvalue|sethook|traceback|getfenv|getmetatable|getregistry|setfenv|setmetatable)|dofile|error|getfenv|getmetatable|io\.(?:stdin|stdout|stderr|close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|sin|cos|tan|deg|exp|floor|log|log10|max|min|fmod|modf|cosh|sinh|tanh|pow|rad|sqrt|frexp|ldexp|random|randomseed|pi)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|len|lower|rep|sub|upper|format|gsub|gmatch|match|reverse)|table\.(?:maxn|concat|sort|insert|remove)|tonumber|tostring|type|unpack|xpcall)\b/, + pattern: /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/, inside: { 'punctuation': /\./ } diff --git a/components/prism-moonscript.min.js b/components/prism-moonscript.min.js index 69823428be..bf3f99c5e2 100644 --- a/components/prism-moonscript.min.js +++ b/components/prism-moonscript.min.js @@ -1 +1 @@ -Prism.languages.moonscript={comment:/--.*/,string:[{pattern:/'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,greedy:!0},{pattern:/"[^"]*"/,greedy:!0,inside:{interpolation:{pattern:/#\{[^{}]*\}/,inside:{moonscript:{pattern:/(^#\{)[\s\S]+(?=\})/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/#\{|\}/,alias:"punctuation"}}}}}],"class-name":[{pattern:/(\b(?:class|extends)[ \t]+)\w+/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,variable:/@@?\w*/,property:{pattern:/\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,lookbehind:!0},function:{pattern:/\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:running|create|resume|status|wrap|yield)|debug\.(?:debug|gethook|getinfo|getlocal|getupvalue|setlocal|setupvalue|sethook|traceback|getfenv|getmetatable|getregistry|setfenv|setmetatable)|dofile|error|getfenv|getmetatable|io\.(?:stdin|stdout|stderr|close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|sin|cos|tan|deg|exp|floor|log|log10|max|min|fmod|modf|cosh|sinh|tanh|pow|rad|sqrt|frexp|ldexp|random|randomseed|pi)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|len|lower|rep|sub|upper|format|gsub|gmatch|match|reverse)|table\.(?:maxn|concat|sort|insert|remove)|tonumber|tostring|type|unpack|xpcall)\b/,inside:{punctuation:/\./}},boolean:/\b(?:false|true)\b/,number:/(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,operator:/\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,punctuation:/[.,()[\]{}\\]/},Prism.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside=Prism.languages.moonscript,Prism.languages.moon=Prism.languages.moonscript; \ No newline at end of file +Prism.languages.moonscript={comment:/--.*/,string:[{pattern:/'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,greedy:!0},{pattern:/"[^"]*"/,greedy:!0,inside:{interpolation:{pattern:/#\{[^{}]*\}/,inside:{moonscript:{pattern:/(^#\{)[\s\S]+(?=\})/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/#\{|\}/,alias:"punctuation"}}}}}],"class-name":[{pattern:/(\b(?:class|extends)[ \t]+)\w+/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,variable:/@@?\w*/,property:{pattern:/\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,lookbehind:!0},function:{pattern:/\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/,inside:{punctuation:/\./}},boolean:/\b(?:false|true)\b/,number:/(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,operator:/\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,punctuation:/[.,()[\]{}\\]/},Prism.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside=Prism.languages.moonscript,Prism.languages.moon=Prism.languages.moonscript; \ No newline at end of file diff --git a/components/prism-n1ql.js b/components/prism-n1ql.js index 59bb8e425b..0eee0d6615 100644 --- a/components/prism-n1ql.js +++ b/components/prism-n1ql.js @@ -1,6 +1,10 @@ +// https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/index.html + Prism.languages.n1ql = { - 'comment': /\/\*[\s\S]*?(?:$|\*\/)/, - 'parameter': /\$[\w.]+/, + 'comment': { + pattern: /\/\*[\s\S]*?(?:$|\*\/)|--.*/, + greedy: true, + }, 'string': { pattern: /(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/, greedy: true, @@ -9,10 +13,12 @@ Prism.languages.n1ql = { pattern: /`(?:\\[\s\S]|[^\\`]|``)*`/, greedy: true, }, - 'function': /\b(?:ABS|ACOS|ARRAY_AGG|ARRAY_APPEND|ARRAY_AVG|ARRAY_CONCAT|ARRAY_CONTAINS|ARRAY_COUNT|ARRAY_DISTINCT|ARRAY_FLATTEN|ARRAY_IFNULL|ARRAY_INSERT|ARRAY_INTERSECT|ARRAY_LENGTH|ARRAY_MAX|ARRAY_MIN|ARRAY_POSITION|ARRAY_PREPEND|ARRAY_PUT|ARRAY_RANGE|ARRAY_REMOVE|ARRAY_REPEAT|ARRAY_REPLACE|ARRAY_REVERSE|ARRAY_SORT|ARRAY_STAR|ARRAY_SUM|ARRAY_SYMDIFF|ARRAY_SYMDIFFN|ARRAY_UNION|ASIN|ATAN|ATAN2|AVG|BASE64|BASE64_DECODE|BASE64_ENCODE|BITAND|BITCLEAR|BITNOT|BITOR|BITSET|BITSHIFT|BITTEST|BITXOR|CEIL|CLOCK_LOCAL|CLOCK_MILLIS|CLOCK_STR|CLOCK_TZ|CLOCK_UTC|CONTAINS|CONTAINS_TOKEN|CONTAINS_TOKEN_LIKE|CONTAINS_TOKEN_REGEXP|COS|COUNT|CURL|DATE_ADD_MILLIS|DATE_ADD_STR|DATE_DIFF_MILLIS|DATE_DIFF_STR|DATE_FORMAT_STR|DATE_PART_MILLIS|DATE_PART_STR|DATE_RANGE_MILLIS|DATE_RANGE_STR|DATE_TRUNC_MILLIS|DATE_TRUNC_STR|DECODE_JSON|DEGREES|DURATION_TO_STR|E|ENCODED_SIZE|ENCODE_JSON|EXP|FLOOR|GREATEST|HAS_TOKEN|IFINF|IFMISSING|IFMISSINGORNULL|IFNAN|IFNANORINF|IFNULL|INITCAP|ISARRAY|ISATOM|ISBOOLEAN|ISNUMBER|ISOBJECT|ISSTRING|IsBitSET|LEAST|LENGTH|LN|LOG|LOWER|LTRIM|MAX|META|MILLIS|MILLIS_TO_LOCAL|MILLIS_TO_STR|MILLIS_TO_TZ|MILLIS_TO_UTC|MILLIS_TO_ZONE_NAME|MIN|MISSINGIF|NANIF|NEGINFIF|NOW_LOCAL|NOW_MILLIS|NOW_STR|NOW_TZ|NOW_UTC|NULLIF|OBJECT_ADD|OBJECT_CONCAT|OBJECT_INNER_PAIRS|OBJECT_INNER_VALUES|OBJECT_LENGTH|OBJECT_NAMES|OBJECT_PAIRS|OBJECT_PUT|OBJECT_REMOVE|OBJECT_RENAME|OBJECT_REPLACE|OBJECT_UNWRAP|OBJECT_VALUES|PAIRS|PI|POLY_LENGTH|POSINFIF|POSITION|POWER|RADIANS|RANDOM|REGEXP_CONTAINS|REGEXP_LIKE|REGEXP_POSITION|REGEXP_REPLACE|REPEAT|REPLACE|REVERSE|ROUND|RTRIM|SIGN|SIN|SPLIT|SQRT|STR_TO_DURATION|STR_TO_MILLIS|STR_TO_TZ|STR_TO_UTC|STR_TO_ZONE_NAME|SUBSTR|SUFFIXES|SUM|TAN|TITLE|TOARRAY|TOATOM|TOBOOLEAN|TOKENS|TOKENS|TONUMBER|TOOBJECT|TOSTRING|TRIM|TRUNC|TYPE|UPPER|WEEKDAY_MILLIS|WEEKDAY_STR)(?=\s*\()/i, - 'keyword': /\b(?:ALL|ALTER|ANALYZE|AS|ASC|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|CONNECT|CONTINUE|CORRELATE|COVER|CREATE|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FLATTEN|FOR|FORCE|FROM|FUNCTION|GRANT|GROUP|GSI|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LAST|LEFT|LET|LETTING|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NULL|NUMBER|OBJECT|OFFSET|ON|OPTION|ORDER|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROCEDURE|PUBLIC|RAW|REALM|REDUCE|RENAME|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|SATISFIES|SCHEMA|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TO|TRANSACTION|TRIGGER|TRUNCATE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WITH|WORK|XOR)\b/i, - 'boolean': /\b(?:TRUE|FALSE)\b/i, - 'number': /(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+\.?\d*|\B\.\d+\b/i, - 'operator': /[-+*\/=%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i, + 'parameter': /\$[\w.]+/, + // https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html#n1ql-reserved-words + 'keyword': /\b(?:ADVISE|ALL|ALTER|ANALYZE|AS|ASC|AT|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|COMMITTED|CONNECT|CONTINUE|CORRELATE|CORRELATED|COVER|CREATE|CURRENT|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FILTER|FLATTEN|FLUSH|FOLLOWING|FOR|FORCE|FROM|FTS|FUNCTION|GOLANG|GRANT|GROUP|GROUPS|GSI|HASH|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|ISOLATION|JAVASCRIPT|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LANGUAGE|LAST|LEFT|LET|LETTING|LEVEL|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NL|NO|NTH_VALUE|NULL|NULLS|NUMBER|OBJECT|OFFSET|ON|OPTION|OPTIONS|ORDER|OTHERS|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PRECEDING|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROBE|PROCEDURE|PUBLIC|RANGE|RAW|REALM|REDUCE|RENAME|RESPECT|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|ROW|ROWS|SATISFIES|SAVEPOINT|SCHEMA|SCOPE|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TIES|TO|TRAN|TRANSACTION|TRIGGER|TRUNCATE|UNBOUNDED|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WINDOW|WITH|WORK|XOR)\b/i, + 'function': /\b[a-z_]\w*(?=\s*\()/i, + 'boolean': /\b(?:FALSE|TRUE)\b/i, + 'number': /(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i, + 'operator': /[-+*\/%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i, 'punctuation': /[;[\](),.{}:]/ -}; \ No newline at end of file +}; diff --git a/components/prism-n1ql.min.js b/components/prism-n1ql.min.js index bb6fd63345..97ae248231 100644 --- a/components/prism-n1ql.min.js +++ b/components/prism-n1ql.min.js @@ -1 +1 @@ -Prism.languages.n1ql={comment:/\/\*[\s\S]*?(?:$|\*\/)/,parameter:/\$[\w.]+/,string:{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/,greedy:!0},identifier:{pattern:/`(?:\\[\s\S]|[^\\`]|``)*`/,greedy:!0},function:/\b(?:ABS|ACOS|ARRAY_AGG|ARRAY_APPEND|ARRAY_AVG|ARRAY_CONCAT|ARRAY_CONTAINS|ARRAY_COUNT|ARRAY_DISTINCT|ARRAY_FLATTEN|ARRAY_IFNULL|ARRAY_INSERT|ARRAY_INTERSECT|ARRAY_LENGTH|ARRAY_MAX|ARRAY_MIN|ARRAY_POSITION|ARRAY_PREPEND|ARRAY_PUT|ARRAY_RANGE|ARRAY_REMOVE|ARRAY_REPEAT|ARRAY_REPLACE|ARRAY_REVERSE|ARRAY_SORT|ARRAY_STAR|ARRAY_SUM|ARRAY_SYMDIFF|ARRAY_SYMDIFFN|ARRAY_UNION|ASIN|ATAN|ATAN2|AVG|BASE64|BASE64_DECODE|BASE64_ENCODE|BITAND|BITCLEAR|BITNOT|BITOR|BITSET|BITSHIFT|BITTEST|BITXOR|CEIL|CLOCK_LOCAL|CLOCK_MILLIS|CLOCK_STR|CLOCK_TZ|CLOCK_UTC|CONTAINS|CONTAINS_TOKEN|CONTAINS_TOKEN_LIKE|CONTAINS_TOKEN_REGEXP|COS|COUNT|CURL|DATE_ADD_MILLIS|DATE_ADD_STR|DATE_DIFF_MILLIS|DATE_DIFF_STR|DATE_FORMAT_STR|DATE_PART_MILLIS|DATE_PART_STR|DATE_RANGE_MILLIS|DATE_RANGE_STR|DATE_TRUNC_MILLIS|DATE_TRUNC_STR|DECODE_JSON|DEGREES|DURATION_TO_STR|E|ENCODED_SIZE|ENCODE_JSON|EXP|FLOOR|GREATEST|HAS_TOKEN|IFINF|IFMISSING|IFMISSINGORNULL|IFNAN|IFNANORINF|IFNULL|INITCAP|ISARRAY|ISATOM|ISBOOLEAN|ISNUMBER|ISOBJECT|ISSTRING|IsBitSET|LEAST|LENGTH|LN|LOG|LOWER|LTRIM|MAX|META|MILLIS|MILLIS_TO_LOCAL|MILLIS_TO_STR|MILLIS_TO_TZ|MILLIS_TO_UTC|MILLIS_TO_ZONE_NAME|MIN|MISSINGIF|NANIF|NEGINFIF|NOW_LOCAL|NOW_MILLIS|NOW_STR|NOW_TZ|NOW_UTC|NULLIF|OBJECT_ADD|OBJECT_CONCAT|OBJECT_INNER_PAIRS|OBJECT_INNER_VALUES|OBJECT_LENGTH|OBJECT_NAMES|OBJECT_PAIRS|OBJECT_PUT|OBJECT_REMOVE|OBJECT_RENAME|OBJECT_REPLACE|OBJECT_UNWRAP|OBJECT_VALUES|PAIRS|PI|POLY_LENGTH|POSINFIF|POSITION|POWER|RADIANS|RANDOM|REGEXP_CONTAINS|REGEXP_LIKE|REGEXP_POSITION|REGEXP_REPLACE|REPEAT|REPLACE|REVERSE|ROUND|RTRIM|SIGN|SIN|SPLIT|SQRT|STR_TO_DURATION|STR_TO_MILLIS|STR_TO_TZ|STR_TO_UTC|STR_TO_ZONE_NAME|SUBSTR|SUFFIXES|SUM|TAN|TITLE|TOARRAY|TOATOM|TOBOOLEAN|TOKENS|TOKENS|TONUMBER|TOOBJECT|TOSTRING|TRIM|TRUNC|TYPE|UPPER|WEEKDAY_MILLIS|WEEKDAY_STR)(?=\s*\()/i,keyword:/\b(?:ALL|ALTER|ANALYZE|AS|ASC|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|CONNECT|CONTINUE|CORRELATE|COVER|CREATE|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FLATTEN|FOR|FORCE|FROM|FUNCTION|GRANT|GROUP|GSI|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LAST|LEFT|LET|LETTING|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NULL|NUMBER|OBJECT|OFFSET|ON|OPTION|ORDER|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROCEDURE|PUBLIC|RAW|REALM|REDUCE|RENAME|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|SATISFIES|SCHEMA|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TO|TRANSACTION|TRIGGER|TRUNCATE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WITH|WORK|XOR)\b/i,boolean:/\b(?:TRUE|FALSE)\b/i,number:/(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+\.?\d*|\B\.\d+\b/i,operator:/[-+*\/=%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i,punctuation:/[;[\](),.{}:]/}; \ No newline at end of file +Prism.languages.n1ql={comment:{pattern:/\/\*[\s\S]*?(?:$|\*\/)|--.*/,greedy:!0},string:{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/,greedy:!0},identifier:{pattern:/`(?:\\[\s\S]|[^\\`]|``)*`/,greedy:!0},parameter:/\$[\w.]+/,keyword:/\b(?:ADVISE|ALL|ALTER|ANALYZE|AS|ASC|AT|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|COMMITTED|CONNECT|CONTINUE|CORRELATE|CORRELATED|COVER|CREATE|CURRENT|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FILTER|FLATTEN|FLUSH|FOLLOWING|FOR|FORCE|FROM|FTS|FUNCTION|GOLANG|GRANT|GROUP|GROUPS|GSI|HASH|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|ISOLATION|JAVASCRIPT|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LANGUAGE|LAST|LEFT|LET|LETTING|LEVEL|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NL|NO|NTH_VALUE|NULL|NULLS|NUMBER|OBJECT|OFFSET|ON|OPTION|OPTIONS|ORDER|OTHERS|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PRECEDING|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROBE|PROCEDURE|PUBLIC|RANGE|RAW|REALM|REDUCE|RENAME|RESPECT|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|ROW|ROWS|SATISFIES|SAVEPOINT|SCHEMA|SCOPE|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TIES|TO|TRAN|TRANSACTION|TRIGGER|TRUNCATE|UNBOUNDED|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WINDOW|WITH|WORK|XOR)\b/i,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:FALSE|TRUE)\b/i,number:/(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i,punctuation:/[;[\](),.{}:]/}; \ No newline at end of file diff --git a/components/prism-n4js.js b/components/prism-n4js.js index c81e262583..916d83a918 100755 --- a/components/prism-n4js.js +++ b/components/prism-n4js.js @@ -1,6 +1,6 @@ Prism.languages.n4js = Prism.languages.extend('javascript', { // Keywords from N4JS language spec: https://numberfour.github.io/n4js/spec/N4JSSpec.html - 'keyword': /\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/ + 'keyword': /\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/ }); Prism.languages.insertBefore('n4js', 'constant', { @@ -11,4 +11,4 @@ Prism.languages.insertBefore('n4js', 'constant', { } }); -Prism.languages.n4jsd=Prism.languages.n4js; +Prism.languages.n4jsd = Prism.languages.n4js; diff --git a/components/prism-n4js.min.js b/components/prism-n4js.min.js index d3b9632b3c..1ce5ed5ce8 100755 --- a/components/prism-n4js.min.js +++ b/components/prism-n4js.min.js @@ -1 +1 @@ -Prism.languages.n4js=Prism.languages.extend("javascript",{keyword:/\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),Prism.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),Prism.languages.n4jsd=Prism.languages.n4js; \ No newline at end of file +Prism.languages.n4js=Prism.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),Prism.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),Prism.languages.n4jsd=Prism.languages.n4js; \ No newline at end of file diff --git a/components/prism-nand2tetris-hdl.js b/components/prism-nand2tetris-hdl.js index b2af921bf0..29ba4f29e0 100644 --- a/components/prism-nand2tetris-hdl.js +++ b/components/prism-nand2tetris-hdl.js @@ -1,8 +1,8 @@ Prism.languages['nand2tetris-hdl'] = { 'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, - 'keyword': /\b(?:CHIP|IN|OUT|PARTS|BUILTIN|CLOCKED)\b/, - 'boolean': /\b(?:true|false)\b/, - 'function': /[A-Za-z][A-Za-z0-9]*(?=\()/, + 'keyword': /\b(?:BUILTIN|CHIP|CLOCKED|IN|OUT|PARTS)\b/, + 'boolean': /\b(?:false|true)\b/, + 'function': /\b[A-Za-z][A-Za-z0-9]*(?=\()/, 'number': /\b\d+\b/, 'operator': /=|\.\./, 'punctuation': /[{}[\];(),:]/ diff --git a/components/prism-nand2tetris-hdl.min.js b/components/prism-nand2tetris-hdl.min.js index 0af0f1956e..fc8ea3dfbd 100644 --- a/components/prism-nand2tetris-hdl.min.js +++ b/components/prism-nand2tetris-hdl.min.js @@ -1 +1 @@ -Prism.languages["nand2tetris-hdl"]={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,keyword:/\b(?:CHIP|IN|OUT|PARTS|BUILTIN|CLOCKED)\b/,boolean:/\b(?:true|false)\b/,function:/[A-Za-z][A-Za-z0-9]*(?=\()/,number:/\b\d+\b/,operator:/=|\.\./,punctuation:/[{}[\];(),:]/}; \ No newline at end of file +Prism.languages["nand2tetris-hdl"]={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,keyword:/\b(?:BUILTIN|CHIP|CLOCKED|IN|OUT|PARTS)\b/,boolean:/\b(?:false|true)\b/,function:/\b[A-Za-z][A-Za-z0-9]*(?=\()/,number:/\b\d+\b/,operator:/=|\.\./,punctuation:/[{}[\];(),:]/}; \ No newline at end of file diff --git a/components/prism-naniscript.js b/components/prism-naniscript.js new file mode 100644 index 0000000000..9284cc8ee2 --- /dev/null +++ b/components/prism-naniscript.js @@ -0,0 +1,170 @@ +(function (Prism) { + + var expressionDef = /\{[^\r\n\[\]{}]*\}/; + + var params = { + 'quoted-string': { + pattern: /"(?:[^"\\]|\\.)*"/, + alias: 'operator' + }, + 'command-param-id': { + pattern: /(\s)\w+:/, + lookbehind: true, + alias: 'property' + }, + 'command-param-value': [ + { + pattern: expressionDef, + alias: 'selector', + }, + { + pattern: /([\t ])\S+/, + lookbehind: true, + greedy: true, + alias: 'operator', + }, + { + pattern: /\S(?:.*\S)?/, + alias: 'operator', + } + ] + }; + + Prism.languages.naniscript = { + // ; ... + 'comment': { + pattern: /^([\t ]*);.*/m, + lookbehind: true, + }, + // > ... + // Define is a control line starting with '>' followed by a word, a space and a text. + 'define': { + pattern: /^>.+/m, + alias: 'tag', + inside: { + 'value': { + pattern: /(^>\w+[\t ]+)(?!\s)[^{}\r\n]+/, + lookbehind: true, + alias: 'operator' + }, + 'key': { + pattern: /(^>)\w+/, + lookbehind: true, + } + } + }, + // # ... + 'label': { + pattern: /^([\t ]*)#[\t ]*\w+[\t ]*$/m, + lookbehind: true, + alias: 'regex' + }, + 'command': { + pattern: /^([\t ]*)@\w+(?=[\t ]|$).*/m, + lookbehind: true, + alias: 'function', + inside: { + 'command-name': /^@\w+/, + 'expression': { + pattern: expressionDef, + greedy: true, + alias: 'selector' + }, + 'command-params': { + pattern: /\s*\S[\s\S]*/, + inside: params + }, + } + }, + // Generic is any line that doesn't start with operators: ;>#@ + 'generic-text': { + pattern: /(^[ \t]*)[^#@>;\s].*/m, + lookbehind: true, + alias: 'punctuation', + inside: { + // \{ ... \} ... \[ ... \] ... \" + 'escaped-char': /\\[{}\[\]"]/, + 'expression': { + pattern: expressionDef, + greedy: true, + alias: 'selector' + }, + 'inline-command': { + pattern: /\[[\t ]*\w[^\r\n\[\]]*\]/, + greedy: true, + alias: 'function', + inside: { + 'command-params': { + pattern: /(^\[[\t ]*\w+\b)[\s\S]+(?=\]$)/, + lookbehind: true, + inside: params + }, + 'command-param-name': { + pattern: /^(\[[\t ]*)\w+/, + lookbehind: true, + alias: 'name', + }, + 'start-stop-char': /[\[\]]/, + } + }, + } + } + }; + Prism.languages.nani = Prism.languages['naniscript']; + + /** @typedef {InstanceType} Token */ + + /** + * This hook is used to validate generic-text tokens for balanced brackets. + * Mark token as bad-line when contains not balanced brackets: {},[] + */ + Prism.hooks.add('after-tokenize', function (env) { + /** @type {(Token | string)[]} */ + var tokens = env.tokens; + tokens.forEach(function (token) { + if (typeof token !== 'string' && token.type === 'generic-text') { + var content = getTextContent(token); + if (!isBracketsBalanced(content)) { + token.type = 'bad-line'; + token.content = content; + } + } + }); + }); + + /** + * @param {string} input + * @returns {boolean} + */ + function isBracketsBalanced(input) { + var brackets = '[]{}'; + var stack = []; + for (var i = 0; i < input.length; i++) { + var bracket = input[i]; + var bracketsIndex = brackets.indexOf(bracket); + if (bracketsIndex !== -1) { + if (bracketsIndex % 2 === 0) { + stack.push(bracketsIndex + 1); + } else if (stack.pop() !== bracketsIndex) { + return false; + } + } + } + return stack.length === 0; + } + + /** + * @param {string | Token | (string | Token)[]} token + * @returns {string} + */ + function getTextContent(token) { + if (typeof token === 'string') { + return token; + } else if (Array.isArray(token)) { + return token.map(getTextContent).join(''); + } else { + return getTextContent(token.content); + } + } + +}(Prism)); diff --git a/components/prism-naniscript.min.js b/components/prism-naniscript.min.js new file mode 100644 index 0000000000..627c052acf --- /dev/null +++ b/components/prism-naniscript.min.js @@ -0,0 +1 @@ +!function(e){var a=/\{[^\r\n\[\]{}]*\}/,n={"quoted-string":{pattern:/"(?:[^"\\]|\\.)*"/,alias:"operator"},"command-param-id":{pattern:/(\s)\w+:/,lookbehind:!0,alias:"property"},"command-param-value":[{pattern:a,alias:"selector"},{pattern:/([\t ])\S+/,lookbehind:!0,greedy:!0,alias:"operator"},{pattern:/\S(?:.*\S)?/,alias:"operator"}]};function t(e){return"string"==typeof e?e:Array.isArray(e)?e.map(t).join(""):t(e.content)}e.languages.naniscript={comment:{pattern:/^([\t ]*);.*/m,lookbehind:!0},define:{pattern:/^>.+/m,alias:"tag",inside:{value:{pattern:/(^>\w+[\t ]+)(?!\s)[^{}\r\n]+/,lookbehind:!0,alias:"operator"},key:{pattern:/(^>)\w+/,lookbehind:!0}}},label:{pattern:/^([\t ]*)#[\t ]*\w+[\t ]*$/m,lookbehind:!0,alias:"regex"},command:{pattern:/^([\t ]*)@\w+(?=[\t ]|$).*/m,lookbehind:!0,alias:"function",inside:{"command-name":/^@\w+/,expression:{pattern:a,greedy:!0,alias:"selector"},"command-params":{pattern:/\s*\S[\s\S]*/,inside:n}}},"generic-text":{pattern:/(^[ \t]*)[^#@>;\s].*/m,lookbehind:!0,alias:"punctuation",inside:{"escaped-char":/\\[{}\[\]"]/,expression:{pattern:a,greedy:!0,alias:"selector"},"inline-command":{pattern:/\[[\t ]*\w[^\r\n\[\]]*\]/,greedy:!0,alias:"function",inside:{"command-params":{pattern:/(^\[[\t ]*\w+\b)[\s\S]+(?=\]$)/,lookbehind:!0,inside:n},"command-param-name":{pattern:/^(\[[\t ]*)\w+/,lookbehind:!0,alias:"name"},"start-stop-char":/[\[\]]/}}}}},e.languages.nani=e.languages.naniscript,e.hooks.add("after-tokenize",function(e){e.tokens.forEach(function(e){if("string"!=typeof e&&"generic-text"===e.type){var a=t(e);(function(e){for(var a=[],n=0;n=&|$!]/ }; diff --git a/components/prism-nasm.min.js b/components/prism-nasm.min.js index 40148e5e75..13eb8bada9 100644 --- a/components/prism-nasm.min.js +++ b/components/prism-nasm.min.js @@ -1 +1 @@ -Prism.languages.nasm={comment:/;.*$/m,string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,label:{pattern:/(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,lookbehind:!0,alias:"function"},keyword:[/\[?BITS (?:16|32|64)\]?/,{pattern:/(^\s*)section\s*[a-zA-Z.]+:?/im,lookbehind:!0},/(?:extern|global)[^;\r\n]*/i,/(?:CPU|FLOAT|DEFAULT).*$/m],register:{pattern:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s)\b/i,alias:"variable"},number:/(?:\b|(?=\$))(?:0[hx][\da-f]*\.?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-\/%<>=&|$!]/}; \ No newline at end of file +Prism.languages.nasm={comment:/;.*$/m,string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,label:{pattern:/(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,lookbehind:!0,alias:"function"},keyword:[/\[?BITS (?:16|32|64)\]?/,{pattern:/(^\s*)section\s*[a-z.]+:?/im,lookbehind:!0},/(?:extern|global)[^;\r\n]*/i,/(?:CPU|DEFAULT|FLOAT).*$/m],register:{pattern:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|di|si|sp)|[cdefgs]s)\b/i,alias:"variable"},number:/(?:\b|(?=\$))(?:0[hx](?:\.[\da-f]+|[\da-f]+(?:\.[\da-f]+)?)(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-\/%<>=&|$!]/}; \ No newline at end of file diff --git a/components/prism-neon.js b/components/prism-neon.js index 4acd10c535..b2b1fc5e66 100644 --- a/components/prism-neon.js +++ b/components/prism-neon.js @@ -14,11 +14,11 @@ Prism.languages.neon = { alias: 'atrule' }, 'number': { - pattern: /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+\.?\d*|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/, + pattern: /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/, lookbehind: true }, 'boolean': { - pattern: /(^|[[{(=:,\s])(?:true|false|yes|no)(?=$|[\]}),:=\s])/i, + pattern: /(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i, lookbehind: true }, 'null': { @@ -32,10 +32,9 @@ Prism.languages.neon = { greedy: true }, 'literal': { - pattern: /(^|[[{(=:,\s])(?:[^#"\',:=[\]{}()\s`-]|[:-][^"\',=[\]{}()\s])(?:[^,:=\]})(\s]+|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/, + pattern: /(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/, lookbehind: true, alias: 'string', }, 'punctuation': /[,:=[\]{}()-]/, }; - diff --git a/components/prism-neon.min.js b/components/prism-neon.min.js index 7783ba7310..3bc91f3e7a 100644 --- a/components/prism-neon.min.js +++ b/components/prism-neon.min.js @@ -1 +1 @@ -Prism.languages.neon={comment:{pattern:/#.*/,greedy:!0},datetime:{pattern:/(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,lookbehind:!0,alias:"number"},key:{pattern:/(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,lookbehind:!0,alias:"atrule"},number:{pattern:/(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+\.?\d*|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,lookbehind:!0},boolean:{pattern:/(^|[[{(=:,\s])(?:true|false|yes|no)(?=$|[\]}),:=\s])/i,lookbehind:!0},null:{pattern:/(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,lookbehind:!0,alias:"keyword"},string:{pattern:/(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,lookbehind:!0,greedy:!0},literal:{pattern:/(^|[[{(=:,\s])(?:[^#"\',:=[\]{}()\s`-]|[:-][^"\',=[\]{}()\s])(?:[^,:=\]})(\s]+|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,lookbehind:!0,alias:"string"},punctuation:/[,:=[\]{}()-]/}; \ No newline at end of file +Prism.languages.neon={comment:{pattern:/#.*/,greedy:!0},datetime:{pattern:/(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,lookbehind:!0,alias:"number"},key:{pattern:/(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,lookbehind:!0,alias:"atrule"},number:{pattern:/(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,lookbehind:!0},boolean:{pattern:/(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i,lookbehind:!0},null:{pattern:/(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,lookbehind:!0,alias:"keyword"},string:{pattern:/(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,lookbehind:!0,greedy:!0},literal:{pattern:/(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,lookbehind:!0,alias:"string"},punctuation:/[,:=[\]{}()-]/}; \ No newline at end of file diff --git a/components/prism-nevod.js b/components/prism-nevod.js new file mode 100644 index 0000000000..867c171aeb --- /dev/null +++ b/components/prism-nevod.js @@ -0,0 +1,125 @@ +Prism.languages.nevod = { + 'comment': /\/\/.*|(?:\/\*[\s\S]*?(?:\*\/|$))/, + 'string': { + pattern: /(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))!?\*?/, + greedy: true, + inside: { + 'string-attrs': /!$|!\*$|\*$/, + }, + }, + 'namespace': { + pattern: /(@namespace\s+)[a-zA-Z0-9\-.]+(?=\s*\{)/, + lookbehind: true, + }, + 'pattern': { + pattern: /(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*\(\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*\))?(?=\s*=)/, + lookbehind: true, + inside: { + 'pattern-name': { + pattern: /^#?[a-zA-Z0-9\-.]+/, + alias: 'class-name', + }, + 'fields': { + pattern: /\(.*\)/, + inside: { + 'field-name': { + pattern: /[a-zA-Z0-9\-.]+/, + alias: 'variable', + }, + 'punctuation': /[,()]/, + 'operator': { + pattern: /~/, + alias: 'field-hidden-mark', + }, + }, + }, + }, + }, + 'search': { + pattern: /(@search\s+|#)[a-zA-Z0-9\-.]+(?:\.\*)?(?=\s*;)/, + alias: 'function', + lookbehind: true, + }, + 'keyword': /@(?:having|inside|namespace|outside|pattern|require|search|where)\b/, + 'standard-pattern': { + pattern: /\b(?:Alpha|AlphaNum|Any|Blank|End|LineBreak|Num|NumAlpha|Punct|Space|Start|Symbol|Word|WordBreak)\b(?:\([a-zA-Z0-9\-.,\s+]*\))?/, + inside: { + 'standard-pattern-name': { + pattern: /^[a-zA-Z0-9\-.]+/, + alias: 'builtin', + }, + 'quantifier': { + pattern: /\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/, + alias: 'number', + }, + 'standard-pattern-attr': { + pattern: /[a-zA-Z0-9\-.]+/, + alias: 'builtin', + }, + 'punctuation': /[,()]/, + }, + }, + 'quantifier': { + pattern: /\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/, + alias: 'number', + }, + 'operator': [ + { + pattern: /=/, + alias: 'pattern-def', + }, + { + pattern: /&/, + alias: 'conjunction', + }, + { + pattern: /~/, + alias: 'exception', + }, + { + pattern: /\?/, + alias: 'optionality', + }, + { + pattern: /[[\]]/, + alias: 'repetition', + }, + { + pattern: /[{}]/, + alias: 'variation', + }, + { + pattern: /[+_]/, + alias: 'sequence', + }, + { + pattern: /\.{2,3}/, + alias: 'span', + }, + ], + 'field-capture': [ + { + pattern: /([a-zA-Z0-9\-.]+\s*\()\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+(?:\s*,\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+)*(?=\s*\))/, + lookbehind: true, + inside: { + 'field-name': { + pattern: /[a-zA-Z0-9\-.]+/, + alias: 'variable', + }, + 'colon': /:/, + }, + }, + { + pattern: /[a-zA-Z0-9\-.]+\s*:/, + inside: { + 'field-name': { + pattern: /[a-zA-Z0-9\-.]+/, + alias: 'variable', + }, + 'colon': /:/, + }, + }, + ], + 'punctuation': /[:;,()]/, + 'name': /[a-zA-Z0-9\-.]+/ +}; diff --git a/components/prism-nevod.min.js b/components/prism-nevod.min.js new file mode 100644 index 0000000000..1cb6b8a24d --- /dev/null +++ b/components/prism-nevod.min.js @@ -0,0 +1 @@ +Prism.languages.nevod={comment:/\/\/.*|(?:\/\*[\s\S]*?(?:\*\/|$))/,string:{pattern:/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))!?\*?/,greedy:!0,inside:{"string-attrs":/!$|!\*$|\*$/}},namespace:{pattern:/(@namespace\s+)[a-zA-Z0-9\-.]+(?=\s*\{)/,lookbehind:!0},pattern:{pattern:/(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*\(\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*\))?(?=\s*=)/,lookbehind:!0,inside:{"pattern-name":{pattern:/^#?[a-zA-Z0-9\-.]+/,alias:"class-name"},fields:{pattern:/\(.*\)/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},punctuation:/[,()]/,operator:{pattern:/~/,alias:"field-hidden-mark"}}}}},search:{pattern:/(@search\s+|#)[a-zA-Z0-9\-.]+(?:\.\*)?(?=\s*;)/,alias:"function",lookbehind:!0},keyword:/@(?:having|inside|namespace|outside|pattern|require|search|where)\b/,"standard-pattern":{pattern:/\b(?:Alpha|AlphaNum|Any|Blank|End|LineBreak|Num|NumAlpha|Punct|Space|Start|Symbol|Word|WordBreak)\b(?:\([a-zA-Z0-9\-.,\s+]*\))?/,inside:{"standard-pattern-name":{pattern:/^[a-zA-Z0-9\-.]+/,alias:"builtin"},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},"standard-pattern-attr":{pattern:/[a-zA-Z0-9\-.]+/,alias:"builtin"},punctuation:/[,()]/}},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},operator:[{pattern:/=/,alias:"pattern-def"},{pattern:/&/,alias:"conjunction"},{pattern:/~/,alias:"exception"},{pattern:/\?/,alias:"optionality"},{pattern:/[[\]]/,alias:"repetition"},{pattern:/[{}]/,alias:"variation"},{pattern:/[+_]/,alias:"sequence"},{pattern:/\.{2,3}/,alias:"span"}],"field-capture":[{pattern:/([a-zA-Z0-9\-.]+\s*\()\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+(?:\s*,\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+)*(?=\s*\))/,lookbehind:!0,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}},{pattern:/[a-zA-Z0-9\-.]+\s*:/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}}],punctuation:/[:;,()]/,name:/[a-zA-Z0-9\-.]+/}; \ No newline at end of file diff --git a/components/prism-nginx.js b/components/prism-nginx.js index c9a7ccc37b..2d7dfd30cd 100644 --- a/components/prism-nginx.js +++ b/components/prism-nginx.js @@ -1,11 +1,54 @@ -Prism.languages.nginx = Prism.languages.extend('clike', { - 'comment': { - pattern: /(^|[^"{\\])#.*/, - lookbehind: true - }, - 'keyword': /\b(?:CONTENT_|DOCUMENT_|GATEWAY_|HTTP_|HTTPS|if_not_empty|PATH_|QUERY_|REDIRECT_|REMOTE_|REQUEST_|SCGI|SCRIPT_|SERVER_|http|events|accept_mutex|accept_mutex_delay|access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth|auth_basic|auth_basic_user_file|auth_http|auth_http_header|auth_http_timeout|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|debug_connection|debug_points|default_type|deny|devpoll_changes|devpoll_events|directio|directio_alignment|disable_symlinks|empty_gif|env|epoll_events|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|google_perftools_profiles|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|imap_capabilities|imap_client_buffer|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|kqueue_changes|kqueue_events|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|lock_file|log_format|log_format_combined|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|multi_accept|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|pop3_auth|pop3_capabilities|port_in_redirect|post_action|postpone_output|protocol|proxy|proxy_buffer|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_error_message|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_timeout|proxy_upstream_fail_timeout|proxy_upstream_max_fails|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|rtsig_signo|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|smtp_auth|smtp_capabilities|so_keepalive|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|starttls|stub_status|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timeout|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|use|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory|xclient|xml_entities|xslt_entities|xslt_stylesheet|xslt_types|ssl_session_tickets|ssl_stapling|ssl_stapling_verify|ssl_ecdh_curve|ssl_trusted_certificate|more_set_headers|ssl_early_data)\b/i -}); - -Prism.languages.insertBefore('nginx', 'keyword', { - 'variable': /\$[a-z_]+/i -}); +(function (Prism) { + + var variable = /\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i; + + Prism.languages.nginx = { + 'comment': { + pattern: /(^|[\s{};])#.*/, + lookbehind: true, + greedy: true + }, + 'directive': { + pattern: /(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/, + lookbehind: true, + greedy: true, + inside: { + 'string': { + pattern: /((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/, + lookbehind: true, + greedy: true, + inside: { + 'escape': { + pattern: /\\["'\\nrt]/, + alias: 'entity' + }, + 'variable': variable + } + }, + 'comment': { + pattern: /(\s)#.*/, + lookbehind: true, + greedy: true + }, + 'keyword': { + pattern: /^\S+/, + greedy: true + }, + + // other patterns + + 'boolean': { + pattern: /(\s)(?:off|on)(?!\S)/, + lookbehind: true + }, + 'number': { + pattern: /(\s)\d+[a-z]*(?!\S)/i, + lookbehind: true + }, + 'variable': variable + } + }, + 'punctuation': /[{};]/ + }; + +}(Prism)); diff --git a/components/prism-nginx.min.js b/components/prism-nginx.min.js index 0c1d62aa8c..b00cc5ab45 100644 --- a/components/prism-nginx.min.js +++ b/components/prism-nginx.min.js @@ -1 +1 @@ -Prism.languages.nginx=Prism.languages.extend("clike",{comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},keyword:/\b(?:CONTENT_|DOCUMENT_|GATEWAY_|HTTP_|HTTPS|if_not_empty|PATH_|QUERY_|REDIRECT_|REMOTE_|REQUEST_|SCGI|SCRIPT_|SERVER_|http|events|accept_mutex|accept_mutex_delay|access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth|auth_basic|auth_basic_user_file|auth_http|auth_http_header|auth_http_timeout|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|debug_connection|debug_points|default_type|deny|devpoll_changes|devpoll_events|directio|directio_alignment|disable_symlinks|empty_gif|env|epoll_events|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|google_perftools_profiles|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|imap_capabilities|imap_client_buffer|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|kqueue_changes|kqueue_events|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|lock_file|log_format|log_format_combined|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|multi_accept|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|pop3_auth|pop3_capabilities|port_in_redirect|post_action|postpone_output|protocol|proxy|proxy_buffer|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_error_message|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_timeout|proxy_upstream_fail_timeout|proxy_upstream_max_fails|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|rtsig_signo|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|smtp_auth|smtp_capabilities|so_keepalive|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|starttls|stub_status|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timeout|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|use|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory|xclient|xml_entities|xslt_entities|xslt_stylesheet|xslt_types|ssl_session_tickets|ssl_stapling|ssl_stapling_verify|ssl_ecdh_curve|ssl_trusted_certificate|more_set_headers|ssl_early_data)\b/i}),Prism.languages.insertBefore("nginx","keyword",{variable:/\$[a-z_]+/i}); \ No newline at end of file +!function(e){var n=/\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i;Prism.languages.nginx={comment:{pattern:/(^|[\s{};])#.*/,lookbehind:!0,greedy:!0},directive:{pattern:/(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:{string:{pattern:/((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,lookbehind:!0,greedy:!0,inside:{escape:{pattern:/\\["'\\nrt]/,alias:"entity"},variable:n}},comment:{pattern:/(\s)#.*/,lookbehind:!0,greedy:!0},keyword:{pattern:/^\S+/,greedy:!0},boolean:{pattern:/(\s)(?:off|on)(?!\S)/,lookbehind:!0},number:{pattern:/(\s)\d+[a-z]*(?!\S)/i,lookbehind:!0},variable:n}},punctuation:/[{};]/}}(); \ No newline at end of file diff --git a/components/prism-nim.js b/components/prism-nim.js index 97990d9f63..bc53dc96e1 100644 --- a/components/prism-nim.js +++ b/components/prism-nim.js @@ -1,33 +1,44 @@ Prism.languages.nim = { - 'comment': /#.*/, - // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals) - // Character literals are handled specifically to prevent issues with numeric type suffixes + 'comment': { + pattern: /#.*/, + greedy: true + }, 'string': { - pattern: /(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/, + // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals) + pattern: /(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")/, greedy: true }, - // The negative look ahead prevents wrong highlighting of the .. operator - 'number': /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/, - 'keyword': /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/, + 'char': { + // Character literals are handled specifically to prevent issues with numeric type suffixes + pattern: /'(?:\\(?:\d+|x[\da-fA-F]{0,2}|.)|[^'])'/, + greedy: true + }, + 'function': { - pattern: /(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/, + pattern: /(?:(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/, + greedy: true, inside: { 'operator': /\*$/ } }, - // We don't want to highlight operators inside backticks - 'ignore': { + // We don't want to highlight operators (and anything really) inside backticks + 'identifier': { pattern: /`[^`\r\n]+`/, + greedy: true, inside: { 'punctuation': /`/ } }, + + // The negative look ahead prevents wrong highlighting of the .. operator + 'number': /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/, + 'keyword': /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/, 'operator': { // Look behind and look ahead prevent wrong highlighting of punctuations [. .] {. .} (. .) // but allow the slice operator .. to take precedence over them // One can define his own operators in Nim so all combination of operators might be an operator. - pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m, + pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|in|is|isnot|mod|not|notin|of|or|shl|shr|xor)\b)/m, lookbehind: true }, 'punctuation': /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/ -}; \ No newline at end of file +}; diff --git a/components/prism-nim.min.js b/components/prism-nim.min.js index 0a254a6345..e7ed392bd9 100644 --- a/components/prism-nim.min.js +++ b/components/prism-nim.min.js @@ -1 +1 @@ -Prism.languages.nim={comment:/#.*/,string:{pattern:/(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,greedy:!0},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,function:{pattern:/(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,inside:{operator:/\*$/}},ignore:{pattern:/`[^`\r\n]+`/,inside:{punctuation:/`/}},operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}; \ No newline at end of file +Prism.languages.nim={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")/,greedy:!0},char:{pattern:/'(?:\\(?:\d+|x[\da-fA-F]{0,2}|.)|[^'])'/,greedy:!0},function:{pattern:/(?:(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,greedy:!0,inside:{operator:/\*$/}},identifier:{pattern:/`[^`\r\n]+`/,greedy:!0,inside:{punctuation:/`/}},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|in|is|isnot|mod|not|notin|of|or|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}; \ No newline at end of file diff --git a/components/prism-nix.js b/components/prism-nix.js index 84ade924e4..d06a76c18c 100644 --- a/components/prism-nix.js +++ b/components/prism-nix.js @@ -1,20 +1,17 @@ Prism.languages.nix = { - 'comment': /\/\*[\s\S]*?\*\/|#.*/, + 'comment': { + pattern: /\/\*[\s\S]*?\*\/|#.*/, + greedy: true + }, 'string': { pattern: /"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/, greedy: true, inside: { 'interpolation': { // The lookbehind ensures the ${} is not preceded by \ or '' - pattern: /(^|(?:^|(?!'').)[^\\])\$\{(?:[^}]|\{[^}]*\})*}/, + pattern: /(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/, lookbehind: true, - inside: { - 'antiquotation': { - pattern: /^\$(?=\{)/, - alias: 'variable' - } - // See rest below - } + inside: null // see below } } }, @@ -27,14 +24,14 @@ Prism.languages.nix = { ], 'antiquotation': { pattern: /\$(?=\{)/, - alias: 'variable' + alias: 'important' }, 'number': /\b\d+\b/, 'keyword': /\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/, - 'function': /\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/, - 'boolean': /\b(?:true|false)\b/, + 'function': /\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:Tarball|url)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/, + 'boolean': /\b(?:false|true)\b/, 'operator': /[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/, 'punctuation': /[{}()[\].,:;]/ }; -Prism.languages.nix.string.inside.interpolation.inside.rest = Prism.languages.nix; \ No newline at end of file +Prism.languages.nix.string.inside.interpolation.inside = Prism.languages.nix; diff --git a/components/prism-nix.min.js b/components/prism-nix.min.js index 518164c4f0..9e0bfc02a1 100644 --- a/components/prism-nix.min.js +++ b/components/prism-nix.min.js @@ -1 +1 @@ -Prism.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^}]|\{[^}]*\})*}/,lookbehind:!0,inside:{antiquotation:{pattern:/^\$(?=\{)/,alias:"variable"}}}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"variable"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},Prism.languages.nix.string.inside.interpolation.inside.rest=Prism.languages.nix; \ No newline at end of file +Prism.languages.nix={comment:{pattern:/\/\*[\s\S]*?\*\/|#.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:null}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"important"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:Tarball|url)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:false|true)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},Prism.languages.nix.string.inside.interpolation.inside=Prism.languages.nix; \ No newline at end of file diff --git a/components/prism-nsis.js b/components/prism-nsis.js index 0486561b25..f012f09f05 100644 --- a/components/prism-nsis.js +++ b/components/prism-nsis.js @@ -1,29 +1,30 @@ /** * Original by Jan T. Sott (http://github.com/idleberg) * - * Includes all commands and plug-ins shipped with NSIS 3.02 + * Includes all commands and plug-ins shipped with NSIS 3.08 */ - Prism.languages.nsis = { +Prism.languages.nsis = { 'comment': { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/, - lookbehind: true + lookbehind: true, + greedy: true }, 'string': { pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: true }, 'keyword': { - pattern: /(^\s*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(?:Font|Gradient|Image)|BrandingText|BringToFront|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|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|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|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|Name|Nop|ns(?:Dialogs|Exec)|NSISdl|OutFile|Page(?:Callbacks)?|PE(?:DllCharacteristics|SubsysVer)|Pop|Push|Quit|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|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|Unicode|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle)\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|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: true }, - 'property': /\b(?: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|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)\b/, - 'constant': /\${[\w\.:\^-]+}|\$\([\w\.:\^-]+\)/i, - 'variable': /\$\w+/i, - 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, + '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: /(^\s*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/mi, + 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: true } }; diff --git a/components/prism-nsis.min.js b/components/prism-nsis.min.js index 3e887a2098..6e577777ab 100644 --- a/components/prism-nsis.min.js +++ b/components/prism-nsis.min.js @@ -1 +1 @@ -Prism.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^\s*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(?:Font|Gradient|Image)|BrandingText|BringToFront|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|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|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|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|Name|Nop|ns(?:Dialogs|Exec)|NSISdl|OutFile|Page(?:Callbacks)?|PE(?:DllCharacteristics|SubsysVer)|Pop|Push|Quit|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|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|Unicode|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle)\b/m,lookbehind:!0},property:/\b(?: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|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)\b/,constant:/\${[\w\.:\^-]+}|\$\([\w\.:\^-]+\)/i,variable:/\$\w+/i,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^\s*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|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|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 diff --git a/components/prism-objectivec.js b/components/prism-objectivec.js index 386b351276..e17fc4e435 100644 --- a/components/prism-objectivec.js +++ b/components/prism-objectivec.js @@ -1,9 +1,12 @@ Prism.languages.objectivec = Prism.languages.extend('c', { - 'keyword': /\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/, - 'string': /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, + 'string': { + pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, + greedy: true + }, + 'keyword': /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/, 'operator': /-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/ }); delete Prism.languages.objectivec['class-name']; -Prism.languages.objc = Prism.languages.objectivec; \ No newline at end of file +Prism.languages.objc = Prism.languages.objectivec; diff --git a/components/prism-objectivec.min.js b/components/prism-objectivec.min.js index a7568e9ce6..f8932973ea 100644 --- a/components/prism-objectivec.min.js +++ b/components/prism-objectivec.min.js @@ -1 +1 @@ -Prism.languages.objectivec=Prism.languages.extend("c",{keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec; \ No newline at end of file +Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec; \ No newline at end of file diff --git a/components/prism-ocaml.js b/components/prism-ocaml.js index a13ded0a51..2fac3b0c59 100644 --- a/components/prism-ocaml.js +++ b/components/prism-ocaml.js @@ -1,41 +1,58 @@ +// https://ocaml.org/manual/lex.html + Prism.languages.ocaml = { - 'comment': /\(\*[\s\S]*?\*\)/, + 'comment': { + pattern: /\(\*[\s\S]*?\*\)/, + greedy: true + }, + 'char': { + pattern: /'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i, + greedy: true + }, 'string': [ { - pattern: /"(?:\\.|[^\\\r\n"])*"/, + pattern: /"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/, greedy: true }, { - pattern: /(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i, + pattern: /\{([a-z_]*)\|[\s\S]*?\|\1\}/, greedy: true } ], - 'number': /\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i, + 'number': [ + // binary and octal + /\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i, + // hexadecimal + /\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i, + // decimal + /\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i, + ], 'directive': { pattern: /\B#\w+/, - alias: 'important' + alias: 'property' }, 'label': { pattern: /\B~\w+/, - alias: 'function' + alias: 'property' }, - 'type_variable': { + 'type-variable': { pattern: /\B'\w+/, alias: 'function' }, 'variant': { pattern: /`\w+/, - alias: 'variable' - }, - 'module': { - pattern: /\b[A-Z]\w+/, - alias: 'variable' + alias: 'symbol' }, // For the list of keywords and operators, // see: http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec84 'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/, 'boolean': /\b(?:false|true)\b/, + + 'operator-like-punctuation': { + pattern: /\[[<>|]|[>|]\]|\{<|>\}/, + alias: 'punctuation' + }, // Custom operators are allowed - 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/, - 'punctuation': /[(){}\[\]|.,:;]|\b_\b/ + 'operator': /\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/, + 'punctuation': /;;|::|[(){}\[\].,:;#]|\b_\b/ }; diff --git a/components/prism-ocaml.min.js b/components/prism-ocaml.min.js index b4ea3c5b38..c7b21ad693 100644 --- a/components/prism-ocaml.min.js +++ b/components/prism-ocaml.min.js @@ -1 +1 @@ -Prism.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},type_variable:{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\]|.,:;]|\b_\b/}; \ No newline at end of file +Prism.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/}; \ No newline at end of file diff --git a/components/prism-opencl.js b/components/prism-opencl.js index b6247b20b1..f4b9de851d 100644 --- a/components/prism-opencl.js +++ b/components/prism-opencl.js @@ -2,38 +2,45 @@ /* OpenCL kernel language */ Prism.languages.opencl = Prism.languages.extend('c', { // Extracted from the official specs (2.0) and http://streamcomputing.eu/downloads/?opencl.lang (opencl-keywords, opencl-types) and http://sourceforge.net/tracker/?func=detail&aid=2957794&group_id=95717&atid=612384 (Words2, partly Words3) - // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/scalarDataTypes.html - // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/otherDataTypes.html - 'keyword': /\b(?:__attribute__|(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|auto|break|case|cl_(?:image_format|mem_fence_flags)|clk_event_t|complex|const|continue|default|do|(?:float|double)(?:16(?:x(?:1|16|2|4|8))?|1x(?:1|16|2|4|8)|2(?:x(?:1|16|2|4|8))?|3|4(?:x(?:1|16|2|4|8))?|8(?:x(?:1|16|2|4|8))?)?|else|enum|event_t|extern|for|goto|(?:u?(?:char|short|int|long)|half|quad|bool)(?:2|3|4|8|16)?|if|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|imaginary|inline|intptr_t|ndrange_t|packed|pipe|ptrdiff_t|queue_t|register|reserve_id_t|restrict|return|sampler_t|signed|size_t|sizeof|static|struct|switch|typedef|uintptr_t|uniform|union|unsigned|void|volatile|while)\b/, + 'keyword': /\b(?:(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|__attribute__|auto|(?:bool|u?(?:char|int|long|short)|half|quad)(?:2|3|4|8|16)?|break|case|complex|const|continue|(?:double|float)(?:16(?:x(?:1|2|4|8|16))?|1x(?:1|2|4|8|16)|2(?:x(?:1|2|4|8|16))?|3|4(?:x(?:1|2|4|8|16))?|8(?:x(?:1|2|4|8|16))?)?|default|do|else|enum|extern|for|goto|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/, // Extracted from http://streamcomputing.eu/downloads/?opencl.lang (opencl-const) // Math Constants: https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/mathConstants.html // Macros and Limits: https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/macroLimits.html + 'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i, + 'boolean': /\b(?:false|true)\b/, 'constant-opencl-kernel': { - pattern: /\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:LOCAL|GLOBAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|MANT_DIG|(?:MIN|MAX)(?:(?:_10)?_EXP)?)|FLT_RADIX|HUGE_VALF?|INFINITY|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|(?:UCHAR|USHRT|UINT|ULONG)_MAX|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:10|2)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN)\b/, + pattern: /\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:GLOBAL|LOCAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|(?:MAX|MIN)(?:(?:_10)?_EXP)?|MANT_DIG)|FLT_RADIX|HUGE_VALF?|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|INFINITY|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:2|10)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN|(?:UCHAR|UINT|ULONG|USHRT)_MAX)\b/, alias: 'constant' - }, - 'boolean': /\b(?:false|true)\b/, - 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]*/i + } + }); + + Prism.languages.insertBefore('opencl', 'class-name', { + // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/scalarDataTypes.html + // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/otherDataTypes.html + 'builtin-type': { + pattern: /\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|intptr_t|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|uintptr_t)\b/, + alias: 'keyword' + } }); var attributes = { // Extracted from http://streamcomputing.eu/downloads/?opencl_host.lang (opencl-types and opencl-host) 'type-opencl-host': { - pattern: /\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|short|int|long)|float|double)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/, + pattern: /\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|int|long|short)|double|float)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/, alias: 'keyword' }, 'boolean-opencl-host': { - pattern: /\bCL_(?:TRUE|FALSE)\b/, + pattern: /\bCL_(?:FALSE|TRUE)\b/, alias: 'boolean' }, // Extracted from cl.h (2.0) and http://streamcomputing.eu/downloads/?opencl_host.lang (opencl-const) 'constant-opencl-host': { - pattern: /\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:16|24|8|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/, + pattern: /\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:8|16|24|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/, alias: 'constant' }, // Extracted from cl.h (2.0) and http://streamcomputing.eu/downloads/?opencl_host.lang (opencl-host) 'function-opencl-host': { - pattern: /\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|Kernel|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/, + pattern: /\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/, alias: 'function' } }; @@ -45,7 +52,7 @@ if (Prism.languages.cpp) { // Extracted from doxygen class list http://github.khronos.org/OpenCL-CLHPP/annotated.html attributes['type-opencl-host-cpp'] = { - pattern: /\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|Sampler|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|UserEvent)\b/, + pattern: /\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|Sampler|UserEvent)\b/, alias: 'keyword' }; diff --git a/components/prism-opencl.min.js b/components/prism-opencl.min.js index f70d8615e5..bb4cb84369 100644 --- a/components/prism-opencl.min.js +++ b/components/prism-opencl.min.js @@ -1 +1 @@ -!function(E){E.languages.opencl=E.languages.extend("c",{keyword:/\b(?:__attribute__|(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|auto|break|case|cl_(?:image_format|mem_fence_flags)|clk_event_t|complex|const|continue|default|do|(?:float|double)(?:16(?:x(?:1|16|2|4|8))?|1x(?:1|16|2|4|8)|2(?:x(?:1|16|2|4|8))?|3|4(?:x(?:1|16|2|4|8))?|8(?:x(?:1|16|2|4|8))?)?|else|enum|event_t|extern|for|goto|(?:u?(?:char|short|int|long)|half|quad|bool)(?:2|3|4|8|16)?|if|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|imaginary|inline|intptr_t|ndrange_t|packed|pipe|ptrdiff_t|queue_t|register|reserve_id_t|restrict|return|sampler_t|signed|size_t|sizeof|static|struct|switch|typedef|uintptr_t|uniform|union|unsigned|void|volatile|while)\b/,"constant-opencl-kernel":{pattern:/\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:LOCAL|GLOBAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|MANT_DIG|(?:MIN|MAX)(?:(?:_10)?_EXP)?)|FLT_RADIX|HUGE_VALF?|INFINITY|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|(?:UCHAR|USHRT|UINT|ULONG)_MAX|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:10|2)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN)\b/,alias:"constant"},boolean:/\b(?:false|true)\b/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]*/i});var _={"type-opencl-host":{pattern:/\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|short|int|long)|float|double)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,alias:"keyword"},"boolean-opencl-host":{pattern:/\bCL_(?:TRUE|FALSE)\b/,alias:"boolean"},"constant-opencl-host":{pattern:/\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:16|24|8|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/,alias:"constant"},"function-opencl-host":{pattern:/\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|Kernel|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,alias:"function"}};E.languages.insertBefore("c","keyword",_),E.languages.cpp&&(_["type-opencl-host-cpp"]={pattern:/\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|Sampler|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|UserEvent)\b/,alias:"keyword"},E.languages.insertBefore("cpp","keyword",_))}(Prism); \ No newline at end of file +!function(E){E.languages.opencl=E.languages.extend("c",{keyword:/\b(?:(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|__attribute__|auto|(?:bool|u?(?:char|int|long|short)|half|quad)(?:2|3|4|8|16)?|break|case|complex|const|continue|(?:double|float)(?:16(?:x(?:1|2|4|8|16))?|1x(?:1|2|4|8|16)|2(?:x(?:1|2|4|8|16))?|3|4(?:x(?:1|2|4|8|16))?|8(?:x(?:1|2|4|8|16))?)?|default|do|else|enum|extern|for|goto|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i,boolean:/\b(?:false|true)\b/,"constant-opencl-kernel":{pattern:/\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:GLOBAL|LOCAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|(?:MAX|MIN)(?:(?:_10)?_EXP)?|MANT_DIG)|FLT_RADIX|HUGE_VALF?|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|INFINITY|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:2|10)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN|(?:UCHAR|UINT|ULONG|USHRT)_MAX)\b/,alias:"constant"}}),E.languages.insertBefore("opencl","class-name",{"builtin-type":{pattern:/\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|intptr_t|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|uintptr_t)\b/,alias:"keyword"}});var _={"type-opencl-host":{pattern:/\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|int|long|short)|double|float)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,alias:"keyword"},"boolean-opencl-host":{pattern:/\bCL_(?:FALSE|TRUE)\b/,alias:"boolean"},"constant-opencl-host":{pattern:/\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:8|16|24|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/,alias:"constant"},"function-opencl-host":{pattern:/\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,alias:"function"}};E.languages.insertBefore("c","keyword",_),E.languages.cpp&&(_["type-opencl-host-cpp"]={pattern:/\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|Sampler|UserEvent)\b/,alias:"keyword"},E.languages.insertBefore("cpp","keyword",_))}(Prism); \ No newline at end of file diff --git a/components/prism-openqasm.js b/components/prism-openqasm.js new file mode 100644 index 0000000000..26b213509f --- /dev/null +++ b/components/prism-openqasm.js @@ -0,0 +1,23 @@ +// https://qiskit.github.io/openqasm/grammar/index.html + +Prism.languages.openqasm = { + 'comment': /\/\*[\s\S]*?\*\/|\/\/.*/, + 'string': { + pattern: /"[^"\r\n\t]*"|'[^'\r\n\t]*'/, + greedy: true + }, + + 'keyword': /\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/, + 'class-name': /\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/, + 'function': /\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/, + + 'constant': /\b(?:euler|pi|tau)\b|π|𝜏|ℇ/, + 'number': { + pattern: /(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i, + lookbehind: true + }, + 'operator': /->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/, + 'punctuation': /[(){}\[\];,:.]/ +}; + +Prism.languages.qasm = Prism.languages.openqasm; diff --git a/components/prism-openqasm.min.js b/components/prism-openqasm.min.js new file mode 100644 index 0000000000..fe0b45c39e --- /dev/null +++ b/components/prism-openqasm.min.js @@ -0,0 +1 @@ +Prism.languages.openqasm={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"[^"\r\n\t]*"|'[^'\r\n\t]*'/,greedy:!0},keyword:/\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/,"class-name":/\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,function:/\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/,constant:/\b(?:euler|pi|tau)\b|π|𝜏|ℇ/,number:{pattern:/(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i,lookbehind:!0},operator:/->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,punctuation:/[(){}\[\];,:.]/},Prism.languages.qasm=Prism.languages.openqasm; \ No newline at end of file diff --git a/components/prism-oz.js b/components/prism-oz.js index 4c6c2848db..257fe3cd88 100644 --- a/components/prism-oz.js +++ b/components/prism-oz.js @@ -1,5 +1,8 @@ Prism.languages.oz = { - 'comment': /\/\*[\s\S]*?\*\/|%.*/, + 'comment': { + pattern: /\/\*[\s\S]*?\*\/|%.*/, + greedy: true + }, 'string': { pattern: /"(?:[^"\\]|\\[\s\S])*"/, greedy: true @@ -17,9 +20,9 @@ Prism.languages.oz = { lookbehind: true } ], - 'number': /\b(?:0[bx][\da-f]+|\d+\.?\d*(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i, - 'variable': /\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/, - 'attr-name': /\w+(?=:)/, + 'number': /\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i, + 'variable': /`(?:[^`\\]|\\.)+`/, + 'attr-name': /\b\w+(?=[ \t]*:(?![:=]))/, 'operator': /:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/, 'punctuation': /[\[\](){}.:;?]/ }; diff --git a/components/prism-oz.min.js b/components/prism-oz.min.js index 7bd2ccfd06..45b826b72a 100644 --- a/components/prism-oz.min.js +++ b/components/prism-oz.min.js @@ -1 +1 @@ -Prism.languages.oz={comment:/\/\*[\s\S]*?\*\/|%.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},atom:{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,alias:"builtin"},keyword:/\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,function:[/\b[a-z][A-Za-z\d]*(?=\()/,{pattern:/(\{)[A-Z][A-Za-z\d]*\b/,lookbehind:!0}],number:/\b(?:0[bx][\da-f]+|\d+\.?\d*(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,variable:/\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/,"attr-name":/\w+(?=:)/,operator:/:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,punctuation:/[\[\](){}.:;?]/}; \ No newline at end of file +Prism.languages.oz={comment:{pattern:/\/\*[\s\S]*?\*\/|%.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},atom:{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,alias:"builtin"},keyword:/\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,function:[/\b[a-z][A-Za-z\d]*(?=\()/,{pattern:/(\{)[A-Z][A-Za-z\d]*\b/,lookbehind:!0}],number:/\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,variable:/`(?:[^`\\]|\\.)+`/,"attr-name":/\b\w+(?=[ \t]*:(?![:=]))/,operator:/:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,punctuation:/[\[\](){}.:;?]/}; \ No newline at end of file diff --git a/components/prism-parigp.js b/components/prism-parigp.js index a1eaf9be0d..4945e74790 100644 --- a/components/prism-parigp.js +++ b/components/prism-parigp.js @@ -19,12 +19,12 @@ Prism.languages.parigp = { }).join('|'); return RegExp('\\b(?:' + keywords + ')\\b'); }()), - 'function': /\w[\w ]*?(?= *\()/, + 'function': /\b\w(?:[\w ]*\w)?(?= *\()/, 'number': { // The lookbehind and the negative lookahead prevent from breaking the .. operator - pattern: /((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *[+-]? *\d(?: *\d)*)?/i, + pattern: /((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *(?:[+-] *)?\d(?: *\d)*)?/i, lookbehind: true }, - 'operator': /\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?:(?: *<)?(?: *=)?| *>)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/, + 'operator': /\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?: *>|(?: *<)?(?: *=)?)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/, 'punctuation': /[\[\]{}().,:;|]/ }; diff --git a/components/prism-parigp.min.js b/components/prism-parigp.min.js index 62e3f6a3b0..fcc023dc58 100644 --- a/components/prism-parigp.min.js +++ b/components/prism-parigp.min.js @@ -1 +1 @@ -Prism.languages.parigp={comment:/\/\*[\s\S]*?\*\/|\\\\.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},keyword:function(){var r=["breakpoint","break","dbg_down","dbg_err","dbg_up","dbg_x","forcomposite","fordiv","forell","forpart","forprime","forstep","forsubgroup","forvec","for","iferr","if","local","my","next","return","until","while"];return r=r.map(function(r){return r.split("").join(" *")}).join("|"),RegExp("\\b(?:"+r+")\\b")}(),function:/\w[\w ]*?(?= *\()/,number:{pattern:/((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *[+-]? *\d(?: *\d)*)?/i,lookbehind:!0},operator:/\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?:(?: *<)?(?: *=)?| *>)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,punctuation:/[\[\]{}().,:;|]/}; \ No newline at end of file +Prism.languages.parigp={comment:/\/\*[\s\S]*?\*\/|\\\\.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},keyword:function(){var r=["breakpoint","break","dbg_down","dbg_err","dbg_up","dbg_x","forcomposite","fordiv","forell","forpart","forprime","forstep","forsubgroup","forvec","for","iferr","if","local","my","next","return","until","while"];return r=r.map(function(r){return r.split("").join(" *")}).join("|"),RegExp("\\b(?:"+r+")\\b")}(),function:/\b\w(?:[\w ]*\w)?(?= *\()/,number:{pattern:/((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *(?:[+-] *)?\d(?: *\d)*)?/i,lookbehind:!0},operator:/\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?: *>|(?: *<)?(?: *=)?)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,punctuation:/[\[\]{}().,:;|]/}; \ No newline at end of file diff --git a/components/prism-parser.js b/components/prism-parser.js index c5cd3451f0..0ee4b87771 100644 --- a/components/prism-parser.js +++ b/components/prism-parser.js @@ -49,8 +49,8 @@ 'keyword': parser.keyword, 'variable': parser.variable, 'function': parser.function, - 'boolean': /\b(?:true|false)\b/, - 'number': /\b(?:0x[a-f\d]+|\d+\.?\d*(?:e[+-]?\d+)?)\b/i, + 'boolean': /\b(?:false|true)\b/, + 'number': /\b(?:0x[a-f\d]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?)\b/i, 'escape': parser.escape, 'operator': /[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/, 'punctuation': parser.punctuation @@ -58,7 +58,7 @@ } }); - parser = Prism.languages.insertBefore('inside', 'punctuation', { + Prism.languages.insertBefore('inside', 'punctuation', { 'expression': parser.expression, 'keyword': parser.keyword, 'variable': parser.variable, diff --git a/components/prism-parser.min.js b/components/prism-parser.min.js index e7b91ccda0..7a01f8cbc2 100644 --- a/components/prism-parser.min.js +++ b/components/prism-parser.min.js @@ -1 +1 @@ -!function(e){var n=e.languages.parser=e.languages.extend("markup",{keyword:{pattern:/(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,lookbehind:!0},variable:{pattern:/(^|[^^])\B\$(?:\w+|(?=[.{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{punctuation:/\.|:+/}},function:{pattern:/(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{keyword:{pattern:/(^@)(?:GET_|SET_)/,lookbehind:!0},punctuation:/\.|:+/}},escape:{pattern:/\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,alias:"builtin"},punctuation:/[\[\](){};]/});n=e.languages.insertBefore("parser","keyword",{"parser-comment":{pattern:/(\s)#.*/,lookbehind:!0,alias:"comment"},expression:{pattern:/(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,greedy:!0,lookbehind:!0,inside:{string:{pattern:/(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,lookbehind:!0},keyword:n.keyword,variable:n.variable,function:n.function,boolean:/\b(?:true|false)\b/,number:/\b(?:0x[a-f\d]+|\d+\.?\d*(?:e[+-]?\d+)?)\b/i,escape:n.escape,operator:/[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,punctuation:n.punctuation}}}),n=e.languages.insertBefore("inside","punctuation",{expression:n.expression,keyword:n.keyword,variable:n.variable,function:n.function,escape:n.escape,"parser-punctuation":{pattern:n.punctuation,alias:"punctuation"}},n.tag.inside["attr-value"])}(Prism); \ No newline at end of file +!function(e){var n=e.languages.parser=e.languages.extend("markup",{keyword:{pattern:/(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,lookbehind:!0},variable:{pattern:/(^|[^^])\B\$(?:\w+|(?=[.{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{punctuation:/\.|:+/}},function:{pattern:/(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{keyword:{pattern:/(^@)(?:GET_|SET_)/,lookbehind:!0},punctuation:/\.|:+/}},escape:{pattern:/\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,alias:"builtin"},punctuation:/[\[\](){};]/});n=e.languages.insertBefore("parser","keyword",{"parser-comment":{pattern:/(\s)#.*/,lookbehind:!0,alias:"comment"},expression:{pattern:/(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,greedy:!0,lookbehind:!0,inside:{string:{pattern:/(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,lookbehind:!0},keyword:n.keyword,variable:n.variable,function:n.function,boolean:/\b(?:false|true)\b/,number:/\b(?:0x[a-f\d]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?)\b/i,escape:n.escape,operator:/[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,punctuation:n.punctuation}}}),e.languages.insertBefore("inside","punctuation",{expression:n.expression,keyword:n.keyword,variable:n.variable,function:n.function,escape:n.escape,"parser-punctuation":{pattern:n.punctuation,alias:"punctuation"}},n.tag.inside["attr-value"])}(Prism); \ No newline at end of file diff --git a/components/prism-pascal.js b/components/prism-pascal.js index 9e95353af6..2f9f5c0e06 100644 --- a/components/prism-pascal.js +++ b/components/prism-pascal.js @@ -5,15 +5,25 @@ */ Prism.languages.pascal = { - 'comment': [ - /\(\*[\s\S]+?\*\)/, - /\{[\s\S]+?\}/, - /\/\/.*/ - ], + 'directive': { + pattern: /\{\$[\s\S]*?\}/, + greedy: true, + alias: ['marco', 'property'] + }, + 'comment': { + pattern: /\(\*[\s\S]*?\*\)|\{[\s\S]*?\}|\/\/.*/, + greedy: true + }, 'string': { pattern: /(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i, greedy: true }, + 'asm': { + pattern: /(\basm\b)[\s\S]+?(?=\bend\s*[;[])/i, + lookbehind: true, + greedy: true, + inside: null // see below + }, 'keyword': [ { // Turbo Pascal @@ -43,7 +53,7 @@ Prism.languages.pascal = { /\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i ], 'operator': [ - /\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i, + /\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/, { pattern: /(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/, lookbehind: true @@ -52,4 +62,10 @@ Prism.languages.pascal = { 'punctuation': /\(\.|\.\)|[()\[\]:;,.]/ }; +Prism.languages.pascal.asm.inside = Prism.languages.extend('pascal', { + 'asm': undefined, + 'keyword': undefined, + 'operator': undefined +}); + Prism.languages.objectpascal = Prism.languages.pascal; diff --git a/components/prism-pascal.min.js b/components/prism-pascal.min.js index 07ae8a25ee..3f21ba69b3 100644 --- a/components/prism-pascal.min.js +++ b/components/prism-pascal.min.js @@ -1 +1 @@ -Prism.languages.pascal={comment:[/\(\*[\s\S]+?\*\)/,/\{[\s\S]+?\}/,/\/\/.*/],string:{pattern:/(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,greedy:!0},keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/},Prism.languages.objectpascal=Prism.languages.pascal; \ No newline at end of file +Prism.languages.pascal={directive:{pattern:/\{\$[\s\S]*?\}/,greedy:!0,alias:["marco","property"]},comment:{pattern:/\(\*[\s\S]*?\*\)|\{[\s\S]*?\}|\/\/.*/,greedy:!0},string:{pattern:/(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,greedy:!0},asm:{pattern:/(\basm\b)[\s\S]+?(?=\bend\s*[;[])/i,lookbehind:!0,greedy:!0,inside:null},keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/},Prism.languages.pascal.asm.inside=Prism.languages.extend("pascal",{asm:void 0,keyword:void 0,operator:void 0}),Prism.languages.objectpascal=Prism.languages.pascal; \ No newline at end of file diff --git a/components/prism-pascaligo.js b/components/prism-pascaligo.js index 5e5eed033a..e9f57ebacf 100644 --- a/components/prism-pascaligo.js +++ b/components/prism-pascaligo.js @@ -3,7 +3,7 @@ // Pascaligo is a layer 2 smart contract language for the tezos blockchain var braces = /\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)/.source; - var type = /(?:\w+(?:)?|)/.source.replace(//g, function () { return braces; }); + var type = /(?:\b\w+(?:)?|)/.source.replace(//g, function () { return braces; }); var pascaligo = Prism.languages.pascaligo = { 'comment': /\(\*[\s\S]+?\*\)|\/\/.*/, @@ -32,14 +32,14 @@ lookbehind: true }, 'boolean': { - pattern: /(^|[^&])\b(?:True|False)\b/i, + pattern: /(^|[^&])\b(?:False|True)\b/i, lookbehind: true }, 'builtin': { pattern: /(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i, lookbehind: true }, - 'function': /\w+(?=\s*\()/i, + 'function': /\b\w+(?=\s*\()/, 'number': [ // Hexadecimal, octal and binary /%[01]+|&[0-7]+|\$[a-f\d]+/i, @@ -55,7 +55,7 @@ return accum; }, {}); - pascaligo["class-name"].forEach(function (p) { + pascaligo['class-name'].forEach(function (p) { p.inside = classNameInside; }); diff --git a/components/prism-pascaligo.min.js b/components/prism-pascaligo.min.js index fb1b154ffe..fe17122272 100644 --- a/components/prism-pascaligo.min.js +++ b/components/prism-pascaligo.min.js @@ -1 +1 @@ -!function(e){var n="(?:\\w+(?:)?|)".replace(//g,function(){return"\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)"}),t=e.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,greedy:!0},"class-name":[{pattern:RegExp("(\\btype\\s+\\w+\\s+is\\s+)".replace(//g,function(){return n}),"i"),lookbehind:!0,inside:null},{pattern:RegExp("(?=\\s+is\\b)".replace(//g,function(){return n}),"i"),inside:null},{pattern:RegExp("(:\\s*)".replace(//g,function(){return n})),lookbehind:!0,inside:null}],keyword:{pattern:/(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:True|False)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,lookbehind:!0},function:/\w+(?=\s*\()/i,number:[/%[01]+|&[0-7]+|\$[a-f\d]+/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i],operator:/->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,punctuation:/\(\.|\.\)|[()\[\]:;,.{}]/},i=["comment","keyword","builtin","operator","punctuation"].reduce(function(e,n){return e[n]=t[n],e},{});t["class-name"].forEach(function(e){e.inside=i})}(Prism); \ No newline at end of file +!function(e){var n="(?:\\b\\w+(?:)?|)".replace(//g,function(){return"\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)"}),t=e.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,greedy:!0},"class-name":[{pattern:RegExp("(\\btype\\s+\\w+\\s+is\\s+)".replace(//g,function(){return n}),"i"),lookbehind:!0,inside:null},{pattern:RegExp("(?=\\s+is\\b)".replace(//g,function(){return n}),"i"),inside:null},{pattern:RegExp("(:\\s*)".replace(//g,function(){return n})),lookbehind:!0,inside:null}],keyword:{pattern:/(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:False|True)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,lookbehind:!0},function:/\b\w+(?=\s*\()/,number:[/%[01]+|&[0-7]+|\$[a-f\d]+/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i],operator:/->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,punctuation:/\(\.|\.\)|[()\[\]:;,.{}]/},i=["comment","keyword","builtin","operator","punctuation"].reduce(function(e,n){return e[n]=t[n],e},{});t["class-name"].forEach(function(e){e.inside=i})}(Prism); \ No newline at end of file diff --git a/components/prism-pcaxis.js b/components/prism-pcaxis.js index 1ce0ba1043..d804a35ada 100644 --- a/components/prism-pcaxis.js +++ b/components/prism-pcaxis.js @@ -15,7 +15,7 @@ Prism.languages.pcaxis = { } }, 'sub-key': { - pattern: /^(\s*)[\s\S]+/, + pattern: /^(\s*)\S[\s\S]*/, lookbehind: true, inside: { 'parameter': { @@ -47,7 +47,7 @@ Prism.languages.pcaxis = { pattern: /(^|\s)\d+(?:\.\d+)?(?!\S)/, lookbehind: true }, - 'boolean': /YES|NO/, + 'boolean': /NO|YES/, }; Prism.languages.px = Prism.languages.pcaxis; diff --git a/components/prism-pcaxis.min.js b/components/prism-pcaxis.min.js index 89ef4484f6..c44e6fff68 100644 --- a/components/prism-pcaxis.min.js +++ b/components/prism-pcaxis.min.js @@ -1 +1 @@ -Prism.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)[\s\S]+/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/YES|NO/},Prism.languages.px=Prism.languages.pcaxis; \ No newline at end of file +Prism.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)\S[\s\S]*/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/NO|YES/},Prism.languages.px=Prism.languages.pcaxis; \ No newline at end of file diff --git a/components/prism-peoplecode.js b/components/prism-peoplecode.js index b7db0f7648..890b412196 100644 --- a/components/prism-peoplecode.js +++ b/components/prism-peoplecode.js @@ -8,7 +8,7 @@ Prism.languages.peoplecode = { /<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source, // /+ +/ comments /\/\+[\s\S]*?\+\//.source, - ].join("|")), + ].join('|')), 'string': { pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/, greedy: true @@ -26,7 +26,7 @@ Prism.languages.peoplecode = { 'punctuation': /:/ } }, - 'keyword': /\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|implements|import|instance|if|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i, + 'keyword': /\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|if|implements|import|instance|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i, 'operator-keyword': { pattern: /\b(?:and|not|or)\b/i, alias: 'operator' diff --git a/components/prism-peoplecode.min.js b/components/prism-peoplecode.min.js index 6481666733..2753baa88b 100644 --- a/components/prism-peoplecode.min.js +++ b/components/prism-peoplecode.min.js @@ -1 +1 @@ -Prism.languages.peoplecode={comment:RegExp(["/\\*[^]*?\\*/","\\bREM[^;]*;","<\\*(?:[^<*]|\\*(?!>)|<(?!\\*)|<\\*(?:(?!\\*>)[^])*\\*>)*\\*>","/\\+[^]*?\\+/"].join("|")),string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},variable:/%\w+/,"function-definition":{pattern:/((?:^|[^\w-])(?:function|method)\s+)\w+/i,lookbehind:!0,alias:"function"},"class-name":{pattern:/((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,lookbehind:!0,inside:{punctuation:/:/}},keyword:/\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|implements|import|instance|if|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,"operator-keyword":{pattern:/\b(?:and|not|or)\b/i,alias:"operator"},function:/[_a-z]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/\b\d+(?:\.\d+)?\b/,operator:/<>|[<>]=?|!=|\*\*|[-+*/|=@]/,punctuation:/[:.;,()[\]]/},Prism.languages.pcode=Prism.languages.peoplecode; \ No newline at end of file +Prism.languages.peoplecode={comment:RegExp(["/\\*[^]*?\\*/","\\bREM[^;]*;","<\\*(?:[^<*]|\\*(?!>)|<(?!\\*)|<\\*(?:(?!\\*>)[^])*\\*>)*\\*>","/\\+[^]*?\\+/"].join("|")),string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},variable:/%\w+/,"function-definition":{pattern:/((?:^|[^\w-])(?:function|method)\s+)\w+/i,lookbehind:!0,alias:"function"},"class-name":{pattern:/((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,lookbehind:!0,inside:{punctuation:/:/}},keyword:/\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|if|implements|import|instance|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,"operator-keyword":{pattern:/\b(?:and|not|or)\b/i,alias:"operator"},function:/[_a-z]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/\b\d+(?:\.\d+)?\b/,operator:/<>|[<>]=?|!=|\*\*|[-+*/|=@]/,punctuation:/[:.;,()[\]]/},Prism.languages.pcode=Prism.languages.peoplecode; \ No newline at end of file diff --git a/components/prism-perl.js b/components/prism-perl.js index f2f0242547..6641fef7d3 100644 --- a/components/prism-perl.js +++ b/components/prism-perl.js @@ -1,191 +1,156 @@ -Prism.languages.perl = { - 'comment': [ - { - // POD - pattern: /(^\s*)=\w+[\s\S]*?=cut.*/m, +(function (Prism) { + + var brackets = /(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source; + + Prism.languages.perl = { + 'comment': [ + { + // POD + pattern: /(^\s*)=\w[\s\S]*?=cut.*/m, + lookbehind: true, + greedy: true + }, + { + pattern: /(^|[^\\$])#.*/, + lookbehind: true, + greedy: true + } + ], + // TODO Could be nice to handle Heredoc too. + 'string': [ + { + pattern: RegExp( + /\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source + + '(?:' + + [ + // q/.../ + /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source, + + // q a...a + // eslint-disable-next-line regexp/strict + /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source, + + // q(...) + // q{...} + // q[...] + // q<...> + brackets, + ].join('|') + + ')' + ), + greedy: true + }, + + // "...", `...` + { + pattern: /("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/, + greedy: true + }, + + // '...' + // FIXME Multi-line single-quoted strings are not supported as they would break variables containing ' + { + pattern: /'(?:[^'\\\r\n]|\\.)*'/, + greedy: true + } + ], + 'regex': [ + { + pattern: RegExp( + /\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source + + '(?:' + + [ + // m/.../ + /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source, + + // m a...a + // eslint-disable-next-line regexp/strict + /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source, + + // m(...) + // m{...} + // m[...] + // m<...> + brackets, + ].join('|') + + ')' + + /[msixpodualngc]*/.source + ), + greedy: true + }, + + // The lookbehinds prevent -s from breaking + { + pattern: RegExp( + /(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source + + '(?:' + + [ + // s/.../.../ + // eslint-disable-next-line regexp/strict + /([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source, + + // s a...a...a + // eslint-disable-next-line regexp/strict + /([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source, + + // s(...)(...) + // s{...}{...} + // s[...][...] + // s<...><...> + // s(...)[...] + brackets + /\s*/.source + brackets, + ].join('|') + + ')' + + /[msixpodualngcer]*/.source + ), + lookbehind: true, + greedy: true + }, + + // /.../ + // The look-ahead tries to prevent two divisions on + // the same line from being highlighted as regex. + // This does not support multi-line regex. + { + pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/, + greedy: true + } + ], + + // FIXME Not sure about the handling of ::, ', and # + 'variable': [ + // ${^POSTMATCH} + /[&*$@%]\{\^[A-Z]+\}/, + // $^V + /[&*$@%]\^[A-Z_]/, + // ${...} + /[&*$@%]#?(?=\{)/, + // $foo + /[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/, + // $1 + /[&*$@%]\d+/, + // $_, @_, %! + // The negative lookahead prevents from breaking the %= operator + /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/ + ], + 'filehandle': { + // <>, , _ + pattern: /<(?![<=])\S*?>|\b_\b/, + alias: 'symbol' + }, + 'v-string': { + // v1.2, 1.2.3 + pattern: /v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/, + alias: 'string' + }, + 'function': { + pattern: /(\bsub[ \t]+)\w+/, lookbehind: true }, - { - pattern: /(^|[^\\$])#.*/, - lookbehind: true - } - ], - // TODO Could be nice to handle Heredoc too. - 'string': [ - // q/.../ - { - pattern: /\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/, - greedy: true - }, - - // q a...a - { - pattern: /\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/, - greedy: true - }, - - // q(...) - { - pattern: /\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/, - greedy: true - }, - - // q{...} - { - pattern: /\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/, - greedy: true - }, - - // q[...] - { - pattern: /\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/, - greedy: true - }, - - // q<...> - { - pattern: /\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/, - greedy: true - }, - - // "...", `...` - { - pattern: /("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/, - greedy: true - }, - - // '...' - // FIXME Multi-line single-quoted strings are not supported as they would break variables containing ' - { - pattern: /'(?:[^'\\\r\n]|\\.)*'/, - greedy: true - } - ], - 'regex': [ - // m/.../ - { - pattern: /\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/, - greedy: true - }, - - // m a...a - { - pattern: /\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/, - greedy: true - }, - - // m(...) - { - pattern: /\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/, - greedy: true - }, - - // m{...} - { - pattern: /\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/, - greedy: true - }, - - // m[...] - { - pattern: /\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/, - greedy: true - }, - - // m<...> - { - pattern: /\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/, - greedy: true - }, - - // The lookbehinds prevent -s from breaking - // FIXME We don't handle change of separator like s(...)[...] - // s/.../.../ - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s a...a...a - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s(...)(...) - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s{...}{...} - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s[...][...] - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // s<...><...> - { - pattern: /(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/, - lookbehind: true, - greedy: true - }, - - // /.../ - // The look-ahead tries to prevent two divisions on - // the same line from being highlighted as regex. - // This does not support multi-line regex. - { - pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/, - greedy: true - } - ], + 'keyword': /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/, + 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/, + 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/, + 'punctuation': /[{}[\];(),:]/ + }; - // FIXME Not sure about the handling of ::, ', and # - 'variable': [ - // ${^POSTMATCH} - /[&*$@%]\{\^[A-Z]+\}/, - // $^V - /[&*$@%]\^[A-Z_]/, - // ${...} - /[&*$@%]#?(?=\{)/, - // $foo - /[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+)+(?:::)*/i, - // $1 - /[&*$@%]\d+/, - // $_, @_, %! - // The negative lookahead prevents from breaking the %= operator - /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/ - ], - 'filehandle': { - // <>, , _ - pattern: /<(?![<=])\S*>|\b_\b/, - alias: 'symbol' - }, - 'vstring': { - // v1.2, 1.2.3 - pattern: /v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/, - alias: 'string' - }, - 'function': { - pattern: /sub [a-z0-9_]+/i, - inside: { - keyword: /sub/ - } - }, - 'keyword': /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/, - 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/, - 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/, - 'punctuation': /[{}[\];(),:]/ -}; +}(Prism)); diff --git a/components/prism-perl.min.js b/components/prism-perl.min.js index 570934047e..1446c7285f 100644 --- a/components/prism-perl.min.js +++ b/components/prism-perl.min.js @@ -1 +1 @@ -Prism.languages.perl={comment:[{pattern:/(^\s*)=\w+[\s\S]*?=cut.*/m,lookbehind:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0}],string:[{pattern:/\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,greedy:!0},{pattern:/\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:/\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,greedy:!0},{pattern:/\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+)+(?:::)*/i,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*>|\b_\b/,alias:"symbol"},vstring:{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/sub [a-z0-9_]+/i,inside:{keyword:/sub/}},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/,punctuation:/[{}[\];(),:]/}; \ No newline at end of file +!function(e){var n="(?:\\((?:[^()\\\\]|\\\\[^])*\\)|\\{(?:[^{}\\\\]|\\\\[^])*\\}|\\[(?:[^[\\]\\\\]|\\\\[^])*\\]|<(?:[^<>\\\\]|\\\\[^])*>)";Prism.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp("\\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\\s*(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1","([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[^])*\\2",n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp("\\b(?:m|qr)(?![a-zA-Z0-9])\\s*(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1","([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[^])*\\2",n].join("|")+")[msixpodualngc]*"),greedy:!0},{pattern:RegExp("(^|[^-])\\b(?:s|tr|y)(?![a-zA-Z0-9])\\s*(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\2)[^\\\\]|\\\\[^])*\\2(?:(?!\\2)[^\\\\]|\\\\[^])*\\2","([a-zA-Z0-9])(?:(?!\\3)[^\\\\]|\\\\[^])*\\3(?:(?!\\3)[^\\\\]|\\\\[^])*\\3",n+"\\s*"+n].join("|")+")[msixpodualngcer]*"),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(); \ No newline at end of file diff --git a/components/prism-php-extras.js b/components/prism-php-extras.js index 370a02e327..ead82a620a 100644 --- a/components/prism-php-extras.js +++ b/components/prism-php-extras.js @@ -1,11 +1,14 @@ Prism.languages.insertBefore('php', 'variable', { - 'this': /\$this\b/, - 'global': /\$(?:_(?:SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE)|GLOBALS|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)\b/, + 'this': { + pattern: /\$this\b/, + alias: 'keyword' + }, + 'global': /\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/, 'scope': { pattern: /\b[\w\\]+::/, inside: { - keyword: /static|self|parent/, - punctuation: /::|\\/ + 'keyword': /\b(?:parent|self|static)\b/, + 'punctuation': /::|\\/ } } -}); \ No newline at end of file +}); diff --git a/components/prism-php-extras.min.js b/components/prism-php-extras.min.js index 2ab526e236..50fc6a2cb9 100644 --- a/components/prism-php-extras.min.js +++ b/components/prism-php-extras.min.js @@ -1 +1 @@ -Prism.languages.insertBefore("php","variable",{this:/\$this\b/,global:/\$(?:_(?:SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE)|GLOBALS|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/static|self|parent/,punctuation:/::|\\/}}}); \ No newline at end of file +Prism.languages.insertBefore("php","variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}}); \ No newline at end of file diff --git a/components/prism-php.js b/components/prism-php.js index 8c2751a5a5..30ac2dc6af 100644 --- a/components/prism-php.js +++ b/components/prism-php.js @@ -1,77 +1,239 @@ /** * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/ * Modified by Miles Johnson: http://milesj.me + * Rewritten by Tom Pavelec * - * Supports the following: - * - Extends clike syntax - * - Support for PHP 5.3+ (namespaces, traits, generators, etc) - * - Smarter constant and function matching - * - * Adds the following new token classes: - * constant, delimiter, variable, function, package + * Supports PHP 5.3 - 8.0 */ (function (Prism) { - Prism.languages.php = Prism.languages.extend('clike', { - 'keyword': /\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i, - 'boolean': { + var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/; + var constant = [ + { pattern: /\b(?:false|true)\b/i, - alias: 'constant' + alias: 'boolean' }, - 'constant': [ - /\b[A-Z_][A-Z0-9_]*\b/, - /\b(?:null)\b/i, - ], - 'comment': { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, - lookbehind: true - } - }); - - Prism.languages.insertBefore('php', 'string', { - 'shell-comment': { - pattern: /(^|[^\\])#.*/, + { + pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i, + greedy: true, lookbehind: true, - alias: 'comment' - } - }); + }, + { + pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i, + greedy: true, + lookbehind: true, + }, + /\b(?:null)\b/i, + /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/, + ]; + var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i; + var operator = /|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/; + var punctuation = /[{}\[\](),:;]/; - Prism.languages.insertBefore('php', 'comment', { + Prism.languages.php = { 'delimiter': { pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, alias: 'important' - } - }); - - Prism.languages.insertBefore('php', 'keyword', { - 'variable': /\$+(?:\w+\b|(?={))/i, + }, + 'comment': comment, + 'variable': /\$+(?:\w+\b|(?=\{))/, 'package': { - pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, + pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i, lookbehind: true, inside: { - punctuation: /\\/ + 'punctuation': /\\/ } - } - }); - - // Must be defined after the function pattern - Prism.languages.insertBefore('php', 'operator', { + }, + 'class-name-definition': { + pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i, + lookbehind: true, + alias: 'class-name' + }, + 'function-definition': { + pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i, + lookbehind: true, + alias: 'function' + }, + 'keyword': [ + { + pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i, + alias: 'type-casting', + greedy: true, + lookbehind: true + }, + { + pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i, + alias: 'type-hint', + greedy: true, + lookbehind: true + }, + { + pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string|void)\b/i, + alias: 'return-type', + greedy: true, + lookbehind: true + }, + { + pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i, + alias: 'type-declaration', + greedy: true + }, + { + pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i, + alias: 'type-declaration', + greedy: true, + lookbehind: true + }, + { + pattern: /\b(?:parent|self|static)(?=\s*::)/i, + alias: 'static-context', + greedy: true + }, + { + // yield from + pattern: /(\byield\s+)from\b/i, + lookbehind: true + }, + // `class` is always a keyword unlike other keywords + /\bclass\b/i, + { + // https://www.php.net/manual/en/reserved.keywords.php + // + // keywords cannot be preceded by "->" + // the complex lookbehind means `(?|::)\s*)` + pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i, + lookbehind: true + } + ], + 'argument-name': { + pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i, + lookbehind: true + }, + 'class-name': [ + { + pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i, + greedy: true, + lookbehind: true + }, + { + pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i, + greedy: true, + lookbehind: true + }, + { + pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i, + greedy: true + }, + { + pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i, + alias: 'class-name-fully-qualified', + greedy: true, + lookbehind: true, + inside: { + 'punctuation': /\\/ + } + }, + { + pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i, + alias: 'class-name-fully-qualified', + greedy: true, + inside: { + 'punctuation': /\\/ + } + }, + { + pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i, + alias: 'class-name-fully-qualified', + greedy: true, + lookbehind: true, + inside: { + 'punctuation': /\\/ + } + }, + { + pattern: /\b[a-z_]\w*(?=\s*\$)/i, + alias: 'type-declaration', + greedy: true + }, + { + pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i, + alias: ['class-name-fully-qualified', 'type-declaration'], + greedy: true, + inside: { + 'punctuation': /\\/ + } + }, + { + pattern: /\b[a-z_]\w*(?=\s*::)/i, + alias: 'static-context', + greedy: true + }, + { + pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i, + alias: ['class-name-fully-qualified', 'static-context'], + greedy: true, + inside: { + 'punctuation': /\\/ + } + }, + { + pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i, + alias: 'type-hint', + greedy: true, + lookbehind: true + }, + { + pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i, + alias: ['class-name-fully-qualified', 'type-hint'], + greedy: true, + lookbehind: true, + inside: { + 'punctuation': /\\/ + } + }, + { + pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i, + alias: 'return-type', + greedy: true, + lookbehind: true + }, + { + pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i, + alias: ['class-name-fully-qualified', 'return-type'], + greedy: true, + lookbehind: true, + inside: { + 'punctuation': /\\/ + } + } + ], + 'constant': constant, + 'function': { + pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i, + lookbehind: true, + inside: { + 'punctuation': /\\/ + } + }, 'property': { - pattern: /(->)[\w]+/, + pattern: /(->\s*)\w+/, lookbehind: true - } - }); + }, + 'number': number, + 'operator': operator, + 'punctuation': punctuation + }; var string_interpolation = { - pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/, + pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/, lookbehind: true, inside: Prism.languages.php }; - Prism.languages.insertBefore('php', 'string', { - 'nowdoc-string': { + var string = [ + { pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/, + alias: 'nowdoc-string', greedy: true, - alias: 'string', inside: { 'delimiter': { pattern: /^<<<'[^']+'|[a-z_]\w*;$/i, @@ -82,10 +244,10 @@ } } }, - 'heredoc-string': { + { pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i, + alias: 'heredoc-string', greedy: true, - alias: 'string', inside: { 'delimiter': { pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i, @@ -94,36 +256,86 @@ 'punctuation': /^<<<"?|[";]$/ } }, - 'interpolation': string_interpolation // See below + 'interpolation': string_interpolation } }, - 'single-quoted-string': { + { + pattern: /`(?:\\[\s\S]|[^\\`])*`/, + alias: 'backtick-quoted-string', + greedy: true + }, + { pattern: /'(?:\\[\s\S]|[^\\'])*'/, - greedy: true, - alias: 'string' + alias: 'single-quoted-string', + greedy: true }, - 'double-quoted-string': { + { pattern: /"(?:\\[\s\S]|[^\\"])*"/, + alias: 'double-quoted-string', greedy: true, - alias: 'string', inside: { - 'interpolation': string_interpolation // See below + 'interpolation': string_interpolation } } + ]; + + Prism.languages.insertBefore('php', 'variable', { + 'string': string, + 'attribute': { + pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im, + greedy: true, + inside: { + 'attribute-content': { + pattern: /^(#\[)[\s\S]+(?=\]$)/, + lookbehind: true, + // inside can appear subset of php + inside: { + 'comment': comment, + 'string': string, + 'attribute-class-name': [ + { + pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i, + alias: 'class-name', + greedy: true, + lookbehind: true + }, + { + pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i, + alias: [ + 'class-name', + 'class-name-fully-qualified' + ], + greedy: true, + lookbehind: true, + inside: { + 'punctuation': /\\/ + } + } + ], + 'constant': constant, + 'number': number, + 'operator': operator, + 'punctuation': punctuation + } + }, + 'delimiter': { + pattern: /^#\[|\]$/, + alias: 'punctuation' + } + } + }, }); - // The different types of PHP strings "replace" the C-like standard string - delete Prism.languages.php['string']; - Prism.hooks.add('before-tokenize', function(env) { + Prism.hooks.add('before-tokenize', function (env) { if (!/<\?/.test(env.code)) { return; } - var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig; + var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g; Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern); }); - Prism.hooks.add('after-tokenize', function(env) { + Prism.hooks.add('after-tokenize', function (env) { Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php'); }); diff --git a/components/prism-php.min.js b/components/prism-php.min.js index 1c4ef76587..75f1f18df3 100644 --- a/components/prism-php.min.js +++ b/components/prism-php.min.js @@ -1 +1 @@ -!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); \ No newline at end of file +!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:a.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];a.languages.insertBefore("php","variable",{string:r,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:e,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),a.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){a.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}}),a.hooks.add("after-tokenize",function(e){a.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); \ No newline at end of file diff --git a/components/prism-phpdoc.js b/components/prism-phpdoc.js index 136f5988a4..8196b9e277 100644 --- a/components/prism-phpdoc.js +++ b/components/prism-phpdoc.js @@ -15,7 +15,7 @@ pattern: RegExp('(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)' + typeExpression), lookbehind: true, inside: { - 'keyword': /\b(?:callback|resource|boolean|integer|double|object|string|array|false|float|mixed|bool|null|self|true|void|int)\b/, + 'keyword': /\b(?:array|bool|boolean|callback|double|false|float|int|integer|mixed|null|object|resource|self|string|true|void)\b/, 'punctuation': /[|\\[\]()]/ } } diff --git a/components/prism-phpdoc.min.js b/components/prism-phpdoc.min.js index fe460a5d28..85aaeea983 100644 --- a/components/prism-phpdoc.min.js +++ b/components/prism-phpdoc.min.js @@ -1 +1 @@ -!function(a){var e="(?:\\b[a-zA-Z]\\w*|[|\\\\[\\]])+";a.languages.phpdoc=a.languages.extend("javadoclike",{parameter:{pattern:RegExp("(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:"+e+"\\s+)?)\\$\\w+"),lookbehind:!0}}),a.languages.insertBefore("phpdoc","keyword",{"class-name":[{pattern:RegExp("(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)"+e),lookbehind:!0,inside:{keyword:/\b(?:callback|resource|boolean|integer|double|object|string|array|false|float|mixed|bool|null|self|true|void|int)\b/,punctuation:/[|\\[\]()]/}}]}),a.languages.javadoclike.addSupport("php",a.languages.phpdoc)}(Prism); \ No newline at end of file +!function(a){var e="(?:\\b[a-zA-Z]\\w*|[|\\\\[\\]])+";a.languages.phpdoc=a.languages.extend("javadoclike",{parameter:{pattern:RegExp("(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:"+e+"\\s+)?)\\$\\w+"),lookbehind:!0}}),a.languages.insertBefore("phpdoc","keyword",{"class-name":[{pattern:RegExp("(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)"+e),lookbehind:!0,inside:{keyword:/\b(?:array|bool|boolean|callback|double|false|float|int|integer|mixed|null|object|resource|self|string|true|void)\b/,punctuation:/[|\\[\]()]/}}]}),a.languages.javadoclike.addSupport("php",a.languages.phpdoc)}(Prism); \ No newline at end of file diff --git a/components/prism-plsql.js b/components/prism-plsql.js index 944132d9f9..15967b9ed1 100644 --- a/components/prism-plsql.js +++ b/components/prism-plsql.js @@ -1,26 +1,17 @@ -(function (Prism) { +Prism.languages.plsql = Prism.languages.extend('sql', { + 'comment': { + pattern: /\/\*[\s\S]*?\*\/|--.*/, + greedy: true + }, + // https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-reserved-words-keywords.html + 'keyword': /\b(?:A|ACCESSIBLE|ADD|AGENT|AGGREGATE|ALL|ALTER|AND|ANY|ARRAY|AS|ASC|AT|ATTRIBUTE|AUTHID|AVG|BEGIN|BETWEEN|BFILE_BASE|BINARY|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BULK|BY|BYTE|C|CALL|CALLING|CASCADE|CASE|CHAR|CHARACTER|CHARSET|CHARSETFORM|CHARSETID|CHAR_BASE|CHECK|CLOB_BASE|CLONE|CLOSE|CLUSTER|CLUSTERS|COLAUTH|COLLECT|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPILED|COMPRESS|CONNECT|CONSTANT|CONSTRUCTOR|CONTEXT|CONTINUE|CONVERT|COUNT|CRASH|CREATE|CREDENTIAL|CURRENT|CURSOR|CUSTOMDATUM|DANGLING|DATA|DATE|DATE_BASE|DAY|DECLARE|DEFAULT|DEFINE|DELETE|DESC|DETERMINISTIC|DIRECTORY|DISTINCT|DOUBLE|DROP|DURATION|ELEMENT|ELSE|ELSIF|EMPTY|END|ESCAPE|EXCEPT|EXCEPTION|EXCEPTIONS|EXCLUSIVE|EXECUTE|EXISTS|EXIT|EXTERNAL|FETCH|FINAL|FIRST|FIXED|FLOAT|FOR|FORALL|FORCE|FROM|FUNCTION|GENERAL|GOTO|GRANT|GROUP|HASH|HAVING|HEAP|HIDDEN|HOUR|IDENTIFIED|IF|IMMEDIATE|IMMUTABLE|IN|INCLUDING|INDEX|INDEXES|INDICATOR|INDICES|INFINITE|INSERT|INSTANTIABLE|INT|INTERFACE|INTERSECT|INTERVAL|INTO|INVALIDATE|IS|ISOLATION|JAVA|LANGUAGE|LARGE|LEADING|LENGTH|LEVEL|LIBRARY|LIKE|LIKE2|LIKE4|LIKEC|LIMIT|LIMITED|LOCAL|LOCK|LONG|LOOP|MAP|MAX|MAXLEN|MEMBER|MERGE|MIN|MINUS|MINUTE|MOD|MODE|MODIFY|MONTH|MULTISET|MUTABLE|NAME|NAN|NATIONAL|NATIVE|NCHAR|NEW|NOCOMPRESS|NOCOPY|NOT|NOWAIT|NULL|NUMBER_BASE|OBJECT|OCICOLL|OCIDATE|OCIDATETIME|OCIDURATION|OCIINTERVAL|OCILOBLOCATOR|OCINUMBER|OCIRAW|OCIREF|OCIREFCURSOR|OCIROWID|OCISTRING|OCITYPE|OF|OLD|ON|ONLY|OPAQUE|OPEN|OPERATOR|OPTION|OR|ORACLE|ORADATA|ORDER|ORGANIZATION|ORLANY|ORLVARY|OTHERS|OUT|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETER|PARAMETERS|PARENT|PARTITION|PASCAL|PERSISTABLE|PIPE|PIPELINED|PLUGGABLE|POLYMORPHIC|PRAGMA|PRECISION|PRIOR|PRIVATE|PROCEDURE|PUBLIC|RAISE|RANGE|RAW|READ|RECORD|REF|REFERENCE|RELIES_ON|REM|REMAINDER|RENAME|RESOURCE|RESULT|RESULT_CACHE|RETURN|RETURNING|REVERSE|REVOKE|ROLLBACK|ROW|SAMPLE|SAVE|SAVEPOINT|SB1|SB2|SB4|SECOND|SEGMENT|SELECT|SELF|SEPARATE|SEQUENCE|SERIALIZABLE|SET|SHARE|SHORT|SIZE|SIZE_T|SOME|SPARSE|SQL|SQLCODE|SQLDATA|SQLNAME|SQLSTATE|STANDARD|START|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUM|SYNONYM|TABAUTH|TABLE|TDO|THE|THEN|TIME|TIMESTAMP|TIMEZONE_ABBR|TIMEZONE_HOUR|TIMEZONE_MINUTE|TIMEZONE_REGION|TO|TRAILING|TRANSACTION|TRANSACTIONAL|TRUSTED|TYPE|UB1|UB2|UB4|UNDER|UNION|UNIQUE|UNPLUG|UNSIGNED|UNTRUSTED|UPDATE|USE|USING|VALIST|VALUE|VALUES|VARIABLE|VARIANCE|VARRAY|VARYING|VIEW|VIEWS|VOID|WHEN|WHERE|WHILE|WITH|WORK|WRAPPED|WRITE|YEAR|ZONE)\b/i, + // https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-language-fundamentals.html#GUID-96A42F7C-7A71-4B90-8255-CA9C8BD9722E + 'operator': /:=?|=>|[<>^~!]=|\.\.|\|\||\*\*|[-+*/%<>=@]/ +}); - var plsql = Prism.languages.plsql = Prism.languages.extend('sql', { - 'comment': [ - /\/\*[\s\S]*?\*\//, - /--.*/ - ] - }); - - var keyword = plsql['keyword']; - if (!Array.isArray(keyword)) { - keyword = plsql['keyword'] = [keyword]; - } - keyword.unshift( - /\b(?:ACCESS|AGENT|AGGREGATE|ARRAY|ARROW|AT|ATTRIBUTE|AUDIT|AUTHID|BFILE_BASE|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BYTE|CALLING|CHAR_BASE|CHARSET(?:FORM|ID)|CLOB_BASE|COLAUTH|COLLECT|CLUSTERS?|COMPILED|COMPRESS|CONSTANT|CONSTRUCTOR|CONTEXT|CRASH|CUSTOMDATUM|DANGLING|DATE_BASE|DEFINE|DETERMINISTIC|DURATION|ELEMENT|EMPTY|EXCEPTIONS?|EXCLUSIVE|EXTERNAL|FINAL|FORALL|FORM|FOUND|GENERAL|HEAP|HIDDEN|IDENTIFIED|IMMEDIATE|INCLUDING|INCREMENT|INDICATOR|INDEXES|INDICES|INFINITE|INITIAL|ISOPEN|INSTANTIABLE|INTERFACE|INVALIDATE|JAVA|LARGE|LEADING|LENGTH|LIBRARY|LIKE[24C]|LIMITED|LONG|LOOP|MAP|MAXEXTENTS|MAXLEN|MEMBER|MINUS|MLSLABEL|MULTISET|NAME|NAN|NATIVE|NEW|NOAUDIT|NOCOMPRESS|NOCOPY|NOTFOUND|NOWAIT|NUMBER(?:_BASE)?|OBJECT|OCI(?:COLL|DATE|DATETIME|DURATION|INTERVAL|LOBLOCATOR|NUMBER|RAW|REF|REFCURSOR|ROWID|STRING|TYPE)|OFFLINE|ONLINE|ONLY|OPAQUE|OPERATOR|ORACLE|ORADATA|ORGANIZATION|ORL(?:ANY|VARY)|OTHERS|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETERS?|PASCAL|PCTFREE|PIPE(?:LINED)?|PRAGMA|PRIOR|PRIVATE|RAISE|RANGE|RAW|RECORD|REF|REFERENCE|REM|REMAINDER|RESULT|RESOURCE|RETURNING|REVERSE|ROW(?:ID|NUM|TYPE)|SAMPLE|SB[124]|SEGMENT|SELF|SEPARATE|SEQUENCE|SHORT|SIZE(?:_T)?|SPARSE|SQL(?:CODE|DATA|NAME|STATE)|STANDARD|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUCCESSFUL|SYNONYM|SYSDATE|TABAUTH|TDO|THE|TIMEZONE_(?:ABBR|HOUR|MINUTE|REGION)|TRAILING|TRANSAC(?:TIONAL)?|TRUSTED|UB[124]|UID|UNDER|UNTRUSTED|VALIDATE|VALIST|VARCHAR2|VARIABLE|VARIANCE|VARRAY|VIEWS|VOID|WHENEVER|WRAPPED|ZONE)\b/i - ); - - var operator = plsql['operator']; - if (!Array.isArray(operator)) { - operator = plsql['operator'] = [operator]; - } - operator.unshift( - /:=/ - ); - -}(Prism)); +Prism.languages.insertBefore('plsql', 'operator', { + 'label': { + pattern: /<<\s*\w+\s*>>/, + alias: 'symbol' + }, +}); diff --git a/components/prism-plsql.min.js b/components/prism-plsql.min.js index dc7f54727a..e20f68e456 100644 --- a/components/prism-plsql.min.js +++ b/components/prism-plsql.min.js @@ -1 +1 @@ -!function(E){var A=E.languages.plsql=E.languages.extend("sql",{comment:[/\/\*[\s\S]*?\*\//,/--.*/]}),T=A.keyword;Array.isArray(T)||(T=A.keyword=[T]),T.unshift(/\b(?:ACCESS|AGENT|AGGREGATE|ARRAY|ARROW|AT|ATTRIBUTE|AUDIT|AUTHID|BFILE_BASE|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BYTE|CALLING|CHAR_BASE|CHARSET(?:FORM|ID)|CLOB_BASE|COLAUTH|COLLECT|CLUSTERS?|COMPILED|COMPRESS|CONSTANT|CONSTRUCTOR|CONTEXT|CRASH|CUSTOMDATUM|DANGLING|DATE_BASE|DEFINE|DETERMINISTIC|DURATION|ELEMENT|EMPTY|EXCEPTIONS?|EXCLUSIVE|EXTERNAL|FINAL|FORALL|FORM|FOUND|GENERAL|HEAP|HIDDEN|IDENTIFIED|IMMEDIATE|INCLUDING|INCREMENT|INDICATOR|INDEXES|INDICES|INFINITE|INITIAL|ISOPEN|INSTANTIABLE|INTERFACE|INVALIDATE|JAVA|LARGE|LEADING|LENGTH|LIBRARY|LIKE[24C]|LIMITED|LONG|LOOP|MAP|MAXEXTENTS|MAXLEN|MEMBER|MINUS|MLSLABEL|MULTISET|NAME|NAN|NATIVE|NEW|NOAUDIT|NOCOMPRESS|NOCOPY|NOTFOUND|NOWAIT|NUMBER(?:_BASE)?|OBJECT|OCI(?:COLL|DATE|DATETIME|DURATION|INTERVAL|LOBLOCATOR|NUMBER|RAW|REF|REFCURSOR|ROWID|STRING|TYPE)|OFFLINE|ONLINE|ONLY|OPAQUE|OPERATOR|ORACLE|ORADATA|ORGANIZATION|ORL(?:ANY|VARY)|OTHERS|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETERS?|PASCAL|PCTFREE|PIPE(?:LINED)?|PRAGMA|PRIOR|PRIVATE|RAISE|RANGE|RAW|RECORD|REF|REFERENCE|REM|REMAINDER|RESULT|RESOURCE|RETURNING|REVERSE|ROW(?:ID|NUM|TYPE)|SAMPLE|SB[124]|SEGMENT|SELF|SEPARATE|SEQUENCE|SHORT|SIZE(?:_T)?|SPARSE|SQL(?:CODE|DATA|NAME|STATE)|STANDARD|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUCCESSFUL|SYNONYM|SYSDATE|TABAUTH|TDO|THE|TIMEZONE_(?:ABBR|HOUR|MINUTE|REGION)|TRAILING|TRANSAC(?:TIONAL)?|TRUSTED|UB[124]|UID|UNDER|UNTRUSTED|VALIDATE|VALIST|VARCHAR2|VARIABLE|VARIANCE|VARRAY|VIEWS|VOID|WHENEVER|WRAPPED|ZONE)\b/i);var R=A.operator;Array.isArray(R)||(R=A.operator=[R]),R.unshift(/:=/)}(Prism); \ No newline at end of file +Prism.languages.plsql=Prism.languages.extend("sql",{comment:{pattern:/\/\*[\s\S]*?\*\/|--.*/,greedy:!0},keyword:/\b(?:A|ACCESSIBLE|ADD|AGENT|AGGREGATE|ALL|ALTER|AND|ANY|ARRAY|AS|ASC|AT|ATTRIBUTE|AUTHID|AVG|BEGIN|BETWEEN|BFILE_BASE|BINARY|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BULK|BY|BYTE|C|CALL|CALLING|CASCADE|CASE|CHAR|CHARACTER|CHARSET|CHARSETFORM|CHARSETID|CHAR_BASE|CHECK|CLOB_BASE|CLONE|CLOSE|CLUSTER|CLUSTERS|COLAUTH|COLLECT|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPILED|COMPRESS|CONNECT|CONSTANT|CONSTRUCTOR|CONTEXT|CONTINUE|CONVERT|COUNT|CRASH|CREATE|CREDENTIAL|CURRENT|CURSOR|CUSTOMDATUM|DANGLING|DATA|DATE|DATE_BASE|DAY|DECLARE|DEFAULT|DEFINE|DELETE|DESC|DETERMINISTIC|DIRECTORY|DISTINCT|DOUBLE|DROP|DURATION|ELEMENT|ELSE|ELSIF|EMPTY|END|ESCAPE|EXCEPT|EXCEPTION|EXCEPTIONS|EXCLUSIVE|EXECUTE|EXISTS|EXIT|EXTERNAL|FETCH|FINAL|FIRST|FIXED|FLOAT|FOR|FORALL|FORCE|FROM|FUNCTION|GENERAL|GOTO|GRANT|GROUP|HASH|HAVING|HEAP|HIDDEN|HOUR|IDENTIFIED|IF|IMMEDIATE|IMMUTABLE|IN|INCLUDING|INDEX|INDEXES|INDICATOR|INDICES|INFINITE|INSERT|INSTANTIABLE|INT|INTERFACE|INTERSECT|INTERVAL|INTO|INVALIDATE|IS|ISOLATION|JAVA|LANGUAGE|LARGE|LEADING|LENGTH|LEVEL|LIBRARY|LIKE|LIKE2|LIKE4|LIKEC|LIMIT|LIMITED|LOCAL|LOCK|LONG|LOOP|MAP|MAX|MAXLEN|MEMBER|MERGE|MIN|MINUS|MINUTE|MOD|MODE|MODIFY|MONTH|MULTISET|MUTABLE|NAME|NAN|NATIONAL|NATIVE|NCHAR|NEW|NOCOMPRESS|NOCOPY|NOT|NOWAIT|NULL|NUMBER_BASE|OBJECT|OCICOLL|OCIDATE|OCIDATETIME|OCIDURATION|OCIINTERVAL|OCILOBLOCATOR|OCINUMBER|OCIRAW|OCIREF|OCIREFCURSOR|OCIROWID|OCISTRING|OCITYPE|OF|OLD|ON|ONLY|OPAQUE|OPEN|OPERATOR|OPTION|OR|ORACLE|ORADATA|ORDER|ORGANIZATION|ORLANY|ORLVARY|OTHERS|OUT|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETER|PARAMETERS|PARENT|PARTITION|PASCAL|PERSISTABLE|PIPE|PIPELINED|PLUGGABLE|POLYMORPHIC|PRAGMA|PRECISION|PRIOR|PRIVATE|PROCEDURE|PUBLIC|RAISE|RANGE|RAW|READ|RECORD|REF|REFERENCE|RELIES_ON|REM|REMAINDER|RENAME|RESOURCE|RESULT|RESULT_CACHE|RETURN|RETURNING|REVERSE|REVOKE|ROLLBACK|ROW|SAMPLE|SAVE|SAVEPOINT|SB1|SB2|SB4|SECOND|SEGMENT|SELECT|SELF|SEPARATE|SEQUENCE|SERIALIZABLE|SET|SHARE|SHORT|SIZE|SIZE_T|SOME|SPARSE|SQL|SQLCODE|SQLDATA|SQLNAME|SQLSTATE|STANDARD|START|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUM|SYNONYM|TABAUTH|TABLE|TDO|THE|THEN|TIME|TIMESTAMP|TIMEZONE_ABBR|TIMEZONE_HOUR|TIMEZONE_MINUTE|TIMEZONE_REGION|TO|TRAILING|TRANSACTION|TRANSACTIONAL|TRUSTED|TYPE|UB1|UB2|UB4|UNDER|UNION|UNIQUE|UNPLUG|UNSIGNED|UNTRUSTED|UPDATE|USE|USING|VALIST|VALUE|VALUES|VARIABLE|VARIANCE|VARRAY|VARYING|VIEW|VIEWS|VOID|WHEN|WHERE|WHILE|WITH|WORK|WRAPPED|WRITE|YEAR|ZONE)\b/i,operator:/:=?|=>|[<>^~!]=|\.\.|\|\||\*\*|[-+*/%<>=@]/}),Prism.languages.insertBefore("plsql","operator",{label:{pattern:/<<\s*\w+\s*>>/,alias:"symbol"}}); \ No newline at end of file diff --git a/components/prism-powerquery.js b/components/prism-powerquery.js index 7abf0ad572..51a30fe122 100644 --- a/components/prism-powerquery.js +++ b/components/prism-powerquery.js @@ -1,55 +1,55 @@ // https://docs.microsoft.com/en-us/powerquery-m/power-query-m-language-specification Prism.languages.powerquery = { - 'comment': { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/, - lookbehind: true - }, - 'quoted-identifier': { - pattern: /#"(?:[^"\r\n]|"")*"(?!")/, - greedy: true, - alias: 'variable' - }, - 'string': { - pattern: /"(?:[^"\r\n]|"")*"(?!")/, - greedy: true - }, - 'constant': [ - /\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/, - /\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/, - /\bOccurrence\.(?:First|Last|All)\b/, - /\bOrder\.(?:Ascending|Descending)\b/, - /\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/, - /\bMissingField\.(?:Error|Ignore|UseNull)\b/, - /\bQuoteStyle\.(?:Csv|None)\b/, - /\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/, - /\bGroupKind\.(?:Global|Local)\b/, - /\bExtraValues\.(?:List|Ignore|Error)\b/, - /\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/, - /\bJoinSide\.(?:Left|Right)\b/, - /\bPrecision\.(?:Double|Decimal)\b/, - /\bRelativePosition\.From(?:End|Start)\b/, - /\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/, - /\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/, - /\bnull\b/ - ], - 'boolean': /\b(?:true|false)\b/, - 'keyword': /\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/, - 'function': { - pattern: /(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/, - lookbehind: true - }, - 'data-type': { - pattern: /\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/, - alias: 'variable' - }, - 'number': { - pattern: /\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i, - lookbehind: true - }, - 'operator': /[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/, - 'punctuation': /[,;\[\](){}]/ + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, + lookbehind: true, + greedy: true + }, + 'quoted-identifier': { + pattern: /#"(?:[^"\r\n]|"")*"(?!")/, + greedy: true + }, + 'string': { + pattern: /(?:#!)?"(?:[^"\r\n]|"")*"(?!")/, + greedy: true + }, + 'constant': [ + /\bDay\.(?:Friday|Monday|Saturday|Sunday|Thursday|Tuesday|Wednesday)\b/, + /\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/, + /\bOccurrence\.(?:All|First|Last)\b/, + /\bOrder\.(?:Ascending|Descending)\b/, + /\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/, + /\bMissingField\.(?:Error|Ignore|UseNull)\b/, + /\bQuoteStyle\.(?:Csv|None)\b/, + /\bJoinKind\.(?:FullOuter|Inner|LeftAnti|LeftOuter|RightAnti|RightOuter)\b/, + /\bGroupKind\.(?:Global|Local)\b/, + /\bExtraValues\.(?:Error|Ignore|List)\b/, + /\bJoinAlgorithm\.(?:Dynamic|LeftHash|LeftIndex|PairwiseHash|RightHash|RightIndex|SortMerge)\b/, + /\bJoinSide\.(?:Left|Right)\b/, + /\bPrecision\.(?:Decimal|Double)\b/, + /\bRelativePosition\.From(?:End|Start)\b/, + /\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf16|Utf8|Windows)\b/, + /\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Function|Int16|Int32|Int64|Int8|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/, + /\bnull\b/ + ], + 'boolean': /\b(?:false|true)\b/, + 'keyword': /\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/, + 'function': { + pattern: /(^|[^#\w.])[a-z_][\w.]*(?=\s*\()/i, + lookbehind: true + }, + 'data-type': { + pattern: /\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time)\b/, + alias: 'class-name' + }, + 'number': { + pattern: /\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i, + lookbehind: true + }, + 'operator': /[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/, + 'punctuation': /[,;\[\](){}]/ }; Prism.languages.pq = Prism.languages['powerquery']; -Prism.languages.mscript = Prism.languages['powerquery'] \ No newline at end of file +Prism.languages.mscript = Prism.languages['powerquery']; diff --git a/components/prism-powerquery.min.js b/components/prism-powerquery.min.js index e6ef36d1c7..7d77308559 100644 --- a/components/prism-powerquery.min.js +++ b/components/prism-powerquery.min.js @@ -1 +1 @@ -Prism.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/,lookbehind:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0,alias:"variable"},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:First|Last|All)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:List|Ignore|Error)\b/,/\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Double|Decimal)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:true|false)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/,alias:"variable"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},Prism.languages.pq=Prism.languages.powerquery,Prism.languages.mscript=Prism.languages.powerquery; \ No newline at end of file +Prism.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},string:{pattern:/(?:#!)?"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Friday|Monday|Saturday|Sunday|Thursday|Tuesday|Wednesday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:All|First|Last)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:FullOuter|Inner|LeftAnti|LeftOuter|RightAnti|RightOuter)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:Error|Ignore|List)\b/,/\bJoinAlgorithm\.(?:Dynamic|LeftHash|LeftIndex|PairwiseHash|RightHash|RightIndex|SortMerge)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Decimal|Double)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf16|Utf8|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Function|Int16|Int32|Int64|Int8|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:false|true)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])[a-z_][\w.]*(?=\s*\()/i,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time)\b/,alias:"class-name"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},Prism.languages.pq=Prism.languages.powerquery,Prism.languages.mscript=Prism.languages.powerquery; \ No newline at end of file diff --git a/components/prism-powershell.js b/components/prism-powershell.js index 327b9bc610..538026992e 100644 --- a/components/prism-powershell.js +++ b/components/prism-powershell.js @@ -15,15 +15,7 @@ { pattern: /"(?:`[\s\S]|[^`"])*"/, greedy: true, - inside: { - 'function': { - // Allow for one level of nesting - pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/, - lookbehind: true, - // Populated at end of file - inside: {} - } - } + inside: null // see below }, { pattern: /'(?:[^']|'')*'/, @@ -32,29 +24,35 @@ ], // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices // Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`) - 'namespace': /\[[a-z](?:\[(?:\[[^\]]*]|[^\[\]])*]|[^\[\]])*]/i, - 'boolean': /\$(?:true|false)\b/i, + 'namespace': /\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i, + 'boolean': /\$(?:false|true)\b/i, 'variable': /\$\w+\b/, // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" } // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" } 'function': [ - /\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i, + /\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i, /\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i ], // per http://technet.microsoft.com/en-us/library/hh847744.aspx 'keyword': /\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i, 'operator': { - pattern: /(\W?)(?:!|-(?:eq|ne|gt|ge|lt|le|sh[lr]|not|b?(?:and|x?or)|(?:Not)?(?:Like|Match|Contains|In)|Replace|Join|is(?:Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i, + pattern: /(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i, lookbehind: true }, 'punctuation': /[|{}[\];(),.]/ }; // Variable interpolation inside strings, and nested expressions - var stringInside = powershell.string[0].inside; - stringInside.boolean = powershell.boolean; - stringInside.variable = powershell.variable; - stringInside.function.inside = powershell; + powershell.string[0].inside = { + 'function': { + // Allow for one level of nesting + pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/, + lookbehind: true, + inside: powershell + }, + 'boolean': powershell.boolean, + 'variable': powershell.variable, + }; }(Prism)); diff --git a/components/prism-powershell.min.js b/components/prism-powershell.min.js index ca7177b5b9..7e969c61f2 100644 --- a/components/prism-powershell.min.js +++ b/components/prism-powershell.min.js @@ -1 +1 @@ -!function(e){var i=Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:{}}}},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*]|[^\[\]])*]|[^\[\]])*]/i,boolean:/\$(?:true|false)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(?:!|-(?:eq|ne|gt|ge|lt|le|sh[lr]|not|b?(?:and|x?or)|(?:Not)?(?:Like|Match|Contains|In)|Replace|Join|is(?:Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/},r=i.string[0].inside;r.boolean=i.boolean,r.variable=i.variable,r.function.inside=i}(); \ No newline at end of file +!function(e){var i=Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};i.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:i},boolean:i.boolean,variable:i.variable}}(); \ No newline at end of file diff --git a/components/prism-processing.js b/components/prism-processing.js index b252764e71..a7ac93a1aa 100644 --- a/components/prism-processing.js +++ b/components/prism-processing.js @@ -1,18 +1,15 @@ Prism.languages.processing = Prism.languages.extend('clike', { - 'keyword': /\b(?:break|catch|case|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/, + 'keyword': /\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/, + // Spaces are allowed between function name and parenthesis + 'function': /\b\w+(?=\s*\()/, 'operator': /<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/ }); + Prism.languages.insertBefore('processing', 'number', { // Special case: XML is a type 'constant': /\b(?!XML\b)[A-Z][A-Z\d_]+\b/, 'type': { - pattern: /\b(?:boolean|byte|char|color|double|float|int|XML|[A-Z]\w*)\b/, - alias: 'variable' + pattern: /\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/, + alias: 'class-name' } }); - -// Spaces are allowed between function name and parenthesis -Prism.languages.processing['function'].pattern = /\w+(?=\s*\()/; - -// Class-names is not styled by default -Prism.languages.processing['class-name'].alias = 'variable'; \ No newline at end of file diff --git a/components/prism-processing.min.js b/components/prism-processing.min.js index e2cc0d1ed8..91d36ca1d7 100644 --- a/components/prism-processing.min.js +++ b/components/prism-processing.min.js @@ -1 +1 @@ -Prism.languages.processing=Prism.languages.extend("clike",{keyword:/\b(?:break|catch|case|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),Prism.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|XML|[A-Z]\w*)\b/,alias:"variable"}}),Prism.languages.processing.function.pattern=/\w+(?=\s*\()/,Prism.languages.processing["class-name"].alias="variable"; \ No newline at end of file +Prism.languages.processing=Prism.languages.extend("clike",{keyword:/\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,function:/\b\w+(?=\s*\()/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),Prism.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,alias:"class-name"}}); \ No newline at end of file diff --git a/components/prism-prolog.js b/components/prism-prolog.js index 19d543a339..0917e542d5 100644 --- a/components/prism-prolog.js +++ b/components/prism-prolog.js @@ -1,20 +1,19 @@ Prism.languages.prolog = { // Syntax depends on the implementation - 'comment': [ - /%.+/, - /\/\*[\s\S]*?\*\// - ], + 'comment': { + pattern: /\/\*[\s\S]*?\*\/|%.*/, + greedy: true + }, // Depending on the implementation, strings may allow escaped newlines and quote-escape 'string': { - pattern: /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + pattern: /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/, greedy: true }, 'builtin': /\b(?:fx|fy|xf[xy]?|yfx?)\b/, - 'variable': /\b[A-Z_]\w*/, // FIXME: Should we list all null-ary predicates (not followed by a parenthesis) like halt, trace, etc.? 'function': /\b[a-z]\w*(?:(?=\()|\/\d+)/, - 'number': /\b\d+\.?\d*/, + 'number': /\b\d+(?:\.\d*)?/, // Custom operators are allowed 'operator': /[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/, 'punctuation': /[(){}\[\],]/ -}; \ No newline at end of file +}; diff --git a/components/prism-prolog.min.js b/components/prism-prolog.min.js index bbd096f550..531b2fd4ed 100644 --- a/components/prism-prolog.min.js +++ b/components/prism-prolog.min.js @@ -1 +1 @@ -Prism.languages.prolog={comment:[/%.+/,/\/\*[\s\S]*?\*\//],string:{pattern:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,variable:/\b[A-Z_]\w*/,function:/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+\.?\d*/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/}; \ No newline at end of file +Prism.languages.prolog={comment:{pattern:/\/\*[\s\S]*?\*\/|%.*/,greedy:!0},string:{pattern:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/,greedy:!0},builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,function:/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+(?:\.\d*)?/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/}; \ No newline at end of file diff --git a/components/prism-promql.js b/components/prism-promql.js new file mode 100644 index 0000000000..d12f730383 --- /dev/null +++ b/components/prism-promql.js @@ -0,0 +1,99 @@ +// Thanks to: https://github.com/prometheus-community/monaco-promql/blob/master/src/promql/promql.ts +// As well as: https://kausal.co/blog/slate-prism-add-new-syntax-promql/ + +(function (Prism) { + // PromQL Aggregation Operators + // (https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators) + var aggregations = [ + 'sum', + 'min', + 'max', + 'avg', + 'group', + 'stddev', + 'stdvar', + 'count', + 'count_values', + 'bottomk', + 'topk', + 'quantile' + ]; + + // PromQL vector matching + the by and without clauses + // (https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching) + var vectorMatching = [ + 'on', + 'ignoring', + 'group_right', + 'group_left', + 'by', + 'without', + ]; + + // PromQL offset modifier + // (https://prometheus.io/docs/prometheus/latest/querying/basics/#offset-modifier) + var offsetModifier = ['offset']; + + var keywords = aggregations.concat(vectorMatching, offsetModifier); + + Prism.languages.promql = { + 'comment': { + pattern: /(^[ \t]*)#.*/m, + lookbehind: true + }, + 'vector-match': { + // Match the comma-separated label lists inside vector matching: + pattern: new RegExp('((?:' + vectorMatching.join('|') + ')\\s*)\\([^)]*\\)'), + lookbehind: true, + inside: { + 'label-key': { + pattern: /\b[^,]+\b/, + alias: 'attr-name', + }, + 'punctuation': /[(),]/ + }, + }, + 'context-labels': { + pattern: /\{[^{}]*\}/, + inside: { + 'label-key': { + pattern: /\b[a-z_]\w*(?=\s*(?:=|![=~]))/, + alias: 'attr-name', + }, + 'label-value': { + pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/, + greedy: true, + alias: 'attr-value', + }, + 'punctuation': /\{|\}|=~?|![=~]|,/, + }, + }, + 'context-range': [ + { + pattern: /\[[\w\s:]+\]/, // [1m] + inside: { + 'punctuation': /\[|\]|:/, + 'range-duration': { + pattern: /\b(?:\d+(?:[smhdwy]|ms))+\b/i, + alias: 'number', + }, + }, + }, + { + pattern: /(\boffset\s+)\w+/, // offset 1m + lookbehind: true, + inside: { + 'range-duration': { + pattern: /\b(?:\d+(?:[smhdwy]|ms))+\b/i, + alias: 'number', + }, + }, + }, + ], + 'keyword': new RegExp('\\b(?:' + keywords.join('|') + ')\\b', 'i'), + 'function': /\b[a-z_]\w*(?=\s*\()/i, + 'number': /[-+]?(?:(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[-+]?\d+)?\b|\b(?:0x[0-9a-f]+|nan|inf)\b)/i, + 'operator': /[\^*/%+-]|==|!=|<=|<|>=|>|\b(?:and|or|unless)\b/i, + 'punctuation': /[{};()`,.[\]]/, + }; +}(Prism)); diff --git a/components/prism-promql.min.js b/components/prism-promql.min.js new file mode 100644 index 0000000000..46253c3263 --- /dev/null +++ b/components/prism-promql.min.js @@ -0,0 +1 @@ +!function(t){var n=["on","ignoring","group_right","group_left","by","without"],a=["sum","min","max","avg","group","stddev","stdvar","count","count_values","bottomk","topk","quantile"].concat(n,["offset"]);t.languages.promql={comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},"vector-match":{pattern:new RegExp("((?:"+n.join("|")+")\\s*)\\([^)]*\\)"),lookbehind:!0,inside:{"label-key":{pattern:/\b[^,]+\b/,alias:"attr-name"},punctuation:/[(),]/}},"context-labels":{pattern:/\{[^{}]*\}/,inside:{"label-key":{pattern:/\b[a-z_]\w*(?=\s*(?:=|![=~]))/,alias:"attr-name"},"label-value":{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0,alias:"attr-value"},punctuation:/\{|\}|=~?|![=~]|,/}},"context-range":[{pattern:/\[[\w\s:]+\]/,inside:{punctuation:/\[|\]|:/,"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}},{pattern:/(\boffset\s+)\w+/,lookbehind:!0,inside:{"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}}],keyword:new RegExp("\\b(?:"+a.join("|")+")\\b","i"),function:/\b[a-z_]\w*(?=\s*\()/i,number:/[-+]?(?:(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[-+]?\d+)?\b|\b(?:0x[0-9a-f]+|nan|inf)\b)/i,operator:/[\^*/%+-]|==|!=|<=|<|>=|>|\b(?:and|or|unless)\b/i,punctuation:/[{};()`,.[\]]/}}(Prism); \ No newline at end of file diff --git a/components/prism-properties.js b/components/prism-properties.js index abcfae4b9e..e9e01ff1bf 100644 --- a/components/prism-properties.js +++ b/components/prism-properties.js @@ -1,9 +1,9 @@ Prism.languages.properties = { 'comment': /^[ \t]*[#!].*$/m, 'attr-value': { - pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?: *[=:] *| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m, + pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m, lookbehind: true }, - 'attr-name': /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?= *[=:] *| )/m, + 'attr-name': /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m, 'punctuation': /[=:]/ -}; \ No newline at end of file +}; diff --git a/components/prism-properties.min.js b/components/prism-properties.min.js index eb6f793b34..d90930c9c1 100644 --- a/components/prism-properties.min.js +++ b/components/prism-properties.min.js @@ -1 +1 @@ -Prism.languages.properties={comment:/^[ \t]*[#!].*$/m,"attr-value":{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?: *[=:] *| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0},"attr-name":/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?= *[=:] *| )/m,punctuation:/[=:]/}; \ No newline at end of file +Prism.languages.properties={comment:/^[ \t]*[#!].*$/m,"attr-value":{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0},"attr-name":/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,punctuation:/[=:]/}; \ No newline at end of file diff --git a/components/prism-protobuf.js b/components/prism-protobuf.js index c74f9206c2..abe7574d61 100644 --- a/components/prism-protobuf.js +++ b/components/prism-protobuf.js @@ -1,6 +1,6 @@ (function (Prism) { - var builtinTypes = /\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/; + var builtinTypes = /\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/; Prism.languages.protobuf = Prism.languages.extend('clike', { 'class-name': [ @@ -14,7 +14,7 @@ } ], 'keyword': /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/, - 'function': /[a-z_]\w*(?=\s*\()/i + 'function': /\b[a-z_]\w*(?=\s*\()/i }); Prism.languages.insertBefore('protobuf', 'operator', { diff --git a/components/prism-protobuf.min.js b/components/prism-protobuf.min.js index 7fce235d4a..9bc79f4632 100644 --- a/components/prism-protobuf.min.js +++ b/components/prism-protobuf.min.js @@ -1 +1 @@ -!function(e){var s=/\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/[a-z_]\w*(?=\s*\()/i}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:s}},builtin:s,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}(Prism); \ No newline at end of file +!function(e){var s=/\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:s}},builtin:s,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}(Prism); \ No newline at end of file diff --git a/components/prism-psl.js b/components/prism-psl.js new file mode 100644 index 0000000000..12e37a9ff9 --- /dev/null +++ b/components/prism-psl.js @@ -0,0 +1,35 @@ +Prism.languages.psl = { + 'comment': { + pattern: /#.*/, + greedy: true + }, + 'string': { + pattern: /"(?:\\.|[^\\"])*"/, + greedy: true, + inside: { + 'symbol': /\\[ntrbA-Z"\\]/ + } + }, + 'heredoc-string': { + pattern: /<<<([a-zA-Z_]\w*)[\r\n](?:.*[\r\n])*?\1\b/, + alias: 'string', + greedy: true + }, + 'keyword': /\b(?:__multi|__single|case|default|do|else|elsif|exit|export|for|foreach|function|if|last|line|local|next|requires|return|switch|until|while|word)\b/, + 'constant': /\b(?:ALARM|CHART_ADD_GRAPH|CHART_DELETE_GRAPH|CHART_DESTROY|CHART_LOAD|CHART_PRINT|EOF|OFFLINE|OK|PSL_PROF_LOG|R_CHECK_HORIZ|R_CHECK_VERT|R_CLICKER|R_COLUMN|R_FRAME|R_ICON|R_LABEL|R_LABEL_CENTER|R_LIST_MULTIPLE|R_LIST_MULTIPLE_ND|R_LIST_SINGLE|R_LIST_SINGLE_ND|R_MENU|R_POPUP|R_POPUP_SCROLLED|R_RADIO_HORIZ|R_RADIO_VERT|R_ROW|R_SCALE_HORIZ|R_SCALE_VERT|R_SEP_HORIZ|R_SEP_VERT|R_SPINNER|R_TEXT_FIELD|R_TEXT_FIELD_LABEL|R_TOGGLE|TRIM_LEADING|TRIM_LEADING_AND_TRAILING|TRIM_REDUNDANT|TRIM_TRAILING|VOID|WARN)\b/, + 'boolean': /\b(?:FALSE|False|NO|No|TRUE|True|YES|Yes|false|no|true|yes)\b/, + 'variable': /\b(?:PslDebug|errno|exit_status)\b/, + 'builtin': { + pattern: /\b(?:PslExecute|PslFunctionCall|PslFunctionExists|PslSetOptions|_snmp_debug|acos|add_diary|annotate|annotate_get|ascii_to_ebcdic|asctime|asin|atan|atexit|batch_set|blackout|cat|ceil|chan_exists|change_state|close|code_cvt|cond_signal|cond_wait|console_type|convert_base|convert_date|convert_locale_date|cos|cosh|create|date|dcget_text|destroy|destroy_lock|dget_text|difference|dump_hist|ebcdic_to_ascii|encrypt|event_archive|event_catalog_get|event_check|event_query|event_range_manage|event_range_query|event_report|event_schedule|event_trigger|event_trigger2|execute|exists|exp|fabs|file|floor|fmod|fopen|fseek|ftell|full_discovery|get|get_chan_info|get_ranges|get_text|get_vars|getenv|gethostinfo|getpid|getpname|grep|history|history_get_retention|in_transition|index|int|internal|intersection|is_var|isnumber|join|kill|length|lines|lock|lock_info|log|log10|loge|matchline|msg_check|msg_get_format|msg_get_severity|msg_printf|msg_sprintf|ntharg|nthargf|nthline|nthlinef|num_bytes|num_consoles|pconfig|popen|poplines|pow|print|printf|proc_exists|process|random|read|readln|refresh_parameters|remote_check|remote_close|remote_event_query|remote_event_trigger|remote_file_send|remote_open|remove|replace|rindex|sec_check_priv|sec_store_get|sec_store_set|set|set_alarm_ranges|set_locale|share|sin|sinh|sleep|snmp_agent_config|snmp_agent_start|snmp_agent_stop|snmp_close|snmp_config|snmp_get|snmp_get_next|snmp_h_get|snmp_h_get_next|snmp_h_set|snmp_open|snmp_set|snmp_trap_ignore|snmp_trap_listen|snmp_trap_raise_std_trap|snmp_trap_receive|snmp_trap_register_im|snmp_trap_send|snmp_walk|sopen|sort|splitline|sprintf|sqrt|srandom|str_repeat|strcasecmp|subset|substr|system|tail|tan|tanh|text_domain|time|tmpnam|tolower|toupper|trace_psl_process|trim|union|unique|unlock|unset|va_arg|va_start|write)\b/, + alias: 'builtin-function' + }, + 'foreach-variable': { + pattern: /(\bforeach\s+(?:(?:\w+\b|"(?:\\.|[^\\"])*")\s+){0,2})[_a-zA-Z]\w*(?=\s*\()/, + lookbehind: true, + greedy: true + }, + 'function': /\b[_a-z]\w*\b(?=\s*\()/i, + 'number': /\b(?:0x[0-9a-f]+|\d+(?:\.\d+)?)\b/i, + 'operator': /--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/, + 'punctuation': /[(){}\[\];,]/ +}; diff --git a/components/prism-psl.min.js b/components/prism-psl.min.js new file mode 100644 index 0000000000..288f9464bf --- /dev/null +++ b/components/prism-psl.min.js @@ -0,0 +1 @@ +Prism.languages.psl={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0,inside:{symbol:/\\[ntrbA-Z"\\]/}},"heredoc-string":{pattern:/<<<([a-zA-Z_]\w*)[\r\n](?:.*[\r\n])*?\1\b/,alias:"string",greedy:!0},keyword:/\b(?:__multi|__single|case|default|do|else|elsif|exit|export|for|foreach|function|if|last|line|local|next|requires|return|switch|until|while|word)\b/,constant:/\b(?:ALARM|CHART_ADD_GRAPH|CHART_DELETE_GRAPH|CHART_DESTROY|CHART_LOAD|CHART_PRINT|EOF|OFFLINE|OK|PSL_PROF_LOG|R_CHECK_HORIZ|R_CHECK_VERT|R_CLICKER|R_COLUMN|R_FRAME|R_ICON|R_LABEL|R_LABEL_CENTER|R_LIST_MULTIPLE|R_LIST_MULTIPLE_ND|R_LIST_SINGLE|R_LIST_SINGLE_ND|R_MENU|R_POPUP|R_POPUP_SCROLLED|R_RADIO_HORIZ|R_RADIO_VERT|R_ROW|R_SCALE_HORIZ|R_SCALE_VERT|R_SEP_HORIZ|R_SEP_VERT|R_SPINNER|R_TEXT_FIELD|R_TEXT_FIELD_LABEL|R_TOGGLE|TRIM_LEADING|TRIM_LEADING_AND_TRAILING|TRIM_REDUNDANT|TRIM_TRAILING|VOID|WARN)\b/,boolean:/\b(?:FALSE|False|NO|No|TRUE|True|YES|Yes|false|no|true|yes)\b/,variable:/\b(?:PslDebug|errno|exit_status)\b/,builtin:{pattern:/\b(?:PslExecute|PslFunctionCall|PslFunctionExists|PslSetOptions|_snmp_debug|acos|add_diary|annotate|annotate_get|ascii_to_ebcdic|asctime|asin|atan|atexit|batch_set|blackout|cat|ceil|chan_exists|change_state|close|code_cvt|cond_signal|cond_wait|console_type|convert_base|convert_date|convert_locale_date|cos|cosh|create|date|dcget_text|destroy|destroy_lock|dget_text|difference|dump_hist|ebcdic_to_ascii|encrypt|event_archive|event_catalog_get|event_check|event_query|event_range_manage|event_range_query|event_report|event_schedule|event_trigger|event_trigger2|execute|exists|exp|fabs|file|floor|fmod|fopen|fseek|ftell|full_discovery|get|get_chan_info|get_ranges|get_text|get_vars|getenv|gethostinfo|getpid|getpname|grep|history|history_get_retention|in_transition|index|int|internal|intersection|is_var|isnumber|join|kill|length|lines|lock|lock_info|log|log10|loge|matchline|msg_check|msg_get_format|msg_get_severity|msg_printf|msg_sprintf|ntharg|nthargf|nthline|nthlinef|num_bytes|num_consoles|pconfig|popen|poplines|pow|print|printf|proc_exists|process|random|read|readln|refresh_parameters|remote_check|remote_close|remote_event_query|remote_event_trigger|remote_file_send|remote_open|remove|replace|rindex|sec_check_priv|sec_store_get|sec_store_set|set|set_alarm_ranges|set_locale|share|sin|sinh|sleep|snmp_agent_config|snmp_agent_start|snmp_agent_stop|snmp_close|snmp_config|snmp_get|snmp_get_next|snmp_h_get|snmp_h_get_next|snmp_h_set|snmp_open|snmp_set|snmp_trap_ignore|snmp_trap_listen|snmp_trap_raise_std_trap|snmp_trap_receive|snmp_trap_register_im|snmp_trap_send|snmp_walk|sopen|sort|splitline|sprintf|sqrt|srandom|str_repeat|strcasecmp|subset|substr|system|tail|tan|tanh|text_domain|time|tmpnam|tolower|toupper|trace_psl_process|trim|union|unique|unlock|unset|va_arg|va_start|write)\b/,alias:"builtin-function"},"foreach-variable":{pattern:/(\bforeach\s+(?:(?:\w+\b|"(?:\\.|[^\\"])*")\s+){0,2})[_a-zA-Z]\w*(?=\s*\()/,lookbehind:!0,greedy:!0},function:/\b[_a-z]\w*\b(?=\s*\()/i,number:/\b(?:0x[0-9a-f]+|\d+(?:\.\d+)?)\b/i,operator:/--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/,punctuation:/[(){}\[\];,]/}; \ No newline at end of file diff --git a/components/prism-pug.js b/components/prism-pug.js index 6860ded5dd..0afee3fcb7 100644 --- a/components/prism-pug.js +++ b/components/prism-pug.js @@ -1,4 +1,4 @@ -(function(Prism) { +(function (Prism) { // TODO: // - Add CSS highlighting inside - + @@ -151,7 +151,7 @@

    Customize your download

    Total filesize: ( JavaScript + CSS)

    -

    Note: The filesizes displayed refer to non-gizipped files and include any CSS code required. The CSS code is not minified.

    +

    Note: The filesizes displayed refer to non-gizipped files and include any CSS code required.

    @@ -172,7 +172,7 @@

    Customize your download

    - + diff --git a/examples.html b/examples.html index e1942a2b37..0d979d5981 100644 --- a/examples.html +++ b/examples.html @@ -43,7 +43,7 @@ padding-left: 40px; } - + @@ -99,8 +99,9 @@

    Per language examples

    - + + diff --git a/examples/prism-apex.html b/examples/prism-apex.html new file mode 100644 index 0000000000..f942f29da3 --- /dev/null +++ b/examples/prism-apex.html @@ -0,0 +1,152 @@ +

    Full example

    +
    // source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_shopping_cart_example_code.htm
    +
    +trigger calculate on Item__c (after insert, after update, after delete) {
    +
    +// Use a map because it doesn't allow duplicate values
    +
    +Map<ID, Shipping_Invoice__C> updateMap = new Map<ID, Shipping_Invoice__C>();
    +
    +// Set this integer to -1 if we are deleting
    +Integer subtract ;
    +
    +// Populate the list of items based on trigger type
    +List<Item__c> itemList;
    +	if(trigger.isInsert || trigger.isUpdate){
    +		itemList = Trigger.new;
    +		subtract = 1;
    +	}
    +	else if(trigger.isDelete)
    +	{
    +		// Note -- there is no trigger.new in delete
    +		itemList = trigger.old;
    +		subtract = -1;
    +	}
    +
    +// Access all the information we need in a single query
    +// rather than querying when we need it.
    +// This is a best practice for bulkifying requests
    +
    +set<Id> AllItems = new set<id>();
    +
    +for(item__c i :itemList){
    +// Assert numbers are not negative.
    +// None of the fields would make sense with a negative value
    +
    +System.assert(i.quantity__c > 0, 'Quantity must be positive');
    +System.assert(i.weight__c >= 0, 'Weight must be non-negative');
    +System.assert(i.price__c >= 0, 'Price must be non-negative');
    +
    +// If there is a duplicate Id, it won't get added to a set
    +AllItems.add(i.Shipping_Invoice__C);
    +}
    +
    +// Accessing all shipping invoices associated with the items in the trigger
    +List<Shipping_Invoice__C> AllShippingInvoices = [SELECT Id, ShippingDiscount__c,
    +                   SubTotal__c, TotalWeight__c, Tax__c, GrandTotal__c
    +                   FROM Shipping_Invoice__C WHERE Id IN :AllItems];
    +
    +// Take the list we just populated and put it into a Map.
    +// This will make it easier to look up a shipping invoice
    +// because you must iterate a list, but you can use lookup for a map,
    +Map<ID, Shipping_Invoice__C> SIMap = new Map<ID, Shipping_Invoice__C>();
    +
    +for(Shipping_Invoice__C sc : AllShippingInvoices)
    +{
    +	SIMap.put(sc.id, sc);
    +}
    +
    +// Process the list of items
    +	if(Trigger.isUpdate)
    +	{
    +		// Treat updates like a removal of the old item and addition of the
    +		// revised item rather than figuring out the differences of each field
    +		// and acting accordingly.
    +		// Note updates have both trigger.new and trigger.old
    +		for(Integer x = 0; x < Trigger.old.size(); x++)
    +		{
    +			Shipping_Invoice__C myOrder;
    +			myOrder = SIMap.get(trigger.old[x].Shipping_Invoice__C);
    +
    +			// Decrement the previous value from the subtotal and weight.
    +			myOrder.SubTotal__c -= (trigger.old[x].price__c *
    +			                        trigger.old[x].quantity__c);
    +			myOrder.TotalWeight__c -= (trigger.old[x].weight__c *
    +			                           trigger.old[x].quantity__c);
    +
    +			// Increment the new subtotal and weight.
    +			myOrder.SubTotal__c += (trigger.new[x].price__c *
    +			                        trigger.new[x].quantity__c);
    +			myOrder.TotalWeight__c += (trigger.new[x].weight__c *
    +			                           trigger.new[x].quantity__c);
    +		}
    +
    +		for(Shipping_Invoice__C myOrder : AllShippingInvoices)
    +		{
    +
    +			// Set tax rate to 9.25%  Please note, this is a simple example.
    +			// Generally, you would never hard code values.
    +			// Leveraging Custom Settings for tax rates is a best practice.
    +			// See Custom Settings in the Apex Developer Guide
    +			// for more information.
    +			myOrder.Tax__c = myOrder.Subtotal__c * .0925;
    +
    +			// Reset the shipping discount
    +			myOrder.ShippingDiscount__c = 0;
    +
    +			// Set shipping rate to 75 cents per pound.
    +			// Generally, you would never hard code values.
    +			// Leveraging Custom Settings for the shipping rate is a best practice.
    +			// See Custom Settings in the Apex Developer Guide
    +			// for more information.
    +			myOrder.Shipping__c = (myOrder.totalWeight__c * .75);
    +			myOrder.GrandTotal__c = myOrder.SubTotal__c + myOrder.tax__c +
    +			                        myOrder.Shipping__c;
    +			updateMap.put(myOrder.id, myOrder);
    +		}
    +	}
    +	else
    +	{
    +		for(Item__c itemToProcess : itemList)
    +		{
    +			Shipping_Invoice__C myOrder;
    +
    +			// Look up the correct shipping invoice from the ones we got earlier
    +			myOrder = SIMap.get(itemToProcess.Shipping_Invoice__C);
    +			myOrder.SubTotal__c += (itemToProcess.price__c *
    +			                        itemToProcess.quantity__c * subtract);
    +			myOrder.TotalWeight__c += (itemToProcess.weight__c *
    +			                           itemToProcess.quantity__c * subtract);
    +		}
    +
    +		for(Shipping_Invoice__C myOrder : AllShippingInvoices)
    +		{
    +
    +			// Set tax rate to 9.25%  Please note, this is a simple example.
    +			// Generally, you would never hard code values.
    +			// Leveraging Custom Settings for tax rates is a best practice.
    +			// See Custom Settings in the Apex Developer Guide
    +			// for more information.
    +			myOrder.Tax__c = myOrder.Subtotal__c * .0925;
    +
    +			// Reset shipping discount
    +			myOrder.ShippingDiscount__c = 0;
    +
    +			// Set shipping rate to 75 cents per pound.
    +			// Generally, you would never hard code values.
    +			// Leveraging Custom Settings for the shipping rate is a best practice.
    +			// See Custom Settings in the Apex Developer Guide
    +			// for more information.
    +			myOrder.Shipping__c = (myOrder.totalWeight__c * .75);
    +			myOrder.GrandTotal__c = myOrder.SubTotal__c + myOrder.tax__c +
    +			                        myOrder.Shipping__c;
    +
    +			updateMap.put(myOrder.id, myOrder);
    +
    +		}
    +	}
    +
    +	// Only use one DML update at the end.
    +	// This minimizes the number of DML requests generated from this trigger.
    +	update updateMap.values();
    +}
    diff --git a/examples/prism-asmatmel.html b/examples/prism-asmatmel.html new file mode 100644 index 0000000000..577916c292 --- /dev/null +++ b/examples/prism-asmatmel.html @@ -0,0 +1,78 @@ +

    Comments

    +
    ; This is a comment
    + +

    Labels

    +
    label1:   ; a label
    + +

    Opcodes

    +
    LD
    +OUT
    +
    +; lowercase
    +ldi
    +jmp label1
    +
    + +

    Assembler directives

    +
    .segment CODE
    +.word $07d3
    +
    + +

    Registers

    +
    LD A  ; "A"
    +LDA label1,x  ; "x"
    +
    + +

    Strings

    +
    .include "header.asm"
    +
    + +

    Numbers

    +
    ldi r24,#127
    +ldi r24,$80f0
    +ldi r24,#%01011000
    +
    + +

    Constants

    +
    ldi r16, (0<<PB5)|(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0)
    + +

    Example program to light up LEDs

    +

    Attach an LED (through a 220 ohm resistor) to any of the pins 0-12

    +
    ; Pin Constant Values (Tested on Arduino UNO)
    +; PD0 - 0
    +; PD1 - 1
    +; PD2 - 2
    +; PD3 - 3
    +; PD4 - 4
    +; PD5 - 5
    +; PD6 - 6
    +; PD7 - 7
    +
    +; PB0 - 8
    +; PB1 - 9
    +; PB2 - 10
    +; PB3 - 11
    +; PB4 - 12
    +; PB5 - 13 - System LED
    +
    +start:
    +
    +	; Set pins 0-7 to high
    +	ldi		r17, (1<<PD7)|(1<<PD6)|(1<<PD5)|(1<<PD4)|(1<<PD3)|(1<<PD2)|(1<<PD1)|(1<<PD0)
    +	out		PORTD, r17
    +
    +	; Set pins 8-13 to high
    +	ldi		r16, (1<<PB5)|(1<<PB4)|(1<<PB3)|(1<<PB2)|(1<<PB1)|(1<<PB0)
    +	out		PORTB, r16
    +
    +	; Set pins 0-7 to output mode
    +	ldi		r18, (1<<DDD7)|(1<<DDD6)|(1<<DDD5)|(1<<DDD4)|(1<<DDD3)|(1<<DDD2)|(1<<DDD1)|(1<<DDD0)
    +	out		DDRD, r18
    +
    +	; Set pins 8-13 to output mode
    +	ldi		r19, (1<<DDB5)|(1<<DDB4)|(1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0)
    +	out		DDRB, r19
    +
    +loop:
    +	rjmp loop ; loop forever
    +
    diff --git a/examples/prism-avisynth.html b/examples/prism-avisynth.html new file mode 100644 index 0000000000..e78fecd9e9 --- /dev/null +++ b/examples/prism-avisynth.html @@ -0,0 +1,24 @@ +

    Full Example

    +
    /*
    + * Example AviSynth script for PrismJS demonstration.
    + * By Zinfidel
    + */
    +
    +SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
    +AddAutoloadDir("MAINSCRIPTDIR/programs/plugins")
    +
    +# Multiplies clip size and changes aspect ratio to 4:3
    +function CorrectAspectRatio(clip c, int scaleFactor, bool "useNearestNeighbor") {
    +    useNearestNeighbor = default(useNearestNeighbor, false)
    +    stretchFactor = (c.Height * (4 / 3)) / c.Width
    +
    +    return useNearestNeighbor \
    +        ? c.PointResize(c.Width * scaleFactor * stretchFactor, c.Height * scaleFactor) \
    +        : c.Lanczos4Resize(c.Width * scaleFactor * stretchFactor, c.Height * scaleFactor)
    +}
    +
    +AviSource("myclip.avi")
    +last.CorrectAspectRatio(3, yes)
    +
    +
    +Prefetch(4)
    \ No newline at end of file diff --git a/examples/prism-avro-idl.html b/examples/prism-avro-idl.html new file mode 100644 index 0000000000..d6572b7130 --- /dev/null +++ b/examples/prism-avro-idl.html @@ -0,0 +1,44 @@ +

    Full example

    +
    // Source: https://avro.apache.org/docs/current/idl.html#example
    +
    +/**
    + * An example protocol in Avro IDL
    + */
    +@namespace("org.apache.avro.test")
    +protocol Simple {
    +
    +	@aliases(["org.foo.KindOf"])
    +	enum Kind {
    +		FOO,
    +		BAR, // the bar enum value
    +		BAZ
    +	}
    +
    +	fixed MD5(16);
    +
    +	record TestRecord {
    +		@order("ignore")
    +		string name;
    +
    +		@order("descending")
    +		Kind kind;
    +
    +		MD5 hash;
    +
    +		union { MD5, null} @aliases(["hash"]) nullableHash;
    +
    +		array<long> arrayOfLongs;
    +	}
    +
    +	error TestError {
    +		string message;
    +	}
    +
    +	string hello(string greeting);
    +	TestRecord echo(TestRecord `record`);
    +	int add(int arg1, int arg2);
    +	bytes echoBytes(bytes data);
    +	void `error`() throws TestError;
    +	void ping() oneway;
    +}
    +
    diff --git a/examples/prism-bicep.html b/examples/prism-bicep.html new file mode 100644 index 0000000000..31a0697021 --- /dev/null +++ b/examples/prism-bicep.html @@ -0,0 +1,19 @@ +

    Variable assignment

    +
    var foo = 'bar'
    + +

    Operators

    +
    (1 + 2 * 3)/4 >= 3 && 4 < 5 || 6 > 7
    + +

    Keywords

    +
    resource appServicePlan 'Microsoft.Web/serverfarms@2020-09-01' existing =  = if (diagnosticsEnabled) {
    +	name: logAnalyticsWsName
    +  }
    +  module cosmosDb './cosmosdb.bicep' = {
    +	name: 'cosmosDbDeploy'
    +  }
    +  param env string
    +  var oneNumber = 123
    +  output databaseName string = cosmosdbDatabaseName
    +  for item in cosmosdbAllowedIpAddresses: {
    +	  ipAddressOrRange: item
    +  }
    diff --git a/examples/prism-birb.html b/examples/prism-birb.html new file mode 100644 index 0000000000..cdc572707d --- /dev/null +++ b/examples/prism-birb.html @@ -0,0 +1,31 @@ +

    Comments

    +
    // Single line comment
    +/* Block comment
    +on multiple lines */
    + +

    Annotations

    +
    <Supersede> // marks an instance member as overriding a superclass
    + +

    Numbers

    +
    int x = 1;
    +double y = 1.1;
    +
    + +

    Strings

    +
    String s1 = 'Strings allow single quotes';
    +String s2 = "as well as double quotes";
    +var s2 = 'Birb strings are
    +	multiline by default';
    + +

    Full example

    +
    class Birb {
    +  final String name;
    +  int age = 19;
    +
    +  void construct(String newName){
    +	nest.name = newName;
    +  }
    +}
    +Birb.construct('Yoko');
    +screm(Birb.name);
    +
    \ No newline at end of file diff --git a/examples/prism-bsl.html b/examples/prism-bsl.html new file mode 100644 index 0000000000..163000b060 --- /dev/null +++ b/examples/prism-bsl.html @@ -0,0 +1,386 @@ +

    Comments

    +
     // This is a 1C:Enterprise comments
    +//
    + +

    Strings and characters

    +
    "This is a 1C:Enterprise string"
    +""
    +"a"
    +"A tabulator character: ""#9"" is easy to embed"
    + +

    Numbers

    +
    123
    +123.456
    +
    + +

    Full example

    +
    ///////////////////////////////////////////////////////////////////////////////////////////////////////
    +// Copyright (c) 2019, ООО 1С-Софт
    +// Все права защищены. Эта программа и сопроводительные материалы предоставляются 
    +// в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0)
    +// Текст лицензии доступен по ссылке:
    +// https://creativecommons.org/licenses/by/4.0/legalcode
    +///////////////////////////////////////////////////////////////////////////////////////////////////////
    +
    +#Область СлужебныеПроцедурыИФункции
    +
    +////////////////////////////////////////////////////////////////////////////////
    +//  Основные процедуры и функции поиска контактов.
    +
    +// Получает представление и всю контактную информацию контакта.
    +//
    +// Параметры:
    +//  Контакт                 - ОпределяемыйТип.КонтактВзаимодействия - контакт для которого получается информация.
    +//  Представление           - Строка - в данный параметр будет помещено полученное представление.
    +//  СтрокаКИ                - Строка - в данный параметр будет помещено полученная контактная информация.
    +//  ТипКонтактнойИнформации - Перечисления.ТипыКонтактнойИнформации - возможность установить отбор по типу получаемой
    +//                                                                    контактной информации.
    +//
    +Процедура ПредставлениеИВсяКонтактнаяИнформациюКонтакта(Контакт, Представление, СтрокаКИ,ТипКонтактнойИнформации = Неопределено) Экспорт
    +	
    +	Представление = "";
    +	СтрокаКИ = "";
    +	Если Не ЗначениеЗаполнено(Контакт) 
    +		ИЛИ ТипЗнч(Контакт) = Тип("СправочникСсылка.СтроковыеКонтактыВзаимодействий") Тогда
    +		Контакт = Неопределено;
    +		Возврат;
    +	КонецЕсли;
    +	
    +	ИмяТаблицы = Контакт.Метаданные().Имя;
    +	ИмяПоляДляНаименованияВладельца = Взаимодействия.ИмяПоляДляНаименованияВладельца(ИмяТаблицы);
    +	
    +	Запрос = Новый Запрос;
    +	Запрос.Текст =
    +	"ВЫБРАТЬ
    +	|	СправочникКонтакт.Наименование          КАК Наименование,
    +	|	" + ИмяПоляДляНаименованияВладельца + " КАК НаименованиеВладельца
    +	|ИЗ
    +	|	Справочник." + ИмяТаблицы + " КАК СправочникКонтакт
    +	|ГДЕ
    +	|	СправочникКонтакт.Ссылка = &Контакт
    +	|";
    +	
    +	Запрос.УстановитьПараметр("Контакт", Контакт);
    +	Запрос.УстановитьПараметр("ТипКонтактнойИнформации", ТипКонтактнойИнформации);
    +	Выборка = Запрос.Выполнить().Выбрать();
    +	Если Не Выборка.Следующий() Тогда
    +		Возврат;
    +	КонецЕсли;
    +	
    +	Представление = Выборка.Наименование;
    +	
    +	Если Не ПустаяСтрока(Выборка.НаименованиеВладельца) Тогда
    +		Представление = Представление + " (" + Выборка.НаименованиеВладельца + ")";
    +	КонецЕсли;
    +	
    +	МассивКонтактов = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Контакт);
    +	ТаблицаКИ = УправлениеКонтактнойИнформацией.КонтактнаяИнформацияОбъектов(МассивКонтактов, ТипКонтактнойИнформации, Неопределено, ТекущаяДатаСеанса());
    +	
    +	Для Каждого СтрокаТаблицы Из ТаблицаКИ Цикл
    +		Если СтрокаТаблицы.Тип <> Перечисления.ТипыКонтактнойИнформации.Другое Тогда
    +			СтрокаКИ = СтрокаКИ + ?(ПустаяСтрока(СтрокаКИ), "", "; ") + СтрокаТаблицы.Представление;
    +		КонецЕсли;
    +	КонецЦикла;
    +	
    +КонецПроцедуры
    +
    +// Получает наименование и адреса электронной почты контакта.
    +//
    +// Параметры:
    +//  Контакт - Ссылка - контакт, для которого получаются данные.
    +//
    +// Возвращаемое значение:
    +//  Структура - содержит наименование контакта и список значений электронной почты контакта.
    +//
    +Функция НаименованиеИАдресаЭлектроннойПочтыКонтакта(Контакт) Экспорт
    +	
    +	Если Не ЗначениеЗаполнено(Контакт) 
    +		Или ТипЗнч(Контакт) = Тип("СправочникСсылка.СтроковыеКонтактыВзаимодействий") Тогда
    +		Возврат Неопределено;
    +	КонецЕсли;
    +	
    +	МетаданныеКонтакта = Контакт.Метаданные();
    +	
    +	Если МетаданныеКонтакта.Иерархический Тогда
    +		Если Контакт.ЭтоГруппа Тогда
    +			Возврат Неопределено;
    +		КонецЕсли;
    +	КонецЕсли;
    +	
    +	МассивОписанияТиповКонтактов = ВзаимодействияКлиентСервер.ОписанияКонтактов();
    +	ЭлементМассиваОписания = Неопределено;
    +	Для Каждого ЭлементМассива Из МассивОписанияТиповКонтактов Цикл
    +		
    +		Если ЭлементМассива.Имя = МетаданныеКонтакта.Имя Тогда
    +			ЭлементМассиваОписания = ЭлементМассива;
    +			Прервать;
    +		КонецЕсли;
    +		
    +	КонецЦикла;
    +	
    +	Если ЭлементМассиваОписания = Неопределено Тогда
    +		Возврат Неопределено;
    +	КонецЕсли;
    +	
    +	ИмяТаблицы = МетаданныеКонтакта.ПолноеИмя();
    +	
    +	ТекстЗапроса =
    +	"ВЫБРАТЬ РАЗРЕШЕННЫЕ РАЗЛИЧНЫЕ
    +	|	ЕСТЬNULL(ТаблицаКонтактнаяИнформация.АдресЭП,"""") КАК АдресЭП,
    +	|	СправочникКонтакт." + ЭлементМассиваОписания.ИмяРеквизитаПредставлениеКонтакта + " КАК Наименование
    +	|ИЗ
    +	|	" + ИмяТаблицы + " КАК СправочникКонтакт
    +	|		ЛЕВОЕ СОЕДИНЕНИЕ " + ИмяТаблицы + ".КонтактнаяИнформация КАК ТаблицаКонтактнаяИнформация
    +	|		ПО (ТаблицаКонтактнаяИнформация.Ссылка = СправочникКонтакт.Ссылка)
    +	|			И (ТаблицаКонтактнаяИнформация.Тип = ЗНАЧЕНИЕ(Перечисление.ТипыКонтактнойИнформации.АдресЭлектроннойПочты))
    +	|ГДЕ
    +	|	СправочникКонтакт.Ссылка = &Контакт
    +	|ИТОГИ ПО
    +	|	Наименование";
    +	
    +	Запрос = Новый Запрос;
    +	Запрос.Текст = ТекстЗапроса;
    +	Запрос.УстановитьПараметр("Контакт", Контакт);
    +	Выборка = Запрос.Выполнить().Выбрать(ОбходРезультатаЗапроса.ПоГруппировкам);
    +	
    +	Если Не Выборка.Следующий() Тогда
    +		Возврат Неопределено;
    +	КонецЕсли;
    +	
    +	Адреса = Новый Структура("Наименование,Адреса", Выборка.Наименование, Новый СписокЗначений);
    +	ВыборкаАдреса = Выборка.Выбрать();
    +	Пока ВыборкаАдреса.Следующий() Цикл
    +		Адреса.Адреса.Добавить(ВыборкаАдреса.АдресЭП);
    +	КонецЦикла;
    +	
    +	Возврат Адреса;
    +	
    +КонецФункции
    +
    +// Получает адреса электронной почты контакта.
    +//
    +// Параметры:
    +//  Контакт - ОпределяемыйТип.КонтактВзаимодействия - контакт, для которого получаются данные.
    +//
    +// Возвращаемое значение:
    +//  Массив - массив структур содержащих адреса, виды и представления адресов.
    +//
    +Функция ПолучитьАдресаЭлектроннойПочтыКонтакта(Контакт, ВключатьНезаполненныеВиды = Ложь) Экспорт
    +	
    +	Если Не ЗначениеЗаполнено(Контакт) Тогда
    +		Возврат Неопределено;
    +	КонецЕсли;
    +	
    +	Запрос = Новый Запрос;
    +	ИмяМетаданныхКонтакта = Контакт.Метаданные().Имя;
    +	
    +	Если ВключатьНезаполненныеВиды Тогда
    +		
    +		Запрос.Текст =
    +		"ВЫБРАТЬ
    +		|	ВидыКонтактнойИнформации.Ссылка КАК Вид,
    +		|	ВидыКонтактнойИнформации.Наименование КАК ВидНаименование,
    +		|	Контакты.Ссылка КАК Контакт
    +		|ПОМЕСТИТЬ КонтактВидыКИ
    +		|ИЗ
    +		|	Справочник.ВидыКонтактнойИнформации КАК ВидыКонтактнойИнформации,
    +		|	Справочник." + ИмяМетаданныхКонтакта + " КАК Контакты
    +		|ГДЕ
    +		|	ВидыКонтактнойИнформации.Родитель = &ГруппаВидаКонтактнойИнформации
    +		|	И Контакты.Ссылка = &Контакт
    +		|	И ВидыКонтактнойИнформации.Тип = ЗНАЧЕНИЕ(Перечисление.ТипыКонтактнойИнформации.АдресЭлектроннойПочты)
    +		|;
    +		|
    +		|////////////////////////////////////////////////////////////////////////////////
    +		|ВЫБРАТЬ
    +		|	Представление(КонтактВидыКИ.Контакт) КАК Представление,
    +		|	ЕСТЬNULL(КонтактнаяИнформация.АдресЭП, """") КАК АдресЭП,
    +		|	КонтактВидыКИ.Вид,
    +		|	КонтактВидыКИ.ВидНаименование
    +		|ИЗ
    +		|	КонтактВидыКИ КАК КонтактВидыКИ
    +		|		ЛЕВОЕ СОЕДИНЕНИЕ Справочник." + ИмяМетаданныхКонтакта + ".КонтактнаяИнформация КАК КонтактнаяИнформация
    +		|		ПО (КонтактнаяИнформация.Ссылка = КонтактВидыКИ.Контакт)
    +		|			И (КонтактнаяИнформация.Вид = КонтактВидыКИ.Вид)";
    +		
    +		ГруппаВидаКонтактнойИнформации = УправлениеКонтактнойИнформацией.ВидКонтактнойИнформацииПоИмени("Справочник" + ИмяМетаданныхКонтакта);
    +		Запрос.УстановитьПараметр("ГруппаВидаКонтактнойИнформации", ГруппаВидаКонтактнойИнформации);
    +	Иначе
    +		
    +		Запрос.Текст =
    +		"ВЫБРАТЬ
    +		|	Таблицы.АдресЭП,
    +		|	Таблицы.Вид,
    +		|	Таблицы.Представление,
    +		|	Таблицы.Вид.Наименование КАК ВидНаименование
    +		|ИЗ
    +		|	Справочник." + ИмяМетаданныхКонтакта + ".КонтактнаяИнформация КАК Таблицы
    +		|ГДЕ
    +		|	Таблицы.Ссылка = &Контакт
    +		|	И Таблицы.Тип = ЗНАЧЕНИЕ(Перечисление.ТипыКонтактнойИнформации.АдресЭлектроннойПочты)";
    +		
    +	КонецЕсли;
    +	
    +	Запрос.УстановитьПараметр("Контакт", Контакт);
    +	
    +	Выборка = Запрос.Выполнить().Выбрать();
    +	Если Выборка.Количество() = 0 Тогда
    +		Возврат Новый Массив;
    +	КонецЕсли;
    +	
    +	Результат = Новый Массив;
    +	Пока Выборка.Следующий() Цикл
    +		Адрес = Новый Структура;
    +		Адрес.Вставить("АдресЭП",         Выборка.АдресЭП);
    +		Адрес.Вставить("Вид",             Выборка.Вид);
    +		Адрес.Вставить("Представление",   Выборка.Представление);
    +		Адрес.Вставить("ВидНаименование", Выборка.ВидНаименование);
    +		Результат.Добавить(Адрес);
    +	КонецЦикла;
    +	
    +	Возврат Результат;
    +	
    +КонецФункции
    +
    +Функция ОтправитьПолучитьПочтуПользователяВФоне(УникальныйИдентификатор) Экспорт
    +	
    +	ПараметрыПроцедуры = Новый Структура;
    +	
    +	ПараметрыВыполнения = ДлительныеОперации.ПараметрыВыполненияВФоне(УникальныйИдентификатор);
    +	ПараметрыВыполнения.НаименованиеФоновогоЗадания = НСтр("ru = 'Получение и отправка электронной почты пользователя'");
    +	
    +	ДлительнаяОперация = ДлительныеОперации.ВыполнитьВФоне("УправлениеЭлектроннойПочтой.ОтправитьЗагрузитьПочтуПользователя",
    +		ПараметрыПроцедуры,	ПараметрыВыполнения);
    +	Возврат ДлительнаяОперация;
    +	
    +КонецФункции
    +
    +////////////////////////////////////////////////////////////////////////////////
    +//  Прочее
    +
    +// Устанавливает предмет для массива взаимодействий.
    +//
    +// Параметры:
    +//  МассивВзаимодействий - Массив - массив взаимодействий для которых будет установлен предмет.
    +//  Предмет  - Ссылка - предмет, на который будет выполнена замена.
    +//  ПроверятьНаличиеДругихЦепочек - Булево - если Истина, то будет выполнена замена предмета и для взаимодействий,
    +//                                           которые входят в  цепочки взаимодействий первым взаимодействием которых
    +//                                           является взаимодействие входящее в массив.
    +//
    +Процедура УстановитьПредметДляМассиваВзаимодействий(МассивВзаимодействий, Предмет, ПроверятьНаличиеДругихЦепочек = Ложь) Экспорт
    +
    +	Если ПроверятьНаличиеДругихЦепочек Тогда
    +		
    +		Запрос = Новый Запрос;
    +		Запрос.Текст = "ВЫБРАТЬ РАЗЛИЧНЫЕ
    +		|	ПредметыВзаимодействий.Взаимодействие КАК Ссылка
    +		|ИЗ
    +		|	РегистрСведений.ПредметыПапкиВзаимодействий КАК ПредметыВзаимодействий
    +		|ГДЕ
    +		|	НЕ (НЕ ПредметыВзаимодействий.Предмет В (&МассивВзаимодействий)
    +		|			И НЕ ПредметыВзаимодействий.Взаимодействие В (&МассивВзаимодействий))";
    +		
    +		Запрос.УстановитьПараметр("МассивВзаимодействий", МассивВзаимодействий);
    +		МассивВзаимодействий = Запрос.Выполнить().Выгрузить().ВыгрузитьКолонку("Ссылка");
    +		
    +	КонецЕсли;
    +	
    +	НачатьТранзакцию();
    +	Попытка
    +		Блокировка = Новый БлокировкаДанных;
    +		РегистрыСведений.ПредметыПапкиВзаимодействий.ЗаблокироватьПредметыПапокВзаимодействий(Блокировка, МассивВзаимодействий);
    +		Блокировка.Заблокировать();
    +		
    +		Если ТипЗнч(Предмет) = Тип("РегистрСведенийКлючЗаписи.СостоянияПредметовВзаимодействий") Тогда
    +			Предмет = Предмет.Предмет;
    +		КонецЕсли;
    +		
    +		Запрос = Новый Запрос;
    +		Запрос.Текст = "ВЫБРАТЬ РАЗЛИЧНЫЕ
    +		|	ПредметыПапкиВзаимодействий.Предмет
    +		|ИЗ
    +		|	РегистрСведений.ПредметыПапкиВзаимодействий КАК ПредметыПапкиВзаимодействий
    +		|ГДЕ
    +		|	ПредметыПапкиВзаимодействий.Взаимодействие В(&МассивВзаимодействий)
    +		|
    +		|ОБЪЕДИНИТЬ ВСЕ
    +		|
    +		|ВЫБРАТЬ
    +		|	&Предмет";
    +		
    +		Запрос.УстановитьПараметр("Предмет", Предмет);
    +		Запрос.УстановитьПараметр("МассивВзаимодействий", МассивВзаимодействий);
    +		
    +		ВыборкаПредметы = Запрос.Выполнить().Выбрать();
    +		
    +		Для Каждого Взаимодействие Из МассивВзаимодействий Цикл
    +			Взаимодействия.УстановитьПредмет(Взаимодействие, Предмет, Ложь);
    +		КонецЦикла;
    +		
    +		Взаимодействия.РассчитатьРассмотреноПоПредметам(Взаимодействия.ТаблицаДанныхДляРасчетаРассмотрено(ВыборкаПредметы, "Предмет"));
    +		ЗафиксироватьТранзакцию();
    +	Исключение
    +		ОтменитьТранзакцию();
    +		ВызватьИсключение;
    +	КонецПопытки;	
    +КонецПроцедуры
    +
    +// Преобразует письмо в двоичные данные и подготавливает к сохранению на диск.
    +//
    +// Параметры:
    +//  Письмо                  - ДокументСсылка.ЭлектронноеПисьмоВходящее,
    +//                            ДокументСсылка.ЭлектронноеПисьмоИсходящее - письмо, которое подготавливается к сохранению.
    +//  УникальныйИдентификатор - УникальныйИдентификатор - уникальный идентификатор формы, из которой была вызвана команда сохранения.
    +//
    +// Возвращаемое значение:
    +//  Структура - структура, содержащая подготовленные данные письма.
    +//
    +Функция ДанныеПисьмаДляСохраненияКакФайл(Письмо, УникальныйИдентификатор) Экспорт
    +
    +	ДанныеФайла = СтруктураДанныхФайла();
    +	
    +	ДанныеПисьма = Взаимодействия.ИнтернетПочтовоеСообщениеИзПисьма(Письмо);
    +	Если ДанныеПисьма <> Неопределено Тогда
    +		
    +		ДвоичныеДанные = ДанныеПисьма.ИнтернетПочтовоеСообщение.ПолучитьИсходныеДанные();
    +		ДанныеФайла.СсылкаНаДвоичныеДанныеФайла = ПоместитьВоВременноеХранилище(ДвоичныеДанные, УникальныйИдентификатор);
    +
    +		ДанныеФайла.Наименование = Взаимодействия.ПредставлениеПисьма(ДанныеПисьма.ИнтернетПочтовоеСообщение.Тема,
    +			ДанныеПисьма.ДатаПисьма);
    +		
    +		ДанныеФайла.Расширение  = "eml";
    +		ДанныеФайла.ИмяФайла    = ДанныеФайла.Наименование + "." + ДанныеФайла.Расширение;
    +		ДанныеФайла.Размер      = ДвоичныеДанные.Размер();
    +		ПапкаДляСохранитьКак = ОбщегоНазначения.ХранилищеОбщихНастроекЗагрузить("НастройкиПрограммы", "ПапкаДляСохранитьКак");
    +		ДанныеФайла.Вставить("ПапкаДляСохранитьКак", ПапкаДляСохранитьКак);
    +		ДанныеФайла.ДатаМодификацииУниверсальная = ТекущаяДатаСеанса();
    +		ДанныеФайла.ПолноеНаименованиеВерсии = ДанныеФайла.ИмяФайла;
    +		
    +	КонецЕсли;
    +	
    +	Возврат ДанныеФайла;
    +
    +КонецФункции
    +
    +Функция СтруктураДанныхФайла()
    +
    +	СтруктураДанныхФайла = Новый Структура;
    +	СтруктураДанныхФайла.Вставить("СсылкаНаДвоичныеДанныеФайла",        "");
    +	СтруктураДанныхФайла.Вставить("ОтносительныйПуть",                  "");
    +	СтруктураДанныхФайла.Вставить("ДатаМодификацииУниверсальная",       Дата(1, 1, 1));
    +	СтруктураДанныхФайла.Вставить("ИмяФайла",                           "");
    +	СтруктураДанныхФайла.Вставить("Наименование",                       "");
    +	СтруктураДанныхФайла.Вставить("Расширение",                         "");
    +	СтруктураДанныхФайла.Вставить("Размер",                             "");
    +	СтруктураДанныхФайла.Вставить("Редактирует",                        Неопределено);
    +	СтруктураДанныхФайла.Вставить("ПодписанЭП",                         Ложь);
    +	СтруктураДанныхФайла.Вставить("Зашифрован",                         Ложь);
    +	СтруктураДанныхФайла.Вставить("ФайлРедактируется",                  Ложь);
    +	СтруктураДанныхФайла.Вставить("ФайлРедактируетТекущийПользователь", Ложь);
    +	СтруктураДанныхФайла.Вставить("ПолноеНаименованиеВерсии",           "");
    +	
    +	Возврат СтруктураДанныхФайла;
    +
    +КонецФункции 
    +
    +#КонецОбласти
    \ No newline at end of file diff --git a/examples/prism-cfscript.html b/examples/prism-cfscript.html new file mode 100644 index 0000000000..6a0a771bb0 --- /dev/null +++ b/examples/prism-cfscript.html @@ -0,0 +1,43 @@ +

    Comments

    +
    // This is a comment
    +
    +/* This is a comment
    +on multiple lines */
    +
    +/**
    +* This is a Javadoc style comment
    +*
    +* @hint This is an annotation
    +*/
    +
    + +

    Functions

    +
    public boolean function myFunc(required any arg) {
    +  return true;
    +}
    + +

    Full example

    +
    component accessors="true" {
    +  property type="string" name="prop1" default="";
    +  property string prop2;
    +  function init(){
    +    this.prop3 = 12;
    +    return this;
    +  }
    +
    +  /**
    +  * @hint Annotations supported
    +  * @foo.hint
    +  */
    +  public any function build( required foo, color="blue", boolean bar=true ){
    +    arguments.foo = {
    +      'name' : "something",
    +      test = true
    +    }
    +    var foobar = function( required string baz, x=true, y=false ){
    +      return "bar!";
    +    };
    +    return foo;
    +  }
    +}
    +
    diff --git a/examples/prism-chaiscript.html b/examples/prism-chaiscript.html new file mode 100644 index 0000000000..a167d39a49 --- /dev/null +++ b/examples/prism-chaiscript.html @@ -0,0 +1,56 @@ +

    Full example

    +
    // http://chaiscript.com/examples.html#ChaiScript_Language_Examples
    +// Source: https://gist.github.com/lefticus/cf058f2927fef68d58e0#file-chaiscript_overview-chai
    +
    +// ChaiScript supports the normal kind of control blocks you've come to expect from
    +// C++ and JavaScript
    +
    +
    +if (5 > 2) {
    +  print("Yup, 5 > 2");
    +} else if (2 > 5) {
    +  // never gonna happen
    +} else {
    +  // really not going to happen
    +}
    +
    +var x = true;
    +
    +while (x)
    +{
    +  print("x was true")
    +  x = false;
    +}
    +
    +for (var i = 1; i < 10; ++i)
    +{
    +  print(i); // prints 1 through 9
    +}
    +
    +
    +// function definition
    +
    +def myFunc(x) {
    +  print(x);
    +}
    +
    +// function definition with function guards
    +def myFunc(x) : x > 2 && x < 5 {
    +  print(to_string(x) + " is between 2 and 5")
    +}
    +
    +def myFunc(x) : x >= 5 {
    +  print(t_string(x) + " is greater than or equal to 5")
    +}
    +
    +myFunc(3)
    +
    +// ChaiScript also supports in string evaluation, which C++ does not
    +
    +print("${3 + 5} is 8");
    +
    +// And dynamic code evaluation
    +
    +var value = eval("4 + 2 + 12");
    +
    +// value is equal to 18
    diff --git a/examples/prism-cobol.html b/examples/prism-cobol.html new file mode 100644 index 0000000000..c807cf10c8 --- /dev/null +++ b/examples/prism-cobol.html @@ -0,0 +1,26 @@ +

    Full example

    +
           *> https://en.wikipedia.org/w/index.php?title=COBOL&oldid=1011483106
    +       RD  sales-report
    +           PAGE LIMITS 60 LINES
    +           FIRST DETAIL 3
    +           CONTROLS seller-name.
    +
    +       01  TYPE PAGE HEADING.
    +           03  COL 1                    VALUE "Sales Report".
    +           03  COL 74                   VALUE "Page".
    +           03  COL 79                   PIC Z9 SOURCE PAGE-COUNTER.
    +
    +       01  sales-on-day TYPE DETAIL, LINE + 1.
    +           03  COL 3                    VALUE "Sales on".
    +           03  COL 12                   PIC 99/99/9999 SOURCE sales-date.
    +           03  COL 21                   VALUE "were".
    +           03  COL 26                   PIC $$$$9.99 SOURCE sales-amount.
    +
    +       01  invalid-sales TYPE DETAIL, LINE + 1.
    +           03  COL 3                    VALUE "INVALID RECORD:".
    +           03  COL 19                   PIC X(34) SOURCE sales-record.
    +
    +       01  TYPE CONTROL HEADING seller-name, LINE + 2.
    +           03  COL 1                    VALUE "Seller:".
    +           03  COL 9                    PIC X(30) SOURCE seller-name.
    +
    diff --git a/examples/prism-coq.html b/examples/prism-coq.html new file mode 100644 index 0000000000..1e9b51db32 --- /dev/null +++ b/examples/prism-coq.html @@ -0,0 +1,45 @@ +

    Full example

    +
    (* Source: https://coq.inria.fr/a-short-introduction-to-coq *)
    +
    +Inductive seq : nat -> Set :=
    +| niln : seq 0
    +| consn : forall n : nat, nat -> seq n -> seq (S n).
    +
    +Fixpoint length (n : nat) (s : seq n) {struct s} : nat :=
    +  match s with
    +  | niln => 0
    +  | consn i _ s' => S (length i s')
    +  end.
    +
    +Theorem length_corr : forall (n : nat) (s : seq n), length n s = n.
    +Proof.
    +  intros n s.
    +
    +  (* reasoning by induction over s. Then, we have two new goals
    +     corresponding on the case analysis about s (either it is
    +     niln or some consn *)
    +  induction s.
    +
    +    (* We are in the case where s is void. We can reduce the
    +       term: length 0 niln *)
    +    simpl.
    +
    +    (* We obtain the goal 0 = 0. *)
    +    trivial.
    +
    +    (* now, we treat the case s = consn n e s with induction
    +       hypothesis IHs *)
    +    simpl.
    +
    +    (* The induction hypothesis has type length n s = n.
    +       So we can use it to perform some rewriting in the goal: *)
    +    rewrite IHs.
    +
    +    (* Now the goal is the trivial equality: S n = S n *)
    +    trivial.
    +
    +  (* Now all sub cases are closed, we perform the ultimate
    +     step: typing the term built using tactics and save it as
    +     a witness of the theorem. *)
    +Qed.
    +
    diff --git a/examples/prism-cshtml.html b/examples/prism-cshtml.html new file mode 100644 index 0000000000..cc11eeb9ae --- /dev/null +++ b/examples/prism-cshtml.html @@ -0,0 +1,36 @@ +

    Full example

    +
    @* Source: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio#the-home-page *@
    +
    +@page
    +@model RazorPagesContacts.Pages.Customers.IndexModel
    +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
    +
    +<h1>Contacts home page</h1>
    +<form method="post">
    +	<table class="table">
    +		<thead>
    +			<tr>
    +				<th>ID</th>
    +				<th>Name</th>
    +				<th></th>
    +			</tr>
    +		</thead>
    +		<tbody>
    +			@foreach (var contact in Model.Customer)
    +			{
    +				<tr>
    +					<td> @contact.Id  </td>
    +					<td>@contact.Name</td>
    +					<td>
    +						<a asp-page="./Edit" asp-route-id="@contact.Id">Edit</a> |
    +						<button type="submit" asp-page-handler="delete"
    +								asp-route-id="@contact.Id">delete
    +						</button>
    +					</td>
    +				</tr>
    +			}
    +		</tbody>
    +	</table>
    +	<a asp-page="Create">Create New</a>
    +</form>
    +
    diff --git a/examples/prism-csv.html b/examples/prism-csv.html new file mode 100644 index 0000000000..cbba8d9dcc --- /dev/null +++ b/examples/prism-csv.html @@ -0,0 +1,7 @@ +

    Full example

    +
    Year,Make,Model,Description,Price
    +1997,Ford,E350,"ac, abs, moon",3000.00
    +1999,Chevy,"Venture ""Extended Edition""","",4900.00
    +1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00
    +1996,Jeep,Grand Cherokee,"MUST SELL!
    +air, moon roof, loaded",4799.00
    diff --git a/examples/prism-dataweave.html b/examples/prism-dataweave.html new file mode 100644 index 0000000000..f66a2da7d2 --- /dev/null +++ b/examples/prism-dataweave.html @@ -0,0 +1,39 @@ +

    Full example

    +
    
    +%dw 2.0
    +input payalod application/json
    +ns ns0 http://localhost.com
    +var a = 123
    +type T = String
    +fun test(a: Number) = a + 123
    +output application/json
    +---
    +{
    +    // This is a comment
    +    /**
    +    This is a multiline comment
    +    **/
    +    name: payload.name,
    +    string: "this",
    +    'another string': true,
    +    "regex": /123/,
    +    fc: test(1),
    +    "dates": |12-12-2020-T12:00:00|,
    +    number: 123,
    +    "null": null,
    +
    +    a: {} match {
    +        case  is {} -> foo.name
    +    },
    +    b: {} update {
    +    case name at .user.name ->  "123"
    +    },
    +    stringMultiLine: "This is a multiline
    +        string
    +    ",
    +    a: if( !true > 2) a else 2,
    +    b: do {
    +            {}
    +        }
    +}
    +
    diff --git a/examples/prism-dot.html b/examples/prism-dot.html new file mode 100644 index 0000000000..21af68c8f3 --- /dev/null +++ b/examples/prism-dot.html @@ -0,0 +1,31 @@ +

    Full example

    +
    // source: http://www.ryandesign.com/canviz/graphs/dot/directed/ctext.gv.txt
    +# Generated Tue Aug 21 10:21:21 GMT 2007 by dot - Graphviz version 2.15.20070819.0440 (Tue Aug 21 09:56:32 GMT 2007)
    +#
    +#
    +# real	0m0.105s
    +# user	0m0.076s
    +# sys	0m0.022s
    +
    +digraph G {
    +	node [label="\N"];
    +	graph [bb="0,0,352,238",
    +		_draw_="c 5 -white C 5 -white P 4 0 0 0 238 352 238 352 0 ",
    +		xdotversion="1.2"];
    +	xyz [label="hello\nworld", color=slateblue, fontsize=24, fontname="Palatino-Italic", style=filled, fontcolor=hotpink, pos="67,191", width="1.64", height="1.29", _draw_="S 6 -filled c 9 -slateblue C 9 -slateblue E 67 191 59 47 ", _ldraw_="F 24.000000 15 -Palatino-Italic c 7 -hotpink T 67 196 0 65 5 -hello F 24.000000 15 -Palatino-Italic c 7 -hotpink T 67 167 0 75 5\
    + -world "];
    +	red [color=red, style=filled, pos="171,191", width="0.75", height="0.50", _draw_="S 6 -filled c 3 -red C 3 -red E 171 191 27 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 171 186 0 24 3 -red "];
    +	green [color=green, style=filled, pos="128,90", width="0.92", height="0.50", _draw_="S 6 -filled c 5 -green C 5 -green E 128 90 33 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 128 85 0 41 5 -green "];
    +	blue [color=blue, style=filled, fontcolor=black, pos="214,90", width="0.78", height="0.50", _draw_="S 6 -filled c 4 -blue C 4 -blue E 214 90 28 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 214 85 0 31 4 -blue "];
    +	cyan [color=cyan, style=filled, pos="214,18", width="0.83", height="0.50", _draw_="S 6 -filled c 4 -cyan C 4 -cyan E 214 18 30 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 214 13 0 34 4 -cyan "];
    +	magenta [color=magenta, style=filled, pos="307,18", width="1.25", height="0.50", _draw_="S 6 -filled c 7 -magenta C 7 -magenta E 307 18 45 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 307 13 0 64 7 -magenta "];
    +	yellow [color=yellow, style=filled, pos="36,18", width="1.00", height="0.50", _draw_="S 6 -filled c 6 -yellow C 6 -yellow E 36 18 36 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 36 13 0 47 6 -yellow "];
    +	orange [color=orange, style=filled, pos="128,18", width="1.06", height="0.50", _draw_="S 6 -filled c 6 -orange C 6 -orange E 128 18 38 18 ", _ldraw_="F 14.000000 11 -Times-Roman c 5 -black T 128 13 0 51 6 -orange "];
    +	red -> green [pos="e,136,108 164,173 157,158 147,135 140,118", _draw_="c 5 -black B 4 164 173 157 158 147 135 140 118 ", _hdraw_="S 5 -solid S 15 -setlinewidth(1) c 5 -black C 5 -black P 3 143 116 136 108 136 119 "];
    +	red -> blue [pos="e,206,108 178,173 185,158 195,135 202,118", _draw_="c 5 -black B 4 178 173 185 158 195 135 202 118 ", _hdraw_="S 5 -solid S 15 -setlinewidth(1) c 5 -black C 5 -black P 3 206 119 206 108 199 116 "];
    +	blue -> cyan [pos="e,214,36 214,72 214,64 214,55 214,46", _draw_="c 5 -black B 4 214 72 214 64 214 55 214 46 ", _hdraw_="S 5 -solid S 15 -setlinewidth(1) c 5 -black C 5 -black P 3 218 46 214 36 211 46 "];
    +	blue -> magenta [pos="e,286,34 232,76 246,66 263,52 278,40", _draw_="c 5 -black B 4 232 76 246 66 263 52 278 40 ", _hdraw_="S 5 -solid S 15 -setlinewidth(1) c 5 -black C 5 -black P 3 280 43 286 34 276 37 "];
    +	green -> yellow [pos="e,56,33 109,75 96,65 78,51 64,40", _draw_="c 5 -black B 4 109 75 96 65 78 51 64 40 ", _hdraw_="S 5 -solid S 15 -setlinewidth(1) c 5 -black C 5 -black P 3 66 37 56 33 61 42 "];
    +	green -> orange [pos="e,128,36 128,72 128,64 128,55 128,46", _draw_="c 5 -black B 4 128 72 128 64 128 55 128 46 ", _hdraw_="S 5 -solid S 15 -setlinewidth(1) c 5 -black C 5 -black P 3 132 46 128 36 125 46 "];
    +}
    +
    diff --git a/examples/prism-false.html b/examples/prism-false.html new file mode 100644 index 0000000000..cbc3bc6d0a --- /dev/null +++ b/examples/prism-false.html @@ -0,0 +1,52 @@ +

    Hello, world!

    + +
    "Hello, world!"
    + +

    Lambda functions

    + +

    Increment

    + +
    5 [7+]! . {Outputs 12.}
    + +

    Square numbers

    + +
    [$*] s: 7s;! . {Outputs 49.}
    + +

    Conditions

    + +

    Equal, less, or greater than

    + +
    5x:
    +7y:
    +x;y;=
    +$
    +x;
    +.
    +[" equals "]?
    +~[
    +    x;y;>
    +    $
    +    [" is greater than "]?
    +    ~[" is less than "]?
    +]?
    +y;
    +.
    + +

    Loops

    + +

    English alphabet

    + +
    'Ai: 'Zm: 1m;+ m: [m;i;>][i;, 1i;+ i:]#
    + +

    Ten Green Bottles

    + +
    [$ . " green bottle" 1> ["s"]? ".
    +"] f:
    +10n: [n;0>][n;f;! n;1- n:]#
    + +

    User input

    + +

    Reverse a string

    + +
    "Enter the string character by character (or a space to finish):
    +"0i: [ß ^ $ 32=~][i;1+ i:]# % "Reverse: " [i;0>][, i;1- i:]#
    diff --git a/examples/prism-gap.html b/examples/prism-gap.html new file mode 100644 index 0000000000..01e3f08cd7 --- /dev/null +++ b/examples/prism-gap.html @@ -0,0 +1,15 @@ +

    Full example

    +
    # Source: https://www.gap-system.org/Manuals/doc/ref/chap4.html#X815F71EA7BC0EB6F
    +gap> fib := function ( n )
    +>     local f1, f2, f3, i;
    +>     f1 := 1; f2 := 1;
    +>     for i in [3..n] do
    +>       f3 := f1 + f2;
    +>       f1 := f2;
    +>       f2 := f3;
    +>     od;
    +>     return f2;
    +>   end;;
    +gap> List( [1..10], fib );
    +[ 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ]
    +
    diff --git a/examples/prism-gn.html b/examples/prism-gn.html new file mode 100644 index 0000000000..d0a7fa7200 --- /dev/null +++ b/examples/prism-gn.html @@ -0,0 +1,24 @@ +

    Full example

    +
    # Source: https://gn.googlesource.com/gn/+/main/docs/cross_compiles.md
    +
    +declare_args() {
    +  # Applies only to toolchains targeting target_cpu.
    +  sysroot = ""
    +}
    +
    +config("my_config") {
    +  # Uses current_cpu because compile flags are toolchain-dependent.
    +  if (current_cpu == "arm") {
    +    defines = [ "CPU_IS_32_BIT" ]
    +  } else {
    +    defines = [ "CPU_IS_64_BIT" ]
    +  }
    +  # Compares current_cpu with target_cpu to see whether current_toolchain
    +  # has the same architecture as target_toolchain.
    +  if (sysroot != "" && current_cpu == target_cpu) {
    +    cflags = [
    +      "-isysroot",
    +      sysroot,
    +    ]
    +  }
    +}
    diff --git a/examples/prism-go-module.html b/examples/prism-go-module.html new file mode 100644 index 0000000000..52855d457b --- /dev/null +++ b/examples/prism-go-module.html @@ -0,0 +1,15 @@ +

    Full example

    +
    // Source: https://go.dev/doc/modules/gomod-ref#example
    +
    +module example.com/mymodule
    +
    +go 1.14
    +
    +require (
    +    example.com/othermodule v1.2.3
    +    example.com/thismodule v1.2.3
    +    example.com/thatmodule v1.2.3
    +)
    +
    +replace example.com/thatmodule => ../thatmodule
    +exclude example.com/thismodule v1.3.0
    diff --git a/examples/prism-hoon.html b/examples/prism-hoon.html new file mode 100644 index 0000000000..6d45086c44 --- /dev/null +++ b/examples/prism-hoon.html @@ -0,0 +1,17 @@ +

    Caesar cipher

    + +
    |= [a=@ b=tape]
    +^- tape
    +?: (gth a 25)
    +$(a (sub a 26))
    +%+ turn b
    +|= c=@tD
    +?: &((gte c 'A') (lte c 'Z'))
    +=. c (add c a)
    +?. (gth c 'Z') c
    +(sub c 26)
    +?: &((gte c 'a') (lte c 'z'))
    +=. c (add c a)
    +?. (gth c 'z') c
    +(sub c 26)
    +c
    \ No newline at end of file diff --git a/examples/prism-icu-message-format.html b/examples/prism-icu-message-format.html new file mode 100644 index 0000000000..691aa47e21 --- /dev/null +++ b/examples/prism-icu-message-format.html @@ -0,0 +1,22 @@ +

    Full example

    +
    https://unicode-org.github.io/icu/userguide/format_parse/messages/
    +
    +{gender_of_host, select,
    +  female {
    +    {num_guests, plural, offset:1
    +      =0 {{host} does not give a party.}
    +      =1 {{host} invites {guest} to her party.}
    +      =2 {{host} invites {guest} and one other person to her party.}
    +      other {{host} invites {guest} and # other people to her party.}}}
    +  male {
    +    {num_guests, plural, offset:1
    +      =0 {{host} does not give a party.}
    +      =1 {{host} invites {guest} to his party.}
    +      =2 {{host} invites {guest} and one other person to his party.}
    +      other {{host} invites {guest} and # other people to his party.}}}
    +  other {
    +    {num_guests, plural, offset:1
    +      =0 {{host} does not give a party.}
    +      =1 {{host} invites {guest} to their party.}
    +      =2 {{host} invites {guest} and one other person to their party.}
    +      other {{host} invites {guest} and # other people to their party.}}}}
    diff --git a/examples/prism-idris.html b/examples/prism-idris.html new file mode 100644 index 0000000000..558f1fa8ca --- /dev/null +++ b/examples/prism-idris.html @@ -0,0 +1,56 @@ +

    Comments

    +
    -- Single line comment
    +{- Multi-line
    +comment -}
    + +

    Strings and characters

    +
    'a'
    +'\n'
    +'\^A'
    +'\^]'
    +'\NUL'
    +'\23'
    +'\o75'
    +'\xFE'
    + +

    Numbers

    +
    42
    +123.456
    +123.456e-789
    +1e+3
    +0o74
    +0XAF
    + +

    Larger example

    +
    module Main
    +
    +import Data.Vect
    +
    +-- this is comment
    +record Person where
    +  constructor MkPerson2
    +  age : Integer
    +  name : String
    +
    +||| identity function
    +id : a -> a
    +id x = x
    +
    +{-
    +Bool type can be defined in
    +userland
    +-}
    +data Bool = True | False
    +
    +implementation Show Bool where
    +  show True = "True"
    +  show False = "False"
    +
    +not : Bool -> Bool
    +not b = case b of
    +          True  => False
    +          False => True
    +
    +vect3 : Vect 3 Int
    +vect3 = with Vect (1 :: 2 :: 3 :: Nil)
    +
    diff --git a/examples/prism-jexl.html b/examples/prism-jexl.html new file mode 100644 index 0000000000..0c5a77e916 --- /dev/null +++ b/examples/prism-jexl.html @@ -0,0 +1,8 @@ +

    Full example

    +
    
    +[
    +  fun(1,2),
    +  { obj: "1" }.obj,
    +  ctx|transform
    +]|join(", ")
    +
    diff --git a/examples/prism-js-templates.html b/examples/prism-js-templates.html index 2fc947aa76..e1fd09dc6c 100644 --- a/examples/prism-js-templates.html +++ b/examples/prism-js-templates.html @@ -1,25 +1,25 @@

    HTML template literals

    -
    html`
    +
    html`
     <p>
     	Foo.
     </p>`;

    JS DOM

    -
    div.innerHTML = `<p></p>`;
    +
    div.innerHTML = `<p></p>`;
     div.outerHTML = `<p></p>`;

    styled-jsx CSS template literals

    -
    css`a:hover { color: blue; }`;
    +
    css`a:hover { color: blue; }`;

    styled-components CSS template literals

    -
    const Button = styled.button`
    +
    const Button = styled.button`
     	color: blue;
     	background: red;
     `;

    Markdown template literals

    -
    markdown`# My title`;
    +
    markdown`# My title`;

    GraphQL template literals

    -
    gql`{ foo }`;
    +
    gql`{ foo }`;
     graphql`{ foo }`;
    diff --git a/examples/prism-keepalived.html b/examples/prism-keepalived.html new file mode 100644 index 0000000000..c8bc961c8f --- /dev/null +++ b/examples/prism-keepalived.html @@ -0,0 +1,130 @@ +

    A example from keepalived document

    +
    
    +# Configuration File for keepalived
    +global_defs {
    +    notification_email {
    +        admin@domain.com
    +        0633225522@domain.com
    +    }
    +    notification_email_from keepalived@domain.com
    +    smtp_server 192.168.200.20
    +    smtp_connect_timeout 30
    +    router_id LVS_MAIN
    +}
    +
    +# VRRP Instances definitions
    +vrrp_instance VI_1 {
    +    state MASTER
    +    interface eth0
    +    virtual_router_id 51
    +    priority 150
    +    advert_int 1
    +    authentication {
    +        auth_type PASS
    +        auth_pass k@l!ve1
    +    }
    +    virtual_ipaddress {
    +        192.168.200.10
    +        192.168.200.11
    +    }
    +}
    +vrrp_instance VI_2 {
    +    state MASTER
    +    interface eth1
    +    virtual_router_id 52
    +    priority 150
    +    advert_int 1
    +    authentication {
    +        auth_type PASS
    +        auth_pass k@l!ve2
    +    }
    +    virtual_ipaddress {
    +        192.168.100.10
    +    }
    +}
    +vrrp_instance VI_3 {
    +    state BACKUP
    +    interface eth0
    +    virtual_router_id 53
    +    priority 100
    +    advert_int 1
    +    authentication {
    +        auth_type PASS
    +        auth_pass k@l!ve3
    +    }
    +    virtual_ipaddress {
    +        192.168.200.12
    +        192.168.200.13
    +    }
    +}
    +vrrp_instance VI_4 {
    +    state BACKUP
    +    interface eth1
    +    virtual_router_id 54
    +    priority 100
    +    advert_int 1
    +    authentication {
    +        auth_type PASS
    +        auth_pass k@l!ve4
    +    }
    +    virtual_ipaddress {
    +        192.168.100.11
    +    }
    +}
    +# Virtual Servers definitions
    +virtual_server 192.168.200.10 80 {
    +    delay_loop 30
    +    lb_algo wrr
    +    lb_kind NAT
    +    persistence_timeout 50
    +    protocol TCP
    +    sorry_server 192.168.100.100 80
    +    real_server 192.168.100.2 80 {
    +        weight 2
    +        HTTP_GET {
    +            url {
    +                path /testurl/test.jsp
    +                digest ec90a42b99ea9a2f5ecbe213ac9eba03
    +            }
    +            url {
    +                path /testurl2/test.jsp
    +                digest 640205b7b0fc66c1ea91c463fac6334c
    +            }
    +            connect_timeout 3
    +            retry 3
    +            delay_before_retry 2
    +        }
    +    }
    +    real_server 192.168.100.3 80 {
    +        weight 1
    +        HTTP_GET {
    +            url {
    +                path /testurl/test.jsp
    +                digest 640205b7b0fc66c1ea91c463fac6334c
    +            }
    +            connect_timeout 3
    +            retry 3
    +            delay_before_retry 2
    +        }
    +    }
    +}
    +virtual_server 192.168.200.12 443 {
    +    delay_loop 20
    +    lb_algo rr
    +    lb_kind NAT
    +    persistence_timeout 360
    +    protocol TCP
    +    real_server 192.168.100.2 443 {
    +        weight 1
    +        TCP_CHECK {
    +            connect_timeout 3
    +        }
    +    }
    +    real_server 192.168.100.3 443 {
    +        weight 1
    +        TCP_CHECK {
    +            connect_timeout 3
    +        }
    +    }
    +}
    +
    \ No newline at end of file diff --git a/examples/prism-kumir.html b/examples/prism-kumir.html new file mode 100644 index 0000000000..4d0af70a7f --- /dev/null +++ b/examples/prism-kumir.html @@ -0,0 +1,61 @@ +

    Example

    + +
    алг
    +нач
    +  | Решение квадратного уравнения.
    +  вещ a, b, c
    +  вещ таб корни[1:2]
    +  цел индекс, число корней
    +  вывод "Укажите первый коэффициент: "
    +  ввод a
    +  вывод нс, "Укажите второй коэффициент: "
    +  ввод b
    +  вывод нс, "Укажите свободный член: "
    +  ввод c
    +  решить квур(a, b, c, число корней, корни)
    +  если число корней = -1
    +    то
    +      вывод нс, "Первый коэффициент не может быть равен нулю.", нс
    +    иначе
    +      если число корней = 0
    +        то
    +          вывод нс, "Уравнение не имеет корней.", нс
    +        иначе
    +          если число корней = 1
    +            то
    +              вывод нс, "Уравнение имеет один корень.", нс
    +              вывод "x = ", корни[1], нс
    +            иначе
    +              вывод нс, "Уравнение имеет два корня.", нс
    +              нц для индекс от 1 до число корней шаг 1
    +                вывод "x", индекс, " = ", корни[индекс], нс
    +              кц
    +          все
    +      все
    +  все
    +кон
    +
    +алг решить квур(арг вещ a, b, c, арг рез цел число корней, арг рез вещ таб корни[1:2])
    +нач
    +  вещ дискриминант
    +  если a = 0
    +    то
    +      число корней := -1
    +    иначе
    +      дискриминант := b**2 - 4 * a * c
    +      если дискриминант > 0
    +        то
    +          корни[1] := (-b - sqrt(дискриминант)) / (2 * a)
    +          корни[2] := (-b + sqrt(дискриминант)) / (2 * a)
    +          число корней := 2
    +        иначе
    +          если дискриминант = 0
    +            то
    +              корни[1] := -b / (2 * a)
    +              число корней := 1
    +            иначе
    +              число корней := 0
    +          все
    +      все
    +  все
    +кон
    diff --git a/examples/prism-kusto.html b/examples/prism-kusto.html new file mode 100644 index 0000000000..aa2fd81d60 --- /dev/null +++ b/examples/prism-kusto.html @@ -0,0 +1,8 @@ +

    Full example

    +
    // Source: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/tutorial?pivots=azuredataexplorer
    +
    +StormEvents
    +| where StartTime > datetime(2007-02-01) and StartTime < datetime(2007-03-01)
    +| where EventType == 'Flood' and State == 'CALIFORNIA'
    +| project StartTime, EndTime , State , EventType , EpisodeNarrative
    +
    diff --git a/examples/prism-log.html b/examples/prism-log.html new file mode 100644 index 0000000000..efb1d4f43d --- /dev/null +++ b/examples/prism-log.html @@ -0,0 +1,10 @@ +

    Nginx example

    +
    /47.29.201.179 - - [28/Feb/2019:13:17:10 +0000] "GET /?p=1 HTTP/2.0" 200 5316 "https://domain1.com/?p=1" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" "2.75"
    +
    Mar 19 22:10:18 xxxxxx journal: xxxxxxx.mylabserver.com nginx: photos.example.com 127.0.0.1 - - [19/Mar/2018:22:10:18 +0000] "GET / HTTP/1.1" 200 1863 "-" "curl/7.29.0" "-"
    +Mar 19 22:10:24 xxxxxxx journal: xxxxxxxx.mylabserver.com nginx: photos.example.com 127.0.0.1 - - [19/Mar/2018:22:10:24 +0000] "GET / HTTP/1.1" 200 53324 "-" "curl/7.29.0" "-"
    +
    TLSv1.2 AES128-SHA 1.1.1.1 "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
    +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 2.2.2.2 "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
    +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 3.3.3.3 "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0"
    +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 4.4.4.4 "Mozilla/5.0 (Android 4.4.2; Tablet; rv:65.0) Gecko/65.0 Firefox/65.0"
    +TLSv1 AES128-SHA 5.5.5.5 "Mozilla/5.0 (Android 4.4.2; Tablet; rv:65.0) Gecko/65.0 Firefox/65.0"
    +TLSv1.2 ECDHE-RSA-CHACHA20-POLY1305 6.6.6.6 "Mozilla/5.0 (Linux; U; Android 5.0.2; en-US; XT1068 Build/LXB22.46-28) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.10.2.1164 Mobile Safari/537.36"
    diff --git a/examples/prism-magma.html b/examples/prism-magma.html new file mode 100644 index 0000000000..558e819f0a --- /dev/null +++ b/examples/prism-magma.html @@ -0,0 +1,34 @@ +

    Full example

    +
    // Source: http://magma.maths.usyd.edu.au/magma/handbook/text/115#963
    +> D := Denominator;
    +> N := Numerator;
    +> farey := function(n)
    +>    f := [ RationalField() | 0, 1/n ];
    +>    p := 0;
    +>    q := 1;
    +>    while p/q lt 1 do
    +>       p := ( D(f[#f-1]) + n) div D(f[#f]) * N(f[#f])  - N(f[#f-1]);
    +>       q := ( D(f[#f-1]) + n) div D(f[#f]) * D(f[#f])  - D(f[#f-1]);
    +>       Append(~f, p/q);
    +>    end while;
    +>    return f;
    +> end function;
    +> function farey(n)
    +>    if n eq 1 then
    +>       return [RationalField() | 0, 1 ];
    +>    else
    +>       f := farey(n-1);
    +>       i := 0;
    +>       while i lt #f-1 do
    +>          i +:= 1;
    +>          if D(f[i]) + D(f[i+1]) eq n then
    +>             Insert( ~f, i+1, (N(f[i]) + N(f[i+1]))/(D(f[i]) + D(f[i+1])));
    +>          end if;
    +>       end while;
    +>       return f;
    +>    end if;
    +> end function;
    +> farey := func< n |
    +>               Sort(Setseq({ a/b : a in { 0..n }, b in { 1..n } | a le b }))>;
    +> farey(6);
    +[ 0, 1/6, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 1 ]
    diff --git a/examples/prism-maxscript.html b/examples/prism-maxscript.html new file mode 100644 index 0000000000..08bd94483c --- /dev/null +++ b/examples/prism-maxscript.html @@ -0,0 +1,33 @@ +

    Strings

    +
    -- Source: https://help.autodesk.com/view/MAXDEV/2022/ENU/?guid=GUID-5E5E1A71-24E2-4605-9720-2178B941DECC
    +
    +plugin RenderEffect MonoChrome
    +name:"MonoChrome"
    +classID:#(0x9e6e9e77, 0xbe815df4)
    +(
    +rollout about_rollout "About..."
    +(
    +  label about_label "MonoChrome Filter"
    +)
    +on apply r_image progressCB: do
    +(
    +  progressCB.setTitle "MonoChrome Effect"
    +  local oldEscapeEnable = escapeEnable
    +  escapeEnable = false
    +  bmp_w = r_image.width
    +  bmp_h = r_image.height
    +  for y = 0 to bmp_h-1 do
    +  (
    +    if progressCB.progress y (bmp_h-1) then exit
    +    pixel_line = getPixels r_image [0,y] bmp_w
    +    for x = 1 to bmp_w do
    +    (
    +      p_v = pixel_line[x].value
    +      pixel_line[x] = color p_v p_v p_v pixel_line[x].alpha
    +    )--end x loop
    +    setPixels r_image [0,y] pixel_line
    +  )--end y loop
    +  escapeEnable = oldEscapeEnable
    +)--end on apply
    +)--end plugin
    +
    diff --git a/examples/prism-mermaid.html b/examples/prism-mermaid.html new file mode 100644 index 0000000000..c379bf27b5 --- /dev/null +++ b/examples/prism-mermaid.html @@ -0,0 +1,25 @@ +

    Full example

    +
    %% https://github.com/mermaid-js/mermaid/blob/develop/docs/examples.md#larger-flowchart-with-some-styling
    +
    +graph TB
    +	sq[Square shape] --> ci((Circle shape))
    +
    +	subgraph A
    +		od>Odd shape]-- Two line<br/>edge comment --> ro
    +		di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape)
    +		di==>ro2(Rounded square shape)
    +	end
    +
    +	%% Notice that no text in shape are added here instead that is appended further down
    +	e --> od3>Really long text with linebreak<br>in an Odd shape]
    +
    +	%% Comments after double percent signs
    +	e((Inner / circle<br>and some odd <br>special characters)) --> f(,.?!+-*ز)
    +
    +	cyr[Cyrillic]-->cyr2((Circle shape Начало));
    +
    +	classDef green fill:#9f6,stroke:#333,stroke-width:2px;
    +	classDef orange fill:#f96,stroke:#333,stroke-width:4px;
    +	class sq,e green
    +	class di orange
    +
    diff --git a/examples/prism-mongodb.html b/examples/prism-mongodb.html new file mode 100644 index 0000000000..305eae5233 --- /dev/null +++ b/examples/prism-mongodb.html @@ -0,0 +1,59 @@ +

    Document

    +
    
    +{
    +	'_id': ObjectId('5ec72ffe00316be87cab3927'),
    +	'code': Code('function () { return 22; }'),
    +	'binary': BinData(1, '232sa3d323sd232a32sda3s2d3a2s1d23s21d3sa'),
    +	'dbref': DBRef('namespace', ObjectId('5ec72f4200316be87cab3926'), 'db'),
    +	'timestamp': Timestamp(0, 0),
    +	'long': NumberLong(9223372036854775807),
    +	'decimal': NumberDecimal('1000.55'),
    +	'integer': 100,
    +	'maxkey': MaxKey(),
    +	'minkey': MinKey(),
    +	'isodate': ISODate('2012-01-01T00:00:00.000Z'),
    +	'regexp': RegExp('prism(js)?', 'i'),
    +	'string': 'Hello World',
    +	'numberArray': [1, 2, 3],
    +	'stringArray': ['1','2','3'],
    +	'randomKey': null,
    +	'object': { 'a': 1, 'b': 2 },
    +	'max_key2': MaxKey(),
    +	'number': 1234,
    +	'invalid-key': 123,
    +	noQuotesKey: 'value',
    +}
    +
    + +

    Query

    +
    
    +db.users.find({
    +	_id: { $nin: ObjectId('5ec72ffe00316be87cab3927') },
    +	age: { $gte: 18, $lte: 99 },
    +	field: { $exists: true }
    +})
    +
    + + +

    Update

    +
    
    +db.users.updateOne(
    +	{
    +		_id: ObjectId('5ec72ffe00316be87cab3927')
    +	},
    +	{
    +		$set: { age: 30 },
    +		$inc: { updateCount: 1 }, 
    +		$push: { updateDates: new Date() } 
    +	}
    +)
    +
    + +

    Aggregate

    +
    
    +db.orders.aggregate([
    +	{ $sort : { age : -1 } },
    +	{ $project : { age : 1, status : 1, name : 1 } },
    +	{ $limit: 5 }
    +])
    +
    diff --git a/examples/prism-naniscript.html b/examples/prism-naniscript.html new file mode 100644 index 0000000000..6d5397bbdc --- /dev/null +++ b/examples/prism-naniscript.html @@ -0,0 +1,72 @@ + +

    Comments

    +
    ;Text of Comment
    +		;		Comment with tabs before
    +
    + +

    Define

    +
    
    +>DefineKey define 12 super usefull lines
    +
    + +

    Label

    +
    # Section
    +#Section without whitespace
    + # Section with whitespace
    +	# SectionWithTab	
    +
    + +

    Command

    +
    
    +@
    +@ cmdWithWhiteSpaceBefore
    +@cmdWithTrailingSemicolon:
    +@paramlessCmd
    + @cmdWithNoParamsAndWhitespaceBefore
    +		@cmdWithNoParamsAndTabBefore
    +					 @cmdWithNoParamsAndTabAndSpacesBefore
    +           @cmdWithNoParamsWrappedInWhitespaces             
    +@cmdWithNoParamWithTrailingSpace 
    +@cmdWithNoParamWithMultipleTrailingSpaces   
    +@cmdWithNoParamWithTrailingTab	
    +@cmdWithNoParamWithTrailingTabAndSpaces	  
    +@cmdWithPositiveIntParam 1
    +@cmdWithNegativeIntParam -1
    +@cmdWithPositiveFloatParamAndNoFraction 1.
    +@cmdWithPositiveFloatParamAndFraction 1.10
    +@cmdWithPositiveHegativeFloatParamAndNoFraction -1.
    +@cmdWithPositiveHegativeFloatParamAndFraction -1.10
    +@cmdWithBoolParamAndPositive true
    +@cmdWithBoolParamAndNegative false
    +@cmdWithStringParam hello$co\:mma"d"
    +@cmdWithQuotedStringNamelessParameter "hello grizzly"
    +@cmdWithQuotedStringNamelessParameterWithEscapedQuotesInTheValue "hello \"grizzly\""
    +@set choice="moe"
    +@command hello.grizzly
    +@command one,two,three
    +@command 1,2,3
    +@command true,false,true
    +@command hi:grizzly
    +@command hi:1
    +@command hi:true
    +@command 1 in:forest danger:true
    +@char 1 pos:0.25,-0.75 look:right
    +
    + +

    Generic Text

    +
    Generic text with inlined commands[i] example[command 1 danger:true] more text here [act danger:false true:false]
    +"Integer: a = {a} malesuada a + b = {a + b}", Random(a, b) = {Random(a, b)}, Random("foo", "bar", "foobar") = {Random("foo", "bar", "foobar")}
    +UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf [
    +"Integer: a = {a} malesuada a + b = {a + b}", Random(a, b) = {Random(a, b)}, Random("foo", "bar", "foobar") = {Random("foo", "bar", "foobar")},}
    +
    + +

    Expressions

    +
    {}
    +{ Abs(a, d) + 12 - 1 / -230.0 + "Lol ipsum" }
    +Expressions inside a generic text line: Loreim ipsu,{ Abs(a, d) + 12 - 1 / -230.0 + "Lol ipsum" } doler sit amen {¯\_(ツ)_/¯}.
    +@ExpressionInsteadOfNamelessParameterValue {x > 0}
    +@ExpressionBlendedWithNamelessParameterValue sdf{x > 0}df
    +@ExpressionsInsideNamedParameterValueWrappedInQuotes text:"{a} < {b}"
    +@ExpressionsBlendedWithNamedParameterValue param:32r2f,df{x > 0},d.{Abs(0) + 12.24 > 0}ff
    +@ExpressionsInsteadOfNamelessParameterAndQuotedParameter {remark} if:remark=="Saying \\"Stop { "the" } car\\" was a mistake."
    +
    diff --git a/examples/prism-nevod.html b/examples/prism-nevod.html new file mode 100644 index 0000000000..a9d4cf1a5f --- /dev/null +++ b/examples/prism-nevod.html @@ -0,0 +1,59 @@ +

    Comment

    +
    /* This is
    +multi-line
    +comment */
    +// This is single-line comment
    + +

    String

    +
    "text in double quotes"
    +'text in single quotes'
    +'case-sensitive text'!
    +'text ''Nevod'' in quotes'
    +"text ""Nevod"" in double quotes"
    +'text prefix'*
    +'case-sensitive text prefix'!*
    + +

    Keyword

    +
    @inside
    +@outside
    +@having
    +@search
    +@where
    + +

    Package Import

    +
    @require "Common/DateTime.np"
    +@require "Common/Url.np"
    + +

    Namespace

    +
    @namespace My { }
    +@namespace My.Domain { }
    + +

    Pattern

    +
    @pattern #Percentage = Num + ?Space + {'%', 'pct.', 'pct', 'percent'};
    +@pattern #GUID = Word(8) + [3 '-' + Word(4)] + '-' + Word(12);
    +@pattern #HashTag = '#' + {AlphaNum, Alpha, '_'} + [0+ {Word, '_'}];
    + +

    Full Example

    +
    @namespace Common
    +{
    +  @search @pattern Url(Domain, Path, Query, Anchor) =
    +    Method + Domain:Url.Domain + ?Port + ?Path:Url.Path +
    +    ?Query:Url.Query + ?Anchor:Url.Anchor
    +  @where
    +  {
    +    Method = {'http', 'https' , 'ftp', 'mailto', 'file', 'data', 'irc'} + '://';
    +    Domain = Word + [1+ '.' + Word + [0+ {Word, '_', '-'}]];
    +    Port = ':' + Num;
    +    Path = ?'/' + [0+ {Word, '/', '_', '+', '-', '%', '.'}];
    +    Query = '?' + ?(Param + [0+ '&' + Param])
    +    @where
    +    {
    +      Param = Identifier + '=' + Identifier
    +      @where
    +      {
    +        Identifier = {Alpha, AlphaNum, '_'} + [0+ {Word, '_'}];
    +      };
    +    };
    +    Anchor(Value) = '#' + Value:{Word};
    +  };
    +}
    \ No newline at end of file diff --git a/examples/prism-nginx.html b/examples/prism-nginx.html index 49d14664d3..b00ffbb2aa 100644 --- a/examples/prism-nginx.html +++ b/examples/prism-nginx.html @@ -22,4 +22,5 @@

    Server Block

    location / { proxy_pass http://127.0.0.1:8080; } -}
    \ No newline at end of file +} +
    \ No newline at end of file diff --git a/examples/prism-openqasm.html b/examples/prism-openqasm.html new file mode 100644 index 0000000000..35ab2fc921 --- /dev/null +++ b/examples/prism-openqasm.html @@ -0,0 +1,43 @@ +

    Full example

    +
    // https://github.com/Qiskit/openqasm
    +/*
    + * Repeat-until-success circuit for Rz(theta),
    + * cos(theta-pi)=3/5, from Nielsen and Chuang, Chapter 4.
    + */
    +OPENQASM 3;
    +include "stdgates.inc";
    +
    +/*
    + * Applies identity if out is 01, 10, or 11 and a Z-rotation by
    + * theta + pi where cos(theta)=3/5 if out is 00.
    + * The 00 outcome occurs with probability 5/8.
    + */
    +def segment qubit[2]:anc, qubit:psi -> bit[2] {
    +  bit[2] b;
    +  reset anc;
    +  h anc;
    +  ccx anc[0], anc[1], psi;
    +  s psi;
    +  ccx anc[0], anc[1], psi;
    +  z psi;
    +  h anc;
    +  measure anc -> b;
    +  return b;
    +}
    +
    +qubit input;
    +qubit ancilla[2];
    +bit flags[2] = "11";
    +bit output;
    +
    +reset input;
    +h input;
    +
    +// braces are optional in this case
    +while(int(flags) != 0) {
    +  flags = segment ancilla, input;
    +}
    +rz(pi - arccos(3 / 5)) input;
    +h input;
    +output = measure input;  // should get zero
    +
    diff --git a/examples/prism-promql.html b/examples/prism-promql.html new file mode 100644 index 0000000000..5570bbda63 --- /dev/null +++ b/examples/prism-promql.html @@ -0,0 +1,17 @@ +

    Examples

    +
    # These examples are taken from: https://prometheus.io/docs/prometheus/latest/querying/examples/
    +
    +http_requests_total{job="apiserver", handler="/api/comments"}[5m]
    +
    +http_requests_total{job=~".*server"}
    +
    +max_over_time(deriv(rate(distance_covered_total[5s])[30s:5s])[10m:])
    +
    +sum by (job) (
    +  rate(http_requests_total[5m])
    +)
    +
    +sum by (app, proc) (
    +  instance_memory_limit_bytes - instance_memory_usage_bytes
    +) / 1024 / 1024
    +
    diff --git a/examples/prism-psl.html b/examples/prism-psl.html new file mode 100644 index 0000000000..daee2b952c --- /dev/null +++ b/examples/prism-psl.html @@ -0,0 +1,43 @@ +

    Strings

    +
    # PSL Strings are properly rendered
    +print("Hello, World!");
    +
    +# Escaped sequences are highlighted too
    +print("Goodbye \H\H\H\H\H\H\H\HHello, World!\n");
    +
    +# Multi-line strings are supported
    +print("multi
    +line");
    +
    + +

    Numbers

    +
    a = 1;
    +b = 2.5;
    +c = 0xff;
    +
    + +

    PSL Built-in Functions

    +
    p = nthargf(process(".*"), 1, " \t", "\n");
    +lock("test");
    +execute("OS", "pwd");
    +
    + +

    PSL Keywords

    +
    foreach entry (["aaa", "bbb", "ccc"]) {
    +	if (grep("[bc]", entry)) {
    +		last;
    +	}
    +}
    +
    + +

    PSL Constants

    +
    set("/CLASS/inst/paramA/state", WARN);
    +if (true) {
    +	PslDebug = -1;
    +}
    +output = execute("OS", "echo test");
    +if (errno) {
    +	print(ALARM." with errno=".errno."\n");
    +}
    +print(trim(output, "\n\r\t ", TRIM_LEADING_AND_TRAILING));
    +
    \ No newline at end of file diff --git a/examples/prism-purescript.html b/examples/prism-purescript.html new file mode 100644 index 0000000000..0b71ec3823 --- /dev/null +++ b/examples/prism-purescript.html @@ -0,0 +1,57 @@ +

    Comments

    +
    -- Single line comment
    +{- Multi-line
    +comment -}
    + +

    Strings and characters

    +
    'a'
    +'\n'
    +'\^A'
    +'\^]'
    +'\NUL'
    +'\23'
    +'\o75'
    +'\xFE'
    +"Here is a backslant \\ as well as \137, \
    +    \a numeric escape character, and \^X, a control character."
    + +

    Numbers

    +
    42
    +123.456
    +123.456e-789
    +1e+3
    +0o74
    +0XAF
    + +

    Full example

    +
    module Codewars.Kata.SumFracts (sumFracts) where
    +
    +import Prelude
    +
    +import Data.Foldable (foldl)
    +import Data.BigInt (BigInt, fromInt, toString)
    +import Data.List (List, length)
    +import Data.Tuple (Tuple(..))
    +import Data.Maybe (Maybe(..))
    +import Data.Ord (abs, signum)
    +
    +reduce :: Tuple BigInt BigInt -> Tuple BigInt BigInt
    +reduce (Tuple num den) =
    +  let gcd' = gcd num den
    +      den' = den / gcd'
    +   in Tuple (num / gcd' * (signum den')) (abs den')
    +   
    +sumFracts :: List (Tuple Int Int) -> Maybe String
    +sumFracts fracts =
    +  let fracts' = fracts <#> (\(Tuple n d) -> Tuple (fromInt n) (fromInt d)) >>> reduce
    +      
    +      den = foldl (\acc (Tuple _ d) -> lcm acc d) one fracts'
    +      num = foldl (\acc (Tuple n d) -> acc + n * (den / d)) zero fracts'
    +      
    +      Tuple n d = reduce $ Tuple num den
    +      
    +   in if length fracts == 0
    +        then Nothing
    +        else if d == one
    +                then Just $ toString n
    +                else Just $ (toString n) >< " " >< (toString d)
    diff --git a/examples/prism-qsharp.html b/examples/prism-qsharp.html new file mode 100644 index 0000000000..eec88a8966 --- /dev/null +++ b/examples/prism-qsharp.html @@ -0,0 +1,33 @@ +

    Full example

    +
    namespace Bell {
    +  open Microsoft.Quantum.Canon;
    +  open Microsoft.Quantum.Intrinsic;
    +
    +  operation SetQubitState(desired : Result, target : Qubit) : Unit {
    +      if desired != M(target) {
    +          X(target);
    +      }
    +  }
    +
    +  @EntryPoint()
    +  operation TestBellState(count : Int, initial : Result) : (Int, Int) {
    +
    +      mutable numOnes = 0;
    +      use qubit = Qubit();
    +      for test in 1..count {
    +          SetQubitState(initial, qubit);
    +          let res = M(qubit);        
    +
    +          // Count the number of ones we saw:
    +          if res == One {
    +                set numOnes += 1;
    +          }
    +      }
    +
    +      SetQubitState(Zero, qubit); 
    +
    +  // Return number of times we saw a |0> and number of times we saw a |1>
    +  Message("Test results (# of 0s, # of 1s): ");
    +  return (count - numOnes, numOnes);
    +  }
    +}
    diff --git a/examples/prism-rego.html b/examples/prism-rego.html new file mode 100644 index 0000000000..d8050a366e --- /dev/null +++ b/examples/prism-rego.html @@ -0,0 +1,44 @@ +

    Full example

    +
    # Role-based Access Control (RBAC)
    +
    +# By default, deny requests.
    +default allow = false
    +
    +# Allow admins to do anything.
    +allow {
    +	user_is_admin
    +}
    +
    +# Allow the action if the user is granted permission to perform the action.
    +allow {
    +	# Find grants for the user.
    +	some grant
    +	user_is_granted[grant]
    +
    +	# Check if the grant permits the action.
    +	input.action == grant.action
    +	input.type == grant.type
    +}
    +
    +# user_is_admin is true if...
    +user_is_admin {
    +
    +	# for some `i`...
    +	some i
    +
    +	# "admin" is the `i`-th element in the user->role mappings for the identified user.
    +	data.user_roles[input.user][i] == "admin"
    +}
    +
    +# user_is_granted is a set of grants for the user identified in the request.
    +# The `grant` will be contained if the set `user_is_granted` for every...
    +user_is_granted[grant] {
    +	some i, j
    +
    +	# `role` assigned an element of the user_roles for this user...
    +	role := data.user_roles[input.user][i]
    +
    +	# `grant` assigned a single grant from the grants list for 'role'...
    +	grant := data.role_grants[role][j]
    +}
    +
    diff --git a/examples/prism-ruby.html b/examples/prism-ruby.html index 4f1e3906f7..58d43cd1ea 100644 --- a/examples/prism-ruby.html +++ b/examples/prism-ruby.html @@ -7,7 +7,10 @@

    Comments

    Strings

    "foo \"bar\" baz"
    -'foo \'bar\' baz'
    +'foo \'bar\' baz' +<<STRING + here's some #{string} contents +STRING

    Regular expressions

    /foo?[ ]*bar/
    diff --git a/examples/prism-sml.html b/examples/prism-sml.html new file mode 100644 index 0000000000..d5030eb815 --- /dev/null +++ b/examples/prism-sml.html @@ -0,0 +1,43 @@ +

    Full example

    +
    (* source: https://github.com/HarrisonGrodin/ml-numbers/blob/ba35c763092052e391871edf224f17474c6231b1/src/Rational.sml *)
    +
    +structure Rational :> RATIONAL =
    +  struct
    +    type t = int * int  (* (a,b) invariant: a,b coprime; b nonnegative *)
    +
    +    local
    +      val rec gcd = fn
    +        (m,0) => m
    +      | (m,n) => gcd (n, m mod n)
    +    in
    +      infix 8 //
    +      val op // = fn (x,y) => (
    +        let
    +          val gcd = gcd (x,y)
    +        in
    +          (x div gcd, y div gcd)
    +        end
    +      )
    +    end
    +
    +    val show = Fn.id
    +
    +    val zero = (0,1)
    +    val one  = (1,1)
    +
    +    val eq : t * t -> bool = (op =)
    +    val compare = fn ((a,b),(x,y)) => Int.compare (a * y, b * x)
    +    val toString = fn (x,y) => Int.toString x ^ " // " ^ Int.toString y
    +    val percent =
    +      Fn.curry (Fn.flip (op ^)) "%"
    +      o Int.toString
    +      o (fn (a,b) => (100 * a) div b)
    +
    +    val op + = fn ((a,b),(x,y)) => (a * y + b * x) // (b * y)
    +    val ~ = fn (a,b) => (~a,b)
    +    val op - = fn (r1,r2) => r1 + ~r2
    +
    +    val op * = fn ((a,b),(x,y)) => (a * x) // (b * y)
    +    val inv = Fn.flip (op //)
    +    val op / = fn (r1,r2) => r1 * inv r2
    +  end
    diff --git a/examples/prism-squirrel.html b/examples/prism-squirrel.html new file mode 100644 index 0000000000..14ff2d6af3 --- /dev/null +++ b/examples/prism-squirrel.html @@ -0,0 +1,57 @@ +

    Full example

    +
     // source: http://www.squirrel-lang.org/#look
    +
    +local table = {
    +	a = "10"
    +	subtable = {
    +		array = [1,2,3]
    +	},
    +	[10 + 123] = "expression index"
    +}
    +
    +local array=[ 1, 2, 3, { a = 10, b = "string" } ];
    +
    +foreach (i,val in array)
    +{
    +	::print("the type of val is"+typeof val);
    +}
    +
    +/////////////////////////////////////////////
    +
    +class Entity
    +{
    +	constructor(etype,entityname)
    +	{
    +		name = entityname;
    +		type = etype;
    +	}
    +
    +	x = 0;
    +	y = 0;
    +	z = 0;
    +	name = null;
    +	type = null;
    +}
    +
    +function Entity::MoveTo(newx,newy,newz)
    +{
    +	x = newx;
    +	y = newy;
    +	z = newz;
    +}
    +
    +class Player extends Entity {
    +	constructor(entityname)
    +	{
    +		base.constructor("Player",entityname)
    +	}
    +	function DoDomething()
    +	{
    +		::print("something");
    +	}
    +
    +}
    +
    +local newplayer = Player("da playar");
    +
    +newplayer.MoveTo(100,200,300);
    diff --git a/examples/prism-stan.html b/examples/prism-stan.html new file mode 100644 index 0000000000..6d7b0ff937 --- /dev/null +++ b/examples/prism-stan.html @@ -0,0 +1,21 @@ +

    Full example

    +
    // source: https://github.com/stan-dev/example-models/blob/8a6964135560f54f52695ccd4d2492a8067f0c30/misc/linear-regression/regression_std.stan
    +
    +// normal mixture, unknown proportion and means, known variance
    +// p(y|mu,theta) = theta * Normal(y|mu[1],1) + (1-theta) * Normal(y|mu[2],1);
    +
    +data {
    +  int<lower=0>  N;
    +  real y[N];
    +}
    +parameters {
    +  real<lower=0,upper=1> theta;
    +  real mu[2];
    +}
    +model {
    +  theta ~ uniform(0,1); // equivalently, ~ beta(1,1);
    +  for (k in 1:2)
    +    mu[k] ~ normal(0,10);
    +  for (n in 1:N)
    +    target += log_mix(theta, normal_lpdf(y[n]|mu[1],1.0), normal_lpdf(y[n]|mu[2],1.0));
    +}
    diff --git a/examples/prism-systemd.html b/examples/prism-systemd.html new file mode 100644 index 0000000000..082ff8b54d --- /dev/null +++ b/examples/prism-systemd.html @@ -0,0 +1,20 @@ +

    Full example

    +
    # Source: https://www.freedesktop.org/software/systemd/man/systemd.syntax.html
    +
    +[Section A]
    +KeyOne=value 1
    +KeyTwo=value 2
    +
    +# a comment
    +
    +[Section B]
    +Setting="something" "some thing" "…"
    +KeyTwo=value 2 \
    +       value 2 continued
    +
    +[Section C]
    +KeyThree=value 3\
    +# this line is ignored
    +; this line is ignored too
    +       value 3 continued
    +
    diff --git a/examples/prism-tremor.html b/examples/prism-tremor.html new file mode 100644 index 0000000000..c0c89e2753 --- /dev/null +++ b/examples/prism-tremor.html @@ -0,0 +1,82 @@ +

    Comments

    +
    # Single line comment
    +### Module level documentation comment
    +## Statement level documentation comment
    +# Regular code comment
    +
    + +

    Strings

    +
    
    +# double quote single line strings
    +"foo \"bar\" baz"
    +
    +# heredocs or multiline strings
    +"""
    +{ "snot": "badger" }
    +"""
    +
    + +

    Variables

    +
    
    +# Immutable constants
    +const snot = "fleek";
    +
    +# Mutable variables
    +let badger = "flook";
    +
    + +

    Operators

    +
    
    +merge {} of
    +  { "snot": "badger" }
    +end;
    +
    +patch {} of
    +  insert snot = "badger"
    +end;
    +
    + +

    Functions and keywords

    +
    
    +fn fib_(a, b, n) of
    +case (a, b, n) when n > 0 => recur(b, a + b, n - 1)
    +default => a
    +end;
    +
    +fn fib(n) with
    +fib_(0, 1, n)
    +end;
    +
    +fib(event)
    +
    + +

    Queries

    +
    
    +	define script fib
    +	script
    +        fn fib_(a, b, n) of
    +            case (a, b, n) when n > 0 => recur(b, a + b, n - 1)
    +            default => a
    +        end;
    +
    +        fn fib(n) with
    +            fib_(0, 1, n)
    +        end;
    +
    +		{ "fib": fib(event.n) }
    +	end;
    +
    +	create script fib;
    +	select event.n from in into fib;
    +	select event from fib into out;
    +
    + +

    Deployments

    +
    
    +define pipeline passthrough
    +pipeline
    +  select event from in into out;
    +end;
    +
    +deploy pipeline passthrough;
    +
    \ No newline at end of file diff --git a/examples/prism-typoscript.html b/examples/prism-typoscript.html new file mode 100644 index 0000000000..2ebcc1373f --- /dev/null +++ b/examples/prism-typoscript.html @@ -0,0 +1,95 @@ +

    Typical TypoScript Setup File

    +
    # import other files
    +@import 'EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript'
    +@import 'EXT:sitepackage/Configuration/TypoScript/Helper/DynamicContent.typoscript'
    +
    +page = PAGE
    +page {
    +	typeNum = 0
    +
    +	// setup templates
    +	10 = FLUIDTEMPLATE
    +	10 {
    +		templateName = TEXT
    +		templateName.stdWrap.cObject = CASE
    +		templateName.stdWrap.cObject {
    +			key.data = pagelayout
    +
    +			pagets__sitepackage_default = TEXT
    +			pagets__sitepackage_default.value = Default
    +
    +			pagets__sitepackage_alternate = TEXT
    +			pagets__sitepackage_alternate.value = Alternative
    +
    +			default = TEXT
    +			default.value = Default
    +		}
    +		
    +		templateRootPaths {
    +			0 = EXT:sitepackage/Resources/Private/Templates/Page/
    +			1 = {$sitepackage.fluidtemplate.templateRootPath}
    +		}
    +		
    +		partialRootPaths {
    +			0 = EXT:sitepackage/Resources/Private/Partials/Page/
    +			1 = {$sitepackage.fluidtemplate.partialRootPath}
    +		}
    +		
    +		layoutRootPaths {
    +			0 = EXT:sitepackage/Resources/Private/Layouts/Page/
    +			1 = {$sitepackage.fluidtemplate.layoutRootPath}
    +		}
    +
    +		dataProcessing {
    +			10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
    +			10 {
    +				levels = 1
    +				includeSpacer = 1
    +				as = mainnavigation
    +			}
    +		}
    +	}
    +
    +	// include css into head
    +	includeCSS {
    +		bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css
    +		bootstrap.external = 1
    +		website = EXT:sitepackage/Resources/Public/Css/styles.css
    +	}
    +
    +	// include js into footer
    +	includeJSFooter {
    +		jquery = https://code.jquery.com/jquery-3.2.1.slim.min.js
    +		jquery.external = 1
    +		bootstrap = https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js
    +		bootstrap.external = 1
    +		website = EXT:sitepackage/Resources/Public/JavaScript/scripts.js
    +	}
    +}
    +
    +// global site configuration
    +config {
    +	absRefPrefix = auto
    +	cache_period = 86400
    +	debug = 0
    +	disablePrefixComment = 1
    +	doctype = html5
    +	extTarget =
    +	index_enable = 1
    +	index_externals = 1
    +	index_metatags = 1
    +	inlineStyle2TempFile = 1
    +	intTarget =
    +	linkVars = L
    +	metaCharset = utf-8
    +	no_cache = 0
    +	pageTitleFirst = 1
    +	prefixLocalAnchors = all
    +	removeDefaultJS = 0
    +	sendCacheHeaders = 1
    +	compressCss = 0
    +	compressJs = 0
    +	concatenateCss = 0
    +	concatenateJs = 0
    +}
    +
    diff --git a/examples/prism-uorazor.html b/examples/prism-uorazor.html new file mode 100644 index 0000000000..5c218ff9a0 --- /dev/null +++ b/examples/prism-uorazor.html @@ -0,0 +1,13 @@ +

    Full example

    +
    
    +# UO Razor Script Highlighting by Jaseowns
    +// These two are comments
    +// Example script:
    +setvar "my_training_target"
    +while skill "anatomy" < 100
    +    useskill "anatomy"
    +    wft 500
    +    target "my_training_target"
    +    wait 2000
    +endwhile
    +
    diff --git a/examples/prism-uri.html b/examples/prism-uri.html new file mode 100644 index 0000000000..da6dc04bec --- /dev/null +++ b/examples/prism-uri.html @@ -0,0 +1,13 @@ +

    Full example

    +
    https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top
    +https://example.com/path/resource.txt#fragment
    +ldap://[2001:db8::7]/c=GB?objectClass?one
    +mailto:John.Doe@example.com
    +news:comp.infosystems.www.servers.unix
    +tel:+1-816-555-1212
    +telnet://192.0.2.16:80/
    +urn:oasis:names:specification:docbook:dtd:xml:4.1.2
    +//example.com/path/resource.txt
    +/path/resource.txt
    +path/resource.txt
    +
    diff --git a/examples/prism-v.html b/examples/prism-v.html new file mode 100644 index 0000000000..1ddb018263 --- /dev/null +++ b/examples/prism-v.html @@ -0,0 +1,91 @@ +

    Comments

    +
    // This is a comment
    +/* This is a comment
    +on multiple lines */
    + +

    Numbers

    +
    123
    +0x7B
    +0b01111011
    +0o173
    +170141183460469231731687303715884105727
    +1_000_000
    +0b0_11
    +3_122.55
    +0xF_F
    +0o17_3
    +72.40
    +072.40
    +2.71828
    +
    + +

    Runes and strings

    +
    '\t'
    +'\000'
    +'\x07'
    +'\u12e4'
    +'\U00101234'
    +`abc`
    +`multi-line
    +string`
    +"Hello, world!"
    +"multi-line
    +string"
    + +

    String interpolation

    +
    'Hello, $name!'
    +"age = $user.age"
    +'can register = ${user.age > 13}'
    +'x = ${x:4.2f}'
    +'[${x:10}]'
    +'[${int(x):-10}]'
    +
    + +

    Struct

    +
    struct Foo {
    +	a int   // private immutable (default)
    +mut:
    +	b int   // private mutable
    +	c int   // (you can list multiple fields with the same access modifier)
    +pub:
    +	d int   // public immutable (readonly)
    +pub mut:
    +	e int   // public, but mutable only in parent module
    +__global:
    +	f int   // public and mutable both inside and outside parent module
    +}           // (not recommended to use, that's why the 'global' keyword
    +			// starts with __)
    +
    + +

    Functions

    +
    func(a, b int, z float64) bool { return a*b < int(z) }
    + +

    Full example

    +
    
    +module mymodule
    +
    +import external_module
    +
    +fn sqr(n int) int {
    +	return n * n
    +}
    +
    +fn run(value int, op fn (int) int) int {
    +	return op(value)
    +}
    +
    +fn main() {
    +	println(run(5, sqr)) // "25"
    +	// Anonymous functions can be declared inside other functions:
    +	double_fn := fn (n int) int {
    +		return n + n
    +	}
    +	println(run(5, double_fn)) // "10"
    +	// Functions can be passed around without assigning them to variables:
    +	res := run(5, fn (n int) int {
    +		return n + n
    +	})
    +
    +	external_module.say_hi()
    +}
    +
    diff --git a/examples/prism-web-idl.html b/examples/prism-web-idl.html new file mode 100644 index 0000000000..7f2c9a91f1 --- /dev/null +++ b/examples/prism-web-idl.html @@ -0,0 +1,28 @@ +

    Full example

    +
    [Exposed=Window]
    +interface Paint { };
    +
    +[Exposed=Window]
    +interface SolidColor : Paint {
    +	attribute double red;
    +	attribute double green;
    +	attribute double blue;
    +};
    +
    +[Exposed=Window]
    +interface Pattern : Paint {
    +	attribute DOMString imageURL;
    +};
    +
    +[Exposed=Window]
    +interface GraphicalWindow {
    +	constructor();
    +	readonly attribute unsigned long width;
    +	readonly attribute unsigned long height;
    +
    +	attribute Paint currentPaint;
    +
    +	undefined drawRectangle(double x, double y, double width, double height);
    +
    +	undefined drawText(double x, double y, DOMString text);
    +};
    diff --git a/examples/prism-wolfram.html b/examples/prism-wolfram.html new file mode 100644 index 0000000000..a6eeabdbc6 --- /dev/null +++ b/examples/prism-wolfram.html @@ -0,0 +1,31 @@ +

    Comments

    +
    
    +(* This is a comment *)
    +
    + +

    Strings

    +
    
    +"foo bar baz"
    +
    + +

    Numbers

    +
    
    +7
    +3.14
    +10.
    +.001
    +1e100
    +3.14e-10
    +2147483647
    +
    + +

    Full example

    +
    
    +(* Most operators are supported *)
    +f /@ {1, 2, 3};
    +f @@ Range[10];
    +f @@@ y;
    +Module[{x=1}, 
    +    Return @ $Failed
    +]
    +
    diff --git a/examples/prism-wren.html b/examples/prism-wren.html new file mode 100644 index 0000000000..bce7637be6 --- /dev/null +++ b/examples/prism-wren.html @@ -0,0 +1,17 @@ +

    Full example

    +
    // Source: https://wren.io/
    +
    +System.print("Hello, world!")
    +
    +class Wren {
    +  flyTo(city) {
    +    System.print("Flying to %(city)")
    +  }
    +}
    +
    +var adjectives = Fiber.new {
    +  ["small", "clean", "fast"].each {|word| Fiber.yield(word) }
    +}
    +
    +while (!adjectives.isDone) System.print(adjectives.call())
    +
    diff --git a/extending.html b/extending.html index 6005a6ed3c..606c2816fb 100644 --- a/extending.html +++ b/extending.html @@ -8,7 +8,7 @@ - + - + - +
    @@ -95,14 +95,15 @@

    How do I know which tokens I can style for every language?

    Language:

    + +

    Additionally, you can find a list of standard tokens on this page.

    How can I use different highlighting for tokens with the same name in different languages?

    Just use a descendant selector, that includes the language class. The default prism.css does this, to have different colors for JavaScript strings (which are very common) and CSS strings (which are relatively rare). Here’s that code, simplified to illustrate the technique: -

    
    -.token.string {
    +	
    .token.string {
     	color: #690;
     }
     
    @@ -123,7 +124,7 @@ 

    How can I use different highlighting for tokens with the same name in differ
    - + + @@ -65,6 +65,7 @@

    Used By

    Drupal React Stripe + MySQL
    @@ -95,19 +96,23 @@

    Full list of features

    Prism forces you to use the correct element for marking up code: <code>. On its own for inline code, or inside a <pre> for blocks of code. In addition, the language is defined through the way recommended in the HTML5 draft: through a language-xxxx class. -
  • The language definition is inherited. This means that if multiple code snippets have the same language, you can just define it once, in one of their common ancestors.
  • -
  • Supports parallelism with Web Workers, if available. Disabled by default (why?).
  • -
  • Very easy to extend without modifying the code, due to Prism’s plugin architecture. Multiple hooks are scattered throughout the source.
  • -
  • Very easy to define new languages. Only thing you need is a good understanding of regular expressions
  • -
  • All styling is done through CSS, with sensible class names rather than ugly namespaced abbreviated nonsense.
  • -
  • Wide browser support: Edge, IE11, Firefox, Chrome, Safari, Opera, most Mobile browsers
  • -
  • Highlights embedded languages (e.g. CSS inside HTML, JavaScript inside HTML)
  • -
  • Highlights inline code as well, not just code blocks
  • -
  • Highlights nested languages (CSS in HTML, JavaScript in HTML)
  • -
  • It doesn’t force you to use any Prism-specific markup, not even a Prism-specific class name, only standard markup you should be using anyway. So, you can just try it for a while, remove it if you don’t like it and leave no traces behind.
  • -
  • Highlight specific lines and/or line ranges (requires plugin)
  • -
  • Show invisible characters like tabs, line breaks etc (requires plugin)
  • -
  • Autolink URLs and emails, use Markdown links in comments (requires plugin)
  • +
  • The language-xxxx class is inherited. + This means that if multiple code snippets have the same language, you can just define it once,in one of their common ancestors.
  • +
  • Supports parallelism with Web Workers, if available. + Disabled by default (why?).
  • +
  • Very easy to extend without modifying the code, due to Prism’s plugin architecture. + Multiple hooks are scattered throughout the source.
  • +
  • Very easy to define new languages. + The only thing you need is a good understanding of regular expressions.
  • +
  • All styling is done through CSS, with sensible class names rather than ugly, namespaced, abbreviated nonsense.
  • +
  • Wide browser support: Edge, IE11, Firefox, Chrome, Safari, Opera, most mobile browsers.
  • +
  • Highlights embedded languages (e.g. CSS inside HTML, JavaScript inside HTML).
  • +
  • Highlights inline code as well, not just code blocks.
  • +
  • It doesn’t force you to use any Prism-specific markup, not even a Prism-specific class name, only standard markup you should be using anyway. + So, you can just try it for a while, remove it if you don’t like it and leave no traces behind.
  • +
  • Highlight specific lines and/or line ranges (requires plugin).
  • +
  • Show invisible characters like tabs, line breaks etc (requires plugin).
  • +
  • Autolink URLs and emails, use Markdown links in comments (requires plugin).
@@ -128,32 +133,50 @@

Basic usage

<!DOCTYPE html>
 <html>
 <head>
-	...
-	<link href="themes/prism.css" rel="stylesheet" />
-</head>
+	...
+	<link href="themes/prism.css" rel="stylesheet" />
+</head>
 <body>
-	...
-	<script src="prism.js"></script>
-</body>
+	...
+	<script src="prism.js"></script>
+</body>
 </html>

Prism does its best to encourage good authoring practices. Therefore, it only works with <code> elements, since marking up code without a <code> element is semantically invalid. According to the HTML5 spec, the recommended way to define a code language is a language-xxxx class, which is what Prism uses. Alternatively, Prism also supports a shorter version: lang-xxxx.

-

To make things easier however, Prism assumes that this language definition is inherited. Therefore, if multiple <code> elements have the same language, you can add the language-xxxx class on one of their common ancestors. - This way, you can also define a document-wide default language, by adding a language-xxxx class on the <body> or <html> element.

- -

If you want to opt-out of highlighting for a <code> element that is a descendant of an element with a declared code language, you can add the class language-none to it (or any non-existing language, really).

The recommended way to mark up a code block (both for semantics and for Prism) is a <pre> element with a <code> element inside, like so:

+
<pre><code class="language-css">p { color: red }</code></pre>
+

If you use that pattern, the <pre> will automatically get the language-xxxx class (if it doesn’t already have it) and will be styled as a code block.

-

If you want to prevent any elements from being automatically highlighted and instead use the API, you can set Prism.manual to true before the DOMContentLoaded event is fired. By setting the data-manual attribute on the <script> element containing Prism core, this will be done automatically. +

Inline code snippets are done like this:

+ +
<code class="language-css">p { color: red }</code>
+ +

Note: You have to escape all < and & characters inside <code> elements (code blocks and inline snippets) with &lt; and &amp; respectively, or else the browser might interpret them as an HTML tag or entity. If you have large portions of HTML code, you can use the Unescaped Markup plugin to work around this.

+ +

Language inheritance

+ +

To make things easier however, Prism assumes that the language class is inherited. Therefore, if multiple <code> elements have the same language, you can add the language-xxxx class on one of their common ancestors. + This way, you can also define a document-wide default language, by adding a language-xxxx class on the <body> or <html> element.

+ +

If you want to opt-out of highlighting a <code> element that inherits its language, you can add the language-none class to it. The none language can also be inherited to disable highlighting for the element with the class and all of its descendants.

+ +

If you want to opt-out of highlighting but still use plugins like Show Invisibles, add use language-plain class instead.

+ +

Manual highlighting

+ +

If you want to prevent any elements from being automatically highlighted and instead use the API, you can set Prism.manual to true before the DOMContentLoaded event is fired. By setting the data-manual attribute on the <script> element containing Prism core, this will be done automatically. Example:

+
<script src="prism.js" data-manual></script>
+

or

+
<script>
 window.Prism = window.Prism || {};
 window.Prism.manual = true;
@@ -164,21 +187,23 @@ 

Usage with CDNs

In combination with CDNs, we recommend using the Autoloader plugin which automatically loads languages when necessary.

-

The setup of the Autoloader, will look like the following. You can also your own themes of course.

+

The setup of the Autoloader, will look like the following. You can also add your own themes of course.

<!DOCTYPE html>
 <html>
 <head>
-	...
-	<link href="https://myCDN.com/prism@v1.x/themes/prism.css" rel="stylesheet" />
-</head>
+	...
+	<link href="https://{{cdn}}/prismjs@v1.x/themes/prism.css" rel="stylesheet" />
+</head>
 <body>
-	...
-	<script src="https://myCDN.com/prism@v1.x/components/prism-core.min.js"></script>
-	<script src="https://myCDN.com/prism@v1.x/plugins/autoloader/prism-autoloader.min.js"></script>
-</body>
+	...
+	<script src="https://{{cdn}}/prismjs@v1.x/components/prism-core.min.js"></script>
+	<script src="https://{{cdn}}/prismjs@v1.x/plugins/autoloader/prism-autoloader.min.js"></script>
+</body>
 </html>
+

Please note that links in the above code sample serve as placeholders. You have to replace them with valid links to the CDN of your choice.

+

CDNs which provide PrismJS are e.g. cdnjs, jsDelivr, and UNPKG.

Usage with Webpack, Browserify, & Other Bundlers

@@ -263,8 +288,8 @@

Third-party tutorials

Several tutorials have been written by members of the community to help you integrate Prism into multiple different website types and configurations:

Please note that the tutorials listed here are not verified to contain correct information. Read at your risk and always check the official documentation here if something doesn’t work :)

@@ -294,8 +322,9 @@

Credits

- + + + @@ -374,7 +374,7 @@

Workarounds

- + diff --git a/package-lock.json b/package-lock.json index ca8d097d40..51f76b340c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5915 +1,8545 @@ { - "name": "prismjs", - "version": "1.21.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/parser": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.3.tgz", - "integrity": "sha512-oJtNJCMFdIMwXGmx+KxuaD7i3b8uS7TTFYW/FNG2BT8m+fmGHoiPYoH0Pe3gya07WuFmM5FCDIr1x0irkD/hyA==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/node": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", - "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", - "dev": true - }, - "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", - "dev": true - }, - "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", - "dev": true - }, - "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - } - }, - "acorn-walk": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", - "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", - "dev": true - }, - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "requires": { - "ansi-wrap": "^0.1.0" - } - }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "dev": true, - "requires": { - "buffer-equal": "^1.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "dev": true, - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "dev": true, - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true - }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "dev": true, - "requires": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", - "dev": true - }, - "array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "dev": true, - "requires": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true - }, - "async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", - "dev": true, - "requires": { - "async-done": "^1.2.2" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, - "bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", - "dev": true, - "requires": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "beeper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-2.0.0.tgz", - "integrity": "sha512-+ShExQEewPvKdTUOtCAJmkUAgEyNF0QqgiAhPRE5xLvoFkIPt8xuHKaz1gMLzSMS73beHWs9gbRBngdH61nVWw==", - "dev": true, - "requires": { - "delay": "^4.1.0" - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "binaryextensions": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.2.tgz", - "integrity": "sha512-xVNN69YGDghOqCCtA6FI7avYrr02mTJjOgB0/f1VPD3pJC8QEvjTKWc4epDx8AqxxA75NI0QpVM2gPJXUbE4Tg==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "catharsis": { - "version": "0.8.11", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", - "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - } - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "clipboard": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz", - "integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==", - "optional": true, - "requires": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "cloneable-readable": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", - "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - } - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "dev": true, - "requires": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "dev": true - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "concat-with-sourcemaps": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", - "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "copy-props": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", - "dev": true, - "requires": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "cssom": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", - "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==", - "dev": true - }, - "cssstyle": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.1.tgz", - "integrity": "sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A==", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "data-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "dev": true, - "requires": { - "kind-of": "^5.0.2" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "del": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", - "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "globby": "^6.1.0", - "is-path-cwd": "^2.0.0", - "is-path-in-cwd": "^2.0.0", - "p-map": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^2.6.3" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - } - } - }, - "delay": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-4.3.0.tgz", - "integrity": "sha512-Lwaf3zVFDMBop1yDuFZ19F9WyGcZcGacsbdlZtWjQmM50tOcMntm1njF/Nb/Vjij3KaSvCF+sEYGKrrjObu2NA==", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", - "optional": true - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "docdash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/docdash/-/docdash-1.2.0.tgz", - "integrity": "sha512-IYZbgYthPTspgqYeciRJNPhSwL51yer7HAwDXhF5p+H7mTDbPvY3PCk/QDjNxdPCpWkaJVFC4t7iCNB/t9E5Kw==", - "dev": true - }, - "dom-serializer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", - "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" - } - }, - "domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", - "dev": true - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "domhandler": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.0.0.tgz", - "integrity": "sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1" - } - }, - "domutils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.0.0.tgz", - "integrity": "sha512-n5SelJ1axbO636c2yUtOGia/IcJtVtlhQbFiVDBZHKV5ReJO1ViX7sFEemtuyoAnBxk5meNSYgA8V4s0271efg==", - "dev": true, - "requires": { - "dom-serializer": "^0.2.1", - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0" - } - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.1", - "object.defaults": "^1.1.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "editions": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", - "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", - "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", - "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", - "dev": true, - "requires": { - "type": "^2.0.0" - }, - "dependencies": { - "type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", - "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", - "dev": true - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fancy-log": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", - "dev": true, - "requires": { - "ansi-gray": "^0.1.1", - "color-support": "^1.1.3", - "parse-node-version": "^1.0.0", - "time-stamp": "^1.0.0" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", - "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" - } - }, - "flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", - "dev": true - }, - "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", - "dev": true - } - } - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", - "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", - "dev": true, - "requires": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" - } - }, - "glob-watcher": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", - "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "object.defaults": "^1.1.0" - } - }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "dev": true, - "requires": { - "sparkles": "^1.0.0" - } - }, - "good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "optional": true, - "requires": { - "delegate": "^3.1.2" - } - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", - "dev": true, - "requires": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" - }, - "dependencies": { - "gulp-cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", - "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", - "dev": true, - "requires": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.1.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.0.1", - "yargs": "^7.1.0" - } - }, - "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - } - } - } - }, - "gulp-concat": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", - "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", - "dev": true, - "requires": { - "concat-with-sourcemaps": "^1.0.0", - "through2": "^2.0.0", - "vinyl": "^2.0.0" - } - }, - "gulp-header": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-2.0.7.tgz", - "integrity": "sha512-qppGkYGQZnt/mRJiiR5wYZIUwNUn47Xpg4+6tHYDVeAW5IDLbHBQwbw7axfMLWGE+gKQpB+yXLeslHMw1/Haog==", - "dev": true, - "requires": { - "concat-with-sourcemaps": "^1.1.0", - "lodash.template": "^4.4.0", - "map-stream": "0.0.7", - "through2": "^2.0.0" - } - }, - "gulp-jsdoc3": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gulp-jsdoc3/-/gulp-jsdoc3-3.0.0.tgz", - "integrity": "sha512-rE2jAwCPA8XFi9g4V3Z3LPhZNjxuMTIYQVMjdqZAQpRfJITLVaUK3xfmiiNTMc7j+fT7pL8Q5yj7ZPRdwCJWNg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1", - "beeper": "^2.0.0", - "debug": "^4.1.1", - "fancy-log": "^1.3.3", - "ink-docstrap": "^1.3.2", - "jsdoc": "^3.6.3", - "map-stream": "0.0.7", - "tmp": "0.1.0" - }, - "dependencies": { - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "gulp-rename": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.4.0.tgz", - "integrity": "sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==", - "dev": true - }, - "gulp-replace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.0.0.tgz", - "integrity": "sha512-lgdmrFSI1SdhNMXZQbrC75MOl1UjYWlOWNbNRnz+F/KHmgxt3l6XstBoAYIdadwETFyG/6i+vWUSCawdC3pqOw==", - "dev": true, - "requires": { - "istextorbinary": "2.2.1", - "readable-stream": "^2.0.1", - "replacestream": "^4.0.0" - } - }, - "gulp-uglify": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.2.tgz", - "integrity": "sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg==", - "dev": true, - "requires": { - "array-each": "^1.0.1", - "extend-shallow": "^3.0.2", - "gulplog": "^1.0.0", - "has-gulplog": "^0.1.0", - "isobject": "^3.0.1", - "make-error-cause": "^1.1.1", - "safe-buffer": "^5.1.2", - "through2": "^2.0.0", - "uglify-js": "^3.0.5", - "vinyl-sourcemaps-apply": "^0.2.0" - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "dev": true, - "requires": { - "glogg": "^1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", - "dev": true, - "requires": { - "sparkles": "^1.0.0" - } - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, - "htmlparser2": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.0.0.tgz", - "integrity": "sha512-cChwXn5Vam57fyXajDtPXL1wTYc8JtLbr2TN76FYu05itVVVealxLowe2B3IEznJG4p9HAYn/0tJaRlGuEglFQ==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", - "entities": "^2.0.0" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "ink-docstrap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", - "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", - "dev": true, - "requires": { - "moment": "^2.14.1", - "sanitize-html": "^1.13.0" - } - }, - "interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-path-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.1.0.tgz", - "integrity": "sha512-Sc5j3/YnM8tDeyCsVeKlm/0p95075DyLmDEIkSgQ7mXkrOX+uTCtmQFm0CYzVyJwcCCmO3k8qfJt17SxQwB5Zw==", - "dev": true - }, - "is-path-in-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", - "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", - "dev": true, - "requires": { - "is-path-inside": "^2.1.0" - } - }, - "is-path-inside": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", - "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", - "dev": true, - "requires": { - "path-is-inside": "^1.0.2" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "requires": { - "is-unc-path": "^1.0.0" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istextorbinary": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.2.1.tgz", - "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", - "dev": true, - "requires": { - "binaryextensions": "2", - "editions": "^1.3.3", - "textextensions": "2" - } - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - } - } - }, - "js2xmlparser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", - "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", - "dev": true, - "requires": { - "xmlcreate": "^2.0.3" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdoc": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz", - "integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==", - "dev": true, - "requires": { - "@babel/parser": "^7.9.4", - "bluebird": "^3.7.2", - "catharsis": "^0.8.11", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.1", - "klaw": "^3.0.0", - "markdown-it": "^10.0.0", - "markdown-it-anchor": "^5.2.7", - "marked": "^0.8.2", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "taffydb": "2.6.2", - "underscore": "~1.10.2" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, - "strip-json-comments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", - "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", - "dev": true - } - } - }, - "jsdom": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-13.2.0.tgz", - "integrity": "sha512-cG1NtMWO9hWpqRNRR3dSvEQa8bFI6iLlqU2x4kwX51FQjp0qus8T9aBaAO6iGp3DeBrhdwuKxckknohkmfvsFw==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "acorn": "^6.0.4", - "acorn-globals": "^4.3.0", - "array-equal": "^1.0.0", - "cssom": "^0.3.4", - "cssstyle": "^1.1.1", - "data-urls": "^1.1.0", - "domexception": "^1.0.1", - "escodegen": "^1.11.0", - "html-encoding-sniffer": "^1.0.2", - "nwsapi": "^2.0.9", - "parse5": "5.1.0", - "pn": "^1.1.0", - "request": "^2.88.0", - "request-promise-native": "^1.0.5", - "saxes": "^3.1.5", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.5.0", - "w3c-hr-time": "^1.0.1", - "w3c-xmlserializer": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^7.0.0", - "ws": "^6.1.2", - "xml-name-validator": "^3.0.0" - } - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "just-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", - "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", - "dev": true, - "requires": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - } - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "^2.0.5" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", - "dev": true, - "requires": { - "flush-write-stream": "^1.0.2" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", - "dev": true, - "requires": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" - } - }, - "linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "lodash.template": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", - "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", - "dev": true, - "requires": { - "lodash._reinterpolate": "~3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", - "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", - "dev": true, - "requires": { - "lodash._reinterpolate": "~3.0.0" - } - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - }, - "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", - "dev": true - }, - "make-error-cause": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", - "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", - "dev": true, - "requires": { - "make-error": "^1.2.0" - } - }, - "make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", - "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "markdown-it": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", - "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "entities": "~2.0.0", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - } - }, - "markdown-it-anchor": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", - "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", - "dev": true - }, - "marked": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", - "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==", - "dev": true - }, - "matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", - "dev": true, - "requires": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "dependencies": { - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, - "mem": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", - "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", - "dev": true - }, - "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", - "dev": true, - "requires": { - "mime-db": "~1.38.0" - } - }, - "mimic-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", - "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", - "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", - "dev": true, - "requires": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" - }, - "dependencies": { - "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "moment": { - "version": "2.27.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", - "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "mute-stdout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", - "dev": true - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", - "dev": true, - "requires": { - "once": "^1.3.2" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nwsapi": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.1.tgz", - "integrity": "sha512-T5GaA1J/d34AC8mkrFD2O0DR17kwJ702ZOtJOsS8RpbsQZVOC2/xYFb1i/cw+xdM54JIlMuojjDOYct8GIWtwg==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "dev": true, - "requires": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "dev": true, - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "object.reduce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "dev": true, - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, - "ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", - "dev": true - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, - "p-try": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.1.0.tgz", - "integrity": "sha512-H2RyIJ7+A3rjkwKC2l5GGtU4H1vkxKCAGsWasNVd0Set+6i4znxbWy6/j16YDPJDWxhsgZiKAstMEP8wCdSpjA==", - "dev": true - }, - "parse-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-node-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", - "dev": true - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parse5": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", - "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "dev": true, - "requires": { - "path-root-regex": "^0.1.0" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", - "dev": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - } - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, - "remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "dev": true, - "requires": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - } - }, - "remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "dev": true, - "requires": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" - } - }, - "replacestream": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz", - "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.3", - "object-assign": "^4.0.1", - "readable-stream": "^2.0.2" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - } - } - }, - "request-promise-core": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, - "request-promise-native": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", - "dev": true, - "requires": { - "request-promise-core": "1.1.2", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "requizzle": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, - "resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", - "dev": true, - "requires": { - "value-or-function": "^3.0.0" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sanitize-html": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.27.0.tgz", - "integrity": "sha512-U1btucGeYVpg0GoK43jPpe/bDCV4cBOGuxzv5NBd0bOjyZdMKY0n98S/vNlO1wVwre0VCj8H3hbzE7gD2+RjKA==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "htmlparser2": "^4.1.0", - "lodash": "^4.17.15", - "postcss": "^7.0.27", - "srcset": "^2.0.1", - "xtend": "^4.0.1" - }, - "dependencies": { - "htmlparser2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", - "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", - "entities": "^2.0.0" - } - } - } - }, - "saxes": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.9.tgz", - "integrity": "sha512-FZeKhJglhJHk7eWG5YM0z46VHmI3KJpMBAQm3xa9meDvd+wevB5GuBB0wc0exPInZiBBHqi00DbS8AcvCGCFMw==", - "dev": true, - "requires": { - "xmlchars": "^1.3.1" - } - }, - "select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", - "optional": true - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true - }, - "semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", - "dev": true, - "requires": { - "sver-compat": "^1.5.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "simple-git": { - "version": "1.110.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.110.0.tgz", - "integrity": "sha512-UYY0rQkknk0P5eb+KW+03F4TevZ9ou0H+LoGaj7iiVgpnZH4wdj/HTViy/1tNNkmIPcmtxuBqXWiYt2YwlRKOQ==", - "dev": true, - "requires": { - "debug": "^4.0.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "srcset": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-2.0.1.tgz", - "integrity": "sha512-00kZI87TdRKwt+P8jj8UZxbfp7mK2ufxcIMWvhAOZNJTRROimpHeruWrGvCZneiuVDLqdyHefVp748ECTnyUBQ==", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, - "stream-exhaust": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", - "dev": true - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", - "dev": true, - "requires": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", - "dev": true - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - }, - "textextensions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-2.4.0.tgz", - "integrity": "sha512-qftQXnX1DzpSV8EddtHIT0eDDEiBF8ywhFYR2lI9xrGtxqKN+CvLXhACeCIGbCpQfxxERbrkZEFb8cZcDKbVZA==", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true - }, - "tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", - "optional": true - }, - "tmp": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", - "dev": true, - "requires": { - "rimraf": "^2.6.3" - } - }, - "to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", - "dev": true, - "requires": { - "through2": "^2.0.3" - } - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "uglify-js": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.2.tgz", - "integrity": "sha512-imog1WIsi9Yb56yRt5TfYVxGmnWs3WSGU73ieSOlMVFwhJCA9W8fqFFMMj4kgDqiS/80LGdsYnWL7O9UcjEBlg==", - "dev": true, - "requires": { - "commander": "~2.19.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "underscore": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", - "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", - "dev": true - }, - "undertaker": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" - } - }, - "undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "dev": true, - "requires": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "v8flags": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", - "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - }, - "vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", - "dev": true, - "requires": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - } - }, - "vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", - "dev": true, - "requires": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" - } - }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, - "requires": { - "source-map": "^0.5.1" - } - }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "dev": true, - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, - "w3c-xmlserializer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.0.1.tgz", - "integrity": "sha512-XZGI1OH/OLQr/NaJhhPmzhngwcAnZDLytsvXnRmlYeRkmbb0I7sqFFA22erq4WQR0sUu17ZSQOAV9mFwCqKRNg==", - "dev": true, - "requires": { - "domexception": "^1.0.1", - "webidl-conversions": "^4.0.2", - "xml-name-validator": "^3.0.0" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "xmlchars": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-1.3.1.tgz", - "integrity": "sha512-tGkGJkN8XqCod7OT+EvGYK5Z4SfDQGD30zAa58OcnAa0RRWgzUEK72tkXhsX1FZd+rgnhRxFtmO+ihkp8LHSkw==", - "dev": true - }, - "xmlcreate": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", - "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - } - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", - "dev": true, - "requires": { - "camelcase": "^3.0.0" - } - }, - "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", - "dev": true, - "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - } - } + "name": "prismjs", + "version": "1.27.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", + "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.10.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.3.tgz", + "integrity": "sha512-oJtNJCMFdIMwXGmx+KxuaD7i3b8uS7TTFYW/FNG2BT8m+fmGHoiPYoH0Pe3gya07WuFmM5FCDIr1x0irkD/hyA==", + "dev": true + }, + "@babel/polyfill": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz", + "integrity": "sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==", + "dev": true, + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.4" + } + }, + "@eslint/eslintrc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", + "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "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==", + "dev": true, + "requires": { + "@octokit/types": "^5.0.0" + } + }, + "@octokit/endpoint": { + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.8.tgz", + "integrity": "sha512-MuRrgv+bM4Q+e9uEvxAB/Kf+Sj0O2JAOBA131uo1o6lgdq1iS8ejKwtqHgdfY91V3rN9R/hdGKFiQYMzVzVBEQ==", + "dev": true, + "requires": { + "@octokit/types": "^5.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + }, + "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 + } + } + }, + "@octokit/plugin-paginate-rest": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", + "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.1" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } + } + }, + "@octokit/plugin-request-log": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz", + "integrity": "sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg==", + "dev": true + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", + "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.1", + "deprecation": "^2.3.1" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } + } + }, + "@octokit/request": { + "version": "5.4.9", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", + "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", + "dev": true, + "requires": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.0.0", + "@octokit/types": "^5.0.0", + "deprecation": "^2.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.1", + "once": "^1.4.0", + "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==", + "dev": true, + "requires": { + "@octokit/types": "^5.0.1", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true + }, + "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 + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } + }, + "@octokit/request-error": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", + "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } + } + }, + "@octokit/rest": { + "version": "16.43.2", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", + "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", + "dev": true, + "requires": { + "@octokit/auth-token": "^2.4.0", + "@octokit/plugin-paginate-rest": "^1.1.1", + "@octokit/plugin-request-log": "^1.0.0", + "@octokit/plugin-rest-endpoint-methods": "2.4.0", + "@octokit/request": "^5.2.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/types": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", + "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", + "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", + "dev": true + }, + "@types/node-fetch": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", + "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", + "dev": true, + "requires": { + "@types/node": "*", + "form-data": "^3.0.0" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, + "a-sync-waterfall": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", + "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==", + "dev": true + }, + "abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "dev": true + }, + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } + } + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "dependencies": { + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + } + } + }, + "ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "requires": { + "ansi-wrap": "^0.1.0" + } + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "requires": { + "buffer-equal": "^1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-initial": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "dev": true, + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", + "dev": true, + "requires": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + } + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-retry": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.2.3.tgz", + "integrity": "sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q==", + "dev": true, + "requires": { + "retry": "0.12.0" + } + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "dev": true, + "requires": { + "async-done": "^1.2.2" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", + "dev": true + }, + "bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "dev": true, + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "basic-auth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", + "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=", + "dev": true + }, + "beeper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-2.0.0.tgz", + "integrity": "sha512-+ShExQEewPvKdTUOtCAJmkUAgEyNF0QqgiAhPRE5xLvoFkIPt8xuHKaz1gMLzSMS73beHWs9gbRBngdH61nVWw==", + "dev": true, + "requires": { + "delay": "^4.1.0" + } + }, + "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==", + "dev": true + }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "binaryextensions": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.2.tgz", + "integrity": "sha512-xVNN69YGDghOqCCtA6FI7avYrr02mTJjOgB0/f1VPD3pJC8QEvjTKWc4epDx8AqxxA75NI0QpVM2gPJXUbE4Tg==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", + "dev": true + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "catharsis": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", + "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-css": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", + "dev": true, + "requires": { + "source-map": "~0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "dev": true, + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, + "comment-parser": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.1.2.tgz", + "integrity": "sha512-AOdq0i8ghZudnYv8RUnHrhTgafUGs61Rdz9jemU5x2lnZwAWyOq7vySo626K59e1fVKH1xSRorJwPVRLSWOoAQ==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-props": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", + "dev": true, + "requires": { + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + } + } + }, + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", + "dev": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "cubic2quad": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cubic2quad/-/cubic2quad-1.1.1.tgz", + "integrity": "sha1-abGcYaP1tB7PLx1fro+wNBWqixU=", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "danger": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/danger/-/danger-10.5.0.tgz", + "integrity": "sha512-KUqwc8WFmW4JqPpgG4cssOZQE1aYRj/If/ZX+XNOsMRhxJH5cY9ij6VQH7C/pP64UGqmMNNV6jSsbxOOAWMy4w==", + "dev": true, + "requires": { + "@babel/polyfill": "^7.2.5", + "@octokit/rest": "^16.43.1", + "async-retry": "1.2.3", + "chalk": "^2.3.0", + "commander": "^2.18.0", + "debug": "^4.1.1", + "fast-json-patch": "^3.0.0-1", + "get-stdin": "^6.0.0", + "gitlab": "^10.0.1", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.1", + "hyperlinker": "^1.0.0", + "json5": "^2.1.0", + "jsonpointer": "^4.0.1", + "jsonwebtoken": "^8.4.0", + "lodash.find": "^4.6.0", + "lodash.includes": "^4.3.0", + "lodash.isobject": "^3.0.2", + "lodash.keys": "^4.0.8", + "lodash.mapvalues": "^4.6.0", + "lodash.memoize": "^4.1.2", + "memfs-or-file-map-to-github-branch": "^1.1.0", + "micromatch": "^3.1.10", + "node-cleanup": "^2.1.2", + "node-fetch": "2.6.1", + "override-require": "^1.1.1", + "p-limit": "^2.1.0", + "parse-diff": "^0.7.0", + "parse-git-config": "^2.0.3", + "parse-github-url": "^1.0.2", + "parse-link-header": "^1.0.1", + "pinpoint": "^1.1.0", + "prettyjson": "^1.2.1", + "readline-sync": "^1.4.9", + "require-from-string": "^2.0.2", + "supports-hyperlinks": "^1.0.1" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + } + } + }, + "data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "dev": true + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "requires": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + }, + "dependencies": { + "tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true + }, + "whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "requires": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + } + } + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deepmerge": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.3.0.tgz", + "integrity": "sha512-GRQOafGHwMHpjPx9iCvTgpu9NojZ49q794EEL94JVEw6VaeA8XTUyBKvAkOOjBX9oJNiV6G3P+T+tihFjo2TqA==", + "dev": true + }, + "default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, + "requires": { + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "del": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "delay": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-4.3.0.tgz", + "integrity": "sha512-Lwaf3zVFDMBop1yDuFZ19F9WyGcZcGacsbdlZtWjQmM50tOcMntm1njF/Nb/Vjij3KaSvCF+sEYGKrrjObu2NA==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "docdash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/docdash/-/docdash-1.2.0.tgz", + "integrity": "sha512-IYZbgYthPTspgqYeciRJNPhSwL51yer7HAwDXhF5p+H7mTDbPvY3PCk/QDjNxdPCpWkaJVFC4t7iCNB/t9E5Kw==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", + "dev": true + }, + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "requires": { + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } + } + }, + "domhandler": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.0.0.tgz", + "integrity": "sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1" + } + }, + "domutils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.0.0.tgz", + "integrity": "sha512-n5SelJ1axbO636c2yUtOGia/IcJtVtlhQbFiVDBZHKV5ReJO1ViX7sFEemtuyoAnBxk5meNSYgA8V4s0271efg==", + "dev": true, + "requires": { + "dom-serializer": "^0.2.1", + "domelementtype": "^2.0.1", + "domhandler": "^3.0.0" + } + }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "ecstatic": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz", + "integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==", + "dev": true, + "requires": { + "he": "^1.1.1", + "mime": "^1.6.0", + "minimist": "^1.1.0", + "url-join": "^2.0.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "editions": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "eslint": { + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", + "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.21", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "eslint-plugin-jsdoc": { + "version": "32.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-32.3.0.tgz", + "integrity": "sha512-zyx7kajDK+tqS1bHuY5sapkad8P8KT0vdd/lE55j47VPG2MeenSYuIY/M/Pvmzq5g0+3JB+P3BJGUXmHxtuKPQ==", + "dev": true, + "requires": { + "comment-parser": "1.1.2", + "debug": "^4.3.1", + "jsdoctypeparser": "^9.0.0", + "lodash": "^4.17.20", + "regextras": "^0.7.1", + "semver": "^7.3.4", + "spdx-expression-parse": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + } + } + }, + "eslint-plugin-regexp": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.4.0.tgz", + "integrity": "sha512-H+APSyKFrhPOaVAdsLa3qLPD6SgkzNPypxM+lnx5fwbUY9Pcw5XV3bJkxt7JIjdsL1B5NMdQXOhN3N8LtyVa5A==", + "dev": true, + "requires": { + "comment-parser": "^1.1.2", + "eslint-utils": "^3.0.0", + "grapheme-splitter": "^1.0.4", + "jsdoctypeparser": "^9.0.0", + "refa": "^0.9.0", + "regexp-ast-analysis": "^0.3.0", + "regexpp": "^3.2.0", + "scslre": "^0.1.6" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + }, + "regexp-ast-analysis": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.3.0.tgz", + "integrity": "sha512-11PlbBSUxwWpdj6BdZUKfhDdV9g+cveqHB+BqBQDBD7ZermDBVgtyowUaXTvT0dO3tZYo2bDIr/GoED6X1aYSA==", + "dev": true, + "requires": { + "refa": "^0.9.0", + "regexpp": "^3.2.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "dev": true, + "requires": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + } + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + } + }, + "fast-json-patch": { + "version": "3.0.0-1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.0.0-1.tgz", + "integrity": "sha512-6pdFb07cknxvPzCeLsFHStEy+MysPJPgZQ9LbQ/2O67unQF93SNqfdSqnPPl71YMHX+AD8gbl7iuoGFzHEdDuw==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "dev": true, + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + } + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "follow-redirects": { + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + } + } + }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "requires": { + "fetch-blob": "^3.1.2" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", + "dev": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "geometry-interfaces": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/geometry-interfaces/-/geometry-interfaces-1.1.4.tgz", + "integrity": "sha512-qD6OdkT6NcES9l4Xx3auTpwraQruU7dARbQPVO71MKvkGYw5/z/oIiGymuFXrRaEQa5Y67EIojUpaLeGEa5hGA==", + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + } + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "git-config-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", + "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "homedir-polyfill": "^1.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "gitlab": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/gitlab/-/gitlab-10.2.1.tgz", + "integrity": "sha512-z+DxRF1C9uayVbocs9aJkJz+kGy14TSm1noB/rAIEBbXOkOYbjKxyuqJzt+0zeFpXFdgA0yq6DVVbvM7HIfGwg==", + "dev": true, + "requires": { + "form-data": "^2.5.0", + "humps": "^2.0.1", + "ky": "^0.12.0", + "ky-universal": "^0.3.0", + "li": "^1.3.0", + "query-string": "^6.8.2", + "universal-url": "^2.0.0" + }, + "dependencies": { + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + } + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "glob-watcher": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", + "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "object.defaults": "^1.1.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globals": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", + "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "glogg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "gulp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "dev": true, + "requires": { + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", + "vinyl-fs": "^3.0.0" + }, + "dependencies": { + "gulp-cli": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", + "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", + "dev": true, + "requires": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.1.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.0.1", + "yargs": "^7.1.0" + } + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + } + } + }, + "gulp-clean-css": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-4.3.0.tgz", + "integrity": "sha512-mGyeT3qqFXTy61j0zOIciS4MkYziF2U594t2Vs9rUnpkEHqfu6aDITMp8xOvZcvdX61Uz3y1mVERRYmjzQF5fg==", + "dev": true, + "requires": { + "clean-css": "4.2.3", + "plugin-error": "1.0.1", + "through2": "3.0.1", + "vinyl-sourcemaps-apply": "0.2.1" + }, + "dependencies": { + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "gulp-concat": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", + "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", + "dev": true, + "requires": { + "concat-with-sourcemaps": "^1.0.0", + "through2": "^2.0.0", + "vinyl": "^2.0.0" + } + }, + "gulp-header": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-2.0.7.tgz", + "integrity": "sha512-qppGkYGQZnt/mRJiiR5wYZIUwNUn47Xpg4+6tHYDVeAW5IDLbHBQwbw7axfMLWGE+gKQpB+yXLeslHMw1/Haog==", + "dev": true, + "requires": { + "concat-with-sourcemaps": "^1.1.0", + "lodash.template": "^4.4.0", + "map-stream": "0.0.7", + "through2": "^2.0.0" + } + }, + "gulp-jsdoc3": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-jsdoc3/-/gulp-jsdoc3-3.0.0.tgz", + "integrity": "sha512-rE2jAwCPA8XFi9g4V3Z3LPhZNjxuMTIYQVMjdqZAQpRfJITLVaUK3xfmiiNTMc7j+fT7pL8Q5yj7ZPRdwCJWNg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1", + "beeper": "^2.0.0", + "debug": "^4.1.1", + "fancy-log": "^1.3.3", + "ink-docstrap": "^1.3.2", + "jsdoc": "^3.6.3", + "map-stream": "0.0.7", + "tmp": "0.1.0" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "gulp-rename": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.4.0.tgz", + "integrity": "sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==", + "dev": true + }, + "gulp-replace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.0.0.tgz", + "integrity": "sha512-lgdmrFSI1SdhNMXZQbrC75MOl1UjYWlOWNbNRnz+F/KHmgxt3l6XstBoAYIdadwETFyG/6i+vWUSCawdC3pqOw==", + "dev": true, + "requires": { + "istextorbinary": "2.2.1", + "readable-stream": "^2.0.1", + "replacestream": "^4.0.0" + } + }, + "gulp-uglify": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.2.tgz", + "integrity": "sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg==", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "extend-shallow": "^3.0.2", + "gulplog": "^1.0.0", + "has-gulplog": "^0.1.0", + "isobject": "^3.0.1", + "make-error-cause": "^1.1.1", + "safe-buffer": "^5.1.2", + "through2": "^2.0.0", + "uglify-js": "^3.0.5", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "^1.0.0" + } + }, + "gzip-size": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", + "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "pify": "^4.0.1" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hasurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hasurl/-/hasurl-1.0.0.tgz", + "integrity": "sha512-43ypUd3DbwyCT01UYpA99AEZxZ4aKtRxWGBHEIbjcOsUghd9YUON0C+JF6isNjaiwC/UF5neaUudy6JS9jZPZQ==", + "dev": true + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.5" + } + }, + "htmlparser2": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.0.0.tgz", + "integrity": "sha512-cChwXn5Vam57fyXajDtPXL1wTYc8JtLbr2TN76FYu05itVVVealxLowe2B3IEznJG4p9HAYn/0tJaRlGuEglFQ==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^3.0.0", + "domutils": "^2.0.0", + "entities": "^2.0.0" + } + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4", + "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "http-server": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.12.3.tgz", + "integrity": "sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==", + "dev": true, + "requires": { + "basic-auth": "^1.0.3", + "colors": "^1.4.0", + "corser": "^2.0.1", + "ecstatic": "^3.3.2", + "http-proxy": "^1.18.0", + "minimist": "^1.2.5", + "opener": "^1.5.1", + "portfinder": "^1.0.25", + "secure-compare": "3.0.1", + "union": "~0.5.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "humps": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/humps/-/humps-2.0.1.tgz", + "integrity": "sha1-3QLqYIG9BWjcXQcxhEY5V7qe+ao=", + "dev": true + }, + "hyperlinker": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", + "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", + "dev": true + }, + "ink-docstrap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", + "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", + "dev": true, + "requires": { + "moment": "^2.14.1", + "sanitize-html": "^1.13.0" + } + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-bigint": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-boolean-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", + "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-number-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", + "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", + "dev": true + }, + "is-path-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.1.0.tgz", + "integrity": "sha512-Sc5j3/YnM8tDeyCsVeKlm/0p95075DyLmDEIkSgQ7mXkrOX+uTCtmQFm0CYzVyJwcCCmO3k8qfJt17SxQwB5Zw==", + "dev": true + }, + "is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "dev": true, + "requires": { + "is-path-inside": "^2.1.0" + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-string": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", + "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "istextorbinary": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.2.1.tgz", + "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", + "dev": true, + "requires": { + "binaryextensions": "2", + "editions": "^1.3.3", + "textextensions": "2" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "js2xmlparser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", + "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", + "dev": true, + "requires": { + "xmlcreate": "^2.0.3" + } + }, + "jsdoc": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz", + "integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==", + "dev": true, + "requires": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.8.11", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^0.8.2", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.10.2" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + } + } + }, + "jsdoctypeparser": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", + "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "dev": true + }, + "jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "requires": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true + }, + "whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "requires": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + } + } + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonpointer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.1.0.tgz", + "integrity": "sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg==", + "dev": true + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "dev": true, + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "just-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", + "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", + "dev": true + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dev": true, + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dev": true, + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "ky": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/ky/-/ky-0.12.0.tgz", + "integrity": "sha512-t9b7v3V2fGwAcQnnDDQwKQGF55eWrf4pwi1RN08Fy8b/9GEwV7Ea0xQiaSW6ZbeghBHIwl8kgnla4vVo9seepQ==", + "dev": true + }, + "ky-universal": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.3.0.tgz", + "integrity": "sha512-CM4Bgb2zZZpsprcjI6DNYTaH3oGHXL2u7BU4DK+lfCuC4snkt9/WRpMYeKbBbXscvKkeqBwzzjFX2WwmKY5K/A==", + "dev": true, + "requires": { + "abort-controller": "^3.0.0", + "node-fetch": "^2.6.0" + }, + "dependencies": { + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "dev": true, + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "li": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/li/-/li-1.3.0.tgz", + "integrity": "sha1-IsWbyu+qmo7zWc91l4TkvxBq6hs=", + "dev": true + }, + "liftoff": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^3.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + } + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.find": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", + "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", + "dev": true + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", + "dev": true + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", + "dev": true + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", + "dev": true + }, + "lodash.isobject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=", + "dev": true + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", + "dev": true + }, + "lodash.keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.2.0.tgz", + "integrity": "sha1-oIYCrBLk+4P5H8H7ejYKTZujUgU=", + "dev": true + }, + "lodash.mapvalues": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", + "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", + "dev": true + }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0" + } + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "macos-release": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz", + "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==", + "dev": true + }, + "make-error": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true + }, + "make-error-cause": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", + "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", + "dev": true, + "requires": { + "make-error": "^1.2.0" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", + "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", + "dev": true + }, + "marked": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", + "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==", + "dev": true + }, + "matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", + "dev": true, + "requires": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + }, + "dependencies": { + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, + "mem": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", + "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "memfs-or-file-map-to-github-branch": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/memfs-or-file-map-to-github-branch/-/memfs-or-file-map-to-github-branch-1.2.0.tgz", + "integrity": "sha512-PloI9AkRXrLQuBU1s7eYQpl+4hkL0U0h23lddMaJ3ZGUufn8pdNRxd1kCfBqL5gISCFQs78ttXS15e4/f5vcTA==", + "dev": true, + "requires": { + "@octokit/rest": "^16.43.1" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "microbuffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/microbuffer/-/microbuffer-1.0.0.tgz", + "integrity": "sha1-izgy7UDIfVH0e7I0kTppinVtGdI=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", + "dev": true + }, + "mime-types": { + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "dev": true, + "requires": { + "mime-db": "~1.38.0" + } + }, + "mimic-fn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", + "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "2.2.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "ms": "2.1.1", + "node-environment-flags": "1.0.5", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", + "yargs-unparser": "1.5.0" + }, + "dependencies": { + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "yargs-parser": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "moment": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", + "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stdout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "dev": true + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "neatequal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/neatequal/-/neatequal-1.0.0.tgz", + "integrity": "sha1-LuEhG8n6bkxVcV/SELsFYC6xrjs=", + "dev": true, + "requires": { + "varstream": "^0.3.2" + } + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-cleanup": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/node-cleanup/-/node-cleanup-2.1.2.tgz", + "integrity": "sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=", + "dev": true + }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true + }, + "node-environment-flags": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } + } + }, + "node-fetch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz", + "integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==", + "dev": true, + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.3", + "formdata-polyfill": "^4.0.10" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nunjucks": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.2.tgz", + "integrity": "sha512-KUi85OoF2NMygwODAy28Lh9qHmq5hO3rBlbkYoC8v377h4l8Pt5qFjILl0LWpMbOrZ18CzfVVUvIHUIrtED3sA==", + "dev": true, + "requires": { + "a-sync-waterfall": "^1.0.0", + "asap": "^2.0.3", + "chokidar": "^3.3.0", + "commander": "^5.1.0" + }, + "dependencies": { + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "optional": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true, + "optional": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "optional": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", + "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "optional": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "optional": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "optional": true + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "optional": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "optional": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-inspect": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", + "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "dev": true + }, + "object-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-name": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", + "dev": true, + "requires": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + } + }, + "override-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/override-require/-/override-require-1.1.1.tgz", + "integrity": "sha1-auIvresfhQ/7DPTCD/e4fl62UN8=", + "dev": true + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "dev": true + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "p-try": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.1.0.tgz", + "integrity": "sha512-H2RyIJ7+A3rjkwKC2l5GGtU4H1vkxKCAGsWasNVd0Set+6i4znxbWy6/j16YDPJDWxhsgZiKAstMEP8wCdSpjA==", + "dev": true + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, + "parse-diff": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/parse-diff/-/parse-diff-0.7.1.tgz", + "integrity": "sha512-1j3l8IKcy4yRK2W4o9EYvJLSzpAVwz4DXqCewYyx2vEwk2gcf3DBPqc8Fj4XV3K33OYJ08A8fWwyu/ykD/HUSg==", + "dev": true + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-git-config": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-2.0.3.tgz", + "integrity": "sha512-Js7ueMZOVSZ3tP8C7E3KZiHv6QQl7lnJ+OkbxoaFazzSa2KyEHqApfGbU3XboUgUnq4ZuUmskUpYKTNx01fm5A==", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "git-config-path": "^1.0.1", + "ini": "^1.3.5" + } + }, + "parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-link-header": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-1.0.1.tgz", + "integrity": "sha1-vt/g0hGK64S+deewJUGeyKYRQKc=", + "dev": true, + "requires": { + "xtend": "~4.0.1" + } + }, + "parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "optional": true + }, + "pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pinpoint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pinpoint/-/pinpoint-1.1.0.tgz", + "integrity": "sha1-DPd1eml38b9/ajIge3CeN3OI6HQ=", + "dev": true + }, + "platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "dev": true + }, + "plugin-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", + "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", + "dev": true, + "requires": { + "ansi-colors": "^1.0.1", + "arr-diff": "^4.0.0", + "arr-union": "^3.1.0", + "extend-shallow": "^3.0.2" + } + }, + "portfinder": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", + "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "dev": true, + "requires": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "postcss": { + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "dev": true + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "prettyjson": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz", + "integrity": "sha1-/P+rQdGcq0365eV15kJGYZsS0ok=", + "dev": true, + "requires": { + "colors": "^1.1.2", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "query-string": { + "version": "6.13.6", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.13.6.tgz", + "integrity": "sha512-/WWZ7d9na6s2wMEGdVCVgKWE9Rt7nYyNIf7k8xmHXcesPMlEzicWo3lbYwHyA4wBktI2KrXxxZeACLbE84hvSQ==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + } + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "dev": true + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "refa": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.9.1.tgz", + "integrity": "sha512-egU8LgFq2VXlAfUi8Jcbr5X38wEOadMFf8tCbshgcpVCYlE7k84pJOSlnvXF+muDB4igkdVMq7Z/kiNPqDT9TA==", + "dev": true, + "requires": { + "regexpp": "^3.2.0" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp-ast-analysis": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.2.4.tgz", + "integrity": "sha512-8L7kOZQaKPxKKAwGuUZxTQtlO3WZ+tiXy4s6G6PKL6trbOXcZoumwC3AOHHFtI/xoSbNxt7jgLvCnP1UADLWqg==", + "dev": true, + "requires": { + "refa": "^0.9.0", + "regexpp": "^3.2.0" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "regextras": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", + "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", + "dev": true + }, + "remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "requires": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" + } + }, + "replacestream": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz", + "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.3", + "object-assign": "^4.0.1", + "readable-stream": "^2.0.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "resolve": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "requires": { + "value-or-function": "^3.0.0" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sanitize-html": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.27.0.tgz", + "integrity": "sha512-U1btucGeYVpg0GoK43jPpe/bDCV4cBOGuxzv5NBd0bOjyZdMKY0n98S/vNlO1wVwre0VCj8H3hbzE7gD2+RjKA==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "htmlparser2": "^4.1.0", + "lodash": "^4.17.15", + "postcss": "^7.0.27", + "srcset": "^2.0.1", + "xtend": "^4.0.1" + }, + "dependencies": { + "htmlparser2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", + "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^3.0.0", + "domutils": "^2.0.0", + "entities": "^2.0.0" + } + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "scslre": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.1.6.tgz", + "integrity": "sha512-JORxVRlQTfjvlOAaiQKebgFElyAm5/W8b50lgaZ0OkEnKnagJW2ufDh3xRfU75UD9z3FGIu1gL1IyR3Poa6Qmw==", + "dev": true, + "requires": { + "refa": "^0.9.0", + "regexp-ast-analysis": "^0.2.3", + "regexpp": "^3.2.0" + } + }, + "secure-compare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", + "integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", + "dev": true, + "requires": { + "sver-compat": "^1.5.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "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==", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-git": { + "version": "1.110.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.110.0.tgz", + "integrity": "sha512-UYY0rQkknk0P5eb+KW+03F4TevZ9ou0H+LoGaj7iiVgpnZH4wdj/HTViy/1tNNkmIPcmtxuBqXWiYt2YwlRKOQ==", + "dev": true, + "requires": { + "debug": "^4.0.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "srcset": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-2.0.1.tgz", + "integrity": "sha512-00kZI87TdRKwt+P8jj8UZxbfp7mK2ufxcIMWvhAOZNJTRROimpHeruWrGvCZneiuVDLqdyHefVp748ECTnyUBQ==", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.fromcodepoint": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string.fromcodepoint/-/string.fromcodepoint-0.2.1.tgz", + "integrity": "sha1-jZeDM8C8klOPUPOD5IiPPlYZ1lM=", + "dev": true + }, + "string.prototype.codepointat": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz", + "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==", + "dev": true + }, + "string.prototype.padend": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz", + "integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", + "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.10.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true + }, + "is-regex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.2" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-hyperlinks": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz", + "integrity": "sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw==", + "dev": true, + "requires": { + "has-flag": "^2.0.0", + "supports-color": "^5.0.0" + }, + "dependencies": { + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + } + } + } + } + }, + "sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", + "dev": true, + "requires": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "svg-pathdata": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-5.0.5.tgz", + "integrity": "sha512-TAAvLNSE3fEhyl/Da19JWfMAdhSXTYeviXsLSoDT1UM76ADj5ndwAPX1FKQEgB/gFMPavOy6tOqfalXKUiXrow==", + "dev": true + }, + "svg2ttf": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/svg2ttf/-/svg2ttf-4.3.0.tgz", + "integrity": "sha512-LZ0B7zzHWLWbzLzwaKGHQvPOuxCXLReIb3LSxFSGUy1gMw2Utk6KGNbTmbmRL6Rk1qDSmTixnDrQgnXaL9n0CA==", + "dev": true, + "requires": { + "argparse": "^1.0.6", + "cubic2quad": "^1.0.0", + "lodash": "^4.17.10", + "microbuffer": "^1.0.0", + "svgpath": "^2.1.5", + "xmldom": "~0.1.22" + } + }, + "svgicons2svgfont": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/svgicons2svgfont/-/svgicons2svgfont-9.1.1.tgz", + "integrity": "sha512-iOj7lqHP/oMrLg7S2Iv89LOJUfmIuePefXcs5ul4IsKwcYvL/T/Buahz+nQQJygyuvEMBBXqnCRmnvJggHeJzA==", + "dev": true, + "requires": { + "commander": "^2.12.2", + "geometry-interfaces": "^1.1.4", + "glob": "^7.1.2", + "neatequal": "^1.0.0", + "readable-stream": "^2.3.3", + "sax": "^1.2.4", + "string.fromcodepoint": "^0.2.1", + "string.prototype.codepointat": "^0.2.0", + "svg-pathdata": "^5.0.0", + "transformation-matrix-js": "^2.7.1" + } + }, + "svgpath": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/svgpath/-/svgpath-2.3.0.tgz", + "integrity": "sha512-N/4UDu3Y2ICik0daMmFW1tplw0XPs1nVIEVYkTiQfj9/JQZeEtAKaSYwheCwje1I4pQ5r22fGpoaNIvGgsyJyg==", + "dev": true + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "table": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", + "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "dev": true, + "requires": { + "ajv": "^7.0.2", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ajv": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.4.tgz", + "integrity": "sha512-nBeQgg/ZZA3u3SYxyaDvpvDtgZ/EZPF547ARgZBrG9Bhu1vKDwAIjtIf+sDtJUKa2zOcEbmRLBRSyMraS/Oy1A==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "textextensions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-2.4.0.tgz", + "integrity": "sha512-qftQXnX1DzpSV8EddtHIT0eDDEiBF8ywhFYR2lI9xrGtxqKN+CvLXhACeCIGbCpQfxxERbrkZEFb8cZcDKbVZA==", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "tmp": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "dev": true, + "requires": { + "rimraf": "^2.6.3" + } + }, + "to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "requires": { + "through2": "^2.0.3" + } + }, + "tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "dev": true, + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "transformation-matrix-js": { + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/transformation-matrix-js/-/transformation-matrix-js-2.7.6.tgz", + "integrity": "sha512-1CxDIZmCQ3vA0GGnkdMQqxUXVm3xXAFmglPYRS1hr37LzSg22TC7QAWOT38OmdUvMEs/rqcnkFoAsqvzdiluDg==", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "ttf2eot": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ttf2eot/-/ttf2eot-2.0.0.tgz", + "integrity": "sha1-jmM3pYWr0WCKDISVirSDzmn2ZUs=", + "dev": true, + "requires": { + "argparse": "^1.0.6", + "microbuffer": "^1.0.0" + } + }, + "ttf2woff": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ttf2woff/-/ttf2woff-2.0.2.tgz", + "integrity": "sha512-X68badwBjAy/+itU49scLjXUL094up+rHuYk+YAOTTBYSUMOmLZ7VyhZJuqQESj1gnyLAC2/5V8Euv+mExmyPA==", + "dev": true, + "requires": { + "argparse": "^1.0.6", + "microbuffer": "^1.0.0", + "pako": "^1.0.0" + } + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "uglify-js": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.2.tgz", + "integrity": "sha512-imog1WIsi9Yb56yRt5TfYVxGmnWs3WSGU73ieSOlMVFwhJCA9W8fqFFMMj4kgDqiS/80LGdsYnWL7O9UcjEBlg==", + "dev": true, + "requires": { + "commander": "~2.19.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + } + } + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "underscore": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", + "dev": true + }, + "undertaker": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", + "dev": true + }, + "union": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", + "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", + "dev": true, + "requires": { + "qs": "^6.4.0" + } + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "requires": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "universal-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universal-url/-/universal-url-2.0.0.tgz", + "integrity": "sha512-3DLtXdm/G1LQMCnPj+Aw7uDoleQttNHp2g5FnNQKR6cP6taNWS1b/Ehjjx4PVyvejKi3TJyu8iBraKM4q3JQPg==", + "dev": true, + "requires": { + "hasurl": "^1.0.0", + "whatwg-url": "^7.0.0" + } + }, + "universal-user-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", + "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", + "dev": true, + "requires": { + "os-name": "^3.1.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url-join": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", + "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "v8flags": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", + "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true + }, + "varstream": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/varstream/-/varstream-0.3.2.tgz", + "integrity": "sha1-GKxklHZfP/GjWtmkvgU77BiKXeE=", + "dev": true, + "requires": { + "readable-stream": "^1.0.33" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "vinyl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "requires": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + } + }, + "w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "requires": { + "browser-process-hrtime": "^1.0.0" + } + }, + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "requires": { + "xml-name-validator": "^3.0.0" + } + }, + "wawoff2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wawoff2/-/wawoff2-1.0.2.tgz", + "integrity": "sha512-qxuTwf5tAP/XojrRc6cmR0hGvqgD3XUxv2fzfzURKPDfE7AeHmtRuankVxdJ4DRdSKXaE5QlyJT49yBis2vb6Q==", + "dev": true, + "requires": { + "argparse": "^1.0.6" + } + }, + "web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", + "dev": true + }, + "webfont": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/webfont/-/webfont-9.0.0.tgz", + "integrity": "sha512-Sn8KnTXroWAbBHYKUXCUq2rKwqbluupUd7krYqluT+kFGV4dvMuKXaL84Fm/Kfv+5rz2S81jNRvcyQ6ySBiC2Q==", + "dev": true, + "requires": { + "cosmiconfig": "^5.2.0", + "deepmerge": "^3.2.0", + "fs-extra": "^7.0.1", + "globby": "^9.2.0", + "meow": "^5.0.0", + "nunjucks": "^3.2.0", + "p-limit": "^2.2.0", + "resolve-from": "^5.0.0", + "svg2ttf": "^4.0.0", + "svgicons2svgfont": "^9.0.3", + "ttf2eot": "^2.0.0", + "ttf2woff": "^2.0.0", + "wawoff2": "^1.0.2", + "xml2js": "^0.4.17" + }, + "dependencies": { + "globby": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", + "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^1.0.2", + "dir-glob": "^2.2.2", + "fast-glob": "^2.2.6", + "glob": "^7.1.3", + "ignore": "^4.0.3", + "pify": "^4.0.1", + "slash": "^2.0.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + } + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "windows-release": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz", + "integrity": "sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==", + "dev": true, + "requires": { + "execa": "^1.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "xmlcreate": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", + "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", + "dev": true + }, + "xmldom": { + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", + "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "yargs-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + } + } } diff --git a/package.json b/package.json old mode 100755 new mode 100644 index b498d9317a..201c71bac1 --- a/package.json +++ b/package.json @@ -1,65 +1,87 @@ { - "name": "prismjs", - "version": "1.21.0", - "description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.", - "main": "prism.js", - "style": "themes/prism.css", - "scripts": { - "build": "gulp", - "test:aliases": "mocha tests/aliases-test.js", - "test:core": "mocha tests/core/**/*.js", - "test:dependencies": "mocha tests/dependencies-test.js", - "test:examples": "mocha tests/examples-test.js", - "test:identifiers": "mocha tests/identifier-test.js", - "test:languages": "mocha tests/run.js", - "test:patterns": "mocha tests/pattern-tests.js", - "test:plugins": "mocha tests/plugins/**/*.js", - "test:runner": "mocha tests/testrunner-tests.js", - "test": "npm run test:runner && npm run test:core && npm run test:dependencies && npm run test:languages && npm run test:plugins && npm run test:aliases && npm run test:patterns && npm run test:examples && npm run test:identifiers" - }, - "repository": { - "type": "git", - "url": "https://github.com/PrismJS/prism.git" - }, - "keywords": [ - "prism", - "highlight" - ], - "author": "Lea Verou", - "license": "MIT", - "readmeFilename": "README.md", - "optionalDependencies": { - "clipboard": "^2.0.0" - }, - "devDependencies": { - "chai": "^4.2.0", - "del": "^4.1.1", - "docdash": "^1.2.0", - "gulp": "^4.0.2", - "gulp-concat": "^2.3.4", - "gulp-header": "^2.0.7", - "gulp-jsdoc3": "^3.0.0", - "gulp-rename": "^1.2.0", - "gulp-replace": "^1.0.0", - "gulp-uglify": "^3.0.1", - "htmlparser2": "^4.0.0", - "jsdom": "^13.0.0", - "mocha": "^6.2.0", - "pump": "^3.0.0", - "regexpp": "^2.0.1", - "simple-git": "^1.107.0", - "yargs": "^13.2.2" - }, - "jspm": { - "main": "prism", - "registry": "jspm", - "jspmPackage": true, - "format": "global", - "files": [ - "components/**/*.js", - "plugins/**/*", - "themes/*.css", - "prism.js" - ] - } + "name": "prismjs", + "version": "1.27.0", + "description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.", + "main": "prism.js", + "style": "themes/prism.css", + "engines": { + "node": ">=6" + }, + "scripts": { + "benchmark": "node benchmark/benchmark.js", + "build": "gulp", + "start": "http-server -c-1", + "lint": "eslint . --cache", + "lint:fix": "npm run lint -- --fix", + "lint:ci": "eslint . --max-warnings 0", + "regex-coverage": "mocha tests/coverage.js", + "test:aliases": "mocha tests/aliases-test.js", + "test:core": "mocha tests/core/**/*.js", + "test:dependencies": "mocha tests/dependencies-test.js", + "test:examples": "mocha tests/examples-test.js", + "test:identifiers": "mocha tests/identifier-test.js", + "test:languages": "mocha tests/run.js", + "test:patterns": "mocha tests/pattern-tests.js", + "test:plugins": "mocha tests/plugins/**/*.js", + "test:runner": "mocha tests/testrunner-tests.js", + "test": "npm-run-all test:*" + }, + "repository": { + "type": "git", + "url": "https://github.com/PrismJS/prism.git" + }, + "keywords": [ + "prism", + "highlight" + ], + "author": "Lea Verou", + "license": "MIT", + "readmeFilename": "README.md", + "devDependencies": { + "@types/node-fetch": "^2.5.5", + "benchmark": "^2.1.4", + "chai": "^4.2.0", + "danger": "^10.5.0", + "del": "^4.1.1", + "docdash": "^1.2.0", + "eslint": "^7.22.0", + "eslint-plugin-jsdoc": "^32.3.0", + "eslint-plugin-regexp": "^1.4.0", + "gulp": "^4.0.2", + "gulp-clean-css": "^4.3.0", + "gulp-concat": "^2.3.4", + "gulp-header": "^2.0.7", + "gulp-jsdoc3": "^3.0.0", + "gulp-rename": "^1.2.0", + "gulp-replace": "^1.0.0", + "gulp-uglify": "^3.0.1", + "gzip-size": "^5.1.1", + "htmlparser2": "^4.0.0", + "http-server": "^0.12.3", + "jsdom": "^16.7.0", + "mocha": "^6.2.0", + "node-fetch": "^3.1.1", + "npm-run-all": "^4.1.5", + "prettier": "^2.4.1", + "pump": "^3.0.0", + "refa": "^0.9.1", + "regexp-ast-analysis": "^0.2.4", + "regexpp": "^3.2.0", + "scslre": "^0.1.6", + "simple-git": "^1.107.0", + "webfont": "^9.0.0", + "yargs": "^13.2.2" + }, + "jspm": { + "main": "prism", + "registry": "jspm", + "jspmPackage": true, + "format": "global", + "files": [ + "components/**/*.js", + "plugins/**/*", + "themes/*.css", + "prism.js" + ] + } } diff --git a/plugins/autolinker/index.html b/plugins/autolinker/index.html index c1ac1abff2..b4e4a282c7 100644 --- a/plugins/autolinker/index.html +++ b/plugins/autolinker/index.html @@ -9,7 +9,7 @@ - + @@ -48,7 +48,7 @@

CSS

HTML

<!-- Links in HTML, woo!
 Lea Verou http://lea.verou.me or, with Markdown, [Lea Verou](http://lea.verou.me) -->
-<img src="http://prismjs.com/img/spectrum.png" alt="In attributes too!" />
+<img src="https://prismjs.com/assets/img/spectrum.png" alt="In attributes too!" />
 <p>Autolinking in raw text: http://prismjs.com</p>
@@ -56,7 +56,7 @@

HTML

- + diff --git a/plugins/autolinker/prism-autolinker.js b/plugins/autolinker/prism-autolinker.js index ed70c1dca7..7846dba519 100644 --- a/plugins/autolinker/prism-autolinker.js +++ b/plugins/autolinker/prism-autolinker.js @@ -1,81 +1,76 @@ -(function(){ +(function () { -if ( - typeof self !== 'undefined' && !self.Prism || - typeof global !== 'undefined' && !global.Prism -) { - return; -} + if (typeof Prism === 'undefined') { + return; + } -var url = /\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/, - email = /\b\S+@[\w.]+[a-z]{2}/, - linkMd = /\[([^\]]+)]\(([^)]+)\)/, + var url = /\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/; + var email = /\b\S+@[\w.]+[a-z]{2}/; + var linkMd = /\[([^\]]+)\]\(([^)]+)\)/; // Tokens that may contain URLs and emails - candidates = ['comment', 'url', 'attr-value', 'string']; + var candidates = ['comment', 'url', 'attr-value', 'string']; -Prism.plugins.autolinker = { - processGrammar: function (grammar) { - // Abort if grammar has already been processed - if (!grammar || grammar['url-link']) { - return; - } - Prism.languages.DFS(grammar, function (key, def, type) { - if (candidates.indexOf(type) > -1 && !Array.isArray(def)) { - if (!def.pattern) { - def = this[key] = { - pattern: def - }; - } + Prism.plugins.autolinker = { + processGrammar: function (grammar) { + // Abort if grammar has already been processed + if (!grammar || grammar['url-link']) { + return; + } + Prism.languages.DFS(grammar, function (key, def, type) { + if (candidates.indexOf(type) > -1 && !Array.isArray(def)) { + if (!def.pattern) { + def = this[key] = { + pattern: def + }; + } - def.inside = def.inside || {}; + def.inside = def.inside || {}; - if (type == 'comment') { - def.inside['md-link'] = linkMd; - } - if (type == 'attr-value') { - Prism.languages.insertBefore('inside', 'punctuation', { 'url-link': url }, def); - } - else { - def.inside['url-link'] = url; - } + if (type == 'comment') { + def.inside['md-link'] = linkMd; + } + if (type == 'attr-value') { + Prism.languages.insertBefore('inside', 'punctuation', { 'url-link': url }, def); + } else { + def.inside['url-link'] = url; + } - def.inside['email-link'] = email; - } - }); - grammar['url-link'] = url; - grammar['email-link'] = email; - } -}; + def.inside['email-link'] = email; + } + }); + grammar['url-link'] = url; + grammar['email-link'] = email; + } + }; -Prism.hooks.add('before-highlight', function(env) { - Prism.plugins.autolinker.processGrammar(env.grammar); -}); + Prism.hooks.add('before-highlight', function (env) { + Prism.plugins.autolinker.processGrammar(env.grammar); + }); -Prism.hooks.add('wrap', function(env) { - if (/-link$/.test(env.type)) { - env.tag = 'a'; + Prism.hooks.add('wrap', function (env) { + if (/-link$/.test(env.type)) { + env.tag = 'a'; - var href = env.content; + var href = env.content; - if (env.type == 'email-link' && href.indexOf('mailto:') != 0) { - href = 'mailto:' + href; - } - else if (env.type == 'md-link') { - // Markdown - var match = env.content.match(linkMd); + if (env.type == 'email-link' && href.indexOf('mailto:') != 0) { + href = 'mailto:' + href; + } else if (env.type == 'md-link') { + // Markdown + var match = env.content.match(linkMd); - href = match[2]; - env.content = match[1]; - } + href = match[2]; + env.content = match[1]; + } - env.attributes.href = href; + env.attributes.href = href; - // Silently catch any error thrown by decodeURIComponent (#1186) - try { - env.content = decodeURIComponent(env.content); - } catch(e) {} - } -}); + // Silently catch any error thrown by decodeURIComponent (#1186) + try { + env.content = decodeURIComponent(env.content); + } catch (e) { /* noop */ } + } + }); -})(); +}()); diff --git a/plugins/autolinker/prism-autolinker.min.css b/plugins/autolinker/prism-autolinker.min.css new file mode 100644 index 0000000000..3c54381d78 --- /dev/null +++ b/plugins/autolinker/prism-autolinker.min.css @@ -0,0 +1 @@ +.token a{color:inherit} \ No newline at end of file diff --git a/plugins/autolinker/prism-autolinker.min.js b/plugins/autolinker/prism-autolinker.min.js index 91a2567b15..731c4a0c21 100644 --- a/plugins/autolinker/prism-autolinker.min.js +++ b/plugins/autolinker/prism-autolinker.min.js @@ -1 +1 @@ -!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var t=/\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/,r=/\b\S+@[\w.]+[a-z]{2}/,a=/\[([^\]]+)]\(([^)]+)\)/,l=["comment","url","attr-value","string"];Prism.plugins.autolinker={processGrammar:function(i){i&&!i["url-link"]&&(Prism.languages.DFS(i,function(i,n,e){-1 - + @@ -36,11 +36,13 @@

How to use

The plugin will automatically handle missing grammars and load them for you. - To do this, you need to provide it with a directory of all the grammars you want. + To do this, you need to provide a URL to a directory of all the grammars you want. + This can be the path to a local directory with all grammars or a CDN URL.

You can download all the available grammars by clicking on the following link: .
Alternatively, you can also clone the GitHub repo and take the components folder from there. + Read our usage section to use a CDN.

You can then download Prism core and any plugins from the Download page, without checking any languages (or just check the languages you want to load by default, e.g. if you're using a language a lot, then you probably want to save the extra HTTP request). @@ -58,6 +60,10 @@

Specifying the grammars path

Prism.plugins.autoloader.languages_path = 'path/to/grammars/';
+

+ Note: Autoloader is pretty good at guessing this path. You most likely won't have to change this path. +

+

Using development versions

@@ -141,7 +147,7 @@

Markdown

- + diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js index b57c694bdc..69bfa53f29 100644 --- a/plugins/autoloader/prism-autoloader.js +++ b/plugins/autoloader/prism-autoloader.js @@ -1,8 +1,11 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document || !document.createElement) { + + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } + /* eslint-disable */ + /** * The dependencies map is built automatically with gulp. * @@ -11,15 +14,25 @@ var lang_dependencies = /*dependencies_placeholder[*/{ "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", @@ -50,6 +63,7 @@ "handlebars": "markup-templating", "haxe": "clike", "hlsl": "c", + "idris": "haskell", "java": "clike", "javadoc": [ "markup", @@ -74,17 +88,15 @@ ], "less": "css", "lilypond": "scheme", + "liquid": "markup-templating", "markdown": "markup", "markup-templating": "markup", + "mongodb": "javascript", "n4js": "javascript", - "nginx": "clike", "objectivec": "c", "opencl": "c", "parser": "markup", - "php": [ - "clike", - "markup-templating" - ], + "php": "markup-templating", "phpdoc": [ "php", "javadoclike" @@ -98,9 +110,15 @@ "javascript" ], "purebasic": "clike", + "purescript": "haskell", + "qsharp": "clike", "qml": "javascript", "qore": "clike", "racket": "scheme", + "cshtml": [ + "markup", + "csharp" + ], "jsx": [ "markup", "javascript" @@ -120,7 +138,7 @@ "soy": "markup-templating", "sparql": "turtle", "sqf": "clike", - "swift": "clike", + "squirrel": "clike", "t4-cs": [ "t4-templating", "csharp" @@ -135,8 +153,9 @@ "markup-templating" ], "textile": "markup", - "twig": "markup", + "twig": "markup-templating", "typescript": "javascript", + "v": "clike", "vala": "clike", "vbnet": "basic", "velocity": "markup", @@ -156,28 +175,39 @@ "rss": "markup", "js": "javascript", "g4": "antlr4", + "ino": "arduino", "adoc": "asciidoc", + "avs": "avisynth", + "avdl": "avro-idl", "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", + "gni": "gn", + "go-mod": "go-module", + "hbs": "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", @@ -187,32 +217,50 @@ "md": "markdown", "moon": "moonscript", "n4jsd": "n4js", + "nani": "naniscript", "objc": "objectivec", + "qasm": "openqasm", "objectpascal": "pascal", "px": "pcaxis", "pcode": "peoplecode", "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", "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" }/*]*/; + /* eslint-enable */ + /** * @typedef LangDataItem * @property {{ success?: () => void, error?: () => void }[]} callbacks @@ -227,8 +275,8 @@ var script = Prism.util.currentScript(); if (script) { - var autoloaderFile = /\bplugins\/autoloader\/prism-autoloader\.(?:min\.)js(?:\?[^\r\n/]*)?$/i; - var prismFile = /(^|\/)[\w-]+\.(?:min\.)js(?:\?[^\r\n/]*)?$/i; + var autoloaderFile = /\bplugins\/autoloader\/prism-autoloader\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i; + var prismFile = /(^|\/)[\w-]+\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i; var autoloaderPath = script.getAttribute('data-autoloader-path'); if (autoloaderPath != null) { @@ -323,7 +371,7 @@ * @returns {string} */ function getLanguagePath(lang) { - return config.languages_path + 'prism-' + lang + (config.use_minified ? '.min' : '') + '.js' + return config.languages_path + 'prism-' + lang + (config.use_minified ? '.min' : '') + '.js'; } /** @@ -416,7 +464,7 @@ languageCallback(lang, 'error'); }); } - }; + } var dependencies = lang_dependencies[lang]; if (dependencies && dependencies.length) { @@ -453,7 +501,13 @@ } var deps = getDependencies(element); - deps.push(language); + if (/^diff-./i.test(language)) { + // the "diff-xxxx" format is used by the Diff Highlight plugin + deps.push('diff'); + deps.push(language.substr('diff-'.length)); + } else { + deps.push(language); + } if (!deps.every(isLoaded)) { // the language or some dependencies aren't loaded diff --git a/plugins/autoloader/prism-autoloader.min.js b/plugins/autoloader/prism-autoloader.min.js index 8bd4e77e1e..812b2c97ac 100644 --- a/plugins/autoloader/prism-autoloader.min.js +++ b/plugins/autoloader/prism-autoloader.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var l={javascript:"clike",actionscript:"javascript",arduino:"cpp",aspnet:["markup","csharp"],bison:"c",c:"clike",csharp:"clike",cpp:"c",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",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",markdown:"markup","markup-templating":"markup",n4js:"javascript",nginx:"clike",objectivec:"c",opencl:"c",parser:"markup",php:["clike","markup-templating"],phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],purebasic:"clike",qml:"javascript",qore:"clike",racket:"scheme",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",swift:"clike","t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","vbnet"],tap:"yaml",tt2:["clike","markup-templating"],textile:"markup",twig:"markup",typescript:"javascript",vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup","xml-doc":"markup",xquery:"markup"},n={html:"markup",xml:"markup",svg:"markup",mathml:"markup",ssml:"markup",atom:"markup",rss:"markup",js:"javascript",g4:"antlr4",adoc:"asciidoc",shell:"bash",shortcode:"bbcode",rbnf:"bnf",cs:"csharp",dotnet:"csharp",coffee:"coffeescript",conc:"concurnas",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",hs:"haskell",gitignore:"ignore",hgignore:"ignore",npmignore:"ignore",webmanifest:"json",kt:"kotlin",kts:"kotlin",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",objc:"objectivec",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",pq:"powerquery",mscript:"powerquery",pbfasm:"purebasic",py:"python",rkt:"racket",rpy:"renpy",robot:"robotframework",rb:"ruby",sol:"solidity",sln:"solution-file",rq:"sparql",t4:"t4-cs",trig:"turtle",ts:"typescript",uscript:"unrealscript",uc:"unrealscript",vb:"visual-basic",vba:"visual-basic",xeoracube:"xeora",yml:"yaml"},p={},e="components/",a=Prism.util.currentScript();if(a){var r=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,t=/(^|\/)[\w-]+\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,i=a.getAttribute("data-autoloader-path");if(null!=i)e=i.trim().replace(/\/?$/,"/");else{var s=a.src;r.test(s)?e=s.replace(r,"components/"):t.test(s)&&(e=s.replace(t,"$1components/"))}}var o=Prism.plugins.autoloader={languages_path:e,use_minified:!0,loadLanguages:m};Prism.hooks.add("complete",function(e){var a=e.element,r=e.language;if(a&&r&&"none"!==r){var t=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);t.push(r),t.every(u)||m(t,function(){Prism.highlightElement(a)})}})}function u(e){if(0<=e.indexOf("!"))return!1;if((e=n[e]||e)in Prism.languages)return!0;var a=p[e];return a&&!a.error&&!1===a.loading}function m(e,a,r){"string"==typeof e&&(e=[e]);var t=e.length,i=0,s=!1;function c(){s||++i===t&&a&&a(e)}0!==t?e.forEach(function(e){!function(a,r,t){var i=0<=a.indexOf("!");function e(){var e=p[a];e||(e=p[a]={callbacks:[]}),e.callbacks.push({success:r,error:t}),!i&&u(a)?k(a,"success"):!i&&e.error?k(a,"error"):!i&&e.loading||(e.loading=!0,e.error=!1,function(e,a,r){var t=document.createElement("script");t.src=e,t.async=!0,t.onload=function(){document.body.removeChild(t),a&&a()},t.onerror=function(){document.body.removeChild(t),r&&r()},document.body.appendChild(t)}(function(e){return o.languages_path+"prism-"+e+(o.use_minified?".min":"")+".js"}(a),function(){e.loading=!1,k(a,"success")},function(){e.loading=!1,e.error=!0,k(a,"error")}))}a=a.replace("!",""),a=n[a]||a;var s=l[a];s&&s.length?m(s,e,t):e()}(e,c,function(){s||(s=!0,r&&r(e))})}):a&&setTimeout(a,0)}function k(e,a){if(p[e]){for(var r=p[e].callbacks,t=0,i=r.length;t - + @@ -49,6 +49,14 @@

How to use

Optional: To automatically present some lines as output, you can prefix those lines with any string and specify the prefix using the data-filter-output attribute on the <pre> element. For example, data-filter-output="(out)" will treat lines beginning with (out) as output and remove the prefix.

+ +

Output lines are user selectable by default, so if you select the whole content of the code block, it will select the shell commands and any output lines. This may not be desireable if you want to copy/paste just the commands and not the output. If you want to make the output not user selectable then add the following to your CSS:

+ +
.command-line span.token.output {
+	user-select: none;
+}
+ +

Optional: For multi-line commands you can specify the data-continuation-str attribute on the <pre> element. For example, data-continuation-str="\" will treat lines ending with \ as being continued on the following line. Continued lines will have a prompt as set by the attribute data-continuation-prompt or a default of >.

@@ -90,13 +98,33 @@

Windows PowerShell With Output

d-r-- 10/14/2015 5:06 PM Searches d-r-- 10/14/2015 5:06 PM Videos
+

Line continuation with Output (bash)

+
echo "hello"
+(out)hello
+echo one \
+two \
+three
+(out)one two three
+(out)
+echo "goodbye"
+(out)goodbye
+ +

Line continuation with Output (PowerShell)

+
Write-Host `
+'Hello' `
+'from' `
+'PowerShell!'
+(out)Hello from PowerShell!
+Write-Host 'Goodbye from PowerShell!'
+(out)Goodbye from PowerShell!
+
- + diff --git a/plugins/command-line/prism-command-line.css b/plugins/command-line/prism-command-line.css index 153a87076a..984a718c1f 100644 --- a/plugins/command-line/prism-command-line.css +++ b/plugins/command-line/prism-command-line.css @@ -6,6 +6,7 @@ letter-spacing: -1px; margin-right: 1em; pointer-events: none; + text-align: right; -webkit-user-select: none; -moz-user-select: none; @@ -14,7 +15,7 @@ } .command-line-prompt > span:before { - color: #999; + opacity: 0.4; content: ' '; display: block; padding-right: 0.8em; @@ -31,3 +32,12 @@ .command-line-prompt > span[data-prompt]:before { content: attr(data-prompt); } + +.command-line-prompt > span[data-continuation-prompt]:before { + content: attr(data-continuation-prompt); +} + +.command-line span.token.output { + /* Make shell output lines a bit lighter to distinguish them from shell commands */ + opacity: 0.7; +} diff --git a/plugins/command-line/prism-command-line.js b/plugins/command-line/prism-command-line.js index 907fd36df6..415ac5dc95 100644 --- a/plugins/command-line/prism-command-line.js +++ b/plugins/command-line/prism-command-line.js @@ -1,6 +1,6 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } @@ -8,27 +8,31 @@ var PROMPT_CLASS = 'command-line-prompt'; /** @type {(str: string, prefix: string) => boolean} */ - var startsWith = "".startsWith + var startsWith = ''.startsWith ? function (s, p) { return s.startsWith(p); } : function (s, p) { return s.indexOf(p) === 0; }; + // Support for IE11 that has no endsWith() + /** @type {(str: string, suffix: string) => boolean} */ + var endsWith = ''.endsWith + ? function (str, suffix) { + return str.endsWith(suffix); + } + : function (str, suffix) { + var len = str.length; + return str.substring(len - suffix.length, len) === suffix; + }; + /** - * Repeats the given string some number of times. - * - * This is just a polyfill for `String.prototype.repeat`. + * Returns whether the given hook environment has a command line info object. * - * @param {string} str - * @param {number} times - * @returns {string} + * @param {any} env + * @returns {boolean} */ - function repeat(str, times) { - var s = ""; - for (var i = 0; i < times; i++) { - s += str; - } - return s; + function hasCommandLineInfo(env) { + var vars = env.vars = env.vars || {}; + return 'command-line' in vars; } - /** * Returns the command line info object from the given hook environment. * @@ -69,6 +73,22 @@ } var codeLines = env.code.split('\n'); + + var continuationLineIndicies = commandLine.continuationLineIndicies = new Set(); + var lineContinuationStr = pre.getAttribute('data-continuation-str'); + + // Identify code lines that are a continuation line and thus don't need + // a prompt + if (lineContinuationStr && codeLines.length > 1) { + for (var j = 1; j < codeLines.length; j++) { + if (codeLines.hasOwnProperty(j - 1) + && endsWith(codeLines[j - 1], lineContinuationStr)) { + // Mark this line as being a continuation line + continuationLineIndicies.add(j); + } + } + } + commandLine.numberOfLines = codeLines.length; /** @type {string[]} */ var outputLines = commandLine.outputLines = []; @@ -120,15 +140,27 @@ // Reinsert the output lines into the highlighted code. -- cwells var codeLines = env.highlightedCode.split('\n'); var outputLines = commandLine.outputLines || []; - for (var i = 0, l = outputLines.length; i < l; i++) { + for (var i = 0, l = codeLines.length; i < l; i++) { + // Add spans to allow distinction of input/output text for styling if (outputLines.hasOwnProperty(i)) { - codeLines[i] = outputLines[i]; + // outputLines were removed from codeLines so missed out on escaping + // of markup so do it here. + codeLines[i] = '' + + Prism.util.encode(outputLines[i]) + ''; + } else { + codeLines[i] = '' + + codeLines[i] + ''; } } env.highlightedCode = codeLines.join('\n'); }); Prism.hooks.add('complete', function (env) { + if (!hasCommandLineInfo(env)) { + // the previous hooks never ran + return; + } + var commandLine = getCommandLineInfo(env); if (commandLine.complete) { @@ -148,15 +180,29 @@ } // Create the "rows" that will become the command-line prompts. -- cwells - var promptLines; + var promptLines = ''; var rowCount = commandLine.numberOfLines || 0; var promptText = getAttribute('data-prompt', ''); + var promptLine; if (promptText !== '') { - promptLines = repeat('', rowCount); + promptLine = ''; } else { var user = getAttribute('data-user', 'user'); var host = getAttribute('data-host', 'localhost'); - promptLines = repeat('', rowCount); + promptLine = ''; + } + + var continuationLineIndicies = commandLine.continuationLineIndicies || new Set(); + var continuationPromptText = getAttribute('data-continuation-prompt', '>'); + var continuationPromptLine = ''; + + // Assemble all the appropriate prompt/continuation lines + for (var j = 0; j < rowCount; j++) { + if (continuationLineIndicies.has(j)) { + promptLines += continuationPromptLine; + } else { + promptLines += promptLine; + } } // Create the wrapper element. -- cwells diff --git a/plugins/command-line/prism-command-line.min.css b/plugins/command-line/prism-command-line.min.css new file mode 100644 index 0000000000..5e5c875d7e --- /dev/null +++ b/plugins/command-line/prism-command-line.min.css @@ -0,0 +1 @@ +.command-line-prompt{border-right:1px solid #999;display:block;float:left;font-size:100%;letter-spacing:-1px;margin-right:1em;pointer-events:none;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.command-line-prompt>span:before{opacity:.4;content:' ';display:block;padding-right:.8em}.command-line-prompt>span[data-user]:before{content:"[" attr(data-user) "@" attr(data-host) "] $"}.command-line-prompt>span[data-user=root]:before{content:"[" attr(data-user) "@" attr(data-host) "] #"}.command-line-prompt>span[data-prompt]:before{content:attr(data-prompt)}.command-line-prompt>span[data-continuation-prompt]:before{content:attr(data-continuation-prompt)}.command-line span.token.output{opacity:.7} \ No newline at end of file diff --git a/plugins/command-line/prism-command-line.min.js b/plugins/command-line/prism-command-line.min.js index 8a3d34716e..fb2e402b04 100644 --- a/plugins/command-line/prism-command-line.min.js +++ b/plugins/command-line/prism-command-line.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var f=/(?:^|\s)command-line(?:\s|$)/,p="command-line-prompt",m="".startsWith?function(e,t){return e.startsWith(t)}:function(e,t){return 0===e.indexOf(t)};Prism.hooks.add("before-highlight",function(e){var t=h(e);if(!t.complete&&e.code){var n=e.element.parentElement;if(n&&/pre/i.test(n.nodeName)&&(f.test(n.className)||f.test(e.element.className))){var a=e.element.querySelector("."+p);a&&a.remove();var s=e.code.split("\n");t.numberOfLines=s.length;var o=t.outputLines=[],r=n.getAttribute("data-output"),i=n.getAttribute("data-filter-output");if(null!==r)r.split(",").forEach(function(e){var t=e.split("-"),n=parseInt(t[0],10),a=2===t.length?parseInt(t[1],10):n;if(!isNaN(n)&&!isNaN(a)){n<1&&(n=1),a>s.length&&(a=s.length),a--;for(var r=--n;r<=a;r++)o[r]=s[r],s[r]=""}});else if(i)for(var l=0;l',r);else n=d('',r);var o=document.createElement("span");o.className=p,o.innerHTML=n;for(var i=t.outputLines||[],l=0,m=i.length;li.length&&(a=i.length),a--;for(var r=--n;r<=a;r++)l[r]=i[r],i[r]=""}});else if(u)for(var c=0;c'+Prism.util.encode(a[r])+"":n[r]=''+n[r]+"";e.highlightedCode=n.join("\n")}}),Prism.hooks.add("complete",function(e){if(function(e){return"command-line"in(e.vars=e.vars||{})}(e)){var t=N(e);if(!t.complete){var n=e.element.parentElement;v.test(e.element.className)&&(e.element.className=e.element.className.replace(v," ")),v.test(n.className)||(n.className+=" command-line");var a,r="",i=t.numberOfLines||0,s=h("data-prompt","");if(""!==s)a='';else a='';for(var o=t.continuationLineIndicies||new Set,l='")+'">',m=0;m - + - +

How to use

-

In addition to including the plugin file with your PrismJS build, ensure Clipboard.js is loaded before the plugin.

-

The simplest way to include Clipboard.js is to use any of the - recommended CDNs. If you're using Browserify, Clipboard.js will be loaded automatically - if it's included in your package.json. - If you don't load Clipboard.js yourself, the plugin will load it from a CDN for you.

+

The plugin depends on the Prism Toolbar plugin. In addition to including the plugin file with your PrismJS build, ensure it is loaded before the plugin.

+
+ +
+

Settings

+ +

By default, the plugin shows messages in English and sets a 5-second timeout after a click. You can use the following HTML5 data attributes to override the default settings:

+ +
    +
  • data-prismjs-copy — default message displayed by Copy to Clipboard;
  • +
  • data-prismjs-copy-error — a message displayed after failing copying, prompting the user to press Ctrl+C;
  • +
  • data-prismjs-copy-success — a message displayed after a successful copying;
  • +
  • data-prismjs-copy-timeout — a timeout (in milliseconds) after copying. Once the timeout passed, the success or error message will revert back to the default message. The value should be a non-negative integer.
  • +
+ +

The plugin traverses up the DOM tree to find each of these attributes. The search starts at every pre code element and stops at the closest ancestor element that has a desired attribute or at the worst case, at the html element.

+ +

Warning! Although possible, you definitely shouldn't add these attributes to the html element, because a human-readable text should be placed after the character encoding declaration (<meta charset="...">), and the latter must be serialized completely within the first 512 (in older browsers) or 1024 bytes of the document. Consider using the body element or one of its descendants.

+
+ +
+

Styling

+ +

This plugin supports customizing the style of the copy button. To understand how this is done, let's look at the HTML structure of the copy button:

+ +
<button class="copy-to-clipboard-button" type="button" data-copy-state="copy">
+	<span>Copy</span>
+</button>
+ +

The copy-to-clipboard-button class can be used to select the button. The data-copy-state attribute indicates the current state of the plugin with the 3 possible states being:

+ +
    +
  • data-copy-state="copy" — default state;
  • +
  • data-copy-state="copy-error" — the state after failing copying;
  • +
  • data-copy-state="copy-success" — the state after successful copying;
  • +
+ +

These 3 states should be conveyed to the user either by different styling or displaying the button text.

+
+ +
+

Examples

+ +

Sharing

+ +

The following code blocks show modified messages and both use a half-second timeout. The other settings are set to default.

+ +

Source code:

+ +
<body data-prismjs-copy-timeout="500">
+	<pre><code class="language-js" data-prismjs-copy="Copy the JavaScript snippet!">console.log('Hello, world!');</code></pre>
+
+	<pre><code class="language-c" data-prismjs-copy="Copy the C snippet!">int main() {
+	return 0;
+}</code></pre>
+</body>
+ +

Output:

+ +
+
console.log('Hello, world!');
+ +
int main() {
+	return 0;
+}
+
+ +

Inheritance

+ +

The plugin always use the closest ancestor element that has a desired attribute, so it's possible to override any setting on any descendant. In the following example, the baz message is used. The other settings are set to default.

+ +

Source code:

+ +
<body data-prismjs-copy="foo">
+	<main data-prismjs-copy="bar">
+		<pre><code class="language-c" data-prismjs-copy="baz">int main() {
+	return 0;
+}</code></pre>
+	</main>
+</body>
+ +

Output:

+ +
+
+
int main() {
+	return 0;
+}
+
+
+ +

i18n

+ +

You can use the data attributes for internationalization.

+ +

The following code blocks use shared messages in Russian and the default 5-second timeout.

+ +

Source code:

+ +
<!DOCTYPE html>
+<html lang="ru">
+<!-- The head is omitted. -->
+<body
+	data-prismjs-copy="Скопировать"
+	data-prismjs-copy-error="Нажмите Ctrl+C, чтобы скопировать"
+	data-prismjs-copy-success="Скопировано!"
+>
+	<pre><code class="language-c">int main() {
+	return 0;
+}</code></pre>
+
+	<pre><code class="language-js">console.log('Hello, world!');</code></pre>
+</body>
+</html>
+ +

Output:

+ +
+
int main() {
+	return 0;
+}
+ +
console.log('Hello, world!');
+
+ +

The next HTML document is in English, but some code blocks show messages in Russian and simplified Mainland Chinese. The other settings are set to default.

+ +

Source code:

+ +
<!DOCTYPE html>
+<html lang="en"><!-- The head is omitted. -->
+<body>
+	<pre><code class="language-js">console.log('Hello, world!');</code></pre>
+
+	<pre
+		lang="ru"
+		data-prismjs-copy="Скопировать"
+		data-prismjs-copy-error="Нажмите Ctrl+C, чтобы скопировать"
+		data-prismjs-copy-success="Скопировано!"
+	><code class="language-js">console.log('Привет, мир!');</code></pre>
+
+	<pre
+		lang="zh-Hans-CN"
+		data-prismjs-copy="复制文本"
+		data-prismjs-copy-error="按Ctrl+C复制"
+		data-prismjs-copy-success="文本已复制!"
+	><code class="language-js">console.log('你好,世界!');</code></pre>
+</body>
+</html>
+ +

Output:

+ +
+
console.log('Hello, world!');
+ +
console.log('Привет, мир!');
-

+		
console.log('你好,世界!');
+
+ - + diff --git a/plugins/copy-to-clipboard/prism-copy-to-clipboard.js b/plugins/copy-to-clipboard/prism-copy-to-clipboard.js index ce52a79143..f6cac476ac 100644 --- a/plugins/copy-to-clipboard/prism-copy-to-clipboard.js +++ b/plugins/copy-to-clipboard/prism-copy-to-clipboard.js @@ -1,5 +1,6 @@ -(function(){ - if (typeof self === 'undefined' || !self.Prism || !self.document) { +(function () { + + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } @@ -9,69 +10,151 @@ return; } - var ClipboardJS = window.ClipboardJS || undefined; - - if (!ClipboardJS && typeof require === 'function') { - ClipboardJS = require('clipboard'); + /** + * When the given elements is clicked by the user, the given text will be copied to clipboard. + * + * @param {HTMLElement} element + * @param {CopyInfo} copyInfo + * + * @typedef CopyInfo + * @property {() => string} getText + * @property {() => void} success + * @property {(reason: unknown) => void} error + */ + function registerClipboard(element, copyInfo) { + element.addEventListener('click', function () { + copyTextToClipboard(copyInfo); + }); } - var callbacks = []; + // https://stackoverflow.com/a/30810322/7595472 + + /** @param {CopyInfo} copyInfo */ + function fallbackCopyTextToClipboard(copyInfo) { + var textArea = document.createElement('textarea'); + textArea.value = copyInfo.getText(); - if (!ClipboardJS) { - var script = document.createElement('script'); - var head = document.querySelector('head'); + // Avoid scrolling to bottom + textArea.style.top = '0'; + textArea.style.left = '0'; + textArea.style.position = 'fixed'; - script.onload = function() { - ClipboardJS = window.ClipboardJS; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); - if (ClipboardJS) { - while (callbacks.length) { - callbacks.pop()(); + try { + var successful = document.execCommand('copy'); + setTimeout(function () { + if (successful) { + copyInfo.success(); + } else { + copyInfo.error(); } - } + }, 1); + } catch (err) { + setTimeout(function () { + copyInfo.error(err); + }, 1); + } + + document.body.removeChild(textArea); + } + /** @param {CopyInfo} copyInfo */ + function copyTextToClipboard(copyInfo) { + if (navigator.clipboard) { + navigator.clipboard.writeText(copyInfo.getText()).then(copyInfo.success, function () { + // try the fallback in case `writeText` didn't work + fallbackCopyTextToClipboard(copyInfo); + }); + } else { + fallbackCopyTextToClipboard(copyInfo); + } + } + + /** + * Selects the text content of the given element. + * + * @param {Element} element + */ + function selectElementText(element) { + // https://stackoverflow.com/a/20079910/7595472 + window.getSelection().selectAllChildren(element); + } + + /** + * Traverses up the DOM tree to find data attributes that override the default plugin settings. + * + * @param {Element} startElement An element to start from. + * @returns {Settings} The plugin settings. + * @typedef {Record<"copy" | "copy-error" | "copy-success" | "copy-timeout", string | number>} Settings + */ + function getSettings(startElement) { + /** @type {Settings} */ + var settings = { + 'copy': 'Copy', + 'copy-error': 'Press Ctrl+C to copy', + 'copy-success': 'Copied!', + 'copy-timeout': 5000 }; - script.src = 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js'; - head.appendChild(script); + var prefix = 'data-prismjs-'; + for (var key in settings) { + var attr = prefix + key; + var element = startElement; + while (element && !element.hasAttribute(attr)) { + element = element.parentElement; + } + if (element) { + settings[key] = element.getAttribute(attr); + } + } + return settings; } Prism.plugins.toolbar.registerButton('copy-to-clipboard', function (env) { - var linkCopy = document.createElement('button'); - linkCopy.textContent = 'Copy'; - var element = env.element; - if (!ClipboardJS) { - callbacks.push(registerClipboard); - } else { - registerClipboard(); - } + var settings = getSettings(element); - return linkCopy; + var linkCopy = document.createElement('button'); + linkCopy.className = 'copy-to-clipboard-button'; + linkCopy.setAttribute('type', 'button'); + var linkSpan = document.createElement('span'); + linkCopy.appendChild(linkSpan); - function registerClipboard() { - var clip = new ClipboardJS(linkCopy, { - 'text': function () { - return element.textContent; - } - }); + setState('copy'); - clip.on('success', function() { - linkCopy.textContent = 'Copied!'; + registerClipboard(linkCopy, { + getText: function () { + return element.textContent; + }, + success: function () { + setState('copy-success'); resetText(); - }); - clip.on('error', function () { - linkCopy.textContent = 'Press Ctrl+C to copy'; + }, + error: function () { + setState('copy-error'); + + setTimeout(function () { + selectElementText(element); + }, 1); resetText(); - }); - } + } + }); + + return linkCopy; function resetText() { - setTimeout(function () { - linkCopy.textContent = 'Copy'; - }, 5000); + setTimeout(function () { setState('copy'); }, settings['copy-timeout']); + } + + /** @param {"copy" | "copy-error" | "copy-success"} state */ + function setState(state) { + linkSpan.textContent = settings[state]; + linkCopy.setAttribute('data-copy-state', state); } }); -})(); +}()); diff --git a/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js b/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js index 3c8b52560e..4604e93994 100644 --- a/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js +++ b/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var i=window.ClipboardJS||void 0;i||"function"!=typeof require||(i=require("clipboard"));var c=[];if(!i){var o=document.createElement("script"),t=document.querySelector("head");o.onload=function(){if(i=window.ClipboardJS)for(;c.length;)c.pop()()},o.src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js",t.appendChild(o)}Prism.plugins.toolbar.registerButton("copy-to-clipboard",function(o){var t=document.createElement("button");t.textContent="Copy";var e=o.element;return i?n():c.push(n),t;function n(){var o=new i(t,{text:function(){return e.textContent}});o.on("success",function(){t.textContent="Copied!",r()}),o.on("error",function(){t.textContent="Press Ctrl+C to copy",r()})}function r(){setTimeout(function(){t.textContent="Copy"},5e3)}})}else console.warn("Copy to Clipboard plugin loaded before Toolbar plugin.")}(); \ No newline at end of file +!function(){function u(t,e){t.addEventListener("click",function(){!function(t){navigator.clipboard?navigator.clipboard.writeText(t.getText()).then(t.success,function(){o(t)}):o(t)}(e)})}function o(e){var t=document.createElement("textarea");t.value=e.getText(),t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var o=document.execCommand("copy");setTimeout(function(){o?e.success():e.error()},1)}catch(t){setTimeout(function(){e.error(t)},1)}document.body.removeChild(t)}"undefined"!=typeof Prism&&"undefined"!=typeof document&&(Prism.plugins.toolbar?Prism.plugins.toolbar.registerButton("copy-to-clipboard",function(t){var e=t.element,o=function(t){var e={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var o in e){for(var n="data-prismjs-"+o,c=t;c&&!c.hasAttribute(n);)c=c.parentElement;c&&(e[o]=c.getAttribute(n))}return e}(e),n=document.createElement("button");n.className="copy-to-clipboard-button",n.setAttribute("type","button");var c=document.createElement("span");return n.appendChild(c),i("copy"),u(n,{getText:function(){return e.textContent},success:function(){i("copy-success"),r()},error:function(){i("copy-error"),setTimeout(function(){!function(t){window.getSelection().selectAllChildren(t)}(e)},1),r()}}),n;function r(){setTimeout(function(){i("copy")},o["copy-timeout"])}function i(t){c.textContent=o[t],n.setAttribute("data-copy-state",t)}}):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))}(); \ No newline at end of file diff --git a/plugins/custom-class/index.html b/plugins/custom-class/index.html index 624c37bd94..ec94c122d8 100644 --- a/plugins/custom-class/index.html +++ b/plugins/custom-class/index.html @@ -8,7 +8,7 @@ - + @@ -86,9 +86,9 @@

Notes

Feature functions must be called AFTER Prism and this plugin. For example:

<!-- 1. load prism -->
-<script src="prism.js"></script>
+<script src="prism.js"></script>
 <!-- 2. load the plugin if you don't include it inside prism when download -->
-<script src="plugins/custom-class/custom-class.js"></script>
+<script src="plugins/custom-class/custom-class.js"></script>
 <!-- 3. call the feature you want to use -->
 <script>
 	Prism.plugins.customClass.map(myClassMap);
@@ -109,6 +109,7 @@ 

CSS Modules Usage:

import classMap from 'styles/editor-class-map.css'; Prism.plugins.customClass.map(classMap)
+

Note: This plugin only affects generated token elements (usually of the form span.token). The classes of code and pre elements as well as all elements generated by other plugins (e.g. Toolbar elements and line number elements) will not be changed.

@@ -117,7 +118,7 @@

Example

Prefix and map classes

Input

-
<pre class="language-javascript"><code>
+	
<pre class="language-javascript"><code>
 	var foo = 'bar';
 </code></pre>
@@ -129,18 +130,20 @@

Prefix and map classes

Prism.plugins.customClass.prefix('pr-');

Output

-
<pre class="language-javascript"><code>
-	<span class="pr-token pr-special-keyword">var</span>
+	
<pre class="language-javascript"><code class="language-markup">
+	<span class="pr-token pr-special-keyword">var</span>
 	foo
-	<span class="pr-token pr-operator">=</span>
-	<span class="pr-token pr-my-string">'bar'</span>
-	<span class="pr-token pr-punctuation">;</span>
+	<span class="pr-token pr-operator">=</span>
+	<span class="pr-token pr-my-string">'bar'</span>
+	<span class="pr-token pr-punctuation">;</span>
 </code></pre>
+

Note that this plugin only affects tokens. The classes of the code and pre elements won't be prefixed.

+

Add new classes

Input

-
<pre class="language-css"><code>
+	
<pre class="language-css"><code>
 a::after {
 	content: '\2b00 ';
 	opacity: .7;
@@ -175,7 +178,7 @@ 

Add new classes

- + diff --git a/plugins/custom-class/prism-custom-class.js b/plugins/custom-class/prism-custom-class.js index 3eeb75f191..a8dca48f98 100644 --- a/plugins/custom-class/prism-custom-class.js +++ b/plugins/custom-class/prism-custom-class.js @@ -1,9 +1,6 @@ (function () { - if ( - (typeof self === 'undefined' || !self.Prism) && - (typeof global === 'undefined' || !global.Prism) - ) { + if (typeof Prism === 'undefined') { return; } @@ -33,6 +30,15 @@ var prefixString = ''; + /** + * @param {string} className + * @param {string} language + */ + function apply(className, language) { + return prefixString + (mapper ? mapper(className, language) : className); + } + + Prism.plugins.customClass = { /** * Sets the function which can be used to add custom aliases to any token. @@ -65,8 +71,17 @@ */ prefix: function prefix(string) { prefixString = string || ''; - } - } + }, + /** + * Applies the current mapping and prefix to the given class name. + * + * @param {string} className A single class name. + * @param {string} language The language of the code that contains this class name. + * + * If the language is unknown, pass `"none"`. + */ + apply: apply + }; Prism.hooks.add('wrap', function (env) { if (adder) { @@ -88,8 +103,8 @@ } env.classes = env.classes.map(function (c) { - return prefixString + (mapper ? mapper(c, env.language) : c); + return apply(c, env.language); }); }); -})(); +}()); diff --git a/plugins/custom-class/prism-custom-class.min.js b/plugins/custom-class/prism-custom-class.min.js index e579293526..e6331f932a 100644 --- a/plugins/custom-class/prism-custom-class.min.js +++ b/plugins/custom-class/prism-custom-class.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism||"undefined"!=typeof global&&global.Prism){var a,e,t="";Prism.plugins.customClass={add:function(n){a=n},map:function(s){e="function"==typeof s?s:function(n){return s[n]||n}},prefix:function(n){t=n||""}},Prism.hooks.add("wrap",function(s){if(a){var n=a({content:s.content,type:s.type,language:s.language});Array.isArray(n)?s.classes.push.apply(s.classes,n):n&&s.classes.push(n)}(e||t)&&(s.classes=s.classes.map(function(n){return t+(e?e(n,s.language):n)}))})}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism){var a,t,e="";Prism.plugins.customClass={add:function(n){a=n},map:function(s){t="function"==typeof s?s:function(n){return s[n]||n}},prefix:function(n){e=n||""},apply:u},Prism.hooks.add("wrap",function(s){if(a){var n=a({content:s.content,type:s.type,language:s.language});Array.isArray(n)?s.classes.push.apply(s.classes,n):n&&s.classes.push(n)}(t||e)&&(s.classes=s.classes.map(function(n){return u(n,s.language)}))})}function u(n,s){return e+(t?t(n,s):n)}}(); \ No newline at end of file diff --git a/plugins/data-uri-highlight/index.html b/plugins/data-uri-highlight/index.html index 30b581b513..0c986aae69 100644 --- a/plugins/data-uri-highlight/index.html +++ b/plugins/data-uri-highlight/index.html @@ -9,7 +9,7 @@ - + @@ -46,7 +46,7 @@

Example

- + diff --git a/plugins/data-uri-highlight/prism-data-uri-highlight.js b/plugins/data-uri-highlight/prism-data-uri-highlight.js index c6413a9cb1..ea1f4b3a34 100644 --- a/plugins/data-uri-highlight/prism-data-uri-highlight.js +++ b/plugins/data-uri-highlight/prism-data-uri-highlight.js @@ -1,9 +1,6 @@ (function () { - if ( - typeof self !== 'undefined' && !self.Prism || - typeof global !== 'undefined' && !global.Prism - ) { + if (typeof Prism === 'undefined') { return; } @@ -60,8 +57,7 @@ Prism.languages.insertBefore('inside', def.inside['url-link'] ? 'url-link' : 'punctuation', { 'data-uri': dataURI }, def); - } - else { + } else { if (def.inside['url-link']) { Prism.languages.insertBefore('inside', 'url-link', { 'data-uri': dataURI diff --git a/plugins/data-uri-highlight/prism-data-uri-highlight.min.js b/plugins/data-uri-highlight/prism-data-uri-highlight.min.js index 0375be5f37..7f6a2137de 100644 --- a/plugins/data-uri-highlight/prism-data-uri-highlight.min.js +++ b/plugins/data-uri-highlight/prism-data-uri-highlight.min.js @@ -1 +1 @@ -!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var r={pattern:/(.)\bdata:[^\/]+\/[^,]+,(?:(?!\1)[\s\S]|\\\1)+(?=\1)/,lookbehind:!0,inside:{"language-css":{pattern:/(data:[^\/]+\/(?:[^+,]+\+)?css,)[\s\S]+/,lookbehind:!0},"language-javascript":{pattern:/(data:[^\/]+\/(?:[^+,]+\+)?javascript,)[\s\S]+/,lookbehind:!0},"language-json":{pattern:/(data:[^\/]+\/(?:[^+,]+\+)?json,)[\s\S]+/,lookbehind:!0},"language-markup":{pattern:/(data:[^\/]+\/(?:[^+,]+\+)?(?:html|xml),)[\s\S]+/,lookbehind:!0}}},e=["url","attr-value","string"];Prism.plugins.dataURIHighlight={processGrammar:function(i){i&&!i["data-uri"]&&(Prism.languages.DFS(i,function(i,a,n){-1 - + @@ -24,8 +24,14 @@

How to use

Replace the language-diff of your code block with a language-diff-xxxx class to enable syntax highlighting for diff blocks.

-

Optional:
- You can add the diff-highlight class to your code block to indicate changes using the background color of a line rather than the color of the text.

+

+ Optional:
+ You can add the diff-highlight class to your code block to indicate changes using the background color of a line rather than the color of the text. +

+ +

Autoloader

+ +

The Autoloader plugin understands the language-diff-xxxx format and will ensure that the language definitions for both Diff and the code language are loaded.

@@ -63,14 +69,29 @@

Example

+ const foo = bar.baz([1, 2, 3]) + 1; console.log(`foo: ${foo}`);
+

+ Using class="language-diff-rust diff-highlight":
+ (Autoloader is used to load the Rust language definition.) +

+ +
@@ -111,6 +114,9 @@
+         nasty_btree_map.insert(i, MyLeafNode(i));
+     }
+
++    let mut zst_btree_map: BTreeMap<(), ()> = BTreeMap::new();
++    zst_btree_map.insert((), ());
++
+     // VecDeque
+     let mut vec_deque = VecDeque::new();
+     vec_deque.push_back(5);
- + - + diff --git a/plugins/diff-highlight/prism-diff-highlight.js b/plugins/diff-highlight/prism-diff-highlight.js index ae38fab6ab..aa7bcf3f3f 100644 --- a/plugins/diff-highlight/prism-diff-highlight.js +++ b/plugins/diff-highlight/prism-diff-highlight.js @@ -1,33 +1,38 @@ (function () { - if (typeof Prism === 'undefined' || !Prism.languages['diff']) { + if (typeof Prism === 'undefined') { return; } - var LANGUAGE_REGEX = /diff-([\w-]+)/i; - var HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi; + var LANGUAGE_REGEX = /^diff-([\w-]+)/i; + var HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/g; //this will match a line plus the line break while ignoring the line breaks HTML tags may contain. var HTML_LINE = RegExp(/(?:__|[^\r\n<])*(?:\r\n?|\n|(?:__|[^\r\n<])(?![^\r\n]))/.source.replace(/__/g, function () { return HTML_TAG.source; }), 'gi'); - var PREFIXES = Prism.languages.diff.PREFIXES; - + var warningLogged = false; Prism.hooks.add('before-sanity-check', function (env) { var lang = env.language; if (LANGUAGE_REGEX.test(lang) && !env.grammar) { - env.grammar = Prism.languages[lang] = Prism.languages['diff']; + env.grammar = Prism.languages[lang] = Prism.languages.diff; } }); Prism.hooks.add('before-tokenize', function (env) { + if (!warningLogged && !Prism.languages.diff && !Prism.plugins.autoloader) { + warningLogged = true; + console.warn("Prism's Diff Highlight plugin requires the Diff language definition (prism-diff.js)." + + "Make sure the language definition is loaded or use Prism's Autoloader plugin."); + } + var lang = env.language; if (LANGUAGE_REGEX.test(lang) && !Prism.languages[lang]) { - Prism.languages[lang] = Prism.languages['diff']; + Prism.languages[lang] = Prism.languages.diff; } }); Prism.hooks.add('wrap', function (env) { - var diffLanguage, diffGrammar; + var diffLanguage; var diffGrammar; if (env.language !== 'diff') { var langMatch = LANGUAGE_REGEX.exec(env.language); @@ -39,8 +44,10 @@ diffGrammar = Prism.languages[diffLanguage]; } + var PREFIXES = Prism.languages.diff && Prism.languages.diff.PREFIXES; + // one of the diff tokens without any nested tokens - if (env.type in PREFIXES) { + if (PREFIXES && env.type in PREFIXES) { /** @type {string} */ var content = env.content.replace(HTML_TAG, ''); // remove all HTML tags @@ -63,9 +70,9 @@ var prefix = Prism.Token.stringify(prefixToken, env.language); // add prefix - var lines = [], m; + var lines = []; var m; HTML_LINE.lastIndex = 0; - while (m = HTML_LINE.exec(highlighted)) { + while ((m = HTML_LINE.exec(highlighted))) { lines.push(prefix + m[0]); } if (/(?:^|[\r\n]).$/.test(decoded)) { diff --git a/plugins/diff-highlight/prism-diff-highlight.min.css b/plugins/diff-highlight/prism-diff-highlight.min.css new file mode 100644 index 0000000000..9b8f6a7528 --- /dev/null +++ b/plugins/diff-highlight/prism-diff-highlight.min.css @@ -0,0 +1 @@ +pre.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.1);color:inherit;display:block}pre.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.1);color:inherit;display:block} \ No newline at end of file diff --git a/plugins/diff-highlight/prism-diff-highlight.min.js b/plugins/diff-highlight/prism-diff-highlight.min.js index 8d9aefb2cb..a6cf1c2fce 100644 --- a/plugins/diff-highlight/prism-diff-highlight.min.js +++ b/plugins/diff-highlight/prism-diff-highlight.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof Prism&&Prism.languages.diff){var o=/diff-([\w-]+)/i,m=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi,c=RegExp("(?:__|[^\r\n<])*(?:\r\n?|\n|(?:__|[^\r\n<])(?![^\r\n]))".replace(/__/g,function(){return m.source}),"gi"),d=Prism.languages.diff.PREFIXES;Prism.hooks.add("before-sanity-check",function(e){var a=e.language;o.test(a)&&!e.grammar&&(e.grammar=Prism.languages[a]=Prism.languages.diff)}),Prism.hooks.add("before-tokenize",function(e){var a=e.language;o.test(a)&&!Prism.languages[a]&&(Prism.languages[a]=Prism.languages.diff)}),Prism.hooks.add("wrap",function(e){var a,s;if("diff"!==e.language){var n=o.exec(e.language);if(!n)return;a=n[1],s=Prism.languages[a]}if(e.type in d){var r,i=e.content.replace(m,"").replace(/</g,"<").replace(/&/g,"&"),g=i.replace(/(^|[\r\n])./g,"$1");r=s?Prism.highlight(g,s,a):Prism.util.encode(g);var f,t=new Prism.Token("prefix",d[e.type],[/\w+/.exec(e.type)[0]]),u=Prism.Token.stringify(t,e.language),l=[];for(c.lastIndex=0;f=c.exec(r);)l.push(u+f[0]);/(?:^|[\r\n]).$/.test(i)&&l.push(u),e.content=l.join(""),s&&e.classes.push("language-"+a)}})}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism){var m=/^diff-([\w-]+)/i,d=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/g,c=RegExp("(?:__|[^\r\n<])*(?:\r\n?|\n|(?:__|[^\r\n<])(?![^\r\n]))".replace(/__/g,function(){return d.source}),"gi"),a=!1;Prism.hooks.add("before-sanity-check",function(e){var i=e.language;m.test(i)&&!e.grammar&&(e.grammar=Prism.languages[i]=Prism.languages.diff)}),Prism.hooks.add("before-tokenize",function(e){a||Prism.languages.diff||Prism.plugins.autoloader||(a=!0,console.warn("Prism's Diff Highlight plugin requires the Diff language definition (prism-diff.js).Make sure the language definition is loaded or use Prism's Autoloader plugin."));var i=e.language;m.test(i)&&!Prism.languages[i]&&(Prism.languages[i]=Prism.languages.diff)}),Prism.hooks.add("wrap",function(e){var i,a;if("diff"!==e.language){var s=m.exec(e.language);if(!s)return;i=s[1],a=Prism.languages[i]}var r=Prism.languages.diff&&Prism.languages.diff.PREFIXES;if(r&&e.type in r){var n,g=e.content.replace(d,"").replace(/</g,"<").replace(/&/g,"&"),f=g.replace(/(^|[\r\n])./g,"$1");n=a?Prism.highlight(f,a,i):Prism.util.encode(f);var u,l=new Prism.Token("prefix",r[e.type],[/\w+/.exec(e.type)[0]]),t=Prism.Token.stringify(l,e.language),o=[];for(c.lastIndex=0;u=c.exec(n);)o.push(t+u[0]);/(?:^|[\r\n]).$/.test(g)&&o.push(t),e.content=o.join(""),a&&e.classes.push("language-"+i)}})}}(); \ No newline at end of file diff --git a/plugins/download-button/index.html b/plugins/download-button/index.html index d0236bc1a8..2f7c29c91f 100644 --- a/plugins/download-button/index.html +++ b/plugins/download-button/index.html @@ -9,7 +9,7 @@ - + @@ -44,7 +44,7 @@

Examples

- + diff --git a/plugins/download-button/prism-download-button.js b/plugins/download-button/prism-download-button.js index 55d8ec67a2..8a5bd90539 100644 --- a/plugins/download-button/prism-download-button.js +++ b/plugins/download-button/prism-download-button.js @@ -1,5 +1,6 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) { + + if (typeof Prism === 'undefined' || typeof document === 'undefined' || !document.querySelector) { return; } @@ -16,4 +17,4 @@ return a; }); -})(); +}()); diff --git a/plugins/download-button/prism-download-button.min.js b/plugins/download-button/prism-download-button.min.js index 00f667306c..57e5879e75 100644 --- a/plugins/download-button/prism-download-button.min.js +++ b/plugins/download-button/prism-download-button.min.js @@ -1 +1 @@ -"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&Prism.plugins.toolbar.registerButton("download-file",function(t){var e=t.element.parentNode;if(e&&/pre/i.test(e.nodeName)&&e.hasAttribute("data-src")&&e.hasAttribute("data-download-link")){var a=e.getAttribute("data-src"),n=document.createElement("a");return n.textContent=e.getAttribute("data-download-link-label")||"Download",n.setAttribute("download",""),n.href=a,n}}); \ No newline at end of file +"undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector&&Prism.plugins.toolbar.registerButton("download-file",function(t){var e=t.element.parentNode;if(e&&/pre/i.test(e.nodeName)&&e.hasAttribute("data-src")&&e.hasAttribute("data-download-link")){var n=e.getAttribute("data-src"),a=document.createElement("a");return a.textContent=e.getAttribute("data-download-link-label")||"Download",a.setAttribute("download",""),a.href=n,a}}); \ No newline at end of file diff --git a/plugins/file-highlight/index.html b/plugins/file-highlight/index.html index 1b41d66a25..2033ef017a 100644 --- a/plugins/file-highlight/index.html +++ b/plugins/file-highlight/index.html @@ -8,7 +8,8 @@ - + + @@ -27,6 +28,14 @@

How to use

You don’t need to specify the language, it’s automatically determined by the file extension. If, however, the language cannot be determined from the file extension or the file extension is incorrect, you may specify a language as well (with the usual class name way).

+

Use the data-range attribute to display only a selected range of lines from the file, like so:

+ +
<pre data-src="myfile.js" data-range="1,5"></pre>
+ +

Lines start at 1, so "1,5" will display line 1 up to and including line 5. It's also possible to specify just a single line (e.g. "5" for just line 5) and open ranges (e.g. "3," for all lines starting at line 3). Negative integers can be used to specify the n-th last line, e.g. -2 for the second last line.

+ +

When data-range is used in conjunction with the Line Numbers plugin, this plugin will add the proper data-start according to the specified range. This behavior can be overridden by setting the data-start attribute manually.

+

Please note that the files are fetched with XMLHttpRequest. This means that if the file is on a different origin, fetching it will fail, unless CORS is enabled on that website.

@@ -42,6 +51,9 @@

Examples

File that doesn’t exist:


 
+	

With line numbers, and data-range="12,111":

+

+
 	

For more examples, browse around the Prism website. Most large code samples are actually files fetched with this plugin.

@@ -49,7 +61,8 @@

Examples

- + + diff --git a/plugins/file-highlight/prism-file-highlight.js b/plugins/file-highlight/prism-file-highlight.js index 93db3acb2b..1247e19fae 100644 --- a/plugins/file-highlight/prism-file-highlight.js +++ b/plugins/file-highlight/prism-file-highlight.js @@ -1,9 +1,13 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } - var Prism = window.Prism; + // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } var LOADING_MESSAGE = 'Loading…'; var FAILURE_MESSAGE = function (status, message) { @@ -31,21 +35,57 @@ var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])' + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])'; - var lang = /\blang(?:uage)?-([\w-]+)\b/i; - /** - * Sets the Prism `language-xxxx` or `lang-xxxx` class to the given language. + * Loads the given file. * - * @param {HTMLElement} element - * @param {string} language - * @returns {void} + * @param {string} src The URL or path of the source file to load. + * @param {(result: string) => void} success + * @param {(reason: string) => void} error */ - function setLanguageClass(element, language) { - var className = element.className; - className = className.replace(lang, ' ') + ' language-' + language; - element.className = className.replace(/\s+/g, ' ').trim(); + function loadFile(src, success, error) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', src, true); + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + if (xhr.status < 400 && xhr.responseText) { + success(xhr.responseText); + } else { + if (xhr.status >= 400) { + error(FAILURE_MESSAGE(xhr.status, xhr.statusText)); + } else { + error(FAILURE_EMPTY_MESSAGE); + } + } + } + }; + xhr.send(null); } + /** + * Parses the given range. + * + * This returns a range with inclusive ends. + * + * @param {string | null | undefined} range + * @returns {[number, number | undefined] | undefined} + */ + function parseRange(range) { + var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || ''); + if (m) { + var start = Number(m[1]); + var comma = m[2]; + var end = m[3]; + + if (!comma) { + return [start, start]; + } + if (!end) { + return [start, undefined]; + } + return [start, Number(end)]; + } + return undefined; + } Prism.hooks.add('before-highlightall', function (env) { env.selector += ', ' + SELECTOR; @@ -73,8 +113,8 @@ } // set language classes - setLanguageClass(code, language); - setLanguageClass(pre, language); + Prism.util.setLanguage(code, language); + Prism.util.setLanguage(pre, language); // preload the language var autoloader = Prism.plugins.autoloader; @@ -83,31 +123,45 @@ } // load file - var xhr = new XMLHttpRequest(); - xhr.open('GET', src, true); - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - if (xhr.status < 400 && xhr.responseText) { - // mark as loaded - pre.setAttribute(STATUS_ATTR, STATUS_LOADED); - - // highlight code - code.textContent = xhr.responseText; - Prism.highlightElement(code); - - } else { - // mark as failed - pre.setAttribute(STATUS_ATTR, STATUS_FAILED); - - if (xhr.status >= 400) { - code.textContent = FAILURE_MESSAGE(xhr.status, xhr.statusText); - } else { - code.textContent = FAILURE_EMPTY_MESSAGE; + loadFile( + src, + function (text) { + // mark as loaded + pre.setAttribute(STATUS_ATTR, STATUS_LOADED); + + // handle data-range + var range = parseRange(pre.getAttribute('data-range')); + if (range) { + var lines = text.split(/\r\n?|\n/g); + + // the range is one-based and inclusive on both ends + var start = range[0]; + var end = range[1] == null ? lines.length : range[1]; + + if (start < 0) { start += lines.length; } + start = Math.max(0, Math.min(start - 1, lines.length)); + if (end < 0) { end += lines.length; } + end = Math.max(0, Math.min(end, lines.length)); + + text = lines.slice(start, end).join('\n'); + + // add data-start for line numbers + if (!pre.hasAttribute('data-start')) { + pre.setAttribute('data-start', String(start + 1)); } } + + // highlight code + code.textContent = text; + Prism.highlightElement(code); + }, + function (error) { + // mark as failed + pre.setAttribute(STATUS_ATTR, STATUS_FAILED); + + code.textContent = error; } - }; - xhr.send(null); + ); } }); @@ -122,7 +176,7 @@ highlight: function highlight(container) { var elements = (container || document).querySelectorAll(SELECTOR); - for (var i = 0, element; element = elements[i++];) { + for (var i = 0, element; (element = elements[i++]);) { Prism.highlightElement(element); } } @@ -136,6 +190,6 @@ logged = true; } Prism.plugins.fileHighlight.highlight.apply(this, arguments); - } + }; -})(); +}()); diff --git a/plugins/file-highlight/prism-file-highlight.min.js b/plugins/file-highlight/prism-file-highlight.min.js index 843072dff8..23bacb136e 100644 --- a/plugins/file-highlight/prism-file-highlight.min.js +++ b/plugins/file-highlight/prism-file-highlight.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var o=window.Prism,h={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},g="data-src-status",u="loading",c="loaded",d="pre[data-src]:not(["+g+'="'+c+'"]):not(['+g+'="'+u+'"])',n=/\blang(?:uage)?-([\w-]+)\b/i;o.hooks.add("before-highlightall",function(e){e.selector+=", "+d}),o.hooks.add("before-sanity-check",function(e){var t=e.element;if(t.matches(d)){e.code="",t.setAttribute(g,u);var i=t.appendChild(document.createElement("CODE"));i.textContent="Loading…";var n=t.getAttribute("data-src"),a=e.language;if("none"===a){var s=(/\.(\w+)$/.exec(n)||[,"none"])[1];a=h[s]||s}f(i,a),f(t,a);var l=o.plugins.autoloader;l&&l.loadLanguages(a);var r=new XMLHttpRequest;r.open("GET",n,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?(t.setAttribute(g,c),i.textContent=r.responseText,o.highlightElement(i)):(t.setAttribute(g,"failed"),400<=r.status?i.textContent=function(e,t){return"✖ Error "+e+" while fetching file: "+t}(r.status,r.statusText):i.textContent="✖ Error: File does not exist or is empty"))},r.send(null)}});var e=!(o.plugins.fileHighlight={highlight:function(e){for(var t,i=(e||document).querySelectorAll(d),n=0;t=i[n++];)o.highlightElement(t)}});o.fileHighlight=function(){e||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),e=!0),o.plugins.fileHighlight.highlight.apply(this,arguments)}}function f(e,t){var i=e.className;i=i.replace(n," ")+" language-"+t,e.className=i.replace(/\s+/g," ").trim()}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",h="loading",g="loaded",u="pre[data-src]:not(["+o+'="'+g+'"]):not(['+o+'="'+h+'"])';Prism.hooks.add("before-highlightall",function(t){t.selector+=", "+u}),Prism.hooks.add("before-sanity-check",function(t){var r=t.element;if(r.matches(u)){t.code="",r.setAttribute(o,h);var s=r.appendChild(document.createElement("CODE"));s.textContent="Loading…";var e=r.getAttribute("data-src"),i=t.language;if("none"===i){var n=(/\.(\w+)$/.exec(e)||[,"none"])[1];i=l[n]||n}Prism.util.setLanguage(s,i),Prism.util.setLanguage(r,i);var a=Prism.plugins.autoloader;a&&a.loadLanguages(i),function(t,e,i){var n=new XMLHttpRequest;n.open("GET",t,!0),n.onreadystatechange=function(){4==n.readyState&&(n.status<400&&n.responseText?e(n.responseText):400<=n.status?i(function(t,e){return"✖ Error "+t+" while fetching file: "+e}(n.status,n.statusText)):i("✖ Error: File does not exist or is empty"))},n.send(null)}(e,function(t){r.setAttribute(o,g);var e=function(t){var e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(t||"");if(e){var i=Number(e[1]),n=e[2],a=e[3];return n?a?[i,Number(a)]:[i,void 0]:[i,i]}}(r.getAttribute("data-range"));if(e){var i=t.split(/\r\n?|\n/g),n=e[0],a=null==e[1]?i.length:e[1];n<0&&(n+=i.length),n=Math.max(0,Math.min(n-1,i.length)),a<0&&(a+=i.length),a=Math.max(0,Math.min(a,i.length)),t=i.slice(n,a).join("\n"),r.hasAttribute("data-start")||r.setAttribute("data-start",String(n+1))}s.textContent=t,Prism.highlightElement(s)},function(t){r.setAttribute(o,"failed"),s.textContent=t})}});var t=!(Prism.plugins.fileHighlight={highlight:function(t){for(var e,i=(t||document).querySelectorAll(u),n=0;e=i[n++];)Prism.highlightElement(e)}});Prism.fileHighlight=function(){t||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),t=!0),Prism.plugins.fileHighlight.highlight.apply(this,arguments)}}}(); \ No newline at end of file diff --git a/plugins/filter-highlight-all/index.html b/plugins/filter-highlight-all/index.html index bca36e1ae0..58523c593e 100644 --- a/plugins/filter-highlight-all/index.html +++ b/plugins/filter-highlight-all/index.html @@ -8,7 +8,7 @@ - + @@ -127,7 +127,7 @@

Examples

- + diff --git a/plugins/filter-highlight-all/prism-filter-highlight-all.js b/plugins/filter-highlight-all/prism-filter-highlight-all.js index 6bfec21384..03d61d8db5 100644 --- a/plugins/filter-highlight-all/prism-filter-highlight-all.js +++ b/plugins/filter-highlight-all/prism-filter-highlight-all.js @@ -1,6 +1,6 @@ (function () { - if (typeof self !== 'undefined' && !self.Prism) { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } @@ -94,10 +94,12 @@ if (script) { var attr; - if (attr = script.getAttribute('data-filter-selector')) { + attr = script.getAttribute('data-filter-selector'); + if (attr) { config.addSelector(attr); } - if (attr = script.getAttribute('data-reject-selector')) { + attr = script.getAttribute('data-reject-selector'); + if (attr) { config.reject.addSelector(attr); } } diff --git a/plugins/filter-highlight-all/prism-filter-highlight-all.min.js b/plugins/filter-highlight-all/prism-filter-highlight-all.min.js index 8e5a143591..1e311d345a 100644 --- a/plugins/filter-highlight-all/prism-filter-highlight-all.min.js +++ b/plugins/filter-highlight-all/prism-filter-highlight-all.min.js @@ -1 +1 @@ -!function(){if("undefined"==typeof self||self.Prism){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e,t=Prism.util.currentScript(),r=[],n=Prism.plugins.filterHighlightAll={add:function(t){r.push(function(e){return t({element:e,language:Prism.util.getLanguage(e)})})},addSelector:function(t){r.push(function(e){return e.matches(t)})},reject:{add:function(t){r.push(function(e){return!t({element:e,language:Prism.util.getLanguage(e)})})},addSelector:function(t){r.push(function(e){return!e.matches(t)})}},filterKnown:!!t&&t.hasAttribute("data-filter-known")};if(n.add(function(e){return!n.filterKnown||"object"==typeof Prism.languages[e.language]}),t)(e=t.getAttribute("data-filter-selector"))&&n.addSelector(e),(e=t.getAttribute("data-reject-selector"))&&n.reject.addSelector(e);Prism.hooks.add("before-all-elements-highlight",function(e){e.elements=e.elements.filter(i)})}function i(e){for(var t=0,n=r.length;t - + - +
+
+

How to use

+ +

This plugin adds a special class for every keyword, so keyword-specific styles can be applied. These special classes allow for fine-grained control over the appearance of keywords using your own CSS rules.

+ +

For example, the keyword if will have the class keyword-if added. A CSS rule used to apply special highlighting could look like this:

+ +
.token.keyword.keyword-if { /* styles for 'if' */ }
+ +

Note: This plugin does not come with CSS styles. You have to define the keyword-specific CSS rules yourself.

+
+

Examples

+

This example shows the plugin in action. The keywords if and return will be highlighted in red. The color of all other keywords will be determined by the current theme. The CSS rules used to implement the keyword-specific highlighting can be seen in the HTML file below.

+

JavaScript


 
@@ -37,7 +52,7 @@ 

HTML (Markup)

- + diff --git a/plugins/highlight-keywords/prism-highlight-keywords.js b/plugins/highlight-keywords/prism-highlight-keywords.js index 32b2812273..523fc964fe 100644 --- a/plugins/highlight-keywords/prism-highlight-keywords.js +++ b/plugins/highlight-keywords/prism-highlight-keywords.js @@ -1,17 +1,14 @@ -(function(){ +(function () { -if ( - typeof self !== 'undefined' && !self.Prism || - typeof global !== 'undefined' && !global.Prism -) { - return; -} - -Prism.hooks.add('wrap', function(env) { - if (env.type !== "keyword") { + if (typeof Prism === 'undefined') { return; } - env.classes.push('keyword-' + env.content); -}); -})(); + Prism.hooks.add('wrap', function (env) { + if (env.type !== 'keyword') { + return; + } + env.classes.push('keyword-' + env.content); + }); + +}()); diff --git a/plugins/highlight-keywords/prism-highlight-keywords.min.js b/plugins/highlight-keywords/prism-highlight-keywords.min.js index c06a208075..b0d8d9adb5 100644 --- a/plugins/highlight-keywords/prism-highlight-keywords.min.js +++ b/plugins/highlight-keywords/prism-highlight-keywords.min.js @@ -1 +1 @@ -"undefined"!=typeof self&&!self.Prism||"undefined"!=typeof global&&!global.Prism||Prism.hooks.add("wrap",function(e){"keyword"===e.type&&e.classes.push("keyword-"+e.content)}); \ No newline at end of file +"undefined"!=typeof Prism&&Prism.hooks.add("wrap",function(e){"keyword"===e.type&&e.classes.push("keyword-"+e.content)}); \ No newline at end of file diff --git a/plugins/index.html b/plugins/index.html index 629d5d75f3..cdab97fbb0 100644 --- a/plugins/index.html +++ b/plugins/index.html @@ -9,7 +9,7 @@ - + @@ -34,7 +34,7 @@

Contribute

- + diff --git a/plugins/inline-color/index.html b/plugins/inline-color/index.html index 60ef87e563..3639e065cf 100644 --- a/plugins/inline-color/index.html +++ b/plugins/inline-color/index.html @@ -15,7 +15,7 @@ color: red; } - + @@ -66,7 +66,7 @@

HTML (Markup)

- + diff --git a/plugins/inline-color/prism-inline-color.js b/plugins/inline-color/prism-inline-color.js index 9d9eccbda1..6e7b9edaa7 100644 --- a/plugins/inline-color/prism-inline-color.js +++ b/plugins/inline-color/prism-inline-color.js @@ -1,6 +1,6 @@ (function () { - if (typeof self === 'undefined' || typeof Prism === 'undefined' || typeof document === 'undefined') { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } diff --git a/plugins/inline-color/prism-inline-color.min.css b/plugins/inline-color/prism-inline-color.min.css new file mode 100644 index 0000000000..c161187fe4 --- /dev/null +++ b/plugins/inline-color/prism-inline-color.min.css @@ -0,0 +1 @@ +span.inline-color-wrapper{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyIDIiPjxwYXRoIGZpbGw9ImdyYXkiIGQ9Ik0wIDBoMnYySDB6Ii8+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0wIDBoMXYxSDB6TTEgMWgxdjFIMXoiLz48L3N2Zz4=);background-position:center;background-size:110%;display:inline-block;height:1.333ch;width:1.333ch;margin:0 .333ch;box-sizing:border-box;border:1px solid #fff;outline:1px solid rgba(0,0,0,.5);overflow:hidden}span.inline-color{display:block;height:120%;width:120%} \ No newline at end of file diff --git a/plugins/inline-color/prism-inline-color.min.js b/plugins/inline-color/prism-inline-color.min.js index cfb45f9694..c64c1572f6 100644 --- a/plugins/inline-color/prism-inline-color.min.js +++ b/plugins/inline-color/prism-inline-color.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&"undefined"!=typeof Prism&&"undefined"!=typeof document){var a=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/g,c=/^#?((?:[\da-f]){3,4}|(?:[\da-f]{2}){3,4})$/i,f=[function(n){var r=c.exec(n);if(r){for(var o=6<=(n=r[1]).length?2:1,e=n.length/o,s=1==o?1/15:1/255,t=[],i=0;i';n.content=i+o}})}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var a=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/g,c=/^#?((?:[\da-f]){3,4}|(?:[\da-f]{2}){3,4})$/i,l=[function(n){var r=c.exec(n);if(r){for(var o=6<=(n=r[1]).length?2:1,s=n.length/o,e=1==o?1/15:1/255,t=[],i=0;i';n.content=i+o}})}}(); \ No newline at end of file diff --git a/plugins/jsonp-highlight/index.html b/plugins/jsonp-highlight/index.html index d281adf18e..14b0278ee7 100644 --- a/plugins/jsonp-highlight/index.html +++ b/plugins/jsonp-highlight/index.html @@ -8,7 +8,7 @@ - + @@ -160,7 +160,7 @@

Examples

- + diff --git a/plugins/jsonp-highlight/prism-jsonp-highlight.js b/plugins/jsonp-highlight/prism-jsonp-highlight.js index 3312e99ae9..28541a3f3d 100644 --- a/plugins/jsonp-highlight/prism-jsonp-highlight.js +++ b/plugins/jsonp-highlight/prism-jsonp-highlight.js @@ -1,5 +1,6 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } @@ -28,7 +29,7 @@ */ function registerAdapter(adapter, name) { name = name || adapter.name; - if (typeof adapter === "function" && !getAdapter(adapter) && !getAdapter(name)) { + if (typeof adapter === 'function' && !getAdapter(adapter) && !getAdapter(name)) { adapters.push({ adapter: adapter, name: name }); } } @@ -41,15 +42,15 @@ * @returns {Adapter} A registered adapter or `null`. */ function getAdapter(adapter) { - if (typeof adapter === "function") { - for (var i = 0, item; item = adapters[i++];) { + if (typeof adapter === 'function') { + for (var i = 0, item; (item = adapters[i++]);) { if (item.adapter.valueOf() === adapter.valueOf()) { return item.adapter; } } - } - else if (typeof adapter === "string") { - for (var i = 0, item; item = adapters[i++];) { + } else if (typeof adapter === 'string') { + // eslint-disable-next-line no-redeclare + for (var i = 0, item; (item = adapters[i++]);) { if (item.name === adapter) { return item.adapter; } @@ -64,10 +65,10 @@ * @param {string|Function} adapter The adapter itself or the name of an adapter. */ function removeAdapter(adapter) { - if (typeof adapter === "string") { + if (typeof adapter === 'string') { adapter = getAdapter(adapter); } - if (typeof adapter === "function") { + if (typeof adapter === 'function') { var index = adapters.findIndex(function (item) { return item.adapter === adapter; }); @@ -77,15 +78,14 @@ } } - registerAdapter(function github(rsp, el) { + registerAdapter(function github(rsp) { if (rsp && rsp.meta && rsp.data) { if (rsp.meta.status && rsp.meta.status >= 400) { - return "Error: " + (rsp.data.message || rsp.meta.status); - } - else if (typeof (rsp.data.content) === "string") { - return typeof (atob) === "function" - ? atob(rsp.data.content.replace(/\s/g, "")) - : "Your browser cannot decode base64"; + return 'Error: ' + (rsp.data.message || rsp.meta.status); + } else if (typeof (rsp.data.content) === 'string') { + return typeof (atob) === 'function' + ? atob(rsp.data.content.replace(/\s/g, '')) + : 'Your browser cannot decode base64'; } } return null; @@ -93,11 +93,11 @@ registerAdapter(function gist(rsp, el) { if (rsp && rsp.meta && rsp.data && rsp.data.files) { if (rsp.meta.status && rsp.meta.status >= 400) { - return "Error: " + (rsp.data.message || rsp.meta.status); + return 'Error: ' + (rsp.data.message || rsp.meta.status); } var files = rsp.data.files; - var filename = el.getAttribute("data-filename"); + var filename = el.getAttribute('data-filename'); if (filename == null) { // Maybe in the future we can somehow render all files // But the standard + - +
@@ -39,6 +39,12 @@

How to use

However, you can deactivate the plugin for certain code element by adding the no-keep-markup class to it. You can also deactivate the plugin for the whole page by adding the no-keep-markup class to the body of the page and then selectively activate it again by adding the keep-markup class to code elements.

+

Double highlighting

+ +

Some plugins (e.g. Autoloader) need to re-highlight code blocks. This is a problem for Keep Markup because it will keep the markup of the first highlighting pass resulting in a lot of unnecessary DOM nodes and causing problems for themes and other plugins.

+ +

This problem can be fixed by adding a drop-tokens class to a code block or any of its ancestors. If drop-tokens is present, Keep Markup will ignore all span.token elements created by Prism.

+

Examples

The following source code

@@ -70,7 +76,7 @@

Examples

- + diff --git a/plugins/keep-markup/prism-keep-markup.js b/plugins/keep-markup/prism-keep-markup.js index b0fb0d0b4d..c160faa88f 100644 --- a/plugins/keep-markup/prism-keep-markup.js +++ b/plugins/keep-markup/prism-keep-markup.js @@ -1,6 +1,6 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document || !document.createRange) { + if (typeof Prism === 'undefined' || typeof document === 'undefined' || !document.createRange) { return; } @@ -15,38 +15,60 @@ return; } + var dropTokens = Prism.util.isActive(env.element, 'drop-tokens', false); + /** + * Returns whether the given element should be kept. + * + * @param {HTMLElement} element + * @returns {boolean} + */ + function shouldKeep(element) { + if (dropTokens && element.nodeName.toLowerCase() === 'span' && element.classList.contains('token')) { + return false; + } + return true; + } + var pos = 0; var data = []; - var f = function (elt, baseNode) { - var o = {}; - if (!baseNode) { - // Clone the original tag to keep all attributes - o.clone = elt.cloneNode(false); - o.posOpen = pos; - data.push(o); + function processElement(element) { + if (!shouldKeep(element)) { + // don't keep this element and just process its children + processChildren(element); + return; } - for (var i = 0, l = elt.childNodes.length; i < l; i++) { - var child = elt.childNodes[i]; + + var o = { + // Clone the original tag to keep all attributes + clone: element.cloneNode(false), + posOpen: pos + }; + data.push(o); + + processChildren(element); + + o.posClose = pos; + } + function processChildren(element) { + for (var i = 0, l = element.childNodes.length; i < l; i++) { + var child = element.childNodes[i]; if (child.nodeType === 1) { // element - f(child); - } else if(child.nodeType === 3) { // text + processElement(child); + } else if (child.nodeType === 3) { // text pos += child.data.length; } } - if (!baseNode) { - o.posClose = pos; - } - }; - f(env.element, true); + } + processChildren(env.element); - if (data && data.length) { + if (data.length) { // data is an array of all existing tags env.keepMarkup = data; } }); Prism.hooks.add('after-highlight', function (env) { - if(env.keepMarkup && env.keepMarkup.length) { + if (env.keepMarkup && env.keepMarkup.length) { var walk = function (elt, nodeState) { for (var i = 0, l = elt.childNodes.length; i < l; i++) { @@ -59,12 +81,12 @@ } } else if (child.nodeType === 3) { // text - if(!nodeState.nodeStart && nodeState.pos + child.data.length > nodeState.node.posOpen) { + if (!nodeState.nodeStart && nodeState.pos + child.data.length > nodeState.node.posOpen) { // We found the start position nodeState.nodeStart = child; nodeState.nodeStartPos = nodeState.node.posOpen - nodeState.pos; } - if(nodeState.nodeStart && nodeState.pos + child.data.length >= nodeState.node.posClose) { + if (nodeState.nodeStart && nodeState.pos + child.data.length >= nodeState.node.posClose) { // We found the end position nodeState.nodeEnd = child; nodeState.nodeEndPos = nodeState.node.posClose - nodeState.pos; diff --git a/plugins/keep-markup/prism-keep-markup.min.js b/plugins/keep-markup/prism-keep-markup.min.js index a0a0973fc8..6bea9d2efd 100644 --- a/plugins/keep-markup/prism-keep-markup.min.js +++ b/plugins/keep-markup/prism-keep-markup.min.js @@ -1 +1 @@ -"undefined"!=typeof self&&self.Prism&&self.document&&document.createRange&&(Prism.plugins.KeepMarkup=!0,Prism.hooks.add("before-highlight",function(e){if(e.element.children.length&&Prism.util.isActive(e.element,"keep-markup",!0)){var a=0,s=[],l=function(e,n){var o={};n||(o.clone=e.cloneNode(!1),o.posOpen=a,s.push(o));for(var t=0,d=e.childNodes.length;tn.node.posOpen&&(n.nodeStart=d,n.nodeStartPos=n.node.posOpen-n.pos),n.nodeStart&&n.pos+d.data.length>=n.node.posClose&&(n.nodeEnd=d,n.nodeEndPos=n.node.posClose-n.pos),n.pos+=d.data.length);if(n.nodeStart&&n.nodeEnd){var r=document.createRange();return r.setStart(n.nodeStart,n.nodeStartPos),r.setEnd(n.nodeEnd,n.nodeEndPos),n.node.clone.appendChild(r.extractContents()),r.insertNode(n.node.clone),r.detach(),!1}}return!0};n.keepMarkup.forEach(function(e){a(n.element,{node:e,pos:0})}),n.highlightedCode=n.element.innerHTML}})); \ No newline at end of file +"undefined"!=typeof Prism&&"undefined"!=typeof document&&document.createRange&&(Prism.plugins.KeepMarkup=!0,Prism.hooks.add("before-highlight",function(e){if(e.element.children.length&&Prism.util.isActive(e.element,"keep-markup",!0)){var o=Prism.util.isActive(e.element,"drop-tokens",!1),d=0,t=[];s(e.element),t.length&&(e.keepMarkup=t)}function r(e){if(function(e){return!o||"span"!==e.nodeName.toLowerCase()||!e.classList.contains("token")}(e)){var n={clone:e.cloneNode(!1),posOpen:d};t.push(n),s(e),n.posClose=d}else s(e)}function s(e){for(var n=0,o=e.childNodes.length;nn.node.posOpen&&(n.nodeStart=d,n.nodeStartPos=n.node.posOpen-n.pos),n.nodeStart&&n.pos+d.data.length>=n.node.posClose&&(n.nodeEnd=d,n.nodeEndPos=n.node.posClose-n.pos),n.pos+=d.data.length);if(n.nodeStart&&n.nodeEnd){var r=document.createRange();return r.setStart(n.nodeStart,n.nodeStartPos),r.setEnd(n.nodeEnd,n.nodeEndPos),n.node.clone.appendChild(r.extractContents()),r.insertNode(n.node.clone),r.detach(),!1}}return!0};n.keepMarkup.forEach(function(e){s(n.element,{node:e,pos:0})}),n.highlightedCode=n.element.innerHTML}})); \ No newline at end of file diff --git a/plugins/line-highlight/index.html b/plugins/line-highlight/index.html index f609a6fee1..f06b5a53a1 100644 --- a/plugins/line-highlight/index.html +++ b/plugins/line-highlight/index.html @@ -10,7 +10,7 @@ - + @@ -73,11 +73,15 @@

Line 43, starting from line 41

Linking example

-

With line numbers

-

+	

Compatible with Line numbers

+

+
+	

Even with some extra content before the code element.

+
Some content

+

With linkable line numbers

-

+	

 
 
@@ -86,7 +90,7 @@

With linkable line numbers

- + diff --git a/plugins/line-highlight/prism-line-highlight.css b/plugins/line-highlight/prism-line-highlight.css index 1262b9a342..ae47c89a28 100644 --- a/plugins/line-highlight/prism-line-highlight.css +++ b/plugins/line-highlight/prism-line-highlight.css @@ -19,6 +19,17 @@ pre[data-line] { white-space: pre; } +@media print { + .line-highlight { + /* + * This will prevent browsers from replacing the background color with white. + * It's necessary because the element is layered on top of the displayed code. + */ + -webkit-print-color-adjust: exact; + color-adjust: exact; + } +} + .line-highlight:before, .line-highlight[data-end]:after { content: attr(data-start); diff --git a/plugins/line-highlight/prism-line-highlight.js b/plugins/line-highlight/prism-line-highlight.js index 5f0a5e0ef1..1e615c2f49 100644 --- a/plugins/line-highlight/prism-line-highlight.js +++ b/plugins/line-highlight/prism-line-highlight.js @@ -1,9 +1,12 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) { + if (typeof Prism === 'undefined' || typeof document === 'undefined' || !document.querySelector) { return; } + var LINE_NUMBERS_CLASS = 'line-numbers'; + var LINKABLE_LINE_NUMBERS_CLASS = 'linkable-line-numbers'; + /** * @param {string} selector * @param {ParentNode} [container] @@ -21,8 +24,7 @@ * @returns {boolean} */ function hasClass(element, className) { - className = " " + className + " "; - return (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(className) > -1 + return element.classList.contains(className); } /** @@ -54,110 +56,169 @@ document.body.removeChild(d); } return res; - } + }; }()); /** - * Highlights the lines of the given pre. - * - * This function is split into a DOM measuring and mutate phase to improve performance. - * The returned function mutates the DOM when called. + * Returns the top offset of the content box of the given parent and the content box of one of its children. * - * @param {HTMLElement} pre - * @param {string} [lines] - * @param {string} [classes=''] - * @returns {() => void} + * @param {HTMLElement} parent + * @param {HTMLElement} child */ - function highlightLines(pre, lines, classes) { - lines = typeof lines === 'string' ? lines : pre.getAttribute('data-line'); + function getContentBoxTopOffset(parent, child) { + var parentStyle = getComputedStyle(parent); + var childStyle = getComputedStyle(child); - var ranges = lines.replace(/\s+/g, '').split(',').filter(Boolean); - var offset = +pre.getAttribute('data-line-offset') || 0; + /** + * Returns the numeric value of the given pixel value. + * + * @param {string} px + */ + function pxToNumber(px) { + return +px.substr(0, px.length - 2); + } - var parseMethod = isLineHeightRounded() ? parseInt : parseFloat; - var lineHeight = parseMethod(getComputedStyle(pre).lineHeight); - var hasLineNumbers = hasClass(pre, 'line-numbers'); - var parentElement = hasLineNumbers ? pre : pre.querySelector('code') || pre; - var mutateActions = /** @type {(() => void)[]} */ ([]); + return child.offsetTop + + pxToNumber(childStyle.borderTopWidth) + + pxToNumber(childStyle.paddingTop) + - pxToNumber(parentStyle.paddingTop); + } - ranges.forEach(function (currentRange) { - var range = currentRange.split('-'); + /** + * Returns whether the Line Highlight plugin is active for the given element. + * + * If this function returns `false`, do not call `highlightLines` for the given element. + * + * @param {HTMLElement | null | undefined} pre + * @returns {boolean} + */ + function isActiveFor(pre) { + if (!pre || !/pre/i.test(pre.nodeName)) { + return false; + } - var start = +range[0]; - var end = +range[1] || start; + if (pre.hasAttribute('data-line')) { + return true; + } - /** @type {HTMLElement} */ - var line = pre.querySelector('.line-highlight[data-range="' + currentRange + '"]') || document.createElement('div'); + if (pre.id && Prism.util.isActive(pre, LINKABLE_LINE_NUMBERS_CLASS)) { + // Technically, the line numbers plugin is also necessary but this plugin doesn't control the classes of + // the line numbers plugin, so we can't assume that they are present. + return true; + } - mutateActions.push(function () { - line.setAttribute('aria-hidden', 'true'); - line.setAttribute('data-range', currentRange); - line.className = (classes || '') + ' line-highlight'; - }); + return false; + } - // if the line-numbers plugin is enabled, then there is no reason for this plugin to display the line numbers - if (hasLineNumbers && Prism.plugins.lineNumbers) { - var startNode = Prism.plugins.lineNumbers.getLine(pre, start); - var endNode = Prism.plugins.lineNumbers.getLine(pre, end); + var scrollIntoView = true; - if (startNode) { - var top = startNode.offsetTop + 'px'; - mutateActions.push(function () { - line.style.top = top; - }); - } + Prism.plugins.lineHighlight = { + /** + * Highlights the lines of the given pre. + * + * This function is split into a DOM measuring and mutate phase to improve performance. + * The returned function mutates the DOM when called. + * + * @param {HTMLElement} pre + * @param {string | null} [lines] + * @param {string} [classes=''] + * @returns {() => void} + */ + highlightLines: function highlightLines(pre, lines, classes) { + lines = typeof lines === 'string' ? lines : (pre.getAttribute('data-line') || ''); + + var ranges = lines.replace(/\s+/g, '').split(',').filter(Boolean); + var offset = +pre.getAttribute('data-line-offset') || 0; + + var parseMethod = isLineHeightRounded() ? parseInt : parseFloat; + var lineHeight = parseMethod(getComputedStyle(pre).lineHeight); + var hasLineNumbers = Prism.util.isActive(pre, LINE_NUMBERS_CLASS); + var codeElement = pre.querySelector('code'); + var parentElement = hasLineNumbers ? pre : codeElement || pre; + var mutateActions = /** @type {(() => void)[]} */ ([]); + + /** + * 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 ``).
+			 *
+			 * This offset might not be zero for some themes where the  element has a top margin. Some plugins
+			 * (or users) might also add element above the  element. Because the line highlight is aligned relative
+			 * to the 
 element, we have to take this into account.
+			 *
+			 * This offset will be 0 if the parent element of the line highlight element is the `` element.
+			 */
+			var codePreOffset = !codeElement || parentElement == codeElement ? 0 : getContentBoxTopOffset(pre, codeElement);
+
+			ranges.forEach(function (currentRange) {
+				var range = currentRange.split('-');
+
+				var start = +range[0];
+				var end = +range[1] || start;
+
+				/** @type {HTMLElement} */
+				var line = pre.querySelector('.line-highlight[data-range="' + currentRange + '"]') || document.createElement('div');
 
-				if (endNode) {
-					var height = (endNode.offsetTop - startNode.offsetTop) + endNode.offsetHeight + 'px';
-					mutateActions.push(function () {
-						line.style.height = height;
-					});
-				}
-			} else {
 				mutateActions.push(function () {
-					line.setAttribute('data-start', start);
+					line.setAttribute('aria-hidden', 'true');
+					line.setAttribute('data-range', currentRange);
+					line.className = (classes || '') + ' line-highlight';
+				});
 
-					if (end > start) {
-						line.setAttribute('data-end', end);
+				// if the line-numbers plugin is enabled, then there is no reason for this plugin to display the line numbers
+				if (hasLineNumbers && Prism.plugins.lineNumbers) {
+					var startNode = Prism.plugins.lineNumbers.getLine(pre, start);
+					var endNode = Prism.plugins.lineNumbers.getLine(pre, end);
+
+					if (startNode) {
+						var top = startNode.offsetTop + codePreOffset + 'px';
+						mutateActions.push(function () {
+							line.style.top = top;
+						});
 					}
 
-					line.style.top = (start - offset - 1) * lineHeight + 'px';
+					if (endNode) {
+						var height = (endNode.offsetTop - startNode.offsetTop) + endNode.offsetHeight + 'px';
+						mutateActions.push(function () {
+							line.style.height = height;
+						});
+					}
+				} else {
+					mutateActions.push(function () {
+						line.setAttribute('data-start', String(start));
+
+						if (end > start) {
+							line.setAttribute('data-end', String(end));
+						}
+
+						line.style.top = (start - offset - 1) * lineHeight + codePreOffset + 'px';
 
-					line.textContent = new Array(end - start + 2).join(' \n');
+						line.textContent = new Array(end - start + 2).join(' \n');
+					});
+				}
+
+				mutateActions.push(function () {
+					line.style.width = pre.scrollWidth + 'px';
 				});
-			}
 
-			mutateActions.push(function () {
-				// allow this to play nicely with the line-numbers plugin
-				// need to attack to pre as when line-numbers is enabled, the code tag is relatively which screws up the positioning
-				parentElement.appendChild(line);
+				mutateActions.push(function () {
+					// allow this to play nicely with the line-numbers plugin
+					// need to attack to pre as when line-numbers is enabled, the code tag is relatively which screws up the positioning
+					parentElement.appendChild(line);
+				});
 			});
-		});
 
-		var id = pre.id;
-		if (hasLineNumbers && id) {
-			// This implements linkable line numbers. Linkable line numbers use Line Highlight to create a link to a
-			// specific line. For this to work, the pre element has to:
-			//  1) have line numbers,
-			//  2) have the `linkable-line-numbers` class or an ascendant that has that class, and
-			//  3) have an id.
-
-			var linkableLineNumbersClass = 'linkable-line-numbers';
-			var linkableLineNumbers = false;
-			var node = pre;
-			while (node) {
-				if (hasClass(node, linkableLineNumbersClass)) {
-					linkableLineNumbers = true;
-					break;
-				}
-				node = node.parentElement;
-			}
+			var id = pre.id;
+			if (hasLineNumbers && Prism.util.isActive(pre, LINKABLE_LINE_NUMBERS_CLASS) && id) {
+				// This implements linkable line numbers. Linkable line numbers use Line Highlight to create a link to a
+				// specific line. For this to work, the pre element has to:
+				//  1) have line numbers,
+				//  2) have the `linkable-line-numbers` class or an ascendant that has that class, and
+				//  3) have an id.
 
-			if (linkableLineNumbers) {
-				if (!hasClass(pre, linkableLineNumbersClass)) {
+				if (!hasClass(pre, LINKABLE_LINE_NUMBERS_CLASS)) {
 					// add class to pre
 					mutateActions.push(function () {
-						pre.className = (pre.className + ' ' + linkableLineNumbersClass).trim();
+						pre.classList.add(LINKABLE_LINE_NUMBERS_CLASS);
 					});
 				}
 
@@ -178,14 +239,14 @@
 					};
 				});
 			}
+
+			return function () {
+				mutateActions.forEach(callFunction);
+			};
 		}
+	};
 
-		return function () {
-			mutateActions.forEach(callFunction);
-		};
-	}
 
-	var scrollIntoView = true;
 	function applyHash() {
 		var hash = location.hash.slice(1);
 
@@ -200,8 +261,8 @@
 			return;
 		}
 
-		var id = hash.slice(0, hash.lastIndexOf('.')),
-			pre = document.getElementById(id);
+		var id = hash.slice(0, hash.lastIndexOf('.'));
+		var pre = document.getElementById(id);
 
 		if (!pre) {
 			return;
@@ -211,7 +272,7 @@
 			pre.setAttribute('data-line', '');
 		}
 
-		var mutateDom = highlightLines(pre, range, 'temporary ');
+		var mutateDom = Prism.plugins.lineHighlight.highlightLines(pre, range, 'temporary ');
 		mutateDom();
 
 		if (scrollIntoView) {
@@ -222,10 +283,8 @@
 	var fakeTimer = 0; // Hack to limit the number of times applyHash() runs
 
 	Prism.hooks.add('before-sanity-check', function (env) {
-		var pre = env.element.parentNode;
-		var lines = pre && pre.getAttribute('data-line');
-
-		if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
+		var pre = env.element.parentElement;
+		if (!isActiveFor(pre)) {
 			return;
 		}
 
@@ -242,16 +301,14 @@
 			line.parentNode.removeChild(line);
 		});
 		// Remove extra whitespace
-		if (num && /^( \n)+$/.test(env.code.slice(-num))) {
+		if (num && /^(?: \n)+$/.test(env.code.slice(-num))) {
 			env.code = env.code.slice(0, -num);
 		}
 	});
 
 	Prism.hooks.add('complete', function completeHook(env) {
-		var pre = env.element.parentNode;
-		var lines = pre && pre.getAttribute('data-line');
-
-		if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
+		var pre = env.element.parentElement;
+		if (!isActiveFor(pre)) {
 			return;
 		}
 
@@ -260,10 +317,10 @@
 		var hasLineNumbers = Prism.plugins.lineNumbers;
 		var isLineNumbersLoaded = env.plugins && env.plugins.lineNumbers;
 
-		if (hasClass(pre, 'line-numbers') && hasLineNumbers && !isLineNumbersLoaded) {
+		if (hasClass(pre, LINE_NUMBERS_CLASS) && hasLineNumbers && !isLineNumbersLoaded) {
 			Prism.hooks.add('line-numbers', completeHook);
 		} else {
-			var mutateDom = highlightLines(pre, lines);
+			var mutateDom = Prism.plugins.lineHighlight.highlightLines(pre);
 			mutateDom();
 			fakeTimer = setTimeout(applyHash, 1);
 		}
@@ -271,10 +328,12 @@
 
 	window.addEventListener('hashchange', applyHash);
 	window.addEventListener('resize', function () {
-		var actions = $$('pre[data-line]').map(function (pre) {
-			return highlightLines(pre);
-		});
+		var actions = $$('pre')
+			.filter(isActiveFor)
+			.map(function (pre) {
+				return Prism.plugins.lineHighlight.highlightLines(pre);
+			});
 		actions.forEach(callFunction);
 	});
 
-})();
+}());
diff --git a/plugins/line-highlight/prism-line-highlight.min.css b/plugins/line-highlight/prism-line-highlight.min.css
new file mode 100644
index 0000000000..6cd87723b4
--- /dev/null
+++ b/plugins/line-highlight/prism-line-highlight.min.css
@@ -0,0 +1 @@
+pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:rgba(128,128,128,.2)}
\ No newline at end of file
diff --git a/plugins/line-highlight/prism-line-highlight.min.js b/plugins/line-highlight/prism-line-highlight.min.js
index adf8d37755..c1f640b45c 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 self&&self.Prism&&self.document&&document.querySelector){var t,s=function(){if(void 0===t){var e=document.createElement("div");e.style.fontSize="13px",e.style.lineHeight="1.5",e.style.padding="0",e.style.border="0",e.innerHTML=" 
 ",document.body.appendChild(e),t=38===e.offsetHeight,document.body.removeChild(e)}return t},l=!0,a=0;Prism.hooks.add("before-sanity-check",function(e){var t=e.element.parentNode,n=t&&t.getAttribute("data-line");if(t&&n&&/pre/i.test(t.nodeName)){var i=0;g(".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(t){var n=t.element.parentNode,i=n&&n.getAttribute("data-line");if(n&&i&&/pre/i.test(n.nodeName)){clearTimeout(a);var r=Prism.plugins.lineNumbers,o=t.plugins&&t.plugins.lineNumbers;if(b(n,"line-numbers")&&r&&!o)Prism.hooks.add("line-numbers",e);else u(n,i)(),a=setTimeout(c,1)}}),window.addEventListener("hashchange",c),window.addEventListener("resize",function(){g("pre[data-line]").map(function(e){return u(e)}).forEach(v)})}function g(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function b(e,t){return t=" "+t+" ",-1<(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)}function v(e){e()}function u(u,e,c){var t=(e="string"==typeof e?e:u.getAttribute("data-line")).replace(/\s+/g,"").split(",").filter(Boolean),d=+u.getAttribute("data-line-offset")||0,f=(s()?parseInt:parseFloat)(getComputedStyle(u).lineHeight),m=b(u,"line-numbers"),p=m?u:u.querySelector("code")||u,h=[];t.forEach(function(e){var t=e.split("-"),n=+t[0],i=+t[1]||n,r=u.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(h.push(function(){r.setAttribute("aria-hidden","true"),r.setAttribute("data-range",e),r.className=(c||"")+" line-highlight"}),m&&Prism.plugins.lineNumbers){var o=Prism.plugins.lineNumbers.getLine(u,n),a=Prism.plugins.lineNumbers.getLine(u,i);if(o){var s=o.offsetTop+"px";h.push(function(){r.style.top=s})}if(a){var l=a.offsetTop-o.offsetTop+a.offsetHeight+"px";h.push(function(){r.style.height=l})}}else h.push(function(){r.setAttribute("data-start",n),n span",u).forEach(function(e,t){var n=t+a;e.onclick=function(){var e=i+"."+n;l=!1,location.hash=e,setTimeout(function(){l=!0},1)}})}}return function(){h.forEach(v)}}function c(){var e=location.hash.slice(1);g(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),i=document.getElementById(n);if(i)i.hasAttribute("data-line")||i.setAttribute("data-line",""),u(i,t,"temporary ")(),l&&document.querySelector(".temporary.line-highlight").scrollIntoView()}}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector){var t,o="line-numbers",s="linkable-line-numbers",l=function(){if(void 0===t){var e=document.createElement("div");e.style.fontSize="13px",e.style.lineHeight="1.5",e.style.padding="0",e.style.border="0",e.innerHTML=" 
 ",document.body.appendChild(e),t=38===e.offsetHeight,document.body.removeChild(e)}return t},a=!0;Prism.plugins.lineHighlight={highlightLines:function(u,e,c){var t=(e="string"==typeof e?e:u.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),d=+u.getAttribute("data-line-offset")||0,h=(l()?parseInt:parseFloat)(getComputedStyle(u).lineHeight),f=Prism.util.isActive(u,o),i=u.querySelector("code"),p=f?u:i||u,g=[],m=i&&p!=i?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)}(u,i):0;t.forEach(function(e){var t=e.split("-"),i=+t[0],n=+t[1]||i,r=u.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(g.push(function(){r.setAttribute("aria-hidden","true"),r.setAttribute("data-range",e),r.className=(c||"")+" line-highlight"}),f&&Prism.plugins.lineNumbers){var o=Prism.plugins.lineNumbers.getLine(u,i),s=Prism.plugins.lineNumbers.getLine(u,n);if(o){var l=o.offsetTop+m+"px";g.push(function(){r.style.top=l})}if(s){var a=s.offsetTop-o.offsetTop+s.offsetHeight+"px";g.push(function(){r.style.height=a})}}else g.push(function(){r.setAttribute("data-start",String(i)),i span",u).forEach(function(e,t){var i=t+r;e.onclick=function(){var e=n+"."+i;a=!1,location.hash=e,setTimeout(function(){a=!0},1)}})}return function(){g.forEach(b)}}};var u=0;Prism.hooks.add("before-sanity-check",function(e){var t=e.element.parentElement;if(c(t)){var i=0;v(".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(t){var i=t.element.parentElement;if(c(i)){clearTimeout(u);var n=Prism.plugins.lineNumbers,r=t.plugins&&t.plugins.lineNumbers;if(y(i,o)&&n&&!r)Prism.hooks.add("line-numbers",e);else Prism.plugins.lineHighlight.highlightLines(i)(),u=setTimeout(d,1)}}),window.addEventListener("hashchange",d),window.addEventListener("resize",function(){v("pre").filter(c).map(function(e){return Prism.plugins.lineHighlight.highlightLines(e)}).forEach(b)})}function v(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function y(e,t){return e.classList.contains(t)}function b(e){e()}function c(e){return!(!e||!/pre/i.test(e.nodeName))&&(!!e.hasAttribute("data-line")||!(!e.id||!Prism.util.isActive(e,s)))}function d(){var e=location.hash.slice(1);v(".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);if(n)n.hasAttribute("data-line")||n.setAttribute("data-line",""),Prism.plugins.lineHighlight.highlightLines(n,t,"temporary ")(),a&&document.querySelector(".temporary.line-highlight").scrollIntoView()}}}(); \ No newline at end of file diff --git a/plugins/line-numbers/index.html b/plugins/line-numbers/index.html index e1a1994f49..a6c93b1ace 100644 --- a/plugins/line-numbers/index.html +++ b/plugins/line-numbers/index.html @@ -9,7 +9,7 @@ - + @@ -75,7 +75,7 @@

Soft wrap support

- + diff --git a/plugins/line-numbers/prism-line-numbers.js b/plugins/line-numbers/prism-line-numbers.js index 16012f604d..71e8b6963a 100644 --- a/plugins/line-numbers/prism-line-numbers.js +++ b/plugins/line-numbers/prism-line-numbers.js @@ -1,17 +1,19 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } /** * Plugin name which is used as a class name for
 which is activating the plugin
-	 * @type {String}
+	 *
+	 * @type {string}
 	 */
 	var PLUGIN_NAME = 'line-numbers';
 
 	/**
 	 * Regular expression used for determining line breaks
+	 *
 	 * @type {RegExp}
 	 */
 	var NEW_LINE_EXP = /\n(?!$)/g;
@@ -23,9 +25,10 @@
 	var config = Prism.plugins.lineNumbers = {
 		/**
 		 * Get node for provided line number
+		 *
 		 * @param {Element} element pre element
-		 * @param {Number} number line number
-		 * @return {Element|undefined}
+		 * @param {number} number line number
+		 * @returns {Element|undefined}
 		 */
 		getLine: function (element, number) {
 			if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
@@ -33,6 +36,9 @@
 			}
 
 			var lineNumberRows = element.querySelector('.line-numbers-rows');
+			if (!lineNumberRows) {
+				return;
+			}
 			var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
 			var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);
 
@@ -52,6 +58,7 @@
 		 * Resizes the line numbers of the given element.
 		 *
 		 * This function will not add line numbers. It will only resize existing ones.
+		 *
 		 * @param {HTMLElement} element A `
` element with line numbers.
 		 * @returns {void}
 		 */
@@ -166,15 +173,16 @@
 
 	/**
 	 * Returns style declarations for the element
+	 *
 	 * @param {Element} element
 	 */
-	var getStyles = function (element) {
+	function getStyles(element) {
 		if (!element) {
 			return null;
 		}
 
 		return window.getComputedStyle ? getComputedStyle(element) : (element.currentStyle || null);
-	};
+	}
 
 	var lastWidth = undefined;
 	window.addEventListener('resize', function () {
diff --git a/plugins/line-numbers/prism-line-numbers.min.css b/plugins/line-numbers/prism-line-numbers.min.css
new file mode 100644
index 0000000000..8170f64670
--- /dev/null
+++ b/plugins/line-numbers/prism-line-numbers.min.css
@@ -0,0 +1 @@
+pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}
\ No newline at end of file
diff --git a/plugins/line-numbers/prism-line-numbers.min.js b/plugins/line-numbers/prism-line-numbers.min.js
index b0ee977c66..9ccb6da910 100644
--- a/plugins/line-numbers/prism-line-numbers.min.js
+++ b/plugins/line-numbers/prism-line-numbers.min.js
@@ -1 +1 @@
-!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var o="line-numbers",a=/\n(?!$)/g,e=Prism.plugins.lineNumbers={getLine:function(e,n){if("PRE"===e.tagName&&e.classList.contains(o)){var t=e.querySelector(".line-numbers-rows"),i=parseInt(e.getAttribute("data-start"),10)||1,r=i+(t.children.length-1);n");(i=document.createElement("span")).setAttribute("aria-hidden","true"),i.className="line-numbers-rows",i.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(i),u([t]),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0})}function u(e){if(0!=(e=e.filter(function(e){var n=t(e)["white-space"];return"pre-wrap"===n||"pre-line"===n})).length){var n=e.map(function(e){var n=e.querySelector("code"),t=e.querySelector(".line-numbers-rows");if(n&&t){var i=e.querySelector(".line-numbers-sizer"),r=n.textContent.split(a);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var s=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:s,sizer:i}}}).filter(Boolean);n.forEach(function(e){var i=e.sizer,n=e.lines,r=e.lineHeights,s=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach(function(e,n){if(e&&1");(i=document.createElement("span")).setAttribute("aria-hidden","true"),i.className="line-numbers-rows",i.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(i),u([t]),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0})}function u(e){if(0!=(e=e.filter(function(e){var n=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null}(e)["white-space"];return"pre-wrap"===n||"pre-line"===n})).length){var n=e.map(function(e){var n=e.querySelector("code"),t=e.querySelector(".line-numbers-rows");if(n&&t){var i=e.querySelector(".line-numbers-sizer"),r=n.textContent.split(a);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var s=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:s,sizer:i}}}).filter(Boolean);n.forEach(function(e){var i=e.sizer,n=e.lines,r=e.lineHeights,s=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach(function(e,n){if(e&&1
 
 
-
+
 
 
 
@@ -44,6 +44,9 @@ 

Examples

JavaScript


+	
const func = (a, b) => {
+	return `${a}:${b}`;
+}

Lisp

(defun factorial (n)
@@ -61,7 +64,7 @@ 

Lisp with rainbow braces 🌈 but without hover

- + diff --git a/plugins/match-braces/prism-match-braces.js b/plugins/match-braces/prism-match-braces.js index 2488e34bce..478f344ff3 100644 --- a/plugins/match-braces/prism-match-braces.js +++ b/plugins/match-braces/prism-match-braces.js @@ -1,16 +1,17 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } - var MATCH_ALL_CLASS = /(?:^|\s)match-braces(?:\s|$)/; - - var BRACE_HOVER_CLASS = /(?:^|\s)brace-hover(?:\s|$)/; - var BRACE_SELECTED_CLASS = /(?:^|\s)brace-selected(?:\s|$)/; - - var NO_BRACE_HOVER_CLASS = /(?:^|\s)no-brace-hover(?:\s|$)/; - var NO_BRACE_SELECT_CLASS = /(?:^|\s)no-brace-select(?:\s|$)/; + function mapClassName(name) { + var customClass = Prism.plugins.customClass; + if (customClass) { + return customClass.apply(name, 'none'); + } else { + return name; + } + } var PARTNER = { '(': ')', @@ -18,17 +19,26 @@ '{': '}', }; + // The names for brace types. + // These names have two purposes: 1) they can be used for styling and 2) they are used to pair braces. Only braces + // of the same type are paired. var NAMES = { '(': 'brace-round', '[': 'brace-square', '{': 'brace-curly', }; + // A map for brace aliases. + // This is useful for when some braces have a prefix/suffix as part of the punctuation token. + var BRACE_ALIAS_MAP = { + '${': '{', // JS template punctuation (e.g. `foo ${bar + 1}`) + }; + var LEVEL_WARP = 12; var pairIdCounter = 0; - var BRACE_ID_PATTERN = /^(pair-\d+-)(open|close)$/; + var BRACE_ID_PATTERN = /^(pair-\d+-)(close|open)$/; /** * Returns the brace partner given one brace of a brace pair. @@ -45,36 +55,32 @@ * @this {HTMLElement} */ function hoverBrace() { - for (var parent = this.parentElement; parent; parent = parent.parentElement) { - if (NO_BRACE_HOVER_CLASS.test(parent.className)) { - return; - } + if (!Prism.util.isActive(this, 'brace-hover', true)) { + return; } - [this, getPartnerBrace(this)].forEach(function (ele) { - ele.className = (ele.className.replace(BRACE_HOVER_CLASS, ' ') + ' brace-hover').replace(/\s+/g, ' '); + [this, getPartnerBrace(this)].forEach(function (e) { + e.classList.add(mapClassName('brace-hover')); }); } /** * @this {HTMLElement} */ function leaveBrace() { - [this, getPartnerBrace(this)].forEach(function (ele) { - ele.className = ele.className.replace(BRACE_HOVER_CLASS, ' '); + [this, getPartnerBrace(this)].forEach(function (e) { + e.classList.remove(mapClassName('brace-hover')); }); } /** * @this {HTMLElement} */ function clickBrace() { - for (var parent = this.parentElement; parent; parent = parent.parentElement) { - if (NO_BRACE_SELECT_CLASS.test(parent.className)) { - return; - } + if (!Prism.util.isActive(this, 'brace-select', true)) { + return; } - [this, getPartnerBrace(this)].forEach(function (ele) { - ele.className = (ele.className.replace(BRACE_SELECTED_CLASS, ' ') + ' brace-selected').replace(/\s+/g, ' '); + [this, getPartnerBrace(this)].forEach(function (e) { + e.classList.add(mapClassName('brace-selected')); }); } @@ -91,11 +97,8 @@ // find the braces to match /** @type {string[]} */ var toMatch = []; - for (var ele = code; ele; ele = ele.parentElement) { - if (MATCH_ALL_CLASS.test(ele.className)) { - toMatch.push('(', '[', '{'); - break; - } + if (Prism.util.isActive(code, 'match-braces')) { + toMatch.push('(', '[', '{'); } if (toMatch.length == 0) { @@ -108,22 +111,25 @@ pre.addEventListener('mousedown', function removeBraceSelected() { // the code element might have been replaced var code = pre.querySelector('code'); - Array.prototype.slice.call(code.querySelectorAll('.brace-selected')).forEach(function (element) { - element.className = element.className.replace(BRACE_SELECTED_CLASS, ' '); + var className = mapClassName('brace-selected'); + Array.prototype.slice.call(code.querySelectorAll('.' + className)).forEach(function (e) { + e.classList.remove(className); }); }); Object.defineProperty(pre, '__listenerAdded', { value: true }); } /** @type {HTMLSpanElement[]} */ - var punctuation = Array.prototype.slice.call(code.querySelectorAll('span.token.punctuation')); + var punctuation = Array.prototype.slice.call( + code.querySelectorAll('span.' + mapClassName('token') + '.' + mapClassName('punctuation')) + ); /** @type {{ index: number, open: boolean, element: HTMLElement }[]} */ var allBraces = []; toMatch.forEach(function (open) { var close = PARTNER[open]; - var name = NAMES[open]; + var name = mapClassName(NAMES[open]); /** @type {[number, number][]} */ var pairs = []; @@ -134,15 +140,16 @@ var element = punctuation[i]; if (element.childElementCount == 0) { var text = element.textContent; + text = BRACE_ALIAS_MAP[text] || text; if (text === open) { allBraces.push({ index: i, open: true, element: element }); - element.className += ' ' + name; - element.className += ' brace-open'; + element.classList.add(name); + element.classList.add(mapClassName('brace-open')); openStack.push(i); } else if (text === close) { allBraces.push({ index: i, open: false, element: element }); - element.className += ' ' + name; - element.className += ' brace-close'; + element.classList.add(name); + element.classList.add(mapClassName('brace-close')); if (openStack.length) { pairs.push([i, openStack.pop()]); } @@ -153,16 +160,16 @@ pairs.forEach(function (pair) { var pairId = 'pair-' + (pairIdCounter++) + '-'; - var openEle = punctuation[pair[0]]; - var closeEle = punctuation[pair[1]]; + var opening = punctuation[pair[0]]; + var closing = punctuation[pair[1]]; - openEle.id = pairId + 'open'; - closeEle.id = pairId + 'close'; + opening.id = pairId + 'open'; + closing.id = pairId + 'close'; - [openEle, closeEle].forEach(function (ele) { - ele.addEventListener('mouseenter', hoverBrace); - ele.addEventListener('mouseleave', leaveBrace); - ele.addEventListener('click', clickBrace); + [opening, closing].forEach(function (e) { + e.addEventListener('mouseenter', hoverBrace); + e.addEventListener('mouseleave', leaveBrace); + e.addEventListener('click', clickBrace); }); }); }); @@ -171,14 +178,13 @@ allBraces.sort(function (a, b) { return a.index - b.index; }); allBraces.forEach(function (brace) { if (brace.open) { - brace.element.className += ' brace-level-' + (level % LEVEL_WARP + 1); + brace.element.classList.add(mapClassName('brace-level-' + (level % LEVEL_WARP + 1))); level++; } else { level = Math.max(0, level - 1); - brace.element.className += ' brace-level-' + (level % LEVEL_WARP + 1); + brace.element.classList.add(mapClassName('brace-level-' + (level % LEVEL_WARP + 1))); } }); - }); }()); diff --git a/plugins/match-braces/prism-match-braces.min.css b/plugins/match-braces/prism-match-braces.min.css new file mode 100644 index 0000000000..367b166b5a --- /dev/null +++ b/plugins/match-braces/prism-match-braces.min.css @@ -0,0 +1 @@ +.token.punctuation.brace-hover,.token.punctuation.brace-selected{outline:solid 1px}.rainbow-braces .token.punctuation.brace-level-1,.rainbow-braces .token.punctuation.brace-level-5,.rainbow-braces .token.punctuation.brace-level-9{color:#e50;opacity:1}.rainbow-braces .token.punctuation.brace-level-10,.rainbow-braces .token.punctuation.brace-level-2,.rainbow-braces .token.punctuation.brace-level-6{color:#0b3;opacity:1}.rainbow-braces .token.punctuation.brace-level-11,.rainbow-braces .token.punctuation.brace-level-3,.rainbow-braces .token.punctuation.brace-level-7{color:#26f;opacity:1}.rainbow-braces .token.punctuation.brace-level-12,.rainbow-braces .token.punctuation.brace-level-4,.rainbow-braces .token.punctuation.brace-level-8{color:#e0e;opacity:1} \ No newline at end of file diff --git a/plugins/match-braces/prism-match-braces.min.js b/plugins/match-braces/prism-match-braces.min.js index 4ae2953dba..8b523abaaa 100644 --- a/plugins/match-braces/prism-match-braces.min.js +++ b/plugins/match-braces/prism-match-braces.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var c=/(?:^|\s)match-braces(?:\s|$)/,a=/(?:^|\s)brace-hover(?:\s|$)/,l=/(?:^|\s)brace-selected(?:\s|$)/,n=/(?:^|\s)no-brace-hover(?:\s|$)/,t=/(?:^|\s)no-brace-select(?:\s|$)/,u={"(":")","[":"]","{":"}"},f={"(":"brace-round","[":"brace-square","{":"brace-curly"},m=0,r=/^(pair-\d+-)(open|close)$/;Prism.hooks.add("complete",function(e){var a=e.element,n=a.parentElement;if(n&&"PRE"==n.tagName){for(var t=[],r=a;r;r=r.parentElement)if(c.test(r.className)){t.push("(","[","{");break}if(0!=t.length){n.__listenerAdded||(n.addEventListener("mousedown",function(){var e=n.querySelector("code");Array.prototype.slice.call(e.querySelectorAll(".brace-selected")).forEach(function(e){e.className=e.className.replace(l," ")})}),Object.defineProperty(n,"__listenerAdded",{value:!0}));var o=Array.prototype.slice.call(a.querySelectorAll("span.token.punctuation")),i=[];t.forEach(function(e){for(var a=u[e],n=f[e],t=[],r=[],s=0;s - + @@ -167,7 +167,7 @@

Examples

- + diff --git a/plugins/normalize-whitespace/prism-normalize-whitespace.js b/plugins/normalize-whitespace/prism-normalize-whitespace.js index 13d9341baa..c8bc361bbd 100644 --- a/plugins/normalize-whitespace/prism-normalize-whitespace.js +++ b/plugins/normalize-whitespace/prism-normalize-whitespace.js @@ -1,194 +1,198 @@ -(function() { +(function () { -var assign = Object.assign || function (obj1, obj2) { - for (var name in obj2) { - if (obj2.hasOwnProperty(name)) - obj1[name] = obj2[name]; + if (typeof Prism === 'undefined') { + return; } - return obj1; -} -function NormalizeWhitespace(defaults) { - this.defaults = assign({}, defaults); -} + var assign = Object.assign || function (obj1, obj2) { + for (var name in obj2) { + if (obj2.hasOwnProperty(name)) { + obj1[name] = obj2[name]; + } + } + return obj1; + }; -function toCamelCase(value) { - return value.replace(/-(\w)/g, function(match, firstChar) { - return firstChar.toUpperCase(); - }); -} + function NormalizeWhitespace(defaults) { + this.defaults = assign({}, defaults); + } -function tabLen(str) { - var res = 0; - for (var i = 0; i < str.length; ++i) { - if (str.charCodeAt(i) == '\t'.charCodeAt(0)) - res += 3; + function toCamelCase(value) { + return value.replace(/-(\w)/g, function (match, firstChar) { + return firstChar.toUpperCase(); + }); } - return str.length + res; -} - -NormalizeWhitespace.prototype = { - setDefaults: function (defaults) { - this.defaults = assign(this.defaults, defaults); - }, - normalize: function (input, settings) { - settings = assign(this.defaults, settings); - - for (var name in settings) { - var methodName = toCamelCase(name); - if (name !== "normalize" && methodName !== 'setDefaults' && - settings[name] && this[methodName]) { - input = this[methodName].call(this, input, settings[name]); + + function tabLen(str) { + var res = 0; + for (var i = 0; i < str.length; ++i) { + if (str.charCodeAt(i) == '\t'.charCodeAt(0)) { + res += 3; } } + return str.length + res; + } - return input; - }, - - /* - * Normalization methods - */ - leftTrim: function (input) { - return input.replace(/^\s+/, ''); - }, - rightTrim: function (input) { - return input.replace(/\s+$/, ''); - }, - tabsToSpaces: function (input, spaces) { - spaces = spaces|0 || 4; - return input.replace(/\t/g, new Array(++spaces).join(' ')); - }, - spacesToTabs: function (input, spaces) { - spaces = spaces|0 || 4; - return input.replace(RegExp(' {' + spaces + '}', 'g'), '\t'); - }, - removeTrailing: function (input) { - return input.replace(/\s*?$/gm, ''); - }, - // Support for deprecated plugin remove-initial-line-feed - removeInitialLineFeed: function (input) { - return input.replace(/^(?:\r?\n|\r)/, ''); - }, - removeIndent: function (input) { - var indents = input.match(/^[^\S\n\r]*(?=\S)/gm); - - if (!indents || !indents[0].length) - return input; + NormalizeWhitespace.prototype = { + setDefaults: function (defaults) { + this.defaults = assign(this.defaults, defaults); + }, + normalize: function (input, settings) { + settings = assign(this.defaults, settings); - indents.sort(function(a, b){return a.length - b.length; }); + for (var name in settings) { + var methodName = toCamelCase(name); + if (name !== 'normalize' && methodName !== 'setDefaults' && + settings[name] && this[methodName]) { + input = this[methodName].call(this, input, settings[name]); + } + } - if (!indents[0].length) return input; + }, + + /* + * Normalization methods + */ + leftTrim: function (input) { + return input.replace(/^\s+/, ''); + }, + rightTrim: function (input) { + return input.replace(/\s+$/, ''); + }, + tabsToSpaces: function (input, spaces) { + spaces = spaces|0 || 4; + return input.replace(/\t/g, new Array(++spaces).join(' ')); + }, + spacesToTabs: function (input, spaces) { + spaces = spaces|0 || 4; + return input.replace(RegExp(' {' + spaces + '}', 'g'), '\t'); + }, + removeTrailing: function (input) { + return input.replace(/\s*?$/gm, ''); + }, + // Support for deprecated plugin remove-initial-line-feed + removeInitialLineFeed: function (input) { + return input.replace(/^(?:\r?\n|\r)/, ''); + }, + removeIndent: function (input) { + var indents = input.match(/^[^\S\n\r]*(?=\S)/gm); + + if (!indents || !indents[0].length) { + return input; + } + + indents.sort(function (a, b) { return a.length - b.length; }); - return input.replace(RegExp('^' + indents[0], 'gm'), ''); - }, - indent: function (input, tabs) { - return input.replace(/^[^\S\n\r]*(?=\S)/gm, new Array(++tabs).join('\t') + '$&'); - }, - breakLines: function (input, characters) { - characters = (characters === true) ? 80 : characters|0 || 80; - - var lines = input.split('\n'); - for (var i = 0; i < lines.length; ++i) { - if (tabLen(lines[i]) <= characters) - continue; - - var line = lines[i].split(/(\s+)/g), - len = 0; - - for (var j = 0; j < line.length; ++j) { - var tl = tabLen(line[j]); - len += tl; - if (len > characters) { - line[j] = '\n' + line[j]; - len = tl; + if (!indents[0].length) { + return input; + } + + return input.replace(RegExp('^' + indents[0], 'gm'), ''); + }, + indent: function (input, tabs) { + return input.replace(/^[^\S\n\r]*(?=\S)/gm, new Array(++tabs).join('\t') + '$&'); + }, + breakLines: function (input, characters) { + characters = (characters === true) ? 80 : characters|0 || 80; + + var lines = input.split('\n'); + for (var i = 0; i < lines.length; ++i) { + if (tabLen(lines[i]) <= characters) { + continue; } + + var line = lines[i].split(/(\s+)/g); + var len = 0; + + for (var j = 0; j < line.length; ++j) { + var tl = tabLen(line[j]); + len += tl; + if (len > characters) { + line[j] = '\n' + line[j]; + len = tl; + } + } + lines[i] = line.join(''); } - lines[i] = line.join(''); + return lines.join('\n'); } - return lines.join('\n'); - } -}; - -// Support node modules -if (typeof module !== 'undefined' && module.exports) { - module.exports = NormalizeWhitespace; -} - -// Exit if prism is not loaded -if (typeof Prism === 'undefined') { - return; -} - -Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({ - 'remove-trailing': true, - 'remove-indent': true, - 'left-trim': true, - 'right-trim': true, - /*'break-lines': 80, - 'indent': 2, - 'remove-initial-line-feed': false, - 'tabs-to-spaces': 4, - 'spaces-to-tabs': 4*/ -}); - -Prism.hooks.add('before-sanity-check', function (env) { - var Normalizer = Prism.plugins.NormalizeWhitespace; - - // Check settings - if (env.settings && env.settings['whitespace-normalization'] === false) { - return; - } + }; - // Check classes - if (!Prism.util.isActive(env.element, 'whitespace-normalization', true)) { - return; + // Support node modules + if (typeof module !== 'undefined' && module.exports) { + module.exports = NormalizeWhitespace; } - // Simple mode if there is no env.element - if ((!env.element || !env.element.parentNode) && env.code) { - env.code = Normalizer.normalize(env.code, env.settings); - return; - } + Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({ + 'remove-trailing': true, + 'remove-indent': true, + 'left-trim': true, + 'right-trim': true, + /*'break-lines': 80, + 'indent': 2, + 'remove-initial-line-feed': false, + 'tabs-to-spaces': 4, + 'spaces-to-tabs': 4*/ + }); - // Normal mode - var pre = env.element.parentNode; - if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre') { - return; - } + Prism.hooks.add('before-sanity-check', function (env) { + var Normalizer = Prism.plugins.NormalizeWhitespace; - var children = pre.childNodes, - before = '', - after = '', - codeFound = false; - - // Move surrounding whitespace from the
 tag into the  tag
-	for (var i = 0; i < children.length; ++i) {
-		var node = children[i];
-
-		if (node == env.element) {
-			codeFound = true;
-		} else if (node.nodeName === "#text") {
-			if (codeFound) {
-				after += node.nodeValue;
-			} else {
-				before += node.nodeValue;
-			}
+		// Check settings
+		if (env.settings && env.settings['whitespace-normalization'] === false) {
+			return;
+		}
 
-			pre.removeChild(node);
-			--i;
+		// Check classes
+		if (!Prism.util.isActive(env.element, 'whitespace-normalization', true)) {
+			return;
 		}
-	}
 
-	if (!env.element.children.length || !Prism.plugins.KeepMarkup) {
-		env.code = before + env.code + after;
-		env.code = Normalizer.normalize(env.code, env.settings);
-	} else {
-		// Preserve markup for keep-markup plugin
-		var html = before + env.element.innerHTML + after;
-		env.element.innerHTML = Normalizer.normalize(html, env.settings);
-		env.code = env.element.textContent;
-	}
-});
+		// Simple mode if there is no env.element
+		if ((!env.element || !env.element.parentNode) && env.code) {
+			env.code = Normalizer.normalize(env.code, env.settings);
+			return;
+		}
+
+		// Normal mode
+		var pre = env.element.parentNode;
+		if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre') {
+			return;
+		}
+
+		var children = pre.childNodes;
+		var before = '';
+		var after = '';
+		var codeFound = false;
+
+		// Move surrounding whitespace from the 
 tag into the  tag
+		for (var i = 0; i < children.length; ++i) {
+			var node = children[i];
+
+			if (node == env.element) {
+				codeFound = true;
+			} else if (node.nodeName === '#text') {
+				if (codeFound) {
+					after += node.nodeValue;
+				} else {
+					before += node.nodeValue;
+				}
+
+				pre.removeChild(node);
+				--i;
+			}
+		}
+
+		if (!env.element.children.length || !Prism.plugins.KeepMarkup) {
+			env.code = before + env.code + after;
+			env.code = Normalizer.normalize(env.code, env.settings);
+		} else {
+			// Preserve markup for keep-markup plugin
+			var html = before + env.element.innerHTML + after;
+			env.element.innerHTML = Normalizer.normalize(html, env.settings);
+			env.code = env.element.textContent;
+		}
+	});
 
 }());
diff --git a/plugins/normalize-whitespace/prism-normalize-whitespace.min.js b/plugins/normalize-whitespace/prism-normalize-whitespace.min.js
index 06ee095a7e..36353c9b62 100644
--- a/plugins/normalize-whitespace/prism-normalize-whitespace.min.js
+++ b/plugins/normalize-whitespace/prism-normalize-whitespace.min.js
@@ -1 +1 @@
-!function(){var i=Object.assign||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e};function e(e){this.defaults=i({},e)}function s(e){for(var n=0,t=0;t
 	
 	
-	
+	
 
 	
 	
@@ -220,7 +220,7 @@ 

new Prism.plugins.Previewer(type, updater, - + diff --git a/plugins/previewers/prism-previewers.css b/plugins/previewers/prism-previewers.css index b36988c2bf..2d5e9570c0 100644 --- a/plugins/previewers/prism-previewers.css +++ b/plugins/previewers/prism-previewers.css @@ -13,6 +13,7 @@ width: 32px; height: 32px; margin-left: -16px; + z-index: 10; opacity: 0; -webkit-transition: opacity .25s; diff --git a/plugins/previewers/prism-previewers.js b/plugins/previewers/prism-previewers.js index eaf0500af1..89ac73f029 100644 --- a/plugins/previewers/prism-previewers.js +++ b/plugins/previewers/prism-previewers.js @@ -1,9 +1,6 @@ -(function() { +(function () { - if ( - typeof self !== 'undefined' && !self.Prism || - !self.document || !Function.prototype.bind - ) { + if (typeof Prism === 'undefined' || typeof document === 'undefined' || !Function.prototype.bind) { return; } @@ -18,15 +15,16 @@ /** * Returns a W3C-valid linear gradient + * * @param {string} prefix Vendor prefix if any ("-moz-", "-webkit-", etc.) * @param {string} func Gradient function name ("linear-gradient") * @param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"]) */ - var convertToW3CLinearGradient = function(prefix, func, values) { + var convertToW3CLinearGradient = function (prefix, func, values) { // Default value for angle var angle = '180deg'; - if (/^(?:-?\d*\.?\d+(?:deg|rad)|to\b|top|right|bottom|left)/.test(values[0])) { + if (/^(?:-?(?:\d+(?:\.\d+)?|\.\d+)(?:deg|rad)|to\b|top|right|bottom|left)/.test(values[0])) { angle = values.shift(); if (angle.indexOf('to ') < 0) { // Angle uses old keywords @@ -67,11 +65,12 @@ /** * Returns a W3C-valid radial gradient + * * @param {string} prefix Vendor prefix if any ("-moz-", "-webkit-", etc.) * @param {string} func Gradient function name ("linear-gradient") * @param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"]) */ - var convertToW3CRadialGradient = function(prefix, func, values) { + var convertToW3CRadialGradient = function (prefix, func, values) { if (values[0].indexOf('at') < 0) { // Looks like old syntax @@ -80,12 +79,12 @@ var shape = 'ellipse'; var size = 'farthest-corner'; - if (/\bcenter|top|right|bottom|left\b|^\d+/.test(values[0])) { + if (/\b(?:bottom|center|left|right|top)\b|^\d+/.test(values[0])) { // Found a position // Remove angle value, if any - position = values.shift().replace(/\s*-?\d+(?:rad|deg)\s*/, ''); + position = values.shift().replace(/\s*-?\d+(?:deg|rad)\s*/, ''); } - if (/\bcircle|ellipse|closest|farthest|contain|cover\b/.test(values[0])) { + if (/\b(?:circle|closest|contain|cover|ellipse|farthest)\b/.test(values[0])) { // Found a shape and/or size var shapeSizeParts = values.shift().split(/\s+/); if (shapeSizeParts[0] && (shapeSizeParts[0] === 'circle' || shapeSizeParts[0] === 'ellipse')) { @@ -111,9 +110,10 @@ /** * Converts a gradient to a W3C-valid one * Does not support old webkit syntax (-webkit-gradient(linear...) and -webkit-gradient(radial...)) + * * @param {string} gradient The CSS gradient */ - var convertToW3CGradient = function(gradient) { + var convertToW3CGradient = function (gradient) { if (cache[gradient]) { return cache[gradient]; } @@ -134,7 +134,7 @@ }; return function () { - new Prism.plugins.Previewer('gradient', function(value) { + new Prism.plugins.Previewer('gradient', function (value) { this.firstChild.style.backgroundImage = ''; this.firstChild.style.backgroundImage = convertToW3CGradient(value); return !!this.firstChild.style.backgroundImage; @@ -145,7 +145,7 @@ }()), tokens: { 'gradient': { - pattern: /(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:rgb|hsl)a?\(.+?\)|[^\)])+\)/gi, + pattern: /(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:hsl|rgb)a?\(.+?\)|[^\)])+\)/gi, inside: { 'function': /[\w-]+(?=\()/, 'punctuation': /[(),]/ @@ -188,16 +188,16 @@ }, 'angle': { create: function () { - new Prism.plugins.Previewer('angle', function(value) { + new Prism.plugins.Previewer('angle', function (value) { var num = parseFloat(value); var unit = value.match(/[a-z]+$/i); - var max, percentage; + var max; var percentage; if (!num || !unit) { return false; } unit = unit[0]; - switch(unit) { + switch (unit) { case 'deg': max = 360; break; @@ -211,10 +211,10 @@ max = 1; } - percentage = 100 * num/max; + percentage = 100 * num / max; percentage %= 100; - this[(num < 0? 'set' : 'remove') + 'Attribute']('data-negative', ''); + this[(num < 0 ? 'set' : 'remove') + 'Attribute']('data-negative', ''); this.querySelector('circle').style.strokeDasharray = Math.abs(percentage) + ',500'; return true; }, '*', function () { @@ -224,7 +224,7 @@ }); }, tokens: { - 'angle': /(?:\b|\B-|(?=\B\.))\d*\.?\d+(?:deg|g?rad|turn)\b/i + 'angle': /(?:\b|\B-|(?=\B\.))(?:\d+(?:\.\d+)?|\.\d+)(?:deg|g?rad|turn)\b/i }, languages: { 'css': true, @@ -267,7 +267,7 @@ }, 'color': { create: function () { - new Prism.plugins.Previewer('color', function(value) { + new Prism.plugins.Previewer('color', function (value) { this.style.backgroundColor = ''; this.style.backgroundColor = value; return !!this.style.backgroundColor; @@ -325,13 +325,13 @@ 'ease': '.25,.1,.25,1', 'ease-in': '.42,0,1,1', 'ease-out': '0,0,.58,1', - 'ease-in-out':'.42,0,.58,1' + 'ease-in-out': '.42,0,.58,1' }[value] || value; - var p = value.match(/-?\d*\.?\d+/g); + var p = value.match(/-?(?:\d+(?:\.\d+)?|\.\d+)/g); - if(p.length === 4) { - p = p.map(function(p, i) { return (i % 2? 1 - p : p) * 100; }); + if (p.length === 4) { + p = p.map(function (p, i) { return (i % 2 ? 1 - p : p) * 100; }); this.querySelector('path').setAttribute('d', 'M0,100 C' + p[0] + ',' + p[1] + ', ' + p[2] + ',' + p[3] + ', 100,0'); @@ -360,7 +360,7 @@ }, tokens: { 'easing': { - pattern: /\bcubic-bezier\((?:-?\d*\.?\d+,\s*){3}-?\d*\.?\d+\)\B|\b(?:linear|ease(?:-in)?(?:-out)?)(?=\s|[;}]|$)/i, + pattern: /\bcubic-bezier\((?:-?(?:\d+(?:\.\d+)?|\.\d+),\s*){3}-?(?:\d+(?:\.\d+)?|\.\d+)\)\B|\b(?:ease(?:-in)?(?:-out)?|linear)(?=\s|[;}]|$)/i, inside: { 'function': /[\w-]+(?=\()/, 'punctuation': /[(),]/ @@ -403,7 +403,7 @@ 'time': { create: function () { - new Prism.plugins.Previewer('time', function(value) { + new Prism.plugins.Previewer('time', function (value) { var num = parseFloat(value); var unit = value.match(/[a-z]+$/i); if (!num || !unit) { @@ -419,7 +419,7 @@ }); }, tokens: { - 'time': /(?:\b|\B-|(?=\B\.))\d*\.?\d+m?s\b/i + 'time': /(?:\b|\B-|(?=\B\.))(?:\d+(?:\.\d+)?|\.\d+)m?s\b/i }, languages: { 'css': true, @@ -464,6 +464,7 @@ /** * Returns the absolute X, Y offsets for an element + * * @param {HTMLElement} element * @returns {{top: number, right: number, bottom: number, left: number, width: number, height: number}} */ @@ -485,22 +486,22 @@ }; }; - var tokenRegexp = /(?:^|\s)token(?=$|\s)/; - var activeRegexp = /(?:^|\s)active(?=$|\s)/g; - var flippedRegexp = /(?:^|\s)flipped(?=$|\s)/g; + var TOKEN_CLASS = 'token'; + var ACTIVE_CLASS = 'active'; + var FLIPPED_CLASS = 'flipped'; /** * Previewer constructor + * * @param {string} type Unique previewer type - * @param {function} updater Function that will be called on mouseover. - * @param {string[]|string=} supportedLanguages Aliases of the languages this previewer must be enabled for. Defaults to "*", all languages. - * @param {function=} initializer Function that will be called on initialization. - * @constructor + * @param {Function} updater Function that will be called on mouseover. + * @param {string[]|string} [supportedLanguages] Aliases of the languages this previewer must be enabled for. Defaults to "*", all languages. + * @param {Function} [initializer] Function that will be called on initialization. + * @class */ var Previewer = function (type, updater, supportedLanguages, initializer) { this._elt = null; this._type = type; - this._clsRegexp = RegExp('(?:^|\\s)' + type + '(?=$|\\s)'); this._token = null; this.updater = updater; this._mouseout = this.mouseout.bind(this); @@ -538,34 +539,39 @@ this._elt = document.createElement('div'); this._elt.className = 'prism-previewer prism-previewer-' + this._type; document.body.appendChild(this._elt); - if(this.initializer) { + if (this.initializer) { this.initializer(); } }; + /** + * @param {Element} token + * @returns {boolean} + */ Previewer.prototype.isDisabled = function (token) { do { if (token.hasAttribute && token.hasAttribute('data-previewers')) { var previewers = token.getAttribute('data-previewers'); return (previewers || '').split(/\s+/).indexOf(this._type) === -1; } - } while(token = token.parentNode); + } while ((token = token.parentNode)); return false; }; /** * Checks the class name of each hovered element - * @param token + * + * @param {Element} token */ Previewer.prototype.check = function (token) { - if (tokenRegexp.test(token.className) && this.isDisabled(token)) { + if (token.classList.contains(TOKEN_CLASS) && this.isDisabled(token)) { return; } do { - if (tokenRegexp.test(token.className) && this._clsRegexp.test(token.className)) { + if (token.classList && token.classList.contains(TOKEN_CLASS) && token.classList.contains(this._type)) { break; } - } while(token = token.parentNode); + } while ((token = token.parentNode)); if (token && token !== this._token) { this._token = token; @@ -576,7 +582,7 @@ /** * Called on mouseout */ - Previewer.prototype.mouseout = function() { + Previewer.prototype.mouseout = function () { this._token.removeEventListener('mouseout', this._mouseout, false); this._token = null; this.hide(); @@ -597,14 +603,14 @@ this._token.addEventListener('mouseout', this._mouseout, false); var offset = getOffset(this._token); - this._elt.className += ' active'; + this._elt.classList.add(ACTIVE_CLASS); if (offset.top - this._elt.offsetHeight > 0) { - this._elt.className = this._elt.className.replace(flippedRegexp, ''); + this._elt.classList.remove(FLIPPED_CLASS); this._elt.style.top = offset.top + 'px'; this._elt.style.bottom = ''; } else { - this._elt.className += ' flipped'; + this._elt.classList.add(FLIPPED_CLASS); this._elt.style.bottom = offset.bottom + 'px'; this._elt.style.top = ''; } @@ -619,23 +625,26 @@ * Hides the previewer. */ Previewer.prototype.hide = function () { - this._elt.className = this._elt.className.replace(activeRegexp, ''); + this._elt.classList.remove(ACTIVE_CLASS); }; /** * Map of all registered previewers by language + * * @type {{}} */ Previewer.byLanguages = {}; /** * Map of all registered previewers by type + * * @type {{}} */ Previewer.byType = {}; /** * Initializes the mouseover event on the code block. + * * @param {HTMLElement} elt The code block (env.element) * @param {string} lang The language (env.language) */ @@ -665,7 +674,7 @@ lang = [lang]; } lang.forEach(function (lang) { - var before, inside, root, skip; + var before; var inside; var root; var skip; if (lang === true) { before = 'important'; inside = env.language; @@ -682,7 +691,7 @@ Prism.languages.insertBefore(inside, before, previewers[previewer].tokens, root); env.grammar = Prism.languages[lang]; - languages[env.language] = {initialized: true}; + languages[env.language] = { initialized: true }; } }); } @@ -691,7 +700,7 @@ // Initialize the previewers only when needed Prism.hooks.add('after-highlight', function (env) { - if(Previewer.byLanguages['*'] || Previewer.byLanguages[env.language]) { + if (Previewer.byLanguages['*'] || Previewer.byLanguages[env.language]) { Previewer.initEvents(env.element, env.language); } }); diff --git a/plugins/previewers/prism-previewers.min.css b/plugins/previewers/prism-previewers.min.css new file mode 100644 index 0000000000..8ba1b5b301 --- /dev/null +++ b/plugins/previewers/prism-previewers.min.css @@ -0,0 +1 @@ +.prism-previewer,.prism-previewer:after,.prism-previewer:before{position:absolute;pointer-events:none}.prism-previewer,.prism-previewer:after{left:50%}.prism-previewer{margin-top:-48px;width:32px;height:32px;margin-left:-16px;z-index:10;opacity:0;-webkit-transition:opacity .25s;-o-transition:opacity .25s;transition:opacity .25s}.prism-previewer.flipped{margin-top:0;margin-bottom:-48px}.prism-previewer:after,.prism-previewer:before{content:'';position:absolute;pointer-events:none}.prism-previewer:before{top:-5px;right:-5px;left:-5px;bottom:-5px;border-radius:10px;border:5px solid #fff;box-shadow:0 0 3px rgba(0,0,0,.5) inset,0 0 10px rgba(0,0,0,.75)}.prism-previewer:after{top:100%;width:0;height:0;margin:5px 0 0 -7px;border:7px solid transparent;border-color:rgba(255,0,0,0);border-top-color:#fff}.prism-previewer.flipped:after{top:auto;bottom:100%;margin-top:0;margin-bottom:5px;border-top-color:rgba(255,0,0,0);border-bottom-color:#fff}.prism-previewer.active{opacity:1}.prism-previewer-angle:before{border-radius:50%;background:#fff}.prism-previewer-angle:after{margin-top:4px}.prism-previewer-angle svg{width:32px;height:32px;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.prism-previewer-angle[data-negative] svg{-webkit-transform:scaleX(-1) rotate(-90deg);-moz-transform:scaleX(-1) rotate(-90deg);-ms-transform:scaleX(-1) rotate(-90deg);-o-transform:scaleX(-1) rotate(-90deg);transform:scaleX(-1) rotate(-90deg)}.prism-previewer-angle circle{fill:transparent;stroke:#2d3438;stroke-opacity:.9;stroke-width:32;stroke-dasharray:0,500}.prism-previewer-gradient{background-image:linear-gradient(45deg,#bbb 25%,transparent 25%,transparent 75%,#bbb 75%,#bbb),linear-gradient(45deg,#bbb 25%,#eee 25%,#eee 75%,#bbb 75%,#bbb);background-size:10px 10px;background-position:0 0,5px 5px;width:64px;margin-left:-32px}.prism-previewer-gradient:before{content:none}.prism-previewer-gradient div{position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;border-radius:10px;border:5px solid #fff;box-shadow:0 0 3px rgba(0,0,0,.5) inset,0 0 10px rgba(0,0,0,.75)}.prism-previewer-color{background-image:linear-gradient(45deg,#bbb 25%,transparent 25%,transparent 75%,#bbb 75%,#bbb),linear-gradient(45deg,#bbb 25%,#eee 25%,#eee 75%,#bbb 75%,#bbb);background-size:10px 10px;background-position:0 0,5px 5px}.prism-previewer-color:before{background-color:inherit;background-clip:padding-box}.prism-previewer-easing{margin-top:-76px;margin-left:-30px;width:60px;height:60px;background:#333}.prism-previewer-easing.flipped{margin-bottom:-116px}.prism-previewer-easing svg{width:60px;height:60px}.prism-previewer-easing circle{fill:#2d3438;stroke:#fff}.prism-previewer-easing path{fill:none;stroke:#fff;stroke-linecap:round;stroke-width:4}.prism-previewer-easing line{stroke:#fff;stroke-opacity:.5;stroke-width:2}@-webkit-keyframes prism-previewer-time{0%{stroke-dasharray:0,500;stroke-dashoffset:0}50%{stroke-dasharray:100,500;stroke-dashoffset:0}100%{stroke-dasharray:0,500;stroke-dashoffset:-100}}@-o-keyframes prism-previewer-time{0%{stroke-dasharray:0,500;stroke-dashoffset:0}50%{stroke-dasharray:100,500;stroke-dashoffset:0}100%{stroke-dasharray:0,500;stroke-dashoffset:-100}}@-moz-keyframes prism-previewer-time{0%{stroke-dasharray:0,500;stroke-dashoffset:0}50%{stroke-dasharray:100,500;stroke-dashoffset:0}100%{stroke-dasharray:0,500;stroke-dashoffset:-100}}@keyframes prism-previewer-time{0%{stroke-dasharray:0,500;stroke-dashoffset:0}50%{stroke-dasharray:100,500;stroke-dashoffset:0}100%{stroke-dasharray:0,500;stroke-dashoffset:-100}}.prism-previewer-time:before{border-radius:50%;background:#fff}.prism-previewer-time:after{margin-top:4px}.prism-previewer-time svg{width:32px;height:32px;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.prism-previewer-time circle{fill:transparent;stroke:#2d3438;stroke-opacity:.9;stroke-width:32;stroke-dasharray:0,500;stroke-dashoffset:0;-webkit-animation:prism-previewer-time linear infinite 3s;-moz-animation:prism-previewer-time linear infinite 3s;-o-animation:prism-previewer-time linear infinite 3s;animation:prism-previewer-time linear infinite 3s} \ No newline at end of file diff --git a/plugins/previewers/prism-previewers.min.js b/plugins/previewers/prism-previewers.min.js index 323f4472e8..2b28cd2570 100644 --- a/plugins/previewers/prism-previewers.min.js +++ b/plugins/previewers/prism-previewers.min.js @@ -1 +1 @@ -!function(){if(("undefined"==typeof self||self.Prism)&&self.document&&Function.prototype.bind){var r,s,o={gradient:{create:(r={},s=function(e){if(r[e])return r[e];var s=e.match(/^(\b|\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gradient)/),t=s&&s[1],i=s&&s[2],a=e.replace(/^(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\(|\)$/g,"").split(/\s*,\s*/);return 0<=i.indexOf("linear")?r[e]=function(e,s,t){var i="180deg";return/^(?:-?\d*\.?\d+(?:deg|rad)|to\b|top|right|bottom|left)/.test(t[0])&&(i=t.shift()).indexOf("to ")<0&&(0<=i.indexOf("top")?i=0<=i.indexOf("left")?"to bottom right":0<=i.indexOf("right")?"to bottom left":"to bottom":0<=i.indexOf("bottom")?i=0<=i.indexOf("left")?"to top right":0<=i.indexOf("right")?"to top left":"to top":0<=i.indexOf("left")?i="to right":0<=i.indexOf("right")?i="to left":e&&(0<=i.indexOf("deg")?i=90-parseFloat(i)+"deg":0<=i.indexOf("rad")&&(i=Math.PI/2-parseFloat(i)+"rad"))),s+"("+i+","+t.join(",")+")"}(t,i,a):0<=i.indexOf("radial")?r[e]=function(e,s,t){if(t[0].indexOf("at")<0){var i="center",a="ellipse",r="farthest-corner";if(/\bcenter|top|right|bottom|left\b|^\d+/.test(t[0])&&(i=t.shift().replace(/\s*-?\d+(?:rad|deg)\s*/,"")),/\bcircle|ellipse|closest|farthest|contain|cover\b/.test(t[0])){var n=t.shift().split(/\s+/);!n[0]||"circle"!==n[0]&&"ellipse"!==n[0]||(a=n.shift()),n[0]&&(r=n.shift()),"cover"===r?r="farthest-corner":"contain"===r&&(r="clothest-side")}return s+"("+a+" "+r+" at "+i+","+t.join(",")+")"}return s+"("+t.join(",")+")"}(0,i,a):r[e]=i+"("+a.join(",")+")"},function(){new Prism.plugins.Previewer("gradient",function(e){return this.firstChild.style.backgroundImage="",this.firstChild.style.backgroundImage=s(e),!!this.firstChild.style.backgroundImage},"*",function(){this._elt.innerHTML="
"})}),tokens:{gradient:{pattern:/(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:rgb|hsl)a?\(.+?\)|[^\)])+\)/gi,inside:{function:/[\w-]+(?=\()/,punctuation:/[(),]/}}},languages:{css:!0,less:!0,sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},angle:{create:function(){new Prism.plugins.Previewer("angle",function(e){var s,t,i=parseFloat(e),a=e.match(/[a-z]+$/i);if(!i||!a)return!1;switch(a=a[0]){case"deg":s=360;break;case"grad":s=400;break;case"rad":s=2*Math.PI;break;case"turn":s=1}return t=100*i/s,t%=100,this[(i<0?"set":"remove")+"Attribute"]("data-negative",""),this.querySelector("circle").style.strokeDasharray=Math.abs(t)+",500",!0},"*",function(){this._elt.innerHTML=''})},tokens:{angle:/(?:\b|\B-|(?=\B\.))\d*\.?\d+(?:deg|g?rad|turn)\b/i},languages:{css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},color:{create:function(){new Prism.plugins.Previewer("color",function(e){return this.style.backgroundColor="",this.style.backgroundColor=e,!!this.style.backgroundColor})},tokens:{color:[Prism.languages.css.hexcode].concat(Prism.languages.css.color)},languages:{css:!1,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!1,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},easing:{create:function(){new Prism.plugins.Previewer("easing",function(e){var s=(e={linear:"0,0,1,1",ease:".25,.1,.25,1","ease-in":".42,0,1,1","ease-out":"0,0,.58,1","ease-in-out":".42,0,.58,1"}[e]||e).match(/-?\d*\.?\d+/g);if(4!==s.length)return!1;s=s.map(function(e,s){return 100*(s%2?1-e:e)}),this.querySelector("path").setAttribute("d","M0,100 C"+s[0]+","+s[1]+", "+s[2]+","+s[3]+", 100,0");var t=this.querySelectorAll("line");return t[0].setAttribute("x2",s[0]),t[0].setAttribute("y2",s[1]),t[1].setAttribute("x2",s[2]),t[1].setAttribute("y2",s[3]),!0},"*",function(){this._elt.innerHTML=''})},tokens:{easing:{pattern:/\bcubic-bezier\((?:-?\d*\.?\d+,\s*){3}-?\d*\.?\d+\)\B|\b(?:linear|ease(?:-in)?(?:-out)?)(?=\s|[;}]|$)/i,inside:{function:/[\w-]+(?=\()/,punctuation:/[(),]/}}},languages:{css:!0,less:!0,sass:[{lang:"sass",inside:"inside",before:"punctuation",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},time:{create:function(){new Prism.plugins.Previewer("time",function(e){var s=parseFloat(e),t=e.match(/[a-z]+$/i);return!(!s||!t)&&(t=t[0],this.querySelector("circle").style.animationDuration=2*s+t,!0)},"*",function(){this._elt.innerHTML=''})},tokens:{time:/(?:\b|\B-|(?=\B\.))\d*\.?\d+m?s\b/i},languages:{css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}}},t=/(?:^|\s)token(?=$|\s)/,e=/(?:^|\s)active(?=$|\s)/g,i=/(?:^|\s)flipped(?=$|\s)/g,n=function(e,s,t,i){this._elt=null,this._type=e,this._clsRegexp=RegExp("(?:^|\\s)"+e+"(?=$|\\s)"),this._token=null,this.updater=s,this._mouseout=this.mouseout.bind(this),this.initializer=i;var a=this;t||(t=["*"]),Array.isArray(t)||(t=[t]),t.forEach(function(e){"string"!=typeof e&&(e=e.lang),n.byLanguages[e]||(n.byLanguages[e]=[]),n.byLanguages[e].indexOf(a)<0&&n.byLanguages[e].push(a)}),n.byType[e]=this};for(var a in n.prototype.init=function(){this._elt||(this._elt=document.createElement("div"),this._elt.className="prism-previewer prism-previewer-"+this._type,document.body.appendChild(this._elt),this.initializer&&this.initializer())},n.prototype.isDisabled=function(e){do{if(e.hasAttribute&&e.hasAttribute("data-previewers"))return-1===(e.getAttribute("data-previewers")||"").split(/\s+/).indexOf(this._type)}while(e=e.parentNode);return!1},n.prototype.check=function(e){if(!t.test(e.className)||!this.isDisabled(e)){do{if(t.test(e.className)&&this._clsRegexp.test(e.className))break}while(e=e.parentNode);e&&e!==this._token&&(this._token=e,this.show())}},n.prototype.mouseout=function(){this._token.removeEventListener("mouseout",this._mouseout,!1),this._token=null,this.hide()},n.prototype.show=function(){if(this._elt||this.init(),this._token)if(this.updater.call(this._elt,this._token.textContent)){this._token.addEventListener("mouseout",this._mouseout,!1);var e=function(e){var s=e.getBoundingClientRect(),t=s.left,i=s.top,a=document.documentElement.getBoundingClientRect();return t-=a.left,{top:i-=a.top,right:innerWidth-t-s.width,bottom:innerHeight-i-s.height,left:t,width:s.width,height:s.height}}(this._token);this._elt.className+=" active",0"})}),tokens:{gradient:{pattern:/(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:hsl|rgb)a?\(.+?\)|[^\)])+\)/gi,inside:{function:/[\w-]+(?=\()/,punctuation:/[(),]/}}},languages:{css:!0,less:!0,sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},angle:{create:function(){new Prism.plugins.Previewer("angle",function(e){var s,t,i=parseFloat(e),a=e.match(/[a-z]+$/i);if(!i||!a)return!1;switch(a=a[0]){case"deg":s=360;break;case"grad":s=400;break;case"rad":s=2*Math.PI;break;case"turn":s=1}return t=100*i/s,t%=100,this[(i<0?"set":"remove")+"Attribute"]("data-negative",""),this.querySelector("circle").style.strokeDasharray=Math.abs(t)+",500",!0},"*",function(){this._elt.innerHTML=''})},tokens:{angle:/(?:\b|\B-|(?=\B\.))(?:\d+(?:\.\d+)?|\.\d+)(?:deg|g?rad|turn)\b/i},languages:{css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},color:{create:function(){new Prism.plugins.Previewer("color",function(e){return this.style.backgroundColor="",this.style.backgroundColor=e,!!this.style.backgroundColor})},tokens:{color:[Prism.languages.css.hexcode].concat(Prism.languages.css.color)},languages:{css:!1,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!1,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},easing:{create:function(){new Prism.plugins.Previewer("easing",function(e){var s=(e={linear:"0,0,1,1",ease:".25,.1,.25,1","ease-in":".42,0,1,1","ease-out":"0,0,.58,1","ease-in-out":".42,0,.58,1"}[e]||e).match(/-?(?:\d+(?:\.\d+)?|\.\d+)/g);if(4!==s.length)return!1;s=s.map(function(e,s){return 100*(s%2?1-e:e)}),this.querySelector("path").setAttribute("d","M0,100 C"+s[0]+","+s[1]+", "+s[2]+","+s[3]+", 100,0");var t=this.querySelectorAll("line");return t[0].setAttribute("x2",s[0]),t[0].setAttribute("y2",s[1]),t[1].setAttribute("x2",s[2]),t[1].setAttribute("y2",s[3]),!0},"*",function(){this._elt.innerHTML=''})},tokens:{easing:{pattern:/\bcubic-bezier\((?:-?(?:\d+(?:\.\d+)?|\.\d+),\s*){3}-?(?:\d+(?:\.\d+)?|\.\d+)\)\B|\b(?:ease(?:-in)?(?:-out)?|linear)(?=\s|[;}]|$)/i,inside:{function:/[\w-]+(?=\()/,punctuation:/[(),]/}}},languages:{css:!0,less:!0,sass:[{lang:"sass",inside:"inside",before:"punctuation",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},time:{create:function(){new Prism.plugins.Previewer("time",function(e){var s=parseFloat(e),t=e.match(/[a-z]+$/i);return!(!s||!t)&&(t=t[0],this.querySelector("circle").style.animationDuration=2*s+t,!0)},"*",function(){this._elt.innerHTML=''})},tokens:{time:/(?:\b|\B-|(?=\B\.))(?:\d+(?:\.\d+)?|\.\d+)m?s\b/i},languages:{css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}}},t="token",i="active",a="flipped",r=function(e,s,t,i){this._elt=null,this._type=e,this._token=null,this.updater=s,this._mouseout=this.mouseout.bind(this),this.initializer=i;var a=this;t||(t=["*"]),Array.isArray(t)||(t=[t]),t.forEach(function(e){"string"!=typeof e&&(e=e.lang),r.byLanguages[e]||(r.byLanguages[e]=[]),r.byLanguages[e].indexOf(a)<0&&r.byLanguages[e].push(a)}),r.byType[e]=this};for(var e in r.prototype.init=function(){this._elt||(this._elt=document.createElement("div"),this._elt.className="prism-previewer prism-previewer-"+this._type,document.body.appendChild(this._elt),this.initializer&&this.initializer())},r.prototype.isDisabled=function(e){do{if(e.hasAttribute&&e.hasAttribute("data-previewers"))return-1===(e.getAttribute("data-previewers")||"").split(/\s+/).indexOf(this._type)}while(e=e.parentNode);return!1},r.prototype.check=function(e){if(!e.classList.contains(t)||!this.isDisabled(e)){do{if(e.classList&&e.classList.contains(t)&&e.classList.contains(this._type))break}while(e=e.parentNode);e&&e!==this._token&&(this._token=e,this.show())}},r.prototype.mouseout=function(){this._token.removeEventListener("mouseout",this._mouseout,!1),this._token=null,this.hide()},r.prototype.show=function(){if(this._elt||this.init(),this._token)if(this.updater.call(this._elt,this._token.textContent)){this._token.addEventListener("mouseout",this._mouseout,!1);var e=function(e){var s=e.getBoundingClientRect(),t=s.left,i=s.top,a=document.documentElement.getBoundingClientRect();return t-=a.left,{top:i-=a.top,right:innerWidth-t-s.width,bottom:innerHeight-i-s.height,left:t,width:s.width,height:s.height}}(this._token);this._elt.classList.add(i),0 - + @@ -45,7 +45,7 @@

With the class added

- + diff --git a/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js b/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js index f9c2cd6e85..ffad4b9393 100644 --- a/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js +++ b/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js @@ -1,21 +1,21 @@ -(function() { +(function () { -if (typeof self === 'undefined' || !self.Prism || !self.document) { - return; -} + if (typeof Prism === 'undefined' || typeof document === 'undefined') { + return; + } -Prism.hooks.add('before-sanity-check', function (env) { - if (env.code) { - var pre = env.element.parentNode; - var clsReg = /(?:^|\s)keep-initial-line-feed(?:\s|$)/; - if ( - pre && pre.nodeName.toLowerCase() === 'pre' && - // Apply only if nor the
 or the  have the class
-			(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
-		) {
-			env.code = env.code.replace(/^(?:\r?\n|\r)/, '');
+	Prism.hooks.add('before-sanity-check', function (env) {
+		if (env.code) {
+			var pre = env.element.parentNode;
+			var clsReg = /(?:^|\s)keep-initial-line-feed(?:\s|$)/;
+			if (
+				pre && pre.nodeName.toLowerCase() === 'pre' &&
+				// Apply only if nor the 
 or the  have the class
+				(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
+			) {
+				env.code = env.code.replace(/^(?:\r?\n|\r)/, '');
+			}
 		}
-	}
-});
+	});
 
 }());
diff --git a/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js b/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
index c9e904f494..f507edf165 100644
--- a/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
+++ b/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
@@ -1 +1 @@
-"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("before-sanity-check",function(e){if(e.code){var s=e.element.parentNode,n=/(?:^|\s)keep-initial-line-feed(?:\s|$)/;!s||"pre"!==s.nodeName.toLowerCase()||n.test(s.className)||n.test(e.element.className)||(e.code=e.code.replace(/^(?:\r?\n|\r)/,""))}});
\ No newline at end of file
+"undefined"!=typeof Prism&&"undefined"!=typeof document&&Prism.hooks.add("before-sanity-check",function(e){if(e.code){var n=e.element.parentNode,o=/(?:^|\s)keep-initial-line-feed(?:\s|$)/;!n||"pre"!==n.nodeName.toLowerCase()||o.test(n.className)||o.test(e.element.className)||(e.code=e.code.replace(/^(?:\r?\n|\r)/,""))}});
\ No newline at end of file
diff --git a/plugins/show-invisibles/index.html b/plugins/show-invisibles/index.html
index 19138a0d78..664a1b94e6 100644
--- a/plugins/show-invisibles/index.html
+++ b/plugins/show-invisibles/index.html
@@ -9,7 +9,7 @@
 
 
 
-
+
 
 
 
@@ -32,7 +32,7 @@ 

Examples

- + diff --git a/plugins/show-invisibles/prism-show-invisibles.js b/plugins/show-invisibles/prism-show-invisibles.js index 809bde2c85..e1f97f9581 100644 --- a/plugins/show-invisibles/prism-show-invisibles.js +++ b/plugins/show-invisibles/prism-show-invisibles.js @@ -1,9 +1,6 @@ (function () { - if ( - typeof self !== 'undefined' && !self.Prism || - typeof global !== 'undefined' && !global.Prism - ) { + if (typeof Prism === 'undefined') { return; } @@ -44,6 +41,7 @@ break; default: // 'Object' + // eslint-disable-next-line no-redeclare var inside = value.inside || (value.inside = {}); addInvisibles(inside); break; @@ -67,6 +65,7 @@ } } + // eslint-disable-next-line no-redeclare for (var name in grammar) { if (grammar.hasOwnProperty(name) && !invisibles[name]) { if (name === 'rest') { @@ -81,4 +80,4 @@ Prism.hooks.add('before-highlight', function (env) { addInvisibles(env.grammar); }); -})(); +}()); diff --git a/plugins/show-invisibles/prism-show-invisibles.min.css b/plugins/show-invisibles/prism-show-invisibles.min.css new file mode 100644 index 0000000000..0e2b048b90 --- /dev/null +++ b/plugins/show-invisibles/prism-show-invisibles.min.css @@ -0,0 +1 @@ +.token.cr,.token.lf,.token.space,.token.tab:not(:empty){position:relative}.token.cr:before,.token.lf:before,.token.space:before,.token.tab:not(:empty):before{color:grey;opacity:.6;position:absolute}.token.tab:not(:empty):before{content:'\21E5'}.token.cr:before{content:'\240D'}.token.crlf:before{content:'\240D\240A'}.token.lf:before{content:'\240A'}.token.space:before{content:'\00B7'} \ No newline at end of file diff --git a/plugins/show-invisibles/prism-show-invisibles.min.js b/plugins/show-invisibles/prism-show-invisibles.min.js index c8f600a66e..56231c4aa7 100644 --- a/plugins/show-invisibles/prism-show-invisibles.min.js +++ b/plugins/show-invisibles/prism-show-invisibles.min.js @@ -1 +1 @@ -!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var i={tab:/\t/,crlf:/\r\n/,lf:/\n/,cr:/\r/,space:/ /};Prism.hooks.add("before-highlight",function(r){s(r.grammar)})}function f(r,e){var i=r[e];switch(Prism.util.type(i)){case"RegExp":var a={};r[e]={pattern:i,inside:a},s(a);break;case"Array":for(var n=0,t=i.length;n - + @@ -33,6 +33,9 @@

HTML (Markup)

SVG

The data-language attribute can be used to display a specific label whether it has been defined as a language or not.


+
+	

Plain text

+
Just some text (aka. not code).
@@ -40,7 +43,7 @@

SVG

- + diff --git a/plugins/show-language/prism-show-language.js b/plugins/show-language/prism-show-language.js index f9bfdac40b..f5eac704dd 100644 --- a/plugins/show-language/prism-show-language.js +++ b/plugins/show-language/prism-show-language.js @@ -1,6 +1,6 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } @@ -10,8 +10,15 @@ return; } + /* eslint-disable */ + // The languages map is built automatically with gulp var Languages = /*languages_placeholder[*/{ + "none": "Plain text", + "plain": "Plain text", + "plaintext": "Plain text", + "text": "Plain text", + "txt": "Plain text", "html": "HTML", "xml": "XML", "svg": "SVG", @@ -29,33 +36,48 @@ "apacheconf": "Apache Configuration", "apl": "APL", "aql": "AQL", + "ino": "Arduino", "arff": "ARFF", "asciidoc": "AsciiDoc", "adoc": "AsciiDoc", "aspnet": "ASP.NET (C#)", "asm6502": "6502 Assembly", + "asmatmel": "Atmel AVR Assembly", "autohotkey": "AutoHotkey", "autoit": "AutoIt", + "avisynth": "AviSynth", + "avs": "AviSynth", + "avro-idl": "Avro IDL", + "avdl": "Avro IDL", "basic": "BASIC", "bbcode": "BBcode", "bnf": "BNF", "rbnf": "RBNF", + "bsl": "BSL (1C:Enterprise)", + "oscript": "OneScript", "csharp": "C#", "cs": "C#", "dotnet": "C#", "cpp": "C++", + "cfscript": "CFScript", + "cfc": "CFScript", "cil": "CIL", "cmake": "CMake", + "cobol": "COBOL", "coffee": "CoffeeScript", "conc": "Concurnas", "csp": "Content-Security-Policy", "css-extras": "CSS Extras", + "csv": "CSV", + "dataweave": "DataWeave", "dax": "DAX", "django": "Django/Jinja2", "jinja2": "Django/Jinja2", "dns-zone-file": "DNS zone file", "dns-zone": "DNS zone file", "dockerfile": "Docker", + "dot": "DOT (Graphviz)", + "gv": "DOT (Graphviz)", "ebnf": "EBNF", "editorconfig": "EditorConfig", "ejs": "EJS", @@ -69,11 +91,17 @@ "ftl": "FreeMarker Template Language", "gml": "GameMaker Language", "gamemakerlanguage": "GameMaker Language", + "gap": "GAP (CAS)", "gcode": "G-code", "gdscript": "GDScript", "gedcom": "GEDCOM", "glsl": "GLSL", + "gn": "GN", + "gni": "GN", + "go-module": "Go module", + "go-mod": "Go module", "graphql": "GraphQL", + "hbs": "Handlebars", "hs": "Haskell", "hcl": "HCL", "hlsl": "HLSL", @@ -81,6 +109,8 @@ "hpkp": "HTTP Public-Key-Pins", "hsts": "HTTP Strict-Transport-Security", "ichigojam": "IchigoJam", + "icu-message-format": "ICU Message Format", + "idr": "Idris", "ignore": ".ignore", "gitignore": ".gitignore", "hgignore": ".hgignore", @@ -98,8 +128,11 @@ "jsonp": "JSONP", "jsstacktrace": "JS stack trace", "js-templates": "JS Templates", + "keepalived": "Keepalived Configure", "kts": "Kotlin Script", "kt": "Kotlin", + "kumir": "KuMir (КуМир)", + "kum": "KuMir (КуМир)", "latex": "LaTeX", "tex": "TeX", "context": "ConTeXt", @@ -109,16 +142,22 @@ "elisp": "Lisp", "emacs-lisp": "Lisp", "llvm": "LLVM IR", + "log": "Log file", "lolcode": "LOLCODE", + "magma": "Magma (CAS)", "md": "Markdown", "markup-templating": "Markup templating", "matlab": "MATLAB", + "maxscript": "MAXScript", "mel": "MEL", + "mongodb": "MongoDB", "moon": "MoonScript", "n1ql": "N1QL", "n4js": "N4JS", "n4jsd": "N4JS", "nand2tetris-hdl": "Nand To Tetris HDL", + "naniscript": "Naninovel Script", + "nani": "Naninovel Script", "nasm": "NASM", "neon": "NEON", "nginx": "nginx", @@ -127,8 +166,11 @@ "objc": "Objective-C", "ocaml": "OCaml", "opencl": "OpenCL", + "openqasm": "OpenQasm", + "qasm": "OpenQasm", "parigp": "PARI/GP", "objectpascal": "Object Pascal", + "psl": "PATROL Scripting Language", "pcaxis": "PC-Axis", "px": "PC-Axis", "peoplecode": "PeopleCode", @@ -141,14 +183,20 @@ "pq": "PowerQuery", "mscript": "PowerQuery", "powershell": "PowerShell", + "promql": "PromQL", "properties": ".properties", "protobuf": "Protocol Buffers", "purebasic": "PureBasic", "pbfasm": "PureBasic", + "purs": "PureScript", "py": "Python", + "qsharp": "Q#", + "qs": "Q#", "q": "Q (kdb+ database)", "qml": "QML", "rkt": "Racket", + "cshtml": "Razor C#", + "razor": "Razor C#", "jsx": "React JSX", "tsx": "React TSX", "renpy": "Ren'py", @@ -161,6 +209,10 @@ "sass": "Sass (Sass)", "scss": "Sass (Scss)", "shell-session": "Shell session", + "sh-session": "Shell session", + "shellsession": "Shell session", + "sml": "SML", + "smlnj": "SML/NJ", "solidity": "Solidity (Ethereum)", "sol": "Solidity (Ethereum)", "solution-file": "Solution file", @@ -172,6 +224,7 @@ "sqf": "SQF: Status Quo Function (Arma 3)", "sql": "SQL", "iecst": "Structured Text (IEC 61131-3)", + "systemd": "Systemd configuration file", "t4-templating": "T4 templating", "t4-cs": "T4 Text Templates (C#)", "t4": "T4 Text Templates (C#)", @@ -179,10 +232,16 @@ "tap": "TAP", "tt2": "Template Toolkit 2", "toml": "TOML", + "trickle": "trickle", + "troy": "troy", "trig": "TriG", "ts": "TypeScript", + "tsconfig": "TSConfig", "uscript": "UnrealScript", "uc": "UnrealScript", + "uorazor": "UO Razor Script", + "uri": "URI", + "url": "URL", "vbnet": "VB.Net", "vhdl": "VHDL", "vim": "vim", @@ -190,7 +249,12 @@ "vba": "VBA", "vb": "Visual Basic", "wasm": "WebAssembly", + "web-idl": "Web IDL", + "webidl": "Web IDL", "wiki": "Wiki markup", + "wolfram": "Wolfram language", + "nb": "Mathematica Notebook", + "wl": "Wolfram language", "xeoracube": "XeoraCube", "xml-doc": "XML doc (.net)", "xojo": "Xojo (REALbasic)", @@ -200,6 +264,8 @@ "yang": "YANG" }/*]*/; + /* eslint-enable */ + Prism.plugins.toolbar.registerButton('show-language', function (env) { var pre = env.element.parentNode; if (!pre || !/pre/i.test(pre.nodeName)) { @@ -230,4 +296,4 @@ return element; }); -})(); +}()); diff --git a/plugins/show-language/prism-show-language.min.js b/plugins/show-language/prism-show-language.min.js index 6967c8aff8..355479c388 100644 --- a/plugins/show-language/prism-show-language.min.js +++ b/plugins/show-language/prism-show-language.min.js @@ -1 +1 @@ -!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var r={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",cmake:"CMake",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,o=a.getAttribute("data-language")||r[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(o){var s=document.createElement("span");return s.textContent=o,s}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var i={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",ino:"Arduino",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",asmatmel:"Atmel AVR Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",avisynth:"AviSynth",avs:"AviSynth","avro-idl":"Avro IDL",avdl:"Avro IDL",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gap:"GAP (CAS)",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gn:"GN",gni:"GN","go-module":"Go module","go-mod":"Go module",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",keepalived:"Keepalived Configure",kts:"Kotlin Script",kt:"Kotlin",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",magma:"Magma (CAS)",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",maxscript:"MAXScript",mel:"MEL",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",cshtml:"Razor C#",razor:"Razor C#",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",iecst:"Structured Text (IEC 61131-3)",systemd:"Systemd configuration file","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trickle:"trickle",troy:"troy",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",uorazor:"UO Razor Script",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly","web-idl":"Web IDL",webidl:"Web IDL",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,o=a.getAttribute("data-language")||i[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(o){var s=document.createElement("span");return s.textContent=o,s}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}(); \ No newline at end of file diff --git a/plugins/toolbar/index.html b/plugins/toolbar/index.html index e85db09654..6c5b88c152 100644 --- a/plugins/toolbar/index.html +++ b/plugins/toolbar/index.html @@ -9,7 +9,7 @@ - + @@ -100,7 +100,7 @@

Ordering buttons

- + + @@ -75,7 +75,7 @@

How to use

- + diff --git a/plugins/treeview/prism-treeview.css b/plugins/treeview/prism-treeview.css index 77957804a0..99ee658cb0 100644 --- a/plugins/treeview/prism-treeview.css +++ b/plugins/treeview/prism-treeview.css @@ -7,7 +7,7 @@ } .token.treeview-part .entry-line:before, .token.treeview-part .line-h:after { - content: ''; + content: ""; position: absolute; top: 0; left: 50%; @@ -31,28 +31,50 @@ position: relative; display: inline-block; vertical-align: top; - padding: 0 0 0 1.5em; } -.token.treeview-part .entry-name:before { - content: ''; - position: absolute; - top: 0; - left: 0.25em; - height: 100%; - width: 1em; - background: no-repeat 50% 50% / contain; -} - .token.treeview-part .entry-name.dotfile { opacity: 0.5; } +/* @GENERATED-FONT */ +@font-face { + font-family: "PrismTreeview"; + /** + * This font is generated from the .svg files in the `icons` folder. See the `treeviewIconFont` function in + * `gulpfile.js/index.js` for more information. + * + * Use the following escape sequences to refer to a specific icon: + * + * - \ea01 file + * - \ea02 folder + * - \ea03 image + * - \ea04 audio + * - \ea05 video + * - \ea06 text + * - \ea07 code + * - \ea08 archive + * - \ea09 pdf + * - \ea0a excel + * - \ea0b powerpoint + * - \ea0c word + */ + src: url("data:application/font-woff;base64,d09GRgABAAAAAAgYAAsAAAAAEGAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPwAAAFY1UkH9Y21hcAAAAYQAAAB/AAACCtvO7yxnbHlmAAACBAAAA+MAAAlACm1VqmhlYWQAAAXoAAAAKgAAADZfxj5jaGhlYQAABhQAAAAYAAAAJAFbAMFobXR4AAAGLAAAAA4AAAA0CGQAAGxvY2EAAAY8AAAAHAAAABwM9A9CbWF4cAAABlgAAAAfAAAAIAEgAHZuYW1lAAAGeAAAATcAAAJSfUrk+HBvc3QAAAewAAAAZgAAAIka0DSfeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGRYyjiBgZWBgaGQoRZISkLpUAYOBj0GBiYGVmYGrCAgzTWFweEV4ysehs1ArgDDFgZGIA3CDAB2tQjAAHic7ZHLEcMwCESfLCz/VEoKSEE5parURxMOC4c0Ec283WGFdABgBXrwCAzam4bOK9KWeefM3Hhmjyn3ed+hTRq1pS7Ra/HjYGPniHcXMy4G/zNTP7/KW5HTXArkvdBW3ArN19dCG/NRIN8K5HuB/CiQn4U26VeBfBbML9NEH78AeJyVVc1u20YQ3pn905JcSgr/YsuSDTEg3cR1bFEkYyS1HQcQ2jQF2hot6vYSoECKnnPLA/SWUy9NTr31Bfp+6azsNI0SGiolzu7ODnfn+2Z2lnHG3rxhr9nfLGKbLGesncAYYnUHpsVnMG/uwyzNdFIVd6HI6twp8+R3LpT4TSglLoTHwwJgG2/dFvKrl9yI507/p5CCq4LTxB/PlPjkFaMHnWB/0S9je7RTPS+utnGtom1T2q5pk/e3H0M1S18rsXAL7wgpxQuhAmteGGvNjmcfGXuwnFNOPCXxeOGmnjrBLWNyBeNtVq2Hs03yus1aPS3mzSyNVSfu588iW1Q93x/4fjcHn+5EkS2tMxr4xIRa8ese+4L9uKZnxEqs8+ldyN9atU02a5t5uQ8hZGms1QTKpaKYqnipiNNOAIeIADC0JNEOYY+jtSgFoOchiAjRGFACpUTRje8bwIYWGCDEgENY8MEu9bnCYCdAxftoNg0KiSpUtPaHcanYwzXRu6T4r40b5npal3V7UHWCPJW9niyl1vIHgoujEXZjudBkeWkOeMQBRmbEPhKzij1i52t6/TadL+3q7H0U1eq4E8cG4gIIwQLx8VX7ToPXgPrehVc5QXHR7gMSmwjKfaYAP4KvZV+yn9bE18y2IY37LvtyrSg3i7ZK++B603ndlg/gBJpZRsfpBI6hyiaQ6FjlnThz8lAC3LgBIMnXDOAXxBQ4SIgiEhx2AcGCAwAhwjXRpCQms42bwAUt75BvAwgONzdgOfWEwzk4Ylzj4mz+5YEzzXzWX9aNlk7ot65y5QnBHsNlm6zDTu7sspRqG4V+fgJ1lVBZ07Nm7s5nemo3Lf3PO7iwtnroQ5/YDGwPRUip6fV6L+27p+wCHwSvPs85UnHqId8NAn5IBsKdv95KrL9m31Gsf2a/rluDslk1y1J9GE+LUmmVT/OyOHaFKGnapt2H5XeJTmKd6qYNoVVZOy+pWzr7rMip3ndG/4mQSoUcMbAqG/YNIAdXhkAqTVruXhocSKN0iS4Rwj7vSS4fcF/La07BfeQSuRAcFeW+9igjwPhhYPpGCBCBHhxiKMyFMFT7ziRH7RtfIWdiha+TdW+Rqs7bLHdN2ZJIKl0um0x3op9saYr0REeRdj09pl43pMzz4tjztrY8L4o8bzT+oLY27PR/eFtXs/YY5vtwB5Iqad14eYN0ujveMaGWqkdU3TKbQSC5Uvxaf4fA7SAQ3r2tEfIhd4duld91bwMisjqBw22orthNcroXl7KqO1329HBgAexgoCfGAwiDPoBnriki3lmNojrzvD0tjo6E3vPYP6E2BMIAeJxjYGRgYADiY8t3FsTz23xl4GbYzIAB/v9nWM6wBcjgYGAC8QH+QQhZAAB4nGNgZGBg2MzAACeXMzAyoAJeADPyAh14nGNgAILNpGEA0fgIZQAAAAAAAAA2AHIAvgE+AZgCCAKMAv4DlgPsBEYEoHicY2BkYGDgZchi4GQAASYg5gJCBob/YD4DABTSAZcAeJx9kU1uwjAQhV/4qwpqhdSqi67cTTeVEmBXDgBbhBD7AHYISuLUMSD2PUdP0HNwjp6i676k3qQS9Ujjb968mYUNoI8zPJTHw02Vy9PAFatfbpLuHbfIT47b6MF33KH+6riLF0wc93CHN27wWtdUHvHuuIFbfDhuUv903CKfHbfxgC/HHerfjrtYen3HPTx7ambiIl0YKQ+xPM5ltE9CU9NqxVKaItaZGPqDmj6VmTShlRuxOoniEI2sVUIZnYqJzqxMEi1yo3dybf2ttfk4CJTT/bVOMYNBjAIpFiTJOLCWOGLOHGGPBCE7l32XO0tmw04MjQwCQ7774B//lDmrZkJY3hvOrHBiLuiJMKJqoVgrejQ3CP5Yubt0JwxNJa96Oypr6j621VSOMQKG+uP36eKmHylcb0MAeJxtwdEOgjAMBdBeWEFR/Mdl7bTJtMsygc/nwVfPoYF+QP+tGDAigDFhxgVXLLjhjhUPCtmKTtmLaGN7x6dy/Io5bybqoevRQ3LRObb0sk3HKpn1SFqW6ru26vbpYfcmRCccJhqsAAA=") + format("woff"); +} + .token.treeview-part .entry-name:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogIiAvPg0KCTwvZz4NCjwvc3ZnPg=='); + content: "\ea01"; + font-family: "PrismTreeview"; + font-size: inherit; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + width: 2.5ex; + display: inline-block; } -.token.treeview-part .entry-name.dir:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTUzNiAyMjR2NzA0cTAgNDAgLTI4IDY4dC02OCAyOGgtNzA0cS00MCAwIC02OCAyOHQtMjggNjh2NjRxMCA0MCAtMjggNjh0LTY4IDI4aC0zMjBxLTQwIDAgLTY4IC0yOHQtMjggLTY4di05NjBxMCAtNDAgMjggLTY4dDY4IC0yOGgxMjE2cTQwIDAgNjggMjh0MjggNjh6TTE2NjQgOTI4di03MDRxMCAtOTIgLTY2IC0xNTh0LTE1OCAtNjZoLTEyMTZxLTkyIDAgLTE1OCA2NnQtNjYgMTU4djk2MHEwIDkyIDY2IDE1OHQxNTggNjZoMzIwIHE5MiAwIDE1OCAtNjZ0NjYgLTE1OHYtMzJoNjcycTkyIDAgMTU4IC02NnQ2NiAtMTU4eiIgLz4NCgk8L2c+DQo8L3N2Zz4='); +.token.treeview-part .entry-name.dir:before { + content: "\ea02"; } .token.treeview-part .entry-name.ext-bmp:before, .token.treeview-part .entry-name.ext-eps:before, @@ -63,7 +85,7 @@ .token.treeview-part .entry-name.ext-png:before, .token.treeview-part .entry-name.ext-svg:before, .token.treeview-part .entry-name.ext-tiff:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTEyODAgMzIwdi0zMjBoLTEwMjR2MTkybDE5MiAxOTJsMTI4IC0xMjhsMzg0IDM4NHpNNDQ4IDUxMnEtODAgMCAtMTM2IDU2dC01NiAxMzZ0NTYgMTM2dDEzNiA1NnQxMzYgLTU2dDU2IC0xMzZ0LTU2IC0xMzZ0LTEzNiAtNTZ6IiAvPg0KCTwvZz4NCjwvc3ZnPg=='); + content: "\ea03"; } .token.treeview-part .entry-name.ext-cfg:before, .token.treeview-part .entry-name.ext-conf:before, @@ -74,7 +96,7 @@ .token.treeview-part .entry-name.ext-md:before, .token.treeview-part .entry-name.ext-nfo:before, .token.treeview-part .entry-name.ext-txt:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTM4NCA3MzZxMCAxNCA5IDIzdDIzIDloNzA0cTE0IDAgMjMgLTl0OSAtMjN2LTY0cTAgLTE0IC05IC0yM3QtMjMgLTloLTcwNHEtMTQgMCAtMjMgOXQtOSAyM3Y2NHpNMTEyMCA1MTJxMTQgMCAyMyAtOXQ5IC0yM3YtNjRxMCAtMTQgLTkgLTIzdC0yMyAtOWgtNzA0cS0xNCAwIC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDcwNHpNMTEyMCAyNTZxMTQgMCAyMyAtOXQ5IC0yM3YtNjRxMCAtMTQgLTkgLTIzdC0yMyAtOWgtNzA0IHEtMTQgMCAtMjMgOXQtOSAyM3Y2NHEwIDE0IDkgMjN0MjMgOWg3MDR6IiAvPg0KCTwvZz4NCjwvc3ZnPg=='); + content: "\ea06"; } .token.treeview-part .entry-name.ext-asp:before, .token.treeview-part .entry-name.ext-aspx:before, @@ -93,7 +115,7 @@ .token.treeview-part .entry-name.ext-php:before, .token.treeview-part .entry-name.ext-rb:before, .token.treeview-part .entry-name.ext-xml:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTQ4MCA3NjhxOCAxMSAyMSAxMi41dDI0IC02LjVsNTEgLTM4cTExIC04IDEyLjUgLTIxdC02LjUgLTI0bC0xODIgLTI0M2wxODIgLTI0M3E4IC0xMSA2LjUgLTI0dC0xMi41IC0yMWwtNTEgLTM4cS0xMSAtOCAtMjQgLTYuNXQtMjEgMTIuNWwtMjI2IDMwMXEtMTQgMTkgMCAzOHpNMTI4MiA0NjdxMTQgLTE5IDAgLTM4bC0yMjYgLTMwMXEtOCAtMTEgLTIxIC0xMi41dC0yNCA2LjVsLTUxIDM4cS0xMSA4IC0xMi41IDIxdDYuNSAyNGwxODIgMjQzIGwtMTgyIDI0M3EtOCAxMSAtNi41IDI0dDEyLjUgMjFsNTEgMzhxMTEgOCAyNCA2LjV0MjEgLTEyLjV6TTY2MiA2cS0xMyAyIC0yMC41IDEzdC01LjUgMjRsMTM4IDgzMXEyIDEzIDEzIDIwLjV0MjQgNS41bDYzIC0xMHExMyAtMiAyMC41IC0xM3Q1LjUgLTI0bC0xMzggLTgzMXEtMiAtMTMgLTEzIC0yMC41dC0yNCAtNS41eiIgLz4NCgk8L2c+DQo8L3N2Zz4='); + content: "\ea07"; } .token.treeview-part .entry-name.ext-7z:before, .token.treeview-part .entry-name.ext-bz:before, @@ -103,7 +125,7 @@ .token.treeview-part .entry-name.ext-tar:before, .token.treeview-part .entry-name.ext-tgz:before, .token.treeview-part .entry-name.ext-zip:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNNjQwIDExNTJ2MTI4aC0xMjh2LTEyOGgxMjh6TTc2OCAxMDI0djEyOGgtMTI4di0xMjhoMTI4ek02NDAgODk2djEyOGgtMTI4di0xMjhoMTI4ek03NjggNzY4djEyOGgtMTI4di0xMjhoMTI4ek0xNDY4IDExNTZxMjggLTI4IDQ4IC03NnQyMCAtODh2LTExNTJxMCAtNDAgLTI4IC02OHQtNjggLTI4aC0xMzQ0cS00MCAwIC02OCAyOHQtMjggNjh2MTYwMHEwIDQwIDI4IDY4dDY4IDI4aDg5NnE0MCAwIDg4IC0yMHQ3NiAtNDh6TTEwMjQgMTQwMCB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC0xMjh2LTEyOGgtMTI4djEyOGgtNTEydi0xNTM2aDEyODB6TTc4MSA1OTNsMTA3IC0zNDlxOCAtMjcgOCAtNTJxMCAtODMgLTcyLjUgLTEzNy41dC0xODMuNSAtNTQuNXQtMTgzLjUgNTQuNXQtNzIuNSAxMzcuNXEwIDI1IDggNTJxMjEgNjMgMTIwIDM5NnYxMjhoMTI4di0xMjhoNzkgcTIyIDAgMzkgLTEzdDIzIC0zNHpNNjQwIDEyOHE1MyAwIDkwLjUgMTl0MzcuNSA0NXQtMzcuNSA0NXQtOTAuNSAxOXQtOTAuNSAtMTl0LTM3LjUgLTQ1dDM3LjUgLTQ1dDkwLjUgLTE5eiIgLz4NCgk8L2c+DQo8L3N2Zz4='); + content: "\ea08"; } .token.treeview-part .entry-name.ext-aac:before, .token.treeview-part .entry-name.ext-au:before, @@ -114,7 +136,7 @@ .token.treeview-part .entry-name.ext-ogg:before, .token.treeview-part .entry-name.ext-wav:before, .token.treeview-part .entry-name.ext-wma:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTYyMCA2ODZxMjAgLTggMjAgLTMwdi01NDRxMCAtMjIgLTIwIC0zMHEtOCAtMiAtMTIgLTJxLTEyIDAgLTIzIDlsLTE2NiAxNjdoLTEzMXEtMTQgMCAtMjMgOXQtOSAyM3YxOTJxMCAxNCA5IDIzdDIzIDloMTMxbDE2NiAxNjdxMTYgMTUgMzUgN3pNMTAzNyAtM3EzMSAwIDUwIDI0cTEyOSAxNTkgMTI5IDM2M3QtMTI5IDM2M3EtMTYgMjEgLTQzIDI0dC00NyAtMTRxLTIxIC0xNyAtMjMuNSAtNDMuNXQxNC41IC00Ny41IHExMDAgLTEyMyAxMDAgLTI4MnQtMTAwIC0yODJxLTE3IC0yMSAtMTQuNSAtNDcuNXQyMy41IC00Mi41cTE4IC0xNSA0MCAtMTV6TTgyNiAxNDVxMjcgMCA0NyAyMHE4NyA5MyA4NyAyMTl0LTg3IDIxOXEtMTggMTkgLTQ1IDIwdC00NiAtMTd0LTIwIC00NC41dDE4IC00Ni41cTUyIC01NyA1MiAtMTMxdC01MiAtMTMxcS0xOSAtMjAgLTE4IC00Ni41dDIwIC00NC41cTIwIC0xNyA0NCAtMTd6IiAvPg0KCTwvZz4NCjwvc3ZnPg=='); + content: "\ea04"; } .token.treeview-part .entry-name.ext-avi:before, .token.treeview-part .entry-name.ext-flv:before, @@ -125,22 +147,22 @@ .token.treeview-part .entry-name.ext-mpg:before, .token.treeview-part .entry-name.ext-ogv:before, .token.treeview-part .entry-name.ext-webm:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTc2OCA3NjhxNTIgMCA5MCAtMzh0MzggLTkwdi0zODRxMCAtNTIgLTM4IC05MHQtOTAgLTM4aC0zODRxLTUyIDAgLTkwIDM4dC0zOCA5MHYzODRxMCA1MiAzOCA5MHQ5MCAzOGgzODR6TTEyNjAgNzY2cTIwIC04IDIwIC0zMHYtNTc2cTAgLTIyIC0yMCAtMzBxLTggLTIgLTEyIC0ycS0xNCAwIC0yMyA5bC0yNjUgMjY2djkwbDI2NSAyNjZxOSA5IDIzIDlxNCAwIDEyIC0yeiIgLz4NCgk8L2c+DQo8L3N2Zz4='); + content: "\ea05"; } .token.treeview-part .entry-name.ext-pdf:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTg5NCA0NjVxMzMgLTI2IDg0IC01NnE1OSA3IDExNyA3cTE0NyAwIDE3NyAtNDlxMTYgLTIyIDIgLTUycTAgLTEgLTEgLTJsLTIgLTJ2LTFxLTYgLTM4IC03MSAtMzhxLTQ4IDAgLTExNSAyMHQtMTMwIDUzcS0yMjEgLTI0IC0zOTIgLTgzcS0xNTMgLTI2MiAtMjQyIC0yNjJxLTE1IDAgLTI4IDdsLTI0IDEycS0xIDEgLTYgNXEtMTAgMTAgLTYgMzZxOSA0MCA1NiA5MS41dDEzMiA5Ni41cTE0IDkgMjMgLTZxMiAtMiAyIC00cTUyIDg1IDEwNyAxOTcgcTY4IDEzNiAxMDQgMjYycS0yNCA4MiAtMzAuNSAxNTkuNXQ2LjUgMTI3LjVxMTEgNDAgNDIgNDBoMjFoMXEyMyAwIDM1IC0xNXExOCAtMjEgOSAtNjhxLTIgLTYgLTQgLThxMSAtMyAxIC04di0zMHEtMiAtMTIzIC0xNCAtMTkycTU1IC0xNjQgMTQ2IC0yMzh6TTMxOCA1NHE1MiAyNCAxMzcgMTU4cS01MSAtNDAgLTg3LjUgLTg0dC00OS41IC03NHpNNzE2IDk3NHEtMTUgLTQyIC0yIC0xMzJxMSA3IDcgNDRxMCAzIDcgNDNxMSA0IDQgOCBxLTEgMSAtMSAydC0wLjUgMS41dC0wLjUgMS41cS0xIDIyIC0xMyAzNnEwIC0xIC0xIC0ydi0yek01OTIgMzEzcTEzNSA1NCAyODQgODFxLTIgMSAtMTMgOS41dC0xNiAxMy41cS03NiA2NyAtMTI3IDE3NnEtMjcgLTg2IC04MyAtMTk3cS0zMCAtNTYgLTQ1IC04M3pNMTIzOCAzMjlxLTI0IDI0IC0xNDAgMjRxNzYgLTI4IDEyNCAtMjhxMTQgMCAxOCAxcTAgMSAtMiAzeiIgLz4NCgk8L2c+DQo8L3N2Zz4='); + content: "\ea09"; } .token.treeview-part .entry-name.ext-xls:before, .token.treeview-part .entry-name.ext-xlsx:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTQyOSAxMDZ2LTEwNmgyODF2MTA2aC03NWwxMDMgMTYxcTUgNyAxMCAxNi41dDcuNSAxMy41dDMuNSA0aDJxMSAtNCA1IC0xMHEyIC00IDQuNSAtNy41dDYgLTh0Ni41IC04LjVsMTA3IC0xNjFoLTc2di0xMDZoMjkxdjEwNmgtNjhsLTE5MiAyNzNsMTk1IDI4Mmg2N3YxMDdoLTI3OXYtMTA3aDc0bC0xMDMgLTE1OXEtNCAtNyAtMTAgLTE2LjV0LTkgLTEzLjVsLTIgLTNoLTJxLTEgNCAtNSAxMHEtNiAxMSAtMTcgMjNsLTEwNiAxNTloNzZ2MTA3IGgtMjkwdi0xMDdoNjhsMTg5IC0yNzJsLTE5NCAtMjgzaC02OHoiIC8+DQoJPC9nPg0KPC9zdmc+'); + content: "\ea0a"; } .token.treeview-part .entry-name.ext-doc:before, .token.treeview-part .entry-name.ext-docm:before, .token.treeview-part .entry-name.ext-docx:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTIzMyA3Njh2LTEwN2g3MGwxNjQgLTY2MWgxNTlsMTI4IDQ4NXE3IDIwIDEwIDQ2cTIgMTYgMiAyNGg0bDMgLTI0cTEgLTMgMy41IC0yMHQ1LjUgLTI2bDEyOCAtNDg1aDE1OWwxNjQgNjYxaDcwdjEwN2gtMzAwdi0xMDdoOTBsLTk5IC00MzhxLTUgLTIwIC03IC00NmwtMiAtMjFoLTRsLTMgMjFxLTEgNSAtNCAyMXQtNSAyNWwtMTQ0IDU0NWgtMTE0bC0xNDQgLTU0NXEtMiAtOSAtNC41IC0yNC41dC0zLjUgLTIxLjVsLTQgLTIxaC00bC0yIDIxIHEtMiAyNiAtNyA0NmwtOTkgNDM4aDkwdjEwN2gtMzAweiIgLz4NCgk8L2c+DQo8L3N2Zz4='); + content: "\ea0c"; } .token.treeview-part .entry-name.ext-pps:before, .token.treeview-part .entry-name.ext-ppt:before, .token.treeview-part .entry-name.ext-pptx:before { - background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiA+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIxNzkuMiIgd2lkdGg9IjE3OS4yIj4NCgk8Zz4NCgkJPHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjEsLTAuMSkgdHJhbnNsYXRlKDAsLTE1MzYpIiBkPSJNMTQ2OCAxMTU2cTI4IC0yOCA0OCAtNzZ0MjAgLTg4di0xMTUycTAgLTQwIC0yOCAtNjh0LTY4IC0yOGgtMTM0NHEtNDAgMCAtNjggMjh0LTI4IDY4djE2MDBxMCA0MCAyOCA2OHQ2OCAyOGg4OTZxNDAgMCA4OCAtMjB0NzYgLTQ4ek0xMDI0IDE0MDB2LTM3NmgzNzZxLTEwIDI5IC0yMiA0MWwtMzEzIDMxM3EtMTIgMTIgLTQxIDIyek0xNDA4IC0xMjh2MTAyNGgtNDE2cS00MCAwIC02OCAyOHQtMjggNjh2NDE2aC03Njh2LTE1MzZoMTI4MHogTTQxNiAxMDZ2LTEwNmgzMjd2MTA2aC05M3YxNjdoMTM3cTc2IDAgMTE4IDE1cTY3IDIzIDEwNi41IDg3dDM5LjUgMTQ2cTAgODEgLTM3IDE0MXQtMTAwIDg3cS00OCAxOSAtMTMwIDE5aC0zNjh2LTEwN2g5MnYtNTU1aC05MnpNNzY5IDM4NmgtMTE5djI2OGgxMjBxNTIgMCA4MyAtMThxNTYgLTMzIDU2IC0xMTVxMCAtODkgLTYyIC0xMjBxLTMxIC0xNSAtNzggLTE1eiIgLz4NCgk8L2c+DQo8L3N2Zz4='); + content: "\ea0b"; } diff --git a/plugins/treeview/prism-treeview.js b/plugins/treeview/prism-treeview.js index 41fa83c89a..945668320a 100644 --- a/plugins/treeview/prism-treeview.js +++ b/plugins/treeview/prism-treeview.js @@ -1,63 +1,70 @@ -Prism.languages.treeview = { - 'treeview-part': { - pattern: /^.+/m, - inside: { - 'entry-line': [ - { - pattern: /\|-- |├── /, - alias: 'line-h' - }, - { - pattern: /\| |│ /, - alias: 'line-v' - }, - { - pattern: /`-- |└── /, - alias: 'line-v-last' - }, - { - pattern: / {4}/, - alias: 'line-v-gap' - } - ], - 'entry-name': { - pattern: /.*\S.*/, - inside: { - // symlink - 'operator': / -> /, +(function () { + + if (typeof Prism === 'undefined') { + return; + } + + Prism.languages.treeview = { + 'treeview-part': { + pattern: /^.+/m, + inside: { + 'entry-line': [ + { + pattern: /\|-- |├── /, + alias: 'line-h' + }, + { + pattern: /\| {3}|│ {3}/, + alias: 'line-v' + }, + { + pattern: /`-- |└── /, + alias: 'line-v-last' + }, + { + pattern: / {4}/, + alias: 'line-v-gap' + } + ], + 'entry-name': { + pattern: /.*\S.*/, + inside: { + // symlink + 'operator': / -> /, + } } } } - } -}; - -Prism.hooks.add('wrap', function (env) { - if (env.language === 'treeview' && env.type === 'entry-name') { - var classes = env.classes; - - var folderPattern = /(^|[^\\])\/\s*$/; - if (folderPattern.test(env.content)) { - // folder - - // remove trailing / - env.content = env.content.replace(folderPattern, '$1'); - classes.push('dir'); - } else { - // file - - // remove trailing file marker - env.content = env.content.replace(/(^|[^\\])[=*|]\s*$/, '$1'); - - var parts = env.content.toLowerCase().replace(/\s+/g, '').split('.'); - while (parts.length > 1) { - parts.shift(); - // Ex. 'foo.min.js' would become 'foo.min.js' - classes.push('ext-' + parts.join('-')); + }; + + Prism.hooks.add('wrap', function (env) { + if (env.language === 'treeview' && env.type === 'entry-name') { + var classes = env.classes; + + var folderPattern = /(^|[^\\])\/\s*$/; + if (folderPattern.test(env.content)) { + // folder + + // remove trailing / + env.content = env.content.replace(folderPattern, '$1'); + classes.push('dir'); + } else { + // file + + // remove trailing file marker + env.content = env.content.replace(/(^|[^\\])[=*|]\s*$/, '$1'); + + var parts = env.content.toLowerCase().replace(/\s+/g, '').split('.'); + while (parts.length > 1) { + parts.shift(); + // Ex. 'foo.min.js' would become 'foo.min.js' + classes.push('ext-' + parts.join('-')); + } } - } - if (env.content[0] === '.') { - classes.push('dotfile'); + if (env.content[0] === '.') { + classes.push('dotfile'); + } } - } -}); + }); +}()); diff --git a/plugins/treeview/prism-treeview.min.css b/plugins/treeview/prism-treeview.min.css new file mode 100644 index 0000000000..9856725d67 --- /dev/null +++ b/plugins/treeview/prism-treeview.min.css @@ -0,0 +1 @@ +.token.treeview-part .entry-line{position:relative;text-indent:-99em;display:inline-block;vertical-align:top;width:1.2em}.token.treeview-part .entry-line:before,.token.treeview-part .line-h:after{content:"";position:absolute;top:0;left:50%;width:50%;height:100%}.token.treeview-part .line-h:before,.token.treeview-part .line-v:before{border-left:1px solid #ccc}.token.treeview-part .line-v-last:before{height:50%;border-left:1px solid #ccc;border-bottom:1px solid #ccc}.token.treeview-part .line-h:after{height:50%;border-bottom:1px solid #ccc}.token.treeview-part .entry-name{position:relative;display:inline-block;vertical-align:top}.token.treeview-part .entry-name.dotfile{opacity:.5}@font-face{font-family:PrismTreeview;src:url(data:application/font-woff;base64,d09GRgABAAAAAAgYAAsAAAAAEGAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPwAAAFY1UkH9Y21hcAAAAYQAAAB/AAACCtvO7yxnbHlmAAACBAAAA+MAAAlACm1VqmhlYWQAAAXoAAAAKgAAADZfxj5jaGhlYQAABhQAAAAYAAAAJAFbAMFobXR4AAAGLAAAAA4AAAA0CGQAAGxvY2EAAAY8AAAAHAAAABwM9A9CbWF4cAAABlgAAAAfAAAAIAEgAHZuYW1lAAAGeAAAATcAAAJSfUrk+HBvc3QAAAewAAAAZgAAAIka0DSfeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGRYyjiBgZWBgaGQoRZISkLpUAYOBj0GBiYGVmYGrCAgzTWFweEV4ysehs1ArgDDFgZGIA3CDAB2tQjAAHic7ZHLEcMwCESfLCz/VEoKSEE5parURxMOC4c0Ec283WGFdABgBXrwCAzam4bOK9KWeefM3Hhmjyn3ed+hTRq1pS7Ra/HjYGPniHcXMy4G/zNTP7/KW5HTXArkvdBW3ArN19dCG/NRIN8K5HuB/CiQn4U26VeBfBbML9NEH78AeJyVVc1u20YQ3pn905JcSgr/YsuSDTEg3cR1bFEkYyS1HQcQ2jQF2hot6vYSoECKnnPLA/SWUy9NTr31Bfp+6azsNI0SGiolzu7ODnfn+2Z2lnHG3rxhr9nfLGKbLGesncAYYnUHpsVnMG/uwyzNdFIVd6HI6twp8+R3LpT4TSglLoTHwwJgG2/dFvKrl9yI507/p5CCq4LTxB/PlPjkFaMHnWB/0S9je7RTPS+utnGtom1T2q5pk/e3H0M1S18rsXAL7wgpxQuhAmteGGvNjmcfGXuwnFNOPCXxeOGmnjrBLWNyBeNtVq2Hs03yus1aPS3mzSyNVSfu588iW1Q93x/4fjcHn+5EkS2tMxr4xIRa8ese+4L9uKZnxEqs8+ldyN9atU02a5t5uQ8hZGms1QTKpaKYqnipiNNOAIeIADC0JNEOYY+jtSgFoOchiAjRGFACpUTRje8bwIYWGCDEgENY8MEu9bnCYCdAxftoNg0KiSpUtPaHcanYwzXRu6T4r40b5npal3V7UHWCPJW9niyl1vIHgoujEXZjudBkeWkOeMQBRmbEPhKzij1i52t6/TadL+3q7H0U1eq4E8cG4gIIwQLx8VX7ToPXgPrehVc5QXHR7gMSmwjKfaYAP4KvZV+yn9bE18y2IY37LvtyrSg3i7ZK++B603ndlg/gBJpZRsfpBI6hyiaQ6FjlnThz8lAC3LgBIMnXDOAXxBQ4SIgiEhx2AcGCAwAhwjXRpCQms42bwAUt75BvAwgONzdgOfWEwzk4Ylzj4mz+5YEzzXzWX9aNlk7ot65y5QnBHsNlm6zDTu7sspRqG4V+fgJ1lVBZ07Nm7s5nemo3Lf3PO7iwtnroQ5/YDGwPRUip6fV6L+27p+wCHwSvPs85UnHqId8NAn5IBsKdv95KrL9m31Gsf2a/rluDslk1y1J9GE+LUmmVT/OyOHaFKGnapt2H5XeJTmKd6qYNoVVZOy+pWzr7rMip3ndG/4mQSoUcMbAqG/YNIAdXhkAqTVruXhocSKN0iS4Rwj7vSS4fcF/La07BfeQSuRAcFeW+9igjwPhhYPpGCBCBHhxiKMyFMFT7ziRH7RtfIWdiha+TdW+Rqs7bLHdN2ZJIKl0um0x3op9saYr0REeRdj09pl43pMzz4tjztrY8L4o8bzT+oLY27PR/eFtXs/YY5vtwB5Iqad14eYN0ujveMaGWqkdU3TKbQSC5Uvxaf4fA7SAQ3r2tEfIhd4duld91bwMisjqBw22orthNcroXl7KqO1329HBgAexgoCfGAwiDPoBnriki3lmNojrzvD0tjo6E3vPYP6E2BMIAeJxjYGRgYADiY8t3FsTz23xl4GbYzIAB/v9nWM6wBcjgYGAC8QH+QQhZAAB4nGNgZGBg2MzAACeXMzAyoAJeADPyAh14nGNgAILNpGEA0fgIZQAAAAAAAAA2AHIAvgE+AZgCCAKMAv4DlgPsBEYEoHicY2BkYGDgZchi4GQAASYg5gJCBob/YD4DABTSAZcAeJx9kU1uwjAQhV/4qwpqhdSqi67cTTeVEmBXDgBbhBD7AHYISuLUMSD2PUdP0HNwjp6i676k3qQS9Ujjb968mYUNoI8zPJTHw02Vy9PAFatfbpLuHbfIT47b6MF33KH+6riLF0wc93CHN27wWtdUHvHuuIFbfDhuUv903CKfHbfxgC/HHerfjrtYen3HPTx7ambiIl0YKQ+xPM5ltE9CU9NqxVKaItaZGPqDmj6VmTShlRuxOoniEI2sVUIZnYqJzqxMEi1yo3dybf2ttfk4CJTT/bVOMYNBjAIpFiTJOLCWOGLOHGGPBCE7l32XO0tmw04MjQwCQ7774B//lDmrZkJY3hvOrHBiLuiJMKJqoVgrejQ3CP5Yubt0JwxNJa96Oypr6j621VSOMQKG+uP36eKmHylcb0MAeJxtwdEOgjAMBdBeWEFR/Mdl7bTJtMsygc/nwVfPoYF+QP+tGDAigDFhxgVXLLjhjhUPCtmKTtmLaGN7x6dy/Io5bybqoevRQ3LRObb0sk3HKpn1SFqW6ru26vbpYfcmRCccJhqsAAA=) format("woff")}.token.treeview-part .entry-name:before{content:"\ea01";font-family:PrismTreeview;font-size:inherit;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:2.5ex;display:inline-block}.token.treeview-part .entry-name.dir:before{content:"\ea02"}.token.treeview-part .entry-name.ext-bmp:before,.token.treeview-part .entry-name.ext-eps:before,.token.treeview-part .entry-name.ext-gif:before,.token.treeview-part .entry-name.ext-jpe:before,.token.treeview-part .entry-name.ext-jpeg:before,.token.treeview-part .entry-name.ext-jpg:before,.token.treeview-part .entry-name.ext-png:before,.token.treeview-part .entry-name.ext-svg:before,.token.treeview-part .entry-name.ext-tiff:before{content:"\ea03"}.token.treeview-part .entry-name.ext-cfg:before,.token.treeview-part .entry-name.ext-conf:before,.token.treeview-part .entry-name.ext-config:before,.token.treeview-part .entry-name.ext-csv:before,.token.treeview-part .entry-name.ext-ini:before,.token.treeview-part .entry-name.ext-log:before,.token.treeview-part .entry-name.ext-md:before,.token.treeview-part .entry-name.ext-nfo:before,.token.treeview-part .entry-name.ext-txt:before{content:"\ea06"}.token.treeview-part .entry-name.ext-asp:before,.token.treeview-part .entry-name.ext-aspx:before,.token.treeview-part .entry-name.ext-c:before,.token.treeview-part .entry-name.ext-cc:before,.token.treeview-part .entry-name.ext-cpp:before,.token.treeview-part .entry-name.ext-cs:before,.token.treeview-part .entry-name.ext-css:before,.token.treeview-part .entry-name.ext-h:before,.token.treeview-part .entry-name.ext-hh:before,.token.treeview-part .entry-name.ext-htm:before,.token.treeview-part .entry-name.ext-html:before,.token.treeview-part .entry-name.ext-jav:before,.token.treeview-part .entry-name.ext-java:before,.token.treeview-part .entry-name.ext-js:before,.token.treeview-part .entry-name.ext-php:before,.token.treeview-part .entry-name.ext-rb:before,.token.treeview-part .entry-name.ext-xml:before{content:"\ea07"}.token.treeview-part .entry-name.ext-7z:before,.token.treeview-part .entry-name.ext-bz2:before,.token.treeview-part .entry-name.ext-bz:before,.token.treeview-part .entry-name.ext-gz:before,.token.treeview-part .entry-name.ext-rar:before,.token.treeview-part .entry-name.ext-tar:before,.token.treeview-part .entry-name.ext-tgz:before,.token.treeview-part .entry-name.ext-zip:before{content:"\ea08"}.token.treeview-part .entry-name.ext-aac:before,.token.treeview-part .entry-name.ext-au:before,.token.treeview-part .entry-name.ext-cda:before,.token.treeview-part .entry-name.ext-flac:before,.token.treeview-part .entry-name.ext-mp3:before,.token.treeview-part .entry-name.ext-oga:before,.token.treeview-part .entry-name.ext-ogg:before,.token.treeview-part .entry-name.ext-wav:before,.token.treeview-part .entry-name.ext-wma:before{content:"\ea04"}.token.treeview-part .entry-name.ext-avi:before,.token.treeview-part .entry-name.ext-flv:before,.token.treeview-part .entry-name.ext-mkv:before,.token.treeview-part .entry-name.ext-mov:before,.token.treeview-part .entry-name.ext-mp4:before,.token.treeview-part .entry-name.ext-mpeg:before,.token.treeview-part .entry-name.ext-mpg:before,.token.treeview-part .entry-name.ext-ogv:before,.token.treeview-part .entry-name.ext-webm:before{content:"\ea05"}.token.treeview-part .entry-name.ext-pdf:before{content:"\ea09"}.token.treeview-part .entry-name.ext-xls:before,.token.treeview-part .entry-name.ext-xlsx:before{content:"\ea0a"}.token.treeview-part .entry-name.ext-doc:before,.token.treeview-part .entry-name.ext-docm:before,.token.treeview-part .entry-name.ext-docx:before{content:"\ea0c"}.token.treeview-part .entry-name.ext-pps:before,.token.treeview-part .entry-name.ext-ppt:before,.token.treeview-part .entry-name.ext-pptx:before{content:"\ea0b"} \ No newline at end of file diff --git a/plugins/treeview/prism-treeview.min.js b/plugins/treeview/prism-treeview.min.js index 8c2283ada1..7c59a60f75 100644 --- a/plugins/treeview/prism-treeview.min.js +++ b/plugins/treeview/prism-treeview.min.js @@ -1 +1 @@ -Prism.languages.treeview={"treeview-part":{pattern:/^.+/m,inside:{"entry-line":[{pattern:/\|-- |├── /,alias:"line-h"},{pattern:/\| |│ /,alias:"line-v"},{pattern:/`-- |└── /,alias:"line-v-last"},{pattern:/ {4}/,alias:"line-v-gap"}],"entry-name":{pattern:/.*\S.*/,inside:{operator:/ -> /}}}}},Prism.hooks.add("wrap",function(e){if("treeview"===e.language&&"entry-name"===e.type){var t=e.classes,n=/(^|[^\\])\/\s*$/;if(n.test(e.content))e.content=e.content.replace(n,"$1"),t.push("dir");else{e.content=e.content.replace(/(^|[^\\])[=*|]\s*$/,"$1");for(var a=e.content.toLowerCase().replace(/\s+/g,"").split(".");1 /}}}}},Prism.hooks.add("wrap",function(e){if("treeview"===e.language&&"entry-name"===e.type){var t=e.classes,n=/(^|[^\\])\/\s*$/;if(n.test(e.content))e.content=e.content.replace(n,"$1"),t.push("dir");else{e.content=e.content.replace(/(^|[^\\])[=*|]\s*$/,"$1");for(var a=e.content.toLowerCase().replace(/\s+/g,"").split(".");1 - + @@ -24,15 +24,23 @@

How to use

This plugin provides several methods of achieving the same thing:

    -
  • Instead of using <pre><code> elements, use <script type="text/plain"> -
    <script type="text/plain" class="language-markup">
    +		
  • + Instead of using <pre><code> elements, use <script type="text/plain">: + +
    <script type="text/plain" class="language-markup">
     <p>Example</p>
     </script>
  • -
  • Use a HTML-comment to escape your code -
    <pre class="language-markup"><code><!--
    +		
  • + Use an HTML-comment to escape your code: + +
    <pre class="language-markup"><code><!--
     <p>Example</p>
    ---></code></pre>
  • +--></code></pre>
    + + This will only work if the code element contains exactly one comment and nothing else (not even spaces). + E.g. <code> <!-- some text --></code> and <code>text<!-- more text --></code> will not work. +
@@ -52,7 +60,7 @@

Examples

- + @@ -156,7 +164,7 @@

FAQ

- + @@ -182,7 +190,7 @@

FAQ

- + diff --git a/plugins/unescaped-markup/prism-unescaped-markup.js b/plugins/unescaped-markup/prism-unescaped-markup.js index 7437090ba9..03dc4b15e1 100644 --- a/plugins/unescaped-markup/prism-unescaped-markup.js +++ b/plugins/unescaped-markup/prism-unescaped-markup.js @@ -1,44 +1,62 @@ (function () { - if (typeof self === 'undefined' || !self.Prism || !self.document) { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { return; } + // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } + + Prism.plugins.UnescapedMarkup = true; Prism.hooks.add('before-highlightall', function (env) { - env.selector += ", [class*='lang-'] script[type='text/plain'], [class*='language-'] script[type='text/plain']" + - ", script[type='text/plain'][class*='lang-'], script[type='text/plain'][class*='language-']"; + env.selector += ', [class*="lang-"] script[type="text/plain"]' + + ', [class*="language-"] script[type="text/plain"]' + + ', script[type="text/plain"][class*="lang-"]' + + ', script[type="text/plain"][class*="language-"]'; }); Prism.hooks.add('before-sanity-check', function (env) { - if ((env.element.matches || env.element.msMatchesSelector).call(env.element, "script[type='text/plain']")) { - var code = document.createElement("code"); - var pre = document.createElement("pre"); - - pre.className = code.className = env.element.className; - - if (env.element.dataset) { - Object.keys(env.element.dataset).forEach(function (key) { - if (Object.prototype.hasOwnProperty.call(env.element.dataset, key)) { - pre.dataset[key] = env.element.dataset[key]; - } - }); - } + /** @type {HTMLElement} */ + var element = env.element; + + if (element.matches('script[type="text/plain"]')) { + // found a + @@ -55,7 +55,7 @@

SVG

- + diff --git a/plugins/wpd/prism-wpd.js b/plugins/wpd/prism-wpd.js index dc147d4f65..6872638e46 100644 --- a/plugins/wpd/prism-wpd.js +++ b/plugins/wpd/prism-wpd.js @@ -1,169 +1,154 @@ -(function(){ - -if ( - typeof self !== 'undefined' && !self.Prism || - typeof global !== 'undefined' && !global.Prism -) { - return; -} - -if (Prism.languages.css) { - // check whether the selector is an advanced pattern before extending it - if (Prism.languages.css.selector.pattern) - { - Prism.languages.css.selector.inside['pseudo-class'] = /:[\w-]+/; - Prism.languages.css.selector.inside['pseudo-element'] = /::[\w-]+/; +(function () { + + if (typeof Prism === 'undefined') { + return; } - else - { - Prism.languages.css.selector = { - pattern: Prism.languages.css.selector, - inside: { - 'pseudo-class': /:[\w-]+/, - 'pseudo-element': /::[\w-]+/ - } - }; + + if (Prism.languages.css) { + // check whether the selector is an advanced pattern before extending it + if (Prism.languages.css.selector.pattern) { + Prism.languages.css.selector.inside['pseudo-class'] = /:[\w-]+/; + Prism.languages.css.selector.inside['pseudo-element'] = /::[\w-]+/; + } else { + Prism.languages.css.selector = { + pattern: Prism.languages.css.selector, + inside: { + 'pseudo-class': /:[\w-]+/, + 'pseudo-element': /::[\w-]+/ + } + }; + } } -} - -if (Prism.languages.markup) { - Prism.languages.markup.tag.inside.tag.inside['tag-id'] = /[\w-]+/; - - var Tags = { - HTML: { - 'a': 1, 'abbr': 1, 'acronym': 1, 'b': 1, 'basefont': 1, 'bdo': 1, 'big': 1, 'blink': 1, 'cite': 1, 'code': 1, 'dfn': 1, 'em': 1, 'kbd': 1, 'i': 1, - 'rp': 1, 'rt': 1, 'ruby': 1, 's': 1, 'samp': 1, 'small': 1, 'spacer': 1, 'strike': 1, 'strong': 1, 'sub': 1, 'sup': 1, 'time': 1, 'tt': 1, 'u': 1, - 'var': 1, 'wbr': 1, 'noframes': 1, 'summary': 1, 'command': 1, 'dt': 1, 'dd': 1, 'figure': 1, 'figcaption': 1, 'center': 1, 'section': 1, 'nav': 1, - 'article': 1, 'aside': 1, 'hgroup': 1, 'header': 1, 'footer': 1, 'address': 1, 'noscript': 1, 'isIndex': 1, 'main': 1, 'mark': 1, 'marquee': 1, - 'meter': 1, 'menu': 1 - }, - SVG: { - 'animateColor': 1, 'animateMotion': 1, 'animateTransform': 1, 'glyph': 1, 'feBlend': 1, 'feColorMatrix': 1, 'feComponentTransfer': 1, - 'feFuncR': 1, 'feFuncG': 1, 'feFuncB': 1, 'feFuncA': 1, 'feComposite': 1, 'feConvolveMatrix': 1, 'feDiffuseLighting': 1, 'feDisplacementMap': 1, - 'feFlood': 1, 'feGaussianBlur': 1, 'feImage': 1, 'feMerge': 1, 'feMergeNode': 1, 'feMorphology': 1, 'feOffset': 1, 'feSpecularLighting': 1, - 'feTile': 1, 'feTurbulence': 1, 'feDistantLight': 1, 'fePointLight': 1, 'feSpotLight': 1, 'linearGradient': 1, 'radialGradient': 1, 'altGlyph': 1, - 'textPath': 1, 'tref': 1, 'altglyph': 1, 'textpath': 1, 'altglyphdef': 1, 'altglyphitem': 1, 'clipPath': 1, 'color-profile': 1, 'cursor': 1, - 'font-face': 1, 'font-face-format': 1, 'font-face-name': 1, 'font-face-src': 1, 'font-face-uri': 1, 'foreignObject': 1, 'glyphRef': 1, - 'hkern': 1, 'vkern': 1 - }, - MathML: {} + + if (Prism.languages.markup) { + Prism.languages.markup.tag.inside.tag.inside['tag-id'] = /[\w-]+/; + + var Tags = { + HTML: { + 'a': 1, 'abbr': 1, 'acronym': 1, 'b': 1, 'basefont': 1, 'bdo': 1, 'big': 1, 'blink': 1, 'cite': 1, 'code': 1, 'dfn': 1, 'em': 1, 'kbd': 1, 'i': 1, + 'rp': 1, 'rt': 1, 'ruby': 1, 's': 1, 'samp': 1, 'small': 1, 'spacer': 1, 'strike': 1, 'strong': 1, 'sub': 1, 'sup': 1, 'time': 1, 'tt': 1, 'u': 1, + 'var': 1, 'wbr': 1, 'noframes': 1, 'summary': 1, 'command': 1, 'dt': 1, 'dd': 1, 'figure': 1, 'figcaption': 1, 'center': 1, 'section': 1, 'nav': 1, + 'article': 1, 'aside': 1, 'hgroup': 1, 'header': 1, 'footer': 1, 'address': 1, 'noscript': 1, 'isIndex': 1, 'main': 1, 'mark': 1, 'marquee': 1, + 'meter': 1, 'menu': 1 + }, + SVG: { + 'animateColor': 1, 'animateMotion': 1, 'animateTransform': 1, 'glyph': 1, 'feBlend': 1, 'feColorMatrix': 1, 'feComponentTransfer': 1, + 'feFuncR': 1, 'feFuncG': 1, 'feFuncB': 1, 'feFuncA': 1, 'feComposite': 1, 'feConvolveMatrix': 1, 'feDiffuseLighting': 1, 'feDisplacementMap': 1, + 'feFlood': 1, 'feGaussianBlur': 1, 'feImage': 1, 'feMerge': 1, 'feMergeNode': 1, 'feMorphology': 1, 'feOffset': 1, 'feSpecularLighting': 1, + 'feTile': 1, 'feTurbulence': 1, 'feDistantLight': 1, 'fePointLight': 1, 'feSpotLight': 1, 'linearGradient': 1, 'radialGradient': 1, 'altGlyph': 1, + 'textPath': 1, 'tref': 1, 'altglyph': 1, 'textpath': 1, 'altglyphdef': 1, 'altglyphitem': 1, 'clipPath': 1, 'color-profile': 1, 'cursor': 1, + 'font-face': 1, 'font-face-format': 1, 'font-face-name': 1, 'font-face-src': 1, 'font-face-uri': 1, 'foreignObject': 1, 'glyphRef': 1, + 'hkern': 1, 'vkern': 1 + }, + MathML: {} + }; } -} -var language; + var language; -Prism.hooks.add('wrap', function(env) { - if ((env.type == 'tag-id' - || (env.type == 'property' && env.content.indexOf('-') != 0) - || (env.type == 'rule'&& env.content.indexOf('@-') != 0) - || (env.type == 'pseudo-class'&& env.content.indexOf(':-') != 0) - || (env.type == 'pseudo-element'&& env.content.indexOf('::-') != 0) - || (env.type == 'attr-name' && env.content.indexOf('data-') != 0) + Prism.hooks.add('wrap', function (env) { + if ((env.type == 'tag-id' + || (env.type == 'property' && env.content.indexOf('-') != 0) + || (env.type == 'rule' && env.content.indexOf('@-') != 0) + || (env.type == 'pseudo-class' && env.content.indexOf(':-') != 0) + || (env.type == 'pseudo-element' && env.content.indexOf('::-') != 0) + || (env.type == 'attr-name' && env.content.indexOf('data-') != 0) ) && env.content.indexOf('<') === -1 - ) { - if (env.language == 'css' - || env.language == 'scss' - || env.language == 'markup' ) { - var href = 'https://webplatform.github.io/docs/'; - var content = env.content; + if (env.language == 'css' + || env.language == 'scss' + || env.language == 'markup' + ) { + var href = 'https://webplatform.github.io/docs/'; + var content = env.content; - if (env.language == 'css' || env.language == 'scss') { - href += 'css/'; + if (env.language == 'css' || env.language == 'scss') { + href += 'css/'; - if (env.type == 'property') { - href += 'properties/'; - } - else if (env.type == 'rule') { - href += 'atrules/'; - content = content.substring(1); - } - else if (env.type == 'pseudo-class') { - href += 'selectors/pseudo-classes/'; - content = content.substring(1); - } - else if (env.type == 'pseudo-element') { - href += 'selectors/pseudo-elements/'; - content = content.substring(2); - } - } - else if (env.language == 'markup') { - if (env.type == 'tag-id') { - // Check language - language = getLanguage(env.content) || language; - - if (language) { - href += language + '/elements/'; - } - else { - return; // Abort - } - } - else if (env.type == 'attr-name') { - if (language) { - href += language + '/attributes/'; + if (env.type == 'property') { + href += 'properties/'; + } else if (env.type == 'rule') { + href += 'atrules/'; + content = content.substring(1); + } else if (env.type == 'pseudo-class') { + href += 'selectors/pseudo-classes/'; + content = content.substring(1); + } else if (env.type == 'pseudo-element') { + href += 'selectors/pseudo-elements/'; + content = content.substring(2); } - else { - return; // Abort + } else if (env.language == 'markup') { + if (env.type == 'tag-id') { + // Check language + language = getLanguage(env.content) || language; + + if (language) { + href += language + '/elements/'; + } else { + return; // Abort + } + } else if (env.type == 'attr-name') { + if (language) { + href += language + '/attributes/'; + } else { + return; // Abort + } } } - } - href += content; - env.tag = 'a'; - env.attributes.href = href; - env.attributes.target = '_blank'; + href += content; + env.tag = 'a'; + env.attributes.href = href; + env.attributes.target = '_blank'; + } } - } -}); + }); -function getLanguage(tag) { - var tagL = tag.toLowerCase(); - - if (Tags.HTML[tagL]) { - return 'html'; - } - else if (Tags.SVG[tag]) { - return 'svg'; - } - else if (Tags.MathML[tag]) { - return 'mathml'; - } - - // Not in dictionary, perform check - if (Tags.HTML[tagL] !== 0 && typeof document !== 'undefined') { - var htmlInterface = (document.createElement(tag).toString().match(/\[object HTML(.+)Element\]/) || [])[1]; - - if (htmlInterface && htmlInterface != 'Unknown') { - Tags.HTML[tagL] = 1; + function getLanguage(tag) { + var tagL = tag.toLowerCase(); + + if (Tags.HTML[tagL]) { return 'html'; - } - } - - Tags.HTML[tagL] = 0; - - if (Tags.SVG[tag] !== 0 && typeof document !== 'undefined') { - var svgInterface = (document.createElementNS('http://www.w3.org/2000/svg', tag).toString().match(/\[object SVG(.+)Element\]/) || [])[1]; - - if (svgInterface && svgInterface != 'Unknown') { - Tags.SVG[tag] = 1; + } else if (Tags.SVG[tag]) { return 'svg'; - } - } - - Tags.SVG[tag] = 0; - - // Lame way to detect MathML, but browsers don’t expose interface names there :( - if (Tags.MathML[tag] !== 0) { - if (tag.indexOf('m') === 0) { - Tags.MathML[tag] = 1; + } else if (Tags.MathML[tag]) { return 'mathml'; } + + // Not in dictionary, perform check + if (Tags.HTML[tagL] !== 0 && typeof document !== 'undefined') { + var htmlInterface = (document.createElement(tag).toString().match(/\[object HTML(.+)Element\]/) || [])[1]; + + if (htmlInterface && htmlInterface != 'Unknown') { + Tags.HTML[tagL] = 1; + return 'html'; + } + } + + Tags.HTML[tagL] = 0; + + if (Tags.SVG[tag] !== 0 && typeof document !== 'undefined') { + var svgInterface = (document.createElementNS('http://www.w3.org/2000/svg', tag).toString().match(/\[object SVG(.+)Element\]/) || [])[1]; + + if (svgInterface && svgInterface != 'Unknown') { + Tags.SVG[tag] = 1; + return 'svg'; + } + } + + Tags.SVG[tag] = 0; + + // Lame way to detect MathML, but browsers don’t expose interface names there :( + if (Tags.MathML[tag] !== 0) { + if (tag.indexOf('m') === 0) { + Tags.MathML[tag] = 1; + return 'mathml'; + } + } + + Tags.MathML[tag] = 0; + + return null; } - - Tags.MathML[tag] = 0; - - return null; -} -})(); \ No newline at end of file +}()); diff --git a/plugins/wpd/prism-wpd.min.css b/plugins/wpd/prism-wpd.min.css new file mode 100644 index 0000000000..43b0cf6112 --- /dev/null +++ b/plugins/wpd/prism-wpd.min.css @@ -0,0 +1 @@ +code[class*=language-] a[href],pre[class*=language-] a[href]{cursor:help;text-decoration:none}code[class*=language-] a[href]:hover,pre[class*=language-] a[href]:hover{cursor:help;text-decoration:underline} \ No newline at end of file diff --git a/plugins/wpd/prism-wpd.min.js b/plugins/wpd/prism-wpd.min.js index 878572db19..4d2f395544 100644 --- a/plugins/wpd/prism-wpd.min.js +++ b/plugins/wpd/prism-wpd.min.js @@ -1 +1 @@ -!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){if(Prism.languages.css&&(Prism.languages.css.selector.pattern?(Prism.languages.css.selector.inside["pseudo-class"]=/:[\w-]+/,Prism.languages.css.selector.inside["pseudo-element"]=/::[\w-]+/):Prism.languages.css.selector={pattern:Prism.languages.css.selector,inside:{"pseudo-class":/:[\w-]+/,"pseudo-element":/::[\w-]+/}}),Prism.languages.markup){Prism.languages.markup.tag.inside.tag.inside["tag-id"]=/[\w-]+/;var s={HTML:{a:1,abbr:1,acronym:1,b:1,basefont:1,bdo:1,big:1,blink:1,cite:1,code:1,dfn:1,em:1,kbd:1,i:1,rp:1,rt:1,ruby:1,s:1,samp:1,small:1,spacer:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,var:1,wbr:1,noframes:1,summary:1,command:1,dt:1,dd:1,figure:1,figcaption:1,center:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,address:1,noscript:1,isIndex:1,main:1,mark:1,marquee:1,meter:1,menu:1},SVG:{animateColor:1,animateMotion:1,animateTransform:1,glyph:1,feBlend:1,feColorMatrix:1,feComponentTransfer:1,feFuncR:1,feFuncG:1,feFuncB:1,feFuncA:1,feComposite:1,feConvolveMatrix:1,feDiffuseLighting:1,feDisplacementMap:1,feFlood:1,feGaussianBlur:1,feImage:1,feMerge:1,feMergeNode:1,feMorphology:1,feOffset:1,feSpecularLighting:1,feTile:1,feTurbulence:1,feDistantLight:1,fePointLight:1,feSpotLight:1,linearGradient:1,radialGradient:1,altGlyph:1,textPath:1,tref:1,altglyph:1,textpath:1,altglyphdef:1,altglyphitem:1,clipPath:1,"color-profile":1,cursor:1,"font-face":1,"font-face-format":1,"font-face-name":1,"font-face-src":1,"font-face-uri":1,foreignObject:1,glyphRef:1,hkern:1,vkern:1},MathML:{}}}var a;Prism.hooks.add("wrap",function(e){if(("tag-id"==e.type||"property"==e.type&&0!=e.content.indexOf("-")||"rule"==e.type&&0!=e.content.indexOf("@-")||"pseudo-class"==e.type&&0!=e.content.indexOf(":-")||"pseudo-element"==e.type&&0!=e.content.indexOf("::-")||"attr-name"==e.type&&0!=e.content.indexOf("data-"))&&-1===e.content.indexOf("<")&&("css"==e.language||"scss"==e.language||"markup"==e.language)){var t="https://webplatform.github.io/docs/",n=e.content;if("css"==e.language||"scss"==e.language)t+="css/","property"==e.type?t+="properties/":"rule"==e.type?(t+="atrules/",n=n.substring(1)):"pseudo-class"==e.type?(t+="selectors/pseudo-classes/",n=n.substring(1)):"pseudo-element"==e.type&&(t+="selectors/pseudo-elements/",n=n.substring(2));else if("markup"==e.language)if("tag-id"==e.type){if(!(a=function(e){var t=e.toLowerCase();{if(s.HTML[t])return"html";if(s.SVG[e])return"svg";if(s.MathML[e])return"mathml"}if(0!==s.HTML[t]&&"undefined"!=typeof document){var n=(document.createElement(e).toString().match(/\[object HTML(.+)Element\]/)||[])[1];if(n&&"Unknown"!=n)return s.HTML[t]=1,"html"}if((s.HTML[t]=0)!==s.SVG[e]&&"undefined"!=typeof document){var a=(document.createElementNS("http://www.w3.org/2000/svg",e).toString().match(/\[object SVG(.+)Element\]/)||[])[1];if(a&&"Unknown"!=a)return s.SVG[e]=1,"svg"}if((s.SVG[e]=0)!==s.MathML[e]&&0===e.indexOf("m"))return s.MathML[e]=1,"mathml";return s.MathML[e]=0,null}(e.content)||a))return;t+=a+"/elements/"}else if("attr-name"==e.type){if(!a)return;t+=a+"/attributes/"}t+=n,e.tag="a",e.attributes.href=t,e.attributes.target="_blank"}})}}(); \ No newline at end of file +!function(){if("undefined"!=typeof Prism){if(Prism.languages.css&&(Prism.languages.css.selector.pattern?(Prism.languages.css.selector.inside["pseudo-class"]=/:[\w-]+/,Prism.languages.css.selector.inside["pseudo-element"]=/::[\w-]+/):Prism.languages.css.selector={pattern:Prism.languages.css.selector,inside:{"pseudo-class":/:[\w-]+/,"pseudo-element":/::[\w-]+/}}),Prism.languages.markup){Prism.languages.markup.tag.inside.tag.inside["tag-id"]=/[\w-]+/;var s={HTML:{a:1,abbr:1,acronym:1,b:1,basefont:1,bdo:1,big:1,blink:1,cite:1,code:1,dfn:1,em:1,kbd:1,i:1,rp:1,rt:1,ruby:1,s:1,samp:1,small:1,spacer:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,var:1,wbr:1,noframes:1,summary:1,command:1,dt:1,dd:1,figure:1,figcaption:1,center:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,address:1,noscript:1,isIndex:1,main:1,mark:1,marquee:1,meter:1,menu:1},SVG:{animateColor:1,animateMotion:1,animateTransform:1,glyph:1,feBlend:1,feColorMatrix:1,feComponentTransfer:1,feFuncR:1,feFuncG:1,feFuncB:1,feFuncA:1,feComposite:1,feConvolveMatrix:1,feDiffuseLighting:1,feDisplacementMap:1,feFlood:1,feGaussianBlur:1,feImage:1,feMerge:1,feMergeNode:1,feMorphology:1,feOffset:1,feSpecularLighting:1,feTile:1,feTurbulence:1,feDistantLight:1,fePointLight:1,feSpotLight:1,linearGradient:1,radialGradient:1,altGlyph:1,textPath:1,tref:1,altglyph:1,textpath:1,altglyphdef:1,altglyphitem:1,clipPath:1,"color-profile":1,cursor:1,"font-face":1,"font-face-format":1,"font-face-name":1,"font-face-src":1,"font-face-uri":1,foreignObject:1,glyphRef:1,hkern:1,vkern:1},MathML:{}}}var a;Prism.hooks.add("wrap",function(e){if(("tag-id"==e.type||"property"==e.type&&0!=e.content.indexOf("-")||"rule"==e.type&&0!=e.content.indexOf("@-")||"pseudo-class"==e.type&&0!=e.content.indexOf(":-")||"pseudo-element"==e.type&&0!=e.content.indexOf("::-")||"attr-name"==e.type&&0!=e.content.indexOf("data-"))&&-1===e.content.indexOf("<")&&("css"==e.language||"scss"==e.language||"markup"==e.language)){var t="https://webplatform.github.io/docs/",n=e.content;if("css"==e.language||"scss"==e.language)t+="css/","property"==e.type?t+="properties/":"rule"==e.type?(t+="atrules/",n=n.substring(1)):"pseudo-class"==e.type?(t+="selectors/pseudo-classes/",n=n.substring(1)):"pseudo-element"==e.type&&(t+="selectors/pseudo-elements/",n=n.substring(2));else if("markup"==e.language)if("tag-id"==e.type){if(!(a=function(e){var t=e.toLowerCase();{if(s.HTML[t])return"html";if(s.SVG[e])return"svg";if(s.MathML[e])return"mathml"}if(0!==s.HTML[t]&&"undefined"!=typeof document){var n=(document.createElement(e).toString().match(/\[object HTML(.+)Element\]/)||[])[1];if(n&&"Unknown"!=n)return s.HTML[t]=1,"html"}if((s.HTML[t]=0)!==s.SVG[e]&&"undefined"!=typeof document){var a=(document.createElementNS("http://www.w3.org/2000/svg",e).toString().match(/\[object SVG(.+)Element\]/)||[])[1];if(a&&"Unknown"!=a)return s.SVG[e]=1,"svg"}if((s.SVG[e]=0)!==s.MathML[e]&&0===e.indexOf("m"))return s.MathML[e]=1,"mathml";return s.MathML[e]=0,null}(e.content)||a))return;t+=a+"/elements/"}else if("attr-name"==e.type){if(!a)return;t+=a+"/attributes/"}t+=n,e.tag="a",e.attributes.href=t,e.attributes.target="_blank"}})}}(); \ No newline at end of file diff --git a/prism.js b/prism.js index 4eebe7d9ce..04e9a28e61 100644 --- a/prism.js +++ b/prism.js @@ -9,8 +9,8 @@ var _self = (typeof window !== 'undefined') ? window // if in browser : ( (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) - ? self // if in worker - : {} // if in node js + ? self // if in worker + : {} // if in node js ); /** @@ -21,1111 +21,1193 @@ var _self = (typeof window !== 'undefined') * @namespace * @public */ -var Prism = (function (_self){ +var Prism = (function (_self) { -// Private helper vars -var lang = /\blang(?:uage)?-([\w-]+)\b/i; -var uniqueId = 0; + // Private helper vars + var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i; + var uniqueId = 0; + // The grammar object for plaintext + var plainTextGrammar = {}; -var _ = { - /** - * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the - * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load - * additional languages or plugins yourself. - * - * By setting this value to `true`, Prism will not automatically highlight all code elements on the page. - * - * You obviously have to change this value before the automatic highlighting started. To do this, you can add an - * empty Prism object into the global scope before loading the Prism script like this: - * - * ```js - * window.Prism = window.Prism || {}; - * Prism.manual = true; - * // add a new + @@ -50,7 +50,7 @@

Writing tests

Language directories

All tests are sorted into directories in the tests/languages directory. Each directory name encodes, which language you are currently testing.

-

All language names must match the names from the definition in components.js.

+

All language names must match the names from the definition in components.json.

Example 1: testing a language in isolation (default use case)

Just put your test file into the directory of the language you want to test.

@@ -85,19 +85,20 @@

Creating your test case file

Writing your test

-

The structure of a test case file is as follows:

-

-... language snippet...
-----
-... the simplified token stream you expect ...
-

Your file is built up of two or three sections, separated by ten or more dashes -, starting at the begin of the line:

+

A test case file is built up of two or three sections separated by ten or more dashes - starting at the begin of the line. The sections are the following:

+
    -
  1. Your language snippet. The code you want to compile using Prism. (required)
  2. -
  3. The simplified token stream you expect. Needs to be valid JSON. (required)
  4. -
  5. A comment explaining the test case. (optional)
  6. +
  7. Your language snippet. The code you want to tokenize using Prism. (required)
  8. +
  9. + The simplified token stream you expect. Needs to be valid JSON. (optional)
    + The test runner will automatically insert this if not present. Carefully check that the inserted token stream is what you expected.
    + If the test case fails because the JSON is present but incorrect, then you can use the --update flag to overwrite it. +
  10. +
  11. A brief comment explaining the test case. (optional)
-

The easiest way would be to look at an existing test file:

+ +

Here is an example:

var a = 5;
 
 ----------------------------------------------------
@@ -114,10 +115,40 @@ 

Writing your test

This is a comment explaining this test case.
+

The easy way to write tests

+

The easy way to create one or multiple new test case(s) is this:

+ +
    +
  1. Create a new test case file tests/languages/{language}/{test-case}.test.
  2. +
  3. Insert the code you want to test (and nothing more).
  4. +
  5. Repeat the first two steps for as many test cases as you want.
  6. +
  7. Run npm run test:languages.
  8. +
  9. Done.
  10. +
+ +

Updating existing test case files is easy too!

+ +
    +
  1. Run npm run test:languages -- --update.
  2. +
  3. Done.
  4. +
+ +

This works by making the test runner insert the actual token stream of you test code as the expected token stream. Carefully check that the inserted token stream is actually what you expect or else the test is meaningless!

+ + +

Updating tests

+ +

When creating and changing languages, their test files have to be updated to properly test the language. The rather tedious task of updating test files can be automated using the following command:

+ +
npm run test:languages -- --update
+ +

Updates (overwrites) the expected token stream of all failing test files. The language tests are guaranteed to pass after running this command.

+ +

Keep in mind: This command makes it easy to create/update test files but this doesn't mean that the tests will be correct. Always carefully check the inserted/updated token streams!

Explaining the simplified token stream

-

While compiling, Prism transforms your source code into a token stream. This is basically a tree of nested tokens (or arrays, or strings).

+

While highlighting, Prism transforms your source code into a token stream. This is basically a tree of nested tokens (or arrays, or strings).

As these trees are hard to write by hand, the test runner uses a simplified version of it.

It uses the following rules:

    @@ -126,7 +157,7 @@

    Explaining the sim
  • All empty structures are removed.
-

Note: The pretty-printed simplified token stream is indented using 4 spaces. You have to convert these to tabs after you copy-pasted the JSON. (Most editors today have an option that handles the conversion for you.)

+

The simplified token stream does not contain the aliases of a token.

For further information: reading the tests of the test runner (tests/testrunner-tests.js) will help you understand the transformation.

@@ -134,14 +165,21 @@

Explaining the sim

Writing specific tests

-

Sometimes, using the token stream tests is not powerful enough. By creating a test file with the file extension .js instead of .test, you can make Prism highlight arbitrary pieces of code and check their HTML results.

+

Sometimes, using the token stream tests is not powerful enough. By creating a test file with the file extension .html.test instead of .test, you can make Prism highlight arbitrary pieces of code and check their HTML results.

The language is determined by the folder containing the test file lies, as explained in the previous section.

The structure of your test file will look like this, for example:

-
module.exports = {
-	'&#x278a;': '<span class="token entity" title="&#x278a;">&amp;#x278a;</span>',
-	'&#182;': '<span class="token entity" title="&#182;">&amp;#182;</span>',
-};
-

The keys are the codes which will be highlighted by Prism. The values are the expected results, as HTML.

+
&amp;
+&#x41;
+
+----------------------------------------------------
+
+<span class="token entity named-entity" title="&amp;">&amp;amp;</span>
+<span class="token entity" title="&#x41;">&amp;#x41;</span>
+
+----------------------------------------------------
+
+This is a comment explaining this test case.
+
@@ -164,7 +202,7 @@

Internal structure

- + diff --git a/test.html b/test.html index 55caccfcd7..dff0a8533b 100644 --- a/test.html +++ b/test.html @@ -8,10 +8,6 @@ - + @@ -115,9 +149,16 @@

Test drive

Result:

-

+

-

+ +

Language:

@@ -126,8 +167,12 @@

Test drive

- + + + @@ -151,18 +196,41 @@

Test drive

code = newCode; }; - +function getHashParams() { + return parseUrlParams((location.hash || '').substr(1)); +} +function setHashParams(params) { + location.hash = stringifyUrlParams(params); +} function updateHashLanguage(lang) { - location.hash = lang ? 'language=' + lang : ''; + var params = getHashParams(); + params.language = lang; + setHashParams(params); } function getHashLanguage() { - var match = /[#&]language=([^&]+)/.exec(location.hash); - return match ? match[1] : null; + return getHashParams().language; } function getRadio(lang) { return $('input[name=language][value="' + lang + '"]'); } +function copyShare() { + const link = $('#share-link').href; + try { + navigator.clipboard.writeText(link).then(function () { + $('#copy-share-link').textContent = 'Copied!'; + }, function () { + $('#copy-share-link').textContent = 'Failed to copy!'; + }); + } catch (e) { + $('#copy-share-link').textContent = 'Failed to copy!'; + } + setTimeout(function () { + $('#copy-share-link').textContent = 'Copy to clipboard'; + }, 5000); +} +window.copyShare = copyShare; + window.onhashchange = function () { var input = getRadio(getHashLanguage()); @@ -196,11 +264,9 @@

Test drive

code.className = 'language-' + lang; code.textContent = code.textContent; updateHashLanguage(lang); + updateShareLink(); - // loadLanguage() returns a promise, so we use highlightCode() - // as resolve callback. The promise will be immediately - // resolved if there is nothing to load. - loadLanguage(lang).then(highlightCode); + highlightCode(); } } }, name @@ -210,59 +276,6 @@

Test drive

} -/** - * Loads a language, including all dependencies - * - * @param {string} lang the language to load - * @type {Promise} the promise which resolves as soon as everything is loaded - */ -function loadLanguage (lang) -{ - // at first we need to fetch all dependencies for the main language - // Note: we need to do this, even if the main language already is loaded (just to be sure..) - // - // We load an array of all dependencies and call recursively this function on each entry - // - // dependencies is now an (possibly empty) array of loading-promises - var dependencies = getDependenciesOfLanguage(lang).map(loadLanguage); - - // We create a promise, which will resolve, as soon as all dependencies are loaded. - // They need to be fully loaded because the main language may extend them. - return Promise.all(dependencies) - .then(function () { - - // If the main language itself isn't already loaded, load it now - // and return the newly created promise (we chain the promises). - // If the language is already loaded, just do nothing - the next .then() - // will immediately be called - if (!Prism.languages[lang]) { - return new Promise(function (resolve) { - $u.script('components/prism-' + lang + '.js', resolve); - }); - } - }); -} - - -/** - * Returns all dependencies (as identifiers) of a specific language - * - * @param {string} lang - * @returns {Array.} the list of dependencies. Empty if the language has none. - */ -function getDependenciesOfLanguage (lang) -{ - if (!components.languages[lang] || !components.languages[lang].require) - { - return []; - } - - return ($u.type(components.languages[lang].require) === "array") - ? components.languages[lang].require - : [components.languages[lang].require]; -} - - var radios = $$('input[name=language]'); var selectedRadio = radios[0]; @@ -277,9 +290,14 @@

Test drive

var textarea = $('textarea', form); try { - var lastCode = sessionStorage.getItem('test-code'); - if (lastCode) { - textarea.value = lastCode; + var hashText = getHashParams().text; + if (hashText) { + textarea.value = hashText; + } else { + var lastCode = sessionStorage.getItem('test-code'); + if (lastCode) { + textarea.value = lastCode; + } } } catch (e) { // ignore sessionStorage errors @@ -290,6 +308,8 @@

Test drive

code.textContent = codeText; highlightCode(); + updateShareLink(); + try { sessionStorage.setItem('test-code', codeText); } catch (error) { @@ -308,8 +328,57 @@

Test drive

}; $('#option-show-tokens').onchange(); -})(); +function updateShareLink() { + var params = { + language: /\blang(?:uage)?-([\w-]+)\b/i.exec(code.className)[1], + text: code.textContent, + }; + $('#share-link').href = '#' + stringifyUrlParams(params); + $('#share-link-input').value = $('#share-link').href; +} + + +/** + * @param {Record} params + * @returns {string} + */ +function stringifyUrlParams(params) { + var parts = []; + for (var name in params) { + if (params.hasOwnProperty(name)) { + var value = params[name]; + if (typeof value === 'boolean') { + if (value) { + parts.push(name); + } + } else { + parts.push(name + '=' + encodeURIComponent(value)); + } + } + } + return parts.join('&'); +} +/** + * @param {string} str + * @returns {Record} + */ +function parseUrlParams(str) { + /** @type {Record} */ + var params = {}; + str.split(/&/g).filter(Boolean).forEach(function (part) { + var parts = part.split(/=/); + var name = parts[0]; + if (parts.length === 1) { + params[name] = true; + } else { + params[name] = decodeURIComponent(parts[1]); + } + }); + return params; +} + +})(); diff --git a/tests/aliases-test.js b/tests/aliases-test.js index 2b562f7f75..892cb5005a 100644 --- a/tests/aliases-test.js +++ b/tests/aliases-test.js @@ -1,6 +1,6 @@ -"use strict"; +'use strict'; -const { assert } = require("chai"); +const { assert } = require('chai'); const PrismLoader = require('./helper/prism-loader'); const { languages } = require('./../components.json'); @@ -27,7 +27,7 @@ for (const lang in languages) { if (languages[lang].aliasTitles) { it('- should have all alias titles registered as alias', function () { - var aliases = new Set(toArray(languages[lang].alias)); + let aliases = new Set(toArray(languages[lang].alias)); Object.keys(languages[lang].aliasTitles).forEach(id => { if (!aliases.has(id)) { @@ -40,7 +40,7 @@ for (const lang in languages) { it('- should known all aliases', function () { - var loadedLanguages = new Set(Object.keys(PrismLoader.createInstance(lang).languages)); + let loadedLanguages = new Set(Object.keys(PrismLoader.createInstance(lang).languages)); // check that all aliases are defined toArray(languages[lang].alias).forEach(alias => { diff --git a/tests/core/greedy.js b/tests/core/greedy.js index 812828cbff..8d2b81b80e 100644 --- a/tests/core/greedy.js +++ b/tests/core/greedy.js @@ -1,15 +1,16 @@ -"use strict"; +'use strict'; const { assert } = require('chai'); const PrismLoader = require('../helper/prism-loader'); const TestCase = require('../helper/test-case'); +const TokenStreamTransformer = require('../helper/token-stream-transformer'); function testTokens({ grammar, code, expected }) { const Prism = PrismLoader.createEmptyPrism(); Prism.languages.test = grammar; - const simpleTokens = TestCase.simpleTokenize(Prism, code, 'test'); + const simpleTokens = TokenStreamTransformer.simplify(TestCase.tokenize(Prism, code, 'test')); assert.deepStrictEqual(simpleTokens, expected); } @@ -29,8 +30,8 @@ describe('Greedy matching', function () { }, code: '// /*\n/* comment */', expected: [ - ["comment", "// /*"], - ["comment", "/* comment */"] + ['comment', '// /*'], + ['comment', '/* comment */'] ] }); }); @@ -48,9 +49,9 @@ describe('Greedy matching', function () { }, code: 'foo "bar" \'baz\'', expected: [ - ["b", "foo"], - ["b", "\"bar\""], - ["a", "'baz'"] + ['b', 'foo'], + ['b', '"bar"'], + ['a', "'baz'"] ] }); }); @@ -72,15 +73,50 @@ describe('Greedy matching', function () { }, code: `<'> '' ''\n<"> "" ""`, expected: [ - ["c", "<'>"], + ['c', "<'>"], " '", - ["a", "' '"], + ['a', "' '"], "'\n", - ["c", "<\">"], - ["b", "\"\""], - ["b", "\"\""], + ['c', '<">'], + ['b', '""'], + ['b', '""'], ] }); }); + + it('should always match tokens against the whole text', function () { + // this is to test for a bug where greedy tokens where matched like non-greedy ones if the token stream ended on + // a string + testTokens({ + grammar: { + 'a': /a/, + 'b': { + pattern: /^b/, + greedy: true + } + }, + code: 'bab', + expected: [ + ['b', 'b'], + ['a', 'a'], + 'b' + ] + }); + }); + + it('issue3052', function () { + // If a greedy pattern creates an empty token at the end of the string, then this token should be discarded + testTokens({ + grammar: { + 'oh-no': { + pattern: /$/, + greedy: true + } + }, + code: 'foo', + expected: ['foo'] + }); + }); + }); diff --git a/tests/coverage.js b/tests/coverage.js new file mode 100644 index 0000000000..cd7175789f --- /dev/null +++ b/tests/coverage.js @@ -0,0 +1,260 @@ +'use strict'; + +const TestDiscovery = require('./helper/test-discovery'); +const TestCase = require('./helper/test-case'); +const PrismLoader = require('./helper/prism-loader'); +const { BFS, BFSPathToPrismTokenPath } = require('./helper/util'); +const { assert } = require('chai'); +const components = require('../components.json'); +const ALL_LANGUAGES = [...Object.keys(components.languages).filter(k => k !== 'meta')]; + + +describe('Pattern test coverage', function () { + /** + * @type {Map} + * @typedef PatternData + * @property {RegExp} pattern + * @property {string} language + * @property {Set} from + * @property {RegExpExecArray[]} matches + */ + const patterns = new Map(); + + /** + * @param {string | string[]} languages + * @returns {import("./helper/prism-loader").Prism} + */ + function createInstance(languages) { + const Prism = PrismLoader.createInstance(languages); + + BFS(Prism.languages, (path, object) => { + const { key, value } = path[path.length - 1]; + const tokenPath = BFSPathToPrismTokenPath(path); + + if (Object.prototype.toString.call(value) == '[object RegExp]') { + const regex = makeGlobal(value); + object[key] = regex; + + const patternKey = String(regex); + let data = patterns.get(patternKey); + if (!data) { + data = { + pattern: regex, + language: path[1].key, + from: new Set([tokenPath]), + matches: [] + }; + patterns.set(patternKey, data); + } else { + data.from.add(tokenPath); + } + + regex.exec = string => { + let match = RegExp.prototype.exec.call(regex, string); + if (match) { + data.matches.push(match); + } + return match; + }; + } + }); + + return Prism; + } + + describe('Register all patterns', function () { + it('all', function () { + this.slow(10 * 1000); + // This will cause ALL regexes of Prism to be registered in the patterns map. + // (Languages that don't have any tests can't be caught otherwise.) + createInstance(ALL_LANGUAGES); + }); + }); + + describe('Run all language tests', function () { + // define tests for all tests in all languages in the test suite + for (const [languageIdentifier, files] of TestDiscovery.loadAllTests()) { + it(languageIdentifier, function () { + this.timeout(10 * 1000); + + for (const filePath of files) { + try { + TestCase.run({ + languageIdentifier, + filePath, + updateMode: 'none', + createInstance + }); + } catch (error) { + // we don't case about whether the test succeeds, + // we just want to gather usage data + } + } + }); + } + }); + + describe('Coverage', function () { + for (const language of ALL_LANGUAGES) { + describe(language, function () { + it(`- should cover all patterns`, function () { + const untested = getAllOf(language).filter(d => d.matches.length === 0); + if (untested.length === 0) { + return; + } + + const problems = untested.map(data => { + return formatProblem(data, [ + 'This pattern is completely untested. Add test files that match this pattern.' + ]); + }); + + assert.fail([ + `${problems.length} pattern(s) are untested:\n` + + 'You can learn more about writing tests at https://prismjs.com/test-suite.html#writing-tests', + ...problems + ].join('\n\n')); + }); + + it(`- should exhaustively cover all keywords in keyword lists`, function () { + const problems = []; + + for (const data of getAllOf(language)) { + if (data.matches.length === 0) { + // don't report the same pattern twice + continue; + } + + const keywords = getKeywordList(data.pattern); + if (!keywords) { + continue; + } + const keywordCount = keywords.size; + + data.matches.forEach(([m]) => { + if (data.pattern.ignoreCase) { + m = m.toUpperCase(); + } + keywords.delete(m); + }); + + if (keywords.size > 0) { + problems.push(formatProblem(data, [ + `Add test files to test all keywords. The following keywords (${keywords.size}/${keywordCount}) are untested:`, + ...[...keywords].map(k => ` ${k}`) + ])); + } + } + + if (problems.length === 0) { + return; + } + + assert.fail([ + `${problems.length} keyword list(s) are not exhaustively tested:\n` + + 'You can learn more about writing tests at https://prismjs.com/test-suite.html#writing-tests', + ...problems + ].join('\n\n')); + }); + }); + } + }); + + /** + * @param {string} language + * @returns {PatternData[]} + */ + function getAllOf(language) { + return [...patterns.values()].filter(d => d.language === language); + } + + /** + * @param {string} string + * @param {number} maxLength + * @returns {string} + */ + function short(string, maxLength) { + if (string.length > maxLength) { + return string.slice(0, maxLength - 1) + '…'; + } else { + return string; + } + } + + /** + * If the given pattern string describes a keyword list, all keyword will be returned. Otherwise, `null` will be + * returned. + * + * @param {RegExp} pattern + * @returns {Set | null} + */ + function getKeywordList(pattern) { + // Right now, only keyword lists of the form /\b(?:foo|bar)\b/ are supported. + // In the future, we might want to convert these regexes to NFAs and iterate all words to cover more complex + // keyword lists and even operator and punctuation lists. + + let source = pattern.source.replace(/^\\b|\\b$/g, ''); + if (source.startsWith('(?:') && source.endsWith(')')) { + source = source.slice('(?:'.length, source.length - ')'.length); + } + + if (/^\w+(?:\|\w+)*$/.test(source)) { + if (pattern.ignoreCase) { + source = source.toUpperCase(); + } + return new Set(source.split(/\|/g)); + } else { + return null; + } + } + + /** + * @param {Iterable} occurrences + * @returns {{ origin: string; otherOccurrences: string[] }} + */ + function splitOccurrences(occurrences) { + const all = [...occurrences]; + return { + origin: all[0], + otherOccurrences: all.slice(1), + }; + } + + /** + * @param {PatternData} data + * @param {string[]} messageLines + * @returns {string} + */ + function formatProblem(data, messageLines) { + const { origin, otherOccurrences } = splitOccurrences(data.from); + + const lines = [ + `${origin}:`, + short(String(data.pattern), 100), + '', + ...messageLines, + ]; + + if (otherOccurrences.length) { + lines.push( + '', + 'Other occurrences of this pattern:', + ...otherOccurrences.map(o => `- ${o}`) + ); + } + + return lines.join('\n '); + } +}); + +/** + * @param {RegExp} regex + * @returns {RegExp} + */ +function makeGlobal(regex) { + if (regex.global) { + return regex; + } else { + return RegExp(regex.source, regex.flags + 'g'); + } +} diff --git a/tests/dependencies-test.js b/tests/dependencies-test.js index 5c525db3b5..ebacf5bf7f 100644 --- a/tests/dependencies-test.js +++ b/tests/dependencies-test.js @@ -246,22 +246,25 @@ describe('Dependency logic', function () { describe('components.json', function () { - it('- should be valid', function () { - try { - const allIds = []; - for (const category in components) { - Object.keys(components[category]).forEach(id => allIds.push(id)); - } - // and an alias, so we force the lazy alias resolver to check all aliases - allIds.push('js'); - - getLoader(components, allIds).getIds(); - } catch (error) { - assert.fail(error.toString()); + /** + * @param {T | T[] | undefined | null} value + * @returns {T[]} + * @template T + */ + function toArray(value) { + if (Array.isArray(value)) { + return value; + } else if (value == undefined) { + return []; + } else { + return [value]; } - }); + } - it('- should not have redundant optional dependencies', function () { + /** + * @param {(entry: import("../dependencies").ComponentEntry, id: string, entries: Object) => void} consumeFn + */ + function forEachEntry(consumeFn) { /** @type {Object} */ const entries = {}; @@ -274,31 +277,56 @@ describe('components.json', function () { } } - function toArray(value) { - if (Array.isArray(value)) { - return value; - } else if (value == undefined) { - return []; - } else { - return [value]; + for (const id in entries) { + consumeFn(entries[id], id, entries); + } + } + + const entryProperties = [ + 'title', + 'description', + 'alias', + 'aliasTitles', + 'owner', + + 'require', + 'optional', + 'modify', + + 'noCSS', + 'option' + ]; + + it('- should be valid', function () { + try { + const allIds = []; + for (const category in components) { + Object.keys(components[category]).forEach(id => allIds.push(id)); } + // and an alias, so we force the lazy alias resolver to check all aliases + allIds.push('js'); + + getLoader(components, allIds).getIds(); + } catch (error) { + assert.fail(error.toString()); } + }); - for (const id in entries) { - const entry = entries[id]; + it('- should not have redundant optional dependencies', function () { + forEachEntry((entry, id) => { const optional = new Set(toArray(entry.optional)); for (const modifyId of toArray(entry.modify)) { if (optional.has(modifyId)) { - assert.fail(`The component "${id}" has declared "${modifyId}" as both optional and modify.`) + assert.fail(`The component "${id}" has declared "${modifyId}" as both optional and modify.`); } } for (const requireId of toArray(entry.require)) { if (optional.has(requireId)) { - assert.fail(`The component "${id}" has declared "${requireId}" as both optional and require.`) + assert.fail(`The component "${id}" has declared "${requireId}" as both optional and require.`); } } - } + }); }); it('- should have a sorted language list', function () { @@ -327,10 +355,74 @@ describe('components.json', function () { return comp; } // a and b have the same intermediate form (e.g. "C" => "C", "C++" => "C", "C#" => "C"). - a.title.toLowerCase().localeCompare(b.title.toLowerCase()) + return a.title.toLowerCase().localeCompare(b.title.toLowerCase()); }); assert.sameOrderedMembers(languages, sorted); }); + it('- should not have single-element or empty arrays', function () { + /** @type {keyof import("../dependencies").ComponentEntry} */ + const properties = ['alias', 'optional', 'require', 'modify']; + + forEachEntry((entry, id) => { + for (const prop of properties) { + const value = entry[prop]; + if (Array.isArray(value)) { + if (value.length === 0) { + assert.fail( + `The component "${id}" defines an empty array for "${prop}".` + + ` Please remove the "${prop}" property.` + ); + } else if (value.length === 1) { + assert.fail( + `The component "${id}" defines a single-empty array for "${prop}".` + + ` Please replace the array with its element.` + + `\n\t${JSON.stringify(prop)}: ${JSON.stringify(value[0])}` + ); + } + } + } + }); + }); + + it('- should only have alias titles for valid aliases', function () { + forEachEntry((entry, id) => { + const title = entry.title; + const alias = toArray(entry.alias); + const aliasTitles = entry.aliasTitles; + + for (const key in aliasTitles) { + if (alias.indexOf(key) === -1) { + assert.fail( + `Component "${id}":` + + ` The alias ${JSON.stringify(key)} in "aliasTitles" is not defined in "alias".` + ); + } + if (aliasTitles[key] === title) { + assert.fail( + `Component "${id}":` + + ` The alias title for ${JSON.stringify(key)} is the same as the normal title.` + + ` Remove the alias title or choose a different alias title.` + ); + } + } + }); + }); + + it('- should not have unknown properties', function () { + const knownProperties = new Set(entryProperties); + + forEachEntry((entry, id) => { + for (const prop in entry) { + if (!knownProperties.has(prop)) { + assert.fail( + `Component "${id}":` + + ` The property ${JSON.stringify(prop)} is not supported by Prism.` + ); + } + } + }); + }); + }); diff --git a/tests/examples-test.js b/tests/examples-test.js index 0a4f3e4164..870bbf9e96 100644 --- a/tests/examples-test.js +++ b/tests/examples-test.js @@ -100,7 +100,7 @@ async function validateHTML(html) { assert.isEmpty(node.rawText.trim(), 'All non-whitespace text has to be in

tags.'); } else { // only known tags - assert.match(node.tagName, /^(?:h2|h3|p|pre|ul|ol)$/, 'Only some tags are allowed as top level tags.'); + assert.match(node.tagName, /^(?:h2|h3|ol|p|pre|ul)$/, 'Only some tags are allowed as top level tags.'); //

 elements must have only one child, a  element
 			if (node.tagName === 'pre') {
@@ -151,7 +151,7 @@ function parseHTML(html) {
 
 		const p = new Parser({
 			onerror(err) {
-				reject(err)
+				reject(err);
 			},
 			onend() {
 				resolve(tree);
diff --git a/tests/helper/checks.js b/tests/helper/checks.js
index f926626c34..d1dba603c3 100644
--- a/tests/helper/checks.js
+++ b/tests/helper/checks.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 function testFunction(name, object, tester) {
 	const func = object[name];
@@ -9,10 +9,116 @@ function testFunction(name, object, tester) {
 	};
 }
 
+/**
+ * @param {readonly T[]} a1
+ * @param {readonly T[]} a2
+ * @returns {boolean}
+ * @template T
+ */
+function arrayEqual(a1, a2) {
+	if (a1.length !== a2.length) {
+		return false;
+	}
+	for (let i = 0, l = a1.length; i < l; i++) {
+		if (a1[i] !== a2[i]) {
+			return false;
+		}
+	}
+	return true;
+}
+
+/**
+ * Returns a slice of the first array that doesn't contain the leading and trailing elements the both arrays have in
+ * common.
+ *
+ * Examples:
+ *
+ *     trimCommon([1,2,3,4], [1,3,2,4]) => [2,3]
+ *     trimCommon([1,2,3,4], [1,2,3,4]) => []
+ *     trimCommon([1,2,0,0,3,4], [1,2,3,4]) => [0,0]
+ *     trimCommon([1,2,3,4], [1,2,0,0,3,4]) => []
+ *
+ * @param {readonly T[]} a1
+ * @param {readonly T[]} a2
+ * @returns {T[]}
+ * @template T
+ */
+function trimCommon(a1, a2) {
+	let commonBefore = 0;
+	for (let i = 0; i < a1.length; i++) {
+		if (a1[i] === a2[i]) {
+			commonBefore++;
+		} else {
+			break;
+		}
+	}
+	a1 = a1.slice(commonBefore);
+	let commonAfter = 0;
+	for (let i = 0; i < a1.length; i++) {
+		if (a1[a1.length - 1 - i] === a2[a2.length - 1 - i]) {
+			commonAfter++;
+		} else {
+			break;
+		}
+	}
+	return a1.slice(0, a1.length - commonAfter);
+}
+
+/**
+ * @param {string[]} a
+ */
+function joinEnglishList(a) {
+	if (a.length === 0) {
+		return '(no elements)';
+	} else if (a.length === 1) {
+		return a[0];
+	} else if (a.length === 2) {
+		return `${a[0]} and ${a[1]}`;
+	} else {
+		return a.slice(0, a.length - 1).join(', ') + ', and ' + a[a.length - 1];
+	}
+}
+
+
 module.exports = (Prism) => {
 
+	// The test for Prism.languages.extend has to be able to tell whether an object is a clone, so we mark it with a
+	// special property
+	const oldClone = Prism.util.clone;
+	Prism.util.clone = obj => {
+		const clone = oldClone(obj);
+		if (clone && typeof clone === 'object') {
+			Object.defineProperty(clone, '__cloned', { value: true });
+		}
+		return clone;
+	};
+
+
 	function extendTest(id, redef) {
-		const details = `\nextend("${id}", ${redef})`;
+		let redefStr;
+		if (Prism.util.type(redef) === 'Object') {
+			redefStr = '{\n';
+			for (const key in redef) {
+				const element = redef[key];
+				let elementStr;
+				if (Array.isArray(element)) {
+					elementStr = `[ ... ${element.length} element(s) ]`;
+				} else if (Prism.util.type(element) === 'RegExp') {
+					elementStr = 'RegExp';
+				} else if (Prism.util.type(element) === 'Object') {
+					elementStr = '{ ... }';
+				} else {
+					elementStr = String(element);
+				}
+				redefStr += `\t'${key}': ${elementStr},\n`;
+			}
+			redefStr += '}';
+		} else {
+			redefStr = String(redef);
+		}
+		const details = `\n\nActual method call (nonconforming):` +
+			`\n\n\tPrism.languages.extend('${id}', ${redefStr.replace(/\n/g, '\n\t')});` +
+			'\n\nFor more information see: https://prismjs.com/docs/Prism.languages.html#.extend';
 
 		// type checks
 		if (typeof id !== 'string') {
@@ -22,10 +128,56 @@ module.exports = (Prism) => {
 			throw new TypeError(`The redef argument has to be an 'object'.` + details);
 		}
 
-
+		// language has to be loaded
 		if (!(id in Prism.languages)) {
 			throw new Error(`Cannot extend '${id}' because it is not defined in Prism.languages.`);
 		}
+
+		// rest property check
+		if ('rest' in redef) {
+			throw new Error(`The redef object is not allowed to contain a "rest" property.` + details);
+		}
+
+		// redef cannot be a direct reference to a language
+		let isReference = false;
+		Prism.languages.DFS(Prism.languages, (key, value) => {
+			if (value === redef) {
+				isReference = true;
+			}
+		});
+		if (isReference) {
+			throw new Error(`The redef object cannot be a reference to an existing language.` +
+				` Use Prism.util.clone(object) to create a deep clone.` + details);
+		}
+
+		// check the order of properties in redef
+		if (!redef.__cloned) {
+			const languageKeys = Object.keys(Prism.languages[id]);
+			const redefKeys = Object.keys(redef);
+			const overwriteKeys = redefKeys.filter(k => languageKeys.indexOf(k) !== -1);
+			const appendKeys = redefKeys.filter(k => languageKeys.indexOf(k) === -1);
+			if (!arrayEqual(redefKeys, [...overwriteKeys, ...appendKeys])) {
+				const lastOverwrite = overwriteKeys[overwriteKeys.length - 1];
+				const lastOverwriteIndex = redefKeys.indexOf(lastOverwrite);
+				const offenders = appendKeys.filter(k => redefKeys.indexOf(k) < lastOverwriteIndex);
+				const offendersList = joinEnglishList(offenders.map(k => `'${k}'`));
+
+				throw new Error(
+					`All tokens in the redef object that do not overwrite tokens of the extended language have to be placed after the last token that does overwrite an existing token.` +
+					` Move the token(s) ${offendersList} after the '${lastOverwrite}' token.` + details);
+			}
+
+			const sortedOverwriteKeys = [...overwriteKeys].sort((a, b) => {
+				return languageKeys.indexOf(a) - languageKeys.indexOf(b);
+			});
+			if (!arrayEqual(overwriteKeys, sortedOverwriteKeys)) {
+				const trimmedUnsorted = trimCommon(overwriteKeys, sortedOverwriteKeys).map(k => `'${k}'`).join(', ');
+				const trimmedSorted = trimCommon(sortedOverwriteKeys, overwriteKeys).map(k => `'${k}'`).join(', ');
+				throw new Error(
+					'The tokens in the redef object that overwrite existing tokens of the extended language should be in the order of the existing tokens. ' +
+					`The tokens ${trimmedUnsorted} should be in the order ${trimmedSorted}.` + details);
+			}
+		}
 	}
 
 	function insertBeforeTest(inside, before, insert, root) {
@@ -47,7 +199,7 @@ module.exports = (Prism) => {
 
 
 		root = root || Prism.languages;
-		var grammar = root[inside];
+		let grammar = root[inside];
 
 		if (typeof grammar !== 'object') {
 			throw new Error(`The grammar "${inside}" has to be an 'object' not '${typeof grammar}'.`);
diff --git a/tests/helper/prism-dom-util.js b/tests/helper/prism-dom-util.js
new file mode 100644
index 0000000000..86de3645fe
--- /dev/null
+++ b/tests/helper/prism-dom-util.js
@@ -0,0 +1,58 @@
+const { assert } = require('chai');
+const PrismLoader = require('./prism-loader');
+
+/**
+ * @typedef {import("./prism-loader").PrismDOM} PrismDOM
+ * @typedef {import("./prism-loader").PrismWindow} PrismWindow
+ */
+
+module.exports = {
+	/**
+	 * @param {PrismWindow} window
+	 */
+	createUtil(window) {
+		const { Prism, document } = window;
+
+		const util = {
+			assert: {
+				highlight({ language = 'none', code, expected }) {
+					assert.strictEqual(Prism.highlight(code, Prism.languages[language], language), expected);
+				},
+				highlightElement({ language = 'none', code, expected }) {
+					const element = document.createElement('CODE');
+					element.classList.add('language-' + language);
+					element.textContent = code;
+
+					Prism.highlightElement(element);
+
+					assert.strictEqual(element.innerHTML, expected);
+				}
+			},
+		};
+
+		return util;
+	},
+
+	/**
+	 * Creates a Prism DOM instance that will be automatically cleaned up after the given test suite finished.
+	 *
+	 * @param {ReturnType} suite
+	 * @param {Partial>} options
+	 */
+	createScopedPrismDom(suite, options = {}) {
+		const dom = PrismLoader.createPrismDOM();
+
+		suite.afterAll(function () {
+			dom.window.close();
+		});
+
+		if (options.languages) {
+			dom.loadLanguages(options.languages);
+		}
+		if (options.plugins) {
+			dom.loadPlugins(options.plugins);
+		}
+
+		return dom;
+	}
+};
diff --git a/tests/helper/prism-loader.js b/tests/helper/prism-loader.js
index 30f1729ad5..1a9ef4dd98 100644
--- a/tests/helper/prism-loader.js
+++ b/tests/helper/prism-loader.js
@@ -1,19 +1,34 @@
-"use strict";
-
-const fs = require("fs");
-const { getAllFiles } = require("./test-discovery");
-const components = require("../../components.json");
-const getLoader = require("../../dependencies");
-const languagesCatalog = components.languages;
+'use strict';
+const fs = require('fs');
+const { JSDOM } = require('jsdom');
+const components = require('../../components.json');
+const getLoader = require('../../dependencies');
 const coreChecks = require('./checks');
+const { languages: languagesCatalog, plugins: pluginsCatalog } = components;
+
 
+/**
+ * @typedef {import('../../components/prism-core')} Prism
+ */
 
 /**
  * @typedef PrismLoaderContext
- * @property {import('../../components/prism-core')} Prism The Prism instance.
+ * @property {Prism} Prism The Prism instance.
  * @property {Set} loaded A set of loaded components.
  */
 
+/**
+ * @typedef {import("jsdom").DOMWindow & { Prism: Prism }} PrismWindow
+ *
+ * @typedef PrismDOM
+ * @property {JSDOM} dom
+ * @property {PrismWindow} window
+ * @property {Document} document
+ * @property {Prism} Prism
+ * @property {(languages: string | string[]) => void} loadLanguages
+ * @property {(plugins: string | string[]) => void} loadPlugins
+ */
+
 /** @type {Map} */
 const fileSourceCache = new Map();
 /** @type {() => any} */
@@ -40,6 +55,54 @@ module.exports = {
 		return context.Prism;
 	},
 
+	/**
+	 * Creates a new JavaScript DOM instance with Prism being loaded.
+	 *
+	 * @returns {PrismDOM}
+	 */
+	createPrismDOM() {
+		const dom = new JSDOM(``, {
+			runScripts: 'outside-only'
+		});
+		const window = dom.window;
+
+		window.self = window; // set self for plugins
+		window.eval(this.loadComponentSource('core'));
+
+		/** The set of loaded languages and plugins */
+		const loaded = new Set();
+
+		/**
+		 * Loads the given languages or plugins.
+		 *
+		 * @param {string | string[]} languagesOrPlugins
+		 */
+		const load = (languagesOrPlugins) => {
+			getLoader(components, toArray(languagesOrPlugins), [...loaded]).load(id => {
+				let source;
+				if (languagesCatalog[id]) {
+					source = this.loadComponentSource(id);
+				} else if (pluginsCatalog[id]) {
+					source = this.loadPluginSource(id);
+				} else {
+					throw new Error(`Language or plugin '${id}' not found.`);
+				}
+
+				window.eval(source);
+				loaded.add(id);
+			});
+		};
+
+		return {
+			dom,
+			window: /** @type {PrismWindow} */ (window),
+			document: window.document,
+			Prism: window.Prism,
+			loadLanguages: load,
+			loadPlugins: load,
+		};
+	},
+
 	/**
 	 * Loads the given languages and appends the config to the given Prism object.
 	 *
@@ -49,11 +112,7 @@ module.exports = {
 	 * @returns {PrismLoaderContext}
 	 */
 	loadLanguages(languages, context) {
-		if (typeof languages === 'string') {
-			languages = [languages];
-		}
-
-		getLoader(components, languages, [...context.loaded]).load(id => {
+		getLoader(components, toArray(languages), [...context.loaded]).load(id => {
 			if (!languagesCatalog[id]) {
 				throw new Error(`Language '${id}' not found.`);
 			}
@@ -83,7 +142,7 @@ module.exports = {
 	 */
 	createEmptyPrism() {
 		if (!coreSupplierFunction) {
-			const source = this.loadComponentSource("core");
+			const source = this.loadComponentSource('core');
 			// Core exports itself in 2 ways:
 			//  1) it uses `module.exports = Prism` which what we'll use
 			//  2) it uses `global.Prism = Prism` which we want to sabotage to prevent leaking
@@ -110,7 +169,18 @@ module.exports = {
 	 * @returns {string}
 	 */
 	loadComponentSource(name) {
-		return this.loadFileSource(__dirname + "/../../components/prism-" + name + ".js");
+		return this.loadFileSource(__dirname + '/../../components/prism-' + name + '.js');
+	},
+
+	/**
+	 * Loads the given plugin's file source as string
+	 *
+	 * @private
+	 * @param {string} name
+	 * @returns {string}
+	 */
+	loadPluginSource(name) {
+		return this.loadFileSource(`${__dirname}/../../plugins/${name}/prism-${name}.js`);
 	},
 
 	/**
@@ -123,8 +193,19 @@ module.exports = {
 	loadFileSource(src) {
 		let content = fileSourceCache.get(src);
 		if (content === undefined) {
-			fileSourceCache.set(src, content = fs.readFileSync(src, "utf8"));
+			fileSourceCache.set(src, content = fs.readFileSync(src, 'utf8'));
 		}
 		return content;
 	}
 };
+
+/**
+ * Wraps the given value in an array if it's not an array already.
+ *
+ * @param {T[] | T} value
+ * @returns {T[]}
+ * @template T
+ */
+function toArray(value) {
+	return Array.isArray(value) ? value : [value];
+}
diff --git a/tests/helper/test-case.js b/tests/helper/test-case.js
index 0ebd277e8c..d69e2c3d98 100644
--- a/tests/helper/test-case.js
+++ b/tests/helper/test-case.js
@@ -1,39 +1,331 @@
-"use strict";
+'use strict';
 
-const fs = require("fs");
-const { assert } = require("chai");
-const PrismLoader = require("./prism-loader");
-const TokenStreamTransformer = require("./token-stream-transformer");
+const fs = require('fs');
+const path = require('path');
+const { assert } = require('chai');
+const Prettier = require('prettier');
+const PrismLoader = require('./prism-loader');
+const TokenStreamTransformer = require('./token-stream-transformer');
 
 /**
- * Handles parsing of a test case file.
- *
+ * @typedef {import("./token-stream-transformer").TokenStream} TokenStream
+ * @typedef {import("../../components/prism-core.js")} Prism
+ */
+
+/**
+ * @param {string[]} languages
+ * @returns {Prism}
+ */
+const defaultCreateInstance = (languages) => PrismLoader.createInstance(languages);
+
+/**
+ * Handles parsing and printing of a test case file.
  *
- * A test case file consists of at least two parts, separated by a line of dashes.
+ * A test case file consists of at most three parts, separated by a line of at least 10 dashes.
  * This separation line must start at the beginning of the line and consist of at least three dashes.
  *
- * The test case file can either consist of two parts:
- *
- *     {source code}
- *     ----
- *     {expected token stream}
- *
- *
- * or of three parts:
- *
- *     {source code}
- *     ----
- *     {expected token stream}
- *     ----
- *     {text comment explaining the test case}
- *
- * If the file contains more than three parts, the remaining parts are just ignored.
- * If the file however does not contain at least two parts (so no expected token stream),
- * the test case will later be marked as failed.
+ *     {code: the source code of the test case}
+ *     ----------
+ *     {expected: the expected value of the test case}
+ *     ----------
+ *     {description: explaining the test case}
  *
+ * All parts are optional.
  *
+ * If the file contains more than three parts, the remaining parts are part of the description.
  */
+class TestCaseFile {
+	/**
+	 * @param {string} code
+	 * @param {string | undefined} [expected]
+	 * @param {string | undefined} [description]
+	 */
+	constructor(code, expected, description) {
+		this.code = code;
+		this.expected = expected || '';
+		this.description = description || '';
+
+		/**
+		 * The end of line sequence used when printed.
+		 *
+		 * @type {"\n" | "\r\n"}
+		 */
+		this.eol = '\n';
+
+		/**
+		 * The number of the first line of `code`.
+		 *
+		 * @type {number}
+		 */
+		this.codeLineStart = NaN;
+		/**
+		 * The number of the first line of `expected`.
+		 *
+		 * @type {number}
+		 */
+		this.expectedLineStart = NaN;
+		/**
+		 * The number of the first line of `description`.
+		 *
+		 * @type {number}
+		 */
+		this.descriptionLineStart = NaN;
+	}
+
+	/**
+	 * Returns the file content of the given test file.
+	 *
+	 * @returns {string}
+	 */
+	print() {
+		const code = this.code.trim();
+		const expected = (this.expected || '').trim();
+		const description = (this.description || '').trim();
+
+		const parts = [code];
+		if (description) {
+			parts.push(expected, description);
+		} else if (expected) {
+			parts.push(expected);
+		}
+
+		// join all parts together and normalize line ends to LF
+		const content = parts
+			.join('\n\n----------------------------------------------------\n\n')
+			.replace(/\r\n?|\n/g, this.eol);
+
+		return content + this.eol;
+	}
+
+	/**
+	 * Writes the given test case file to disk.
+	 *
+	 * @param {string} filePath
+	 */
+	writeToFile(filePath) {
+		fs.writeFileSync(filePath, this.print(), 'utf-8');
+	}
+
+	/**
+	 * Parses the given file contents into a test file.
+	 *
+	 * The line ends of the code, expected value, and description are all normalized to CRLF.
+	 *
+	 * @param {string} content
+	 * @returns {TestCaseFile}
+	 */
+	static parse(content) {
+		const eol = (/\r\n|\n/.exec(content) || ['\n'])[0];
+
+		// normalize line ends to CRLF
+		content = content.replace(/\r\n?|\n/g, '\r\n');
+
+		const parts = content.split(/^-{10,}[ \t]*$/m, 3);
+		const code = parts[0] || '';
+		const expected = parts[1] || '';
+		const description = parts[2] || '';
+
+		const file = new TestCaseFile(code.trim(), expected.trim(), description.trim());
+		file.eol = /** @type {"\r\n" | "\n"} */ (eol);
+
+		const codeStartSpaces = /^\s*/.exec(code)[0];
+		const expectedStartSpaces = /^\s*/.exec(expected)[0];
+		const descriptionStartSpaces = /^\s*/.exec(description)[0];
+
+		const codeLineCount = code.split(/\r\n/).length;
+		const expectedLineCount = expected.split(/\r\n/).length;
+
+		file.codeLineStart = codeStartSpaces.split(/\r\n/).length;
+		file.expectedLineStart = codeLineCount + expectedStartSpaces.split(/\r\n/).length;
+		file.descriptionLineStart = codeLineCount + expectedLineCount + descriptionStartSpaces.split(/\r\n/).length;
+
+		return file;
+	}
+
+	/**
+	 * Reads the given test case file from disk.
+	 *
+	 * @param {string} filePath
+	 * @returns {TestCaseFile}
+	 */
+	static readFromFile(filePath) {
+		return TestCaseFile.parse(fs.readFileSync(filePath, 'utf8'));
+	}
+}
+
+/**
+ * @template T
+ * @typedef Runner
+ * @property {(Prism: Prism, code: string, language: string) => T} run
+ * @property {(actual: T) => string} print
+ * @property {(actual: T, expected: string) => boolean} isEqual
+ * @property {(actual: T, expected: string, message: (firstDifference: number) => string) => void} assertEqual
+ */
+
+/**
+ * @implements {Runner}
+ */
+class TokenizeJSONRunner {
+	/**
+	 * @param {Prism} Prism
+	 * @param {string} code
+	 * @param {string} language
+	 * @returns {TokenStream}
+	 */
+	run(Prism, code, language) {
+		return tokenize(Prism, code, language);
+	}
+	/**
+	 * @param {TokenStream} actual
+	 * @returns {string}
+	 */
+	print(actual) {
+		return TokenStreamTransformer.prettyprint(actual, '\t');
+	}
+	/**
+	 * @param {TokenStream} actual
+	 * @param {string} expected
+	 * @returns {boolean}
+	 */
+	isEqual(actual, expected) {
+		const simplifiedActual = TokenStreamTransformer.simplify(actual);
+		let simplifiedExpected;
+		try {
+			simplifiedExpected = JSON.parse(expected);
+		} catch (error) {
+			return false;
+		}
+
+		return JSON.stringify(simplifiedActual) === JSON.stringify(simplifiedExpected);
+	}
+	/**
+	 * @param {TokenStream} actual
+	 * @param {string} expected
+	 * @param {(firstDifference: number) => string} message
+	 * @returns {void}
+	 */
+	assertEqual(actual, expected, message) {
+		const simplifiedActual = TokenStreamTransformer.simplify(actual);
+		const simplifiedExpected = JSON.parse(expected);
+
+		const actualString = JSON.stringify(simplifiedActual);
+		const expectedString = JSON.stringify(simplifiedExpected);
+
+		const difference = firstDiff(expectedString, actualString);
+		if (difference === undefined) {
+			// both are equal
+			return;
+		}
+
+		// The index of the first difference between the expected token stream and the actual token stream.
+		// The index is in the raw expected token stream JSON of the test case.
+		const diffIndex = translateIndexIgnoreSpaces(expected, expectedString, difference);
+
+		assert.deepEqual(simplifiedActual, simplifiedExpected, message(diffIndex));
+	}
+}
+
+/**
+ * @implements {Runner}
+ */
+class HighlightHTMLRunner {
+	/**
+	 * @param {Prism} Prism
+	 * @param {string} code
+	 * @param {string} language
+	 * @returns {string}
+	 */
+	run(Prism, code, language) {
+		const env = {
+			element: {},
+			language,
+			grammar: Prism.languages[language],
+			code,
+		};
+
+		Prism.hooks.run('before-highlight', env);
+		env.highlightedCode = Prism.highlight(env.code, env.grammar, env.language);
+		Prism.hooks.run('before-insert', env);
+		env.element.innerHTML = env.highlightedCode;
+		Prism.hooks.run('after-highlight', env);
+		Prism.hooks.run('complete', env);
+
+		return env.highlightedCode;
+	}
+	/**
+	 * @param {string} actual
+	 * @returns {string}
+	 */
+	print(actual) {
+		return Prettier.format(actual, {
+			printWidth: 100,
+			tabWidth: 4,
+			useTabs: true,
+			htmlWhitespaceSensitivity: 'ignore',
+			filepath: 'fake.html',
+		});
+	}
+	/**
+	 * @param {string} actual
+	 * @param {string} expected
+	 * @returns {boolean}
+	 */
+	isEqual(actual, expected) {
+		return this.normalize(actual) === this.normalize(expected);
+	}
+	/**
+	 * @param {string} actual
+	 * @param {string} expected
+	 * @param {(firstDifference: number) => string} message
+	 * @returns {void}
+	 */
+	assertEqual(actual, expected, message) {
+		// We don't calculate the index of the first difference because it's difficult.
+		assert.deepEqual(this.normalize(actual), this.normalize(expected), message(0));
+	}
+
+	/**
+	 * Normalizes the given HTML by removing all leading spaces and trailing spaces. Line breaks will also be normalized
+	 * to enable good diffing.
+	 *
+	 * @param {string} html
+	 * @returns {string}
+	 */
+	normalize(html) {
+		return html
+			.replace(//g, '>\n')
+			.replace(/[ \t]*[\r\n]\s*/g, '\n')
+			.trim();
+	}
+}
+
+
 module.exports = {
+	TestCaseFile,
+
+	/**
+	 * Runs the given test file and asserts the result.
+	 *
+	 * This function will determine what kind of test files the given file is and call the appropriate method to run the
+	 * test.
+	 *
+	 * @param {RunOptions} options
+	 * @returns {void}
+	 *
+	 * @typedef RunOptions
+	 * @property {string} languageIdentifier
+	 * @property {string} filePath
+	 * @property {"none" | "insert" | "update"} updateMode
+	 * @property {(languages: string[]) => Prism} [createInstance]
+	 */
+	run(options) {
+		if (path.extname(options.filePath) === '.test') {
+			this.runTestCase(options.languageIdentifier, options.filePath, options.updateMode, options.createInstance);
+		} else {
+			this.runTestsWithHooks(options.languageIdentifier, require(options.filePath), options.createInstance);
+		}
+	},
 
 	/**
 	 * Runs the given test case file and asserts the result
@@ -49,69 +341,85 @@ module.exports = {
 	 *
 	 * @param {string} languageIdentifier
 	 * @param {string} filePath
+	 * @param {"none" | "insert" | "update"} updateMode
+	 * @param {(languages: string[]) => Prism} [createInstance]
 	 */
-	runTestCase(languageIdentifier, filePath) {
-		const testCase = this.parseTestCaseFile(filePath);
-		const usedLanguages = this.parseLanguageNames(languageIdentifier);
-
-		if (null === testCase) {
-			throw new Error("Test case file has invalid format (or the provided token stream is invalid JSON), please read the docs.");
+	runTestCase(languageIdentifier, filePath, updateMode, createInstance = defaultCreateInstance) {
+		let runner;
+		if (/\.html\.test$/i.test(filePath)) {
+			runner = new HighlightHTMLRunner();
+		} else {
+			runner = new TokenizeJSONRunner();
 		}
+		this.runTestCaseWithRunner(languageIdentifier, filePath, updateMode, runner, createInstance);
+	},
+
+	/**
+	 * @param {string} languageIdentifier
+	 * @param {string} filePath
+	 * @param {"none" | "insert" | "update"} updateMode
+	 * @param {Runner} runner
+	 * @param {(languages: string[]) => Prism} createInstance
+	 * @template T
+	 */
+	runTestCaseWithRunner(languageIdentifier, filePath, updateMode, runner, createInstance) {
+		const testCase = TestCaseFile.readFromFile(filePath);
+		const usedLanguages = this.parseLanguageNames(languageIdentifier);
 
-		const Prism = PrismLoader.createInstance(usedLanguages.languages);
+		const Prism = createInstance(usedLanguages.languages);
 
 		// the first language is the main language to highlight
-		const simplifiedTokenStream = this.simpleTokenize(Prism, testCase.testSource, usedLanguages.mainLanguage);
+		const actualValue = runner.run(Prism, testCase.code, usedLanguages.mainLanguage);
 
-		const actual = JSON.stringify(simplifiedTokenStream);
-		const expected = JSON.stringify(testCase.expectedTokenStream);
-
-		if (actual === expected) {
-			// no difference
-			return;
+		function updateFile() {
+			// change the file
+			testCase.expected = runner.print(actualValue);
+			testCase.writeToFile(filePath);
 		}
 
-		// The index of the first difference between the expected token stream and the actual token stream.
-		// The index is in the raw expected token stream JSON of the test case.
-		const diffIndex = translateIndexIgnoreSpaces(testCase.expectedJson, expected, firstDiff(expected, actual));
-		const expectedJsonLines = testCase.expectedJson.substr(0, diffIndex).split(/\r\n?|\n/g);
-		const columnNumber = expectedJsonLines.pop().length + 1;
-		const lineNumber = testCase.expectedLineOffset + expectedJsonLines.length;
-
-		const tokenStreamStr = TokenStreamTransformer.prettyprint(simplifiedTokenStream);
-		const message = "\n\nActual Token Stream:" +
-			"\n-----------------------------------------\n" +
-			tokenStreamStr +
-			"\n-----------------------------------------\n" +
-			"File: " + filePath + ":" + lineNumber + ":" + columnNumber + "\n\n";
-
-		assert.deepEqual(simplifiedTokenStream, testCase.expectedTokenStream, testCase.comment + message);
-	},
+		if (!testCase.expected) {
+			// the test case doesn't have an expected value
 
-	/**
-	 * Returns the simplified token stream of the given code highlighted with `language`.
-	 *
-	 * The `before-tokenize` and `after-tokenize` hooks will also be executed.
-	 *
-	 * @param {import('../../components/prism-core')} Prism The Prism instance which will tokenize `code`.
-	 * @param {string} code The code to tokenize.
-	 * @param {string} language The language id.
-	 * @returns {Array>}
-	 */
-	simpleTokenize(Prism, code, language) {
-		const env = {
-			code,
-			grammar: Prism.languages[language],
-			language
-		};
+			if (updateMode === 'none') {
+				throw new Error('This test case doesn\'t have an expected token stream.'
+					+ ' Either add the JSON of a token stream or run \`npm run test:languages -- --insert\`'
+					+ ' to automatically add the current token stream.');
+			}
 
-		Prism.hooks.run('before-tokenize', env);
-		env.tokens = Prism.tokenize(env.code, env.grammar);
-		Prism.hooks.run('after-tokenize', env);
+			updateFile();
+		} else {
+			// there is an expected value
 
-		return TokenStreamTransformer.simplify(env.tokens);
+			if (runner.isEqual(actualValue, testCase.expected)) {
+				// no difference
+				return;
+			}
+
+			if (updateMode === 'update') {
+				updateFile();
+				return;
+			}
+
+			runner.assertEqual(actualValue, testCase.expected, diffIndex => {
+				const expectedLines = testCase.expected.substr(0, diffIndex).split(/\r\n?|\n/g);
+				const columnNumber = expectedLines.pop().length + 1;
+				const lineNumber = testCase.expectedLineStart + expectedLines.length;
+
+				return testCase.description +
+					`\nThe expected token stream differs from the actual token stream.` +
+					` Either change the ${usedLanguages.mainLanguage} language or update the expected token stream.` +
+					` Run \`npm run test:languages -- --update\` to update all missing or incorrect expected token streams.` +
+					`\n\n\nActual Token Stream:` +
+					`\n-----------------------------------------\n` +
+					runner.print(actualValue) +
+					`\n-----------------------------------------\n` +
+					`File: ${filePath}:${lineNumber}:${columnNumber}\n\n`;
+			});
+		}
 	},
 
+	tokenize,
+
 
 	/**
 	 * Parses the language names and finds the main language.
@@ -124,19 +432,19 @@ module.exports = {
 	 * @returns {{languages: string[], mainLanguage: string}}
 	 */
 	parseLanguageNames(languageIdentifier) {
-		let languages = languageIdentifier.split("+");
+		let languages = languageIdentifier.split('+');
 		let mainLanguage = null;
 
 		languages = languages.map(
 			function (language) {
-				const pos = language.indexOf("!");
+				const pos = language.indexOf('!');
 
 				if (-1 < pos) {
 					if (mainLanguage) {
-						throw "There are multiple main languages defined.";
+						throw 'There are multiple main languages defined.';
 					}
 
-					mainLanguage = language.replace("!", "");
+					mainLanguage = language.replace('!', '');
 					return mainLanguage;
 				}
 
@@ -153,75 +461,32 @@ module.exports = {
 			mainLanguage: mainLanguage
 		};
 	},
-
-
-	/**
-	 * Parses the test case from the given test case file
-	 *
-	 * @private
-	 * @param {string} filePath
-	 * @returns {{testSource: string, expectedTokenStream: Array, comment:string?}|null}
-	 */
-	parseTestCaseFile(filePath) {
-		const testCaseSource = fs.readFileSync(filePath, "utf8");
-		const testCaseParts = testCaseSource.split(/^-{10,}\w*$/m);
-
-		try {
-			const testCase = {
-				testSource: testCaseParts[0].trim(),
-				expectedJson: testCaseParts[1],
-				expectedLineOffset: testCaseParts[0].split(/\r\n?|\n/g).length,
-				expectedTokenStream: JSON.parse(testCaseParts[1]),
-				comment: null
-			};
-
-			// if there are three parts, the third one is the comment
-			// explaining the test case
-			if (testCaseParts[2]) {
-				testCase.comment = testCaseParts[2].trim();
-			}
-
-			return testCase;
-		}
-		catch (e) {
-			// the JSON can't be parsed (e.g. it could be empty)
-			return null;
-		}
-	},
-
-	/**
-	 * Runs the given pieces of codes and asserts their result.
-	 *
-	 * Code is provided as the key and expected result as the value.
-	 *
-	 * @param {string} languageIdentifier
-	 * @param {object} codes
-	 */
-	runTestsWithHooks(languageIdentifier, codes) {
-		const usedLanguages = this.parseLanguageNames(languageIdentifier);
-		const Prism = PrismLoader.createInstance(usedLanguages.languages);
-		// the first language is the main language to highlight
-
-		for (const code in codes) {
-			if (codes.hasOwnProperty(code)) {
-				const env = {
-					element: {},
-					language: usedLanguages.mainLanguage,
-					grammar: Prism.languages[usedLanguages.mainLanguage],
-					code: code
-				};
-				Prism.hooks.run('before-highlight', env);
-				env.highlightedCode = Prism.highlight(env.code, env.grammar, env.language);
-				Prism.hooks.run('before-insert', env);
-				env.element.innerHTML = env.highlightedCode;
-				Prism.hooks.run('after-highlight', env);
-				Prism.hooks.run('complete', env);
-				assert.equal(env.highlightedCode, codes[code]);
-			}
-		}
-	}
 };
 
+/**
+ * Returns the token stream of the given code highlighted with `language`.
+ *
+ * The `before-tokenize` and `after-tokenize` hooks will also be executed.
+ *
+ * @param {import('../../components/prism-core')} Prism The Prism instance which will tokenize `code`.
+ * @param {string} code The code to tokenize.
+ * @param {string} language The language id.
+ * @returns {TokenStream}
+ */
+function tokenize(Prism, code, language) {
+	const env = {
+		code,
+		grammar: Prism.languages[language],
+		language
+	};
+
+	Prism.hooks.run('before-tokenize', env);
+	env.tokens = Prism.tokenize(env.code, env.grammar);
+	Prism.hooks.run('after-tokenize', env);
+
+	return env.tokens;
+}
+
 /**
  * Returns the index at which the given expected string differs from the given actual string.
  *
@@ -264,7 +529,9 @@ function translateIndexIgnoreSpaces(spacey, withoutSpaces, withoutSpaceIndex) {
 	let i = 0;
 	let j = 0;
 	while (i < spacey.length && j < withoutSpaces.length) {
-		while (spacey[i] !== withoutSpaces[j]) i++;
+		while (spacey[i] !== withoutSpaces[j]) {
+			i++;
+		}
 		if (j === withoutSpaceIndex) {
 			return i;
 		}
diff --git a/tests/helper/test-discovery.js b/tests/helper/test-discovery.js
index 99896bde7d..3e374a393c 100644
--- a/tests/helper/test-discovery.js
+++ b/tests/helper/test-discovery.js
@@ -1,44 +1,39 @@
-"use strict";
+'use strict';
 
-const fs = require("fs");
-const path = require("path");
+const fs = require('fs');
+const path = require('path');
 
+const LANGUAGES_DIR = path.join(__dirname, '..', 'languages');
 
 module.exports = {
 
 	/**
 	 * Loads the list of all available tests
 	 *
-	 * @param {string} rootDir
-	 * @returns {Object}
+	 * @param {string} [rootDir]
+	 * @returns {Map}
 	 */
 	loadAllTests(rootDir) {
-		/** @type {Object.} */
-		const testSuite = {};
+		rootDir = rootDir || LANGUAGES_DIR;
 
-		for (const language of this.getAllDirectories(rootDir)) {
-			testSuite[language] = this.getAllFiles(path.join(rootDir, language));
-		}
-
-		return testSuite;
+		return new Map(this.getAllDirectories(rootDir).map(language => {
+			return [language, this.getAllFiles(path.join(rootDir, language))];
+		}));
 	},
 
 	/**
 	 * Loads the list of available tests that match the given languages
 	 *
-	 * @param {string} rootDir
 	 * @param {string|string[]} languages
-	 * @returns {Object}
+	 * @param {string} [rootDir]
+	 * @returns {Map}
 	 */
-	loadSomeTests(rootDir, languages) {
-		/** @type {Object.} */
-		const testSuite = {};
+	loadSomeTests(languages, rootDir) {
+		rootDir = rootDir || LANGUAGES_DIR;
 
-		for (const language of this.getSomeDirectories(rootDir, languages)) {
-			testSuite[language] = this.getAllFiles(path.join(rootDir, language));
-		}
-
-		return testSuite;
+		return new Map(this.getSomeDirectories(rootDir, languages).map(language => {
+			return [language, this.getAllFiles(path.join(rootDir, language))];
+		}));
 	},
 
 
@@ -71,6 +66,7 @@ module.exports = {
 
 	/**
 	 * Returns whether a directory matches one of the given languages.
+	 *
 	 * @param {string} directory
 	 * @param {string|string[]} languages
 	 */
@@ -93,7 +89,8 @@ module.exports = {
 	getAllFiles(src) {
 		return fs.readdirSync(src)
 			.filter(fileName => {
-				return fs.statSync(path.join(src, fileName)).isFile();
+				return path.extname(fileName) === '.test'
+					&& fs.statSync(path.join(src, fileName)).isFile();
 			})
 			.map(fileName => {
 				return path.join(src, fileName);
diff --git a/tests/helper/token-stream-transformer.js b/tests/helper/token-stream-transformer.js
index be5c33f00c..8a92a548b7 100644
--- a/tests/helper/token-stream-transformer.js
+++ b/tests/helper/token-stream-transformer.js
@@ -1,14 +1,20 @@
-"use strict";
+'use strict';
 
 
+/**
+ * @typedef TokenStreamItem
+ * @property {string} type
+ * @property {string | Array} content
+ *
+ * @typedef {Array} TokenStream
+ *
+ * @typedef {Array} SimplifiedTokenStream
+ *
+ * @typedef {Array} PrettyTokenStream
+ * @typedef {string | LineBreakItem | GlueItem | [string, string | Array]} PrettyTokenStreamItem
+ */
+
 module.exports = {
-	/**
-	 * @typedef TokenStreamItem
-	 * @property {string} type
-	 * @property {string | Array} content
-	 *
-	 * @typedef {Array} SimplifiedTokenStream
-	 */
 
 	/**
 	 * Simplifies the token stream to ease the matching with the expected token stream.
@@ -17,31 +23,20 @@ module.exports = {
 	 * * In arrays each value is transformed individually
 	 * * Values that are empty (empty arrays or strings only containing whitespace)
 	 *
-	 * @param {Array} tokenStream
+	 * @param {TokenStream} tokenStream
 	 * @returns {SimplifiedTokenStream}
 	 */
 	simplify: function simplify(tokenStream) {
 		return tokenStream
 			.map(innerSimple)
-			.filter((value, i, arr) => {
-				if (typeof value === "string" && !value.trim().length) {
-					// string contains only spaces
-					if (i > 0 && i < arr.length - 1 && value.split(/\r\n?|\n/g).length > 2) {
-						// in a valid token stream there are no adjacent strings, so we know that the previous
-						// element is a (simplified) token
-						arr[i - 1]['newline-after'] = true;
-					}
-					return false;
-				}
-				return true;
-			});
+			.filter(value => !(typeof value === 'string' && isBlank(value)));
 
 		/**
 		 * @param {string | TokenStreamItem} value
 		 * @returns {string | [string, string | Array]}
 		 */
 		function innerSimple(value) {
-			if (typeof value === "object") {
+			if (typeof value === 'object') {
 				if (Array.isArray(value.content)) {
 					return [value.type, simplify(value.content)];
 				} else {
@@ -54,21 +49,217 @@ module.exports = {
 	},
 
 	/**
-	 *
-	 * @param {Readonly} tokenStream
-	 * @param {number} [indentationLevel]
+	 * @param {TokenStream} tokenStream
+	 * @param {string} [indentation]
+	 * @returns {string}
+	 */
+	prettyprint(tokenStream, indentation) {
+		return printPrettyTokenStream(toPrettyTokenStream(tokenStream), undefined, indentation);
+	}
+};
+
+/**
+ * This item indicates that one or multiple line breaks are present between the preceding and following items in the
+ * source token stream.
+ *
+ * Only if an item is enabled will it appear in the pretty-printed token stream.
+ */
+class LineBreakItem {
+	/** @param {number} sourceCount */
+	constructor(sourceCount) {
+		this.sourceCount = sourceCount;
+		this.enabled = false;
+	}
+}
+/**
+ * This item indicates the the preceding and following items are to be printed on the same line in the pretty-printed
+ * token stream.
+ */
+class GlueItem { }
+
+/**
+ * @param {TokenStream} tokenStream
+ * @param {number} [level]
+ * @returns {PrettyTokenStream}
+ */
+function toPrettyTokenStream(tokenStream, level = 0) {
+	/** @type {PrettyTokenStream} */
+	const prettyStream = [];
+	for (const token of tokenStream) {
+		if (typeof token === 'string') {
+			if (isBlank(token)) {
+				// blank string
+				const lineBreaks = countLineBreaks(token);
+				if (lineBreaks > 0) {
+					prettyStream.push(new LineBreakItem(lineBreaks));
+				}
+			} else {
+				// might start with line breaks
+				const startLineBreaks = countLineBreaks(/^\s*/.exec(token)[0]);
+				if (startLineBreaks > 0) {
+					prettyStream.push(new LineBreakItem(startLineBreaks));
+				}
+
+				prettyStream.push(token);
+
+				const endLineBreaks = countLineBreaks(/\s*$/.exec(token)[0]);
+				if (endLineBreaks > 0) {
+					prettyStream.push(new LineBreakItem(endLineBreaks));
+				}
+			}
+		} else {
+			prettyStream.push(innerSimple(token));
+		}
+	}
+	/**
+	 * @param {TokenStreamItem} value
+	 * @returns {[string, string | Array]}
 	 */
-	prettyprint(tokenStream, indentationLevel = 1) {
-		const indentChar = '    ';
+	function innerSimple(value) {
+		if (Array.isArray(value.content)) {
+			return [value.type, toPrettyTokenStream(value.content, level + 1)];
+		} else {
+			return [value.type, value.content];
+		}
+	}
+
+	prettyFormat(prettyStream, (level + 1) * 4);
+	return prettyStream;
+}
+
+/**
+ * @param {PrettyTokenStream} prettyStream
+ * @param {number} indentationWidth
+ * @returns {void}
+ */
+function prettyFormat(prettyStream, indentationWidth) {
+	// The maximum number of (glued) tokens per line
+	const MAX_TOKEN_PER_LINE = 5;
+	// The maximum number of characters per line
+	// (this is based on an estimation. The actual output might be longer.)
+	const MAX_PRINT_WIDTH = 80 - indentationWidth;
+
+	prettyTrimLineBreaks(prettyStream);
+	// enable all line breaks with >=2 breaks in the source token stream
+	prettyEnableLineBreaks(prettyStream, br => br.sourceCount >= 2);
+
+	const ranges = prettySplit(prettyStream, br => br instanceof LineBreakItem && br.enabled);
+	for (const group of ranges) {
+		if (prettySomeLineBreak(group, true, br => br.enabled)) {
+			// Since we just split by enabled line break, only nested line breaks can be enabled. This usually
+			// indicates complex token streams, so let's just enable all line breaks and call it a day.
+			prettyEnableLineBreaks(group, () => true);
+		} else {
+			// try to optimize for the pattern /{1,MAX_TOKEN_PER_LINE}(\n{1,MAX_TOKEN_PER_LINE})*/
+			const lines = prettySplit(group, i => i instanceof LineBreakItem);
+
+			/**
+			 * Returns whether lines can generally be glued together (no line breaks within lines and don't glue with
+			 * nested tokens).
+			 */
+			function glueable() {
+				return lines.every(g => {
+					if (g.length > 1) {
+						if (prettyContainsNonTriviallyNested(g)) {
+							// the token with nested tokens might be glued together with other tokens and we can't allow
+							// that to happen
+							return false;
+						} else {
+							return true;
+						}
+					} else {
+						// we can safely ignore all tokens that are on their own line
+						return true;
+					}
+				});
+			}
+			function tokensPerLine() {
+				return lines.map(g => prettyCountTokens(g, true));
+			}
+			/**
+			 * Returns an estimate for the output length each line will have
+			 */
+			function widthPerLine() {
+				return lines.map(g => {
+					if (g.length > 1) {
+						return g
+							.map(item => {
+								if (isToken(item)) {
+									if (typeof item === 'string') {
+										return ', '.length + JSON.stringify(item).length;
+									} else {
+										return ', '.length + JSON.stringify(item).length + ' '.length;
+									}
+								} else {
+									return 0;
+								}
+							})
+							.reduce((a, b) => a + b, 0) - ', '.length;
+					} else {
+						// we don't really care about the print width of a single-token line
+						return 1;
+					}
+				});
+			}
+
+			const glueTokens = glueable()
+				// at most this many tokens per line
+				&& Math.max(...tokensPerLine()) <= MAX_TOKEN_PER_LINE
+				// the output of each line can be at most this many characters long
+				&& Math.max(...widthPerLine()) <= MAX_PRINT_WIDTH
+				// We need to have at least 2 lines in this group OR this group isn't the only group in the stream.
+				// This will prevent all tokens of a really short token stream to be glued together.
+				&& (lines.length > 1 || ranges.length > 1);
+
+			if (glueTokens) {
+				prettyGlueTogetherAll(prettyStream, group);
+			} else {
+				const flatTokenCount = prettyCountTokens(group, false);
+				const deepTokenCount = prettyCountTokens(group, true);
+				if (
+					// prevent a one-token-per-line situation
+					flatTokenCount > lines.length &&
+					// require at least 2 tokens per line on average
+					deepTokenCount >= lines.length * 2
+				) {
+					prettyEnableLineBreaks(group, () => true);
+				}
+			}
+		}
+	}
+}
+
+/**
+ * @param {PrettyTokenStream} prettyStream
+ * @param {number} [indentationLevel]
+ * @param {string} [indentationChar]
+ * @returns {string}
+ */
+function printPrettyTokenStream(prettyStream, indentationLevel = 1, indentationChar = '    ') {
+	// can't use tabs because the console will convert one tab to four spaces
+	const indentation = new Array(indentationLevel + 1).join(indentationChar);
 
-		// can't use tabs because the console will convert one tab to four spaces
-		const indentation = new Array(indentationLevel + 1).join(indentChar);
+	let out = '';
+	out += '[\n';
 
-		let out = "";
-		out += "[\n"
-		tokenStream.forEach((item, i) => {
-			out += indentation;
-			let extraNewline = false;
+	let glued = false;
+	prettyStream.forEach((item, i) => {
+		if (item instanceof LineBreakItem) {
+			if (item.enabled) {
+				out += '\n';
+			}
+		} else if (item instanceof GlueItem) {
+			out = out.trimEnd();
+			if (out[out.length - 1] === ',') {
+				out += ' ';
+			}
+			glued = true;
+		} else {
+			if (glued) {
+				glued = false;
+			} else {
+				out += indentation;
+			}
 
 			if (typeof item === 'string') {
 				out += JSON.stringify(item);
@@ -79,24 +270,218 @@ module.exports = {
 				out += '[' + JSON.stringify(name) + ', ';
 
 				if (typeof content === 'string') {
+					// simple string literal
+					out += JSON.stringify(content);
+				} else if (content.length === 1 && typeof content[0] === 'string') {
+					// token stream that only contains a single string literal
 					out += JSON.stringify(content);
 				} else {
-					out += this.prettyprint(content, indentationLevel + 1);
+					// token stream
+					out += printPrettyTokenStream(content, indentationLevel + 1, indentationChar);
 				}
 
 				out += ']';
-
-				extraNewline = !!item['newline-after'];
 			}
 
-			const lineEnd = (i === tokenStream.length - 1) ? '\n' : ',\n';
+			const lineEnd = (i === prettyStream.length - 1) ? '\n' : ',\n';
 			out += lineEnd;
+		}
+	});
+	out += indentation.substr(indentationChar.length) + ']';
+	return out;
+}
 
-			if (extraNewline) {
-				out += '\n';
+/**
+ * Returns whether the given string is empty or contains only whitespace characters.
+ *
+ * @param {string} str
+ * @returns {boolean}
+ */
+function isBlank(str) {
+	return /^\s*$/.test(str);
+}
+
+/**
+ * @param {string} str
+ * @returns {number}
+ */
+function countLineBreaks(str) {
+	return str.split(/\r\n?|\n/).length - 1;
+}
+
+/**
+ * Trim all line breaks at the start and at the end of the pretty stream.
+ *
+ * @param {PrettyTokenStream} prettyStream
+ * @returns {void}
+ */
+function prettyTrimLineBreaks(prettyStream) {
+	let value;
+	while ((value = prettyStream[0])) {
+		if (value instanceof LineBreakItem) {
+			prettyStream.shift();
+		} else {
+			break;
+		}
+	}
+	while ((value = prettyStream[prettyStream.length - 1])) {
+		if (value instanceof LineBreakItem) {
+			prettyStream.pop();
+		} else {
+			break;
+		}
+	}
+}
+
+/**
+ * Enables all line breaks in the pretty token stream (but not in nested token stream) that contain at least some
+ * number of line breaks in the source token stream.
+ *
+ * @param {PrettyTokenStream} prettyStream
+ * @param {(item: LineBreakItem) => boolean} cond
+ */
+function prettyEnableLineBreaks(prettyStream, cond) {
+	prettyStream.forEach(token => {
+		if (token instanceof LineBreakItem && cond(token)) {
+			token.enabled = true;
+		}
+	});
+}
+
+/**
+ * Splits the given pretty stream on all items for which `cond` return `true`. The items for which `cond` returns
+ * `true` will not be part of any of the created streams. No empty streams will be returned.
+ *
+ * @param {PrettyTokenStream} prettyStream
+ * @param {(item: PrettyTokenStreamItem) => boolean} cond
+ * @returns {PrettyTokenStream[]}
+ */
+function prettySplit(prettyStream, cond) {
+	/** @type {PrettyTokenStream[]} */
+	const result = [];
+	/** @type {PrettyTokenStream} */
+	let current = [];
+	for (const item of prettyStream) {
+		if (cond(item)) {
+			if (current.length > 0) {
+				result.push(current);
+				current = [];
 			}
-		})
-		out += indentation.substr(indentChar.length) + ']'
-		return out;
+		} else {
+			current.push(item);
+		}
 	}
-};
+	if (current.length > 0) {
+		result.push(current);
+		current = [];
+	}
+	return result;
+}
+
+/**
+ * @param {PrettyTokenStream} prettyStream
+ * @param {boolean} recursive
+ * @param {(item: LineBreakItem) => boolean} cond
+ * @returns {boolean}
+ */
+function prettySomeLineBreak(prettyStream, recursive, cond) {
+	for (const item of prettyStream) {
+		if (item instanceof LineBreakItem && cond(item)) {
+			return true;
+		} else if (recursive && isNested(item) && prettySomeLineBreak(item[1], true, cond)) {
+			return true;
+		}
+	}
+	return false;
+}
+/**
+ * @param {PrettyTokenStream} prettyStream
+ * @returns {boolean}
+ */
+function prettyContainsNonTriviallyNested(prettyStream) {
+	for (const item of prettyStream) {
+		if (isNested(item) && !isTriviallyNested(item)) {
+			return true;
+		}
+	}
+	return false;
+}
+/**
+ * @param {PrettyTokenStream} prettyStream
+ * @param {boolean} recursive
+ * @returns {number}
+ */
+function prettyCountTokens(prettyStream, recursive) {
+	let count = 0;
+	for (const item of prettyStream) {
+		if (isToken(item)) {
+			count++;
+			if (recursive && isNested(item) && !isTriviallyNested(item)) {
+				count += prettyCountTokens(item[1], true);
+			}
+		}
+	}
+	return count;
+}
+
+/**
+ * Adds glue between the given tokens in the given stream.
+ *
+ * @param {PrettyTokenStream} prettyStream
+ * @param {string | [string, string | any[]]} prev
+ * @param {string | [string, string | any[]]} next
+ */
+function prettyGlueTogether(prettyStream, prev, next) {
+	// strings may appear more than once in the stream, so we have to search for tokens.
+	if (typeof prev !== 'string') {
+		let index = prettyStream.indexOf(prev);
+		if (index === -1 || prettyStream[index + 1] !== next) {
+			throw new Error('Cannot glue: At least one of the tokens is not part of the given token stream.');
+		}
+		prettyStream.splice(index + 1, 0, new GlueItem());
+	} else {
+		let index = prettyStream.indexOf(next);
+		if (index === -1 || prettyStream[index - 1] !== prev) {
+			throw new Error('Cannot glue: At least one of the tokens is not part of the given token stream.');
+		}
+		prettyStream.splice(index, 0, new GlueItem());
+	}
+}
+/**
+ * Glues together all token in the given slice of the given token stream.
+ *
+ * @param {PrettyTokenStream} prettyStream
+ * @param {PrettyTokenStream} slice
+ */
+function prettyGlueTogetherAll(prettyStream, slice) {
+	for (let i = 1, l = slice.length; i < l; i++) {
+		const prev = slice[i - 1];
+		const next = slice[i];
+		if (isToken(prev) && isToken(next)) {
+			prettyGlueTogether(prettyStream, prev, next);
+		}
+	}
+}
+
+/**
+ * @param {PrettyTokenStreamItem} item
+ * @returns {item is (string | [string, string | any[]])}
+ */
+function isToken(item) {
+	return typeof item === 'string' || Array.isArray(item);
+}
+
+/**
+ * @param {PrettyTokenStreamItem} item
+ * @returns {item is [string, any[]]}
+ */
+function isNested(item) {
+	return Array.isArray(item) && Array.isArray(item[1]);
+}
+/**
+ * @param {PrettyTokenStreamItem} item
+ * @returns {item is [string, [string]]}
+ */
+function isTriviallyNested(item) {
+	return isNested(item) && item[1].length === 1 && typeof item[1][0] === 'string';
+}
diff --git a/tests/helper/util.js b/tests/helper/util.js
index c5efc8ebcf..e4c72879fc 100644
--- a/tests/helper/util.js
+++ b/tests/helper/util.js
@@ -1,4 +1,3 @@
-
 const { RegExpParser } = require('regexpp');
 
 
@@ -9,7 +8,7 @@ const { RegExpParser } = require('regexpp');
  */
 
 
-const parser = new RegExpParser({ strict: false, ecmaVersion: 5 });
+const parser = new RegExpParser();
 /** @type {Map} */
 const astCache = new Map();
 
@@ -20,7 +19,7 @@ module.exports = {
 	 * Performs a breadth-first search on the given start element.
 	 *
 	 * @param {any} start
-	 * @param {(path: { key: string, value: any }[]) => void} callback
+	 * @param {(path: { key: string, value: any }[], obj: Record) => void} callback
 	 */
 	BFS(start, callback) {
 		const visited = new Set();
@@ -29,8 +28,6 @@ module.exports = {
 			[{ key: null, value: start }]
 		];
 
-		callback(toVisit[0]);
-
 		while (toVisit.length > 0) {
 			/** @type {{ key: string, value: any }[][]} */
 			const newToVisit = [];
@@ -44,7 +41,7 @@ module.exports = {
 						const value = obj[key];
 
 						path.push({ key, value });
-						callback(path);
+						callback(path, obj);
 
 						if (Array.isArray(value) || Object.prototype.toString.call(value) == '[object Object]') {
 							newToVisit.push([...path]);
@@ -59,6 +56,30 @@ module.exports = {
 		}
 	},
 
+	/**
+	 * Given the `BFS` path given to `BFS` callbacks, this will return the Prism language token path of the current
+	 * value (e.g. `Prism.languages.xml.tag.pattern`).
+	 *
+	 * @param {readonly{ key: string, value: any }[]} path
+	 * @param {string} [root]
+	 * @returns {string}
+	 */
+	BFSPathToPrismTokenPath(path, root = 'Prism.languages') {
+		let tokenPath = root;
+		for (const { key } of path) {
+			if (!key) {
+				// do nothing
+			} else if (/^\d+$/.test(key)) {
+				tokenPath += `[${key}]`;
+			} else if (/^[a-z]\w*$/i.test(key)) {
+				tokenPath += `.${key}`;
+			} else {
+				tokenPath += `[${JSON.stringify(key)}]`;
+			}
+		}
+		return tokenPath;
+	},
+
 	/**
 	 * Returns the AST of a given pattern.
 	 *
diff --git a/tests/identifier-test.js b/tests/identifier-test.js
index 9c90fc5e8d..3d9ef0ec79 100644
--- a/tests/identifier-test.js
+++ b/tests/identifier-test.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 const { assert } = require('chai');
 const PrismLoader = require('./helper/prism-loader');
@@ -35,12 +35,28 @@ const testOptions = {
 		template: false
 	},
 
+	'false': {
+		word: false,
+		template: false
+	},
+	// Hoon uses _ in its keywords
+	'hoon': {
+		word: false,
+		template: false
+	},
+
 	// LilyPond doesn't tokenize based on words
 	'lilypond': {
 		word: false,
 		number: false,
 		template: false,
 	},
+
+	// Nevod uses underscore symbol as operator and allows hyphen to be part of identifier
+	'nevod': {
+		word: false,
+		template: false,
+	},
 };
 
 /** @type {Record} */
@@ -146,7 +162,7 @@ function getOptions(lang) {
  * @property {string | Token | (string | Token)[]} content
  */
 function isNotBroken(token) {
-	if (typeof token === "string") {
+	if (typeof token === 'string') {
 		return true;
 	} else if (Array.isArray(token)) {
 		return token.length === 1 && isNotBroken(token[0]);
@@ -159,7 +175,7 @@ function isNotBroken(token) {
  * Tests all patterns in the given Prism instance.
  *
  * @param {any} Prism
- * @param {lang} Prism
+ * @param {string} lang
  */
 function testLiterals(Prism, lang) {
 
@@ -186,7 +202,7 @@ function testLiterals(Prism, lang) {
 					assert.fail(
 						`${name}: Failed to tokenize the ${identifierType} '${ident}' as one or no token.\n` +
 						'Actual token stream:\n\n' +
-						TokenStreamTransformer.prettyprint(TokenStreamTransformer.simplify(tokens)) +
+						TokenStreamTransformer.prettyprint(tokens) +
 						'\n\n' +
 						'How to fix this:\n' +
 						'If your language failed any of the identifier tests then some patterns in your language can break identifiers. ' +
diff --git a/tests/languages/ada/punctuation_feature.test b/tests/languages/ada/punctuation_feature.test
new file mode 100644
index 0000000000..46bf069344
--- /dev/null
+++ b/tests/languages/ada/punctuation_feature.test
@@ -0,0 +1,14 @@
+. ..
+, ; ( ) :
+
+----------------------------------------------------
+
+[
+	["punctuation", "."],
+	["punctuation", ".."],
+	["punctuation", ","],
+	["punctuation", ";"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ":"]
+]
diff --git a/tests/languages/agda/comment_feature.test b/tests/languages/agda/comment_feature.test
index 8dd0bf4689..de122ad76c 100644
--- a/tests/languages/agda/comment_feature.test
+++ b/tests/languages/agda/comment_feature.test
@@ -7,7 +7,7 @@
 ----------------------------------------------------
 
 [
-	["comment", "{-\n\tThis is a\n\tmultiline comment\n-}"],
+	["comment", "{-\r\n\tThis is a\r\n\tmultiline comment\r\n-}"],
 	["comment", "-- This is a singleline comment"]
 ]
 
diff --git a/tests/languages/agda/data_feature.test b/tests/languages/agda/data_feature.test
index e4300cba7f..777d70c2cf 100644
--- a/tests/languages/agda/data_feature.test
+++ b/tests/languages/agda/data_feature.test
@@ -20,7 +20,6 @@ data _≐_ {ℓ} {A : Set ℓ} (x : A) : A → Prop ℓ where
 	["operator", ":"],
 	" A",
 	["punctuation", ")"],
-	["function", " "],
 	["operator", ":"],
 	" A ",
 	["operator", "→"],
diff --git a/tests/languages/agda/function_feature.test b/tests/languages/agda/function_feature.test
index f857f8dcd3..a90e6d9473 100644
--- a/tests/languages/agda/function_feature.test
+++ b/tests/languages/agda/function_feature.test
@@ -29,11 +29,11 @@ merge xs@(x ∷ xs₁) ys@(y ∷ ys₁) =
 	["operator", "→"],
 	" List A ",
 	["operator", "→"],
-	" List A\nmerge xs [] ",
+	" List A\r\nmerge xs [] ",
 	["operator", "="],
-	" xs\nmerge [] ys ",
+	" xs\r\nmerge [] ys ",
 	["operator", "="],
-	" ys\nmerge xs",
+	" ys\r\nmerge xs",
 	["punctuation", "@"],
 	["punctuation", "("],
 	"x ∷ xs₁",
@@ -44,7 +44,8 @@ merge xs@(x ∷ xs₁) ys@(y ∷ ys₁) =
 	"y ∷ ys₁",
 	["punctuation", ")"],
 	["operator", "="],
-	"\n\tif x < y then x ∷ merge xs₁ ys\n\t\t\t\t\t else y ∷ merge xs ys₁"
+
+	"\r\n\tif x < y then x ∷ merge xs₁ ys\r\n\t\t\t\t\t else y ∷ merge xs ys₁"
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/agda/module_feature.test b/tests/languages/agda/module_feature.test
index deb9e5ddee..f745538842 100644
--- a/tests/languages/agda/module_feature.test
+++ b/tests/languages/agda/module_feature.test
@@ -11,12 +11,14 @@ open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) renaming (begin_ to star
 	["punctuation", "."],
 	"test ",
 	["keyword", "where"],
+
 	["keyword", "import"],
 	" Relation",
 	["punctuation", "."],
 	"Binary",
 	["punctuation", "."],
-	"PropositionalEquality as Eq\n",
+	"PropositionalEquality as Eq\r\n",
+
 	["keyword", "open"],
 	" Eq ",
 	["keyword", "hiding"],
@@ -25,6 +27,7 @@ open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) renaming (begin_ to star
 	["punctuation", ";"],
 	" refl",
 	["punctuation", ")"],
+
 	["keyword", "open"],
 	" Eq",
 	["punctuation", "."],
diff --git a/tests/languages/agda/record_feature.test b/tests/languages/agda/record_feature.test
index 57c83e5e44..4910599c67 100644
--- a/tests/languages/agda/record_feature.test
+++ b/tests/languages/agda/record_feature.test
@@ -15,19 +15,23 @@ open Fin
 	["operator", ":"],
 	" Nat",
 	["punctuation", ")"],
-	["function", " "],
 	["operator", ":"],
 	["keyword", "Set"],
 	["keyword", "where"],
+
 	["keyword", "constructor"],
-	" _[_]\n\t",
+	" _[_]\r\n\t",
+
 	["keyword", "field"],
+
 	["function", "⟦_⟧   "],
 	["operator", ":"],
-	" Nat\n\t\t",
+	" Nat\r\n\t\t",
+
 	["function", "proof "],
 	["operator", ":"],
-	" suc ⟦_⟧ ≤ n\n",
+	" suc ⟦_⟧ ≤ n\r\n",
+
 	["keyword", "open"],
 	" Fin"
 ]
diff --git a/tests/languages/al/comment_feature.test b/tests/languages/al/comment_feature.test
index 4ae0238ba4..77f0c737a3 100644
--- a/tests/languages/al/comment_feature.test
+++ b/tests/languages/al/comment_feature.test
@@ -9,7 +9,7 @@
 [
 	["comment", "// comment"],
 	["comment", "/**/"],
-	["comment", "/*\n comment\n*/"]
+	["comment", "/*\r\n comment\r\n*/"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/antlr4/action_feature.test b/tests/languages/antlr4/action_feature.test
index 110a8a4511..4288ebb6d5 100644
--- a/tests/languages/antlr4/action_feature.test
+++ b/tests/languages/antlr4/action_feature.test
@@ -21,12 +21,14 @@ from LexerAdaptor import LexerAdaptor
 		["content", " superClass = LexerAdaptor; "],
 		["punctuation", "}"]
 	]],
+
 	["annotation", "@lexer::header"],
 	["action", [
 		["punctuation", "{"],
-		["content", "\n  import { Token } from 'antlr4ts/Token';\n  import { CommonToken } from 'antlr4ts/CommonToken';\n  import { Python3Parser } from './Python3Parser';\n"],
+		["content", "\r\n  import { Token } from 'antlr4ts/Token';\r\n  import { CommonToken } from 'antlr4ts/CommonToken';\r\n  import { Python3Parser } from './Python3Parser';\r\n"],
 		["punctuation", "}"]
 	]],
+
 	["definition", "END"],
 	["punctuation", ":"],
 	["string", "'end'"],
@@ -36,10 +38,11 @@ from LexerAdaptor import LexerAdaptor
 		["punctuation", "}"]
 	]],
 	["punctuation", ";"],
+
 	["annotation", "@header"],
 	["action", [
 		["punctuation", "{"],
-		["content", "\nfrom LexerAdaptor import LexerAdaptor\n"],
+		["content", "\r\nfrom LexerAdaptor import LexerAdaptor\r\n"],
 		["punctuation", "}"]
 	]]
 ]
diff --git a/tests/languages/antlr4/comment_feature.test b/tests/languages/antlr4/comment_feature.test
index ca4545e8b1..2b794ba47c 100644
--- a/tests/languages/antlr4/comment_feature.test
+++ b/tests/languages/antlr4/comment_feature.test
@@ -7,7 +7,7 @@
 
 [
 	["comment", "// comment"],
-	["comment", "/*\n comment\n*/"]
+	["comment", "/*\r\n comment\r\n*/"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/apacheconf/directive-flags_feature.test b/tests/languages/apacheconf/directive-flags_feature.test
index 0bb206ecba..69ae37eed4 100644
--- a/tests/languages/apacheconf/directive-flags_feature.test
+++ b/tests/languages/apacheconf/directive-flags_feature.test
@@ -1,13 +1,15 @@
 [OR]
 [L,QSA]
+[L,R=301,NC]
 
 ----------------------------------------------------
 
 [
 	["directive-flags", "[OR]"],
-	["directive-flags", "[L,QSA]"]
+	["directive-flags", "[L,QSA]"],
+	["directive-flags", "[L,R=301,NC]"]
 ]
 
 ----------------------------------------------------
 
-Checks for directive flags.
\ No newline at end of file
+Checks for directive flags.
diff --git a/tests/languages/apex/annotation_feature.test b/tests/languages/apex/annotation_feature.test
new file mode 100644
index 0000000000..24a84e8a75
--- /dev/null
+++ b/tests/languages/apex/annotation_feature.test
@@ -0,0 +1,16 @@
+@Future
+@IsTest
+@isTest(SeeAllData=true)
+
+----------------------------------------------------
+
+[
+	["annotation", "@Future"],
+	["annotation", "@IsTest"],
+	["annotation", "@isTest"],
+	["punctuation", "("],
+	"SeeAllData",
+	["operator", "="],
+	["boolean", "true"],
+	["punctuation", ")"]
+]
diff --git a/tests/languages/apex/boolean_feature.test b/tests/languages/apex/boolean_feature.test
new file mode 100644
index 0000000000..62b158804d
--- /dev/null
+++ b/tests/languages/apex/boolean_feature.test
@@ -0,0 +1,9 @@
+true
+false
+
+----------------------------------------------------
+
+[
+	["boolean", "true"],
+	["boolean", "false"]
+]
diff --git a/tests/languages/apex/class-name_feature.test b/tests/languages/apex/class-name_feature.test
new file mode 100644
index 0000000000..8074dc60fd
--- /dev/null
+++ b/tests/languages/apex/class-name_feature.test
@@ -0,0 +1,334 @@
+Integer i;
+Integer i = (Integer)obj;
+Integer[] myInts = new Integer[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+Object obj = new MyApexClass();
+list itemList;
+List>> my_list_2 = new List>>();
+Map updateMap = new Map();
+set AllItems = new set();
+
+public Season getSouthernHemisphereSeason(season northernHemisphereSeason) {}
+
+for(Shipping_Invoice__C sc : AllShippingInvoices){}
+public static Integer calculate() {}
+
+if (sobject instanceof Account) {
+	Account a = (Account) sobject;
+}
+
+public class myOuterClass {}
+public enum MyEnumClass { X, Y }
+public class YellowMarker extends Marker {}
+interface MySecondInterface extends MyInterface {}
+public virtual class InnerClass implements MySecondInterface {}
+
+
+class Foo {
+	List accs {get; set;}
+	Integer i {get; set;}
+}
+
+
+public with sharing class sharingClass {}
+public without sharing class noSharing {}
+public inherited sharing class InheritedSharingClass{}
+
+----------------------------------------------------
+
+[
+	["keyword", "Integer"],
+	" i",
+	["punctuation", ";"],
+	["keyword", "Integer"],
+	" i ",
+	["operator", "="],
+	["punctuation", "("],
+	["keyword", "Integer"],
+	["punctuation", ")"],
+	"obj",
+	["punctuation", ";"],
+	["class-name", [
+		["keyword", "Integer"],
+		["punctuation", "["],
+		["punctuation", "]"]
+	]],
+	" myInts ",
+	["operator", "="],
+	["keyword", "new"],
+	["class-name", [
+		["keyword", "Integer"],
+		["punctuation", "["],
+		["punctuation", "]"]
+	]],
+	["punctuation", "{"],
+	["number", "1"],
+	["punctuation", ","],
+	["number", "2"],
+	["punctuation", ","],
+	["number", "3"],
+	["punctuation", ","],
+	["number", "4"],
+	["punctuation", ","],
+	["number", "5"],
+	["punctuation", ","],
+	["number", "6"],
+	["punctuation", ","],
+	["number", "7"],
+	["punctuation", ","],
+	["number", "8"],
+	["punctuation", ","],
+	["number", "9"],
+	["punctuation", ","],
+	["number", "10"],
+	["punctuation", "}"],
+	["punctuation", ";"],
+	["keyword", "Object"],
+	" obj ",
+	["operator", "="],
+	["keyword", "new"],
+	["class-name", [
+		"MyApexClass"
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ";"],
+	["class-name", [
+		["keyword", "list"],
+		["punctuation", "<"],
+		"Item__c",
+		["punctuation", ">"]
+	]],
+	" itemList",
+	["punctuation", ";"],
+	["class-name", [
+		["keyword", "List"],
+		["punctuation", "<"],
+		["keyword", "List"],
+		["punctuation", "<"],
+		["keyword", "Set"],
+		["punctuation", "<"],
+		["keyword", "Integer"],
+		["punctuation", ">"],
+		["punctuation", ">"],
+		["punctuation", ">"]
+	]],
+	" my_list_2 ",
+	["operator", "="],
+	["keyword", "new"],
+	["class-name", [
+		["keyword", "List"],
+		["punctuation", "<"],
+		["keyword", "List"],
+		["punctuation", "<"],
+		["keyword", "Set"],
+		["punctuation", "<"],
+		["keyword", "Integer"],
+		["punctuation", ">"],
+		["punctuation", ">"],
+		["punctuation", ">"]
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ";"],
+	["class-name", [
+		["keyword", "Map"],
+		["punctuation", "<"],
+		"ID",
+		["punctuation", ","],
+		" Shipping_Invoice__C",
+		["punctuation", ">"]
+	]],
+	" updateMap ",
+	["operator", "="],
+	["keyword", "new"],
+	["class-name", [
+		["keyword", "Map"],
+		["punctuation", "<"],
+		"ID",
+		["punctuation", ","],
+		" Shipping_Invoice__C",
+		["punctuation", ">"]
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ";"],
+	["class-name", [
+		["keyword", "set"],
+		["punctuation", "<"],
+		"Id",
+		["punctuation", ">"]
+	]],
+	" AllItems ",
+	["operator", "="],
+	["keyword", "new"],
+	["class-name", [
+		["keyword", "set"],
+		["punctuation", "<"],
+		"id",
+		["punctuation", ">"]
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "public"],
+	["class-name", [
+		"Season"
+	]],
+	["function", "getSouthernHemisphereSeason"],
+	["punctuation", "("],
+	["class-name", [
+		"season"
+	]],
+	" northernHemisphereSeason",
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["keyword", "for"],
+	["punctuation", "("],
+	["class-name", [
+		"Shipping_Invoice__C"
+	]],
+	" sc ",
+	["operator", ":"],
+	" AllShippingInvoices",
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["keyword", "public"],
+	["keyword", "static"],
+	["keyword", "Integer"],
+	["function", "calculate"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["keyword", "if"],
+	["punctuation", "("],
+	["keyword", "sobject"],
+	["keyword", "instanceof"],
+	["class-name", [
+		"Account"
+	]],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["class-name", [
+		"Account"
+	]],
+	" a ",
+	["operator", "="],
+	["punctuation", "("],
+	["class-name", [
+		"Account"
+	]],
+	["punctuation", ")"],
+	["keyword", "sobject"],
+	["punctuation", ";"],
+	["punctuation", "}"],
+
+	["keyword", "public"],
+	["keyword", "class"],
+	["class-name", [
+		"myOuterClass"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["keyword", "public"],
+	["keyword", "enum"],
+	["class-name", [
+		"MyEnumClass"
+	]],
+	["punctuation", "{"],
+	" X",
+	["punctuation", ","],
+	" Y ",
+	["punctuation", "}"],
+	["keyword", "public"],
+	["keyword", "class"],
+	["class-name", [
+		"YellowMarker"
+	]],
+	["keyword", "extends"],
+	["class-name", [
+		"Marker"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["keyword", "interface"],
+	["class-name", [
+		"MySecondInterface"
+	]],
+	["keyword", "extends"],
+	["class-name", [
+		"MyInterface"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["keyword", "public"],
+	["keyword", "virtual"],
+	["keyword", "class"],
+	["class-name", [
+		"InnerClass"
+	]],
+	["keyword", "implements"],
+	["class-name", [
+		"MySecondInterface"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["keyword", "class"],
+	["class-name", [
+		"Foo"
+	]],
+	["punctuation", "{"],
+	["class-name", [
+		["keyword", "List"],
+		["punctuation", "<"],
+		"Account",
+		["punctuation", ">"]
+	]],
+	" accs ",
+	["punctuation", "{"],
+	["keyword", "get"],
+	["punctuation", ";"],
+	["keyword", "set"],
+	["punctuation", ";"],
+	["punctuation", "}"],
+	["keyword", "Integer"],
+	" i ",
+	["punctuation", "{"],
+	["keyword", "get"],
+	["punctuation", ";"],
+	["keyword", "set"],
+	["punctuation", ";"],
+	["punctuation", "}"],
+	["punctuation", "}"],
+
+	["keyword", "public"],
+	["keyword", "with sharing"],
+	["keyword", "class"],
+	["class-name", [
+		"sharingClass"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["keyword", "public"],
+	["keyword", "without sharing"],
+	["keyword", "class"],
+	["class-name", [
+		"noSharing"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["keyword", "public"],
+	["keyword", "inherited sharing"],
+	["keyword", "class"],
+	["class-name", [
+		"InheritedSharingClass"
+	]],
+	["punctuation", "{"],
+	["punctuation", "}"]
+]
\ No newline at end of file
diff --git a/tests/languages/apex/comment_feature.test b/tests/languages/apex/comment_feature.test
new file mode 100644
index 0000000000..37590c35d1
--- /dev/null
+++ b/tests/languages/apex/comment_feature.test
@@ -0,0 +1,11 @@
+// comment
+/*
+comment
+*/
+
+----------------------------------------------------
+
+[
+	["comment", "// comment"],
+	["comment", "/*\r\ncomment\r\n*/"]
+]
\ No newline at end of file
diff --git a/tests/languages/apex/number_feature.test b/tests/languages/apex/number_feature.test
new file mode 100644
index 0000000000..e2be1e3fd2
--- /dev/null
+++ b/tests/languages/apex/number_feature.test
@@ -0,0 +1,15 @@
+0
+123
+.123
+21.3
+123L
+
+----------------------------------------------------
+
+[
+	["number", "0"],
+	["number", "123"],
+	["number", ".123"],
+	["number", "21.3"],
+	["number", "123L"]
+]
diff --git a/tests/languages/apex/operator_feature.test b/tests/languages/apex/operator_feature.test
new file mode 100644
index 0000000000..e7e8464c32
--- /dev/null
+++ b/tests/languages/apex/operator_feature.test
@@ -0,0 +1,64 @@
+=
+
++= *= -= /=
+|= &= <<= >>= >>>=
+
+? :
+
+&& ||
+== === < > <= >= != !==
+
++ - * / !
+++ --
+& |
+^ ^=
+<< >> >>>
+
+?.
+
+----------------------------------------------------
+
+[
+	["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", "?."]
+]
diff --git a/tests/languages/apex/punctuation_feature.test b/tests/languages/apex/punctuation_feature.test
new file mode 100644
index 0000000000..7be7561bec
--- /dev/null
+++ b/tests/languages/apex/punctuation_feature.test
@@ -0,0 +1,16 @@
+( ) [ ] { }
+. , ;
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", "."],
+	["punctuation", ","],
+	["punctuation", ";"]
+]
diff --git a/tests/languages/apex/sql_feature.test b/tests/languages/apex/sql_feature.test
new file mode 100644
index 0000000000..2ade8e615d
--- /dev/null
+++ b/tests/languages/apex/sql_feature.test
@@ -0,0 +1,48 @@
+b = [SELECT Price__c FROM Book__c WHERE Id =:b.Id];
+return [SELECT Name FROM Contact];
+
+// don't capture array indexing
+a[0].Name = 'Acme';
+
+----------------------------------------------------
+
+[
+	"b ",
+	["operator", "="],
+	["sql", [
+		["punctuation", "["],
+		["keyword", "SELECT"],
+		" Price__c ",
+		["keyword", "FROM"],
+		" Book__c ",
+		["keyword", "WHERE"],
+		" Id ",
+		["operator", "="],
+		":b",
+		["punctuation", "."],
+		"Id",
+		["punctuation", "]"]
+	]],
+	["punctuation", ";"],
+	["keyword", "return"],
+	["sql", [
+		["punctuation", "["],
+		["keyword", "SELECT"],
+		" Name ",
+		["keyword", "FROM"],
+		" Contact",
+		["punctuation", "]"]
+	]],
+	["punctuation", ";"],
+
+	["comment", "// don't capture array indexing"],
+	"\r\na",
+	["punctuation", "["],
+	["number", "0"],
+	["punctuation", "]"],
+	["punctuation", "."],
+	"Name ",
+	["operator", "="],
+	["string", "'Acme'"],
+	["punctuation", ";"]
+]
\ No newline at end of file
diff --git a/tests/languages/apex/string_feature.test b/tests/languages/apex/string_feature.test
new file mode 100644
index 0000000000..5d6f204ad5
--- /dev/null
+++ b/tests/languages/apex/string_feature.test
@@ -0,0 +1,13 @@
+''
+'  '
+'\''
+'foo\nbar'
+
+----------------------------------------------------
+
+[
+	["string", "''"],
+	["string", "'  '"],
+	["string", "'\\''"],
+	["string", "'foo\\nbar'"]
+]
diff --git a/tests/languages/apex/trigger_feature.test b/tests/languages/apex/trigger_feature.test
new file mode 100644
index 0000000000..c59d1f0162
--- /dev/null
+++ b/tests/languages/apex/trigger_feature.test
@@ -0,0 +1,39 @@
+trigger HelloWorldTrigger on Book__c (before insert) {}
+
+trigger T1 on Account (before delete, after delete, after undelete) {}
+
+----------------------------------------------------
+
+[
+	["keyword", "trigger"],
+	["trigger", "HelloWorldTrigger"],
+	["keyword", "on"],
+	["class-name", [
+		"Book__c"
+	]],
+	["punctuation", "("],
+	["keyword", "before"],
+	["keyword", "insert"],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["keyword", "trigger"],
+	["trigger", "T1"],
+	["keyword", "on"],
+	["class-name", [
+		"Account"
+	]],
+	["punctuation", "("],
+	["keyword", "before"],
+	["keyword", "delete"],
+	["punctuation", ","],
+	["keyword", "after"],
+	["keyword", "delete"],
+	["punctuation", ","],
+	["keyword", "after"],
+	["keyword", "undelete"],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"]
+]
diff --git a/tests/languages/applescript/class-name_feature.test b/tests/languages/applescript/class-name_feature.test
new file mode 100644
index 0000000000..db348ead10
--- /dev/null
+++ b/tests/languages/applescript/class-name_feature.test
@@ -0,0 +1,90 @@
+alias application boolean class constant
+date file integer list number
+POSIX file
+real record reference
+RGB color
+script text centimetres centimeters feet
+inches kilometres kilometers metres meters
+miles yards
+square feet square kilometres square kilometers square metres
+square meters square miles square yards
+cubic centimetres cubic centimeters cubic feet cubic inches
+cubic metres cubic meters cubic yards
+gallons litres liters quarts grams
+kilograms ounces pounds
+degrees Celsius degrees Fahrenheit degrees Kelvin
+
+----------------------------------------------------
+
+[
+	["class-name", "alias"],
+	["class-name", "application"],
+	["class-name", "boolean"],
+	["class-name", "class"],
+	["class-name", "constant"],
+
+	["class-name", "date"],
+	["class-name", "file"],
+	["class-name", "integer"],
+	["class-name", "list"],
+	["class-name", "number"],
+
+	["class-name", "POSIX file"],
+
+	["class-name", "real"],
+	["class-name", "record"],
+	["class-name", "reference"],
+
+	["class-name", "RGB color"],
+
+	["class-name", "script"],
+	["class-name", "text"],
+	["class-name", "centimetres"],
+	["class-name", "centimeters"],
+	["class-name", "feet"],
+
+	["class-name", "inches"],
+	["class-name", "kilometres"],
+	["class-name", "kilometers"],
+	["class-name", "metres"],
+	["class-name", "meters"],
+
+	["class-name", "miles"],
+	["class-name", "yards"],
+
+	["class-name", "square feet"],
+	["class-name", "square kilometres"],
+	["class-name", "square kilometers"],
+	["class-name", "square metres"],
+
+	["class-name", "square meters"],
+	["class-name", "square miles"],
+	["class-name", "square yards"],
+
+	["class-name", "cubic centimetres"],
+	["class-name", "cubic centimeters"],
+	["class-name", "cubic feet"],
+	["class-name", "cubic inches"],
+
+	["class-name", "cubic metres"],
+	["class-name", "cubic meters"],
+	["class-name", "cubic yards"],
+
+	["class-name", "gallons"],
+	["class-name", "litres"],
+	["class-name", "liters"],
+	["class-name", "quarts"],
+	["class-name", "grams"],
+
+	["class-name", "kilograms"],
+	["class-name", "ounces"],
+	["class-name", "pounds"],
+
+	["class-name", "degrees Celsius"],
+	["class-name", "degrees Fahrenheit"],
+	["class-name", "degrees Kelvin"]
+]
+
+----------------------------------------------------
+
+Checks for all classes.
diff --git a/tests/languages/applescript/class_feature.test b/tests/languages/applescript/class_feature.test
deleted file mode 100644
index 547906deab..0000000000
--- a/tests/languages/applescript/class_feature.test
+++ /dev/null
@@ -1,39 +0,0 @@
-alias application boolean class constant
-date file integer list number
-POSIX file
-real record reference
-RGB color
-script text centimetres centimeters feet
-inches kilometres kilometers metres meters
-miles yards
-square feet square kilometres square kilometers square metres
-square meters square miles square yards
-cubic centimetres cubic centimeters cubic feet cubic inches
-cubic metres cubic meters cubic yards
-gallons litres liters quarts grams
-kilograms ounces pounds
-degrees Celsius degrees Fahrenheit degrees Kelvin
-
-----------------------------------------------------
-
-[
-	["class", "alias"], ["class", "application"], ["class", "boolean"], ["class", "class"], ["class", "constant"],
-	["class", "date"], ["class", "file"], ["class", "integer"], ["class", "list"], ["class", "number"],
-	["class", "POSIX file"],
-	["class", "real"], ["class", "record"], ["class", "reference"],
-	["class", "RGB color"],
-	["class", "script"], ["class", "text"], ["class", "centimetres"], ["class", "centimeters"], ["class", "feet"],
-	["class", "inches"], ["class", "kilometres"], ["class", "kilometers"], ["class", "metres"], ["class", "meters"],
-	["class", "miles"], ["class", "yards"],
-	["class", "square feet"], ["class", "square kilometres"], ["class", "square kilometers"], ["class", "square metres"],
-	["class", "square meters"], ["class", "square miles"], ["class", "square yards"],
-	["class", "cubic centimetres"], ["class", "cubic centimeters"], ["class", "cubic feet"], ["class", "cubic inches"],
-	["class", "cubic metres"], ["class", "cubic meters"], ["class", "cubic yards"],
-	["class", "gallons"], ["class", "litres"], ["class", "liters"], ["class", "quarts"], ["class", "grams"],
-	["class", "kilograms"], ["class", "ounces"], ["class", "pounds"],
-	["class", "degrees Celsius"], ["class", "degrees Fahrenheit"], ["class", "degrees Kelvin"]
-]
-
-----------------------------------------------------
-
-Checks for all classes.
\ No newline at end of file
diff --git a/tests/languages/applescript/punctuation_feature.test b/tests/languages/applescript/punctuation_feature.test
new file mode 100644
index 0000000000..183ea153e7
--- /dev/null
+++ b/tests/languages/applescript/punctuation_feature.test
@@ -0,0 +1,18 @@
+{ } ( ) : ,
+¬ « » 《 》
+
+----------------------------------------------------
+
+[
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ":"],
+	["punctuation", ","],
+	["punctuation", "¬"],
+	["punctuation", "«"],
+	["punctuation", "»"],
+	["punctuation", "《"],
+	["punctuation", "》"]
+]
diff --git a/tests/languages/aql/boolean_feature.test b/tests/languages/aql/boolean_feature.test
new file mode 100644
index 0000000000..6d5c41a781
--- /dev/null
+++ b/tests/languages/aql/boolean_feature.test
@@ -0,0 +1,13 @@
+true
+false
+TRUE
+FALSE
+
+----------------------------------------------------
+
+[
+	["boolean", "true"],
+	["boolean", "false"],
+	["boolean", "TRUE"],
+	["boolean", "FALSE"]
+]
diff --git a/tests/languages/aql/identifier_feature.test b/tests/languages/aql/identifier_feature.test
new file mode 100644
index 0000000000..664358bbef
--- /dev/null
+++ b/tests/languages/aql/identifier_feature.test
@@ -0,0 +1,9 @@
+´filter´
+`sort`
+
+----------------------------------------------------
+
+[
+	["identifier", "´filter´"],
+	["identifier", "`sort`"]
+]
diff --git a/tests/languages/aql/keyword_feature.test b/tests/languages/aql/keyword_feature.test
index 204d45785e..d095cb4ae9 100644
--- a/tests/languages/aql/keyword_feature.test
+++ b/tests/languages/aql/keyword_feature.test
@@ -16,6 +16,7 @@ IN
 INBOUND
 INSERT
 INTO
+K_PATHS
 K_SHORTEST_PATHS
 LET
 LIKE
@@ -32,6 +33,7 @@ SHORTEST_PATH
 SORT
 UPDATE
 UPSERT
+WINDOW
 WITH
 
 KEEP
@@ -69,6 +71,7 @@ OPTIONS
 	["keyword", "INBOUND"],
 	["keyword", "INSERT"],
 	["keyword", "INTO"],
+	["keyword", "K_PATHS"],
 	["keyword", "K_SHORTEST_PATHS"],
 	["keyword", "LET"],
 	["keyword", "LIKE"],
@@ -85,6 +88,7 @@ OPTIONS
 	["keyword", "SORT"],
 	["keyword", "UPDATE"],
 	["keyword", "UPSERT"],
+	["keyword", "WINDOW"],
 	["keyword", "WITH"],
 
 	["keyword", "KEEP"],
diff --git a/tests/languages/aql/number_feature.test b/tests/languages/aql/number_feature.test
index b4720e08ad..4fd7800bf8 100644
--- a/tests/languages/aql/number_feature.test
+++ b/tests/languages/aql/number_feature.test
@@ -6,6 +6,8 @@
 .5
 4.87e103
 4.87E103
+0b10101110
+0xabcdef02
 
 ----------------------------------------------------
 
@@ -17,7 +19,9 @@
 	["number", "0.5"],
 	["number", ".5"],
 	["number", "4.87e103"],
-	["number", "4.87E103"]
+	["number", "4.87E103"],
+	["number", "0b10101110"],
+	["number", "0xabcdef02"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/aql/string_feature.test b/tests/languages/aql/string_feature.test
index 064c0f0e72..21db276995 100644
--- a/tests/languages/aql/string_feature.test
+++ b/tests/languages/aql/string_feature.test
@@ -10,9 +10,6 @@
 'this is a longer string.'
 'the path separator on Windows is \\'
 
-´filter´
-`sort`
-
 ----------------------------------------------------
 
 [
@@ -21,13 +18,12 @@
 	["string", "\"this is a \\\"quoted\\\" word\""],
 	["string", "\"this is a longer string.\""],
 	["string", "\"the path separator on Windows is \\\\\""],
+
 	["string", "'yikes!'"],
 	["string", "'don\\'t know'"],
 	["string", "'this is a \"quoted\" word'"],
 	["string", "'this is a longer string.'"],
-	["string", "'the path separator on Windows is \\\\'"],
-	["string", "´filter´"],
-	["string", "`sort`"]
+	["string", "'the path separator on Windows is \\\\'"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/arduino/builtin_feature.test b/tests/languages/arduino/builtin_feature.test
new file mode 100644
index 0000000000..29bf7785b7
--- /dev/null
+++ b/tests/languages/arduino/builtin_feature.test
@@ -0,0 +1,667 @@
+KeyboardController
+MouseController
+SoftwareSerial
+EthernetServer
+EthernetClient
+LiquidCrystal
+LiquidCrystal_I2C
+RobotControl
+GSMVoiceCall
+EthernetUDP
+EsploraTFT
+HttpClient
+RobotMotor
+WiFiClient
+GSMScanner
+FileSystem
+Scheduler
+GSMServer
+YunClient
+YunServer
+IPAddress
+GSMClient
+GSMModem
+Keyboard
+Ethernet
+Console
+GSMBand
+Esplora
+Stepper
+Process
+WiFiUDP
+GSM_SMS
+Mailbox
+USBHost
+Firmata
+PImage
+Client
+Server
+GSMPIN
+FileIO
+Bridge
+Serial
+EEPROM
+Stream
+Mouse
+Audio
+Servo
+File
+Task
+GPRS
+WiFi
+Wire
+TFT
+GSM
+SPI
+SD
+runShellCommandAsynchronously
+analogWriteResolution
+retrieveCallingNumber
+printFirmwareVersion
+analogReadResolution
+sendDigitalPortPair
+noListenOnLocalhost
+readJoystickButton
+setFirmwareVersion
+readJoystickSwitch
+scrollDisplayRight
+getVoiceCallStatus
+scrollDisplayLeft
+writeMicroseconds
+delayMicroseconds
+beginTransmission
+getSignalStrength
+runAsynchronously
+getAsynchronously
+listenOnLocalhost
+getCurrentCarrier
+readAccelerometer
+messageAvailable
+sendDigitalPorts
+lineFollowConfig
+countryNameWrite
+runShellCommand
+readStringUntil
+rewindDirectory
+readTemperature
+setClockDivider
+readLightSensor
+endTransmission
+analogReference
+detachInterrupt
+countryNameRead
+attachInterrupt
+encryptionType
+readBytesUntil
+robotNameWrite
+readMicrophone
+robotNameRead
+cityNameWrite
+userNameWrite
+readJoystickY
+readJoystickX
+mouseReleased
+openNextFile
+scanNetworks
+noInterrupts
+digitalWrite
+beginSpeaker
+mousePressed
+isActionDone
+mouseDragged
+displayLogos
+noAutoscroll
+addParameter
+remoteNumber
+getModifiers
+keyboardRead
+userNameRead
+waitContinue
+processInput
+parseCommand
+printVersion
+readNetworks
+writeMessage
+blinkVersion
+cityNameRead
+readMessage
+setDataMode
+parsePacket
+isListening
+setBitOrder
+beginPacket
+isDirectory
+motorsWrite
+drawCompass
+digitalRead
+clearScreen
+serialEvent
+rightToLeft
+setTextSize
+leftToRight
+requestFrom
+keyReleased
+compassRead
+analogWrite
+interrupts
+WiFiServer
+disconnect
+playMelody
+parseFloat
+autoscroll
+getPINUsed
+setPINUsed
+setTimeout
+sendAnalog
+readSlider
+analogRead
+beginWrite
+createChar
+motorsStop
+keyPressed
+tempoWrite
+readButton
+subnetMask
+debugPrint
+macAddress
+writeGreen
+randomSeed
+attachGPRS
+readString
+sendString
+remotePort
+releaseAll
+mouseMoved
+background
+getXChange
+getYChange
+answerCall
+getResult
+voiceCall
+endPacket
+constrain
+getSocket
+writeJSON
+getButton
+available
+connected
+findUntil
+readBytes
+exitValue
+readGreen
+writeBlue
+startLoop
+isPressed
+sendSysex
+pauseMode
+gatewayIP
+setCursor
+getOemKey
+tuneWrite
+noDisplay
+loadImage
+switchPIN
+onRequest
+onReceive
+changePIN
+playFile
+noBuffer
+parseInt
+overflow
+checkPIN
+knobRead
+beginTFT
+bitClear
+updateIR
+bitWrite
+position
+writeRGB
+highByte
+writeRed
+setSpeed
+readBlue
+noStroke
+remoteIP
+transfer
+shutdown
+hangCall
+beginSMS
+endWrite
+attached
+maintain
+noCursor
+checkReg
+checkPUK
+shiftOut
+isValid
+shiftIn
+pulseIn
+connect
+println
+localIP
+pinMode
+getIMEI
+display
+noBlink
+process
+getBand
+running
+beginSD
+drawBMP
+lowByte
+setBand
+release
+bitRead
+prepare
+pointTo
+readRed
+setMode
+noFill
+remove
+listen
+stroke
+detach
+attach
+noTone
+exists
+buffer
+height
+bitSet
+circle
+config
+cursor
+random
+IRread
+setDNS
+endSMS
+getKey
+micros
+millis
+begin
+print
+write
+ready
+flush
+width
+isPIN
+blink
+clear
+press
+mkdir
+rmdir
+close
+point
+yield
+image
+BSSID
+click
+delay
+read
+text
+move
+peek
+beep
+rect
+line
+open
+seek
+fill
+size
+turn
+stop
+home
+find
+step
+tone
+sqrt
+RSSI
+SSID
+end
+bit
+tan
+cos
+sin
+pow
+map
+abs
+max
+min
+get
+run
+put
+
+----------------------------------------------------
+
+[
+	["builtin", "KeyboardController"],
+	["builtin", "MouseController"],
+	["builtin", "SoftwareSerial"],
+	["builtin", "EthernetServer"],
+	["builtin", "EthernetClient"],
+	["builtin", "LiquidCrystal"],
+	["builtin", "LiquidCrystal_I2C"],
+	["builtin", "RobotControl"],
+	["builtin", "GSMVoiceCall"],
+	["builtin", "EthernetUDP"],
+	["builtin", "EsploraTFT"],
+	["builtin", "HttpClient"],
+	["builtin", "RobotMotor"],
+	["builtin", "WiFiClient"],
+	["builtin", "GSMScanner"],
+	["builtin", "FileSystem"],
+	["builtin", "Scheduler"],
+	["builtin", "GSMServer"],
+	["builtin", "YunClient"],
+	["builtin", "YunServer"],
+	["builtin", "IPAddress"],
+	["builtin", "GSMClient"],
+	["builtin", "GSMModem"],
+	["builtin", "Keyboard"],
+	["builtin", "Ethernet"],
+	["builtin", "Console"],
+	["builtin", "GSMBand"],
+	["builtin", "Esplora"],
+	["builtin", "Stepper"],
+	["builtin", "Process"],
+	["builtin", "WiFiUDP"],
+	["builtin", "GSM_SMS"],
+	["builtin", "Mailbox"],
+	["builtin", "USBHost"],
+	["builtin", "Firmata"],
+	["builtin", "PImage"],
+	["builtin", "Client"],
+	["builtin", "Server"],
+	["builtin", "GSMPIN"],
+	["builtin", "FileIO"],
+	["builtin", "Bridge"],
+	["builtin", "Serial"],
+	["builtin", "EEPROM"],
+	["builtin", "Stream"],
+	["builtin", "Mouse"],
+	["builtin", "Audio"],
+	["builtin", "Servo"],
+	["builtin", "File"],
+	["builtin", "Task"],
+	["builtin", "GPRS"],
+	["builtin", "WiFi"],
+	["builtin", "Wire"],
+	["builtin", "TFT"],
+	["builtin", "GSM"],
+	["builtin", "SPI"],
+	["builtin", "SD"],
+	["builtin", "runShellCommandAsynchronously"],
+	["builtin", "analogWriteResolution"],
+	["builtin", "retrieveCallingNumber"],
+	["builtin", "printFirmwareVersion"],
+	["builtin", "analogReadResolution"],
+	["builtin", "sendDigitalPortPair"],
+	["builtin", "noListenOnLocalhost"],
+	["builtin", "readJoystickButton"],
+	["builtin", "setFirmwareVersion"],
+	["builtin", "readJoystickSwitch"],
+	["builtin", "scrollDisplayRight"],
+	["builtin", "getVoiceCallStatus"],
+	["builtin", "scrollDisplayLeft"],
+	["builtin", "writeMicroseconds"],
+	["builtin", "delayMicroseconds"],
+	["builtin", "beginTransmission"],
+	["builtin", "getSignalStrength"],
+	["builtin", "runAsynchronously"],
+	["builtin", "getAsynchronously"],
+	["builtin", "listenOnLocalhost"],
+	["builtin", "getCurrentCarrier"],
+	["builtin", "readAccelerometer"],
+	["builtin", "messageAvailable"],
+	["builtin", "sendDigitalPorts"],
+	["builtin", "lineFollowConfig"],
+	["builtin", "countryNameWrite"],
+	["builtin", "runShellCommand"],
+	["builtin", "readStringUntil"],
+	["builtin", "rewindDirectory"],
+	["builtin", "readTemperature"],
+	["builtin", "setClockDivider"],
+	["builtin", "readLightSensor"],
+	["builtin", "endTransmission"],
+	["builtin", "analogReference"],
+	["builtin", "detachInterrupt"],
+	["builtin", "countryNameRead"],
+	["builtin", "attachInterrupt"],
+	["builtin", "encryptionType"],
+	["builtin", "readBytesUntil"],
+	["builtin", "robotNameWrite"],
+	["builtin", "readMicrophone"],
+	["builtin", "robotNameRead"],
+	["builtin", "cityNameWrite"],
+	["builtin", "userNameWrite"],
+	["builtin", "readJoystickY"],
+	["builtin", "readJoystickX"],
+	["builtin", "mouseReleased"],
+	["builtin", "openNextFile"],
+	["builtin", "scanNetworks"],
+	["builtin", "noInterrupts"],
+	["builtin", "digitalWrite"],
+	["builtin", "beginSpeaker"],
+	["builtin", "mousePressed"],
+	["builtin", "isActionDone"],
+	["builtin", "mouseDragged"],
+	["builtin", "displayLogos"],
+	["builtin", "noAutoscroll"],
+	["builtin", "addParameter"],
+	["builtin", "remoteNumber"],
+	["builtin", "getModifiers"],
+	["builtin", "keyboardRead"],
+	["builtin", "userNameRead"],
+	["builtin", "waitContinue"],
+	["builtin", "processInput"],
+	["builtin", "parseCommand"],
+	["builtin", "printVersion"],
+	["builtin", "readNetworks"],
+	["builtin", "writeMessage"],
+	["builtin", "blinkVersion"],
+	["builtin", "cityNameRead"],
+	["builtin", "readMessage"],
+	["builtin", "setDataMode"],
+	["builtin", "parsePacket"],
+	["builtin", "isListening"],
+	["builtin", "setBitOrder"],
+	["builtin", "beginPacket"],
+	["builtin", "isDirectory"],
+	["builtin", "motorsWrite"],
+	["builtin", "drawCompass"],
+	["builtin", "digitalRead"],
+	["builtin", "clearScreen"],
+	["builtin", "serialEvent"],
+	["builtin", "rightToLeft"],
+	["builtin", "setTextSize"],
+	["builtin", "leftToRight"],
+	["builtin", "requestFrom"],
+	["builtin", "keyReleased"],
+	["builtin", "compassRead"],
+	["builtin", "analogWrite"],
+	["builtin", "interrupts"],
+	["builtin", "WiFiServer"],
+	["builtin", "disconnect"],
+	["builtin", "playMelody"],
+	["builtin", "parseFloat"],
+	["builtin", "autoscroll"],
+	["builtin", "getPINUsed"],
+	["builtin", "setPINUsed"],
+	["builtin", "setTimeout"],
+	["builtin", "sendAnalog"],
+	["builtin", "readSlider"],
+	["builtin", "analogRead"],
+	["builtin", "beginWrite"],
+	["builtin", "createChar"],
+	["builtin", "motorsStop"],
+	["builtin", "keyPressed"],
+	["builtin", "tempoWrite"],
+	["builtin", "readButton"],
+	["builtin", "subnetMask"],
+	["builtin", "debugPrint"],
+	["builtin", "macAddress"],
+	["builtin", "writeGreen"],
+	["builtin", "randomSeed"],
+	["builtin", "attachGPRS"],
+	["builtin", "readString"],
+	["builtin", "sendString"],
+	["builtin", "remotePort"],
+	["builtin", "releaseAll"],
+	["builtin", "mouseMoved"],
+	["builtin", "background"],
+	["builtin", "getXChange"],
+	["builtin", "getYChange"],
+	["builtin", "answerCall"],
+	["builtin", "getResult"],
+	["builtin", "voiceCall"],
+	["builtin", "endPacket"],
+	["builtin", "constrain"],
+	["builtin", "getSocket"],
+	["builtin", "writeJSON"],
+	["builtin", "getButton"],
+	["builtin", "available"],
+	["builtin", "connected"],
+	["builtin", "findUntil"],
+	["builtin", "readBytes"],
+	["builtin", "exitValue"],
+	["builtin", "readGreen"],
+	["builtin", "writeBlue"],
+	["builtin", "startLoop"],
+	["builtin", "isPressed"],
+	["builtin", "sendSysex"],
+	["builtin", "pauseMode"],
+	["builtin", "gatewayIP"],
+	["builtin", "setCursor"],
+	["builtin", "getOemKey"],
+	["builtin", "tuneWrite"],
+	["builtin", "noDisplay"],
+	["builtin", "loadImage"],
+	["builtin", "switchPIN"],
+	["builtin", "onRequest"],
+	["builtin", "onReceive"],
+	["builtin", "changePIN"],
+	["builtin", "playFile"],
+	["builtin", "noBuffer"],
+	["builtin", "parseInt"],
+	["builtin", "overflow"],
+	["builtin", "checkPIN"],
+	["builtin", "knobRead"],
+	["builtin", "beginTFT"],
+	["builtin", "bitClear"],
+	["builtin", "updateIR"],
+	["builtin", "bitWrite"],
+	["builtin", "position"],
+	["builtin", "writeRGB"],
+	["builtin", "highByte"],
+	["builtin", "writeRed"],
+	["builtin", "setSpeed"],
+	["builtin", "readBlue"],
+	["builtin", "noStroke"],
+	["builtin", "remoteIP"],
+	["builtin", "transfer"],
+	["builtin", "shutdown"],
+	["builtin", "hangCall"],
+	["builtin", "beginSMS"],
+	["builtin", "endWrite"],
+	["builtin", "attached"],
+	["builtin", "maintain"],
+	["builtin", "noCursor"],
+	["builtin", "checkReg"],
+	["builtin", "checkPUK"],
+	["builtin", "shiftOut"],
+	["builtin", "isValid"],
+	["builtin", "shiftIn"],
+	["builtin", "pulseIn"],
+	["builtin", "connect"],
+	["builtin", "println"],
+	["builtin", "localIP"],
+	["builtin", "pinMode"],
+	["builtin", "getIMEI"],
+	["builtin", "display"],
+	["builtin", "noBlink"],
+	["builtin", "process"],
+	["builtin", "getBand"],
+	["builtin", "running"],
+	["builtin", "beginSD"],
+	["builtin", "drawBMP"],
+	["builtin", "lowByte"],
+	["builtin", "setBand"],
+	["builtin", "release"],
+	["builtin", "bitRead"],
+	["builtin", "prepare"],
+	["builtin", "pointTo"],
+	["builtin", "readRed"],
+	["builtin", "setMode"],
+	["builtin", "noFill"],
+	["builtin", "remove"],
+	["builtin", "listen"],
+	["builtin", "stroke"],
+	["builtin", "detach"],
+	["builtin", "attach"],
+	["builtin", "noTone"],
+	["builtin", "exists"],
+	["builtin", "buffer"],
+	["builtin", "height"],
+	["builtin", "bitSet"],
+	["builtin", "circle"],
+	["builtin", "config"],
+	["builtin", "cursor"],
+	["builtin", "random"],
+	["builtin", "IRread"],
+	["builtin", "setDNS"],
+	["builtin", "endSMS"],
+	["builtin", "getKey"],
+	["builtin", "micros"],
+	["builtin", "millis"],
+	["builtin", "begin"],
+	["builtin", "print"],
+	["builtin", "write"],
+	["builtin", "ready"],
+	["builtin", "flush"],
+	["builtin", "width"],
+	["builtin", "isPIN"],
+	["builtin", "blink"],
+	["builtin", "clear"],
+	["builtin", "press"],
+	["builtin", "mkdir"],
+	["builtin", "rmdir"],
+	["builtin", "close"],
+	["builtin", "point"],
+	["builtin", "yield"],
+	["builtin", "image"],
+	["builtin", "BSSID"],
+	["builtin", "click"],
+	["builtin", "delay"],
+	["builtin", "read"],
+	["builtin", "text"],
+	["builtin", "move"],
+	["builtin", "peek"],
+	["builtin", "beep"],
+	["builtin", "rect"],
+	["builtin", "line"],
+	["builtin", "open"],
+	["builtin", "seek"],
+	["builtin", "fill"],
+	["builtin", "size"],
+	["builtin", "turn"],
+	["builtin", "stop"],
+	["builtin", "home"],
+	["builtin", "find"],
+	["builtin", "step"],
+	["builtin", "tone"],
+	["builtin", "sqrt"],
+	["builtin", "RSSI"],
+	["builtin", "SSID"],
+	["builtin", "end"],
+	["builtin", "bit"],
+	["builtin", "tan"],
+	["builtin", "cos"],
+	["builtin", "sin"],
+	["builtin", "pow"],
+	["builtin", "map"],
+	["builtin", "abs"],
+	["builtin", "max"],
+	["builtin", "min"],
+	["builtin", "get"],
+	["builtin", "run"],
+	["builtin", "put"]
+]
diff --git a/tests/languages/arduino/constant_feature.test b/tests/languages/arduino/constant_feature.test
new file mode 100644
index 0000000000..ea33346ac5
--- /dev/null
+++ b/tests/languages/arduino/constant_feature.test
@@ -0,0 +1,43 @@
+DIGITAL_MESSAGE
+FIRMATA_STRING
+ANALOG_MESSAGE
+REPORT_DIGITAL
+REPORT_ANALOG
+INPUT_PULLUP
+SET_PIN_MODE
+INTERNAL2V56
+SYSTEM_RESET
+LED_BUILTIN
+INTERNAL1V1
+SYSEX_START
+INTERNAL
+EXTERNAL
+DEFAULT
+OUTPUT
+INPUT
+HIGH
+LOW
+
+----------------------------------------------------
+
+[
+	["constant", "DIGITAL_MESSAGE"],
+	["constant", "FIRMATA_STRING"],
+	["constant", "ANALOG_MESSAGE"],
+	["constant", "REPORT_DIGITAL"],
+	["constant", "REPORT_ANALOG"],
+	["constant", "INPUT_PULLUP"],
+	["constant", "SET_PIN_MODE"],
+	["constant", "INTERNAL2V56"],
+	["constant", "SYSTEM_RESET"],
+	["constant", "LED_BUILTIN"],
+	["constant", "INTERNAL1V1"],
+	["constant", "SYSEX_START"],
+	["constant", "INTERNAL"],
+	["constant", "EXTERNAL"],
+	["constant", "DEFAULT"],
+	["constant", "OUTPUT"],
+	["constant", "INPUT"],
+	["constant", "HIGH"],
+	["constant", "LOW"]
+]
diff --git a/tests/languages/arduino/keyword_feature.test b/tests/languages/arduino/keyword_feature.test
new file mode 100644
index 0000000000..7b44538984
--- /dev/null
+++ b/tests/languages/arduino/keyword_feature.test
@@ -0,0 +1,75 @@
+setup
+if
+else
+while
+do
+for
+return
+in
+instanceof
+default
+function
+loop
+goto
+switch
+case
+new
+try
+throw
+catch
+finally
+null
+break
+continue
+boolean
+bool
+void
+byte
+word
+string
+String
+array
+int
+long
+integer
+double
+
+----------------------------------------------------
+
+[
+	["keyword", "setup"],
+	["keyword", "if"],
+	["keyword", "else"],
+	["keyword", "while"],
+	["keyword", "do"],
+	["keyword", "for"],
+	["keyword", "return"],
+	["keyword", "in"],
+	["keyword", "instanceof"],
+	["keyword", "default"],
+	["keyword", "function"],
+	["keyword", "loop"],
+	["keyword", "goto"],
+	["keyword", "switch"],
+	["keyword", "case"],
+	["keyword", "new"],
+	["keyword", "try"],
+	["keyword", "throw"],
+	["keyword", "catch"],
+	["keyword", "finally"],
+	["keyword", "null"],
+	["keyword", "break"],
+	["keyword", "continue"],
+	["keyword", "boolean"],
+	["keyword", "bool"],
+	["keyword", "void"],
+	["keyword", "byte"],
+	["keyword", "word"],
+	["keyword", "string"],
+	["keyword", "String"],
+	["keyword", "array"],
+	["keyword", "int"],
+	["keyword", "long"],
+	["keyword", "integer"],
+	["keyword", "double"]
+]
diff --git a/tests/languages/asciidoc/entity_feature.html.test b/tests/languages/asciidoc/entity_feature.html.test
new file mode 100644
index 0000000000..6d21274793
--- /dev/null
+++ b/tests/languages/asciidoc/entity_feature.html.test
@@ -0,0 +1,7 @@
+➊
+¶
+
+----------------------------------------------------
+
+&#x278a;
+&#182;
diff --git a/tests/languages/asciidoc/entity_feature.js b/tests/languages/asciidoc/entity_feature.js
deleted file mode 100644
index 2e99cd10ef..0000000000
--- a/tests/languages/asciidoc/entity_feature.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = {
-	'➊': '&#x278a;',
-	'¶': '&#182;'
-};
\ No newline at end of file
diff --git a/tests/languages/asm6502/number_feature.test b/tests/languages/asm6502/number_feature.test
index 55262f67bd..7b5fd3b020 100644
--- a/tests/languages/asm6502/number_feature.test
+++ b/tests/languages/asm6502/number_feature.test
@@ -1,18 +1,17 @@
 LDA #127
 STA $8000
+STA #$1
 LDX #%10001010
 
--------------------------
+----------------------------------------------------
 
 [
-  ["opcode", "LDA"],
-  ["decimalnumber", "#127"],
-  ["opcode", "STA"],
-  ["hexnumber", "$8000"],
-  ["opcode", "LDX"],
-  ["binarynumber", "#%10001010"]
+	["op-code", "LDA"], ["decimal-number", "#127"],
+	["op-code", "STA"], ["hex-number", "$8000"],
+	["op-code", "STA"], ["hex-number", "#$1"],
+	["op-code", "LDX"], ["binary-number", "#%10001010"]
 ]
 
--------------------------
+----------------------------------------------------
 
 Check for numbers
diff --git a/tests/languages/asm6502/opcode_feature.test b/tests/languages/asm6502/opcode_feature.test
index 75e7b42806..178d0179d6 100644
--- a/tests/languages/asm6502/opcode_feature.test
+++ b/tests/languages/asm6502/opcode_feature.test
@@ -1,17 +1,233 @@
-LDA
-BNE
-inx
+adc
+and
+asl
+bcc
+bcs
+beq
+bit
+bmi
+bne
+bpl
+brk
+bvc
+bvs
 clc
+cld
+cli
+clv
+cmp
+cpx
+cpy
+dec
+dex
+dey
+eor
+inc
+inx
+iny
+jmp
+jsr
+lda
+ldx
+ldy
+lsr
+nop
+ora
+pha
+php
+pla
+plp
+rol
+ror
+rti
+rts
+sbc
+sec
+sed
+sei
+sta
+stx
+sty
+tax
+tay
+tsx
+txa
+txs
+tya
+ADC
+AND
+ASL
+BCC
+BCS
+BEQ
+BIT
+BMI
+BNE
+BPL
+BRK
+BVC
+BVS
+CLC
+CLD
+CLI
+CLV
+CMP
+CPX
+CPY
+DEC
+DEX
+DEY
+EOR
+INC
+INX
+INY
+JMP
+JSR
+LDA
+LDX
+LDY
+LSR
+NOP
+ORA
+PHA
+PHP
+PLA
+PLP
+ROL
+ROR
+RTI
+RTS
+SBC
+SEC
+SED
+SEI
+STA
+STX
+STY
+TAX
+TAY
+TSX
+TXA
+TXS
+TYA
 
--------------------------------------
+----------------------------------------------------
 
 [
-  ["opcode", "LDA"],
-  ["opcode", "BNE"],
-  ["opcode", "inx"],
-  ["opcode", "clc"]
+	["op-code", "adc"],
+	["op-code", "and"],
+	["op-code", "asl"],
+	["op-code", "bcc"],
+	["op-code", "bcs"],
+	["op-code", "beq"],
+	["op-code", "bit"],
+	["op-code", "bmi"],
+	["op-code", "bne"],
+	["op-code", "bpl"],
+	["op-code", "brk"],
+	["op-code", "bvc"],
+	["op-code", "bvs"],
+	["op-code", "clc"],
+	["op-code", "cld"],
+	["op-code", "cli"],
+	["op-code", "clv"],
+	["op-code", "cmp"],
+	["op-code", "cpx"],
+	["op-code", "cpy"],
+	["op-code", "dec"],
+	["op-code", "dex"],
+	["op-code", "dey"],
+	["op-code", "eor"],
+	["op-code", "inc"],
+	["op-code", "inx"],
+	["op-code", "iny"],
+	["op-code", "jmp"],
+	["op-code", "jsr"],
+	["op-code", "lda"],
+	["op-code", "ldx"],
+	["op-code", "ldy"],
+	["op-code", "lsr"],
+	["op-code", "nop"],
+	["op-code", "ora"],
+	["op-code", "pha"],
+	["op-code", "php"],
+	["op-code", "pla"],
+	["op-code", "plp"],
+	["op-code", "rol"],
+	["op-code", "ror"],
+	["op-code", "rti"],
+	["op-code", "rts"],
+	["op-code", "sbc"],
+	["op-code", "sec"],
+	["op-code", "sed"],
+	["op-code", "sei"],
+	["op-code", "sta"],
+	["op-code", "stx"],
+	["op-code", "sty"],
+	["op-code", "tax"],
+	["op-code", "tay"],
+	["op-code", "tsx"],
+	["op-code", "txa"],
+	["op-code", "txs"],
+	["op-code", "tya"],
+	["op-code", "ADC"],
+	["op-code", "AND"],
+	["op-code", "ASL"],
+	["op-code", "BCC"],
+	["op-code", "BCS"],
+	["op-code", "BEQ"],
+	["op-code", "BIT"],
+	["op-code", "BMI"],
+	["op-code", "BNE"],
+	["op-code", "BPL"],
+	["op-code", "BRK"],
+	["op-code", "BVC"],
+	["op-code", "BVS"],
+	["op-code", "CLC"],
+	["op-code", "CLD"],
+	["op-code", "CLI"],
+	["op-code", "CLV"],
+	["op-code", "CMP"],
+	["op-code", "CPX"],
+	["op-code", "CPY"],
+	["op-code", "DEC"],
+	["op-code", "DEX"],
+	["op-code", "DEY"],
+	["op-code", "EOR"],
+	["op-code", "INC"],
+	["op-code", "INX"],
+	["op-code", "INY"],
+	["op-code", "JMP"],
+	["op-code", "JSR"],
+	["op-code", "LDA"],
+	["op-code", "LDX"],
+	["op-code", "LDY"],
+	["op-code", "LSR"],
+	["op-code", "NOP"],
+	["op-code", "ORA"],
+	["op-code", "PHA"],
+	["op-code", "PHP"],
+	["op-code", "PLA"],
+	["op-code", "PLP"],
+	["op-code", "ROL"],
+	["op-code", "ROR"],
+	["op-code", "RTI"],
+	["op-code", "RTS"],
+	["op-code", "SBC"],
+	["op-code", "SEC"],
+	["op-code", "SED"],
+	["op-code", "SEI"],
+	["op-code", "STA"],
+	["op-code", "STX"],
+	["op-code", "STY"],
+	["op-code", "TAX"],
+	["op-code", "TAY"],
+	["op-code", "TSX"],
+	["op-code", "TXA"],
+	["op-code", "TXS"],
+	["op-code", "TYA"]
 ]
 
--------------------------------------
+----------------------------------------------------
 
 Check for opcodes
diff --git a/tests/languages/asm6502/punctuation_feature.test b/tests/languages/asm6502/punctuation_feature.test
new file mode 100644
index 0000000000..b0a75ee6f6
--- /dev/null
+++ b/tests/languages/asm6502/punctuation_feature.test
@@ -0,0 +1,10 @@
+( ) , :
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ","],
+	["punctuation", ":"]
+]
diff --git a/tests/languages/asm6502/register_feature.test b/tests/languages/asm6502/register_feature.test
index 91ec7c42be..10002bedc0 100644
--- a/tests/languages/asm6502/register_feature.test
+++ b/tests/languages/asm6502/register_feature.test
@@ -1,17 +1,18 @@
 LDA $8000,x
 ASL A
 
--------------------------
+----------------------------------------------------
 
 [
-  ["opcode", "LDA"],
-  ["hexnumber", "$8000"],
-  ",",
-  ["register", "x"],
-  ["opcode", "ASL"],
-  ["register", "A"]
+	["op-code", "LDA"],
+	["hex-number", "$8000"],
+	["punctuation", ","],
+	["register", "x"],
+
+	["op-code", "ASL"],
+	["register", "A"]
 ]
 
--------------------------
+----------------------------------------------------
 
 Check for registers
diff --git a/tests/languages/ocaml/module_feature.test b/tests/languages/asmatmel/comment_feature.test
similarity index 53%
rename from tests/languages/ocaml/module_feature.test
rename to tests/languages/asmatmel/comment_feature.test
index 006d259e48..1d5bc02c8a 100644
--- a/tests/languages/ocaml/module_feature.test
+++ b/tests/languages/asmatmel/comment_feature.test
@@ -1,15 +1,13 @@
-Foo
-Bar42
-Baz_42
+;
+; foo bar baz
 
 ----------------------------------------------------
 
 [
-	["module", "Foo"],
-	["module", "Bar42"],
-	["module", "Baz_42"]
+	["comment", ";"],
+	["comment", "; foo bar baz"]
 ]
 
 ----------------------------------------------------
 
-Checks for modules.
\ No newline at end of file
+Check for comments
diff --git a/tests/languages/asmatmel/constant_feature.test b/tests/languages/asmatmel/constant_feature.test
new file mode 100644
index 0000000000..9ed01f0b4f
--- /dev/null
+++ b/tests/languages/asmatmel/constant_feature.test
@@ -0,0 +1,70 @@
+OUT PORTD,x
+ldi r17,PD06
+ldi	r19,(1< {"a":2}
+
+NormalLabel:
+; do something
+return
+	TabbedLabel:
+	; do something
+	return
+Sus{}//[]Label:
+; do something
+return
+
+----------------------------------------------------
+
+[
+	"A",
+	["operator", "."],
+	["function", "invert"],
+	["punctuation", "("],
+	["punctuation", "{"],
+	["number", "1"],
+	["punctuation", ":"],
+	["string", "\"a\""],
+	["punctuation", ","],
+	["number", "2"],
+	["punctuation", ":"],
+	["string", "\"A\""],
+	["punctuation", "}"],
+	["punctuation", ")"],
+
+	["comment", "; => {\"a\":2}"],
+
+	["tag", "NormalLabel"], ["punctuation", ":"],
+	["comment", "; do something"],
+	["selector", "return"],
+	["tag", "TabbedLabel"], ["punctuation", ":"],
+	["comment", "; do something"],
+	["selector", "return"],
+	["tag", "Sus{}//[]Label"], ["punctuation", ":"],
+	["comment", "; do something"],
+	["selector", "return"]
+]
diff --git a/tests/languages/autohotkey/tag_feature.test b/tests/languages/autohotkey/tag_feature.test
index 0ca92589e4..72097a166e 100644
--- a/tests/languages/autohotkey/tag_feature.test
+++ b/tests/languages/autohotkey/tag_feature.test
@@ -1,15 +1,25 @@
 foo:
 foo_bar:
 
+validLabel: ; a comment
+/* multiline comment
+*/ validLabel:
+
 ----------------------------------------------------
 
 [
-	["tag", "foo"],
+	["tag", "foo"], ["punctuation", ":"],
+	["tag", "foo_bar"], ["punctuation", ":"],
+
+	["tag", "validLabel"],
 	["punctuation", ":"],
-	["tag", "foo_bar"],
+	["comment", "; a comment"],
+
+	["comment", "/* multiline comment\r\n*/"],
+	["tag", "validLabel"],
 	["punctuation", ":"]
 ]
 
 ----------------------------------------------------
 
-Checks for tags (labels).
\ No newline at end of file
+Checks for tags (labels).
diff --git a/tests/languages/autoit/directive_feature.test b/tests/languages/autoit/directive_feature.test
index 9219f700a0..af7e4ece85 100644
--- a/tests/languages/autoit/directive_feature.test
+++ b/tests/languages/autoit/directive_feature.test
@@ -1,13 +1,17 @@
 #NoTrayIcon
 #OnAutoItStartRegister "Example"
+#include-once
+#include 
 
 ----------------------------------------------------
 
 [
 	["directive", "#NoTrayIcon"],
-	["directive", "#OnAutoItStartRegister"], ["string", ["\"Example\""]]
+	["directive", "#OnAutoItStartRegister"], ["string", ["\"Example\""]],
+	["directive", "#include-once"],
+	["directive", "#include"], ["url", ""]
 ]
 
 ----------------------------------------------------
 
-Checks for directives.
\ No newline at end of file
+Checks for directives.
diff --git a/tests/languages/avisynth/clipproperties_feature.test b/tests/languages/avisynth/clipproperties_feature.test
new file mode 100644
index 0000000000..d4335a2e5b
--- /dev/null
+++ b/tests/languages/avisynth/clipproperties_feature.test
@@ -0,0 +1,117 @@
+hasaudio
+hasvideo
+width
+height
+framecount
+framerate
+frameratenumerator
+frameratedenominator
+isfieldbased
+isframebased
+getparity
+
+pixeltype
+isplanar
+isinterleaved
+isrgb
+isrgb24
+isrgb32
+isyuv
+isyuy2
+isy8
+isyv12
+isyv16
+isyv24
+isyv411
+is420
+is422
+is444
+isy
+isyuva
+isrgb48
+isrgb64
+ispackedrgb
+isplanarrgb
+isplanarrgba
+hasalpha
+componentsize
+numcomponents
+bitspercomponent
+
+audiorate
+audioduration
+audiolength
+audiolengthf
+audiolengths
+audiolengthlo
+audiolengthhi
+audiochannels
+audiobits
+isaudiofloat
+isaudioint
+
+xyzisaudiointxyz
+
+----------------------------------------------------
+
+[
+	["builtin-function", "hasaudio"],
+	["builtin-function", "hasvideo"],
+	["builtin-function", "width"],
+	["builtin-function", "height"],
+	["builtin-function", "framecount"],
+	["builtin-function", "framerate"],
+	["builtin-function", "frameratenumerator"],
+	["builtin-function", "frameratedenominator"],
+	["builtin-function", "isfieldbased"],
+	["builtin-function", "isframebased"],
+	["builtin-function", "getparity"],
+
+	["builtin-function", "pixeltype"],
+	["builtin-function", "isplanar"],
+	["builtin-function", "isinterleaved"],
+	["builtin-function", "isrgb"],
+	["builtin-function", "isrgb24"],
+	["builtin-function", "isrgb32"],
+	["builtin-function", "isyuv"],
+	["builtin-function", "isyuy2"],
+	["builtin-function", "isy8"],
+	["builtin-function", "isyv12"],
+	["builtin-function", "isyv16"],
+	["builtin-function", "isyv24"],
+	["builtin-function", "isyv411"],
+	["builtin-function", "is420"],
+	["builtin-function", "is422"],
+	["builtin-function", "is444"],
+	["builtin-function", "isy"],
+	["builtin-function", "isyuva"],
+	["builtin-function", "isrgb48"],
+	["builtin-function", "isrgb64"],
+	["builtin-function", "ispackedrgb"],
+	["builtin-function", "isplanarrgb"],
+	["builtin-function", "isplanarrgba"],
+	["builtin-function", "hasalpha"],
+	["builtin-function", "componentsize"],
+	["builtin-function", "numcomponents"],
+	["builtin-function", "bitspercomponent"],
+
+	["builtin-function", "audiorate"],
+	["builtin-function", "audioduration"],
+	["builtin-function", "audiolength"],
+	["builtin-function", "audiolengthf"],
+	["builtin-function", "audiolengths"],
+	["builtin-function", "audiolengthlo"],
+	["builtin-function", "audiolengthhi"],
+	["builtin-function", "audiochannels"],
+	["builtin-function", "audiobits"],
+	["builtin-function", "isaudiofloat"],
+	["builtin-function", "isaudioint"],
+
+	"\r\n\r\nxyzisaudiointxyz"
+]
+
+----------------------------------------------------
+
+All internal functions, filters, and properties can be used in the following formats:
+intFunc == intFunc() == last.intFunc == last.intFunc()
+They must not appear within other words.
diff --git a/tests/languages/avisynth/comments_strings_predefines_feature.test b/tests/languages/avisynth/comments_strings_predefines_feature.test
new file mode 100644
index 0000000000..b6575acf5d
--- /dev/null
+++ b/tests/languages/avisynth/comments_strings_predefines_feature.test
@@ -0,0 +1,131 @@
+[* comment [* global *] DEFAULT_MT_MODE *]
+
+notacomment
+
+/* comment
+global "a string"
+DEFAULT_MT_MODE */
+
+notacomment
+
+# comment global DEFAULT_MT_MODE
+
+notacomment
+
+"a simple string"
+
+"""a
+complex
+string"""
+
+"DEFAULT_MT_MODE"
+"SCRIPTDIR"
+"MAINSCRIPTDIR"
+"PROGRAMDIR"
+"USER_PLUS_PLUGINS"
+"MACHINE_PLUS_PLUGINS"
+"USER_CLASSIC_PLUGINS"
+"MACHINE_CLASSIC_PLUGINS"
+
+"default_mt_mode"
+"scriptdir"
+"mainscriptdir"
+"programdir"
+"user_plus_plugins"
+"machine_plus_plugins"
+"user_classic_plugins"
+"machine_classic_plugins"
+
+DEFAULT_MT_MODE
+# SCRIPTDIR is also an internal function
+MAINSCRIPTDIR
+PROGRAMDIR
+USER_PLUS_PLUGINS
+MACHINE_PLUS_PLUGINS
+USER_CLASSIC_PLUGINS
+MACHINE_CLASSIC_PLUGINS
+
+----------------------------------------------------
+
+[
+	["comment", "[* comment [* global *] DEFAULT_MT_MODE *]"],
+
+	"\r\n\r\nnotacomment\r\n\r\n",
+
+	["comment", "/* comment\r\nglobal \"a string\"\r\nDEFAULT_MT_MODE */"],
+
+	"\r\n\r\nnotacomment\r\n\r\n",
+
+	["comment", "# comment global DEFAULT_MT_MODE"],
+
+	"\r\n\r\nnotacomment\r\n\r\n",
+
+	["string", ["\"a simple string\""]],
+
+	["string", "\"\"\"a\r\ncomplex\r\nstring\"\"\""],
+
+	["string", [
+		"\"",
+		["constant", "DEFAULT_MT_MODE"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "SCRIPTDIR"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "MAINSCRIPTDIR"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "PROGRAMDIR"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "USER_PLUS_PLUGINS"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "MACHINE_PLUS_PLUGINS"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "USER_CLASSIC_PLUGINS"],
+		"\""
+	]],
+	["string", [
+		"\"",
+		["constant", "MACHINE_CLASSIC_PLUGINS"],
+		"\""
+	]],
+
+	["string", ["\"default_mt_mode\""]],
+	["string", ["\"scriptdir\""]],
+	["string", ["\"mainscriptdir\""]],
+	["string", ["\"programdir\""]],
+	["string", ["\"user_plus_plugins\""]],
+	["string", ["\"machine_plus_plugins\""]],
+	["string", ["\"user_classic_plugins\""]],
+	["string", ["\"machine_classic_plugins\""]],
+
+	"\r\n\r\nDEFAULT_MT_MODE\r\n",
+	["comment", "# SCRIPTDIR is also an internal function"],
+	"\r\nMAINSCRIPTDIR\r\nPROGRAMDIR\r\nUSER_PLUS_PLUGINS\r\nMACHINE_PLUS_PLUGINS\r\nUSER_CLASSIC_PLUGINS\r\nMACHINE_CLASSIC_PLUGINS"
+]
+
+----------------------------------------------------
+
+Block comments should not allow any other tokens within them, and should work over multiple lines.
+Single line comments are the same, but just one line.
+Known issue: square bracket block comments can be nested, but regular languages can't do that.
+
+Single line strings should be surrounded by double quotes, and allow no tokens within them except for predefined symbols.
+Triple quote strings can span multiple lines and allow no tokens within them.
+
+Predefined symbols must appear within single line strings. They are case sensitive.
diff --git a/tests/languages/avisynth/intenalfuncs_feature.test b/tests/languages/avisynth/intenalfuncs_feature.test
new file mode 100644
index 0000000000..730e9f557f
--- /dev/null
+++ b/tests/languages/avisynth/intenalfuncs_feature.test
@@ -0,0 +1,391 @@
+isbool
+isclip
+isfloat
+isint
+isstring
+exist
+defined
+functionexists
+internalfunctionexists
+varexist
+
+apply
+eval
+import
+select
+default
+assert
+nop
+undefined
+
+setmemorymax
+setcachemode
+setmaxcpu
+setworkingdir
+setplanarlegacyalignment
+opt_allowfloataudio
+opt_usewaveextensible
+opt_dwchannelmask
+opt_avipadscanlines
+opt_vdubplanarhack
+opt_enable_v210
+opt_enable_y3_10_10
+opt_enable_y3_10_16
+opt_enable_b64a
+opt_enable_planartopackedrgb
+
+value
+hexvalue
+hex
+
+max
+min
+muldiv
+floor
+ceil
+round
+fmod
+pi
+exp
+log
+log10
+pow
+sqrt
+abs
+sign
+frac
+rand
+spline
+continuednumerator
+continueddenominator
+
+sin
+cos
+tan
+asin
+acos
+atan
+atan2
+sinh
+cosh
+tanh
+
+bitand
+bitnot
+bitor
+bitxor
+bitlshift
+bitshl
+bitsal
+bitrshifta
+bitrshifts
+bitsar
+bitrshiftl
+bitrshiftu
+bitshr
+bitlrotate
+bitrol
+bitrrotatel
+bitror
+bittest
+bittst
+bitset
+bitsetcount
+bitclear
+bitclr
+bitchange
+bitchg
+
+averageluma
+averagechromau
+averagechromav
+averageb
+averageg
+averager
+lumadifference
+chromaudifference
+chromavdifference
+rgbdifference
+bdifference
+gdifference
+rdifference
+ydifferencefromprevious
+udifferencefromprevious
+vdifferencefromprevious
+rgbdifferencefromprevious
+bdifferencefromprevious
+gdifferencefromprevious
+rdifferencefromprevious
+ydifferencetonext
+udifferencetonext
+vdifferencetonext
+rgbdifferencetonext
+rdifferencetonext
+gdifferencetonext
+bdifferencetonext
+yplanemedian
+uplanemedian
+vplanemedian
+bplanemedian
+gplanemedian
+rplanemedian
+yplanemin
+uplanemin
+vplanemin
+bplanemin
+gplanemin
+rplanemin
+yplanemax
+uplanemax
+vplanemax
+bplanemax
+gplanemax
+rplanemax
+yplaneminmaxdifference
+uplaneminmaxdifference
+vplaneminmaxdifference
+bplaneminmaxdifference
+gplaneminmaxdifference
+rplaneminmaxdifference
+
+scriptname
+scriptnameutf8
+scriptfile
+scriptfileutf8
+scriptdir
+scriptdirutf8
+setlogparams
+logmsg
+getprocessinfo
+
+lcase
+ucase
+strtoutf8
+strfromutf8
+strlen
+revstr
+leftstr
+rightstr
+midstr
+findstr
+replacestr
+format
+fillstr
+strcmp
+strcmpi
+trimleft
+trimright
+trimall
+chr
+ord
+time
+
+versionnumber
+versionstring
+isversionorgreater
+
+buildpixeltype
+colorspacenametopixeltype
+
+kevincosner
+
+----------------------------------------------------
+
+[
+	["builtin-function", "isbool"],
+	["builtin-function", "isclip"],
+	["builtin-function", "isfloat"],
+	["builtin-function", "isint"],
+	["builtin-function", "isstring"],
+	["builtin-function", "exist"],
+	["builtin-function", "defined"],
+	["builtin-function", "functionexists"],
+	["builtin-function", "internalfunctionexists"],
+	["builtin-function", "varexist"],
+
+	["builtin-function", "apply"],
+	["builtin-function", "eval"],
+	["builtin-function", "import"],
+	["builtin-function", "select"],
+	["builtin-function", "default"],
+	["builtin-function", "assert"],
+	["builtin-function", "nop"],
+	["builtin-function", "undefined"],
+
+	["builtin-function", "setmemorymax"],
+	["builtin-function", "setcachemode"],
+	["builtin-function", "setmaxcpu"],
+	["builtin-function", "setworkingdir"],
+	["builtin-function", "setplanarlegacyalignment"],
+	["builtin-function", "opt_allowfloataudio"],
+	["builtin-function", "opt_usewaveextensible"],
+	["builtin-function", "opt_dwchannelmask"],
+	["builtin-function", "opt_avipadscanlines"],
+	["builtin-function", "opt_vdubplanarhack"],
+	["builtin-function", "opt_enable_v210"],
+	["builtin-function", "opt_enable_y3_10_10"],
+	["builtin-function", "opt_enable_y3_10_16"],
+	["builtin-function", "opt_enable_b64a"],
+	["builtin-function", "opt_enable_planartopackedrgb"],
+
+	["builtin-function", "value"],
+	["builtin-function", "hexvalue"],
+	["builtin-function", "hex"],
+
+	["builtin-function", "max"],
+	["builtin-function", "min"],
+	["builtin-function", "muldiv"],
+	["builtin-function", "floor"],
+	["builtin-function", "ceil"],
+	["builtin-function", "round"],
+	["builtin-function", "fmod"],
+	["builtin-function", "pi"],
+	["builtin-function", "exp"],
+	["builtin-function", "log"],
+	["builtin-function", "log10"],
+	["builtin-function", "pow"],
+	["builtin-function", "sqrt"],
+	["builtin-function", "abs"],
+	["builtin-function", "sign"],
+	["builtin-function", "frac"],
+	["builtin-function", "rand"],
+	["builtin-function", "spline"],
+	["builtin-function", "continuednumerator"],
+	["builtin-function", "continueddenominator"],
+
+	["builtin-function", "sin"],
+	["builtin-function", "cos"],
+	["builtin-function", "tan"],
+	["builtin-function", "asin"],
+	["builtin-function", "acos"],
+	["builtin-function", "atan"],
+	["builtin-function", "atan2"],
+	["builtin-function", "sinh"],
+	["builtin-function", "cosh"],
+	["builtin-function", "tanh"],
+
+	["builtin-function", "bitand"],
+	["builtin-function", "bitnot"],
+	["builtin-function", "bitor"],
+	["builtin-function", "bitxor"],
+	["builtin-function", "bitlshift"],
+	["builtin-function", "bitshl"],
+	["builtin-function", "bitsal"],
+	["builtin-function", "bitrshifta"],
+	["builtin-function", "bitrshifts"],
+	["builtin-function", "bitsar"],
+	["builtin-function", "bitrshiftl"],
+	["builtin-function", "bitrshiftu"],
+	["builtin-function", "bitshr"],
+	["builtin-function", "bitlrotate"],
+	["builtin-function", "bitrol"],
+	["builtin-function", "bitrrotatel"],
+	["builtin-function", "bitror"],
+	["builtin-function", "bittest"],
+	["builtin-function", "bittst"],
+	["builtin-function", "bitset"],
+	["builtin-function", "bitsetcount"],
+	["builtin-function", "bitclear"],
+	["builtin-function", "bitclr"],
+	["builtin-function", "bitchange"],
+	["builtin-function", "bitchg"],
+
+	["builtin-function", "averageluma"],
+	["builtin-function", "averagechromau"],
+	["builtin-function", "averagechromav"],
+	["builtin-function", "averageb"],
+	["builtin-function", "averageg"],
+	["builtin-function", "averager"],
+	["builtin-function", "lumadifference"],
+	["builtin-function", "chromaudifference"],
+	["builtin-function", "chromavdifference"],
+	["builtin-function", "rgbdifference"],
+	["builtin-function", "bdifference"],
+	["builtin-function", "gdifference"],
+	["builtin-function", "rdifference"],
+	["builtin-function", "ydifferencefromprevious"],
+	["builtin-function", "udifferencefromprevious"],
+	["builtin-function", "vdifferencefromprevious"],
+	["builtin-function", "rgbdifferencefromprevious"],
+	["builtin-function", "bdifferencefromprevious"],
+	["builtin-function", "gdifferencefromprevious"],
+	["builtin-function", "rdifferencefromprevious"],
+	["builtin-function", "ydifferencetonext"],
+	["builtin-function", "udifferencetonext"],
+	["builtin-function", "vdifferencetonext"],
+	["builtin-function", "rgbdifferencetonext"],
+	["builtin-function", "rdifferencetonext"],
+	["builtin-function", "gdifferencetonext"],
+	["builtin-function", "bdifferencetonext"],
+	["builtin-function", "yplanemedian"],
+	["builtin-function", "uplanemedian"],
+	["builtin-function", "vplanemedian"],
+	["builtin-function", "bplanemedian"],
+	["builtin-function", "gplanemedian"],
+	["builtin-function", "rplanemedian"],
+	["builtin-function", "yplanemin"],
+	["builtin-function", "uplanemin"],
+	["builtin-function", "vplanemin"],
+	["builtin-function", "bplanemin"],
+	["builtin-function", "gplanemin"],
+	["builtin-function", "rplanemin"],
+	["builtin-function", "yplanemax"],
+	["builtin-function", "uplanemax"],
+	["builtin-function", "vplanemax"],
+	["builtin-function", "bplanemax"],
+	["builtin-function", "gplanemax"],
+	["builtin-function", "rplanemax"],
+	["builtin-function", "yplaneminmaxdifference"],
+	["builtin-function", "uplaneminmaxdifference"],
+	["builtin-function", "vplaneminmaxdifference"],
+	["builtin-function", "bplaneminmaxdifference"],
+	["builtin-function", "gplaneminmaxdifference"],
+	["builtin-function", "rplaneminmaxdifference"],
+
+	["builtin-function", "scriptname"],
+	["builtin-function", "scriptnameutf8"],
+	["builtin-function", "scriptfile"],
+	["builtin-function", "scriptfileutf8"],
+	["builtin-function", "scriptdir"],
+	["builtin-function", "scriptdirutf8"],
+	["builtin-function", "setlogparams"],
+	["builtin-function", "logmsg"],
+	["builtin-function", "getprocessinfo"],
+
+	["builtin-function", "lcase"],
+	["builtin-function", "ucase"],
+	["builtin-function", "strtoutf8"],
+	["builtin-function", "strfromutf8"],
+	["builtin-function", "strlen"],
+	["builtin-function", "revstr"],
+	["builtin-function", "leftstr"],
+	["builtin-function", "rightstr"],
+	["builtin-function", "midstr"],
+	["builtin-function", "findstr"],
+	["builtin-function", "replacestr"],
+	["builtin-function", "format"],
+	["builtin-function", "fillstr"],
+	["builtin-function", "strcmp"],
+	["builtin-function", "strcmpi"],
+	["builtin-function", "trimleft"],
+	["builtin-function", "trimright"],
+	["builtin-function", "trimall"],
+	["builtin-function", "chr"],
+	["builtin-function", "ord"],
+	["builtin-function", "time"],
+
+	["builtin-function", "versionnumber"],
+	["builtin-function", "versionstring"],
+	["builtin-function", "isversionorgreater"],
+
+	["builtin-function", "buildpixeltype"],
+	["builtin-function", "colorspacenametopixeltype"],
+
+	"\r\n\r\nkevincosner"
+]
+
+----------------------------------------------------
+
+All internal functions, filters, and properties can be used in the following formats:
+intFunc == intFunc() == last.intFunc == last.intFunc()
+They must not appear within other words.
diff --git a/tests/languages/avisynth/internalfilters_feature.test b/tests/languages/avisynth/internalfilters_feature.test
new file mode 100644
index 0000000000..375da954a8
--- /dev/null
+++ b/tests/languages/avisynth/internalfilters_feature.test
@@ -0,0 +1,429 @@
+avisource
+avifilesource
+opendmlsource
+directshowsource
+imagereader
+imagesource
+imagesourceanim
+segmentedavisource
+segmenteddirectshowsource
+wavsource
+
+coloryuv
+convertbacktoyuy2
+converttorgb
+converttorgb24
+converttorgb32
+converttorgb48
+converttorgb64
+converttoplanarrgb
+converttoplanarrgba
+converttoyuy2
+converttoyv24
+converttoyv16
+converttoyv12
+converttoy8
+converttoyuv444
+converttoyuv422
+converttoyuv420
+converttoyuva444
+converttoyuva422
+converttoyuva420
+converttoyuv411
+fixluminance
+greyscale
+grayscale
+invert
+levels
+limiter
+mergergb
+mergeargb
+mergeluma
+mergechroma
+rgbadjust
+showred
+showgreen
+showblue
+showalpha
+swapuv
+tweak
+utoy
+utoy8
+vtoy
+vtoy8
+ytouv
+
+colorkeymask
+layer
+mask
+maskhs
+merge
+overlay
+resetmask
+subtract
+
+addborders
+crop
+cropbottom
+fliphorizontal
+flipvertical
+letterbox
+horizontalreduceby2
+verticalreduceby2
+reduceby2
+bicubicresize
+bilinearresize
+blackmanresize
+gaussresize
+lanczosresize
+lanczos4resize
+pointresize
+sincresize
+spline16resize
+spline36resize
+spline64resize
+
+skewrows
+turnleft
+turnright
+turn180
+
+blur
+sharpen
+generalconvolution
+spatialsoften
+temporalsoften
+fixbrokenchromaupsampling
+
+alignedsplice
+unalignedsplice
+assumefps
+assumescaledfps
+changefps
+convertfps
+deleteframe
+dissolve
+duplicateframe
+fadein0
+fadein
+fadein2
+fadeout0
+fadeout
+fadeout2
+fadeio0
+fadeio
+fadeio2
+freezeframe
+interleave
+loop
+reverse
+selecteven
+selectodd
+selectevery
+selectrangeevery
+trim
+
+assumeframebased
+assumefieldbased
+assumebff
+assumetff
+bob
+complementparity
+doubleweave
+peculiarblend
+pulldown
+separatecolumns
+separaterows
+separatefields
+swapfields
+weave
+weavecolumns
+weaverows
+
+amplify
+amplifydb
+assumesamplerate
+audiodub
+audiodubex
+audiotrim
+convertaudioto8bit
+convertaudioto16bit
+convertaudioto24bit
+convertaudioto32bit
+convertaudiotofloat
+converttomono
+delayaudio
+ensurevbrmp3sync
+getchannel
+getleftchannel
+getrightchannel
+killaudio
+killvideo
+mergechannels
+mixaudio
+monotostereo
+normalize
+resampleaudio
+supereq
+ssrc
+timestretch
+
+conditionalfilter
+frameevaluate
+scriptclip
+conditionalselect
+conditionalreader
+writefile
+writefileif
+writefilestart
+writefileend
+animate
+applyrange
+tcpserver
+tcpsource
+
+imagewriter
+
+blankclip
+blackness
+colorbars
+colorbarshd
+compare
+dumpfiltergraph
+setgraphanalysis
+echo
+histogram
+info
+messageclip
+preroll
+showfiveversions
+showframenumber
+showsmpte
+showtime
+stackhorizontal
+stackvertical
+subtitle
+tone
+version
+
+pantone
+
+----------------------------------------------------
+
+[
+	["builtin-function", "avisource"],
+	["builtin-function", "avifilesource"],
+	["builtin-function", "opendmlsource"],
+	["builtin-function", "directshowsource"],
+	["builtin-function", "imagereader"],
+	["builtin-function", "imagesource"],
+	["builtin-function", "imagesourceanim"],
+	["builtin-function", "segmentedavisource"],
+	["builtin-function", "segmenteddirectshowsource"],
+	["builtin-function", "wavsource"],
+
+	["builtin-function", "coloryuv"],
+	["builtin-function", "convertbacktoyuy2"],
+	["builtin-function", "converttorgb"],
+	["builtin-function", "converttorgb24"],
+	["builtin-function", "converttorgb32"],
+	["builtin-function", "converttorgb48"],
+	["builtin-function", "converttorgb64"],
+	["builtin-function", "converttoplanarrgb"],
+	["builtin-function", "converttoplanarrgba"],
+	["builtin-function", "converttoyuy2"],
+	["builtin-function", "converttoyv24"],
+	["builtin-function", "converttoyv16"],
+	["builtin-function", "converttoyv12"],
+	["builtin-function", "converttoy8"],
+	["builtin-function", "converttoyuv444"],
+	["builtin-function", "converttoyuv422"],
+	["builtin-function", "converttoyuv420"],
+	["builtin-function", "converttoyuva444"],
+	["builtin-function", "converttoyuva422"],
+	["builtin-function", "converttoyuva420"],
+	["builtin-function", "converttoyuv411"],
+	["builtin-function", "fixluminance"],
+	["builtin-function", "greyscale"],
+	["builtin-function", "grayscale"],
+	["builtin-function", "invert"],
+	["builtin-function", "levels"],
+	["builtin-function", "limiter"],
+	["builtin-function", "mergergb"],
+	["builtin-function", "mergeargb"],
+	["builtin-function", "mergeluma"],
+	["builtin-function", "mergechroma"],
+	["builtin-function", "rgbadjust"],
+	["builtin-function", "showred"],
+	["builtin-function", "showgreen"],
+	["builtin-function", "showblue"],
+	["builtin-function", "showalpha"],
+	["builtin-function", "swapuv"],
+	["builtin-function", "tweak"],
+	["builtin-function", "utoy"],
+	["builtin-function", "utoy8"],
+	["builtin-function", "vtoy"],
+	["builtin-function", "vtoy8"],
+	["builtin-function", "ytouv"],
+
+	["builtin-function", "colorkeymask"],
+	["builtin-function", "layer"],
+	["builtin-function", "mask"],
+	["builtin-function", "maskhs"],
+	["builtin-function", "merge"],
+	["builtin-function", "overlay"],
+	["builtin-function", "resetmask"],
+	["builtin-function", "subtract"],
+
+	["builtin-function", "addborders"],
+	["builtin-function", "crop"],
+	["builtin-function", "cropbottom"],
+	["builtin-function", "fliphorizontal"],
+	["builtin-function", "flipvertical"],
+	["builtin-function", "letterbox"],
+	["builtin-function", "horizontalreduceby2"],
+	["builtin-function", "verticalreduceby2"],
+	["builtin-function", "reduceby2"],
+	["builtin-function", "bicubicresize"],
+	["builtin-function", "bilinearresize"],
+	["builtin-function", "blackmanresize"],
+	["builtin-function", "gaussresize"],
+	["builtin-function", "lanczosresize"],
+	["builtin-function", "lanczos4resize"],
+	["builtin-function", "pointresize"],
+	["builtin-function", "sincresize"],
+	["builtin-function", "spline16resize"],
+	["builtin-function", "spline36resize"],
+	["builtin-function", "spline64resize"],
+
+	["builtin-function", "skewrows"],
+	["builtin-function", "turnleft"],
+	["builtin-function", "turnright"],
+	["builtin-function", "turn180"],
+
+	["builtin-function", "blur"],
+	["builtin-function", "sharpen"],
+	["builtin-function", "generalconvolution"],
+	["builtin-function", "spatialsoften"],
+	["builtin-function", "temporalsoften"],
+	["builtin-function", "fixbrokenchromaupsampling"],
+
+	["builtin-function", "alignedsplice"],
+	["builtin-function", "unalignedsplice"],
+	["builtin-function", "assumefps"],
+	["builtin-function", "assumescaledfps"],
+	["builtin-function", "changefps"],
+	["builtin-function", "convertfps"],
+	["builtin-function", "deleteframe"],
+	["builtin-function", "dissolve"],
+	["builtin-function", "duplicateframe"],
+	["builtin-function", "fadein0"],
+	["builtin-function", "fadein"],
+	["builtin-function", "fadein2"],
+	["builtin-function", "fadeout0"],
+	["builtin-function", "fadeout"],
+	["builtin-function", "fadeout2"],
+	["builtin-function", "fadeio0"],
+	["builtin-function", "fadeio"],
+	["builtin-function", "fadeio2"],
+	["builtin-function", "freezeframe"],
+	["builtin-function", "interleave"],
+	["builtin-function", "loop"],
+	["builtin-function", "reverse"],
+	["builtin-function", "selecteven"],
+	["builtin-function", "selectodd"],
+	["builtin-function", "selectevery"],
+	["builtin-function", "selectrangeevery"],
+	["builtin-function", "trim"],
+
+	["builtin-function", "assumeframebased"],
+	["builtin-function", "assumefieldbased"],
+	["builtin-function", "assumebff"],
+	["builtin-function", "assumetff"],
+	["builtin-function", "bob"],
+	["builtin-function", "complementparity"],
+	["builtin-function", "doubleweave"],
+	["builtin-function", "peculiarblend"],
+	["builtin-function", "pulldown"],
+	["builtin-function", "separatecolumns"],
+	["builtin-function", "separaterows"],
+	["builtin-function", "separatefields"],
+	["builtin-function", "swapfields"],
+	["builtin-function", "weave"],
+	["builtin-function", "weavecolumns"],
+	["builtin-function", "weaverows"],
+
+	["builtin-function", "amplify"],
+	["builtin-function", "amplifydb"],
+	["builtin-function", "assumesamplerate"],
+	["builtin-function", "audiodub"],
+	["builtin-function", "audiodubex"],
+	["builtin-function", "audiotrim"],
+	["builtin-function", "convertaudioto8bit"],
+	["builtin-function", "convertaudioto16bit"],
+	["builtin-function", "convertaudioto24bit"],
+	["builtin-function", "convertaudioto32bit"],
+	["builtin-function", "convertaudiotofloat"],
+	["builtin-function", "converttomono"],
+	["builtin-function", "delayaudio"],
+	["builtin-function", "ensurevbrmp3sync"],
+	["builtin-function", "getchannel"],
+	["builtin-function", "getleftchannel"],
+	["builtin-function", "getrightchannel"],
+	["builtin-function", "killaudio"],
+	["builtin-function", "killvideo"],
+	["builtin-function", "mergechannels"],
+	["builtin-function", "mixaudio"],
+	["builtin-function", "monotostereo"],
+	["builtin-function", "normalize"],
+	["builtin-function", "resampleaudio"],
+	["builtin-function", "supereq"],
+	["builtin-function", "ssrc"],
+	["builtin-function", "timestretch"],
+
+	["builtin-function", "conditionalfilter"],
+	["builtin-function", "frameevaluate"],
+	["builtin-function", "scriptclip"],
+	["builtin-function", "conditionalselect"],
+	["builtin-function", "conditionalreader"],
+	["builtin-function", "writefile"],
+	["builtin-function", "writefileif"],
+	["builtin-function", "writefilestart"],
+	["builtin-function", "writefileend"],
+	["builtin-function", "animate"],
+	["builtin-function", "applyrange"],
+	["builtin-function", "tcpserver"],
+	["builtin-function", "tcpsource"],
+
+	["builtin-function", "imagewriter"],
+
+	["builtin-function", "blankclip"],
+	["builtin-function", "blackness"],
+	["builtin-function", "colorbars"],
+	["builtin-function", "colorbarshd"],
+	["builtin-function", "compare"],
+	["builtin-function", "dumpfiltergraph"],
+	["builtin-function", "setgraphanalysis"],
+	["builtin-function", "echo"],
+	["builtin-function", "histogram"],
+	["builtin-function", "info"],
+	["builtin-function", "messageclip"],
+	["builtin-function", "preroll"],
+	["builtin-function", "showfiveversions"],
+	["builtin-function", "showframenumber"],
+	["builtin-function", "showsmpte"],
+	["builtin-function", "showtime"],
+	["builtin-function", "stackhorizontal"],
+	["builtin-function", "stackvertical"],
+	["builtin-function", "subtitle"],
+	["builtin-function", "tone"],
+	["builtin-function", "version"],
+
+	"\r\n\r\npantone"
+]
+
+----------------------------------------------------
+
+All internal functions, filters, and properties can be used in the following formats:
+intFunc == intFunc() == last.intFunc == last.intFunc()
+They must not appear within other words.
diff --git a/tests/languages/avisynth/keywords_constants_bools_last_feature.test b/tests/languages/avisynth/keywords_constants_bools_last_feature.test
new file mode 100644
index 0000000000..3b28abc86f
--- /dev/null
+++ b/tests/languages/avisynth/keywords_constants_bools_last_feature.test
@@ -0,0 +1,78 @@
+function
+global
+return
+try
+catch
+if
+else
+while
+for
+__END__
+
+
+MT_NICE_FILTER
+MT_MULTI_INSTANCE
+MT_SERIALIZED
+MT_SPECIAL_MT
+
+mt_nice_filter
+mt_multi_instance
+mt_serialized
+mt_special_mt
+
+TEXTMT_NICE_FILTERTEXT
+
+true
+FALSE
+yEs
+no
+
+knot
+
+laST
+
+blasted
+
+----------------------------------------------------
+
+[
+	["keyword", "function"],
+	["keyword", "global"],
+	["keyword", "return"],
+	["keyword", "try"],
+	["keyword", "catch"],
+	["keyword", "if"],
+	["keyword", "else"],
+	["keyword", "while"],
+	["keyword", "for"],
+	["keyword", "__END__"],
+
+	["constant", "MT_NICE_FILTER"],
+	["constant", "MT_MULTI_INSTANCE"],
+	["constant", "MT_SERIALIZED"],
+	["constant", "MT_SPECIAL_MT"],
+
+	"\r\n\r\nmt_nice_filter\r\nmt_multi_instance\r\nmt_serialized\r\nmt_special_mt\r\n\r\nTEXTMT_NICE_FILTERTEXT\r\n\r\n",
+
+	["boolean", "true"],
+	["boolean", "FALSE"],
+	["boolean", "yEs"],
+	["boolean", "no"],
+
+	"\r\n\r\nknot\r\n\r\n",
+
+	["variable", "laST"],
+
+	"\r\n\r\nblasted"
+]
+
+----------------------------------------------------
+
+Keywords just have word boundaries. Keywords can actually be used as parameter names in functions, but this
+scenario is an extreme edge and we do not bother handling it.
+
+Constants are case sensitive, and must not appear within other words.
+
+Bools are case insensitive, come in 4 flavors, and must not appear within other words.
+
+The Last special variable is case insensitive, and must not appear within other words.
diff --git a/tests/languages/avisynth/operators_numbers_punctuation.test b/tests/languages/avisynth/operators_numbers_punctuation.test
new file mode 100644
index 0000000000..1cc4c2b50c
--- /dev/null
+++ b/tests/languages/avisynth/operators_numbers_punctuation.test
@@ -0,0 +1,88 @@
++
+++
+-
+!
+!=
+<
+<=
+>
+>=
+=
+==
+&&
+||
+?
+:
+%
+/
+*
+
+$abcdef
+$89abcdef
+123.89032
+.902834
+
+$9abcdef
+a$123456a
+
+()
+{}
+[]
+;
+,
+.
+\
+
+\ 1.0 \
+
+1.0 \ 1.0
+
+----------------------------------------------------
+
+[
+	["operator", "+"],
+	["operator", "++"],
+	["operator", "-"],
+	["operator", "!"],
+	["operator", "!="],
+	["operator", "<"],
+	["operator", "<="],
+	["operator", ">"],
+	["operator", ">="],
+	["operator", "="],
+	["operator", "=="],
+	["operator", "&&"],
+	["operator", "||"],
+	["operator", "?"],
+	["operator", ":"],
+	["operator", "%"],
+	["operator", "/"],
+	["operator", "*"],
+
+	["number", "$abcdef"],
+	["number", "$89abcdef"],
+	["number", "123.89032"],
+	["number", ".902834"],
+
+	"\r\n\r\n$9abcdef\r\na$123456a\r\n\r\n",
+
+	["punctuation", "("], ["punctuation", ")"],
+	["punctuation", "{"], ["punctuation", "}"],
+	["punctuation", "["], ["punctuation", "]"],
+	["punctuation", ";"],
+	["punctuation", ","],
+	["punctuation", "."],
+	["line-continuation", "\\"],
+
+	["line-continuation", "\\"], ["number", "1.0"], ["line-continuation", "\\"],
+
+	["number", "1.0"], " \\ ", ["number", "1.0"]
+]
+
+----------------------------------------------------
+
+Numbers can be specified in decimal form, with or without a leading value. So 0.0 and .0 both work.
+Numbers can also be specified as 6- or 8- digit hexadecimal strings for colors. They begin with a $.
+Numbers can not be bounded by words.
+
+Line continuations must be either the first or last character in a line, less some whitespace.
diff --git a/tests/languages/avisynth/types_arguments_feature.test b/tests/languages/avisynth/types_arguments_feature.test
new file mode 100644
index 0000000000..aa1660b227
--- /dev/null
+++ b/tests/languages/avisynth/types_arguments_feature.test
@@ -0,0 +1,119 @@
+function test(clip input, int interleavedFields, float precision, string "floatingDesync", bool "useQTGMC", val "chromaNoise")
+{
+	castTest = clip(chromaNoise)
+	castTest = int(chromaNoise)
+	castTest = float(chromaNoise)
+	castTest = string(chromaNoise)
+	castTest = bool(chromaNoise)
+	castTest = val(chromaNoise)
+
+	return interleavedClip
+}
+
+test(5, 0.5, floatingDesync="progressive")
+
+----------------------------------------------------
+
+[
+	["keyword", "function"],
+	["function", "test"],
+	["punctuation", "("],
+	["argument", [
+		["keyword", "clip"],
+		" input"
+	]],
+	["punctuation", ","],
+	["argument", [
+		["keyword", "int"],
+		" interleavedFields"
+	]],
+	["punctuation", ","],
+	["argument", [
+		["keyword", "float"],
+		" precision"
+	]],
+	["punctuation", ","],
+	["argument", [
+		["keyword", "string"],
+		" \"floatingDesync\""
+	]],
+	["punctuation", ","],
+	["argument", [
+		["keyword", "bool"],
+		" \"useQTGMC\""
+	]],
+	["punctuation", ","],
+	["argument", [
+		["keyword", "val"],
+		" \"chromaNoise\""
+	]],
+	["punctuation", ")"],
+
+	["punctuation", "{"],
+
+	"\r\n\tcastTest ",
+	["operator", "="],
+	["type-cast", "clip"],
+	["punctuation", "("],
+	"chromaNoise",
+	["punctuation", ")"],
+
+	"\r\n\tcastTest ",
+	["operator", "="],
+	["type-cast", "int"],
+	["punctuation", "("],
+	"chromaNoise",
+	["punctuation", ")"],
+
+	"\r\n\tcastTest ",
+	["operator", "="],
+	["type-cast", "float"],
+	["punctuation", "("],
+	"chromaNoise",
+	["punctuation", ")"],
+
+	"\r\n\tcastTest ",
+	["operator", "="],
+	["type-cast", "string"],
+	["punctuation", "("],
+	"chromaNoise",
+	["punctuation", ")"],
+
+	"\r\n\tcastTest ",
+	["operator", "="],
+	["type-cast", "bool"],
+	["punctuation", "("],
+	"chromaNoise",
+	["punctuation", ")"],
+
+	"\r\n\tcastTest ",
+	["operator", "="],
+	["type-cast", "val"],
+	["punctuation", "("],
+	"chromaNoise",
+	["punctuation", ")"],
+
+	["keyword", "return"], " interleavedClip\r\n",
+	["punctuation", "}"],
+
+	["function", "test"],
+	["punctuation", "("],
+	["number", "5"],
+	["punctuation", ","],
+	["number", "0.5"],
+	["punctuation", ","],
+	["argument-label", [
+		["argument-name", "floatingDesync"],
+		["punctuation", "="]
+	]],
+	["string", ["\"progressive\""]],
+	["punctuation", ")"]
+]
+
+----------------------------------------------------
+
+Optional arguments check for preceeding types to match before getting matched as a string, and should not be matched as strings.
+Incidental names of types in an arguments list (such as "interleavedFields" containing "int") should not get highlighted.
+Types can be used as casts, and should not be highlighted as user-functions.
+Incidental names of types elsewhere (such as "interleavedClip" in a function body) should not get highlighted.
+Explicitly-named optional arguments in function calls get lowlighted (including the '=').
diff --git a/tests/languages/avisynth/userfunctions_feature.test b/tests/languages/avisynth/userfunctions_feature.test
new file mode 100644
index 0000000000..d6226cd996
--- /dev/null
+++ b/tests/languages/avisynth/userfunctions_feature.test
@@ -0,0 +1,53 @@
+function CustomUserFunction() {
+
+QTGMC()
+last.QTGMC
+last.QTGMC()
+
+QTGMC
+1func()
+last.1func
+last.1func()
+
+----------------------------------------------------
+
+[
+	["keyword", "function"],
+	["function", "CustomUserFunction"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+
+	["function", "QTGMC"],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	["variable", "last"],
+	["punctuation", "."],
+	["function", "QTGMC"],
+
+	["variable", "last"],
+	["punctuation", "."],
+	["function", "QTGMC"],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	"\r\n\r\nQTGMC\r\n1func",
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	["variable", "last"],
+	["punctuation", "."],
+	"1func\r\n",
+
+	["variable", "last"],
+	["punctuation", "."],
+	"1func",
+	["punctuation", "("],
+	["punctuation", ")"]
+]
+
+----------------------------------------------------
+
+Valid identifiers (starts with [a-zA-Z_]) proceeding a '.', preceeding a '(', or both are user/external functions.
+User/external functions that don't match the above are technically valid but indistinguisable from variables.
diff --git a/tests/languages/avro-idl/annotation_feature.test b/tests/languages/avro-idl/annotation_feature.test
new file mode 100644
index 0000000000..35a359c4d8
--- /dev/null
+++ b/tests/languages/avro-idl/annotation_feature.test
@@ -0,0 +1,76 @@
+record MyRecord {
+  string @order("ascending") myAscendingSortField;
+  string @order("descending")  myDescendingField;
+  string @order("ignore") myIgnoredField;
+}
+
+@java-class("java.util.ArrayList") array myStrings;
+
+@namespace("org.apache.avro.firstNamespace")
+
+union { MD5, null} @aliases(["hash"]) nullableHash;
+
+----------------------------------------------------
+
+[
+	["keyword", "record"],
+	["class-name", "MyRecord"],
+	["punctuation", "{"],
+
+	["keyword", "string"],
+	["annotation", "@order"],
+	["punctuation", "("],
+	["string", "\"ascending\""],
+	["punctuation", ")"],
+	" myAscendingSortField",
+	["punctuation", ";"],
+
+	["keyword", "string"],
+	["annotation", "@order"],
+	["punctuation", "("],
+	["string", "\"descending\""],
+	["punctuation", ")"],
+	"  myDescendingField",
+	["punctuation", ";"],
+
+	["keyword", "string"],
+	["annotation", "@order"],
+	["punctuation", "("],
+	["string", "\"ignore\""],
+	["punctuation", ")"],
+	" myIgnoredField",
+	["punctuation", ";"],
+
+	["punctuation", "}"],
+
+	["annotation", "@java-class"],
+	["punctuation", "("],
+	["string", "\"java.util.ArrayList\""],
+	["punctuation", ")"],
+	["keyword", "array"],
+	["punctuation", "<"],
+	["keyword", "string"],
+	["punctuation", ">"],
+	" myStrings",
+	["punctuation", ";"],
+
+	["annotation", "@namespace"],
+	["punctuation", "("],
+	["string", "\"org.apache.avro.firstNamespace\""],
+	["punctuation", ")"],
+
+	["keyword", "union"],
+	["punctuation", "{"],
+	" MD5",
+	["punctuation", ","],
+	["keyword", "null"],
+	["punctuation", "}"],
+	["annotation", "@aliases"],
+	["punctuation", "("],
+	["punctuation", "["],
+	["string", "\"hash\""],
+	["punctuation", "]"],
+	["punctuation", ")"],
+	" nullableHash",
+	["punctuation", ";"]
+]
diff --git a/tests/languages/avro-idl/class-name_feature.test b/tests/languages/avro-idl/class-name_feature.test
new file mode 100644
index 0000000000..4e4e549aa2
--- /dev/null
+++ b/tests/languages/avro-idl/class-name_feature.test
@@ -0,0 +1,52 @@
+protocol MyProto {
+  @namespace("org.apache.avro.someOtherNamespace")
+  record Foo {}
+
+  record Bar {}
+
+  enum Kind {
+    FOO,
+    BAR, // the bar enum value
+    BAZ
+  }
+
+  error TestError {
+    string message;
+  }
+
+}
+
+----------------------------------------------------
+
+[
+	["keyword", "protocol"],
+	["class-name", "MyProto"],
+	["punctuation", "{"],
+
+	["annotation", "@namespace"],
+	["punctuation", "("],
+	["string", "\"org.apache.avro.someOtherNamespace\""],
+	["punctuation", ")"],
+
+	["keyword", "record"],
+	["class-name", "Foo"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["keyword", "record"],
+	["class-name", "Bar"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["keyword", "enum"], ["class-name", "Kind"], ["punctuation", "{"],
+	"\r\n    FOO", ["punctuation", ","],
+	"\r\n    BAR", ["punctuation", ","], ["comment", "// the bar enum value"],
+	"\r\n    BAZ\r\n  ",
+	["punctuation", "}"],
+
+	["keyword", "error"], ["class-name", "TestError"], ["punctuation", "{"],
+	["keyword", "string"], " message", ["punctuation", ";"],
+	["punctuation", "}"],
+
+	["punctuation", "}"]
+]
diff --git a/tests/languages/avro-idl/comment_feature.test b/tests/languages/avro-idl/comment_feature.test
new file mode 100644
index 0000000000..8a6e067fbe
--- /dev/null
+++ b/tests/languages/avro-idl/comment_feature.test
@@ -0,0 +1,15 @@
+/* comment */
+/*
+ comment
+ */
+
+// comment
+
+----------------------------------------------------
+
+[
+	["comment", "/* comment */"],
+	["comment", "/*\r\n comment\r\n */"],
+
+	["comment", "// comment"]
+]
diff --git a/tests/languages/avro-idl/function_feature.test b/tests/languages/avro-idl/function_feature.test
new file mode 100644
index 0000000000..3f1dae07dd
--- /dev/null
+++ b/tests/languages/avro-idl/function_feature.test
@@ -0,0 +1,57 @@
+int add(int foo, int bar = 0);
+
+void logMessage(string message);
+
+void goKaboom() throws Kaboom;
+
+void fireAndForget(string message) oneway;
+
+void `error`();
+
+----------------------------------------------------
+
+[
+	["keyword", "int"],
+	["function", "add"],
+	["punctuation", "("],
+	["keyword", "int"],
+	" foo",
+	["punctuation", ","],
+	["keyword", "int"],
+	" bar ",
+	["operator", "="],
+	["number", "0"],
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "void"],
+	["function", "logMessage"],
+	["punctuation", "("],
+	["keyword", "string"],
+	" message",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "void"],
+	["function", "goKaboom"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["keyword", "throws"],
+	["class-name", "Kaboom"],
+	["punctuation", ";"],
+
+	["keyword", "void"],
+	["function", "fireAndForget"],
+	["punctuation", "("],
+	["keyword", "string"],
+	" message",
+	["punctuation", ")"],
+	["keyword", "oneway"],
+	["punctuation", ";"],
+
+	["keyword", "void"],
+	["function-identifier", "`error`"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ";"]
+]
diff --git a/tests/languages/avro-idl/keyword_feature.test b/tests/languages/avro-idl/keyword_feature.test
new file mode 100644
index 0000000000..e1ede9c750
--- /dev/null
+++ b/tests/languages/avro-idl/keyword_feature.test
@@ -0,0 +1,65 @@
+array;
+boolean;
+bytes;
+date;
+decimal;
+double;
+enum;
+error;
+false;
+fixed;
+float;
+idl;
+import;
+int;
+local_timestamp_ms;
+long;
+map;
+null;
+oneway;
+protocol;
+record;
+schema;
+string;
+throws;
+time_ms;
+timestamp_ms;
+true;
+union;
+uuid;
+void;
+
+----------------------------------------------------
+
+[
+	["keyword", "array"], ["punctuation", ";"],
+	["keyword", "boolean"], ["punctuation", ";"],
+	["keyword", "bytes"], ["punctuation", ";"],
+	["keyword", "date"], ["punctuation", ";"],
+	["keyword", "decimal"], ["punctuation", ";"],
+	["keyword", "double"], ["punctuation", ";"],
+	["keyword", "enum"], ["punctuation", ";"],
+	["keyword", "error"], ["punctuation", ";"],
+	["keyword", "false"], ["punctuation", ";"],
+	["keyword", "fixed"], ["punctuation", ";"],
+	["keyword", "float"], ["punctuation", ";"],
+	["keyword", "idl"], ["punctuation", ";"],
+	["keyword", "import"], ["punctuation", ";"],
+	["keyword", "int"], ["punctuation", ";"],
+	["keyword", "local_timestamp_ms"], ["punctuation", ";"],
+	["keyword", "long"], ["punctuation", ";"],
+	["keyword", "map"], ["punctuation", ";"],
+	["keyword", "null"], ["punctuation", ";"],
+	["keyword", "oneway"], ["punctuation", ";"],
+	["keyword", "protocol"], ["punctuation", ";"],
+	["keyword", "record"], ["punctuation", ";"],
+	["keyword", "schema"], ["punctuation", ";"],
+	["keyword", "string"], ["punctuation", ";"],
+	["keyword", "throws"], ["punctuation", ";"],
+	["keyword", "time_ms"], ["punctuation", ";"],
+	["keyword", "timestamp_ms"], ["punctuation", ";"],
+	["keyword", "true"], ["punctuation", ";"],
+	["keyword", "union"], ["punctuation", ";"],
+	["keyword", "uuid"], ["punctuation", ";"],
+	["keyword", "void"], ["punctuation", ";"]
+]
diff --git a/tests/languages/avro-idl/number_feature.test b/tests/languages/avro-idl/number_feature.test
new file mode 100644
index 0000000000..87869c9b4d
--- /dev/null
+++ b/tests/languages/avro-idl/number_feature.test
@@ -0,0 +1,43 @@
+0
+123
+0xFFF
+-0
+-123
+-0xFF
+12343324234L
+0xFFFFFFFFFl
+
+0.342e4
+0.342e-4f
+0.342e-4d
+.324
+123.
+0x.2Fp+323f
+0x234.p+323d
+
+NaN
+Infinity
+
+----------------------------------------------------
+
+[
+	["number", "0"],
+	["number", "123"],
+	["number", "0xFFF"],
+	["number", "-0"],
+	["number", "-123"],
+	["number", "-0xFF"],
+	["number", "12343324234L"],
+	["number", "0xFFFFFFFFFl"],
+
+	["number", "0.342e4"],
+	["number", "0.342e-4f"],
+	["number", "0.342e-4d"],
+	["number", ".324"],
+	["number", "123."],
+	["number", "0x.2Fp+323f"],
+	["number", "0x234.p+323d"],
+
+	["number", "NaN"],
+	["number", "Infinity"]
+]
diff --git a/tests/languages/avro-idl/operator_feature.test b/tests/languages/avro-idl/operator_feature.test
new file mode 100644
index 0000000000..27b9165afc
--- /dev/null
+++ b/tests/languages/avro-idl/operator_feature.test
@@ -0,0 +1,7 @@
+=
+
+----------------------------------------------------
+
+[
+	["operator", "="]
+]
diff --git a/tests/languages/avro-idl/punctuation_feature.test b/tests/languages/avro-idl/punctuation_feature.test
new file mode 100644
index 0000000000..f73a56287d
--- /dev/null
+++ b/tests/languages/avro-idl/punctuation_feature.test
@@ -0,0 +1,20 @@
+( ) [ ] { } < >
+. : , ;
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", "<"],
+	["punctuation", ">"],
+
+	["punctuation", "."],
+	["punctuation", ":"],
+	["punctuation", ","],
+	["punctuation", ";"]
+]
diff --git a/tests/languages/avro-idl/string_feature.test b/tests/languages/avro-idl/string_feature.test
new file mode 100644
index 0000000000..d93a89eabe
--- /dev/null
+++ b/tests/languages/avro-idl/string_feature.test
@@ -0,0 +1,13 @@
+""
+"foo"
+"\""
+"\n\n"
+
+----------------------------------------------------
+
+[
+	["string", "\"\""],
+	["string", "\"foo\""],
+	["string", "\"\\\"\""],
+	["string", "\"\\n\\n\""]
+]
diff --git a/tests/languages/bash/assign-left_feature.test b/tests/languages/bash/assign-left_feature.test
index e21364696e..54b64a5ba9 100644
--- a/tests/languages/bash/assign-left_feature.test
+++ b/tests/languages/bash/assign-left_feature.test
@@ -8,13 +8,15 @@ foo+=('xyz')
 	["assign-left", ["foo"]],
 	["operator", ["="]],
 	["number", "12"],
+
 	["assign-left", ["bar"]],
 	["operator", ["+="]],
-	["string", ["'xyz'"]],
+	["string", "'xyz'"],
+
 	["assign-left", ["foo"]],
 	["operator", ["+="]],
 	["punctuation", "("],
-	["string", ["'xyz'"]],
+	["string", "'xyz'"],
 	["punctuation", ")"]
 ]
 
diff --git a/tests/languages/bash/entities_in_strings_feature.test b/tests/languages/bash/entities_in_strings_feature.test
index be4a544275..f4d7dcb911 100644
--- a/tests/languages/bash/entities_in_strings_feature.test
+++ b/tests/languages/bash/entities_in_strings_feature.test
@@ -1,24 +1,63 @@
-'1\a2\b3\c4\e5\f6\n7\r8\t9\v'
-'1234\056789'
-'abc\xdef'
-'123\456789'
-'\uABCDEFG'
+$'1\a2\b3\c4\e5\f6\n7\r8\t9\v'
+$'1234\056789'
+$'123\456789'
+"abc\xdef"
+"\uABCDEFG"
 "a\"b"
 
+'1\a2\b3\c4\e5\f6\n7\r8\t9\v'
+
 ----------------------------------------------------
 
 [
 	["string", [
-		"'1", ["entity", "\\a"], "2", ["entity", "\\b"], "3", ["entity", "\\c"],
-		"4", ["entity", "\\e"], "5", ["entity", "\\f"], "6", ["entity", "\\n"],
-		"7", ["entity", "\\r"], "8", ["entity", "\\t"], "9", ["entity", "\\v"],
+		"$'1",
+		["entity", "\\a"],
+		"2",
+		["entity", "\\b"],
+		"3",
+		["entity", "\\c"],
+		"4",
+		["entity", "\\e"],
+		"5",
+		["entity", "\\f"],
+		"6",
+		["entity", "\\n"],
+		"7",
+		["entity", "\\r"],
+		"8",
+		["entity", "\\t"],
+		"9",
+		["entity", "\\v"],
 		"'"
 	]],
-	["string", ["'1234", ["entity", "\\056"], "789'"]],
-	["string", ["'abc", ["entity", "\\xde"], "f'"]],
-	["string", ["'123", ["entity", "\\456"], "789'"]],
-	["string", ["'", ["entity", "\\uABCD"], "EFG'"]],
-	["string", ["\"a", ["entity", "\\\""], "b\""]]
+	["string", [
+		"$'1234",
+		["entity", "\\056"],
+		"789'"
+	]],
+	["string", [
+		"$'123",
+		["entity", "\\456"],
+		"789'"
+	]],
+	["string", [
+		"\"abc",
+		["entity", "\\xde"],
+		"f\""
+	]],
+	["string", [
+		"\"",
+		["entity", "\\uABCD"],
+		"EFG\""
+	]],
+	["string", [
+		"\"a",
+		["entity", "\\\""],
+		"b\""
+	]],
+
+	["string", "'1\\a2\\b3\\c4\\e5\\f6\\n7\\r8\\t9\\v'"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/bash/function-name_feature.test b/tests/languages/bash/function-name_feature.test
index 51e8213a9f..82cb197960 100644
--- a/tests/languages/bash/function-name_feature.test
+++ b/tests/languages/bash/function-name_feature.test
@@ -1,4 +1,5 @@
 function foo { :; }
+function foo-bar { :; }
 bar() { :; }
 function foo() { :; }
 # Not a function:
@@ -13,6 +14,12 @@ bar { :; }
 	["builtin", ":"],
 	["punctuation", ";"],
 	["punctuation", "}"],
+	["keyword", "function"],
+	["function-name", "foo-bar"],
+	["punctuation", "{"],
+	["builtin", ":"],
+	["punctuation", ";"],
+	["punctuation", "}"],
 	["function-name", "bar"],
 	["punctuation", "("],
 	["punctuation", ")"],
diff --git a/tests/languages/bash/issue2436.test b/tests/languages/bash/issue2436.test
new file mode 100644
index 0000000000..76568aac62
--- /dev/null
+++ b/tests/languages/bash/issue2436.test
@@ -0,0 +1,24 @@
+echo $'module.exports = {\n  extends: [\n    // add more generic rulesets here, such as:\n    // 'eslint:recommended',\n    "plugin:vue/vue3-recommended",\n    "prettier",\n    "prettier/vue",\n  ],\n  rules: {\n    // override/add rules settings here, such as:\n    // 'vue/no-unused-vars': 'error'\n  },\n};' > .eslintrc.js
+
+----------------------------------------------------
+
+[
+	["builtin", "echo"],
+	["string", [
+		"$'module.exports = {",
+		["entity", "\\n"],
+		"  extends: [",
+		["entity", "\\n"],
+		"    // add more generic rulesets here, such as:",
+		["entity", "\\n"],
+		"    // '"
+	]],
+	"eslint:recommended",
+	["string", "',\\n    \"plugin:vue/vue3-recommended\",\\n    \"prettier\",\\n    \"prettier/vue\",\\n  ],\\n  rules: {\\n    // override/add rules settings here, such as:\\n    // '"],
+	"vue/no-unused-vars",
+	["string", "': '"],
+	"error",
+	["string", "'\\n  },\\n};'"],
+	["operator", [">"]],
+	" .eslintrc.js"
+]
\ No newline at end of file
diff --git a/tests/languages/bash/string_feature.test b/tests/languages/bash/string_feature.test
index 533ce79ae9..bdcfc762fe 100644
--- a/tests/languages/bash/string_feature.test
+++ b/tests/languages/bash/string_feature.test
@@ -47,30 +47,14 @@ STRING_END
 ----------------------------------------------------
 
 [
-	["string", [
-		"\"\""
-	]],
-	["string", [
-		"''"
-	]],
-	["string", [
-		"\"foo\""
-	]],
-	["string", [
-		"'foo'"
-	]],
-	["string", [
-		"\"foo\r\nbar\""
-	]],
-	["string", [
-		"'foo\r\nbar'"
-	]],
-	["string", [
-		"\"'foo'\""
-	]],
-	["string", [
-		"'\"bar\"'"
-	]],
+	["string", ["\"\""]],
+	["string", "''"],
+	["string", ["\"foo\""]],
+	["string", "'foo'"],
+	["string", ["\"foo\r\nbar\""]],
+	["string", "'foo\r\nbar'"],
+	["string", ["\"'foo'\""]],
+	["string", "'\"bar\"'"],
 	["string", [
 		"\"",
 		["variable", "$@"],
@@ -78,56 +62,30 @@ STRING_END
 	]],
 	["string", [
 		"\"",
-		["variable", [
-			"${foo}"
-		]],
+		["variable", ["${foo}"]],
 		"\""
 	]],
-	["punctuation", "\\"],
-	["punctuation", "\\"],
-	["string", [
-		"\"foo\""
-	]],
-	["punctuation", "\\"],
-	"'a ",
-	["comment", "# ' not a string"],
-	["operator", [
-		"<<"
-	]],
-	["string", [
-		"STRING_END\r\nfoo\r\nbar\r\nSTRING_END"
-	]],
-	["operator", [
-		"<<-"
-	]],
-	["string", [
-		"STRING_END\r\nfoo\r\nbar\r\nSTRING_END"
-	]],
-	["operator", [
-		"<<"
-	]],
+	["punctuation", "\\"], ["punctuation", "\\"], ["string", ["\"foo\""]],
+	["punctuation", "\\"], "'a ", ["comment", "# ' not a string"],
+
+	["operator", ["<<"]], ["string", ["STRING_END\r\nfoo\r\nbar\r\nSTRING_END"]],
+
+	["operator", ["<<-"]], ["string", ["STRING_END\r\nfoo\r\nbar\r\nSTRING_END"]],
+
+	["operator", ["<<"]],
 	["string", [
-		"EOF\r\nfoo ",
-		["variable", "$@"],
+		"EOF\r\nfoo ", ["variable", "$@"],
 		"\r\nbar\r\nEOF"
 	]],
-	["operator", [
-		"<<"
-	]],
-	["string", "'EOF'\r\n'single quoted string'\r\n\"double quoted string\"\r\nEOF"],
-	["operator", [
-		"<<"
-	]],
-	["string", "\"EOF\"\r\nfoo\r\n$bar\r\nEOF"],
-	["operator", [
-		"<<"
-	]],
-	["string", [
-		"STRING_END\r\n# comment\r\nSTRING_END"
-	]],
-	["string", [
-		"\"  # comment  \""
-	]]
+
+	["operator", ["<<"]],
+	["string", ["'EOF'\r\n'single quoted string'\r\n\"double quoted string\"\r\nEOF"]],
+
+	["operator", ["<<"]], ["string", ["\"EOF\"\r\nfoo\r\n$bar\r\nEOF"]],
+
+	["operator", ["<<"]], ["string", ["STRING_END\r\n# comment\r\nSTRING_END"]],
+
+	["string", ["\"  # comment  \""]]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/bash/variable_operator_feature.test b/tests/languages/bash/variable_operator_feature.test
new file mode 100644
index 0000000000..4cec4fab7d
--- /dev/null
+++ b/tests/languages/bash/variable_operator_feature.test
@@ -0,0 +1,70 @@
+"$((
+
++ - * / % ^ & |
++= -= *= /= %= ^= &= |=
+-- ++ ** && ||
+
+>> >>= << <<=
+
+== != > >= < <=
+= ! ~ ? :
+
+
+
+))"
+
+----------------------------------------------------
+
+[
+	["string", [
+		"\"",
+		["variable", [
+			["variable", "$(("],
+
+			["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", ":"],
+
+			["variable", "))"]
+		]],
+		"\""
+	]]
+]
diff --git a/tests/languages/basic/punctuation_feature.test b/tests/languages/basic/punctuation_feature.test
new file mode 100644
index 0000000000..318275a6e6
--- /dev/null
+++ b/tests/languages/basic/punctuation_feature.test
@@ -0,0 +1,11 @@
+, ; : ( )
+
+----------------------------------------------------
+
+[
+	["punctuation", ","],
+	["punctuation", ";"],
+	["punctuation", ":"],
+	["punctuation", "("],
+	["punctuation", ")"]
+]
diff --git a/tests/languages/batch/command_feature.test b/tests/languages/batch/command_feature.test
index 350788a8bd..77c928ca4b 100644
--- a/tests/languages/batch/command_feature.test
+++ b/tests/languages/batch/command_feature.test
@@ -1,10 +1,19 @@
 FOR /l %%a in (5,-1,1) do (TITLE %title% -- closing in %%as)
+
+FOR /F %%A IN ('TYPE "%InFile%"^|find /v /c ""')
+
 SET title=%~n0
+
 echo.Hello World
+
 @ECHO OFF
+
 if not defined ProgressFormat set "ProgressFormat=[PPPP]"
+
 EXIT /b
+
 set /a ProgressCnt+=1
+
 IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
 
 ----------------------------------------------------
@@ -12,13 +21,18 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
 [
 	["command", [
 		["keyword", "FOR"],
-		["parameter", ["/l"]],
+		["parameter", [
+			"/l"
+		]],
 		["variable", "%%a"],
 		["keyword", "in"],
 		["punctuation", "("],
-		["number", "5"], ["punctuation", ","],
-		["number", "-1"], ["punctuation", ","],
-		["number", "1"], ["punctuation", ")"],
+		["number", "5"],
+		["punctuation", ","],
+		["number", "-1"],
+		["punctuation", ","],
+		["number", "1"],
+		["punctuation", ")"],
 		["keyword", "do"]
 	]],
 	["punctuation", "("],
@@ -30,6 +44,27 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
 	]],
 	["punctuation", ")"],
 
+	["command", [
+		["keyword", "FOR"],
+		["parameter", [
+			"/F"
+		]],
+		["variable", "%%A"],
+		" IN ('TYPE ",
+		["string", "\"%InFile%\""],
+		["operator", "^"],
+		"|find ",
+		["parameter", [
+			"/v"
+		]],
+		["parameter", [
+			"/c"
+		]],
+		["string", "\"\""],
+		"'"
+	]],
+	["punctuation", ")"],
+
 	["command", [
 		["keyword", "SET"],
 		["variable", "title"],
@@ -61,12 +96,16 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
 
 	["command", [
 		["keyword", "EXIT"],
-		["parameter", ["/b"]]
+		["parameter", [
+			"/b"
+		]]
 	]],
 
 	["command", [
 		["keyword", "set"],
-		["parameter", ["/a"]],
+		["parameter", [
+			"/a"
+		]],
 		["variable", "ProgressCnt"],
 		["operator", "+="],
 		["number", "1"]
@@ -100,4 +139,4 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
 
 ----------------------------------------------------
 
-Checks for commands.
\ No newline at end of file
+Checks for commands.
diff --git a/tests/languages/batch/label_feature.test b/tests/languages/batch/label_feature.test
index a672ba0cc3..547bda0200 100644
--- a/tests/languages/batch/label_feature.test
+++ b/tests/languages/batch/label_feature.test
@@ -1,13 +1,18 @@
 :foo
 :Foo_Bar
+GOTO:eof
 
 ----------------------------------------------------
 
 [
 	["label", ":foo"],
-	["label", ":Foo_Bar"]
+	["label", ":Foo_Bar"],
+	["command", [
+		["keyword", "GOTO"],
+		["label", ":eof"]
+	]]
 ]
 
 ----------------------------------------------------
 
-Checks for labels.
\ No newline at end of file
+Checks for labels.
diff --git a/tests/languages/bbcode/tag_feature.test b/tests/languages/bbcode/tag_feature.test
index 3e67030ad8..e64f179f6c 100644
--- a/tests/languages/bbcode/tag_feature.test
+++ b/tests/languages/bbcode/tag_feature.test
@@ -29,6 +29,7 @@
 		]],
 		["punctuation", "]"]
 	]],
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -36,7 +37,8 @@
 		]],
 		["punctuation", "]"]
 	]],
-	"Entry A\n  ",
+	"Entry A\r\n  ",
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -44,7 +46,8 @@
 		]],
 		["punctuation", "]"]
 	]],
-	"Entry B\n",
+	"Entry B\r\n",
+
 	["tag", [
 		["tag", [
 			["punctuation", "[/"],
@@ -64,6 +67,7 @@
 		]],
 		["punctuation", "]"]
 	]],
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -71,7 +75,8 @@
 		]],
 		["punctuation", "]"]
 	]],
-	"Entry 1\n  ",
+	"Entry 1\r\n  ",
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -79,7 +84,8 @@
 		]],
 		["punctuation", "]"]
 	]],
-	"Entry 2\n",
+	"Entry 2\r\n",
+
 	["tag", [
 		["tag", [
 			["punctuation", "[/"],
@@ -110,7 +116,8 @@
 		]],
 		["punctuation", "]"]
 	]],
-	" or\n",
+	" or\r\n",
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -131,7 +138,8 @@
 		]],
 		["punctuation", "]"]
 	]],
-	" or\n",
+	" or\r\n",
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -151,6 +159,7 @@
 		]],
 		["punctuation", "]"]
 	]],
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -166,6 +175,7 @@
 		]],
 		["punctuation", "]"]
 	]],
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
@@ -211,6 +221,7 @@
 		]],
 		["punctuation", "]"]
 	]],
+
 	["tag", [
 		["tag", [
 			["punctuation", "["],
diff --git a/tests/languages/bicep/boolean_feature.test b/tests/languages/bicep/boolean_feature.test
new file mode 100644
index 0000000000..a40f8d95d2
--- /dev/null
+++ b/tests/languages/bicep/boolean_feature.test
@@ -0,0 +1,13 @@
+true
+false
+
+----------------------------------------------------
+
+[
+	["boolean", "true"],
+	["boolean", "false"]
+]
+
+----------------------------------------------------
+
+Checks for booleans.
\ No newline at end of file
diff --git a/tests/languages/bicep/comment_feature.test b/tests/languages/bicep/comment_feature.test
new file mode 100644
index 0000000000..3d3a84ce63
--- /dev/null
+++ b/tests/languages/bicep/comment_feature.test
@@ -0,0 +1,18 @@
+// this is a comment
+
+/* this
+is a
+multi line comment */
+
+/* so is
+this */
+
+----------------------------------------------------
+
+[
+	["comment", "// this is a comment"],
+
+	["comment", "/* this\r\nis a\r\nmulti line comment */"],
+
+	["comment", "/* so is\r\nthis */"]
+]
diff --git a/tests/languages/bicep/datatype_feature.test b/tests/languages/bicep/datatype_feature.test
new file mode 100644
index 0000000000..882430f6fd
--- /dev/null
+++ b/tests/languages/bicep/datatype_feature.test
@@ -0,0 +1,47 @@
+param myString string
+param myInt int
+param myBool bool
+param myObject object
+param myArray array
+
+output myHardcodedOutput int = 42
+output myLoopyOutput array = [for myItem in myArray: {
+  myProperty: myItem.myOtherProperty
+}]
+
+----------------------------------------------------
+
+[
+	["keyword", "param"], " myString ", ["datatype", "string"],
+	["keyword", "param"], " myInt ", ["datatype", "int"],
+	["keyword", "param"], " myBool ", ["datatype", "bool"],
+	["keyword", "param"], " myObject ", ["datatype", "object"],
+	["keyword", "param"], " myArray ", ["datatype", "array"],
+
+	["keyword", "output"],
+	" myHardcodedOutput ",
+	["datatype", "int"],
+	["operator", "="],
+	["number", "42"],
+
+	["keyword", "output"],
+	" myLoopyOutput ",
+	["datatype", "array"],
+	["operator", "="],
+	["punctuation", "["],
+	["keyword", "for"],
+	" myItem ",
+	["keyword", "in"],
+	" myArray",
+	["operator", ":"],
+	["punctuation", "{"],
+
+	["property", "myProperty"],
+	["operator", ":"],
+	" myItem",
+	["punctuation", "."],
+	"myOtherProperty\r\n",
+
+	["punctuation", "}"],
+	["punctuation", "]"]
+]
diff --git a/tests/languages/bicep/decorator_feature.test b/tests/languages/bicep/decorator_feature.test
new file mode 100644
index 0000000000..36d29bc222
--- /dev/null
+++ b/tests/languages/bicep/decorator_feature.test
@@ -0,0 +1,61 @@
+@secure()
+param demoPassword string
+@allowed([
+  'one'
+  'two'
+])
+param demoEnum string
+
+@minLength(3)
+@maxLength(24)
+@description('Name of the storage account')
+param storageAccountName string = concat(uniqueString(resourceGroup().id), 'sa')
+
+----------------------------------------------------
+
+[
+	["decorator", "@secure"], ["punctuation", "("], ["punctuation", ")"],
+	["keyword", "param"], " demoPassword ", ["datatype", "string"],
+	["decorator", "@allowed"], ["punctuation", "("], ["punctuation", "["],
+	["string", "'one'"],
+	["string", "'two'"],
+	["punctuation", "]"], ["punctuation", ")"],
+	["keyword", "param"], " demoEnum ", ["datatype", "string"],
+
+	["decorator", "@minLength"],
+	["punctuation", "("],
+	["number", "3"],
+	["punctuation", ")"],
+
+	["decorator", "@maxLength"],
+	["punctuation", "("],
+	["number", "24"],
+	["punctuation", ")"],
+
+	["decorator", "@description"],
+	["punctuation", "("],
+	["string", "'Name of the storage account'"],
+	["punctuation", ")"],
+
+	["keyword", "param"],
+	" storageAccountName ",
+	["datatype", "string"],
+	["operator", "="],
+	["function", "concat"],
+	["punctuation", "("],
+	["function", "uniqueString"],
+	["punctuation", "("],
+	["function", "resourceGroup"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "."],
+	"id",
+	["punctuation", ")"],
+	["punctuation", ","],
+	["string", "'sa'"],
+	["punctuation", ")"]
+]
+
+----------------------------------------------------
+
+Checks for functions. Also checks for unicode characters in identifiers.
diff --git a/tests/languages/bicep/function_feature.test b/tests/languages/bicep/function_feature.test
new file mode 100644
index 0000000000..91b75bf547
--- /dev/null
+++ b/tests/languages/bicep/function_feature.test
@@ -0,0 +1,62 @@
+param location string = resourceGroup().location
+var hostingPlanName = 'hostingplan${uniqueString(resourceGroup().id)}'
+
+array(parameters('stringToConvert'))
+createArray(1, 2, 3)
+
+----------------------------------------------------
+
+[
+	["keyword", "param"],
+	" location ",
+	["datatype", "string"],
+	["operator", "="],
+	["function", "resourceGroup"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "."],
+	"location\r\n",
+
+	["keyword", "var"],
+	" hostingPlanName ",
+	["operator", "="],
+	["interpolated-string", [
+		["string", "'hostingplan"],
+		["interpolation", [
+			["punctuation", "${"],
+			["expression", [
+				["function", "uniqueString"],
+				["punctuation", "("],
+				["function", "resourceGroup"],
+				["punctuation", "("],
+				["punctuation", ")"],
+				["punctuation", "."],
+				"id",
+				["punctuation", ")"]
+			]],
+			["punctuation", "}"]
+		]],
+		["string", "'"]
+	]],
+
+	["function", "array"],
+	["punctuation", "("],
+	["function", "parameters"],
+	["punctuation", "("],
+	["string", "'stringToConvert'"],
+	["punctuation", ")"],
+	["punctuation", ")"],
+
+	["function", "createArray"],
+	["punctuation", "("],
+	["number", "1"],
+	["punctuation", ","],
+	["number", "2"],
+	["punctuation", ","],
+	["number", "3"],
+	["punctuation", ")"]
+]
+
+----------------------------------------------------
+
+Checks for functions. Based upon https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-array
diff --git a/tests/languages/bicep/keyword_feature.test b/tests/languages/bicep/keyword_feature.test
new file mode 100644
index 0000000000..9a548ae875
--- /dev/null
+++ b/tests/languages/bicep/keyword_feature.test
@@ -0,0 +1,87 @@
+targetScope
+resource appServicePlan 'Microsoft.Web/serverfarms@2020-09-01' existing =  = if (diagnosticsEnabled) {
+  name: logAnalyticsWsName
+}
+module cosmosDb './cosmosdb.bicep' = {
+  name: 'cosmosDbDeploy'
+}
+param env string
+var oneNumber = 123
+output databaseName string = cosmosdbDatabaseName
+for item in cosmosdbAllowedIpAddresses: {
+	ipAddressOrRange: item
+}
+if
+null
+
+----------------------------------------------------
+
+[
+	["keyword", "targetScope"],
+
+	["keyword", "resource"],
+	" appServicePlan ",
+	["string", "'Microsoft.Web/serverfarms@2020-09-01'"],
+	["keyword", "existing"],
+	["operator", "="],
+	["operator", "="],
+	["keyword", "if"],
+	["punctuation", "("],
+	"diagnosticsEnabled",
+	["punctuation", ")"],
+	["punctuation", "{"],
+
+	["property", "name"],
+	["operator", ":"],
+	" logAnalyticsWsName\r\n",
+
+	["punctuation", "}"],
+
+	["keyword", "module"],
+	" cosmosDb ",
+	["string", "'./cosmosdb.bicep'"],
+	["operator", "="],
+	["punctuation", "{"],
+
+	["property", "name"],
+	["operator", ":"],
+	["string", "'cosmosDbDeploy'"],
+
+	["punctuation", "}"],
+
+	["keyword", "param"],
+	" env ",
+	["datatype", "string"],
+
+	["keyword", "var"],
+	" oneNumber ",
+	["operator", "="],
+	["number", "123"],
+
+	["keyword", "output"],
+	" databaseName ",
+	["datatype", "string"],
+	["operator", "="],
+	" cosmosdbDatabaseName\r\n",
+
+	["keyword", "for"],
+	" item ",
+	["keyword", "in"],
+	" cosmosdbAllowedIpAddresses",
+	["operator", ":"],
+	["punctuation", "{"],
+
+	["property", "ipAddressOrRange"],
+	["operator", ":"],
+	" item\r\n",
+
+	["punctuation", "}"],
+
+	["keyword", "if"],
+
+	["keyword", "null"]
+]
+
+----------------------------------------------------
+
+Checks for all keywords.
diff --git a/tests/languages/bicep/number_feature.test b/tests/languages/bicep/number_feature.test
new file mode 100644
index 0000000000..99431b21a8
--- /dev/null
+++ b/tests/languages/bicep/number_feature.test
@@ -0,0 +1,73 @@
+42
+3.14159
+4e10
+3.2E+6
+2.1e-10
+0b1101
+0o571
+0xbabe
+0xBABE
+
+NaN
+Infinity
+
+123n
+0x123n
+
+1_000_000_000_000
+1_000_000.220_720
+0b0101_0110_0011_1000
+0o12_34_56
+0x40_76_38_6A_73
+4_642_473_943_484_686_707n
+0.000_001
+1e10_000
+
+----------------------------------------------------
+
+[
+	["number", "42"],
+	["number", "3.14159"],
+	["number", "4e10"],
+	["number", "3.2E+6"],
+	["number", "2.1e-10"],
+	["number", "0"], "b1101\r\n",
+	["number", "0"], "o571\r\n",
+	["number", "0"], "xbabe\r\n",
+	["number", "0"], "xBABE\r\n\r\nNaN\r\nInfinity\r\n\r\n",
+
+	["number", "123"], "n\r\n",
+	["number", "0"], "x123n\r\n\r\n",
+
+	["number", "1"],
+	"_000_000_000_000\r\n",
+
+	["number", "1"],
+	"_000_000",
+	["punctuation", "."],
+	["number", "220"],
+	"_720\r\n",
+
+	["number", "0"],
+	"b0101_0110_0011_1000\r\n",
+
+	["number", "0"],
+	"o12_34_56\r\n",
+
+	["number", "0"],
+	"x40_76_38_6A_73\r\n",
+
+	["number", "4"],
+	"_642_473_943_484_686_707n\r\n",
+
+	["number", "0.000"],
+	"_001\r\n",
+
+	["number", "1e10"],
+	"_000"
+]
+
+----------------------------------------------------
+
+Checks for decimal numbers, binary numbers, octal numbers, hexadecimal numbers.
+Also checks for keywords representing numbers.
diff --git a/tests/languages/bicep/operator_feature.test b/tests/languages/bicep/operator_feature.test
new file mode 100644
index 0000000000..b5ad0f6334
--- /dev/null
+++ b/tests/languages/bicep/operator_feature.test
@@ -0,0 +1,35 @@
+- -- -=
++ ++ +=
+< <= << <<=
+> >= >> >>= >>> >>>=
+= == === =>
+! != !==
+& && &= &&=
+| || |= ||=
+* ** *= **=
+/ /= ~
+^ ^= % %=
+? : ...
+?? ?. ??=
+
+----------------------------------------------------
+
+[
+	["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", "?"], ["operator", ":"], ["operator", "..."],
+	["operator", "??"], ["operator", "?."], ["operator", "??="]
+]
+
+----------------------------------------------------
+
+Checks for all operators.
diff --git a/tests/languages/bicep/property_feature.test b/tests/languages/bicep/property_feature.test
new file mode 100644
index 0000000000..4bb02cdde2
--- /dev/null
+++ b/tests/languages/bicep/property_feature.test
@@ -0,0 +1,23 @@
+var myObjWithSpecialChars = {
+  '$special\tchars!': true
+  normalKey: 'val'
+}
+
+----------------------------------------------------
+
+[
+	["keyword", "var"],
+	" myObjWithSpecialChars ",
+	["operator", "="],
+	["punctuation", "{"],
+
+	["property", "'$special\\tchars!'"],
+	["operator", ":"],
+	["boolean", "true"],
+
+	["property", "normalKey"],
+	["operator", ":"],
+	["string", "'val'"],
+
+	["punctuation", "}"]
+]
diff --git a/tests/languages/bicep/string_feature.test b/tests/languages/bicep/string_feature.test
new file mode 100644
index 0000000000..7d69ba79e1
--- /dev/null
+++ b/tests/languages/bicep/string_feature.test
@@ -0,0 +1,73 @@
+''
+'hello!'
+'what\'s up?'
+'steve'
+'hello ${name}!'
+'😁\u{1F642}'
+'Microsoft.Web/sites/config@2020-12-01'
+'https://${frontDoorName}.azurefd.net/.auth/login/aad/callback'
+
+'''hello!'''
+var myVar2 = '''
+hello!'''
+'''
+hello!
+'''
+'''
+  this
+    is
+      indented
+'''
+
+'''
+comments // are included
+/* because everything is read as-is */
+'''
+
+'''interpolation
+is ${blocked}'''
+
+----------------------------------------------------
+
+[
+	["string", "''"],
+	["string", "'hello!'"],
+	["string", "'what\\'s up?'"],
+	["string", "'steve'"],
+	["interpolated-string", [
+		["string", "'hello "],
+		["interpolation", [
+			["punctuation", "${"],
+			["expression", ["name"]],
+			["punctuation", "}"]
+		]],
+		["string", "!'"]
+	]],
+	["string", "'😁\\u{1F642}'"],
+	["string", "'Microsoft.Web/sites/config@2020-12-01'"],
+	["interpolated-string", [
+		["string", "'https://"],
+		["interpolation", [
+			["punctuation", "${"],
+			["expression", ["frontDoorName"]],
+			["punctuation", "}"]
+		]],
+		["string", ".azurefd.net/.auth/login/aad/callback'"]
+	]],
+
+	["string", "'''hello!'''"],
+	["keyword", "var"],
+	" myVar2 ",
+	["operator", "="],
+	["string", "'''\r\nhello!'''"],
+	["string", "'''\r\nhello!\r\n'''"],
+	["string", "'''\r\n  this\r\n    is\r\n      indented\r\n'''"],
+
+	["string", "'''\r\ncomments // are included\r\n/* because everything is read as-is */\r\n'''"],
+
+	["string", "'''interpolation\r\nis ${blocked}'''"]
+]
+
+----------------------------------------------------
+
+Checks for strings.
diff --git a/tests/languages/bicep/var_feature.test b/tests/languages/bicep/var_feature.test
new file mode 100644
index 0000000000..87c0a888e2
--- /dev/null
+++ b/tests/languages/bicep/var_feature.test
@@ -0,0 +1,25 @@
+var oneString = 'abc'
+var oneNumber = 123
+var numbers = [
+  123
+]
+var oneObject = {
+	abc: 123
+}
+
+----------------------------------------------------
+
+[
+	["keyword", "var"], " oneString ", ["operator", "="], ["string", "'abc'"],
+	["keyword", "var"], " oneNumber ", ["operator", "="], ["number", "123"],
+	["keyword", "var"], " numbers ", ["operator", "="], ["punctuation", "["],
+	["number", "123"],
+	["punctuation", "]"],
+	["keyword", "var"], " oneObject ", ["operator", "="], ["punctuation", "{"],
+	["property", "abc"], ["operator", ":"], ["number", "123"],
+	["punctuation", "}"]
+]
+
+----------------------------------------------------
+
+Checks for vars.
diff --git a/tests/languages/birb/class-name_feature.test b/tests/languages/birb/class-name_feature.test
new file mode 100644
index 0000000000..946c751f70
--- /dev/null
+++ b/tests/languages/birb/class-name_feature.test
@@ -0,0 +1,63 @@
+class Birb {
+	String name = "Birb";
+	int age = 5;
+	bool isMale = true;
+
+	String getName() {
+		return name;
+	}
+}
+
+List list = ["Seeb", 10, false];
+
+----------------------------------------------------
+
+[
+	["keyword", "class"],
+	["class-name", "Birb"],
+	["punctuation", "{"],
+
+	["class-name", "String"],
+	["variable", "name"],
+	["operator", "="],
+	["string", "\"Birb\""],
+	["punctuation", ";"],
+
+	["class-name", "int"],
+	["variable", "age"],
+	["operator", "="],
+	["number", "5"],
+	["punctuation", ";"],
+
+	["class-name", "bool"],
+	["variable", "isMale"],
+	["operator", "="],
+	["boolean", "true"],
+	["punctuation", ";"],
+
+	["class-name", "String"],
+	["function", "getName"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+
+	["class-name", "return"],
+	["variable", "name"],
+	["punctuation", ";"],
+
+	["punctuation", "}"],
+
+	["punctuation", "}"],
+
+	["class-name", "List"],
+	["variable", "list"],
+	["operator", "="],
+	["punctuation", "["],
+	["string", "\"Seeb\""],
+	["punctuation", ","],
+	["number", "10"],
+	["punctuation", ","],
+	["boolean", "false"],
+	["punctuation", "]"],
+	["punctuation", ";"]
+]
diff --git a/tests/languages/birb/function_feature.test b/tests/languages/birb/function_feature.test
new file mode 100644
index 0000000000..ab0b6f823e
--- /dev/null
+++ b/tests/languages/birb/function_feature.test
@@ -0,0 +1,25 @@
+void foo(int a) {}
+foo(0);
+
+----------------------------------------------------
+
+[
+	["keyword", "void"],
+	["function", "foo"],
+	["punctuation", "("],
+	["class-name", "int"],
+	["variable", "a"],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["function", "foo"],
+	["punctuation", "("],
+	["number", "0"],
+	["punctuation", ")"],
+	["punctuation", ";"]
+]
+
+----------------------------------------------------
+
+Checks for functions.
diff --git a/tests/languages/birb/keyword_feature.test b/tests/languages/birb/keyword_feature.test
new file mode 100644
index 0000000000..3105071968
--- /dev/null
+++ b/tests/languages/birb/keyword_feature.test
@@ -0,0 +1,57 @@
+assert;
+break;
+case;
+class;
+const;
+default;
+else;
+enum;
+final;
+follows;
+for;
+grab;
+if;
+nest;
+next;
+new;
+noSeeb;
+return;
+static;
+switch;
+throw;
+var;
+void;
+while;
+
+----------------------------------------------------
+
+[
+	["keyword", "assert"], ["punctuation", ";"],
+	["keyword", "break"], ["punctuation", ";"],
+	["keyword", "case"], ["punctuation", ";"],
+	["keyword", "class"], ["punctuation", ";"],
+	["keyword", "const"], ["punctuation", ";"],
+	["keyword", "default"], ["punctuation", ";"],
+	["keyword", "else"], ["punctuation", ";"],
+	["keyword", "enum"], ["punctuation", ";"],
+	["keyword", "final"], ["punctuation", ";"],
+	["keyword", "follows"], ["punctuation", ";"],
+	["keyword", "for"], ["punctuation", ";"],
+	["keyword", "grab"], ["punctuation", ";"],
+	["keyword", "if"], ["punctuation", ";"],
+	["keyword", "nest"], ["punctuation", ";"],
+	["keyword", "next"], ["punctuation", ";"],
+	["keyword", "new"], ["punctuation", ";"],
+	["keyword", "noSeeb"], ["punctuation", ";"],
+	["keyword", "return"], ["punctuation", ";"],
+	["keyword", "static"], ["punctuation", ";"],
+	["keyword", "switch"], ["punctuation", ";"],
+	["keyword", "throw"], ["punctuation", ";"],
+	["keyword", "var"], ["punctuation", ";"],
+	["keyword", "void"], ["punctuation", ";"],
+	["keyword", "while"], ["punctuation", ";"]
+]
+
+----------------------------------------------------
+
+Checks for all keywords.
diff --git a/tests/languages/birb/metadata_feature.test b/tests/languages/birb/metadata_feature.test
new file mode 100644
index 0000000000..e87e28d8be
--- /dev/null
+++ b/tests/languages/birb/metadata_feature.test
@@ -0,0 +1,11 @@
+
+
+----------------------------------------------------
+
+[
+	["metadata", ""]
+]
+
+----------------------------------------------------
+
+Checks for metadata.
\ No newline at end of file
diff --git a/tests/languages/birb/operator_feature.test b/tests/languages/birb/operator_feature.test
new file mode 100644
index 0000000000..4017c74c45
--- /dev/null
+++ b/tests/languages/birb/operator_feature.test
@@ -0,0 +1,27 @@
+++ --
+* / % ~/
++ - ! ~
+<< >> ? :
+& ^ |
+>= > <= <
+== != && ||
+= *= /=
+%= += -=
+
+----------------------------------------------------
+
+[
+	["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.
\ No newline at end of file
diff --git a/tests/languages/birb/string_feature.test b/tests/languages/birb/string_feature.test
new file mode 100644
index 0000000000..b3f40ddb7b
--- /dev/null
+++ b/tests/languages/birb/string_feature.test
@@ -0,0 +1,21 @@
+"" ''
+r"" r''
+"fo\"o" 'fo\'o'
+'foo
+bar'
+"foo
+bar"
+
+----------------------------------------------------
+
+[
+	["string", "\"\""], ["string", "''"],
+	["string", "r\"\""], ["string", "r''"],
+	["string", "\"fo\\\"o\""], ["string", "'fo\\'o'"],
+	["string", "'foo\r\nbar'"],
+	["string", "\"foo\r\nbar\""]
+]
+
+----------------------------------------------------
+
+Checks for single quoted, double quoted, and multiline strings
\ No newline at end of file
diff --git a/tests/languages/bison/char_feature.test b/tests/languages/bison/char_feature.test
new file mode 100644
index 0000000000..da4b00afc7
--- /dev/null
+++ b/tests/languages/bison/char_feature.test
@@ -0,0 +1,9 @@
+'+'
+'\''
+
+----------------------------------------------------
+
+[
+	["char", "'+'"],
+	["char", "'\\''"]
+]
diff --git a/tests/languages/bison/number_feature.test b/tests/languages/bison/number_feature.test
index ddbacff94b..3b8e397c61 100644
--- a/tests/languages/bison/number_feature.test
+++ b/tests/languages/bison/number_feature.test
@@ -1,3 +1,9 @@
+%%
+42
+0
+0xBadFace
+%%
+
 42
 0
 0xBadFace
@@ -5,6 +11,14 @@
 ----------------------------------------------------
 
 [
+	["bison", [
+		["punctuation", "%%"],
+		["number", "42"],
+		["number", "0"],
+		["number", "0xBadFace"],
+		["punctuation", "%%"]
+	]],
+
 	["number", "42"],
 	["number", "0"],
 	["number", "0xBadFace"]
@@ -12,4 +26,4 @@
 
 ----------------------------------------------------
 
-Checks for numbers.
\ No newline at end of file
+Checks for numbers.
diff --git a/tests/languages/bison/string_feature.test b/tests/languages/bison/string_feature.test
index 3f3f6c0d58..31289cde05 100644
--- a/tests/languages/bison/string_feature.test
+++ b/tests/languages/bison/string_feature.test
@@ -1,6 +1,6 @@
 %%
-foo: 'foo' "foo";
-bar: '\'' "\"";
+foo: "foo";
+bar: "\"";
 %%
 
 ----------------------------------------------------
@@ -8,14 +8,21 @@ bar: '\'' "\"";
 [
 	["bison", [
 		["punctuation", "%%"],
-		["property", "foo"], ["punctuation", ":"],
-		["string", "'foo'"], ["string", "\"foo\""], ["punctuation", ";"],
-		["property", "bar"], ["punctuation", ":"],
-		["string", "'\\''"], ["string", "\"\\\"\""], ["punctuation", ";"],
+
+		["property", "foo"],
+		["punctuation", ":"],
+		["string", "\"foo\""],
+		["punctuation", ";"],
+
+		["property", "bar"],
+		["punctuation", ":"],
+		["string", "\"\\\"\""],
+		["punctuation", ";"],
+
 		["punctuation", "%%"]
 	]]
 ]
 
 ----------------------------------------------------
 
-Checks for strings.
\ No newline at end of file
+Checks for strings.
diff --git a/tests/languages/brightscript/property_feature.test b/tests/languages/brightscript/property_feature.test
index 3e4ef8f568..a26a06300c 100644
--- a/tests/languages/brightscript/property_feature.test
+++ b/tests/languages/brightscript/property_feature.test
@@ -9,15 +9,11 @@ a = { foo: 5, bar: 6, "foo bar": 7 }
 
 [
 	["punctuation", "{"],
-	["property", "foo"],
-	["operator", ":"],
-	["number", "4"],
-	["property", "\"bar\""],
-	["operator", ":"],
-	["number", "5"],
+	["property", "foo"], ["operator", ":"], ["number", "4"],
+	["property", "\"bar\""], ["operator", ":"], ["number", "5"],
 	["punctuation", "}"],
 
-	"\n\na ",
+	"\r\n\r\na ",
 	["operator", "="],
 	["punctuation", "{"],
 	["property", "foo"],
diff --git a/tests/languages/bro/function_feature.test b/tests/languages/bro/function_feature.test
index a10d792acc..a46f9abfd3 100644
--- a/tests/languages/bro/function_feature.test
+++ b/tests/languages/bro/function_feature.test
@@ -8,14 +8,14 @@ event foo::bar
 ----------------------------------------------------
 
 [
-	["function", [["keyword", "function"], " foo"]],
-	["function", [["keyword", "hook"], " foo"]],
-	["function", [["keyword", "event"], " foo"]],
-	["function", [["keyword", "function"], " foo::bar"]],
-	["function", [["keyword", "hook"], " foo::bar"]],
-	["function", [["keyword", "event"], " foo::bar"]]
+	["keyword", "function"], ["function", "foo"],
+	["keyword", "hook"], ["function", "foo"],
+	["keyword", "event"], ["function", "foo"],
+	["keyword", "function"], ["function", "foo::bar"],
+	["keyword", "hook"], ["function", "foo::bar"],
+	["keyword", "event"], ["function", "foo::bar"]
 ]
 
 ----------------------------------------------------
 
-Checks for the function feature
\ No newline at end of file
+Checks for the function feature
diff --git a/tests/languages/bro/variable_feature.test b/tests/languages/bro/variable_feature.test
index daf51203ba..f84b66e4cb 100644
--- a/tests/languages/bro/variable_feature.test
+++ b/tests/languages/bro/variable_feature.test
@@ -7,14 +7,23 @@ local baz = 66;
 ----------------------------------------------------
 
 [
-	["variable", [["keyword", "local"], " foo"]],
-	["variable", [["keyword", "global"], " foo"]],
-	["variable", [["keyword", "local"], " bool"]],
+	["keyword", "local"],
+	" foo\r\n",
+
+	["keyword", "global"],
+	" foo\r\n",
+
+	["keyword", "local"],
+	["keyword", "bool"],
 	["operator", "="],
 	["boolean", "T"],
 	["punctuation", ";"],
-	["constant", [["keyword", "const"], " bar"]],
-	["variable", [["keyword", "local"], " baz"]],
+
+	["keyword", "const"],
+	["constant", "bar"],
+
+	["keyword", "local"],
+	" baz ",
 	["operator", "="],
 	["number", "66"],
 	["punctuation", ";"]
@@ -22,4 +31,4 @@ local baz = 66;
 
 ----------------------------------------------------
 
-Checks for the highlighting of variables
\ No newline at end of file
+Checks for the highlighting of variables
diff --git a/tests/languages/bsl/comment_feature.test b/tests/languages/bsl/comment_feature.test
new file mode 100644
index 0000000000..a5ec83d1e7
--- /dev/null
+++ b/tests/languages/bsl/comment_feature.test
@@ -0,0 +1,13 @@
+//
+// foobar
+
+----------------------------------------------------
+
+[
+	["comment", "//"],
+	["comment", "// foobar"]
+]
+
+----------------------------------------------------
+
+Checks for comments.
\ No newline at end of file
diff --git a/tests/languages/bsl/directive_feature.test b/tests/languages/bsl/directive_feature.test
new file mode 100644
index 0000000000..df0b91ee07
--- /dev/null
+++ b/tests/languages/bsl/directive_feature.test
@@ -0,0 +1,13 @@
+&Client
+
+#If Server Then
+#EndIf
+
+----------------------------------------------------
+
+[
+	["directive", "&Client"],
+
+	["directive", "#If Server Then"],
+	["directive", "#EndIf"]
+]
diff --git a/tests/languages/bsl/keyword_feature.test b/tests/languages/bsl/keyword_feature.test
new file mode 100644
index 0000000000..6ae1cc431b
--- /dev/null
+++ b/tests/languages/bsl/keyword_feature.test
@@ -0,0 +1,37 @@
+пока для новый прервать попытка
+исключение вызватьисключение иначе конецпопытки неопределено
+функция перем возврат конецфункции
+если иначеесли процедура конецпроцедуры тогда
+знач экспорт конецесли
+из каждого истина по
+цикл конеццикла выполнить
+while for new break try
+except raise else endtry undefined 
+function var return endfunction null
+if elseif procedure endprocedure then
+val export endif
+in each true false to
+do enddo execute
+----------------------------------------------------
+
+[	
+	["keyword", "пока"], ["keyword", "для"], ["keyword", "новый"], ["keyword", "прервать"], ["keyword", "попытка"],
+	["keyword", "исключение"], ["keyword", "вызватьисключение"], ["keyword", "иначе"], ["keyword", "конецпопытки"], ["keyword", "неопределено"],
+	["keyword", "функция"], ["keyword", "перем"], ["keyword", "возврат"], ["keyword", "конецфункции"],
+	["keyword", "если"], ["keyword", "иначеесли"], ["keyword", "процедура"], ["keyword", "конецпроцедуры"], ["keyword", "тогда"],
+	["keyword", "знач"], ["keyword", "экспорт"], ["keyword", "конецесли"],
+	["keyword", "из"], ["keyword", "каждого"], ["keyword", "истина"], ["keyword", "по"],
+	["keyword", "цикл"], ["keyword", "конеццикла"], ["keyword", "выполнить"],	
+	
+	["keyword", "while"], ["keyword", "for"], ["keyword", "new"], ["keyword", "break"], ["keyword", "try"],
+	["keyword", "except"], ["keyword", "raise"], ["keyword", "else"], ["keyword", "endtry"], ["keyword", "undefined"],
+	["keyword", "function"], ["keyword", "var"], ["keyword", "return"], ["keyword", "endfunction"], ["keyword", "null"],
+	["keyword", "if"], ["keyword", "elseif"], ["keyword", "procedure"], ["keyword", "endprocedure"], ["keyword", "then"],
+	["keyword", "val"], ["keyword", "export"], ["keyword", "endif"],
+	["keyword", "in"], ["keyword", "each"], ["keyword", "true"], ["keyword", "false"], ["keyword", "to"],
+	["keyword", "do"], ["keyword", "enddo"], ["keyword", "execute"]
+]
+
+----------------------------------------------------
+
+Checks for all keywords.
\ No newline at end of file
diff --git a/tests/languages/bsl/number_feature.test b/tests/languages/bsl/number_feature.test
new file mode 100644
index 0000000000..eab59e397c
--- /dev/null
+++ b/tests/languages/bsl/number_feature.test
@@ -0,0 +1,13 @@
+42
+3.14159
+
+----------------------------------------------------
+
+[
+	["number", "42"],
+	["number", "3.14159"]
+]
+
+----------------------------------------------------
+
+Checks for decimal.
\ No newline at end of file
diff --git a/tests/languages/bsl/operator_feature.test b/tests/languages/bsl/operator_feature.test
new file mode 100644
index 0000000000..5a93288c29
--- /dev/null
+++ b/tests/languages/bsl/operator_feature.test
@@ -0,0 +1,17 @@
+< <= > >=
++ - * /
+% =
+and or not и или не
+----------------------------------------------------
+
+[	
+	["operator", "<"], ["operator", "<="], ["operator", ">"], ["operator", ">="],
+	["operator", "+"], ["operator", "-"], ["operator", "*"], ["operator", "/"],
+	["operator", "%"], ["operator", "="],	
+	["operator", "and"], ["operator", "or"], ["operator", "not"], ["operator", "и"], ["operator", "или"], ["operator", "не"]
+	
+]
+
+----------------------------------------------------
+
+Checks for operators.
\ No newline at end of file
diff --git a/tests/languages/bsl/punctuation_feature.test b/tests/languages/bsl/punctuation_feature.test
new file mode 100644
index 0000000000..9a6f11899f
--- /dev/null
+++ b/tests/languages/bsl/punctuation_feature.test
@@ -0,0 +1,18 @@
+(. .)
+( ) [ ] : ; , .
+
+----------------------------------------------------
+
+[
+	["punctuation", "(."],
+	["punctuation", ".)"],
+
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", ":"],
+	["punctuation", ";"],
+	["punctuation", ","],
+	["punctuation", "."]
+]
diff --git a/tests/languages/bsl/string_feature.test b/tests/languages/bsl/string_feature.test
new file mode 100644
index 0000000000..abb8b2dba4
--- /dev/null
+++ b/tests/languages/bsl/string_feature.test
@@ -0,0 +1,19 @@
+""
+"fo"
+
+''
+'foo'
+
+----------------------------------------------------
+
+[
+	["string", "\"\""],
+	["string", "\"fo\""],
+
+	["string", "''"],
+	["string", "'foo'"]
+]
+
+----------------------------------------------------
+
+Checks for strings and chars.
diff --git a/tests/languages/c/char_feature.test b/tests/languages/c/char_feature.test
new file mode 100644
index 0000000000..aea75234eb
--- /dev/null
+++ b/tests/languages/c/char_feature.test
@@ -0,0 +1,35 @@
+'a'
+'\n'
+'\13'
+'🍌'
+'ab'
+
+u'a'
+u'¢'
+u'猫'
+U'猫'
+L'猫'
+
+'\1\2\3\4'
+'\xFF'
+u'\U0001f34c'
+
+----------------------------------------------------
+
+[
+	["char", "'a'"],
+	["char", "'\\n'"],
+	["char", "'\\13'"],
+	["char", "'🍌'"],
+	["char", "'ab'"],
+
+	"\r\n\r\nu", ["char", "'a'"],
+	"\r\nu", ["char", "'¢'"],
+	"\r\nu", ["char", "'猫'"],
+	"\r\nU", ["char", "'猫'"],
+	"\r\nL", ["char", "'猫'"],
+
+	["char", "'\\1\\2\\3\\4'"],
+	["char", "'\\xFF'"],
+	"\r\nu", ["char", "'\\U0001f34c'"]
+]
diff --git a/tests/languages/c/class-name_feature.test b/tests/languages/c/class-name_feature.test
index 2c2e63f420..664611624b 100644
--- a/tests/languages/c/class-name_feature.test
+++ b/tests/languages/c/class-name_feature.test
@@ -1,16 +1,22 @@
-struct foo
-enum bar
+struct foo;
+enum bar;
 
 struct foo var;
 struct __attribute__ ((aligned (8))) S { short f[3]; };
 
+// by name
+uint32_t foo;
+static dtrace_helptrace_t *bar;
+
 ----------------------------------------------------
 
 [
 	["keyword", "struct"],
 	["class-name", "foo"],
+	["punctuation", ";"],
 	["keyword", "enum"],
 	["class-name", "bar"],
+	["punctuation", ";"],
 
 	["keyword", "struct"],
 	["class-name", "foo"],
@@ -35,9 +41,19 @@ struct __attribute__ ((aligned (8))) S { short f[3]; };
 	["punctuation", "]"],
 	["punctuation", ";"],
 	["punctuation", "}"],
+	["punctuation", ";"],
+
+	["comment", "// by name"],
+	["class-name", "uint32_t"],
+	" foo",
+	["punctuation", ";"],
+	["keyword", "static"],
+	["class-name", "dtrace_helptrace_t"],
+	["operator", "*"],
+	"bar",
 	["punctuation", ";"]
 ]
 
 ----------------------------------------------------
 
-Checks for structs and enums.
+Checks for structs and enums.
\ No newline at end of file
diff --git a/tests/languages/c/macro_feature.test b/tests/languages/c/macro_feature.test
index 8ae3d473ac..5c20083342 100644
--- a/tests/languages/c/macro_feature.test
+++ b/tests/languages/c/macro_feature.test
@@ -24,6 +24,7 @@
 */ 1
 
 #define FOO 1 // trailing comment
+#define FOO (1 + 1)
 
 #define MAX(a, b) \
 	((a) < (b) ? (b) : (a))
@@ -46,8 +47,8 @@
 	["macro", [
 		["directive-hash", "#"],
 		["directive", "define"],
+		["macro-name", "PG_locked"],
 		["expression", [
-			"PG_locked ",
 			["number", "0"]
 		]]
 	]],
@@ -117,9 +118,7 @@
 	["macro", [
 		["directive-hash", "#"],
 		["directive", "define"],
-		["expression", [
-			"FOO "
-		]],
+		["macro-name", "FOO"],
 		["comment", "/*\r\n comment\r\n*/"],
 		["expression", [
 			["number", "1"]
@@ -129,18 +128,30 @@
 	["macro", [
 		["directive-hash", "#"],
 		["directive", "define"],
+		["macro-name", "FOO"],
 		["expression", [
-			"FOO ",
 			["number", "1"]
 		]],
 		["comment", "// trailing comment"]
 	]],
+	["macro", [
+		["directive-hash", "#"],
+		["directive", "define"],
+		["macro-name", "FOO"],
+		["expression", [
+			["punctuation", "("],
+			["number", "1"],
+			["operator", "+"],
+			["number", "1"],
+			["punctuation", ")"]
+		]]
+	]],
 
 	["macro", [
 		["directive-hash", "#"],
 		["directive", "define"],
+		["macro-name", "MAX"],
 		["expression", [
-			["function", "MAX"],
 			["punctuation", "("],
 			"a",
 			["punctuation", ","],
@@ -172,8 +183,8 @@
 	["macro", [
 		["directive-hash", "#"],
 		["directive", "define"],
+		["macro-name", "BAR"],
 		["expression", [
-			["function", "BAR"],
 			["punctuation", "("],
 			"s",
 			["punctuation", ")"],
@@ -188,4 +199,4 @@
 
 ----------------------------------------------------
 
-Checks for macros and paths inside include statements.
+Checks for macros and paths inside include statements.
\ No newline at end of file
diff --git a/tests/languages/c/string_feature.test b/tests/languages/c/string_feature.test
new file mode 100644
index 0000000000..a1e7ec4d3f
--- /dev/null
+++ b/tests/languages/c/string_feature.test
@@ -0,0 +1,34 @@
+""
+"foo"
+"\x12"
+"3"
+
+"\xff""f"
+
+"foo\
+bar"
+
+"a猫🍌"
+u8"a猫🍌"
+u"a猫🍌"
+U"a猫🍌"
+L"a猫🍌"
+
+----------------------------------------------------
+
+[
+	["string", "\"\""],
+	["string", "\"foo\""],
+	["string", "\"\\x12\""],
+	["string", "\"3\""],
+
+	["string", "\"\\xff\""], ["string", "\"f\""],
+
+	["string", "\"foo\\\r\nbar\""],
+
+	["string", "\"a猫🍌\""],
+	"\r\nu8", ["string", "\"a猫🍌\""],
+	"\r\nu", ["string", "\"a猫🍌\""],
+	"\r\nU", ["string", "\"a猫🍌\""],
+	"\r\nL", ["string", "\"a猫🍌\""]
+]
diff --git a/tests/languages/cfscript/comment_feature.test b/tests/languages/cfscript/comment_feature.test
new file mode 100644
index 0000000000..b6ae720792
--- /dev/null
+++ b/tests/languages/cfscript/comment_feature.test
@@ -0,0 +1,23 @@
+// foobar
+/**/
+/* foo
+bar */
+/**
+* @product.hint
+*/
+
+----------------------------------------------------
+
+[
+	["comment", "// foobar"],
+	["comment", ["/**/"]],
+	["comment", ["/* foo\r\nbar */"]],
+	["comment", [
+		"/**\r\n*", ["annotation", " @product.hint"],
+		"\r\n*/"
+	]]
+]
+
+----------------------------------------------------
+
+Checks for single-line and multi-line comments along with annotation
diff --git a/tests/languages/cfscript/function-variable_feature.test b/tests/languages/cfscript/function-variable_feature.test
new file mode 100644
index 0000000000..2d13bfa1bc
--- /dev/null
+++ b/tests/languages/cfscript/function-variable_feature.test
@@ -0,0 +1,137 @@
+foo = function (  ) {}
+foo = function ( x, y) {}
+{foo: function () {}}
+fooBar = x => x
+fooBar = ( x, y ) => x
+ಠ_ಠ = () => {}
+d = function Example({ props: { a: _A, b} } = Props) {}
+f = function (x = fun()) {}
+l = (x = fun(), y) => {}
+a = function () {}, b = () => {}
+
+----------------------------------------------------
+
+[
+	["function-variable", "foo"],
+	["operator", "="],
+	["keyword", "function"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["function-variable", "foo"],
+	["operator", "="],
+	["keyword", "function"],
+	["punctuation", "("],
+	" x",
+	["punctuation", ","],
+	" y",
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["punctuation", "{"],
+	["function-variable", "foo"],
+	["operator", ":"],
+	["keyword", "function"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", "}"],
+
+	["function-variable", "fooBar"],
+	["operator", "="],
+	" x ",
+	["operator", "=>"],
+	" x\r\n",
+
+	["function-variable", "fooBar"],
+	["operator", "="],
+	["punctuation", "("],
+	" x",
+	["punctuation", ","],
+	" y ",
+	["punctuation", ")"],
+	["operator", "=>"],
+	" x\r\n",
+
+	["function-variable", "ಠ_ಠ"],
+	["operator", "="],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["operator", "=>"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["function-variable", "d"],
+	["operator", "="],
+	["keyword", "function"],
+	["function", "Example"],
+	["punctuation", "("],
+	["punctuation", "{"],
+	" props",
+	["operator", ":"],
+	["punctuation", "{"],
+	" a",
+	["operator", ":"],
+	" _A",
+	["punctuation", ","],
+	" b",
+	["punctuation", "}"],
+	["punctuation", "}"],
+	["operator", "="],
+	" Props",
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["function-variable", "f"],
+	["operator", "="],
+	["keyword", "function"],
+	["punctuation", "("],
+	"x ",
+	["operator", "="],
+	["function", "fun"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["function-variable", "l"],
+	["operator", "="],
+	["punctuation", "("],
+	"x ",
+	["operator", "="],
+	["function", "fun"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ","],
+	" y",
+	["punctuation", ")"],
+	["operator", "=>"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["function-variable", "a"],
+	["operator", "="],
+	["keyword", "function"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", ","],
+	["function-variable", "b"],
+	["operator", "="],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["operator", "=>"],
+	["punctuation", "{"],
+	["punctuation", "}"]
+]
+
+----------------------------------------------------
+
+Checks for variables obviously containing functions.
diff --git a/tests/languages/cfscript/keyword_feature.test b/tests/languages/cfscript/keyword_feature.test
new file mode 100644
index 0000000000..0791a3bf9d
--- /dev/null
+++ b/tests/languages/cfscript/keyword_feature.test
@@ -0,0 +1,71 @@
+abstract
+break
+catch
+component
+continue
+default
+do
+else
+extends
+final
+finally
+for
+function
+if
+in
+include
+package
+private
+property
+public
+remote
+required
+rethrow
+return
+static
+switch
+throw
+try
+var
+while
+xml
+
+----------------------------------------------------
+
+[
+	["keyword", "abstract"],
+	["keyword", "break"],
+	["keyword", "catch"],
+	["keyword", "component"],
+	["keyword", "continue"],
+	["keyword", "default"],
+	["keyword", "do"],
+	["keyword", "else"],
+	["keyword", "extends"],
+	["keyword", "final"],
+	["keyword", "finally"],
+	["keyword", "for"],
+	["keyword", "function"],
+	["keyword", "if"],
+	["keyword", "in"],
+	["keyword", "include"],
+	["keyword", "package"],
+	["keyword", "private"],
+	["keyword", "property"],
+	["keyword", "public"],
+	["keyword", "remote"],
+	["keyword", "required"],
+	["keyword", "rethrow"],
+	["keyword", "return"],
+	["keyword", "static"],
+	["keyword", "switch"],
+	["keyword", "throw"],
+	["keyword", "try"],
+	["keyword", "var"],
+	["keyword", "while"],
+	["keyword", "xml"]
+]
+
+----------------------------------------------------
+
+Checks for all keywords.
diff --git a/tests/languages/cfscript/operator_feature.test b/tests/languages/cfscript/operator_feature.test
new file mode 100644
index 0000000000..54fe40ae53
--- /dev/null
+++ b/tests/languages/cfscript/operator_feature.test
@@ -0,0 +1,71 @@
++ ++ +=
+- -- -=
+! !=
+< <=
+> >=
+= ==
+=== !==
+& && &=
+| ||
+: ::
+? ?. ?:
+^ ^=
+* *=
+/ /=
+% %=
+
+and
+contains
+eq
+equal
+eqv
+gt
+gte
+imp
+is
+lt
+lte
+mod
+not
+or
+xor
+
+----------------------------------------------------
+
+[
+	["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", "and"],
+	["operator", "contains"],
+	["operator", "eq"],
+	["operator", "equal"],
+	["operator", "eqv"],
+	["operator", "gt"],
+	["operator", "gte"],
+	["operator", "imp"],
+	["operator", "is"],
+	["operator", "lt"],
+	["operator", "lte"],
+	["operator", "mod"],
+	["operator", "not"],
+	["operator", "or"],
+	["operator", "xor"]
+]
+
+----------------------------------------------------
+
+Checks for all operators.
diff --git a/tests/languages/cfscript/scope_feature.test b/tests/languages/cfscript/scope_feature.test
new file mode 100644
index 0000000000..70dfb96d8a
--- /dev/null
+++ b/tests/languages/cfscript/scope_feature.test
@@ -0,0 +1,29 @@
+application
+arguments
+cgi
+client
+cookie
+local
+session
+super
+this
+variables
+
+----------------------------------------------------
+
+[
+	["scope", "application"],
+	["scope", "arguments"],
+	["scope", "cgi"],
+	["scope", "client"],
+	["scope", "cookie"],
+	["scope", "local"],
+	["scope", "session"],
+	["scope", "super"],
+	["scope", "this"],
+	["scope", "variables"]
+]
+
+----------------------------------------------------
+
+Checks for all scopes.
diff --git a/tests/languages/cfscript/type_feature.test b/tests/languages/cfscript/type_feature.test
new file mode 100644
index 0000000000..120ab7b911
--- /dev/null
+++ b/tests/languages/cfscript/type_feature.test
@@ -0,0 +1,35 @@
+any
+array
+binary
+boolean
+date
+guid
+numeric
+query
+string
+struct
+uuid
+void
+xml=
+
+----------------------------------------------------
+
+[
+	["type", "any"],
+	["type", "array"],
+	["type", "binary"],
+	["type", "boolean"],
+	["type", "date"],
+	["type", "guid"],
+	["type", "numeric"],
+	["type", "query"],
+	["type", "string"],
+	["type", "struct"],
+	["type", "uuid"],
+	["type", "void"],
+	["type", "xml"], ["operator", "="]
+]
+
+----------------------------------------------------
+
+Checks for all types.
diff --git a/tests/languages/chaiscript/boolean_feature.test b/tests/languages/chaiscript/boolean_feature.test
new file mode 100644
index 0000000000..9f981c0d79
--- /dev/null
+++ b/tests/languages/chaiscript/boolean_feature.test
@@ -0,0 +1,9 @@
+true
+false
+
+----------------------------------------------------
+
+[
+	["boolean", "true"],
+	["boolean", "false"]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/comment_feature.test b/tests/languages/chaiscript/comment_feature.test
new file mode 100644
index 0000000000..992ea69656
--- /dev/null
+++ b/tests/languages/chaiscript/comment_feature.test
@@ -0,0 +1,16 @@
+// comment
+/*
+ comment
+*/
+
+/*
+ comment
+
+----------------------------------------------------
+
+[
+	["comment", "// comment"],
+	["comment", "/*\r\n comment\r\n*/"],
+
+	["comment", "/*\r\n comment"]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/function_feature.test b/tests/languages/chaiscript/function_feature.test
new file mode 100644
index 0000000000..9f8b389dc6
--- /dev/null
+++ b/tests/languages/chaiscript/function_feature.test
@@ -0,0 +1,190 @@
+attr Rectangle::height
+attr Rectangle::width
+def Rectangle::Rectangle() { this.height = 10; this.width = 20 }
+def Rectangle::area() { this.height * this.width }
+var rect = Rectangle()
+rect.height = 30
+print(rect.area())
+
+class Rectangle {
+  attr height
+  attr width
+  def Rectangle() { this.height = 10; this.width = 20 }
+  def area() { this.height * this.width }
+}
+var rect = Rectangle()
+rect.height = 30
+print(rect.area())
+
+def update(dt) {
+  x = x + 20.0f * dt
+}
+
+def foo(int x, Vector y) {}
+
+----------------------------------------------------
+
+[
+	["keyword", "attr"],
+	["class-name", "Rectangle"],
+	["operator", "::"],
+	"height\r\n",
+
+	["keyword", "attr"],
+	["class-name", "Rectangle"],
+	["operator", "::"],
+	"width\r\n",
+
+	["keyword", "def"],
+	["class-name", "Rectangle"],
+	["operator", "::"],
+	["function", "Rectangle"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"height ",
+	["operator", "="],
+	["number", "10"],
+	["punctuation", ";"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"width ",
+	["operator", "="],
+	["number", "20"],
+	["punctuation", "}"],
+
+	["keyword", "def"],
+	["class-name", "Rectangle"],
+	["operator", "::"],
+	["function", "area"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"height ",
+	["operator", "*"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"width ",
+	["punctuation", "}"],
+
+	["keyword", "var"],
+	" rect ",
+	["operator", "="],
+	["function", "Rectangle"],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	"\r\nrect",
+	["punctuation", "."],
+	"height ",
+	["operator", "="],
+	["number", "30"],
+
+	["function", "print"],
+	["punctuation", "("],
+	"rect",
+	["punctuation", "."],
+	["function", "area"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ")"],
+
+	["keyword", "class"],
+	["class-name", "Rectangle"],
+	["punctuation", "{"],
+
+	["keyword", "attr"],
+	" height\r\n  ",
+
+	["keyword", "attr"],
+	" width\r\n  ",
+
+	["keyword", "def"],
+	["function", "Rectangle"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"height ",
+	["operator", "="],
+	["number", "10"],
+	["punctuation", ";"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"width ",
+	["operator", "="],
+	["number", "20"],
+	["punctuation", "}"],
+
+	["keyword", "def"],
+	["function", "area"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"height ",
+	["operator", "*"],
+	["keyword", "this"],
+	["punctuation", "."],
+	"width ",
+	["punctuation", "}"],
+
+	["punctuation", "}"],
+
+	["keyword", "var"],
+	" rect ",
+	["operator", "="],
+	["function", "Rectangle"],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	"\r\nrect",
+	["punctuation", "."],
+	"height ",
+	["operator", "="],
+	["number", "30"],
+
+	["function", "print"],
+	["punctuation", "("],
+	"rect",
+	["punctuation", "."],
+	["function", "area"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ")"],
+
+	["keyword", "def"],
+	["function", "update"],
+	["punctuation", "("],
+	"dt",
+	["punctuation", ")"],
+	["punctuation", "{"],
+
+	"\r\n  x ",
+	["operator", "="],
+	" x ",
+	["operator", "+"],
+	["number", "20.0f"],
+	["operator", "*"],
+	" dt\r\n",
+
+	["punctuation", "}"],
+
+	["keyword", "def"],
+	["function", "foo"],
+	["punctuation", "("],
+	["parameter-type", "int"],
+	" x",
+	["punctuation", ","],
+	["parameter-type", "Vector"],
+	" y",
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/keyword_feature.test b/tests/languages/chaiscript/keyword_feature.test
new file mode 100644
index 0000000000..f317447617
--- /dev/null
+++ b/tests/languages/chaiscript/keyword_feature.test
@@ -0,0 +1,47 @@
+attr;
+auto;
+break;
+case;
+catch;
+class;
+continue;
+def;
+default;
+else;
+finally;
+for;
+fun;
+global;
+if;
+return;
+switch;
+this;
+try;
+var;
+while;
+
+----------------------------------------------------
+
+[
+	["keyword", "attr"], ["punctuation", ";"],
+	["keyword", "auto"], ["punctuation", ";"],
+	["keyword", "break"], ["punctuation", ";"],
+	["keyword", "case"], ["punctuation", ";"],
+	["keyword", "catch"], ["punctuation", ";"],
+	["keyword", "class"], ["punctuation", ";"],
+	["keyword", "continue"], ["punctuation", ";"],
+	["keyword", "def"], ["punctuation", ";"],
+	["keyword", "default"], ["punctuation", ";"],
+	["keyword", "else"], ["punctuation", ";"],
+	["keyword", "finally"], ["punctuation", ";"],
+	["keyword", "for"], ["punctuation", ";"],
+	["keyword", "fun"], ["punctuation", ";"],
+	["keyword", "global"], ["punctuation", ";"],
+	["keyword", "if"], ["punctuation", ";"],
+	["keyword", "return"], ["punctuation", ";"],
+	["keyword", "switch"], ["punctuation", ";"],
+	["keyword", "this"], ["punctuation", ";"],
+	["keyword", "try"], ["punctuation", ";"],
+	["keyword", "var"], ["punctuation", ";"],
+	["keyword", "while"], ["punctuation", ";"]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/number_feature.test b/tests/languages/chaiscript/number_feature.test
new file mode 100644
index 0000000000..22798cad88
--- /dev/null
+++ b/tests/languages/chaiscript/number_feature.test
@@ -0,0 +1,19 @@
+Infinity
+NaN
+
+1e-5
+35.5E+8
+0.01e19
+1.2f
+
+----------------------------------------------------
+
+[
+	["number", "Infinity"],
+	["number", "NaN"],
+
+	["number", "1e-5"],
+	["number", "35.5E+8"],
+	["number", "0.01e19"],
+	["number", "1.2f"]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/operator_feature.test b/tests/languages/chaiscript/operator_feature.test
new file mode 100644
index 0000000000..063d0a94e3
--- /dev/null
+++ b/tests/languages/chaiscript/operator_feature.test
@@ -0,0 +1,74 @@
+?
+|| &&
+| ^ &
+== !=
+< <= > >=
+<< >>
++ -
+* / %
+++ -- - + ! ~
+
+= :=
++= -= *= /= %= <<= >>= &= ^= |=
+: ::
+
+// operator references
+`+`
+
+----------------------------------------------------
+
+[
+	["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", "// operator references"],
+	["operator", "`+`"]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/punctuation_feature.test b/tests/languages/chaiscript/punctuation_feature.test
new file mode 100644
index 0000000000..cfdd322901
--- /dev/null
+++ b/tests/languages/chaiscript/punctuation_feature.test
@@ -0,0 +1,17 @@
+( ) [ ] { }
+; , .
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["punctuation", ";"],
+	["punctuation", ","],
+	["punctuation", "."]
+]
\ No newline at end of file
diff --git a/tests/languages/chaiscript/string_feature.test b/tests/languages/chaiscript/string_feature.test
new file mode 100644
index 0000000000..fdc72461da
--- /dev/null
+++ b/tests/languages/chaiscript/string_feature.test
@@ -0,0 +1,71 @@
+"string"
+"lhs: ${lhs}, rhs: ${rhs}"
+"${3 + 5} is 8"
+"method_missing(${i}, ${name}), ${v.size()} params"
+
+'f'
+
+----------------------------------------------------
+
+[
+	["string-interpolation", [
+		["string", "\"string\""]
+	]],
+	["string-interpolation", [
+		["string", "\"lhs: "],
+		["interpolation", [
+			["interpolation-punctuation", "${"],
+			["interpolation-expression", ["lhs"]],
+			["interpolation-punctuation", "}"]
+		]],
+		["string", ", rhs: "],
+		["interpolation", [
+			["interpolation-punctuation", "${"],
+			["interpolation-expression", ["rhs"]],
+			["interpolation-punctuation", "}"]
+		]],
+		["string", "\""]
+	]],
+	["string-interpolation", [
+		["string", "\""],
+		["interpolation", [
+			["interpolation-punctuation", "${"],
+			["interpolation-expression", [
+				["number", "3"],
+				["operator", "+"],
+				["number", "5"]
+			]],
+			["interpolation-punctuation", "}"]
+		]],
+		["string", " is 8\""]
+	]],
+	["string-interpolation", [
+		["string", "\"method_missing("],
+		["interpolation", [
+			["interpolation-punctuation", "${"],
+			["interpolation-expression", ["i"]],
+			["interpolation-punctuation", "}"]
+		]],
+		["string", ", "],
+		["interpolation", [
+			["interpolation-punctuation", "${"],
+			["interpolation-expression", ["name"]],
+			["interpolation-punctuation", "}"]
+		]],
+		["string", "), "],
+		["interpolation", [
+			["interpolation-punctuation", "${"],
+			["interpolation-expression", [
+				"v",
+				["punctuation", "."],
+				["function", "size"],
+				["punctuation", "("],
+				["punctuation", ")"]
+			]],
+			["interpolation-punctuation", "}"]
+		]],
+		["string", " params\""]
+	]],
+
+	["string", "'f'"]
+]
\ No newline at end of file
diff --git a/tests/languages/cil/directive_feature.test b/tests/languages/cil/directive_feature.test
new file mode 100644
index 0000000000..452b558c95
--- /dev/null
+++ b/tests/languages/cil/directive_feature.test
@@ -0,0 +1,15 @@
+.class public Foo {
+.method
+.maxstack 2
+
+----------------------------------------------------
+
+[
+	["directive", ".class"],
+	["keyword", "public"],
+	" Foo ",
+	["punctuation", "{"],
+	["directive", ".method"],
+	["directive", ".maxstack"],
+	["number", "2"]
+]
diff --git a/tests/languages/cil/number_feature.test b/tests/languages/cil/number_feature.test
new file mode 100644
index 0000000000..fe3fe8900a
--- /dev/null
+++ b/tests/languages/cil/number_feature.test
@@ -0,0 +1,13 @@
+0x0
+0xFF.5F
+-0x1
+-0xFF.5F
+
+----------------------------------------------------
+
+[
+	["number", "0x0"],
+	["number", "0xFF.5F"],
+	"\r\n-", ["number", "0x1"],
+	"\r\n-", ["number", "0xFF.5F"]
+]
diff --git a/tests/languages/cil/punctuation_feature.test b/tests/languages/cil/punctuation_feature.test
new file mode 100644
index 0000000000..57d6604dc0
--- /dev/null
+++ b/tests/languages/cil/punctuation_feature.test
@@ -0,0 +1,21 @@
+( ) [ ] { }
+; , : =
+
+IL_001f
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", ";"],
+	["punctuation", ","],
+	["punctuation", ":"],
+	["punctuation", "="],
+
+	["punctuation", "IL_001f"]
+]
diff --git a/tests/languages/clojure/function_feature.test b/tests/languages/clojure/function_feature.test
new file mode 100644
index 0000000000..28fd4a5f83
--- /dev/null
+++ b/tests/languages/clojure/function_feature.test
@@ -0,0 +1,13 @@
+(foo args)
+
+; not a function
+'(a b c)
+
+----------------------------------------------------
+
+[
+	["punctuation", "("], ["function", "foo"], " args", ["punctuation", ")"],
+
+	["comment", "; not a function"],
+	"\r\n'", ["punctuation", "("], "a b c", ["punctuation", ")"]
+]
diff --git a/tests/languages/clojure/number_feature.test b/tests/languages/clojure/number_feature.test
new file mode 100644
index 0000000000..7ca0213914
--- /dev/null
+++ b/tests/languages/clojure/number_feature.test
@@ -0,0 +1,27 @@
+123
+01234
+0xFFF
+2r0101011
+8r52
+36r16
+1.0
+1M
+2/3
+0.6666666666666666
+36786883868216818816N
+
+----------------------------------------------------
+
+[
+	["number", "123"],
+	["number", "01234"],
+	["number", "0xFFF"],
+	["number", "2r0101011"],
+	["number", "8r52"],
+	["number", "36r16"],
+	["number", "1.0"],
+	["number", "1M"],
+	["number", "2/3"],
+	["number", "0.6666666666666666"],
+	["number", "36786883868216818816N"]
+]
diff --git a/tests/languages/clojure/operator_feature.test b/tests/languages/clojure/operator_feature.test
new file mode 100644
index 0000000000..7c57567c97
--- /dev/null
+++ b/tests/languages/clojure/operator_feature.test
@@ -0,0 +1,11 @@
+# @ ^ ` ~
+
+----------------------------------------------------
+
+[
+	["operator", "#"],
+	["operator", "@"],
+	["operator", "^"],
+	["operator", "`"],
+	["operator", "~"]
+]
diff --git a/tests/languages/clojure/punctuation_feature.test b/tests/languages/clojure/punctuation_feature.test
new file mode 100644
index 0000000000..ea9bbc2188
--- /dev/null
+++ b/tests/languages/clojure/punctuation_feature.test
@@ -0,0 +1,15 @@
+{ } [ ] ( )
+,
+
+----------------------------------------------------
+
+[
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	["punctuation", ","]
+]
diff --git a/tests/languages/clojure/string_feature.test b/tests/languages/clojure/string_feature.test
index 4ac9059227..718b652acc 100644
--- a/tests/languages/clojure/string_feature.test
+++ b/tests/languages/clojure/string_feature.test
@@ -2,13 +2,15 @@
 "Fo\"obar"
 "multi-line
 string"
+\NewLine
 
 ----------------------------------------------------
 
 [
 	["string", "\"\""],
 	["string", "\"Fo\\\"obar\""],
-	["string", "\"multi-line\nstring\""]
+	["string", "\"multi-line\r\nstring\""],
+	["char", "\\NewLine"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/clojure/symbol_feature.test b/tests/languages/clojure/symbol_feature.test
new file mode 100644
index 0000000000..e43df4fd9c
--- /dev/null
+++ b/tests/languages/clojure/symbol_feature.test
@@ -0,0 +1,11 @@
+:foo
+:foo/bar-baz
+::foo
+
+----------------------------------------------------
+
+[
+	["symbol", ":foo"],
+	["symbol", ":foo/bar-baz"],
+	["symbol", "::foo"]
+]
diff --git a/tests/languages/cmake/string_feature.test b/tests/languages/cmake/string_feature.test
index ad61364325..717851d2ea 100644
--- a/tests/languages/cmake/string_feature.test
+++ b/tests/languages/cmake/string_feature.test
@@ -10,29 +10,39 @@ string"
 
 [
 	["string", ["\"This is a string\""]],
-	["string", ["\"This is \nmulti\nline\nstring\""]],
+	["string", ["\"This is \r\nmulti\r\nline\r\nstring\""]],
 	["string", [
 		"\"",
 		["interpolation", [
-			["punctuation", "${"], ["variable", "VAR"], ["punctuation", "}"]]
-		],
+			["punctuation", "${"],
+			["variable", "VAR"],
+			["punctuation", "}"]
+		]],
 		"with",
 		["interpolation", [
-			["punctuation", "${"], ["variable", "BAR"], ["punctuation", "}"]]
-		], "\""]
-	],
+			["punctuation", "${"],
+			["variable", "BAR"],
+			["punctuation", "}"]
+		]],
+		"\""
+	]],
 	["string", [
 		"\"",
 		["interpolation", [
-			["punctuation", "${"], ["variable", "FOO"], ["punctuation", "}"]]
-		],
+			["punctuation", "${"],
+			["variable", "FOO"],
+			["punctuation", "}"]
+		]],
 		" with ",
 		["interpolation", [
-			["punctuation", "${"], ["variable", "BAR"], ["punctuation", "}"]]
-		], "\""]
-	]
+			["punctuation", "${"],
+			["variable", "BAR"],
+			["punctuation", "}"]
+		]],
+		"\""
+	]]
 ]
 
 ----------------------------------------------------
 
-Checks for strings.
\ No newline at end of file
+Checks for strings.
diff --git a/tests/languages/cobol/boolean_feature.test b/tests/languages/cobol/boolean_feature.test
new file mode 100644
index 0000000000..fb3632f821
--- /dev/null
+++ b/tests/languages/cobol/boolean_feature.test
@@ -0,0 +1,9 @@
+false False FALSE
+true True TRUE
+
+----------------------------------------------------
+
+[
+	["boolean", "false"], ["boolean", "False"], ["boolean", "FALSE"],
+	["boolean", "true"], ["boolean", "True"], ["boolean", "TRUE"]
+]
\ No newline at end of file
diff --git a/tests/languages/cobol/class-name_feature.test b/tests/languages/cobol/class-name_feature.test
new file mode 100644
index 0000000000..31021a4d69
--- /dev/null
+++ b/tests/languages/cobol/class-name_feature.test
@@ -0,0 +1,84 @@
+PIC 99/99/9999 SOURCE sales-date.
+PIC $$$$9.99 SOURCE sales-amount.
+PIC X(34) SOURCE sales-record.
+
+pic 9 usage computational value is 5.
+pic 99 value is 10.
+
+pic x(2)
+pic a(20).
+
+greeting pic x(12) value is "Hello World".
+
+----------------------------------------------------
+
+[
+	["keyword", "PIC"],
+	["class-name", ["99/99/9999"]],
+	["keyword", "SOURCE"],
+	" sales-date",
+	["punctuation", "."],
+
+	["keyword", "PIC"],
+	["class-name", ["$$$$9.99"]],
+	["keyword", "SOURCE"],
+	" sales-amount",
+	["punctuation", "."],
+
+	["keyword", "PIC"],
+	["class-name", [
+		"X",
+		["punctuation", "("],
+		["number", "34"],
+		["punctuation", ")"]
+	]],
+	["keyword", "SOURCE"],
+	" sales-record",
+	["punctuation", "."],
+
+	["keyword", "pic"],
+	["class-name", ["9"]],
+	["keyword", "usage"],
+	["keyword", "computational"],
+	["keyword", "value"],
+	["keyword", "is"],
+	["number", "5"],
+	["punctuation", "."],
+
+	["keyword", "pic"],
+	["class-name", ["99"]],
+	["keyword", "value"],
+	["keyword", "is"],
+	["number", "10"],
+	["punctuation", "."],
+
+	["keyword", "pic"],
+	["class-name", [
+		"x",
+		["punctuation", "("],
+		["number", "2"],
+		["punctuation", ")"]
+	]],
+
+	["keyword", "pic"],
+	["class-name", [
+		"a",
+		["punctuation", "("],
+		["number", "20"],
+		["punctuation", ")"]
+	]],
+	["punctuation", "."],
+
+	"\r\n\r\ngreeting ",
+	["keyword", "pic"],
+	["class-name", [
+		"x",
+		["punctuation", "("],
+		["number", "12"],
+		["punctuation", ")"]
+	]],
+	["keyword", "value"],
+	["keyword", "is"],
+	["string", "\"Hello World\""],
+	["punctuation", "."]
+]
diff --git a/tests/languages/cobol/comment_feature.test b/tests/languages/cobol/comment_feature.test
new file mode 100644
index 0000000000..5eb1b8d563
--- /dev/null
+++ b/tests/languages/cobol/comment_feature.test
@@ -0,0 +1,11 @@
+*> comment
+
+* temporary variables in computational usage.
+
+----------------------------------------------------
+
+[
+	["comment", "*> comment"],
+
+	["comment", "* temporary variables in computational usage."]
+]
\ No newline at end of file
diff --git a/tests/languages/cobol/level_feature.test b/tests/languages/cobol/level_feature.test
new file mode 100644
index 0000000000..8e3640f3a9
--- /dev/null
+++ b/tests/languages/cobol/level_feature.test
@@ -0,0 +1,126 @@
+01 ServiceRecord.
+   05 SSN                        pic 9(9).
+   05 Name.
+      10 GivenName               pic a(20).
+      10 FamilyName              pic a(20).
+   05 Rank.
+      10 RankType                pic a(1)
+         88 ValidRankType        value 'O' 'E' 'W'.
+         88 Enlisted             value 'E'.
+         88 WarrantOfficer       value 'W'.
+         88 CommissionedOfficer  value 'W'.
+      10 Grade                   pic x(2)
+         88 ValidGrade           value '1' '2' '3' '4' '5' '6' '7' '8' '9' '10' '1E' '2E' '3E'.
+
+----------------------------------------------------
+
+[
+	["level", "01"],
+	" ServiceRecord",
+	["punctuation", "."],
+
+	["level", "05"],
+	" SSN                        ",
+	["keyword", "pic"],
+	["class-name", [
+		"9",
+		["punctuation", "("],
+		["number", "9"],
+		["punctuation", ")"]
+	]],
+	["punctuation", "."],
+
+	["level", "05"],
+	" Name",
+	["punctuation", "."],
+
+	["level", "10"],
+	" GivenName               ",
+	["keyword", "pic"],
+	["class-name", [
+		"a",
+		["punctuation", "("],
+		["number", "20"],
+		["punctuation", ")"]
+	]],
+	["punctuation", "."],
+
+	["level", "10"],
+	" FamilyName              ",
+	["keyword", "pic"],
+	["class-name", [
+		"a",
+		["punctuation", "("],
+		["number", "20"],
+		["punctuation", ")"]
+	]],
+	["punctuation", "."],
+
+	["level", "05"],
+	" Rank",
+	["punctuation", "."],
+
+	["level", "10"],
+	" RankType                ",
+	["keyword", "pic"],
+	["class-name", [
+		"a",
+		["punctuation", "("],
+		["number", "1"],
+		["punctuation", ")"]
+	]],
+
+	["level", "88"],
+	" ValidRankType        ",
+	["keyword", "value"],
+	["string", "'O'"],
+	["string", "'E'"],
+	["string", "'W'"],
+	["punctuation", "."],
+
+	["level", "88"],
+	" Enlisted             ",
+	["keyword", "value"],
+	["string", "'E'"],
+	["punctuation", "."],
+
+	["level", "88"],
+	" WarrantOfficer       ",
+	["keyword", "value"],
+	["string", "'W'"],
+	["punctuation", "."],
+
+	["level", "88"],
+	" CommissionedOfficer  ",
+	["keyword", "value"],
+	["string", "'W'"],
+	["punctuation", "."],
+
+	["level", "10"],
+	" Grade                   ",
+	["keyword", "pic"],
+	["class-name", [
+		"x",
+		["punctuation", "("],
+		["number", "2"],
+		["punctuation", ")"]
+	]],
+
+	["level", "88"],
+	" ValidGrade           ",
+	["keyword", "value"],
+	["string", "'1'"],
+	["string", "'2'"],
+	["string", "'3'"],
+	["string", "'4'"],
+	["string", "'5'"],
+	["string", "'6'"],
+	["string", "'7'"],
+	["string", "'8'"],
+	["string", "'9'"],
+	["string", "'10'"],
+	["string", "'1E'"],
+	["string", "'2E'"],
+	["string", "'3E'"],
+	["punctuation", "."]
+]
\ No newline at end of file
diff --git a/tests/languages/cobol/number_feature.test b/tests/languages/cobol/number_feature.test
new file mode 100644
index 0000000000..4a73f1e502
--- /dev/null
+++ b/tests/languages/cobol/number_feature.test
@@ -0,0 +1,23 @@
+zero Zero ZERO
+
+= 0
+= 123
+= .4e-5
+= +3e5
+= -43
+
+x"ff"
+
+----------------------------------------------------
+
+[
+	["number", "zero"], ["number", "Zero"], ["number", "ZERO"],
+
+	["operator", "="], ["number", "0"],
+	["operator", "="], ["number", "123"],
+	["operator", "="], ["number", ".4e-5"],
+	["operator", "="], ["number", "+3e5"],
+	["operator", "="], ["number", "-43"],
+
+	["string", "x\"ff\""]
+]
\ No newline at end of file
diff --git a/tests/languages/cobol/operator_feature.test b/tests/languages/cobol/operator_feature.test
new file mode 100644
index 0000000000..872ccc8832
--- /dev/null
+++ b/tests/languages/cobol/operator_feature.test
@@ -0,0 +1,21 @@
++ - * /
+= <> < <= > >=
+&
+
+----------------------------------------------------
+
+[
+	["operator", "+"],
+	["operator", "-"],
+	["operator", "*"],
+	["operator", "/"],
+
+	["operator", "="],
+	["operator", "<>"],
+	["operator", "<"],
+	["operator", "<="],
+	["operator", ">"],
+	["operator", ">="],
+
+	["operator", "&"]
+]
\ No newline at end of file
diff --git a/tests/languages/cobol/punctuation_feature.test b/tests/languages/cobol/punctuation_feature.test
new file mode 100644
index 0000000000..5d033d5a1c
--- /dev/null
+++ b/tests/languages/cobol/punctuation_feature.test
@@ -0,0 +1,9 @@
+( )
+. : ,
+
+----------------------------------------------------
+
+[
+	["punctuation", "("], ["punctuation", ")"],
+	["punctuation", "."], ["punctuation", ":"], ["punctuation", ","]
+]
\ No newline at end of file
diff --git a/tests/languages/cobol/string_feature.test b/tests/languages/cobol/string_feature.test
new file mode 100644
index 0000000000..705f1c4c1f
--- /dev/null
+++ b/tests/languages/cobol/string_feature.test
@@ -0,0 +1,13 @@
+""
+''
+"foo""bar"
+'foo''bar'
+
+----------------------------------------------------
+
+[
+	["string", "\"\""],
+	["string", "''"],
+	["string", "\"foo\"\"bar\""],
+	["string", "'foo''bar'"]
+]
\ No newline at end of file
diff --git a/tests/languages/coffeescript+haml/coffeescript_inclusion.test b/tests/languages/coffeescript+haml/coffeescript_inclusion.test
index 7a7751692d..866b85faf6 100644
--- a/tests/languages/coffeescript+haml/coffeescript_inclusion.test
+++ b/tests/languages/coffeescript+haml/coffeescript_inclusion.test
@@ -10,15 +10,19 @@
 [
 	["filter-coffee", [
 		["filter-name", ":coffee"],
-		["string", "'This is coffee script'"]
+		["text", [
+			["string", "'This is coffee script'"]
+		]]
 	]],
 	["punctuation", "~"],
 	["filter-coffee", [
-        ["filter-name", ":coffee"],
-        ["string", "'This is coffee script'"]
-    ]]
+		["filter-name", ":coffee"],
+		["text", [
+			["string", "'This is coffee script'"]
+		]]
+	]]
 ]
 
 ----------------------------------------------------
 
-Checks for CoffeeScript filter in Haml. The tilde serves only as a separator.
\ No newline at end of file
+Checks for CoffeeScript filter in Haml. The tilde serves only as a separator.
diff --git a/tests/languages/coffeescript+pug/coffeescript_inclusion.test b/tests/languages/coffeescript+pug/coffeescript_inclusion.test
index ccf8963ba1..0ae21dc076 100644
--- a/tests/languages/coffeescript+pug/coffeescript_inclusion.test
+++ b/tests/languages/coffeescript+pug/coffeescript_inclusion.test
@@ -6,14 +6,16 @@
 [
 	["filter-coffee", [
 		["filter-name", ":coffee"],
-		["string", [
-			"\"",
-			["interpolation", "#{foo}"],
-			"\""
+		["text", [
+			["string", [
+				"\"",
+				["interpolation", "#{foo}"],
+				"\""
+			]]
 		]]
 	]]
 ]
 
 ----------------------------------------------------
 
-Checks for coffee filter (CoffeeScript) in Jade.
\ No newline at end of file
+Checks for coffee filter (CoffeeScript) in pug.
diff --git a/tests/languages/coffeescript/inline-javascript_feature.test b/tests/languages/coffeescript/inline-javascript_feature.test
index cf15e26c0a..c6fbd2fcc3 100644
--- a/tests/languages/coffeescript/inline-javascript_feature.test
+++ b/tests/languages/coffeescript/inline-javascript_feature.test
@@ -7,16 +7,20 @@ JS here */`
 [
 	["inline-javascript", [
 		["delimiter", "`"],
-		["comment", "/* JS here */"],
+		["script", [
+			["comment", "/* JS here */"]
+		]],
 		["delimiter", "`"]
 	]],
 	["inline-javascript", [
-        ["delimiter", "`"],
-        ["comment", "/*\r\nJS here */"],
-        ["delimiter", "`"]
-    ]]
+		["delimiter", "`"],
+		["script", [
+			["comment", "/*\r\nJS here */"]
+		]],
+		["delimiter", "`"]
+	]]
 ]
 
 ----------------------------------------------------
 
-Checks for inline JavaScript.
\ No newline at end of file
+Checks for inline JavaScript.
diff --git a/tests/languages/concurnas/comment_feature.test b/tests/languages/concurnas/comment_feature.test
new file mode 100644
index 0000000000..cbcafa7068
--- /dev/null
+++ b/tests/languages/concurnas/comment_feature.test
@@ -0,0 +1,11 @@
+// comment
+/*
+comment
+*/
+
+----------------------------------------------------
+
+[
+	["comment", "// comment"],
+	["comment", "/*\r\ncomment\r\n*/"]
+]
diff --git a/tests/languages/concurnas/function_feature.test b/tests/languages/concurnas/function_feature.test
index 32611b7b9d..9f9905a4e9 100644
--- a/tests/languages/concurnas/function_feature.test
+++ b/tests/languages/concurnas/function_feature.test
@@ -4,10 +4,18 @@ myfunc()
 ----------------------------------------------------
 
 [
-	["keyword", "def"], ["function", "myfunc"], ["punctuation", "("], ["punctuation", ")"], ["operator", "=>"], ["number", "12"],
-	"\r\nmyfunc" , ["punctuation", "("], ["punctuation", ")"]
+	["keyword", "def"],
+	["function", "myfunc"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["operator", "=>"],
+	["number", "12"],
+
+	"\r\nmyfunc",
+	["punctuation", "("],
+	["punctuation", ")"]
 ]
 
 ----------------------------------------------------
 
-Checks for functions.
\ No newline at end of file
+Checks for functions.
diff --git a/tests/languages/concurnas/keyword_feature.test b/tests/languages/concurnas/keyword_feature.test
index cdf3fdb9d3..45e38f7aaf 100644
--- a/tests/languages/concurnas/keyword_feature.test
+++ b/tests/languages/concurnas/keyword_feature.test
@@ -1,20 +1,20 @@
-as
+abstract
+actor
+also
+annotation
 assert
 async
 await
-band
 bool
 boolean
-bor
 break
-bxor
 byte
 case
 catch
 changed
 char
+class
 closed
-comp
 constant
 continue
 def
@@ -23,6 +23,7 @@ del
 double
 elif
 else
+enum
 every
 extends
 false
@@ -39,14 +40,11 @@ in
 init
 inject
 int
-is
-isnot
 lambda
 local
 long
 loop
 match
-mod
 new
 nodefault
 null
@@ -63,6 +61,7 @@ pre
 private
 protected
 provide
+provider
 public
 return
 shared
@@ -74,6 +73,7 @@ super
 sync
 this
 throw
+trait
 trans
 transient
 true
@@ -90,23 +90,23 @@ with
 ----------------------------------------------------
 
 [
-	["operator", "as"],
+	["keyword", "abstract"],
+	["keyword", "actor"],
+	["keyword", "also"],
+	["keyword", "annotation"],
 	["keyword", "assert"],
 	["keyword", "async"],
 	["keyword", "await"],
-	["operator", "band"],
 	["keyword", "bool"],
 	["keyword", "boolean"],
-	["operator", "bor"],
 	["keyword", "break"],
-	["operator", "bxor"],
 	["keyword", "byte"],
 	["keyword", "case"],
 	["keyword", "catch"],
 	["keyword", "changed"],
 	["keyword", "char"],
+	["keyword", "class"],
 	["keyword", "closed"],
-	["operator", "comp"],
 	["keyword", "constant"],
 	["keyword", "continue"],
 	["keyword", "def"],
@@ -115,6 +115,7 @@ with
 	["keyword", "double"],
 	["keyword", "elif"],
 	["keyword", "else"],
+	["keyword", "enum"],
 	["keyword", "every"],
 	["keyword", "extends"],
 	["keyword", "false"],
@@ -131,14 +132,11 @@ with
 	["keyword", "init"],
 	["keyword", "inject"],
 	["keyword", "int"],
-	["operator", "is"],
-	["operator", "isnot"],
 	["keyword", "lambda"],
 	["keyword", "local"],
 	["keyword", "long"],
 	["keyword", "loop"],
 	["keyword", "match"],
-	["operator", "mod"],
 	["keyword", "new"],
 	["keyword", "nodefault"],
 	["keyword", "null"],
@@ -155,6 +153,7 @@ with
 	["keyword", "private"],
 	["keyword", "protected"],
 	["keyword", "provide"],
+	["keyword", "provider"],
 	["keyword", "public"],
 	["keyword", "return"],
 	["keyword", "shared"],
@@ -166,6 +165,7 @@ with
 	["keyword", "sync"],
 	["keyword", "this"],
 	["keyword", "throw"],
+	["keyword", "trait"],
 	["keyword", "trans"],
 	["keyword", "transient"],
 	["keyword", "true"],
@@ -182,4 +182,4 @@ with
 
 ----------------------------------------------------
 
-Checks for keywords.
\ No newline at end of file
+Checks for keywords.
diff --git a/tests/languages/concurnas/langext_feature.test b/tests/languages/concurnas/langext_feature.test
new file mode 100644
index 0000000000..34606886af
--- /dev/null
+++ b/tests/languages/concurnas/langext_feature.test
@@ -0,0 +1,23 @@
+myAPL || x[⍋x←6?40] ||
+SimpleLisp||(+ 1 2 (* 3 3 ) )||
+
+ || invalid ||
+
+----------------------------------------------------
+
+[
+	["langext", [
+		["class-name", "myAPL"],
+		["punctuation", "||"],
+		["string", " x[⍋x←6?40] "],
+		["punctuation", "||"]
+	]],
+	["langext", [
+		["class-name", "SimpleLisp"],
+		["punctuation", "||"],
+		["string", "(+ 1 2 (* 3 3 ) )"],
+		["punctuation", "||"]
+	]],
+
+	"\r\n\r\n || invalid ||"
+]
diff --git a/tests/languages/concurnas/operator_feature.test b/tests/languages/concurnas/operator_feature.test
index 41e009a889..f19761e411 100644
--- a/tests/languages/concurnas/operator_feature.test
+++ b/tests/languages/concurnas/operator_feature.test
@@ -4,30 +4,63 @@
 &== &<>
 isnot
 is as
+comp
 / /= * *=
 mod mod=
 < <== > >==
 and or
-bor bxor
-^
+band bor bxor
+^ ~
 
 ----------------------------------------------------
 
 [
-	["operator", "+"], ["operator", "++"], ["operator", "+="],
-	["operator", "-"], ["operator", "--"], ["operator", "-="],
-	["operator", "="], ["operator", "=="], ["operator", "<>"],
-	["operator", "&=="], ["operator", "&<>"],
+	["operator", "+"],
+	["operator", "++"],
+	["operator", "+="],
+
+	["operator", "-"],
+	["operator", "--"],
+	["operator", "-="],
+
+	["operator", "="],
+	["operator", "=="],
+	["operator", "<>"],
+
+	["operator", "&=="],
+	["operator", "&<>"],
+
 	["operator", "isnot"],
-	["operator", "is"], ["operator", "as"],
-	["operator", "/"], ["operator", "/="], ["operator", "*"], ["operator", "*="],
-	["operator", "mod"], ["operator", "mod="],
-	["operator", "<"], ["operator", "<=="], ["operator", ">"], ["operator", ">=="],
-	["operator", "and"], ["operator", "or"],
-	["operator", "bor"], ["operator", "bxor"],
-	["operator", "^"]
+
+	["operator", "is"],
+	["operator", "as"],
+
+	["operator", "comp"],
+
+	["operator", "/"],
+	["operator", "/="],
+	["operator", "*"],
+	["operator", "*="],
+
+	["operator", "mod"],
+	["operator", "mod="],
+
+	["operator", "<"],
+	["operator", "<=="],
+	["operator", ">"],
+	["operator", ">=="],
+
+	["operator", "and"],
+	["operator", "or"],
+
+	["operator", "band"],
+	["operator", "bor"],
+	["operator", "bxor"],
+
+	["operator", "^"],
+	["operator", "~"]
 ]
 
 ----------------------------------------------------
 
-Checks for operators.
\ No newline at end of file
+Checks for operators.
diff --git a/tests/languages/concurnas/regex_feature.test b/tests/languages/concurnas/regex_feature.test
new file mode 100644
index 0000000000..5615bdc7d8
--- /dev/null
+++ b/tests/languages/concurnas/regex_feature.test
@@ -0,0 +1,13 @@
+r'say'
+r"hello"
+
+----------------------------------------------------
+
+[
+	["regex-literal", [
+		["regex", "r'say'"]
+	]],
+	["regex-literal", [
+		["regex", "r\"hello\""]
+	]]
+]
diff --git a/tests/languages/concurnas/string_feature.test b/tests/languages/concurnas/string_feature.test
index 609a5b38fb..ee0c237b29 100644
--- a/tests/languages/concurnas/string_feature.test
+++ b/tests/languages/concurnas/string_feature.test
@@ -1,23 +1,33 @@
 "hi"
+"addition result: {1+2}"
 'hi'
-r'say'
-r"hello"
 'contains: "'
-myAPL || x[⍋x←6?40] ||
- || invalid ||
 
 ----------------------------------------------------
 
 [
-    ["string", [["string", "\"hi\""]]],
-    ["string", [["string", "'hi'"]]],
-    ["string", [["string", "r'say'"]]],
-    ["string", [["string", "r\"hello\""]]],
-    ["string", [["string", "'contains: \"'"]]],
-	["langext", "myAPL || x[⍋x←6?40] ||"],
-	"\r\n || invalid ||"
+	["string-literal", [
+		["string", "\"hi\""]
+	]],
+	["string-literal", [
+		["string", "\"addition result: "],
+		["interpolation", [
+			["punctuation", "{"],
+			["number", "1"],
+			["operator", "+"],
+			["number", "2"],
+			["punctuation", "}"]
+		]],
+		["string", "\""]
+	]],
+	["string-literal", [
+		["string", "'hi'"]
+	]],
+	["string-literal", [
+		["string", "'contains: \"'"]
+	]]
 ]
 
 ----------------------------------------------------
 
-Checks for raw strings.
\ No newline at end of file
+Checks for raw strings.
diff --git a/tests/languages/coq/attribute_feature.test b/tests/languages/coq/attribute_feature.test
new file mode 100644
index 0000000000..7d727fc1a0
--- /dev/null
+++ b/tests/languages/coq/attribute_feature.test
@@ -0,0 +1,93 @@
+#[program]
+#[program=yes]
+#[deprecated(since="8.9.0")]
+#[local, universes(polymorphic)]
+#[universes(polymorphic(foo,bar))]
+#[canonical=yes, canonical=no]
+#[ export ]
+
+(* legacy *)
+Cumulative
+Global
+Local
+Monomorphic
+NonCumulative
+Polymorphic
+Private
+Program
+
+----------------------------------------------------
+
+[
+	["attribute", [
+		["punctuation", "#["],
+		"program",
+		["punctuation", "]"]
+	]],
+	["attribute", [
+		["punctuation", "#["],
+		"program",
+		["operator", "="],
+		"yes",
+		["punctuation", "]"]
+	]],
+	["attribute", [
+		["punctuation", "#["],
+		"deprecated",
+		["punctuation", "("],
+		"since",
+		["operator", "="],
+		["string", "\"8.9.0\""],
+		["punctuation", ")"],
+		["punctuation", "]"]
+	]],
+	["attribute", [
+		["punctuation", "#["],
+		"local",
+		["punctuation", ","],
+		" universes",
+		["punctuation", "("],
+		"polymorphic",
+		["punctuation", ")"],
+		["punctuation", "]"]
+	]],
+	["attribute", [
+		["punctuation", "#["],
+		"universes",
+		["punctuation", "("],
+		"polymorphic",
+		["punctuation", "("],
+		"foo",
+		["punctuation", ","],
+		"bar",
+		["punctuation", ")"],
+		["punctuation", ")"],
+		["punctuation", "]"]
+	]],
+	["attribute", [
+		["punctuation", "#["],
+		"canonical",
+		["operator", "="],
+		"yes",
+		["punctuation", ","],
+		" canonical",
+		["operator", "="],
+		"no",
+		["punctuation", "]"]
+	]],
+	["attribute", [
+		["punctuation", "#["],
+		" export ",
+		["punctuation", "]"]
+	]],
+
+	["comment", "(* legacy *)"],
+	["attribute", "Cumulative"],
+	["attribute", "Global"],
+	["attribute", "Local"],
+	["attribute", "Monomorphic"],
+	["attribute", "NonCumulative"],
+	["attribute", "Polymorphic"],
+	["attribute", "Private"],
+	["attribute", "Program"]
+]
diff --git a/tests/languages/coq/comment_feature.test b/tests/languages/coq/comment_feature.test
new file mode 100644
index 0000000000..9564560a59
--- /dev/null
+++ b/tests/languages/coq/comment_feature.test
@@ -0,0 +1,17 @@
+(**)
+(* comment *)
+(*
+ comment
+ *)
+
+(* comments (* can be (* nested *) *) *)
+
+----------------------------------------------------
+
+[
+	["comment", "(**)"],
+	["comment", "(* comment *)"],
+	["comment", "(*\r\n comment\r\n *)"],
+
+	["comment", "(* comments (* can be (* nested *) *) *)"]
+]
\ No newline at end of file
diff --git a/tests/languages/coq/keyword_feature.test b/tests/languages/coq/keyword_feature.test
new file mode 100644
index 0000000000..8e17324efe
--- /dev/null
+++ b/tests/languages/coq/keyword_feature.test
@@ -0,0 +1,547 @@
+_
+Abort
+About
+Add
+Admit
+Admitted
+All
+apply
+Arguments
+as
+As
+Assumptions
+at
+Axiom
+Axioms
+Back
+BackTo
+Backtrace
+Bind
+BinOp
+BinOpSpec
+BinRel
+Blacklist
+by
+Canonical
+Case
+Cd
+Check
+Class
+Classes
+Close
+Coercion
+Coercions
+cofix
+CoFixpoint
+CoInductive
+Collection
+Combined
+Compute
+Conjecture
+Conjectures
+Constant
+Constants
+Constraint
+Constructors
+Context
+Corollary
+Create
+CstOp
+Custom
+Cut
+Debug
+Declare
+Defined
+Definition
+Delimit
+Dependencies
+Dependent
+Derive
+Diffs
+Drop
+Elimination
+else
+end
+End
+Entry
+Equality
+Eval
+Example
+Existential
+Existentials
+Existing
+exists
+exists2
+Export
+Extern
+Extraction
+Fact
+Fail
+Field
+File
+Firstorder
+fix
+Fixpoint
+Flags
+Focus
+for
+forall
+From
+fun
+Funclass
+Function
+Functional
+GC
+Generalizable
+Goal
+Grab
+Grammar
+Graph
+Guarded
+Haskell
+Heap
+Hide
+Hint
+HintDb
+Hints
+Hypotheses
+Hypothesis
+Identity
+if
+IF
+Immediate
+Implicit
+Implicits
+Import
+in
+Include
+Induction
+Inductive
+Infix
+Info
+Initial
+InjTyp
+Inline
+Inspect
+Instance
+Instances
+Intro
+Intros
+Inversion
+Inversion_clear
+JSON
+Language
+Left
+Lemma
+let
+Let
+Lia
+Libraries
+Library
+Load
+LoadPath
+Locate
+Ltac
+Ltac2
+match
+Match
+measure
+Method
+Minimality
+ML
+Module
+Modules
+Morphism
+move
+Next
+NoInline
+Notation
+Number
+Obligation
+Obligations
+OCaml
+Opaque
+Open
+Optimize
+Parameter
+Parameters
+Parametric
+Path
+Paths
+Prenex
+Preterm
+Primitive
+Print
+Profile
+Projections
+Proof
+Prop
+PropBinOp
+Property
+PropOp
+Proposition
+PropUOp
+Pwd
+Qed
+Quit
+Rec
+Record
+Recursive
+Redirect
+Reduction
+Register
+Relation
+Remark
+Remove
+removed
+Require
+Reserved
+Reset
+Resolve
+Restart
+return
+Rewrite
+Right
+Ring
+Rings
+Saturate
+Save
+Scheme
+Scope
+Scopes
+Search
+SearchHead
+SearchPattern
+SearchRewrite
+Section
+Separate
+Set
+Setoid
+Show
+Signatures
+Solve
+Solver
+Sort
+Sortclass
+Sorted
+Spec
+SProp
+Step
+Strategies
+Strategy
+String
+struct
+Structure
+SubClass
+Subgraph
+SuchThat
+Tactic
+Term
+TestCompile
+then
+Theorem
+Time
+Timeout
+To
+Transparent
+Type
+Typeclasses
+Types
+Typing
+Undelimit
+Undo
+Unfocus
+Unfocused
+Unfold
+Universe
+Universes
+UnOp
+UnOpSpec
+Unshelve
+using
+Variable
+Variables
+Variant
+Verbose
+View
+Visibility
+wf
+where
+with
+Zify
+
+----------------------------------------------------
+
+[
+	["keyword", "_"],
+	["keyword", "Abort"],
+	["keyword", "About"],
+	["keyword", "Add"],
+	["keyword", "Admit"],
+	["keyword", "Admitted"],
+	["keyword", "All"],
+	["keyword", "apply"],
+	["keyword", "Arguments"],
+	["keyword", "as"],
+	["keyword", "As"],
+	["keyword", "Assumptions"],
+	["keyword", "at"],
+	["keyword", "Axiom"],
+	["keyword", "Axioms"],
+	["keyword", "Back"],
+	["keyword", "BackTo"],
+	["keyword", "Backtrace"],
+	["keyword", "Bind"],
+	["keyword", "BinOp"],
+	["keyword", "BinOpSpec"],
+	["keyword", "BinRel"],
+	["keyword", "Blacklist"],
+	["keyword", "by"],
+	["keyword", "Canonical"],
+	["keyword", "Case"],
+	["keyword", "Cd"],
+	["keyword", "Check"],
+	["keyword", "Class"],
+	["keyword", "Classes"],
+	["keyword", "Close"],
+	["keyword", "Coercion"],
+	["keyword", "Coercions"],
+	["keyword", "cofix"],
+	["keyword", "CoFixpoint"],
+	["keyword", "CoInductive"],
+	["keyword", "Collection"],
+	["keyword", "Combined"],
+	["keyword", "Compute"],
+	["keyword", "Conjecture"],
+	["keyword", "Conjectures"],
+	["keyword", "Constant"],
+	["keyword", "Constants"],
+	["keyword", "Constraint"],
+	["keyword", "Constructors"],
+	["keyword", "Context"],
+	["keyword", "Corollary"],
+	["keyword", "Create"],
+	["keyword", "CstOp"],
+	["keyword", "Custom"],
+	["keyword", "Cut"],
+	["keyword", "Debug"],
+	["keyword", "Declare"],
+	["keyword", "Defined"],
+	["keyword", "Definition"],
+	["keyword", "Delimit"],
+	["keyword", "Dependencies"],
+	["keyword", "Dependent"],
+	["keyword", "Derive"],
+	["keyword", "Diffs"],
+	["keyword", "Drop"],
+	["keyword", "Elimination"],
+	["keyword", "else"],
+	["keyword", "end"],
+	["keyword", "End"],
+	["keyword", "Entry"],
+	["keyword", "Equality"],
+	["keyword", "Eval"],
+	["keyword", "Example"],
+	["keyword", "Existential"],
+	["keyword", "Existentials"],
+	["keyword", "Existing"],
+	["keyword", "exists"],
+	["keyword", "exists2"],
+	["keyword", "Export"],
+	["keyword", "Extern"],
+	["keyword", "Extraction"],
+	["keyword", "Fact"],
+	["keyword", "Fail"],
+	["keyword", "Field"],
+	["keyword", "File"],
+	["keyword", "Firstorder"],
+	["keyword", "fix"],
+	["keyword", "Fixpoint"],
+	["keyword", "Flags"],
+	["keyword", "Focus"],
+	["keyword", "for"],
+	["keyword", "forall"],
+	["keyword", "From"],
+	["keyword", "fun"],
+	["keyword", "Funclass"],
+	["keyword", "Function"],
+	["keyword", "Functional"],
+	["keyword", "GC"],
+	["keyword", "Generalizable"],
+	["keyword", "Goal"],
+	["keyword", "Grab"],
+	["keyword", "Grammar"],
+	["keyword", "Graph"],
+	["keyword", "Guarded"],
+	["keyword", "Haskell"],
+	["keyword", "Heap"],
+	["keyword", "Hide"],
+	["keyword", "Hint"],
+	["keyword", "HintDb"],
+	["keyword", "Hints"],
+	["keyword", "Hypotheses"],
+	["keyword", "Hypothesis"],
+	["keyword", "Identity"],
+	["keyword", "if"],
+	["keyword", "IF"],
+	["keyword", "Immediate"],
+	["keyword", "Implicit"],
+	["keyword", "Implicits"],
+	["keyword", "Import"],
+	["keyword", "in"],
+	["keyword", "Include"],
+	["keyword", "Induction"],
+	["keyword", "Inductive"],
+	["keyword", "Infix"],
+	["keyword", "Info"],
+	["keyword", "Initial"],
+	["keyword", "InjTyp"],
+	["keyword", "Inline"],
+	["keyword", "Inspect"],
+	["keyword", "Instance"],
+	["keyword", "Instances"],
+	["keyword", "Intro"],
+	["keyword", "Intros"],
+	["keyword", "Inversion"],
+	["keyword", "Inversion_clear"],
+	["keyword", "JSON"],
+	["keyword", "Language"],
+	["keyword", "Left"],
+	["keyword", "Lemma"],
+	["keyword", "let"],
+	["keyword", "Let"],
+	["keyword", "Lia"],
+	["keyword", "Libraries"],
+	["keyword", "Library"],
+	["keyword", "Load"],
+	["keyword", "LoadPath"],
+	["keyword", "Locate"],
+	["keyword", "Ltac"],
+	["keyword", "Ltac2"],
+	["keyword", "match"],
+	["keyword", "Match"],
+	["keyword", "measure"],
+	["keyword", "Method"],
+	["keyword", "Minimality"],
+	["keyword", "ML"],
+	["keyword", "Module"],
+	["keyword", "Modules"],
+	["keyword", "Morphism"],
+	["keyword", "move"],
+	["keyword", "Next"],
+	["keyword", "NoInline"],
+	["keyword", "Notation"],
+	["keyword", "Number"],
+	["keyword", "Obligation"],
+	["keyword", "Obligations"],
+	["keyword", "OCaml"],
+	["keyword", "Opaque"],
+	["keyword", "Open"],
+	["keyword", "Optimize"],
+	["keyword", "Parameter"],
+	["keyword", "Parameters"],
+	["keyword", "Parametric"],
+	["keyword", "Path"],
+	["keyword", "Paths"],
+	["keyword", "Prenex"],
+	["keyword", "Preterm"],
+	["keyword", "Primitive"],
+	["keyword", "Print"],
+	["keyword", "Profile"],
+	["keyword", "Projections"],
+	["keyword", "Proof"],
+	["keyword", "Prop"],
+	["keyword", "PropBinOp"],
+	["keyword", "Property"],
+	["keyword", "PropOp"],
+	["keyword", "Proposition"],
+	["keyword", "PropUOp"],
+	["keyword", "Pwd"],
+	["keyword", "Qed"],
+	["keyword", "Quit"],
+	["keyword", "Rec"],
+	["keyword", "Record"],
+	["keyword", "Recursive"],
+	["keyword", "Redirect"],
+	["keyword", "Reduction"],
+	["keyword", "Register"],
+	["keyword", "Relation"],
+	["keyword", "Remark"],
+	["keyword", "Remove"],
+	["keyword", "removed"],
+	["keyword", "Require"],
+	["keyword", "Reserved"],
+	["keyword", "Reset"],
+	["keyword", "Resolve"],
+	["keyword", "Restart"],
+	["keyword", "return"],
+	["keyword", "Rewrite"],
+	["keyword", "Right"],
+	["keyword", "Ring"],
+	["keyword", "Rings"],
+	["keyword", "Saturate"],
+	["keyword", "Save"],
+	["keyword", "Scheme"],
+	["keyword", "Scope"],
+	["keyword", "Scopes"],
+	["keyword", "Search"],
+	["keyword", "SearchHead"],
+	["keyword", "SearchPattern"],
+	["keyword", "SearchRewrite"],
+	["keyword", "Section"],
+	["keyword", "Separate"],
+	["keyword", "Set"],
+	["keyword", "Setoid"],
+	["keyword", "Show"],
+	["keyword", "Signatures"],
+	["keyword", "Solve"],
+	["keyword", "Solver"],
+	["keyword", "Sort"],
+	["keyword", "Sortclass"],
+	["keyword", "Sorted"],
+	["keyword", "Spec"],
+	["keyword", "SProp"],
+	["keyword", "Step"],
+	["keyword", "Strategies"],
+	["keyword", "Strategy"],
+	["keyword", "String"],
+	["keyword", "struct"],
+	["keyword", "Structure"],
+	["keyword", "SubClass"],
+	["keyword", "Subgraph"],
+	["keyword", "SuchThat"],
+	["keyword", "Tactic"],
+	["keyword", "Term"],
+	["keyword", "TestCompile"],
+	["keyword", "then"],
+	["keyword", "Theorem"],
+	["keyword", "Time"],
+	["keyword", "Timeout"],
+	["keyword", "To"],
+	["keyword", "Transparent"],
+	["keyword", "Type"],
+	["keyword", "Typeclasses"],
+	["keyword", "Types"],
+	["keyword", "Typing"],
+	["keyword", "Undelimit"],
+	["keyword", "Undo"],
+	["keyword", "Unfocus"],
+	["keyword", "Unfocused"],
+	["keyword", "Unfold"],
+	["keyword", "Universe"],
+	["keyword", "Universes"],
+	["keyword", "UnOp"],
+	["keyword", "UnOpSpec"],
+	["keyword", "Unshelve"],
+	["keyword", "using"],
+	["keyword", "Variable"],
+	["keyword", "Variables"],
+	["keyword", "Variant"],
+	["keyword", "Verbose"],
+	["keyword", "View"],
+	["keyword", "Visibility"],
+	["keyword", "wf"],
+	["keyword", "where"],
+	["keyword", "with"],
+	["keyword", "Zify"]
+]
\ No newline at end of file
diff --git a/tests/languages/coq/number_feature.test b/tests/languages/coq/number_feature.test
new file mode 100644
index 0000000000..3027ea8b35
--- /dev/null
+++ b/tests/languages/coq/number_feature.test
@@ -0,0 +1,33 @@
+0
+123
+123.456
+123.456e65
+123.456e+65
+1_2_3.4_5_6e-6_5
+1_2_3e-6_5
+
+0x0
+0X0
+0xbad.345e
+0xbad.345ep54
+0xbad.345ep+54
+0xb_a_d.3_4_5_ep-5_4
+
+----------------------------------------------------
+
+[
+	["number", "0"],
+	["number", "123"],
+	["number", "123.456"],
+	["number", "123.456e65"],
+	["number", "123.456e+65"],
+	["number", "1_2_3.4_5_6e-6_5"],
+	["number", "1_2_3e-6_5"],
+
+	["number", "0x0"],
+	["number", "0X0"],
+	["number", "0xbad.345e"],
+	["number", "0xbad.345ep54"],
+	["number", "0xbad.345ep+54"],
+	["number", "0xb_a_d.3_4_5_ep-5_4"]
+]
\ No newline at end of file
diff --git a/tests/languages/coq/operator_feature.test b/tests/languages/coq/operator_feature.test
new file mode 100644
index 0000000000..227cf1943a
--- /dev/null
+++ b/tests/languages/coq/operator_feature.test
@@ -0,0 +1,83 @@
+->
++
+<
+<-
+<->
+<:
+<+
+<<:
+<=
+=
+=>
+>
+>->
+>=
+|
+|-
+||
+@
+*
+**
+/
+/\
+\/
+&
+%
+-
+!
+?
+^
+~
+
+..
+...
+
+::=
+:=
+=
+
+'
+
+----------------------------------------------------
+
+[
+	["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", "'"]
+]
\ No newline at end of file
diff --git a/tests/languages/coq/punctuation_feature.test b/tests/languages/coq/punctuation_feature.test
new file mode 100644
index 0000000000..6d4579d9cb
--- /dev/null
+++ b/tests/languages/coq/punctuation_feature.test
@@ -0,0 +1,35 @@
+, ; .
+( ) .( `(
+{ } @{ } `{ } {| }
+[ ] [= ]
+
+: :>
+
+----------------------------------------------------
+
+[
+	["punctuation", ","],
+	["punctuation", ";"],
+	["punctuation", "."],
+
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ".("],
+	["punctuation", "`("],
+
+	["punctuation", "{"],
+	["punctuation", "}"],
+	["punct", "@{"],
+	["punctuation", "}"],
+	["punctuation", "`{"],
+	["punctuation", "}"],
+	["punct", "{|"],
+	["punctuation", "}"],
+
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punct", "[="],
+	["punctuation", "]"],
+
+	["punctuation", ":"], ["punct", ":>"]
+]
\ No newline at end of file
diff --git a/tests/languages/coq/string_feature.test b/tests/languages/coq/string_feature.test
new file mode 100644
index 0000000000..c03f3f51cf
--- /dev/null
+++ b/tests/languages/coq/string_feature.test
@@ -0,0 +1,9 @@
+""
+"foo""bar"
+
+----------------------------------------------------
+
+[
+	["string", "\"\""],
+	["string", "\"foo\"\"bar\""]
+]
\ No newline at end of file
diff --git a/tests/languages/cpp/base-clause_feature.test b/tests/languages/cpp/base-clause_feature.test
index 4d9247bbc4..260a7099e3 100644
--- a/tests/languages/cpp/base-clause_feature.test
+++ b/tests/languages/cpp/base-clause_feature.test
@@ -18,6 +18,7 @@ class service : private Transport // comment
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"],
+
 	["keyword", "struct"],
 	["class-name", "Derived"],
 	["operator", ":"],
@@ -27,6 +28,7 @@ class service : private Transport // comment
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"],
+
 	["keyword", "struct"],
 	["class-name", "Derived"],
 	["operator", ":"],
@@ -35,6 +37,7 @@ class service : private Transport // comment
 		["class-name", "Base"]
 	]],
 	["punctuation", ";"],
+
 	["keyword", "class"],
 	["class-name", "X"],
 	["operator", ":"],
@@ -46,6 +49,7 @@ class service : private Transport // comment
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"],
+
 	["keyword", "class"],
 	["class-name", "Y"],
 	["operator", ":"],
@@ -57,18 +61,20 @@ class service : private Transport // comment
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"],
+
 	["keyword", "class"],
 	["class-name", "Y"],
 	["operator", ":"],
 	["base-clause", [
 		["keyword", "virtual"],
 		" baz",
-		["operator", "::"],
+		["double-colon", "::"],
 		["class-name", "B"]
 	]],
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"],
+
 	["keyword", "class"],
 	["class-name", "Z"],
 	["operator", ":"],
@@ -77,11 +83,12 @@ class service : private Transport // comment
 		["class-name", "B"],
 		["operator", "<"],
 		"foo",
-		["operator", "::"],
+		["double-colon", "::"],
 		["class-name", "T"],
 		["operator", ">"]
 	]],
 	["punctuation", ";"],
+
 	["keyword", "struct"],
 	["class-name", "AA"],
 	["operator", ":"],
@@ -91,14 +98,15 @@ class service : private Transport // comment
 		["class-name", "Y"],
 		["punctuation", ","],
 		" foo",
-		["operator", "::"],
+		["double-colon", "::"],
 		"bar",
-		["operator", "::"],
+		["double-colon", "::"],
 		["class-name", "Z"]
 	]],
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"],
+
 	["keyword", "class"],
 	["class-name", "service"],
 	["operator", ":"],
@@ -107,6 +115,7 @@ class service : private Transport // comment
 		["class-name", "Transport"],
 		["comment", "// comment"]
 	]],
+
 	["punctuation", "{"],
 	["punctuation", "}"],
 	["punctuation", ";"]
diff --git a/tests/languages/cpp/class-name_feature.test b/tests/languages/cpp/class-name_feature.test
index 3e5a42fc48..086f6af2af 100644
--- a/tests/languages/cpp/class-name_feature.test
+++ b/tests/languages/cpp/class-name_feature.test
@@ -4,6 +4,7 @@ concept Foo_bar
 struct foo
 enum bar
 enum class FooBar
+
 template
 
 void Foo::bar() {}
@@ -19,12 +20,16 @@ void Foo::bar() {}
 	["keyword", "struct"], ["class-name", "foo"],
 	["keyword", "enum"], ["class-name", "bar"],
 	["keyword", "enum"], ["keyword", "class"], ["class-name", "FooBar"],
-	["keyword", "template"], ["operator", "<"], ["keyword", "typename"], ["class-name", "FooBar"], ["operator", ">"],
 
+	["keyword", "template"],
+	["operator", "<"],
+	["keyword", "typename"],
+	["class-name", "FooBar"],
+	["operator", ">"],
 
 	["keyword", "void"],
 	["class-name", "Foo"],
-	["operator", "::"],
+	["double-colon", "::"],
 	["function", "bar"],
 	["punctuation", "("],
 	["punctuation", ")"],
@@ -32,7 +37,7 @@ void Foo::bar() {}
 	["punctuation", "}"],
 
 	["class-name", "Foo"],
-	["operator", "::"],
+	["double-colon", "::"],
 	["operator", "~"],
 	["function", "Foo"],
 	["punctuation", "("],
@@ -45,7 +50,7 @@ void Foo::bar() {}
 	["operator", "<"],
 	["keyword", "int"],
 	["operator", ">"],
-	["operator", "::"],
+	["double-colon", "::"],
 	["function", "bar"],
 	["punctuation", "("],
 	["punctuation", ")"],
diff --git a/tests/languages/cpp/function_feature.test b/tests/languages/cpp/function_feature.test
new file mode 100644
index 0000000000..2968199382
--- /dev/null
+++ b/tests/languages/cpp/function_feature.test
@@ -0,0 +1,93 @@
+foo();
+line.substr(0, separator_index);
+boost::trim(key);
+bpo::value()
+bpo::value>()->multitoken()
+std::make_unique(std::move(entries));
+
+----------------------------------------------------
+
+[
+	["function", "foo"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	"\r\nline",
+	["punctuation", "."],
+	["function", "substr"],
+	["punctuation", "("],
+	["number", "0"],
+	["punctuation", ","],
+	" separator_index",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	"\r\nboost",
+	["double-colon", "::"],
+	["function", "trim"],
+	["punctuation", "("],
+	"key",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	"\r\nbpo",
+	["double-colon", "::"],
+	["generic-function", [
+		["function", "value"],
+		["generic", [
+			["operator", "<"],
+			"std",
+			["double-colon", "::"],
+			"string",
+			["operator", ">"]
+		]]
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	"\r\nbpo",
+	["double-colon", "::"],
+	["generic-function", [
+		["function", "value"],
+		["generic", [
+			["operator", "<"],
+			"std",
+			["double-colon", "::"],
+			"vector",
+			["operator", "<"],
+			"std",
+			["double-colon", "::"],
+			"string",
+			["operator", ">>"]
+		]]
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["operator", "->"],
+	["function", "multitoken"],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	"\r\nstd",
+	["double-colon", "::"],
+	["generic-function", [
+		["function", "make_unique"],
+		["generic", [
+			["operator", "<"],
+			"service",
+			["double-colon", "::"],
+			"UniqueMap",
+			["operator", ">"]
+		]]
+	]],
+	["punctuation", "("],
+	"std",
+	["double-colon", "::"],
+	["function", "move"],
+	["punctuation", "("],
+	"entries",
+	["punctuation", ")"],
+	["punctuation", ")"],
+	["punctuation", ";"]
+]
\ No newline at end of file
diff --git a/tests/languages/cpp/issue2347.test b/tests/languages/cpp/issue2347.test
index 9f302201b6..83afac78ef 100644
--- a/tests/languages/cpp/issue2347.test
+++ b/tests/languages/cpp/issue2347.test
@@ -23,7 +23,7 @@ void MainWindow::changeWindowTitle()
 
 	["punctuation", "{"],
 
-	"\n  Q_OBJECT\n\n ",
+	"\r\n  Q_OBJECT\r\n\r\n ",
 
 	["keyword", "private"],
 	" slots",
@@ -40,7 +40,7 @@ void MainWindow::changeWindowTitle()
 
 	["keyword", "void"],
 	["class-name", "MainWindow"],
-	["operator", "::"],
+	["double-colon", "::"],
 	["function", "changeWindowTitle"],
 	["punctuation", "("],
 	["punctuation", ")"],
@@ -68,5 +68,3 @@ void MainWindow::changeWindowTitle()
 
 	["punctuation", "}"]
 ]
-
-----------------------------------------------------
diff --git a/tests/languages/cpp/issue3042.test b/tests/languages/cpp/issue3042.test
new file mode 100644
index 0000000000..ab5c47b4df
--- /dev/null
+++ b/tests/languages/cpp/issue3042.test
@@ -0,0 +1,126 @@
+class Foo
+{
+public:
+
+	friend bool operator== (const Foo& f1, const Foo& f2);
+	friend bool operator!= (const Foo& f1, const Foo& f2);
+
+	friend bool operator< (const Foo& f1, const Foo& f2);
+	friend bool operator> (const Foo& f1, const Foo& f2);
+
+	friend bool operator<= (const Foo& f1, const Foo& f2);
+	friend bool operator>= (const Foo& f1, const Foo& f2);
+};
+
+----------------------------------------------------
+
+[
+	["keyword", "class"], ["class-name", "Foo"],
+	["punctuation", "{"],
+	["keyword", "public"], ["operator", ":"],
+
+	["keyword", "friend"],
+	["keyword", "bool"],
+	["keyword", "operator"],
+	["operator", "=="],
+	["punctuation", "("],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f1",
+	["punctuation", ","],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f2",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "friend"],
+	["keyword", "bool"],
+	["keyword", "operator"],
+	["operator", "!="],
+	["punctuation", "("],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f1",
+	["punctuation", ","],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f2",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "friend"],
+	["keyword", "bool"],
+	["keyword", "operator"],
+	["operator", "<"],
+	["punctuation", "("],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f1",
+	["punctuation", ","],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f2",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "friend"],
+	["keyword", "bool"],
+	["keyword", "operator"],
+	["operator", ">"],
+	["punctuation", "("],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f1",
+	["punctuation", ","],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f2",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "friend"],
+	["keyword", "bool"],
+	["keyword", "operator"],
+	["operator", "<="],
+	["punctuation", "("],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f1",
+	["punctuation", ","],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f2",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "friend"],
+	["keyword", "bool"],
+	["keyword", "operator"],
+	["operator", ">="],
+	["punctuation", "("],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f1",
+	["punctuation", ","],
+	["keyword", "const"],
+	" Foo",
+	["operator", "&"],
+	" f2",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["punctuation", "}"],
+	["punctuation", ";"]
+]
diff --git a/tests/languages/cpp/keyword_feature.test b/tests/languages/cpp/keyword_feature.test
index ac72b6a31d..69c90b55df 100644
--- a/tests/languages/cpp/keyword_feature.test
+++ b/tests/languages/cpp/keyword_feature.test
@@ -33,20 +33,24 @@ enum;
 explicit
 export
 extern
+final
 float
 for
 friend
 goto
 if
+import;
 inline
 int
 long
+module;
 mutable
 namespace
 new
 noexcept
 nullptr
 operator
+override
 private
 protected
 public
@@ -125,20 +129,24 @@ uint64_t
 	["keyword", "explicit"],
 	["keyword", "export"],
 	["keyword", "extern"],
+	["keyword", "final"],
 	["keyword", "float"],
 	["keyword", "for"],
 	["keyword", "friend"],
 	["keyword", "goto"],
 	["keyword", "if"],
+	["keyword", "import"], ["punctuation", ";"],
 	["keyword", "inline"],
 	["keyword", "int"],
 	["keyword", "long"],
+	["keyword", "module"], ["punctuation", ";"],
 	["keyword", "mutable"],
 	["keyword", "namespace"],
 	["keyword", "new"],
 	["keyword", "noexcept"],
 	["keyword", "nullptr"],
 	["keyword", "operator"],
+	["keyword", "override"],
 	["keyword", "private"],
 	["keyword", "protected"],
 	["keyword", "public"],
diff --git a/tests/languages/cpp/module_feature.test b/tests/languages/cpp/module_feature.test
new file mode 100644
index 0000000000..b6675c3d4e
--- /dev/null
+++ b/tests/languages/cpp/module_feature.test
@@ -0,0 +1,116 @@
+export module speech;
+
+export const char* get_phrase_en() {
+    return "Hello, world!";
+}
+
+export module speech;
+
+export import :english;
+export import :spanish;
+
+export module speech:english;
+
+import speech;
+import :PrivWidget;
+
+import ;
+import ;
+import "foo.h";
+import ;
+
+module : private;
+
+----------------------------------------------------
+
+[
+	["keyword", "export"],
+	["keyword", "module"],
+	["module", ["speech"]],
+	["punctuation", ";"],
+
+	["keyword", "export"],
+	["keyword", "const"],
+	["keyword", "char"],
+	["operator", "*"],
+	["function", "get_phrase_en"],
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "{"],
+
+	["keyword", "return"],
+	["string", "\"Hello, world!\""],
+	["punctuation", ";"],
+
+	["punctuation", "}"],
+
+	["keyword", "export"],
+	["keyword", "module"],
+	["module", ["speech"]],
+	["punctuation", ";"],
+
+	["keyword", "export"],
+	["keyword", "import"],
+	["module", [
+		["operator", ":"],
+		"english"
+	]],
+	["punctuation", ";"],
+
+	["keyword", "export"],
+	["keyword", "import"],
+	["module", [
+		["operator", ":"],
+		"spanish"
+	]],
+	["punctuation", ";"],
+
+	["keyword", "export"],
+	["keyword", "module"],
+	["module", [
+		"speech",
+		["operator", ":"],
+		"english"
+	]],
+	["punctuation", ";"],
+
+	["keyword", "import"],
+	["module", ["speech"]],
+	["punctuation", ";"],
+
+	["keyword", "import"],
+	["module", [
+		["operator", ":"],
+		"PrivWidget"
+	]],
+	["punctuation", ";"],
+
+	["keyword", "import"],
+	["module", [
+		["string", ""]
+	]],
+	["punctuation", ";"],
+
+	["keyword", "import"],
+	["module", [
+		["string", ""]
+	]],
+	["punctuation", ";"],
+
+	["keyword", "import"],
+	["module", [
+		["string", "\"foo.h\""]
+	]],
+	["punctuation", ";"],
+
+	["keyword", "import"],
+	["module", [
+		["string", ""]
+	]],
+	["punctuation", ";"],
+
+	["keyword", "module"],
+	["operator", ":"],
+	["keyword", "private"],
+	["punctuation", ";"]
+]
\ No newline at end of file
diff --git a/tests/languages/cpp/operator_feature.test b/tests/languages/cpp/operator_feature.test
index 83b002e82e..c619b3aac3 100644
--- a/tests/languages/cpp/operator_feature.test
+++ b/tests/languages/cpp/operator_feature.test
@@ -3,7 +3,7 @@
 ~ & | ^
 += -= *= /= %= >>= <<= &= |= ^=
 ! && ||
--> ::
+->
 ? :
 = == != < > <= >= <=>
 and and_eq bitand bitor not not_eq or or_eq xor xor_eq
@@ -43,7 +43,6 @@ and and_eq bitand bitor not not_eq or or_eq xor xor_eq
 	["operator", "||"],
 
 	["operator", "->"],
-	["operator", "::"],
 
 	["operator", "?"],
 	["operator", ":"],
diff --git a/tests/languages/cpp/punctuation_feature.test b/tests/languages/cpp/punctuation_feature.test
new file mode 100644
index 0000000000..5ea8918234
--- /dev/null
+++ b/tests/languages/cpp/punctuation_feature.test
@@ -0,0 +1,18 @@
+( ) [ ] { }
+, ; . ::
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["punctuation", ","],
+	["punctuation", ";"],
+	["punctuation", "."],
+	["double-colon", "::"]
+]
\ No newline at end of file
diff --git a/tests/languages/crystal/attribute_feature.test b/tests/languages/crystal/attribute_feature.test
index 4fb0bad1d0..726049b028 100644
--- a/tests/languages/crystal/attribute_feature.test
+++ b/tests/languages/crystal/attribute_feature.test
@@ -1,17 +1,60 @@
 @[AlwaysInline]
 @[CallConvention("X86_StdCall")]
+@[MyAnnotation(key: "value", value: 123)]
+@[MyAnnotation("foo", 123, false)]
 
 ----------------------------------------------------
 
 [
 	["attribute", [
 		["delimiter", "@["],
-		["constant", "AlwaysInline"],
+		["attribute", "AlwaysInline"],
 		["delimiter", "]"]
 	]],
 	["attribute", [
 		["delimiter", "@["],
-		["constant", "CallConvention"], ["punctuation", "("], ["string", [ "\"X86_StdCall\"" ]], ["punctuation", ")"],
+		["attribute", "CallConvention"],
+		["args", [
+			["punctuation", "("],
+			["string-literal", [
+				["string", "\"X86_StdCall\""]
+			]],
+			["punctuation", ")"]
+		]],
+		["delimiter", "]"]
+	]],
+	["attribute", [
+		["delimiter", "@["],
+		["attribute", "MyAnnotation"],
+		["args", [
+			["punctuation", "("],
+			["symbol", "key"],
+			["operator", ":"],
+			["string-literal", [
+				["string", "\"value\""]
+			]],
+			["punctuation", ","],
+			["symbol", "value"],
+			["operator", ":"],
+			["number", "123"],
+			["punctuation", ")"]
+		]],
+		["delimiter", "]"]
+	]],
+	["attribute", [
+		["delimiter", "@["],
+		["attribute", "MyAnnotation"],
+		["args", [
+			["punctuation", "("],
+			["string-literal", [
+				["string", "\"foo\""]
+			]],
+			["punctuation", ","],
+			["number", "123"],
+			["punctuation", ","],
+			["boolean", "false"],
+			["punctuation", ")"]
+		]],
 		["delimiter", "]"]
 	]]
 ]
diff --git a/tests/languages/crystal/char_feature.test b/tests/languages/crystal/char_feature.test
new file mode 100644
index 0000000000..6734edc97b
--- /dev/null
+++ b/tests/languages/crystal/char_feature.test
@@ -0,0 +1,41 @@
+'a'
+'z'
+'0'
+'_'
+'あ'
+'\''         # single quote
+'\\'         # backslash
+'\a'         # alert
+'\b'         # backspace
+'\e'         # escape
+'\f'         # form feed
+'\n'         # newline
+'\r'         # carriage return
+'\t'         # tab
+'\v'         # vertical tab
+'\0'         # null character
+'\uFFFF'     # hexadecimal unicode character
+'\u{10FFFF}' # hexadecimal unicode character
+
+----------------------------------------------------
+
+[
+	["char", "'a'"],
+	["char", "'z'"],
+	["char", "'0'"],
+	["char", "'_'"],
+	["char", "'あ'"],
+	["char", "'\\''"], ["comment", "# single quote"],
+	["char", "'\\\\'"], ["comment", "# backslash"],
+	["char", "'\\a'"], ["comment", "# alert"],
+	["char", "'\\b'"], ["comment", "# backspace"],
+	["char", "'\\e'"], ["comment", "# escape"],
+	["char", "'\\f'"], ["comment", "# form feed"],
+	["char", "'\\n'"], ["comment", "# newline"],
+	["char", "'\\r'"], ["comment", "# carriage return"],
+	["char", "'\\t'"], ["comment", "# tab"],
+	["char", "'\\v'"], ["comment", "# vertical tab"],
+	["char", "'\\0'"], ["comment", "# null character"],
+	["char", "'\\uFFFF'"], ["comment", "# hexadecimal unicode character"],
+	["char", "'\\u{10FFFF}'"], ["comment", "# hexadecimal unicode character"]
+]
diff --git a/tests/languages/crystal/expansion_feature.test b/tests/languages/crystal/expansion_feature.test
index b40bd1f51f..b11bcc4ab1 100644
--- a/tests/languages/crystal/expansion_feature.test
+++ b/tests/languages/crystal/expansion_feature.test
@@ -8,26 +8,34 @@
 [
 	["expansion", [
 		["delimiter", "{{"],
-		["number", "1_u32"],
+		["content", [
+			["number", "1_u32"]
+		]],
 		["delimiter", "}}"]
 	]],
 	["expansion", [
 		["delimiter", "{%"],
-		["number", "2_u32"],
+		["content", [
+			["number", "2_u32"]
+		]],
 		["delimiter", "%}"]
 	]],
 	["expansion", [
 		["delimiter", "{{"],
-		["punctuation", "{"],
-		["number", "3_u32"],
-		["punctuation", "}"],
+		["content", [
+			["punctuation", "{"],
+			["number", "3_u32"],
+			["punctuation", "}"]
+		]],
 		["delimiter", "}}"]
 	]],
 	["expansion", [
 		["delimiter", "{%"],
-		["operator", "%"],
-		["number", "4_u32"],
-		["operator", "%"],
+		["content", [
+			["operator", "%"],
+			["number", "4_u32"],
+			["operator", "%"]
+		]],
 		["delimiter", "%}"]
 	]]
 ]
diff --git a/tests/languages/crystal/keyword_feature.test b/tests/languages/crystal/keyword_feature.test
index 962beadf84..5b61e97ae3 100644
--- a/tests/languages/crystal/keyword_feature.test
+++ b/tests/languages/crystal/keyword_feature.test
@@ -1,35 +1,127 @@
-abstract alias as asm begin break case
-class;
-def;
-do else elsif
-end ensure enum extend for fun
-if include instance_sizeof
 .is_a?
-lib macro module next of out pointerof
-private protected rescue
 .responds_to?
-return require select self sizeof struct super
-then type typeof uninitialized union unless
-until when while with yield __DIR__ __END_LINE__
-__FILE__ __LINE__
+abstract
+alias
+annotation;
+as
+asm
+begin
+break
+case
+class;
+def;
+do
+else
+elsif
+end
+ensure
+enum
+extend
+for
+fun
+if
+ifdef
+include
+instance_sizeof
+lib
+macro
+module;
+next
+of
+out
+pointerof
+private
+protected
+ptr
+require
+rescue
+return
+select
+self
+sizeof
+struct
+super
+then
+type
+typeof
+undef
+uninitialized
+union
+unless
+until
+when
+while
+with
+yield
+
+__DIR__
+__END_LINE__
+__FILE__
+__LINE__
 
 ----------------------------------------------------
 
 [
-	["keyword", "abstract"], ["keyword", "alias"], ["keyword", "as"], ["keyword", "asm"], ["keyword", "begin"], ["keyword", "break"], ["keyword", "case"],
-	["keyword", "class"], ["punctuation", ";"],
-	["keyword", "def"],  ["punctuation", ";"],
-	["keyword", "do"], ["keyword", "else"], ["keyword", "elsif"],
-	["keyword", "end"], ["keyword", "ensure"], ["keyword", "enum"], ["keyword", "extend"], ["keyword", "for"], ["keyword", "fun"],
-	["keyword", "if"], ["keyword", "include"], ["keyword", "instance_sizeof"],
 	["punctuation", "."], ["keyword", "is_a?"],
-	["keyword", "lib"], ["keyword", "macro"], ["keyword", "module"], ["keyword", "next"], ["keyword", "of"], ["keyword", "out"], ["keyword", "pointerof"],
-	["keyword", "private"], ["keyword", "protected"], ["keyword", "rescue"],
 	["punctuation", "."], ["keyword", "responds_to?"],
-	["keyword", "return"], ["keyword", "require"], ["keyword", "select"], ["keyword", "self"], ["keyword", "sizeof"], ["keyword", "struct"], ["keyword", "super"],
-	["keyword", "then"], ["keyword", "type"], ["keyword", "typeof"], ["keyword", "uninitialized"], ["keyword", "union"], ["keyword", "unless"],
-	["keyword", "until"], ["keyword", "when"], ["keyword", "while"], ["keyword", "with"], ["keyword", "yield"], ["keyword", "__DIR__"], ["keyword", "__END_LINE__"],
-	["keyword", "__FILE__"], ["keyword", "__LINE__"]
+	["keyword", "abstract"],
+	["keyword", "alias"],
+	["keyword", "annotation"], ["punctuation", ";"],
+	["keyword", "as"],
+	["keyword", "asm"],
+	["keyword", "begin"],
+	["keyword", "break"],
+	["keyword", "case"],
+	["keyword", "class"], ["punctuation", ";"],
+	["keyword", "def"], ["punctuation", ";"],
+	["keyword", "do"],
+	["keyword", "else"],
+	["keyword", "elsif"],
+	["keyword", "end"],
+	["keyword", "ensure"],
+	["keyword", "enum"],
+	["keyword", "extend"],
+	["keyword", "for"],
+	["keyword", "fun"],
+	["keyword", "if"],
+	["keyword", "ifdef"],
+	["keyword", "include"],
+	["keyword", "instance_sizeof"],
+	["keyword", "lib"],
+	["keyword", "macro"],
+	["keyword", "module"], ["punctuation", ";"],
+	["keyword", "next"],
+	["keyword", "of"],
+	["keyword", "out"],
+	["keyword", "pointerof"],
+	["keyword", "private"],
+	["keyword", "protected"],
+	["keyword", "ptr"],
+	["keyword", "require"],
+	["keyword", "rescue"],
+	["keyword", "return"],
+	["keyword", "select"],
+	["keyword", "self"],
+	["keyword", "sizeof"],
+	["keyword", "struct"],
+	["keyword", "super"],
+	["keyword", "then"],
+	["keyword", "type"],
+	["keyword", "typeof"],
+	["keyword", "undef"],
+	["keyword", "uninitialized"],
+	["keyword", "union"],
+	["keyword", "unless"],
+	["keyword", "until"],
+	["keyword", "when"],
+	["keyword", "while"],
+	["keyword", "with"],
+	["keyword", "yield"],
+
+	["keyword", "__DIR__"],
+	["keyword", "__END_LINE__"],
+	["keyword", "__FILE__"],
+	["keyword", "__LINE__"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/crystal/operator_feature.test b/tests/languages/crystal/operator_feature.test
new file mode 100644
index 0000000000..43c7205933
--- /dev/null
+++ b/tests/languages/crystal/operator_feature.test
@@ -0,0 +1,82 @@
++ - * / % **
++= -= *= /= %= **=
+
+== != < > <= >= <=> ===
+!~ =~
+=
+& | ^ ~ << >>
+&= |= ^= <<= >>=
+&& || !
+&&= ||=
+
+=>
+->
+
+&.
+
+? :
+.. ...
+
+and or not
+
+----------------------------------------------------
+
+[
+	["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", "?"], ["operator", ":"],
+	["operator", ".."], ["operator", "..."],
+
+	"\r\n\r\nand or not"
+]
diff --git a/tests/languages/crystal/punctuation_feature.test b/tests/languages/crystal/punctuation_feature.test
new file mode 100644
index 0000000000..affcf8f11b
--- /dev/null
+++ b/tests/languages/crystal/punctuation_feature.test
@@ -0,0 +1,20 @@
+( ) [ ] { }
+, .
+:: \
+
+----------------------------------------------------
+
+[
+	["punctuation", "("],
+	["punctuation", ")"],
+	["punctuation", "["],
+	["punctuation", "]"],
+	["punctuation", "{"],
+	["punctuation", "}"],
+
+	["punctuation", ","],
+	["punctuation", "."],
+
+	["double-colon", "::"],
+	["punctuation", "\\"]
+]
diff --git a/tests/languages/crystal/regex_feature.test b/tests/languages/crystal/regex_feature.test
new file mode 100644
index 0000000000..7f075142ee
--- /dev/null
+++ b/tests/languages/crystal/regex_feature.test
@@ -0,0 +1,184 @@
+/foo|bar/
+/h(e+)llo/
+/\d+/
+/あ/
+
+/\//         # slash
+/\\/         # backslash
+/\b/         # backspace
+/\e/         # escape
+/\f/         # form feed
+/\n/         # newline
+/\r/         # carriage return
+/\t/         # tab
+/\v/         # vertical tab
+/\NNN/       # octal ASCII character
+/\xNN/       # hexadecimal ASCII character
+/\x{FFFF}/   # hexadecimal unicode character
+/\x{10FFFF}/ # hexadecimal unicode character
+
+/foo/i.match("FOO")         # => #
+/foo/m.match("bar\nfoo")    # => #
+/foo /x.match("foo")        # => #
+/foo /imx.match("bar\nFOO") # => #
+
+%r((/)) # => /(\/)/
+%r[[/]] # => /[\/]/
+%r{{/}} # => /{\/}/
+%r<> # => /<\/>/
+%r|/|   # => /\//
+
+----------------------------------------------------
+
+[
+	["regex-literal", [
+		["regex", "/foo|bar/"]
+	]],
+	["regex-literal", [
+		["regex", "/h(e+)llo/"]
+	]],
+	["regex-literal", [
+		["regex", "/\\d+/"]
+	]],
+	["regex-literal", [
+		["regex", "/あ/"]
+	]],
+
+	["regex-literal", [
+		["regex", "/\\//"]
+	]],
+	["comment", "# slash"],
+
+	["regex-literal", [
+		["regex", "/\\\\/"]
+	]],
+	["comment", "# backslash"],
+
+	["regex-literal", [
+		["regex", "/\\b/"]
+	]],
+	["comment", "# backspace"],
+
+	["regex-literal", [
+		["regex", "/\\e/"]
+	]],
+	["comment", "# escape"],
+
+	["regex-literal", [
+		["regex", "/\\f/"]
+	]],
+	["comment", "# form feed"],
+
+	["regex-literal", [
+		["regex", "/\\n/"]
+	]],
+	["comment", "# newline"],
+
+	["regex-literal", [
+		["regex", "/\\r/"]
+	]],
+	["comment", "# carriage return"],
+
+	["regex-literal", [
+		["regex", "/\\t/"]
+	]],
+	["comment", "# tab"],
+
+	["regex-literal", [
+		["regex", "/\\v/"]
+	]],
+	["comment", "# vertical tab"],
+
+	["regex-literal", [
+		["regex", "/\\NNN/"]
+	]],
+	["comment", "# octal ASCII character"],
+
+	["regex-literal", [
+		["regex", "/\\xNN/"]
+	]],
+	["comment", "# hexadecimal ASCII character"],
+
+	["regex-literal", [
+		["regex", "/\\x{FFFF}/"]
+	]],
+	["comment", "# hexadecimal unicode character"],
+
+	["regex-literal", [
+		["regex", "/\\x{10FFFF}/"]
+	]],
+	["comment", "# hexadecimal unicode character"],
+
+	["regex-literal", [
+		["regex", "/foo/i"]
+	]],
+	["punctuation", "."],
+	"match",
+	["punctuation", "("],
+	["string-literal", [
+		["string", "\"FOO\""]
+	]],
+	["punctuation", ")"],
+	["comment", "# => #"],
+
+	["regex-literal", [
+		["regex", "/foo/m"]
+	]],
+	["punctuation", "."],
+	"match",
+	["punctuation", "("],
+	["string-literal", [
+		["string", "\"bar\\nfoo\""]
+	]],
+	["punctuation", ")"],
+	["comment", "# => #"],
+
+	["regex-literal", [
+		["regex", "/foo /x"]
+	]],
+	["punctuation", "."],
+	"match",
+	["punctuation", "("],
+	["string-literal", [
+		["string", "\"foo\""]
+	]],
+	["punctuation", ")"],
+	["comment", "# => #"],
+
+	["regex-literal", [
+		["regex", "/foo /imx"]
+	]],
+	["punctuation", "."],
+	"match",
+	["punctuation", "("],
+	["string-literal", [
+		["string", "\"bar\\nFOO\""]
+	]],
+	["punctuation", ")"],
+	["comment", "# => #"],
+
+	["regex-literal", [
+		["regex", "%r((/))"]
+	]],
+	["comment", "# => /(\\/)/"],
+
+	["regex-literal", [
+		["regex", "%r[[/]]"]
+	]],
+	["comment", "# => /[\\/]/"],
+
+	["regex-literal", [
+		["regex", "%r{{/}}"]
+	]],
+	["comment", "# => /{\\/}/"],
+
+	["regex-literal", [
+		["regex", "%r<>"]
+	]],
+	["comment", "# => /<\\/>/"],
+
+	["regex-literal", [
+		["regex", "%r|/|"]
+	]],
+	["comment", "# => /\\//"]
+]
diff --git a/tests/languages/crystal/string_feature.test b/tests/languages/crystal/string_feature.test
new file mode 100644
index 0000000000..04a8ebded6
--- /dev/null
+++ b/tests/languages/crystal/string_feature.test
@@ -0,0 +1,321 @@
+"hello world"
+
+"\""                  # double quote
+"\\"                  # backslash
+"\#"                  # hash character (to escape interpolation)
+"\a"                  # alert
+"\b"                  # backspace
+"\e"                  # escape
+"\f"                  # form feed
+"\n"                  # newline
+"\r"                  # carriage return
+"\t"                  # tab
+"\v"                  # vertical tab
+"\377"                # octal ASCII character
+"\xFF"                # hexadecimal ASCII character
+"\uFFFF"              # hexadecimal unicode character
+"\u{0}".."\u{10FFFF}" # hexadecimal unicode character
+
+"\101" # => "A"
+"\123" # => "S"
+"\12"  # => "\n"
+"\1"   # string with one character with code point 1
+
+"\u{48 45 4C 4C 4F}" # => "HELLO"
+
+"sum: #{a} + #{b} = #{a + b}"
+
+"\#{a + b}"  # => "#{a + b}"
+%q(#{a + b}) # => "#{a + b}"
+
+%(hello ("world")) # => "hello (\"world\")"
+%[hello ["world"]] # => "hello [\"world\"]"
+%{hello {"world"}} # => "hello {\"world\"}"
+%> # => "hello <\"world\">"
+%|hello "world"|   # => "hello \"world\""
+
+name = "world"
+%q(hello \n #{name}) # => "hello \\n \#{name}"
+%Q(hello \n #{name}) # => "hello \n world"
+
+%w(foo bar baz)  # => ["foo", "bar", "baz"]
+%w(foo\nbar baz) # => ["foo\\nbar", "baz"]
+%w(foo(bar) baz) # => ["foo(bar)", "baz"]
+
+%w(foo\ bar baz) # => ["foo bar", "baz"]
+
+"hello " \
+"world, " \
+"no newlines" # same as "hello world, no newlines"
+
+"hello \
+     world, \
+     no newlines" # same as "hello world, no newlines"
+
+<<-XML
+
+  
+
+XML
+
+----------------------------------------------------
+
+[
+	["string-literal", [
+		["string", "\"hello world\""]
+	]],
+
+	["string-literal", [
+		["string", "\"\\\"\""]
+	]],
+	["comment", "# double quote"],
+
+	["string-literal", [
+		["string", "\"\\\\\""]
+	]],
+	["comment", "# backslash"],
+
+	["string-literal", [
+		["string", "\"\\#\""]
+	]],
+	["comment", "# hash character (to escape interpolation)"],
+
+	["string-literal", [
+		["string", "\"\\a\""]
+	]],
+	["comment", "# alert"],
+
+	["string-literal", [
+		["string", "\"\\b\""]
+	]],
+	["comment", "# backspace"],
+
+	["string-literal", [
+		["string", "\"\\e\""]
+	]],
+	["comment", "# escape"],
+
+	["string-literal", [
+		["string", "\"\\f\""]
+	]],
+	["comment", "# form feed"],
+
+	["string-literal", [
+		["string", "\"\\n\""]
+	]],
+	["comment", "# newline"],
+
+	["string-literal", [
+		["string", "\"\\r\""]
+	]],
+	["comment", "# carriage return"],
+
+	["string-literal", [
+		["string", "\"\\t\""]
+	]],
+	["comment", "# tab"],
+
+	["string-literal", [
+		["string", "\"\\v\""]
+	]],
+	["comment", "# vertical tab"],
+
+	["string-literal", [
+		["string", "\"\\377\""]
+	]],
+	["comment", "# octal ASCII character"],
+
+	["string-literal", [
+		["string", "\"\\xFF\""]
+	]],
+	["comment", "# hexadecimal ASCII character"],
+
+	["string-literal", [
+		["string", "\"\\uFFFF\""]
+	]],
+	["comment", "# hexadecimal unicode character"],
+
+	["string-literal", [
+		["string", "\"\\u{0}\""]
+	]],
+	["operator", ".."],
+	["string-literal", [
+		["string", "\"\\u{10FFFF}\""]
+	]],
+	["comment", "# hexadecimal unicode character"],
+
+	["string-literal", [
+		["string", "\"\\101\""]
+	]],
+	["comment", "# => \"A\""],
+
+	["string-literal", [
+		["string", "\"\\123\""]
+	]],
+	["comment", "# => \"S\""],
+
+	["string-literal", [
+		["string", "\"\\12\""]
+	]],
+	["comment", "# => \"\\n\""],
+
+	["string-literal", [
+		["string", "\"\\1\""]
+	]],
+	["comment", "# string with one character with code point 1"],
+
+	["string-literal", [
+		["string", "\"\\u{48 45 4C 4C 4F}\""]
+	]],
+	["comment", "# => \"HELLO\""],
+
+	["string-literal", [
+		["string", "\"sum: "],
+		["interpolation", [
+			["delimiter", "#{"],
+			["content", ["a"]],
+			["delimiter", "}"]
+		]],
+		["string", " + "],
+		["interpolation", [
+			["delimiter", "#{"],
+			["content", ["b"]],
+			["delimiter", "}"]
+		]],
+		["string", " = "],
+		["interpolation", [
+			["delimiter", "#{"],
+			["content", [
+				"a ",
+				["operator", "+"],
+				" b"
+			]],
+			["delimiter", "}"]
+		]],
+		["string", "\""]
+	]],
+
+	["string-literal", [
+		["string", "\"\\#{a + b}\""]
+	]],
+	["comment", "# => \"#{a + b}\""],
+
+	["string-literal", [
+		["string", "%q("],
+		["interpolation", [
+			["delimiter", "#{"],
+			["content", [
+				"a ",
+				["operator", "+"],
+				" b"
+			]],
+			["delimiter", "}"]
+		]],
+		["string", ")"]
+	]],
+	["comment", "# => \"#{a + b}\""],
+
+	["string-literal", [
+		["string", "%(hello (\"world\"))"]
+	]],
+	["comment", "# => \"hello (\\\"world\\\")\""],
+
+	["string-literal", [
+		["string", "%[hello [\"world\"]]"]
+	]],
+	["comment", "# => \"hello [\\\"world\\\"]\""],
+
+	["string-literal", [
+		["string", "%{hello {\"world\"}}"]
+	]],
+	["comment", "# => \"hello {\\\"world\\\"}\""],
+
+	["string-literal", [
+		["string", "%>"]
+	]],
+	["comment", "# => \"hello <\\\"world\\\">\""],
+
+	["string-literal", [
+		["string", "%|hello \"world\"|"]
+	]],
+	["comment", "# => \"hello \\\"world\\\"\""],
+
+	"\r\n\r\nname ",
+	["operator", "="],
+	["string-literal", [
+		["string", "\"world\""]
+	]],
+
+	["string-literal", [
+		["string", "%q(hello \\n "],
+		["interpolation", [
+			["delimiter", "#{"],
+			["content", ["name"]],
+			["delimiter", "}"]
+		]],
+		["string", ")"]
+	]],
+	["comment", "# => \"hello \\\\n \\#{name}\""],
+
+	["string-literal", [
+		["string", "%Q(hello \\n "],
+		["interpolation", [
+			["delimiter", "#{"],
+			["content", ["name"]],
+			["delimiter", "}"]
+		]],
+		["string", ")"]
+	]],
+	["comment", "# => \"hello \\n world\""],
+
+	["string-literal", [
+		["string", "%w(foo bar baz)"]
+	]],
+	["comment", "# => [\"foo\", \"bar\", \"baz\"]"],
+
+	["string-literal", [
+		["string", "%w(foo\\nbar baz)"]
+	]],
+	["comment", "# => [\"foo\\\\nbar\", \"baz\"]"],
+
+	["string-literal", [
+		["string", "%w(foo(bar) baz)"]
+	]],
+	["comment", "# => [\"foo(bar)\", \"baz\"]"],
+
+	["string-literal", [
+		["string", "%w(foo\\ bar baz)"]
+	]],
+	["comment", "# => [\"foo bar\", \"baz\"]"],
+
+	["string-literal", [
+		["string", "\"hello \""]
+	]],
+	["punctuation", "\\"],
+
+	["string-literal", [
+		["string", "\"world, \""]
+	]],
+	["punctuation", "\\"],
+
+	["string-literal", [
+		["string", "\"no newlines\""]
+	]],
+	["comment", "# same as \"hello world, no newlines\""],
+
+	["string-literal", [
+		["string", "\"hello \\\r\n     world, \\\r\n     no newlines\""]
+	]],
+	["comment", "# same as \"hello world, no newlines\""],
+
+	["string-literal", [
+		["delimiter", [
+			["punctuation", "<<-"],
+			["symbol", "XML"]
+		]],
+		["string", "\r\n\r\n  \r\n\r\n"],
+		["delimiter", [
+			["symbol", "XML"]
+		]]
+	]]
+]
diff --git a/tests/languages/crystal/symbol_feature.test b/tests/languages/crystal/symbol_feature.test
new file mode 100644
index 0000000000..d585682131
--- /dev/null
+++ b/tests/languages/crystal/symbol_feature.test
@@ -0,0 +1,17 @@
+:unquoted_symbol
+:"quoted symbol"
+:"a" # identical to :a
+:あ
+:question?
+:exclamation!
+
+----------------------------------------------------
+
+[
+	["symbol", ":unquoted_symbol"],
+	["symbol", ":\"quoted symbol\""],
+	["symbol", ":\"a\""], ["comment", "# identical to :a"],
+	["symbol", ":あ"],
+	["symbol", ":question?"],
+	["symbol", ":exclamation!"]
+]
diff --git a/tests/languages/csharp/attribute_feature.test b/tests/languages/csharp/attribute_feature.test
index a0647e291a..fbc54fbc05 100644
--- a/tests/languages/csharp/attribute_feature.test
+++ b/tests/languages/csharp/attribute_feature.test
@@ -29,16 +29,13 @@ var c = new (int, int)[Count];
 [
 	["punctuation", "["],
 	["attribute", [
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
-		["class-name", [
-			"Foo"
-		]],
+		["class-name", ["Foo"]],
 		["attribute-arguments", [
 			["punctuation", "("],
 			["number", "1"],
@@ -48,11 +45,10 @@ var c = new (int, int)[Count];
 		]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
-		["class-name", [
-			"Foo"
-		]],
+		["class-name", ["Foo"]],
 		["attribute-arguments", [
 			["punctuation", "("],
 			["number", "1"],
@@ -66,58 +62,48 @@ var c = new (int, int)[Count];
 		]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
-		["class-name", [
-			"Foo"
-		]],
+		["class-name", ["Foo"]],
 		["punctuation", ","],
-		["class-name", [
-			"Bar"
-		]]
+		["class-name", ["Bar"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
-		["class-name", [
-			"Foo"
-		]],
+		["class-name", ["Foo"]],
 		["attribute-arguments", [
 			["punctuation", "("],
 			["string", "\"()\""],
 			["punctuation", ")"]
 		]],
 		["punctuation", ","],
-		["class-name", [
-			"Bar"
-		]],
+		["class-name", ["Bar"]],
 		["attribute-arguments", [
 			["punctuation", "("],
 			["string", "\"[]\""],
 			["punctuation", ")"]
 		]],
 		["punctuation", ","],
-		["class-name", [
-			"Baz"
-		]]
+		["class-name", ["Baz"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "return"],
 		["punctuation", ":"],
-		["class-name", [
-			"MaybeNull"
-		]]
+		["class-name", ["MaybeNull"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "assembly"],
 		["punctuation", ":"],
-		["class-name", [
-			"InternalsVisibleTo"
-		]],
+		["class-name", ["InternalsVisibleTo"]],
 		["attribute-arguments", [
 			["punctuation", "("],
 			["string", "\"Tests\""],
@@ -125,98 +111,93 @@ var c = new (int, int)[Count];
 		]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "assembly"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "module"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "field"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "event"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "method"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "param"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "property"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "return"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["punctuation", "["],
 	["attribute", [
 		["target", "type"],
 		["punctuation", ":"],
-		["class-name", [
-			"Foo"
-		]]
+		["class-name", ["Foo"]]
 	]],
 	["punctuation", "]"],
+
 	["comment", "// not attributes"],
+
 	["class-name", [
 		["keyword", "var"]
 	]],
 	" a ",
 	["operator", "="],
-	" d\n",
+	" d\r\n",
+
 	["punctuation", "["],
 	"Foo",
 	["punctuation", "]"],
 	["punctuation", ";"],
+
 	["class-name", [
 		["keyword", "var"]
 	]],
@@ -234,6 +215,7 @@ var c = new (int, int)[Count];
 	"Count",
 	["punctuation", "]"],
 	["punctuation", ";"],
+
 	["class-name", [
 		["keyword", "var"]
 	]],
diff --git a/tests/languages/csharp/char_feature.test b/tests/languages/csharp/char_feature.test
new file mode 100644
index 0000000000..184ed6b581
--- /dev/null
+++ b/tests/languages/csharp/char_feature.test
@@ -0,0 +1,11 @@
+'a'
+'\''
+'\\'
+
+----------------------------------------------------
+
+[
+	["char", "'a'"],
+	["char", "'\\''"],
+	["char", "'\\\\'"]
+]
diff --git a/tests/languages/csharp/class-name-declaration_feature.test b/tests/languages/csharp/class-name-declaration_feature.test
index 93410553eb..0d347ed4f5 100644
--- a/tests/languages/csharp/class-name-declaration_feature.test
+++ b/tests/languages/csharp/class-name-declaration_feature.test
@@ -2,8 +2,12 @@ class Foo
 interface BarBaz
 struct Foo
 enum Foo
+record Foo
 class Foo
 interface Bar
+record Foo
+
+record TestData(string Name);
 
 // not variables
 public static RGBColor FromRainbow(Rainbow colorBand) =>
@@ -13,6 +17,8 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
 		_           => throw new ArgumentException(message: "invalid enum value", paramName: nameof(colorBand)),
 	};
 
+try {} catch (ArgumentException e) {}
+
 ----------------------------------------------------
 
 [
@@ -28,6 +34,9 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
 	["keyword", "enum"],
 	["class-name", ["Foo"]],
 
+	["keyword", "record"],
+	["class-name", ["Foo"]],
+
 	["keyword", "class"],
 	["class-name", [
 		"Foo",
@@ -47,32 +56,49 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
 		["punctuation", ">"]
 	]],
 
+	["keyword", "record"],
+	["class-name", [
+		"Foo",
+		["punctuation", "<"],
+		"A",
+		["punctuation", ","],
+		" B",
+		["punctuation", ">"]
+	]],
+
+	["keyword", "record"],
+	["class-name", ["TestData"]],
+	["punctuation", "("],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" Name",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
 	["comment", "// not variables"],
 
 	["keyword", "public"],
 	["keyword", "static"],
-	["return-type", [
-		"RGBColor"
-	]],
+	["return-type", ["RGBColor"]],
 	["function", "FromRainbow"],
 	["punctuation", "("],
-	["class-name", [
-		"Rainbow"
-	]],
+	["class-name", ["Rainbow"]],
 	" colorBand",
 	["punctuation", ")"],
 	["operator", "=>"],
-	"\n\tcolorBand ",
+
+	"\r\n\tcolorBand ",
 	["keyword", "switch"],
+
 	["punctuation", "{"],
-	"\n\t\tRainbow",
+
+	"\r\n\t\tRainbow",
 	["punctuation", "."],
 	"Red ",
 	["operator", "=>"],
 	["keyword", "new"],
-	["constructor-invocation", [
-		"RGBColor"
-	]],
+	["constructor-invocation", ["RGBColor"]],
 	["punctuation", "("],
 	["number", "0xFF"],
 	["punctuation", ","],
@@ -81,13 +107,12 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
 	["number", "0x00"],
 	["punctuation", ")"],
 	["punctuation", ","],
-	"\n\t\t_           ",
+
+	"\r\n\t\t_           ",
 	["operator", "=>"],
 	["keyword", "throw"],
 	["keyword", "new"],
-	["constructor-invocation", [
-		"ArgumentException"
-	]],
+	["constructor-invocation", ["ArgumentException"]],
 	["punctuation", "("],
 	["named-parameter", "message"],
 	["punctuation", ":"],
@@ -101,8 +126,20 @@ public static RGBColor FromRainbow(Rainbow colorBand) =>
 	["punctuation", ")"],
 	["punctuation", ")"],
 	["punctuation", ","],
+
+	["punctuation", "}"],
+	["punctuation", ";"],
+
+	["keyword", "try"],
+	["punctuation", "{"],
 	["punctuation", "}"],
-	["punctuation", ";"]
+	["keyword", "catch"],
+	["punctuation", "("],
+	["class-name", ["ArgumentException"]],
+	" e",
+	["punctuation", ")"],
+	["punctuation", "{"],
+	["punctuation", "}"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/csharp/interpolation-string_feature.test b/tests/languages/csharp/interpolation-string_feature.test
index d5c2142721..fba1721ffe 100644
--- a/tests/languages/csharp/interpolation-string_feature.test
+++ b/tests/languages/csharp/interpolation-string_feature.test
@@ -1,4 +1,5 @@
 $"Hello, {{ {name} }}! Today is {date.DayOfWeek}, it's {date:HH:mm} now."
+@$"Hello, {{ {name} }}! Today is {date.DayOfWeek}, it's {date:HH:mm} now."
 $"{a,5} and {b + "" /* foo ":} */:format} {h(a, b)}"
 $"{1}{2}{3}"
 
@@ -18,9 +19,7 @@ $@"{
 		["string", "$\"Hello, {{ "],
 		["interpolation", [
 			["punctuation", "{"],
-			["expression", [
-				"name"
-			]],
+			["expression", ["name"]],
 			["punctuation", "}"]
 		]],
 		["string", " }}! Today is "],
@@ -34,11 +33,38 @@ $@"{
 			["punctuation", "}"]
 		]],
 		["string", ", it's "],
+		["interpolation", [
+			["punctuation", "{"],
+			["expression", ["date"]],
+			["format-string", [
+				["punctuation", ":"],
+				"HH:mm"
+			]],
+			["punctuation", "}"]
+		]],
+		["string", " now.\""]
+	]],
+	["interpolation-string", [
+		["string", "@$\"Hello, {{ "],
+		["interpolation", [
+			["punctuation", "{"],
+			["expression", ["name"]],
+			["punctuation", "}"]
+		]],
+		["string", " }}! Today is "],
 		["interpolation", [
 			["punctuation", "{"],
 			["expression", [
-				"date"
+				"date",
+				["punctuation", "."],
+				"DayOfWeek"
 			]],
+			["punctuation", "}"]
+		]],
+		["string", ", it's "],
+		["interpolation", [
+			["punctuation", "{"],
+			["expression", ["date"]],
 			["format-string", [
 				["punctuation", ":"],
 				"HH:mm"
@@ -113,12 +139,14 @@ $@"{
 		]],
 		["string", "\""]
 	]],
+
 	["interpolation-string", [
-		["string", "@$\"\n\""]
+		["string", "@$\"\r\n\""]
 	]],
 	["interpolation-string", [
-		["string", "$@\"\n\""]
+		["string", "$@\"\r\n\""]
 	]],
+
 	["interpolation-string", [
 		["string", "$@\""],
 		["interpolation", [
diff --git a/tests/languages/csharp/issue2968.test b/tests/languages/csharp/issue2968.test
new file mode 100644
index 0000000000..c825e4f65b
--- /dev/null
+++ b/tests/languages/csharp/issue2968.test
@@ -0,0 +1,27 @@
+func(from: "America", to: "Asia"); // Prism incorrectly highlights "from" as a keyword
+
+from element in list; // no issues here
+
+----------------------------------------------------
+
+[
+	["function", "func"],
+	["punctuation", "("],
+	["named-parameter", "from"],
+	["punctuation", ":"],
+	["string", "\"America\""],
+	["punctuation", ","],
+	["named-parameter", "to"],
+	["punctuation", ":"],
+	["string", "\"Asia\""],
+	["punctuation", ")"],
+	["punctuation", ";"],
+	["comment", "// Prism incorrectly highlights \"from\" as a keyword"],
+
+	["keyword", "from"],
+	" element ",
+	["keyword", "in"],
+	" list",
+	["punctuation", ";"],
+	["comment", "// no issues here"]
+]
diff --git a/tests/languages/csharp/keyword_feature.test b/tests/languages/csharp/keyword_feature.test
index 1769b30b0e..3d42242aa8 100644
--- a/tests/languages/csharp/keyword_feature.test
+++ b/tests/languages/csharp/keyword_feature.test
@@ -35,7 +35,7 @@ fixed
 float
 for
 foreach
-from
+from foo;
 get
 global
 goto
@@ -43,6 +43,7 @@ group
 if
 implicit
 in
+init;
 int;
 interface;
 internal
@@ -71,6 +72,7 @@ private
 protected
 public
 readonly
+record;
 ref
 remove
 return
@@ -106,6 +108,9 @@ where;
 while
 yield
 
+// very contextual keywords:
+Person person2 = person1 with { FirstName = "John" };
+
 ----------------------------------------------------
 
 [
@@ -146,7 +151,7 @@ yield
 	["keyword", "float"],
 	["keyword", "for"],
 	["keyword", "foreach"],
-	["keyword", "from"],
+	["keyword", "from"], " foo", ["punctuation", ";"],
 	["keyword", "get"],
 	["keyword", "global"],
 	["keyword", "goto"],
@@ -154,6 +159,7 @@ yield
 	["keyword", "if"],
 	["keyword", "implicit"],
 	["keyword", "in"],
+	["keyword", "init"], ["punctuation", ";"],
 	["keyword", "int"], ["punctuation", ";"],
 	["keyword", "interface"], ["punctuation", ";"],
 	["keyword", "internal"],
@@ -182,6 +188,7 @@ yield
 	["keyword", "protected"],
 	["keyword", "public"],
 	["keyword", "readonly"],
+	["keyword", "record"], ["punctuation", ";"],
 	["keyword", "ref"],
 	["keyword", "remove"],
 	["keyword", "return"],
@@ -215,7 +222,21 @@ yield
 	["keyword", "when"],
 	["keyword", "where"], ["punctuation", ";"],
 	["keyword", "while"],
-	["keyword", "yield"]
+	["keyword", "yield"],
+
+	["comment", "// very contextual keywords:"],
+
+	["class-name", ["Person"]],
+	" person2 ",
+	["operator", "="],
+	" person1 ",
+	["keyword", "with"],
+	["punctuation", "{"],
+	" FirstName ",
+	["operator", "="],
+	["string", "\"John\""],
+	["punctuation", "}"],
+	["punctuation", ";"]
 ]
 
 ----------------------------------------------------
diff --git a/tests/languages/csharp/preprocessor_feature.test b/tests/languages/csharp/preprocessor_feature.test
index 8f21683e74..8f03332608 100644
--- a/tests/languages/csharp/preprocessor_feature.test
+++ b/tests/languages/csharp/preprocessor_feature.test
@@ -7,6 +7,7 @@
 #endregion
 #error
 #line
+#nullable
 #pragma
 #region
 #undef
@@ -24,6 +25,7 @@
 	["preprocessor", ["#", ["directive", "endregion"]]],
 	["preprocessor", ["#", ["directive", "error"]]],
 	["preprocessor", ["#", ["directive", "line"]]],
+	["preprocessor", ["#", ["directive", "nullable"]]],
 	["preprocessor", ["#", ["directive", "pragma"]]],
 	["preprocessor", ["#", ["directive", "region"]]],
 	["preprocessor", ["#", ["directive", "undef"]]],
diff --git a/tests/languages/csharp/range_feature.test b/tests/languages/csharp/range_feature.test
index 805fd91b54..42010fa0d7 100644
--- a/tests/languages/csharp/range_feature.test
+++ b/tests/languages/csharp/range_feature.test
@@ -15,7 +15,7 @@ list[..];
 	["punctuation", "]"],
 	["punctuation", ";"],
 
-	"\nlist",
+	"\r\nlist",
 	["punctuation", "["],
 	["range", ".."],
 	["operator", "^"],
@@ -23,14 +23,14 @@ list[..];
 	["punctuation", "]"],
 	["punctuation", ";"],
 
-	"\nlist",
+	"\r\nlist",
 	["punctuation", "["],
 	["number", "2"],
 	["range", ".."],
 	["punctuation", "]"],
 	["punctuation", ";"],
 
-	"\nlist",
+	"\r\nlist",
 	["punctuation", "["],
 	["range", ".."],
 	["punctuation", "]"],
diff --git a/tests/languages/csharp/string_feature.test b/tests/languages/csharp/string_feature.test
index 2814cb561c..83bc61389e 100644
--- a/tests/languages/csharp/string_feature.test
+++ b/tests/languages/csharp/string_feature.test
@@ -7,10 +7,6 @@
 @"foo
 bar"
 
-'a'
-'\''
-'\\'
-
 ----------------------------------------------------
 
 [
@@ -20,13 +16,9 @@ bar"
 	["string", "@\"\""],
 	["string", "@\"foo\""],
 	["string", "@\"fo\"\"o\""],
-	["string", "@\"foo\r\nbar\""],
-	["string", "'a'"],
-	["string", "'\\''"],
-	["string", "'\\\\'"]
+	["string", "@\"foo\r\nbar\""]
 ]
 
 ----------------------------------------------------
 
 Checks for normal and verbatim strings.
-Also checks for single quoted characters.
\ No newline at end of file
diff --git a/tests/languages/csharp/switch_feature.test b/tests/languages/csharp/switch_feature.test
index a9ff987424..1b77188088 100644
--- a/tests/languages/csharp/switch_feature.test
+++ b/tests/languages/csharp/switch_feature.test
@@ -113,12 +113,13 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	" vehicle",
 	["punctuation", ")"],
 	["operator", "=>"],
-	"\n\tvehicle ",
+
+	"\r\n\tvehicle ",
 	["keyword", "switch"],
+
 	["punctuation", "{"],
-	["class-name", [
-		"DeliveryTruck"
-	]],
+
+	["class-name", ["DeliveryTruck"]],
 	" t ",
 	["keyword", "when"],
 	" t",
@@ -131,9 +132,8 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "+"],
 	["number", "5.00m"],
 	["punctuation", ","],
-	["class-name", [
-		"DeliveryTruck"
-	]],
+
+	["class-name", ["DeliveryTruck"]],
 	" t ",
 	["keyword", "when"],
 	" t",
@@ -146,20 +146,18 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "-"],
 	["number", "2.00m"],
 	["punctuation", ","],
-	["return-type", [
-		"DeliveryTruck"
-	]],
+
+	["return-type", ["DeliveryTruck"]],
 	" _ ",
 	["operator", "=>"],
 	["number", "10.00m"],
 	["punctuation", ","],
-	"\n\t\t_ ",
+
+	"\r\n\t\t_ ",
 	["operator", "=>"],
 	["keyword", "throw"],
 	["keyword", "new"],
-	["constructor-invocation", [
-		"ArgumentException"
-	]],
+	["constructor-invocation", ["ArgumentException"]],
 	["punctuation", "("],
 	["string", "\"Not a known vehicle type\""],
 	["punctuation", ","],
@@ -168,18 +166,20 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	"vehicle",
 	["punctuation", ")"],
 	["punctuation", ")"],
+
 	["punctuation", "}"],
 	["punctuation", ";"],
-	["class-name", [
-		"DeliveryTruck"
-	]],
+
+	["class-name", ["DeliveryTruck"]],
 	" t ",
 	["keyword", "when"],
 	" t",
 	["punctuation", "."],
 	"GrossWeightClass ",
 	["keyword", "switch"],
+
 	["punctuation", "{"],
+
 	["operator", ">"],
 	["number", "5000"],
 	["operator", "=>"],
@@ -187,6 +187,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "+"],
 	["number", "5.00m"],
 	["punctuation", ","],
+
 	["operator", "<"],
 	["number", "3000"],
 	["operator", "=>"],
@@ -194,22 +195,25 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "-"],
 	["number", "2.00m"],
 	["punctuation", ","],
-	"\n\t_ ",
+
+	"\r\n\t_ ",
 	["operator", "=>"],
 	["number", "10.00m"],
 	["punctuation", ","],
+
 	["punctuation", "}"],
 	["punctuation", ","],
-	["class-name", [
-		"DeliveryTruck"
-	]],
+
+	["class-name", ["DeliveryTruck"]],
 	" t ",
 	["keyword", "when"],
 	" t",
 	["punctuation", "."],
 	"GrossWeightClass ",
 	["keyword", "switch"],
+
 	["punctuation", "{"],
+
 	["operator", "<"],
 	["number", "3000"],
 	["operator", "=>"],
@@ -217,6 +221,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "-"],
 	["number", "2.00m"],
 	["punctuation", ","],
+
 	["operator", ">="],
 	["number", "3000"],
 	["keyword", "and"],
@@ -225,6 +230,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "=>"],
 	["number", "10.00m"],
 	["punctuation", ","],
+
 	["operator", ">"],
 	["number", "5000"],
 	["operator", "=>"],
@@ -232,8 +238,10 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "+"],
 	["number", "5.00m"],
 	["punctuation", ","],
+
 	["punctuation", "}"],
 	["punctuation", ","],
+
 	["keyword", "switch"],
 	["punctuation", "("],
 	"DateTime",
@@ -242,150 +250,187 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["punctuation", "."],
 	"DayOfWeek",
 	["punctuation", ")"],
+
 	["punctuation", "{"],
+
 	["keyword", "case"],
 	" DayOfWeek",
 	["punctuation", "."],
 	"Sunday",
 	["punctuation", ":"],
+
 	["keyword", "case"],
 	" DayOfWeek",
 	["punctuation", "."],
 	"Saturday",
 	["punctuation", ":"],
-	"\n\t\tConsole",
+
+	"\r\n\t\tConsole",
 	["punctuation", "."],
 	["function", "WriteLine"],
 	["punctuation", "("],
 	["string", "\"The weekend\""],
 	["punctuation", ")"],
 	["punctuation", ";"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	" DayOfWeek",
 	["punctuation", "."],
 	"Monday",
 	["punctuation", ":"],
-	"\n\t\tConsole",
+
+	"\r\n\t\tConsole",
 	["punctuation", "."],
 	["function", "WriteLine"],
 	["punctuation", "("],
 	["string", "\"The first day of the work week.\""],
 	["punctuation", ")"],
 	["punctuation", ";"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	" DayOfWeek",
 	["punctuation", "."],
 	"Friday",
 	["punctuation", ":"],
-	"\n\t\tConsole",
+
+	"\r\n\t\tConsole",
 	["punctuation", "."],
 	["function", "WriteLine"],
 	["punctuation", "("],
 	["string", "\"The last day of the work week.\""],
 	["punctuation", ")"],
 	["punctuation", ";"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "default"],
 	["punctuation", ":"],
-	"\n\t\tConsole",
+
+	"\r\n\t\tConsole",
 	["punctuation", "."],
 	["function", "WriteLine"],
 	["punctuation", "("],
 	["string", "\"The middle of the work week.\""],
 	["punctuation", ")"],
 	["punctuation", ";"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["punctuation", "}"],
+
 	["keyword", "switch"],
 	["punctuation", "("],
 	"str",
 	["punctuation", ")"],
+
 	["punctuation", "{"],
+
 	["keyword", "case"],
 	["string", "\"1\""],
 	["punctuation", ":"],
+
 	["keyword", "case"],
 	["string", "\"small\""],
 	["punctuation", ":"],
-	"\n\t\tcost ",
+
+	"\r\n\t\tcost ",
 	["operator", "+="],
 	["number", "25"],
 	["punctuation", ";"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["string", "\"2\""],
 	["punctuation", ":"],
+
 	["keyword", "case"],
 	["string", "\"medium\""],
 	["punctuation", ":"],
-	"\n\t\tcost ",
+
+	"\r\n\t\tcost ",
 	["operator", "+="],
 	["number", "25"],
 	["punctuation", ";"],
+
 	["keyword", "goto"],
 	["keyword", "case"],
 	["string", "\"1\""],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["string", "\"3\""],
 	["punctuation", ":"],
+
 	["keyword", "case"],
 	["string", "\"large\""],
 	["punctuation", ":"],
-	"\n\t\tcost ",
+
+	"\r\n\t\tcost ",
 	["operator", "+="],
 	["number", "50"],
 	["punctuation", ";"],
+
 	["keyword", "goto"],
 	["keyword", "case"],
 	["string", "\"1\""],
 	["punctuation", ";"],
+
 	["keyword", "default"],
 	["punctuation", ":"],
-	"\n\t\tConsole",
+
+	"\r\n\t\tConsole",
 	["punctuation", "."],
 	["function", "WriteLine"],
 	["punctuation", "("],
 	["string", "\"Invalid selection. Please select 1, 2, or 3.\""],
 	["punctuation", ")"],
 	["punctuation", ";"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["punctuation", "}"],
+
 	["keyword", "switch"],
 	["punctuation", "("],
 	"sh",
 	["punctuation", ")"],
+
 	["punctuation", "{"],
+
 	["comment", "// Note that this code never evaluates to true."],
+
 	["keyword", "case"],
-	["class-name", [
-		"Shape"
-	]],
+	["class-name", ["Shape"]],
 	" shape ",
 	["keyword", "when"],
 	" shape ",
 	["operator", "=="],
 	["keyword", "null"],
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["keyword", "null"],
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
-	["class-name", [
-		"Rectangle"
-	]],
+	["class-name", ["Rectangle"]],
 	" r ",
 	["keyword", "when"],
 	" r",
@@ -402,26 +447,33 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", ">"],
 	["number", "0"],
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "default"],
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["punctuation", "}"],
+
 	["keyword", "switch"],
 	["punctuation", "("],
 	"coll",
 	["punctuation", ")"],
+
 	["punctuation", "{"],
+
 	["keyword", "case"],
-	["class-name", [
-		"Array"
-	]],
+	["class-name", ["Array"]],
 	" arr",
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["class-name", [
 		"IEnumerable",
@@ -431,21 +483,28 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	]],
 	" ieInt",
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["class-name", [
 		["keyword", "object"]
 	]],
 	" o",
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "default"],
 	["punctuation", ":"],
+
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["punctuation", "}"],
+
 	["return-type", [
 		["keyword", "bool"]
 	]],
@@ -459,6 +518,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "=>"],
 	" x ",
 	["keyword", "is"],
+
 	["operator", ">="],
 	["number", "0"],
 	["keyword", "and"],
@@ -466,6 +526,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["number", "100"],
 	["keyword", "or"],
 	["comment", "// integer tests"],
+
 	["operator", ">="],
 	["number", "0F"],
 	["keyword", "and"],
@@ -473,6 +534,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["number", "100F"],
 	["keyword", "or"],
 	["comment", "// float tests"],
+
 	["operator", ">="],
 	["number", "0D"],
 	["keyword", "and"],
@@ -480,6 +542,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["number", "100D"],
 	["punctuation", ";"],
 	["comment", "// double tests"],
+
 	["return-type", [
 		["keyword", "bool"]
 	]],
@@ -500,6 +563,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["operator", "<"],
 	["number", "100"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["punctuation", "("],
 	["number", "0"],
@@ -510,6 +574,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	" x",
 	["punctuation", ")"],
 	["punctuation", ":"],
+
 	["keyword", "case"],
 	["punctuation", "("],
 	["class-name", [
@@ -520,19 +585,22 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["number", "0"],
 	["punctuation", ")"],
 	["punctuation", ":"],
-	"\n\tConsole",
+
+	"\r\n\tConsole",
 	["punctuation", "."],
 	["function", "WriteLine"],
 	["punctuation", "("],
 	"x",
 	["punctuation", ")"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["operator", "<"],
 	["number", "2"],
 	["punctuation", ":"],
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["keyword", "case"],
 	["number", "0"],
 	["keyword", "or"],
@@ -548,6 +616,7 @@ int x = b switch { <100 => 0, 100 => 1, 101 => 2, >101 => 3 };
 	["punctuation", ":"],
 	["keyword", "break"],
 	["punctuation", ";"],
+
 	["class-name", [
 		["keyword", "int"]
 	]],
diff --git a/tests/languages/csharp/type-list_feature.test b/tests/languages/csharp/type-list_feature.test
index 04331c1b14..bd01217e05 100644
--- a/tests/languages/csharp/type-list_feature.test
+++ b/tests/languages/csharp/type-list_feature.test
@@ -7,6 +7,18 @@ public delegate ErrorCode GetInfoMethod(H handle, A value, I paramName,
 	Size_t paramValueSize, IntPtr paramValue, out Size_t paramValueSizeRet)
 	where H : unmanaged, IInfoHandle where A : unmanaged where I : unmanaged, Enum;
 
+// the "new()" constraint
+void Foo()
+	where A : IFoo, new()
+	where B : new(), IFoo;
+
+// records are kinda difficult to handle
+public abstract record Person(string FirstName, string LastName);
+public record Teacher(string FirstName, string LastName, int Grade)
+	: Person(FirstName, LastName), IFoo;
+public record Student(string FirstName, string LastName, int Grade)
+	: Person(FirstName, LastName);
+
 ----------------------------------------------------
 
 [
@@ -40,10 +52,9 @@ public delegate ErrorCode GetInfoMethod(H handle, A value, I paramName,
 			["punctuation", ">"]
 		]],
 		["punctuation", ","],
-		["class-name", [
-			"IFoo"
-		]]
+		["class-name", ["IFoo"]]
 	]],
+
 	["keyword", "where"],
 	["class-name", "T"],
 	["punctuation", ":"],
@@ -69,9 +80,7 @@ public delegate ErrorCode GetInfoMethod(H handle, A value, I paramName,
 
 	["keyword", "public"],
 	["keyword", "class"],
-	["class-name", [
-		"Foo"
-	]],
+	["class-name", ["Foo"]],
 	["punctuation", ":"],
 	["type-list", [
 		["class-name", [
@@ -86,9 +95,7 @@ public delegate ErrorCode GetInfoMethod(H handle, A value, I paramName,
 
 	["keyword", "public"],
 	["keyword", "delegate"],
-	["return-type", [
-		"ErrorCode"
-	]],
+	["return-type", ["ErrorCode"]],
 	["generic-method", [
 		["function", "GetInfoMethod"],
 		["generic", [
@@ -102,37 +109,27 @@ public delegate ErrorCode GetInfoMethod(H handle, A value, I paramName,
 		]]
 	]],
 	["punctuation", "("],
-	["class-name", [
-		"H"
-	]],
+	["class-name", ["H"]],
 	" handle",
 	["punctuation", ","],
-	["class-name", [
-		"A"
-	]],
+	["class-name", ["A"]],
 	["keyword", "value"],
 	["punctuation", ","],
-	["class-name", [
-		"I"
-	]],
+	["class-name", ["I"]],
 	" paramName",
 	["punctuation", ","],
-	["class-name", [
-		"Size_t"
-	]],
+
+	["class-name", ["Size_t"]],
 	" paramValueSize",
 	["punctuation", ","],
-	["class-name", [
-		"IntPtr"
-	]],
+	["class-name", ["IntPtr"]],
 	" paramValue",
 	["punctuation", ","],
 	["keyword", "out"],
-	["class-name", [
-		"Size_t"
-	]],
+	["class-name", ["Size_t"]],
 	" paramValueSizeRet",
 	["punctuation", ")"],
+
 	["keyword", "where"],
 	["class-name", "H"],
 	["punctuation", ":"],
@@ -160,8 +157,139 @@ public delegate ErrorCode GetInfoMethod(H handle, A value, I paramName,
 	["type-list", [
 		["keyword", "unmanaged"],
 		["punctuation", ","],
+		["class-name", ["Enum"]]
+	]],
+	["punctuation", ";"],
+
+	["comment", "// the \"new()\" constraint"],
+
+	["return-type", [
+		["keyword", "void"]
+	]],
+	["generic-method", [
+		["function", "Foo"],
+		["generic", [
+			["punctuation", "<"],
+			"A",
+			["punctuation", ","],
+			" B",
+			["punctuation", ">"]
+		]]
+	]],
+	["punctuation", "("],
+	["punctuation", ")"],
+
+	["keyword", "where"],
+	["class-name", "A"],
+	["punctuation", ":"],
+	["type-list", [
+		["class-name", ["IFoo"]],
+		["punctuation", ","],
+		["keyword", "new"],
+		["punctuation", "("],
+		["punctuation", ")"]
+	]],
+
+	["keyword", "where"],
+	["class-name", "B"],
+	["punctuation", ":"],
+	["type-list", [
+		["keyword", "new"],
+		["punctuation", "("],
+		["punctuation", ")"],
+		["punctuation", ","],
+		["class-name", ["IFoo"]]
+	]],
+	["punctuation", ";"],
+
+	["comment", "// records are kinda difficult to handle"],
+
+	["keyword", "public"],
+	["keyword", "abstract"],
+	["keyword", "record"],
+	["class-name", ["Person"]],
+	["punctuation", "("],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" FirstName",
+	["punctuation", ","],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" LastName",
+	["punctuation", ")"],
+	["punctuation", ";"],
+
+	["keyword", "public"],
+	["keyword", "record"],
+	["class-name", ["Teacher"]],
+	["punctuation", "("],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" FirstName",
+	["punctuation", ","],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" LastName",
+	["punctuation", ","],
+	["class-name", [
+		["keyword", "int"]
+	]],
+	" Grade",
+	["punctuation", ")"],
+
+	["punctuation", ":"],
+	["type-list", [
+		["class-name", ["Person"]],
+		["record-arguments", [
+			["punctuation", "("],
+			"FirstName",
+			["punctuation", ","],
+			" LastName",
+			["punctuation", ")"]
+		]],
+		["punctuation", ","],
 		["class-name", [
-			"Enum"
+			"IFoo",
+			["punctuation", "<"],
+			["keyword", "int"],
+			["punctuation", ">"]
+		]]
+	]],
+	["punctuation", ";"],
+
+	["keyword", "public"],
+	["keyword", "record"],
+	["class-name", ["Student"]],
+	["punctuation", "("],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" FirstName",
+	["punctuation", ","],
+	["class-name", [
+		["keyword", "string"]
+	]],
+	" LastName",
+	["punctuation", ","],
+	["class-name", [
+		["keyword", "int"]
+	]],
+	" Grade",
+	["punctuation", ")"],
+
+	["punctuation", ":"],
+	["type-list", [
+		["class-name", ["Person"]],
+		["record-arguments", [
+			["punctuation", "("],
+			"FirstName",
+			["punctuation", ","],
+			" LastName",
+			["punctuation", ")"]
 		]]
 	]],
 	["punctuation", ";"]
diff --git a/tests/languages/cshtml/block_feature.test b/tests/languages/cshtml/block_feature.test
new file mode 100644
index 0000000000..59bd8b05de
--- /dev/null
+++ b/tests/languages/cshtml/block_feature.test
@@ -0,0 +1,899 @@
+@for (var i = 0; i < people.Length; i++)
+{
+    var person = people[i];
+    Name: @person.Name
+}
+
+@if (value % 2 == 0)
+{
+    

The value was even.

+} + +@if (value % 2 == 0) +{ +

The value was even.

+} +else if (value >= 1337) +{ +

The value is large.

+} +else +{ +

The value is odd and small.

+} + +@switch (value) +{ + case 1: +

The value is 1!

+ break; + case 1337: +

Your number is 1337!

+ break; + default: +

Your number wasn't 1 or 1337.

+ break; +} + +@for (var i = 0; i < people.Length; i++) +{ + var person = people[i]; +

Name: @person.Name

+

Age: @person.Age

+} + +@foreach (var person in people) +{ +

Name: @person.Name

+

Age: @person.Age

+} + +@{ var i = 0; } +@while (i < people.Length) +{ + var person = people[i]; +

Name: @person.Name

+

Age: @person.Age

+ + i++; +} + +@{ var i = 0; } +@do +{ + var person = people[i]; +

Name: @person.Name

+

Age: @person.Age

+ + i++; +} while (i < people.Length); + +@using (Html.BeginForm()) +{ +
+ Email: + +
+} + +@try +{ + throw new InvalidOperationException("You did something invalid."); +} +catch (Exception ex) +{ +

The exception message: @ex.Message

+} +finally +{ +

The finally statement.

+} + +@lock (SomeLock) +{ + // Do critical section work +} + +---------------------------------------------------- + +[ + ["block", [ + ["keyword", "@for"], + ["csharp", [ + ["punctuation", "("], + ["class-name", [ + ["keyword", "var"] + ]], + " i ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + " i ", + ["operator", "<"], + " people", + ["punctuation", "."], + "Length", + ["punctuation", ";"], + " i", + ["operator", "++"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " person ", + ["operator", "="], + " people", + ["punctuation", "["], + "i", + ["punctuation", "]"], + ["punctuation", ";"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "text" + ]], + ["punctuation", ">"] + ]], + "Name: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Name" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@if"], + ["csharp", [ + ["punctuation", "("], + ["keyword", "value"], + ["operator", "%"], + ["number", "2"], + ["operator", "=="], + ["number", "0"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The value was even.", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@if"], + ["csharp", [ + ["punctuation", "("], + ["keyword", "value"], + ["operator", "%"], + ["number", "2"], + ["operator", "=="], + ["number", "0"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The value was even.", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"], + + ["keyword", "else"], + ["keyword", "if"], + ["punctuation", "("], + ["keyword", "value"], + ["operator", ">="], + ["number", "1337"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The value is large.", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"], + + ["keyword", "else"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The value is odd and small.", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@switch"], + ["csharp", [ + ["punctuation", "("], + ["keyword", "value"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["keyword", "case"], + ["number", "1"], + ["punctuation", ":"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The value is 1!", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["keyword", "break"], + ["punctuation", ";"], + + ["keyword", "case"], + ["number", "1337"], + ["punctuation", ":"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Your number is 1337!", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["keyword", "break"], + ["punctuation", ";"], + + ["keyword", "default"], + ["punctuation", ":"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Your number wasn't 1 or 1337.", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["keyword", "break"], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@for"], + ["csharp", [ + ["punctuation", "("], + ["class-name", [ + ["keyword", "var"] + ]], + " i ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + " i ", + ["operator", "<"], + " people", + ["punctuation", "."], + "Length", + ["punctuation", ";"], + " i", + ["operator", "++"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " person ", + ["operator", "="], + " people", + ["punctuation", "["], + "i", + ["punctuation", "]"], + ["punctuation", ";"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Name: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Name" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Age: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Age" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@foreach"], + ["csharp", [ + ["punctuation", "("], + ["class-name", [ + ["keyword", "var"] + ]], + " person ", + ["keyword", "in"], + " people", + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Name: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Name" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Age: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Age" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + ["class-name", [ + ["keyword", "var"] + ]], + " i ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@while"], + ["csharp", [ + ["punctuation", "("], + "i ", + ["operator", "<"], + " people", + ["punctuation", "."], + "Length", + ["punctuation", ")"], + + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " person ", + ["operator", "="], + " people", + ["punctuation", "["], + "i", + ["punctuation", "]"], + ["punctuation", ";"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Name: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Name" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Age: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Age" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + "\r\n\r\n i", ["operator", "++"], ["punctuation", ";"], + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + ["class-name", [ + ["keyword", "var"] + ]], + " i ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@do"], + + ["csharp", [ + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " person ", + ["operator", "="], + " people", + ["punctuation", "["], + "i", + ["punctuation", "]"], + ["punctuation", ";"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Name: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Name" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Age: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "person", + ["punctuation", "."], + "Age" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + "\r\n\r\n i", + ["operator", "++"], + ["punctuation", ";"], + + ["punctuation", "}"], + ["keyword", "while"], + ["punctuation", "("], + "i ", + ["operator", "<"], + " people", + ["punctuation", "."], + "Length", + ["punctuation", ")"], + ["punctuation", ";"] + ]] + ]], + + ["block", [ + ["keyword", "@using"], + ["csharp", [ + ["punctuation", "("], + "Html", + ["punctuation", "."], + ["function", "BeginForm"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + + "\r\n Email: ", + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "input" + ]], + ["attr-name", ["type"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "email", + ["punctuation", "\""] + ]], + ["attr-name", ["id"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "Email", + ["punctuation", "\""] + ]], + ["attr-name", ["value"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "button" + ]], + ["punctuation", ">"] + ]], + "Register", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@try"], + + ["csharp", [ + ["punctuation", "{"], + + ["keyword", "throw"], + ["keyword", "new"], + ["constructor-invocation", ["InvalidOperationException"]], + ["punctuation", "("], + ["string", "\"You did something invalid.\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "catch"], + ["punctuation", "("], + ["class-name", ["Exception"]], + " ex", + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The exception message: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "ex", + ["punctuation", "."], + "Message" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"], + + ["keyword", "finally"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "The finally statement.", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@lock"], + ["csharp", [ + ["punctuation", "("], "SomeLock", ["punctuation", ")"], + ["punctuation", "{"], + ["comment", "// Do critical section work"], + ["punctuation", "}"] + ]] + ]] +] diff --git a/tests/languages/cshtml/code-block_feature.test b/tests/languages/cshtml/code-block_feature.test new file mode 100644 index 0000000000..469d79c616 --- /dev/null +++ b/tests/languages/cshtml/code-block_feature.test @@ -0,0 +1,327 @@ +@{ + var quote = "The future depends on what you do today. - Mahatma Gandhi"; +} + +

@quote

+ +@{ + quote = "Hate cannot drive out hate, only love can do that. - Martin Luther King, Jr."; +} + +

@quote

+ +@{ + void RenderName(string name) + { +

Name: @name

+ } + + RenderName("Mahatma Gandhi"); + RenderName("Martin Luther King, Jr."); +} + +@{ + var inCSharp = true; +

Now in HTML, was in C# @inCSharp

+} + +@{ + Func petTemplate = @

You have a pet named @item.Name.

; + + var pets = new List + { + new Pet { Name = "Rin Tin Tin" }, + new Pet { Name = "Mr. Bigglesworth" }, + new Pet { Name = "K-9" } + }; +} + +---------------------------------------------------- + +[ + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " quote ", + ["operator", "="], + ["string", "\"The future depends on what you do today. - Mahatma Gandhi\""], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", ["quote"]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + + "\r\n quote ", + ["operator", "="], + ["string", "\"Hate cannot drive out hate, only love can do that. - Martin Luther King, Jr.\""], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", ["quote"]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + + ["return-type", [ + ["keyword", "void"] + ]], + ["function", "RenderName"], + ["punctuation", "("], + ["class-name", [ + ["keyword", "string"] + ]], + " name", + ["punctuation", ")"], + + ["punctuation", "{"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Name: ", + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "strong" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", ["name"]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"], + + ["function", "RenderName"], + ["punctuation", "("], + ["string", "\"Mahatma Gandhi\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "RenderName"], + ["punctuation", "("], + ["string", "\"Martin Luther King, Jr.\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " inCSharp ", + ["operator", "="], + ["boolean", "true"], + ["punctuation", ";"], + + ["html", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Now in HTML, was in C# ", + ["value", [ + ["keyword", "@"], + ["csharp", ["inCSharp"]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + + ["punctuation", "}"] + ]] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + + ["class-name", [ + "Func", + ["punctuation", "<"], + ["keyword", "dynamic"], + ["punctuation", ","], + ["keyword", "object"], + ["punctuation", ">"] + ]], + " petTemplate ", + ["operator", "="], + ["html", [ + ["delegate-operator", "@"], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "You have a pet named ", + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "strong" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", [ + "item", + ["punctuation", "."], + "Name" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ".", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + ["punctuation", ";"], + + ["class-name", [ + ["keyword", "var"] + ]], + " pets ", + ["operator", "="], + ["keyword", "new"], + ["constructor-invocation", [ + "List", + ["punctuation", "<"], + "Pet", + ["punctuation", ">"] + ]], + + ["punctuation", "{"], + + ["keyword", "new"], + ["constructor-invocation", ["Pet"]], + ["punctuation", "{"], + " Name ", + ["operator", "="], + ["string", "\"Rin Tin Tin\""], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "new"], + ["constructor-invocation", ["Pet"]], + ["punctuation", "{"], + " Name ", + ["operator", "="], + ["string", "\"Mr. Bigglesworth\""], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "new"], + ["constructor-invocation", ["Pet"]], + ["punctuation", "{"], + " Name ", + ["operator", "="], + ["string", "\"K-9\""], + ["punctuation", "}"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] + ]] +] diff --git a/tests/languages/cshtml/comment_feature.test b/tests/languages/cshtml/comment_feature.test new file mode 100644 index 0000000000..a3eb706dc7 --- /dev/null +++ b/tests/languages/cshtml/comment_feature.test @@ -0,0 +1,30 @@ +@{ + /* C# comment */ + // Another C# comment +} + + +@* + @{ + /* C# comment */ + // Another C# comment + } + +*@ + +---------------------------------------------------- + +[ + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + ["comment", "/* C# comment */"], + ["comment", "// Another C# comment"], + ["punctuation", "}"] + ]] + ]], + ["comment", ""], + + ["razor-comment", "@*\r\n @{\r\n /* C# comment */\r\n // Another C# comment\r\n }\r\n \r\n*@"] +] diff --git a/tests/languages/cshtml/value_feature.test b/tests/languages/cshtml/value_feature.test new file mode 100644 index 0000000000..4e5848295f --- /dev/null +++ b/tests/languages/cshtml/value_feature.test @@ -0,0 +1,346 @@ +

@@Username

+

@Username

+ +

@DateTime.Now

+

@DateTime.IsLeapYear(2016)

+ +

@await DoSomething("hello", "world")

+ +

@GenericMethod()

+ +

Last week this time: @(DateTime.Now - TimeSpan.FromDays(7))

+

Last week: @DateTime.Now - TimeSpan.FromDays(7)

+

Last week: 7/7/2016 4:39:52 PM - TimeSpan.FromDays(7)

+ +@{ + var joe = new Person("Joe", 33); +} + +

Age@(joe.Age)

+ +

@(GenericMethod())

+ +@("Hello World") + +@Html.Raw("Hello World") + +---------------------------------------------------- + +[ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "@@Username", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", ["Username"]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", [ + "DateTime", + ["punctuation", "."], + "Now" + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", [ + "DateTime", + ["punctuation", "."], + ["function", "IsLeapYear"], + ["punctuation", "("], + ["number", "2016"], + ["punctuation", ")"] + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", [ + ["keyword", "await"], + ["function", "DoSomething"], + ["punctuation", "("], + ["string", "\"hello\""], + ["punctuation", ","], + ["string", "\"world\""], + ["punctuation", ")"] + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", [ + ["generic-method", [ + ["function", "GenericMethod"], + ["generic", [ + ["punctuation", "<"], + ["keyword", "int"], + ["punctuation", ">"] + ]] + ]], + ["punctuation", "("], + ["punctuation", ")"] + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Last week this time: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "("], + "DateTime", + ["punctuation", "."], + "Now ", + ["operator", "-"], + " TimeSpan", + ["punctuation", "."], + ["function", "FromDays"], + ["punctuation", "("], + ["number", "7"], + ["punctuation", ")"], + ["punctuation", ")"] + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Last week: ", + ["value", [ + ["keyword", "@"], + ["csharp", [ + "DateTime", + ["punctuation", "."], + "Now" + ]] + ]], + " - TimeSpan.FromDays(7)", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Last week: 7/7/2016 4:39:52 PM - TimeSpan.FromDays(7)", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["block", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "var"] + ]], + " joe ", + ["operator", "="], + ["keyword", "new"], + ["constructor-invocation", ["Person"]], + ["punctuation", "("], + ["string", "\"Joe\""], + ["punctuation", ","], + ["number", "33"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + "Age", + ["value", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "("], + "joe", + ["punctuation", "."], + "Age", + ["punctuation", ")"] + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "p" + ]], + ["punctuation", ">"] + ]], + ["value", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "("], + ["generic-method", [ + ["function", "GenericMethod"], + ["generic", [ + ["punctuation", "<"], + ["keyword", "int"], + ["punctuation", ">"] + ]] + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"] + ]] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["value", [ + ["keyword", "@"], + ["csharp", [ + ["punctuation", "("], + ["string", "\"Hello World\""], + ["punctuation", ")"] + ]] + ]], + + ["value", [ + ["keyword", "@"], + ["csharp", [ + "Html", + ["punctuation", "."], + ["function", "Raw"], + ["punctuation", "("], + ["string", "\"Hello World\""], + ["punctuation", ")"] + ]] + ]] +] diff --git a/tests/languages/csp/directive_no_value_feature.test b/tests/languages/csp/directive_no_value_feature.test index a45d608292..a9fce90009 100644 --- a/tests/languages/csp/directive_no_value_feature.test +++ b/tests/languages/csp/directive_no_value_feature.test @@ -4,7 +4,7 @@ upgrade-insecure-requests; [ ["directive", "upgrade-insecure-requests"], - ";" + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/csp/directive_with_source_expression_feature.test b/tests/languages/csp/directive_with_source_expression_feature.test index a4db6cd64f..747dcc6a3b 100644 --- a/tests/languages/csp/directive_with_source_expression_feature.test +++ b/tests/languages/csp/directive_with_source_expression_feature.test @@ -1,10 +1,29 @@ -script-src example.com; +input-protection tolerance=50; input-protection-clip before=60; input-protection-selectors div; policy-uri https://example.com; script-src example.com; script-src-attr 'none'; style-src-elem 'none'; ---------------------------------------------------- [ + ["directive", "input-protection"], + " tolerance=50", + ["punctuation", ";"], + ["directive", "input-protection-clip"], + " before=60", + ["punctuation", ";"], + ["directive", "input-protection-selectors"], + " div", + ["punctuation", ";"], + ["directive", "policy-uri"], + ["host", ["https://example.com"]], + ["punctuation", ";"], ["directive", "script-src"], - " example.com;" + ["host", ["example.com"]], + ["punctuation", ";"], + ["directive", "script-src-attr"], + ["none", "'none'"], + ["punctuation", ";"], + ["directive", "style-src-elem"], + ["none", "'none'"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/csp/hash_feature.test b/tests/languages/csp/hash_feature.test new file mode 100644 index 0000000000..fd3b130cd2 --- /dev/null +++ b/tests/languages/csp/hash_feature.test @@ -0,0 +1,8 @@ +style-src 'sha256-EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4=' + +---------------------------------------------------- + +[ + ["directive", "style-src"], + ["hash", "'sha256-EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4='"] +] diff --git a/tests/languages/csp/host_feature.test b/tests/languages/csp/host_feature.test new file mode 100644 index 0000000000..9bc19e5c12 --- /dev/null +++ b/tests/languages/csp/host_feature.test @@ -0,0 +1,46 @@ +default-src trusted.com *.trusted.com; +img-src *; +media-src media1.com media2.com; +script-src userscripts.example.com; +frame-ancestors https://alice https://bob; +frame-ancestors https://example.com/; + +sandbox allow-scripts; + +---------------------------------------------------- + +[ + ["directive", "default-src"], + ["host", ["trusted.com"]], + ["host", [ + ["important", "*"], + ".trusted.com" + ]], + ["punctuation", ";"], + + ["directive", "img-src"], + ["host", [ + ["important", "*"] + ]], + ["punctuation", ";"], + + ["directive", "media-src"], + ["host", ["media1.com"]], + ["host", ["media2.com"]], + ["punctuation", ";"], + + ["directive", "script-src"], + ["host", ["userscripts.example.com"]], + ["punctuation", ";"], + + ["directive", "frame-ancestors"], + ["host", ["https://alice"]], + ["host", ["https://bob"]], + ["punctuation", ";"], + + ["directive", "frame-ancestors"], + ["host", ["https://example.com/"]], + ["punctuation", ";"], + + ["directive", "sandbox"], " allow-scripts", ["punctuation", ";"] +] diff --git a/tests/languages/csp/issue2661.test b/tests/languages/csp/issue2661.test new file mode 100644 index 0000000000..6eb7c5f519 --- /dev/null +++ b/tests/languages/csp/issue2661.test @@ -0,0 +1,14 @@ +default-src-is-a-fake; fake-default-src; + +---------------------------------------------------- + +[ + "default-src-is-a-fake", + ["punctuation", ";"], + " fake-default-src", + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for directive names with adjacent hyphens. diff --git a/tests/languages/csp/keyword_safe_feature.html.test b/tests/languages/csp/keyword_safe_feature.html.test new file mode 100644 index 0000000000..db3f36f6b2 --- /dev/null +++ b/tests/languages/csp/keyword_safe_feature.html.test @@ -0,0 +1,16 @@ +default-src 'report-sample'; +style-src 'self' 'strict-dynamic'; + +---------------------------------------------------- + +default-src +'report-sample' +; +style-src +'self' +'strict-dynamic' +; + +---------------------------------------------------- + +Checks for source expressions classified as safe. diff --git a/tests/languages/csp/keyword_unsafe_feature.html.test b/tests/languages/csp/keyword_unsafe_feature.html.test new file mode 100644 index 0000000000..227bec6b5e --- /dev/null +++ b/tests/languages/csp/keyword_unsafe_feature.html.test @@ -0,0 +1,20 @@ +navigate-to 'unsafe-allow-redirects'; +script-src 'unsafe-dynamic' 'unsafe-eval' 'unsafe-hash-attributes' 'unsafe-hashed-attributes' 'unsafe-hashes' 'unsafe-inline'; + +---------------------------------------------------- + +navigate-to +'unsafe-allow-redirects' +; +script-src +'unsafe-dynamic' +'unsafe-eval' +'unsafe-hash-attributes' +'unsafe-hashed-attributes' +'unsafe-hashes' +'unsafe-inline' +; + +---------------------------------------------------- + +Checks for source expressions classified as unsafe. diff --git a/tests/languages/csp/nonce_feature.test b/tests/languages/csp/nonce_feature.test new file mode 100644 index 0000000000..dc0e4a33ee --- /dev/null +++ b/tests/languages/csp/nonce_feature.test @@ -0,0 +1,9 @@ +style-src 'nonce-yeah'; + +---------------------------------------------------- + +[ + ["directive", "style-src"], + ["nonce", "'nonce-yeah'"], + ["punctuation", ";"] +] diff --git a/tests/languages/csp/none_feature.test b/tests/languages/csp/none_feature.test new file mode 100644 index 0000000000..7b4e837d31 --- /dev/null +++ b/tests/languages/csp/none_feature.test @@ -0,0 +1,8 @@ +sandbox 'none' + +---------------------------------------------------- + +[ + ["directive", "sandbox"], + ["none", "'none'"] +] diff --git a/tests/languages/csp/safe_feature.test b/tests/languages/csp/safe_feature.test deleted file mode 100644 index 13c9d837b7..0000000000 --- a/tests/languages/csp/safe_feature.test +++ /dev/null @@ -1,19 +0,0 @@ -default-src 'none'; style-src 'self' 'strict-dynamic' 'nonce-yeah' 'sha256-EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4='; - ----------------------------------------------------- - -[ - ["directive", "default-src"], - ["safe", "'none'"], - "; ", - ["directive", "style-src"], - ["safe", "'self'"], - ["safe", "'strict-dynamic'"], - ["safe", "'nonce-yeah'"], - ["safe", "'sha256-EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4='"], - ";" -] - ----------------------------------------------------- - -Checks for source expressions classified as safe. diff --git a/tests/languages/csp/scheme_feature.test b/tests/languages/csp/scheme_feature.test new file mode 100644 index 0000000000..5807a8c5dd --- /dev/null +++ b/tests/languages/csp/scheme_feature.test @@ -0,0 +1,10 @@ +default-src https: 'unsafe-inline' 'unsafe-eval' + +---------------------------------------------------- + +[ + ["directive", "default-src"], + ["scheme", "https:"], + ["keyword", "'unsafe-inline'"], + ["keyword", "'unsafe-eval'"] +] diff --git a/tests/languages/csp/unsafe_feature.test b/tests/languages/csp/unsafe_feature.test deleted file mode 100644 index e1cf98aa13..0000000000 --- a/tests/languages/csp/unsafe_feature.test +++ /dev/null @@ -1,15 +0,0 @@ -script-src 'unsafe-inline' 'unsafe-eval' 'unsafe-hashed-attributes'; - ----------------------------------------------------- - -[ - ["directive", "script-src"], - ["unsafe", "'unsafe-inline'"], - ["unsafe", "'unsafe-eval'"], - ["unsafe", "'unsafe-hashed-attributes'"], - ";" -] - ----------------------------------------------------- - -Checks for source expressions classified as unsafe. diff --git a/tests/languages/css!+css-extras/color_feature.test b/tests/languages/css!+css-extras/color_feature.test new file mode 100644 index 0000000000..261b6690e0 --- /dev/null +++ b/tests/languages/css!+css-extras/color_feature.test @@ -0,0 +1,341 @@ +AliceBlue +AntiqueWhite +Aqua +Aquamarine +Azure +Beige +Bisque +Black +BlanchedAlmond +Blue +BlueViolet +Brown +BurlyWood +CadetBlue +Chartreuse +Chocolate +Coral +CornflowerBlue +Cornsilk +Crimson +Cyan +DarkBlue +DarkCyan +DarkGoldenRod +DarkGrey +DarkGreen +DarkKhaki +DarkMagenta +DarkOliveGreen +DarkOrange +DarkOrchid +DarkRed +DarkSalmon +DarkSeaGreen +DarkSlateBlue +DarkSlateGrey +DarkTurquoise +DarkViolet +DeepPink +DeepSkyBlue +DimGrey +DodgerBlue +FireBrick +FloralWhite +ForestGreen +Fuchsia +Gainsboro +GhostWhite +Gold +GoldenRod +Grey +Green +GreenYellow +HoneyDew +HotPink +IndianRed +Indigo +Ivory +Khaki +Lavender +LavenderBlush +LawnGreen +LemonChiffon +LightBlue +LightCoral +LightCyan +LightGoldenRodYellow +LightGrey +LightGreen +LightPink +LightSalmon +LightSeaGreen +LightSkyBlue +LightSlateGrey +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 +SlateGrey +Snow +SpringGreen +SteelBlue +Tan +Teal +Thistle +Tomato +Transparent +Turquoise +Violet +Wheat +White +WhiteSmoke +Yellow +YellowGreen + +rgb(0,0,0) +rgba(0 , 255 , 0, 0.123) +hsl(170, 50%, 45%) +hsla(120,100%,50%,0.3) + +---------------------------------------------------- + +[ + ["color", "AliceBlue"], + ["color", "AntiqueWhite"], + ["color", "Aqua"], + ["color", "Aquamarine"], + ["color", "Azure"], + ["color", "Beige"], + ["color", "Bisque"], + ["color", "Black"], + ["color", "BlanchedAlmond"], + ["color", "Blue"], + ["color", "BlueViolet"], + ["color", "Brown"], + ["color", "BurlyWood"], + ["color", "CadetBlue"], + ["color", "Chartreuse"], + ["color", "Chocolate"], + ["color", "Coral"], + ["color", "CornflowerBlue"], + ["color", "Cornsilk"], + ["color", "Crimson"], + ["color", "Cyan"], + ["color", "DarkBlue"], + ["color", "DarkCyan"], + ["color", "DarkGoldenRod"], + ["color", "DarkGrey"], + ["color", "DarkGreen"], + ["color", "DarkKhaki"], + ["color", "DarkMagenta"], + ["color", "DarkOliveGreen"], + ["color", "DarkOrange"], + ["color", "DarkOrchid"], + ["color", "DarkRed"], + ["color", "DarkSalmon"], + ["color", "DarkSeaGreen"], + ["color", "DarkSlateBlue"], + ["color", "DarkSlateGrey"], + ["color", "DarkTurquoise"], + ["color", "DarkViolet"], + ["color", "DeepPink"], + ["color", "DeepSkyBlue"], + ["color", "DimGrey"], + ["color", "DodgerBlue"], + ["color", "FireBrick"], + ["color", "FloralWhite"], + ["color", "ForestGreen"], + ["color", "Fuchsia"], + ["color", "Gainsboro"], + ["color", "GhostWhite"], + ["color", "Gold"], + ["color", "GoldenRod"], + ["color", "Grey"], + ["color", "Green"], + ["color", "GreenYellow"], + ["color", "HoneyDew"], + ["color", "HotPink"], + ["color", "IndianRed"], + ["color", "Indigo"], + ["color", "Ivory"], + ["color", "Khaki"], + ["color", "Lavender"], + ["color", "LavenderBlush"], + ["color", "LawnGreen"], + ["color", "LemonChiffon"], + ["color", "LightBlue"], + ["color", "LightCoral"], + ["color", "LightCyan"], + ["color", "LightGoldenRodYellow"], + ["color", "LightGrey"], + ["color", "LightGreen"], + ["color", "LightPink"], + ["color", "LightSalmon"], + ["color", "LightSeaGreen"], + ["color", "LightSkyBlue"], + ["color", "LightSlateGrey"], + ["color", "LightSteelBlue"], + ["color", "LightYellow"], + ["color", "Lime"], + ["color", "LimeGreen"], + ["color", "Linen"], + ["color", "Magenta"], + ["color", "Maroon"], + ["color", "MediumAquaMarine"], + ["color", "MediumBlue"], + ["color", "MediumOrchid"], + ["color", "MediumPurple"], + ["color", "MediumSeaGreen"], + ["color", "MediumSlateBlue"], + ["color", "MediumSpringGreen"], + ["color", "MediumTurquoise"], + ["color", "MediumVioletRed"], + ["color", "MidnightBlue"], + ["color", "MintCream"], + ["color", "MistyRose"], + ["color", "Moccasin"], + ["color", "NavajoWhite"], + ["color", "Navy"], + ["color", "OldLace"], + ["color", "Olive"], + ["color", "OliveDrab"], + ["color", "Orange"], + ["color", "OrangeRed"], + ["color", "Orchid"], + ["color", "PaleGoldenRod"], + ["color", "PaleGreen"], + ["color", "PaleTurquoise"], + ["color", "PaleVioletRed"], + ["color", "PapayaWhip"], + ["color", "PeachPuff"], + ["color", "Peru"], + ["color", "Pink"], + ["color", "Plum"], + ["color", "PowderBlue"], + ["color", "Purple"], + ["color", "Red"], + ["color", "RosyBrown"], + ["color", "RoyalBlue"], + ["color", "SaddleBrown"], + ["color", "Salmon"], + ["color", "SandyBrown"], + ["color", "SeaGreen"], + ["color", "SeaShell"], + ["color", "Sienna"], + ["color", "Silver"], + ["color", "SkyBlue"], + ["color", "SlateBlue"], + ["color", "SlateGrey"], + ["color", "Snow"], + ["color", "SpringGreen"], + ["color", "SteelBlue"], + ["color", "Tan"], + ["color", "Teal"], + ["color", "Thistle"], + ["color", "Tomato"], + ["color", "Transparent"], + ["color", "Turquoise"], + ["color", "Violet"], + ["color", "Wheat"], + ["color", "White"], + ["color", "WhiteSmoke"], + ["color", "Yellow"], + ["color", "YellowGreen"], + + ["color", [ + ["function", "rgb"], + ["punctuation", "("], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ")"] + ]], + ["color", [ + ["function", "rgba"], + ["punctuation", "("], + ["number", "0"], + ["punctuation", ","], + ["number", "255"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ","], + ["number", "0.123"], + ["punctuation", ")"] + ]], + ["color", [ + ["function", "hsl"], + ["punctuation", "("], + ["number", "170"], + ["punctuation", ","], + ["number", "50"], + ["unit", "%"], + ["punctuation", ","], + ["number", "45"], + ["unit", "%"], + ["punctuation", ")"] + ]], + ["color", [ + ["function", "hsla"], + ["punctuation", "("], + ["number", "120"], + ["punctuation", ","], + ["number", "100"], + ["unit", "%"], + ["punctuation", ","], + ["number", "50"], + ["unit", "%"], + ["punctuation", ","], + ["number", "0.3"], + ["punctuation", ")"] + ]] +] diff --git a/tests/languages/css+css-extras+sass/issue2992.test b/tests/languages/css+css-extras+sass/issue2992.test new file mode 100644 index 0000000000..7300a2ec96 --- /dev/null +++ b/tests/languages/css+css-extras+sass/issue2992.test @@ -0,0 +1,31 @@ +.lucidagrande-normal-black-14px + color: var(--black) + font-family: var(--font-family-lucidagrande) + font-size: var(--font-size-m) + --foo: black + +---------------------------------------------------- + +[ + ["selector", ".lucidagrande-normal-black-14px"], + ["property-line", [ + ["property", "color"], + ["punctuation", ":"], + " var(--black)" + ]], + ["property-line", [ + ["property", "font-family"], + ["punctuation", ":"], + " var(--font-family-lucidagrande)" + ]], + ["property-line", [ + ["property", "font-size"], + ["punctuation", ":"], + " var(--font-size-m)" + ]], + ["property-line", [ + ["property", "--foo"], + ["punctuation", ":"], + " black" + ]] +] diff --git a/tests/languages/css+haml/css+haml_usage.test b/tests/languages/css+haml/css+haml_usage.test index c90047f28f..61638eac43 100644 --- a/tests/languages/css+haml/css+haml_usage.test +++ b/tests/languages/css+haml/css+haml_usage.test @@ -10,19 +10,23 @@ [ ["filter-css", [ ["filter-name", ":css"], - ["selector", ".test"], - ["punctuation", "{"], - ["punctuation", "}"] + ["text", [ + ["selector", ".test"], + ["punctuation", "{"], + ["punctuation", "}"] + ]] ]], ["punctuation", "~"], ["filter-css", [ - ["filter-name", ":css"], - ["selector", ".test"], - ["punctuation", "{"], - ["punctuation", "}"] - ]] + ["filter-name", ":css"], + ["text", [ + ["selector", ".test"], + ["punctuation", "{"], + ["punctuation", "}"] + ]] + ]] ] ---------------------------------------------------- -Checks for CSS filter in Haml. The tilde serves only as a separator. \ No newline at end of file +Checks for CSS filter in Haml. The tilde serves only as a separator. diff --git a/tests/languages/css+http/css_inclusion.test b/tests/languages/css+http/css_inclusion.test index 381ee3f387..5c3a24f884 100644 --- a/tests/languages/css+http/css_inclusion.test +++ b/tests/languages/css+http/css_inclusion.test @@ -7,15 +7,21 @@ a.link:hover { ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " text/css", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "text/css"] + ]], + ["text-css", [ ["selector", "a.link:hover"], ["punctuation", "{"], + ["property", "color"], ["punctuation", ":"], " red", ["punctuation", ";"], + ["punctuation", "}"] ]] ] diff --git a/tests/languages/csv/value.test b/tests/languages/csv/value.test new file mode 100644 index 0000000000..230d655ab2 --- /dev/null +++ b/tests/languages/csv/value.test @@ -0,0 +1,99 @@ +aaa,bbb,ccc +zzz,yyy,xxx + +"aaa","bbb","ccc" + +"aaa","b +bb","ccc" + +"aaa","b""bb","ccc" + +Year,Make,Model,Description,Price +1997,Ford,E350,"ac, abs, moon",3000.00 +1999,Chevy,"Venture ""Extended Edition""","",4900.00 +1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00 +1996,Jeep,Grand Cherokee,"MUST SELL! +air, moon roof, loaded",4799.00 + +---------------------------------------------------- + +[ + ["value", "aaa"], + ["punctuation", ","], + ["value", "bbb"], + ["punctuation", ","], + ["value", "ccc"], + + ["value", "zzz"], + ["punctuation", ","], + ["value", "yyy"], + ["punctuation", ","], + ["value", "xxx"], + + ["value", "\"aaa\""], + ["punctuation", ","], + ["value", "\"bbb\""], + ["punctuation", ","], + ["value", "\"ccc\""], + + ["value", "\"aaa\""], + ["punctuation", ","], + ["value", "\"b\r\nbb\""], + ["punctuation", ","], + ["value", "\"ccc\""], + + ["value", "\"aaa\""], + ["punctuation", ","], + ["value", "\"b\"\"bb\""], + ["punctuation", ","], + ["value", "\"ccc\""], + + ["value", "Year"], + ["punctuation", ","], + ["value", "Make"], + ["punctuation", ","], + ["value", "Model"], + ["punctuation", ","], + ["value", "Description"], + ["punctuation", ","], + ["value", "Price"], + + ["value", "1997"], + ["punctuation", ","], + ["value", "Ford"], + ["punctuation", ","], + ["value", "E350"], + ["punctuation", ","], + ["value", "\"ac, abs, moon\""], + ["punctuation", ","], + ["value", "3000.00"], + + ["value", "1999"], + ["punctuation", ","], + ["value", "Chevy"], + ["punctuation", ","], + ["value", "\"Venture \"\"Extended Edition\"\"\""], + ["punctuation", ","], + ["value", "\"\""], + ["punctuation", ","], + ["value", "4900.00"], + + ["value", "1999"], + ["punctuation", ","], + ["value", "Chevy"], + ["punctuation", ","], + ["value", "\"Venture \"\"Extended Edition, Very Large\"\"\""], + ["punctuation", ","], + ["punctuation", ","], + ["value", "5000.00"], + + ["value", "1996"], + ["punctuation", ","], + ["value", "Jeep"], + ["punctuation", ","], + ["value", "Grand Cherokee"], + ["punctuation", ","], + ["value", "\"MUST SELL!\r\nair, moon roof, loaded\""], + ["punctuation", ","], + ["value", "4799.00"] +] \ No newline at end of file diff --git a/tests/languages/cypher/variable_feature.test b/tests/languages/cypher/variable_feature.test index 7e1bf7c3c7..73038b3b6c 100644 --- a/tests/languages/cypher/variable_feature.test +++ b/tests/languages/cypher/variable_feature.test @@ -5,9 +5,7 @@ a.$name [ ["variable", "$name"], - "\na", - ["punctuation", "."], - ["variable", "$name"] + "\r\na", ["punctuation", "."], ["variable", "$name"] ] ---------------------------------------------------- diff --git a/tests/languages/d/char_feature.test b/tests/languages/d/char_feature.test new file mode 100644 index 0000000000..8d62d47523 --- /dev/null +++ b/tests/languages/d/char_feature.test @@ -0,0 +1,23 @@ +'a' +'\'' +'\\' +'\n' +'\xFF' +'\377' +'\uFFFF' +'\U0010FFFF' +'\quot' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\''"], + ["char", "'\\\\'"], + ["char", "'\\n'"], + ["char", "'\\xFF'"], + ["char", "'\\377'"], + ["char", "'\\uFFFF'"], + ["char", "'\\U0010FFFF'"], + ["char", "'\\quot'"] +] diff --git a/tests/languages/d/string_feature.test b/tests/languages/d/string_feature.test index ad01114554..5eddabb335 100644 --- a/tests/languages/d/string_feature.test +++ b/tests/languages/d/string_feature.test @@ -19,8 +19,6 @@ bar/" q"|fo"o bar|" -'a' '\'' '\\' '\n' '\xFF' '\377' '\uFFFF' '\U0010FFFF' '\quot' - "" "foo"c "bar"w "baz"d "fo\"o @@ -50,20 +48,8 @@ q{ q{bar} } ["string", "q\"/fo\"o\r\nbar/\""], ["string", "q\"|fo\"o\r\nbar|\""], - ["string", "'a'"], - ["string", "'\\''"], - ["string", "'\\\\'"], - ["string", "'\\n'"], - ["string", "'\\xFF'"], - ["string", "'\\377'"], - ["string", "'\\uFFFF'"], - ["string", "'\\U0010FFFF'"], - ["string", "'\\quot'"], - ["string", "\"\""], - ["string", "\"foo\"c"], - ["string", "\"bar\"w"], - ["string", "\"baz\"d"], + ["string", "\"foo\"c"], ["string", "\"bar\"w"], ["string", "\"baz\"d"], ["string", "\"fo\\\"o\r\nbar\""], ["string", "`foo`"], diff --git a/tests/languages/dart/class-name_feature.test b/tests/languages/dart/class-name_feature.test new file mode 100644 index 0000000000..f97d9ab6f6 --- /dev/null +++ b/tests/languages/dart/class-name_feature.test @@ -0,0 +1,174 @@ +class Foo with ns.Bar { + const Foo(this.bar); + + final Bar bar; + + Baz baz(ns.Bat bat) { + return Baz(bat); + } + +} + +class MyWidget extends SingleChildStatelessWidget { + MyWidget({Key key, Widget child}): super(key: key, child: child); + + @override + Widget buildWithChild(BuildContext context, Widget child) { + return SomethingWidget(child: child); + } +} + +var copy = Foo.Bar.from(foo); +ID foo = something(); + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", ["Foo"]], + ["keyword", "with"], + ["class-name", [ + ["namespace", [ + "ns", + ["punctuation", "."] + ]], + "Bar" + ]], + ["punctuation", "{"], + + ["keyword", "const"], + ["class-name", ["Foo"]], + ["punctuation", "("], + ["keyword", "this"], + ["punctuation", "."], + "bar", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "final"], ["class-name", ["Bar"]], " bar", ["punctuation", ";"], + + ["class-name", ["Baz"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", [ + ["namespace", [ + "ns", + ["punctuation", "."] + ]], + "Bat" + ]], + ["punctuation", ">"] + ]], + ["function", "baz"], + ["punctuation", "("], + ["class-name", [ + ["namespace", [ + "ns", + ["punctuation", "."] + ]], + "Bat" + ]], + " bat", + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["class-name", ["Baz"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", [ + ["namespace", [ + "ns", + ["punctuation", "."] + ]], + "Bat" + ]], + ["punctuation", ">"] + ]], + ["punctuation", "("], + "bat", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", ["MyWidget"]], + ["keyword", "extends"], + ["class-name", ["SingleChildStatelessWidget"]], + ["punctuation", "{"], + + ["class-name", ["MyWidget"]], + ["punctuation", "("], + ["punctuation", "{"], + ["class-name", ["Key"]], + " key", + ["punctuation", ","], + ["class-name", ["Widget"]], + " child", + ["punctuation", "}"], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "super"], + ["punctuation", "("], + "key", + ["punctuation", ":"], + " key", + ["punctuation", ","], + " child", + ["punctuation", ":"], + " child", + ["punctuation", ")"], + ["punctuation", ";"], + + ["metadata", "@override"], + + ["class-name", ["Widget"]], + ["function", "buildWithChild"], + ["punctuation", "("], + ["class-name", ["BuildContext"]], + " context", + ["punctuation", ","], + ["class-name", ["Widget"]], + " child", + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["class-name", ["SomethingWidget"]], + ["punctuation", "("], + "child", + ["punctuation", ":"], + " child", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["keyword", "var"], + " copy ", + ["operator", "="], + ["class-name", ["Foo.Bar"]], + ["punctuation", "."], + ["function", "from"], + ["punctuation", "("], + "foo", + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", ["ID"]], + " foo ", + ["operator", "="], + ["function", "something"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks class names and generics diff --git a/tests/languages/dart/keyword_feature.test b/tests/languages/dart/keyword_feature.test index bc78ce3e11..745f75e9e8 100644 --- a/tests/languages/dart/keyword_feature.test +++ b/tests/languages/dart/keyword_feature.test @@ -7,7 +7,7 @@ continue covariant default deferred do dynamic else enum export extension external extends; -factory final finally for Function +factory final finally for get hide if implements; interface; @@ -34,7 +34,7 @@ void while with yield ["keyword", "do"], ["keyword", "dynamic"], ["keyword", "else"], ["keyword", "enum"], ["keyword", "export"], ["keyword", "extension"], ["keyword", "external"], ["keyword", "extends"], ["punctuation", ";"], - ["keyword", "factory"], ["keyword", "final"], ["keyword", "finally"], ["keyword", "for"], ["keyword", "Function"], + ["keyword", "factory"], ["keyword", "final"], ["keyword", "finally"], ["keyword", "for"], ["keyword", "get"], ["keyword", "hide"], ["keyword", "if"], ["keyword", "implements"], ["punctuation", ";"], ["keyword", "interface"], ["punctuation", ";"], @@ -51,4 +51,4 @@ void while with yield ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/dart/metadata_feature.test b/tests/languages/dart/metadata_feature.test index e88e7ba126..2eecbac80a 100644 --- a/tests/languages/dart/metadata_feature.test +++ b/tests/languages/dart/metadata_feature.test @@ -1,20 +1,148 @@ @deprecated @override -@todo('seth', 'make this do something') +@ToDo('seth', 'make this do something') + +@DataTable("sale_orders") +class SaleOrder { + @DataColumn("sale_order_date") + DateTime date; +} + +@table +class Product { + @column + String name; +} + +const DataColumn column = const DataColumn(); + +const DataTable table = const DataTable(); + +class DataTable { + final String name; + + const DataTable([this.name]); +} + +class DataColumn { + final String name; + + const DataColumn([this.name]); +} ---------------------------------------------------- [ ["metadata", "@deprecated"], + ["metadata", "@override"], - ["metadata", "@todo"], + + ["metadata", "@ToDo"], ["punctuation", "("], - ["string", "'seth'"], + ["string-literal", [ + ["string", "'seth'"] + ]], ["punctuation", ","], - ["string", "'make this do something'"], - ["punctuation", ")"] + ["string-literal", [ + ["string", "'make this do something'"] + ]], + ["punctuation", ")"], + + ["metadata", "@DataTable"], + ["punctuation", "("], + ["string-literal", [ + ["string", "\"sale_orders\""] + ]], + ["punctuation", ")"], + + ["keyword", "class"], + ["class-name", ["SaleOrder"]], + ["punctuation", "{"], + + ["metadata", "@DataColumn"], + ["punctuation", "("], + ["string-literal", [ + ["string", "\"sale_order_date\""] + ]], + ["punctuation", ")"], + + ["class-name", ["DateTime"]], + " date", + ["punctuation", ";"], + + ["punctuation", "}"], + + ["metadata", "@table"], + ["keyword", "class"], ["class-name", ["Product"]], ["punctuation", "{"], + ["metadata", "@column"], + ["class-name", ["String"]], " name", ["punctuation", ";"], + ["punctuation", "}"], + + ["keyword", "const"], + ["class-name", ["DataColumn"]], + " column ", + ["operator", "="], + ["keyword", "const"], + ["class-name", ["DataColumn"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "const"], + ["class-name", ["DataTable"]], + " table ", + ["operator", "="], + ["keyword", "const"], + ["class-name", ["DataTable"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "class"], + ["class-name", ["DataTable"]], + ["punctuation", "{"], + + ["keyword", "final"], + ["class-name", ["String"]], + " name", + ["punctuation", ";"], + + ["keyword", "const"], + ["class-name", ["DataTable"]], + ["punctuation", "("], + ["punctuation", "["], + ["keyword", "this"], + ["punctuation", "."], + "name", + ["punctuation", "]"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", ["DataColumn"]], + ["punctuation", "{"], + + ["keyword", "final"], + ["class-name", ["String"]], + " name", + ["punctuation", ";"], + + ["keyword", "const"], + ["class-name", ["DataColumn"]], + ["punctuation", "("], + ["punctuation", "["], + ["keyword", "this"], + ["punctuation", "."], + "name", + ["punctuation", "]"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] ] ---------------------------------------------------- -Checks for metadata. \ No newline at end of file +Checks for metadata. diff --git a/tests/languages/dart/operator_feature.test b/tests/languages/dart/operator_feature.test index 5d631fd0bb..01993d9ed4 100644 --- a/tests/languages/dart/operator_feature.test +++ b/tests/languages/dart/operator_feature.test @@ -1,14 +1,13 @@ ++ -- * / % ~/ + - ! ~ -<< >> ? -& ^ | ->= > <= < +< << <= <<= +> >> >= >>= +& ^ | ? as is is! == != && || = *= /= ~/= %= += -= -<<= >>= &= ^= |= ---------------------------------------------------- @@ -17,17 +16,16 @@ as is is! ["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", "as"], ["operator", "is"], ["operator", "is!"], ["operator", "=="], ["operator", "!="], ["operator", "&&"], ["operator", "||"], ["operator", "="], ["operator", "*="], ["operator", "/="], ["operator", "~/="], ["operator", "%="], ["operator", "+="], ["operator", "-="], - ["operator", "<<="], ["operator", ">>="], ["operator", "&="], ["operator", "^="], ["operator", "|="] ] ---------------------------------------------------- -Checks for all operators. \ No newline at end of file +Checks for all operators. diff --git a/tests/languages/dart/string_feature.test b/tests/languages/dart/string_feature.test index feffdbce44..951d9fe223 100644 --- a/tests/languages/dart/string_feature.test +++ b/tests/languages/dart/string_feature.test @@ -8,18 +8,89 @@ bar""" '''foo bar''' +'$string has ${string.length} letters' +"cookie has ${cookie.number_of_chips} chips" + ---------------------------------------------------- [ - ["string", "\"\""], ["string", "''"], - ["string", "r\"\""], ["string", "r''"], - ["string", "\"\"\"\"\"\""], ["string", "''''''"], - ["string", "r\"\"\"\"\"\""], ["string", "r''''''"], - ["string", "\"fo\\\"o\""], ["string", "'fo\\'o'"], - ["string", "\"\"\"foo\r\nbar\"\"\""], ["string", "'''foo\r\nbar'''"] + ["string-literal", [ + ["string", "\"\""] + ]], + ["string-literal", [ + ["string", "''"] + ]], + + ["string-literal", [ + ["string", "r\"\""] + ]], + ["string-literal", [ + ["string", "r''"] + ]], + + ["string-literal", [ + ["string", "\"\"\"\"\"\""] + ]], + ["string-literal", [ + ["string", "''''''"] + ]], + + ["string-literal", [ + ["string", "r\"\"\"\"\"\""] + ]], + ["string-literal", [ + ["string", "r''''''"] + ]], + + ["string-literal", [ + ["string", "\"fo\\\"o\""] + ]], + ["string-literal", [ + ["string", "'fo\\'o'"] + ]], + + ["string-literal", [ + ["string", "\"\"\"foo\r\nbar\"\"\""] + ]], + + ["string-literal", [ + ["string", "'''foo\r\nbar'''"] + ]], + + ["string-literal", [ + ["string", "'"], + ["interpolation", [ + ["punctuation", "$"], + ["expression", ["string"]] + ]], + ["string", " has "], + ["interpolation", [ + ["punctuation", "${"], + ["expression", [ + "string", + ["punctuation", "."], + "length" + ]], + ["punctuation", "}"] + ]], + ["string", " letters'"] + ]], + ["string-literal", [ + ["string", "\"cookie has "], + ["interpolation", [ + ["punctuation", "${"], + ["expression", [ + "cookie", + ["punctuation", "."], + "number_of_chips" + ]], + ["punctuation", "}"] + ]], + ["string", " chips\""] + ]] ] ---------------------------------------------------- Checks for single quoted and double quoted strings, -multi-line strings and "raw" strings. \ No newline at end of file +multi-line strings and "raw" strings. diff --git a/tests/languages/dataweave/boolean_feature.test b/tests/languages/dataweave/boolean_feature.test new file mode 100644 index 0000000000..6d1903d869 --- /dev/null +++ b/tests/languages/dataweave/boolean_feature.test @@ -0,0 +1,12 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] + +---------------------------------------------------- +Check for boolean \ No newline at end of file diff --git a/tests/languages/dataweave/comment_feature.test b/tests/languages/dataweave/comment_feature.test new file mode 100644 index 0000000000..6791431849 --- /dev/null +++ b/tests/languages/dataweave/comment_feature.test @@ -0,0 +1,17 @@ +// Line comment "" + /* Block comment */ + /** + * MultiLine Comment + **/ +/* "" */ + +---------------------------------------------------- + +[ + ["comment", "// Line comment \"\"\t"], + ["comment", "/* Block comment */"], + ["comment", "/**\r\n\t* MultiLine Comment\r\n\t**/"], + ["comment", "/* \"\" */"] +] +---------------------------------------------------- +Check for comments \ No newline at end of file diff --git a/tests/languages/dataweave/dates_feature.test b/tests/languages/dataweave/dates_feature.test new file mode 100644 index 0000000000..fb0644e7fc --- /dev/null +++ b/tests/languages/dataweave/dates_feature.test @@ -0,0 +1,27 @@ +|12-12-2001-T12:00:00| +|12-12-2001-T12:00:00+03:00| +|12-12-2001-T12:00:00Z| +|12-12-2001| +|12:00:00| +|12:00:00Z| +|12:00:00-03:00| +|P1D| +|P1Y1D| +|P1Y1D2H3M5S| + +---------------------------------------------------- + +[ + ["date", "|12-12-2001-T12:00:00|"], + ["date", "|12-12-2001-T12:00:00+03:00|"], + ["date", "|12-12-2001-T12:00:00Z|"], + ["date", "|12-12-2001|"], + ["date", "|12:00:00|"], + ["date", "|12:00:00Z|"], + ["date", "|12:00:00-03:00|"], + ["date", "|P1D|"], + ["date", "|P1Y1D|"], + ["date", "|P1Y1D2H3M5S|"] +] +---------------------------------------------------- +Check for date \ No newline at end of file diff --git a/tests/languages/dataweave/functions_feature.test b/tests/languages/dataweave/functions_feature.test new file mode 100644 index 0000000000..84285da4a8 --- /dev/null +++ b/tests/languages/dataweave/functions_feature.test @@ -0,0 +1,30 @@ +myfunction(a, b,123) +payload.myFunction(1,2,3) + +---------------------------------------------------- + +[ + ["function", "myfunction"], + ["punctuation", "("], + "a", + ["punctuation", ","], + " b", + ["punctuation", ","], + ["number", "123"], + ["punctuation", ")"], + + "\r\npayload", + ["punctuation", "."], + ["function", "myFunction"], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Check for functions diff --git a/tests/languages/dataweave/keywords_feature.test b/tests/languages/dataweave/keywords_feature.test new file mode 100644 index 0000000000..73d4e58bf0 --- /dev/null +++ b/tests/languages/dataweave/keywords_feature.test @@ -0,0 +1,134 @@ +%dw 2.0 +input payalod application/json +ns ns0 http://localhost.com +var a = 123 +type T = String +fun test(a: Number) = a + 123 +output application/json +--- +{} match { + case a is String -> x as String +} +update { + case a at .name -> +} +if(true or false and not true) do { + +} +else +payload match { + case a is String -> x as String +} + +null +unless +using + +---------------------------------------------------- + +[ + "%dw ", + ["number", "2.0"], + + ["keyword", "input"], + " payalod ", + ["mime-type", "application/json"], + + ["keyword", "ns"], + " ns0 ", + ["url", "http://localhost.com"], + + ["keyword", "var"], + " a ", + ["operator", "="], + ["number", "123"], + + ["keyword", "type"], + " T ", + ["operator", "="], + " String\r\n", + + ["keyword", "fun"], + ["function", "test"], + ["punctuation", "("], + ["property", "a"], + ["punctuation", ":"], + " Number", + ["punctuation", ")"], + ["operator", "="], + " a ", + ["operator", "+"], + ["number", "123"], + + ["keyword", "output"], + ["mime-type", "application/json"], + + ["operator", "---"], + + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "match"], + ["punctuation", "{"], + + ["keyword", "case"], + " a ", + ["keyword", "is"], + " String ", + ["operator", "->"], + " x ", + ["keyword", "as"], + " String\r\n", + + ["punctuation", "}"], + + ["keyword", "update"], + ["punctuation", "{"], + + ["keyword", "case"], + " a ", + ["keyword", "at"], + ["punctuation", "."], + "name ", + ["operator", "->"], + + ["punctuation", "}"], + + ["keyword", "if"], + ["punctuation", "("], + ["boolean", "true"], + ["keyword", "or"], + ["boolean", "false"], + ["keyword", "and"], + ["keyword", "not"], + ["boolean", "true"], + ["punctuation", ")"], + ["keyword", "do"], + ["punctuation", "{"], + + ["punctuation", "}"], + + ["keyword", "else"], + + "\r\npayload ", + ["keyword", "match"], + ["punctuation", "{"], + + ["keyword", "case"], + " a ", + ["keyword", "is"], + " String ", + ["operator", "->"], + " x ", + ["keyword", "as"], + " String\r\n", + + ["punctuation", "}"], + + ["keyword", "null"], + ["keyword", "unless"], + ["keyword", "using"] +] + +---------------------------------------------------- + +Check for keywords diff --git a/tests/languages/dataweave/null_feature.test b/tests/languages/dataweave/null_feature.test new file mode 100644 index 0000000000..862eca5daa --- /dev/null +++ b/tests/languages/dataweave/null_feature.test @@ -0,0 +1,9 @@ +null + +---------------------------------------------------- + +[ + ["keyword", "null"] +] +---------------------------------------------------- +Check for null \ No newline at end of file diff --git a/tests/languages/dataweave/number_feature.test b/tests/languages/dataweave/number_feature.test new file mode 100644 index 0000000000..a902c641df --- /dev/null +++ b/tests/languages/dataweave/number_feature.test @@ -0,0 +1,25 @@ +0 +123 +3.14159 +5.0e8 +0.2E+2 +47e-5 +-1.23 +-2.34E33 +-4.34E-33 + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"], + ["number", "3.14159"], + ["number", "5.0e8"], + ["number", "0.2E+2"], + ["number", "47e-5"], + ["number", "-1.23"], + ["number", "-2.34E33"], + ["number", "-4.34E-33"] +] +---------------------------------------------------- +Check for number \ No newline at end of file diff --git a/tests/languages/dataweave/operators_feature.test b/tests/languages/dataweave/operators_feature.test new file mode 100644 index 0000000000..f2ea0cac01 --- /dev/null +++ b/tests/languages/dataweave/operators_feature.test @@ -0,0 +1,79 @@ +a > b +c < d +a = 1 +a << 1 +b >> 2 +d <= 2 +e >= 3 +f != 4 +g ~= 4 +h == 1 +(a) -> 1 +a ++ b +c -- d +payload.name! +payload.name? + +---------------------------------------------------- + +[ + "a ", + ["operator", ">"], + " b\r\nc ", + ["operator", "<"], + " d\r\na ", + ["operator", "="], + ["number", "1"], + + "\r\na ", + ["operator", "<<"], + ["number", "1"], + + "\r\nb ", + ["operator", ">>"], + ["number", "2"], + + "\r\nd ", + ["operator", "<="], + ["number", "2"], + + "\r\ne ", + ["operator", ">="], + ["number", "3"], + + "\r\nf ", + ["operator", "!="], + ["number", "4"], + + "\r\ng ", + ["operator", "~="], + ["number", "4"], + + "\r\nh ", + ["operator", "=="], + ["number", "1"], + + ["punctuation", "("], + "a", + ["punctuation", ")"], + ["operator", "->"], + ["number", "1"], + + "\r\na ", + ["operator", "++"], + " b\r\nc ", + ["operator", "--"], + " d\r\npayload", + ["punctuation", "."], + "name", + ["operator", "!"], + + "\r\npayload", + ["punctuation", "."], + "name", + ["operator", "?"] +] + +---------------------------------------------------- + +Check for operators diff --git a/tests/languages/dataweave/property_feature.test b/tests/languages/dataweave/property_feature.test new file mode 100644 index 0000000000..ee3148ebc3 --- /dev/null +++ b/tests/languages/dataweave/property_feature.test @@ -0,0 +1,53 @@ +{ + a: 123, + "My Name": true, + t#test : true, + "test" @(a: true): 2, + test#"test" @(a: true): 3 +} + +---------------------------------------------------- + +[ + ["punctuation", "{"], + + ["property", "a"], + ["punctuation", ":"], + ["number", "123"], + ["punctuation", ","], + + ["property", "\"My Name\""], + ["punctuation", ":"], + ["boolean", "true"], + ["punctuation", ","], + + ["property", "t#test"], + ["punctuation", ":"], + ["boolean", "true"], + ["punctuation", ","], + + ["property", "\"test\""], + ["punctuation", "@"], + ["punctuation", "("], + ["property", "a"], + ["punctuation", ":"], + ["boolean", "true"], + ["punctuation", ")"], + ["punctuation", ":"], + ["number", "2"], + ["punctuation", ","], + + ["property", "test#\"test\""], + ["punctuation", "@"], + ["punctuation", "("], + ["property", "a"], + ["punctuation", ":"], + ["boolean", "true"], + ["punctuation", ")"], + ["punctuation", ":"], + ["number", "3"], + + ["punctuation", "}"] +] +---------------------------------------------------- +Check for properties \ No newline at end of file diff --git a/tests/languages/dataweave/regex_feature.test b/tests/languages/dataweave/regex_feature.test new file mode 100644 index 0000000000..2ff1190c87 --- /dev/null +++ b/tests/languages/dataweave/regex_feature.test @@ -0,0 +1,15 @@ +/(asd)+?[a-Z]/ +/ / +/\w+\/\s*/ +/([0-1]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])/ + +---------------------------------------------------- + +[ + ["regex", "/(asd)+?[a-Z]/"], + ["regex", "/ /"], + ["regex", "/\\w+\\/\\s*/"], + ["regex", "/([0-1]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])/"] +] +---------------------------------------------------- +Check for regex \ No newline at end of file diff --git a/tests/languages/dataweave/string_feature.test b/tests/languages/dataweave/string_feature.test new file mode 100644 index 0000000000..854b3ca8d7 --- /dev/null +++ b/tests/languages/dataweave/string_feature.test @@ -0,0 +1,27 @@ +"" +"foo" +"foo\"bar\"baz" +"\u2642\\" +`hello` +'test' +"this is a multiline +test +that +can +be long" +"This string \r\n Should also \\ \t" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"foo\\\"bar\\\"baz\""], + ["string", "\"\\u2642\\\\\""], + ["string", "`hello`"], + ["string", "'test'"], + ["string", "\"this is a multiline\r\ntest\r\nthat \r\ncan \r\nbe long\""], + ["string", "\"This string \\r\\n Should also \\\\ \\t\""] +] +---------------------------------------------------- +Check for strings \ No newline at end of file diff --git a/tests/languages/dhall/builtin_feature.test b/tests/languages/dhall/builtin_feature.test new file mode 100644 index 0000000000..8ec35a04ec --- /dev/null +++ b/tests/languages/dhall/builtin_feature.test @@ -0,0 +1,9 @@ +Some +None + +---------------------------------------------------- + +[ + ["builtin", "Some"], + ["builtin", "None"] +] diff --git a/tests/languages/dhall/comment_feature.test b/tests/languages/dhall/comment_feature.test index 89dcd4754a..86a35a4e08 100644 --- a/tests/languages/dhall/comment_feature.test +++ b/tests/languages/dhall/comment_feature.test @@ -12,7 +12,7 @@ [ ["comment", "-- comment"], - ["comment", "{-\n\tcomment\n\t{-\n\t\tnested comment\n\t-}\n-}"] + ["comment", "{-\r\n\tcomment\r\n\t{-\r\n\t\tnested comment\r\n\t-}\r\n-}"] ] ---------------------------------------------------- diff --git a/tests/languages/dhall/string_feature.test b/tests/languages/dhall/string_feature.test index 572987db2c..215aa23ab9 100644 --- a/tests/languages/dhall/string_feature.test +++ b/tests/languages/dhall/string_feature.test @@ -14,45 +14,32 @@ foo/${bar} ---------------------------------------------------- [ - ["string", [ - "\"\"" - ]], - ["string", [ - "\"foo\"" - ]], - ["string", [ - "\"\\\"\"" - ]], + ["string", ["\"\""]], + ["string", ["\"foo\""]], + ["string", ["\"\\\"\""]], ["string", [ "\"foo/", ["interpolation", [ ["punctuation", "${"], - ["expression", [ - "bar" - ]], + ["expression", ["bar"]], ["punctuation", "}"] ]], "\"" ]], - ["string", [ - "''foo''" - ]], - ["string", [ - "''bar'''baz''" - ]], + ["string", ["''foo''"]], + ["string", ["''bar'''baz''"]], ["string", [ - "''\nfoo/", + "''\r\nfoo/", ["interpolation", [ ["punctuation", "${"], - ["expression", [ - "bar" - ]], + ["expression", ["bar"]], ["punctuation", "}"] ]], - "\n''" + + "\r\n''" ]] ] diff --git a/tests/languages/django/operator_feature.test b/tests/languages/django/operator_feature.test new file mode 100644 index 0000000000..73d66d20a2 --- /dev/null +++ b/tests/languages/django/operator_feature.test @@ -0,0 +1,58 @@ +{% + ++ - * / % ++= -= *= /= %= +** **= +// //= +== != < <= > >= <> += +<< >> +& | ^ ~ + +%} + +---------------------------------------------------- + +[ + ["django", [ + ["delimiter", "{%"], + + ["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", "~"], + + ["delimiter", "%}"] + ]] +] diff --git a/tests/languages/docker/instruction_feature.test b/tests/languages/docker/instruction_feature.test new file mode 100644 index 0000000000..49179c194b --- /dev/null +++ b/tests/languages/docker/instruction_feature.test @@ -0,0 +1,186 @@ +RUN apt-get \ +update && apt-get \ +#comment +# +\ +\ + + +install git -y #not-a-comment \ +something + +RUN echo hello \ +# comment +world + + # this is a comment-line + RUN echo hello +RUN echo world + +RUN echo "\ + hello\ + world" + +LABEL multi.label1="value1" \ + multi.label2="value2" \ + other="value3" + +EXPOSE 80/udp + +ENV MY_NAME="John Doe" +ENV MY_NAME="John Doe" MY_DOG=Rex\ The\ Dog \ + MY_CAT=fluffy + +ADD hom?.txt /mydir/ + +ENTRYPOINT ["executable", "param1", "param2"] + +FROM debian:stable +RUN apt-get update && apt-get install -y --force-yes apache2 +EXPOSE 80 443 +VOLUME ["/var/www", "/var/log/apache2", "/etc/apache2"] +ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] + +ENTRYPOINT [ "/path/myprocess", \ + "arg1", \ + "arg2" \ +] + +---------------------------------------------------- + +[ + ["instruction", [ + ["keyword", "RUN"], " apt-get ", ["operator", "\\"], + "\r\nupdate && apt-get ", ["operator", "\\"], + ["comment", "#comment"], + ["comment", "#"], + ["operator", "\\"], + ["operator", "\\"], + + "\r\n\r\n\r\ninstall git -y #not-a-comment ", ["operator", "\\"], + "\r\nsomething" + ]], + + ["instruction", [ + ["keyword", "RUN"], " echo hello ", ["operator", "\\"], + ["comment", "# comment"], + "\r\nworld" + ]], + + ["comment", "# this is a comment-line"], + ["instruction", [ + ["keyword", "RUN"], + " echo hello" + ]], + ["instruction", [ + ["keyword", "RUN"], + " echo world" + ]], + + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "\"\\\r\n hello\\\r\n world\""] + ]], + + ["instruction", [ + ["keyword", "LABEL"], + " multi.label1=", + ["string", "\"value1\""], + ["operator", "\\"], + + "\r\n multi.label2=", + ["string", "\"value2\""], + ["operator", "\\"], + + "\r\n other=", + ["string", "\"value3\""] + ]], + + ["instruction", [ + ["keyword", "EXPOSE"], + " 80/udp" + ]], + + ["instruction", [ + ["keyword", "ENV"], + " MY_NAME=", + ["string", "\"John Doe\""] + ]], + + ["instruction", [ + ["keyword", "ENV"], + " MY_NAME=", + ["string", "\"John Doe\""], + " MY_DOG=Rex\\ The\\ Dog ", + ["operator", "\\"], + + "\r\n MY_CAT=fluffy" + ]], + + ["instruction", [ + ["keyword", "ADD"], + " hom?.txt /mydir/" + ]], + + ["instruction", [ + ["keyword", "ENTRYPOINT"], + " [", + ["string", "\"executable\""], + ", ", + ["string", "\"param1\""], + ", ", + ["string", "\"param2\""], + "]" + ]], + + ["instruction", [ + ["keyword", "FROM"], + " debian:stable" + ]], + ["instruction", [ + ["keyword", "RUN"], + " apt-get update && apt-get install -y --force-yes apache2" + ]], + ["instruction", [ + ["keyword", "EXPOSE"], + " 80 443" + ]], + ["instruction", [ + ["keyword", "VOLUME"], + " [", + ["string", "\"/var/www\""], + ", ", + ["string", "\"/var/log/apache2\""], + ", ", + ["string", "\"/etc/apache2\""], + "]" + ]], + ["instruction", [ + ["keyword", "ENTRYPOINT"], + " [", + ["string", "\"/usr/sbin/apache2ctl\""], + ", ", + ["string", "\"-D\""], + ", ", + ["string", "\"FOREGROUND\""], + "]" + ]], + + ["instruction", [ + ["keyword", "ENTRYPOINT"], + " [ ", + ["string", "\"/path/myprocess\""], + ", ", + ["operator", "\\"], + + ["string", "\"arg1\""], + ", ", + ["operator", "\\"], + + ["string", "\"arg2\""], + ["operator", "\\"], + + "\r\n]" + ]] +] \ No newline at end of file diff --git a/tests/languages/docker/keyword_feature.test b/tests/languages/docker/keyword_feature.test index a36a7e00b6..5330a6221e 100644 --- a/tests/languages/docker/keyword_feature.test +++ b/tests/languages/docker/keyword_feature.test @@ -1,5 +1,6 @@ ONBUILD ADD . /app/src FROM ubuntu +FROM ubuntu AS build MAINTAINER SvenDowideit@home.org.au RUN cd /tmp EXPOSE 5900 @@ -9,6 +10,7 @@ VOLUME /myvol USER daemon WORKDIR /a HEALTHCHECK CMD echo "foo" +HEALTHCHECK NONE LABEL version="1.0" ENTRYPOINT ["top", "-b"] ARG user1 @@ -18,28 +20,94 @@ STOPSIGNAL signal ---------------------------------------------------- [ - ["keyword", "ONBUILD"], ["keyword", "ADD"], " . /app/src\r\n", - ["keyword", "FROM"], " ubuntu\r\n", - ["keyword", "MAINTAINER"], " SvenDowideit@home.org.au\r\n", - ["keyword", "RUN"], " cd /tmp\r\n", - ["keyword", "EXPOSE"], " 5900\r\n", - ["keyword", "ENV"], " myName John Doe\r\n", - ["keyword", "COPY"], " hom* /mydir/\r\n", - ["keyword", "VOLUME"], " /myvol\r\n", - ["keyword", "USER"], " daemon\r\n", - ["keyword", "WORKDIR"], " /a\r\n", - ["keyword", "HEALTHCHECK"], ["keyword", "CMD"], " echo ", ["string", "\"foo\""], - ["keyword", "LABEL"], " version=", ["string", "\"1.0\""], - ["keyword", "ENTRYPOINT"], - ["punctuation", "["], ["string", "\"top\""], ["punctuation", ","], - ["string", "\"-b\""], ["punctuation", "]"], - ["keyword", "ARG"], " user1\r\n", - ["keyword", "SHELL"], - ["punctuation", "["], ["string", "\"powershell\""], ["punctuation", ","], - ["string", "\"-command\""], ["punctuation", "]"], - ["keyword", "STOPSIGNAL"], " signal" + ["instruction", [ + ["keyword", "ONBUILD"], + ["keyword", "ADD"], + " . /app/src" + ]], + ["instruction", [ + ["keyword", "FROM"], + " ubuntu" + ]], + ["instruction", [ + ["keyword", "FROM"], + " ubuntu ", + ["keyword", "AS"], + " build" + ]], + ["instruction", [ + ["keyword", "MAINTAINER"], + " SvenDowideit@home.org.au" + ]], + ["instruction", [ + ["keyword", "RUN"], + " cd /tmp" + ]], + ["instruction", [ + ["keyword", "EXPOSE"], + " 5900" + ]], + ["instruction", [ + ["keyword", "ENV"], + " myName John Doe" + ]], + ["instruction", [ + ["keyword", "COPY"], + " hom* /mydir/" + ]], + ["instruction", [ + ["keyword", "VOLUME"], + " /myvol" + ]], + ["instruction", [ + ["keyword", "USER"], + " daemon" + ]], + ["instruction", [ + ["keyword", "WORKDIR"], + " /a" + ]], + ["instruction", [ + ["keyword", "HEALTHCHECK"], + ["keyword", "CMD"], + " echo ", + ["string", "\"foo\""] + ]], + ["instruction", [ + ["keyword", "HEALTHCHECK"], + ["keyword", "NONE"] + ]], + ["instruction", [ + ["keyword", "LABEL"], + " version=", + ["string", "\"1.0\""] + ]], + ["instruction", [ + ["keyword", "ENTRYPOINT"], + " [", + ["string", "\"top\""], + ", ", + ["string", "\"-b\""], + "]" + ]], + ["instruction", [ + ["keyword", "ARG"], + " user1" + ]], + ["instruction", [ + ["keyword", "SHELL"], + " [", + ["string", "\"powershell\""], + ", ", + ["string", "\"-command\""], + "]" + ]], + ["instruction", [ + ["keyword", "STOPSIGNAL"], + " signal" + ]] ] ---------------------------------------------------- -Checks for keywords. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/docker/options_feature.test b/tests/languages/docker/options_feature.test new file mode 100644 index 0000000000..03f4841ce5 --- /dev/null +++ b/tests/languages/docker/options_feature.test @@ -0,0 +1,89 @@ +ADD --chown=1 files* /somedir/ +COPY --chown=1 files* /somedir/ + +HEALTHCHECK --interval=5m --timeout=3s \ + CMD foo + +ONBUILD HEALTHCHECK --interval=5m --timeout=3s \ + CMD foo + +HEALTHCHECK \ + --interval=5m \ + --timeout=3s \ + CMD foo + +---------------------------------------------------- + +[ + ["instruction", [ + ["keyword", "ADD"], + ["options", [ + ["property", "--chown"], + ["punctuation", "="], + ["string", "1"] + ]], + " files* /somedir/" + ]], + ["instruction", [ + ["keyword", "COPY"], + ["options", [ + ["property", "--chown"], + ["punctuation", "="], + ["string", "1"] + ]], + " files* /somedir/" + ]], + + ["instruction", [ + ["keyword", "HEALTHCHECK"], + ["options", [ + ["property", "--interval"], + ["punctuation", "="], + ["string", "5m"], + ["property", "--timeout"], + ["punctuation", "="], + ["string", "3s"] + ]], + ["operator", "\\"], + + ["keyword", "CMD"], + " foo" + ]], + + ["instruction", [ + ["keyword", "ONBUILD"], + ["keyword", "HEALTHCHECK"], + ["options", [ + ["property", "--interval"], + ["punctuation", "="], + ["string", "5m"], + ["property", "--timeout"], + ["punctuation", "="], + ["string", "3s"] + ]], + ["operator", "\\"], + + ["keyword", "CMD"], + " foo" + ]], + + ["instruction", [ + ["keyword", "HEALTHCHECK"], + ["operator", "\\"], + + ["options", [ + ["property", "--interval"], + ["punctuation", "="], + ["string", "5m"], + ["operator", "\\"], + + ["property", "--timeout"], + ["punctuation", "="], + ["string", "3s"] + ]], + ["operator", "\\"], + + ["keyword", "CMD"], + " foo" + ]] +] \ No newline at end of file diff --git a/tests/languages/docker/string_feature.test b/tests/languages/docker/string_feature.test index e131f02136..9f7b812f4c 100644 --- a/tests/languages/docker/string_feature.test +++ b/tests/languages/docker/string_feature.test @@ -1,23 +1,49 @@ -"" -"fo\"obar" -"foo\ +RUN echo "" +RUN echo "fo\"obar" +RUN echo "foo\ bar" -'' -'fo\'obar' -'foo\ + +RUN echo '' +RUN echo 'fo\'obar' +RUN echo 'foo\ bar' ---------------------------------------------------- [ - ["string", "\"\""], - ["string", "\"fo\\\"obar\""], - ["string", "\"foo\\\r\nbar\""], - ["string", "''"], - ["string", "'fo\\'obar'"], - ["string", "'foo\\\r\nbar'"] + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "\"\""] + ]], + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "\"fo\\\"obar\""] + ]], + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "\"foo\\\r\nbar\""] + ]], + + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "''"] + ]], + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "'fo\\'obar'"] + ]], + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["string", "'foo\\\r\nbar'"] + ]] ] ---------------------------------------------------- -Checks for strings. \ No newline at end of file +Checks for strings. diff --git a/tests/languages/docker/variable_feature.test b/tests/languages/docker/variable_feature.test new file mode 100644 index 0000000000..53067767e9 --- /dev/null +++ b/tests/languages/docker/variable_feature.test @@ -0,0 +1,62 @@ +FROM busybox +USER ${user:-some_user} +ARG user +USER $user +RUN echo $CONT_IMG_VER + +ARG CODE_VERSION=latest +FROM base:${CODE_VERSION} +CMD /code/run-app + +FROM extras:${CODE_VERSION} +CMD /code/run-extras + +---------------------------------------------------- + +[ + ["instruction", [ + ["keyword", "FROM"], + " busybox" + ]], + ["instruction", [ + ["keyword", "USER"], + ["variable", "${user:-some_user}"] + ]], + ["instruction", [ + ["keyword", "ARG"], + " user" + ]], + ["instruction", [ + ["keyword", "USER"], + ["variable", "$user"] + ]], + ["instruction", [ + ["keyword", "RUN"], + " echo ", + ["variable", "$CONT_IMG_VER"] + ]], + + ["instruction", [ + ["keyword", "ARG"], + " CODE_VERSION=latest" + ]], + ["instruction", [ + ["keyword", "FROM"], + " base:", + ["variable", "${CODE_VERSION}"] + ]], + ["instruction", [ + ["keyword", "CMD"], + " /code/run-app" + ]], + + ["instruction", [ + ["keyword", "FROM"], + " extras:", + ["variable", "${CODE_VERSION}"] + ]], + ["instruction", [ + ["keyword", "CMD"], + " /code/run-extras" + ]] +] \ No newline at end of file diff --git a/tests/languages/dot!+markup/attribute_feature.test b/tests/languages/dot!+markup/attribute_feature.test new file mode 100644 index 0000000000..42db4f9343 --- /dev/null +++ b/tests/languages/dot!+markup/attribute_feature.test @@ -0,0 +1,129 @@ +[label=< + + +
leftmid dleright
>] + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["attr-name", ["label"]], + ["operator", "="], + ["attr-value", [ + "<", + ["markup", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "TABLE" + ]], + ["attr-name", ["BORDER"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "0", + ["punctuation", "\""] + ]], + ["attr-name", ["CELLBORDER"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "1", + ["punctuation", "\""] + ]], + ["attr-name", ["CELLSPACING"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "0", + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "TR" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "TD" + ]], + ["punctuation", ">"] + ]], + "left", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "TD" + ]], + ["attr-name", ["PORT"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "f1", + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + "mid dle", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "TD" + ]], + ["attr-name", ["PORT"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "f2", + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + "right", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + ">" + ]], + ["punctuation", "]"] +] \ No newline at end of file diff --git a/tests/languages/dot/attribute_feature.test b/tests/languages/dot/attribute_feature.test new file mode 100644 index 0000000000..25db2c6bd1 --- /dev/null +++ b/tests/languages/dot/attribute_feature.test @@ -0,0 +1,53 @@ +[foo=bar] + +[ + foo = 123; + "graph" = " +some +value", 123 = bar baz = 123 +] + +[label=< + + +
leftmid dleright
>] + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["attr-name", ["foo"]], + ["operator", "="], + ["attr-value", ["bar"]], + ["punctuation", "]"], + + ["punctuation", "["], + + ["attr-name", ["foo"]], + ["operator", "="], + ["attr-value", ["123"]], + ["punctuation", ";"], + + ["attr-name", ["\"graph\""]], + ["operator", "="], + ["attr-value", ["\"\r\nsome\r\nvalue\""]], + ["punctuation", ","], + ["attr-name", ["123"]], + ["operator", "="], + ["attr-value", ["bar"]], + ["attr-name", ["baz"]], + ["operator", "="], + ["attr-value", ["123"]], + + ["punctuation", "]"], + + ["punctuation", "["], + ["attr-name", ["label"]], + ["operator", "="], + ["attr-value", [ + "<", + ["markup", "\r\n\r\n \r\n
leftmid dleright
"], + ">" + ]], + ["punctuation", "]"] +] \ No newline at end of file diff --git a/tests/languages/dot/comment_feature.test b/tests/languages/dot/comment_feature.test new file mode 100644 index 0000000000..b8102e52be --- /dev/null +++ b/tests/languages/dot/comment_feature.test @@ -0,0 +1,15 @@ +// comment +/* +comment +*/ + +# not really a comment but ignored + +---------------------------------------------------- + +[ + ["comment", "// comment"], + ["comment", "/*\r\ncomment\r\n*/"], + + ["comment", "# not really a comment but ignored"] +] \ No newline at end of file diff --git a/tests/languages/dot/graph-name_feature.test b/tests/languages/dot/graph-name_feature.test new file mode 100644 index 0000000000..de41c7bf42 --- /dev/null +++ b/tests/languages/dot/graph-name_feature.test @@ -0,0 +1,22 @@ +graph ethane {} +digraph foo {} +subgraph bar {} + +---------------------------------------------------- + +[ + ["keyword", "graph"], + ["graph-name", ["ethane"]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "digraph"], + ["graph-name", ["foo"]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "subgraph"], + ["graph-name", ["bar"]], + ["punctuation", "{"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/dot/keyword_feature.test b/tests/languages/dot/keyword_feature.test new file mode 100644 index 0000000000..d1a4129528 --- /dev/null +++ b/tests/languages/dot/keyword_feature.test @@ -0,0 +1,17 @@ +digraph; +edge; +graph; +node; +strict; +subgraph; + +---------------------------------------------------- + +[ + ["keyword", "digraph"], ["punctuation", ";"], + ["keyword", "edge"], ["punctuation", ";"], + ["keyword", "graph"], ["punctuation", ";"], + ["keyword", "node"], ["punctuation", ";"], + ["keyword", "strict"], ["punctuation", ";"], + ["keyword", "subgraph"], ["punctuation", ";"] +] diff --git a/tests/languages/dot/node_feature.test b/tests/languages/dot/node_feature.test new file mode 100644 index 0000000000..5ae649bdd4 --- /dev/null +++ b/tests/languages/dot/node_feature.test @@ -0,0 +1,34 @@ +struct1:f1 -> struct2:f0; +struct1:f2 -> struct3:here; + +A:ne -> B:sw + +---------------------------------------------------- + +[ + ["node", ["struct1"]], + ["operator", ":"], + ["node", ["f1"]], + ["operator", "->"], + ["node", ["struct2"]], + ["operator", ":"], + ["node", ["f0"]], + ["punctuation", ";"], + + ["node", ["struct1"]], + ["operator", ":"], + ["node", ["f2"]], + ["operator", "->"], + ["node", ["struct3"]], + ["operator", ":"], + ["node", ["here"]], + ["punctuation", ";"], + + ["node", ["A"]], + ["operator", ":"], + ["compass-point", "ne"], + ["operator", "->"], + ["node", ["B"]], + ["operator", ":"], + ["compass-point", "sw"] +] \ No newline at end of file diff --git a/tests/languages/dot/operator_feature.test b/tests/languages/dot/operator_feature.test new file mode 100644 index 0000000000..8ec3ced9d5 --- /dev/null +++ b/tests/languages/dot/operator_feature.test @@ -0,0 +1,9 @@ +-- -> += : + +---------------------------------------------------- + +[ + ["operator", "--"], ["operator", "->"], + ["operator", "="], ["operator", ":"] +] diff --git a/tests/languages/dot/punctuation_feature.test b/tests/languages/dot/punctuation_feature.test new file mode 100644 index 0000000000..c417a42458 --- /dev/null +++ b/tests/languages/dot/punctuation_feature.test @@ -0,0 +1,12 @@ +[ ] { } ; , + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ";"], + ["punctuation", ","] +] \ No newline at end of file diff --git a/tests/languages/editorconfig/key_value_feature.test b/tests/languages/editorconfig/key_value_feature.test index dfcbd6a335..545e34d6f6 100644 --- a/tests/languages/editorconfig/key_value_feature.test +++ b/tests/languages/editorconfig/key_value_feature.test @@ -5,17 +5,17 @@ foobar = 42 ---------------------------------------------------- [ - ["property", "foo"], + ["key", "foo"], ["value", [ ["punctuation", "="], " Bar Baz" ]], - ["property", "foobar"], + ["key", "foobar"], ["value", [ ["punctuation", "="], " 42" ]], - ["property", "another_value"], + ["key", "another_value"], ["value", [ ["punctuation", "="], " with_indent" @@ -24,4 +24,4 @@ foobar = 42 ---------------------------------------------------- -Checks for key/value pairs. \ No newline at end of file +Checks for key/value pairs. diff --git a/tests/languages/eiffel/punctuation_feature.test b/tests/languages/eiffel/punctuation_feature.test new file mode 100644 index 0000000000..efa8051984 --- /dev/null +++ b/tests/languages/eiffel/punctuation_feature.test @@ -0,0 +1,29 @@ +:= << >> (| |) -> + +.foo + +{ } [ ] ; ( ) , : ? + +---------------------------------------------------- + +[ + ["punctuation", ":="], + ["punctuation", "<<"], + ["punctuation", ">>"], + ["punctuation", "(|"], + ["punctuation", "|)"], + ["punctuation", "->"], + + ["punctuation", "."], "foo\r\n\r\n", + + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", "?"] +] diff --git a/tests/languages/ejs+pug/ejs_inclusion.test b/tests/languages/ejs+pug/ejs_inclusion.test new file mode 100644 index 0000000000..f5b90b1bfd --- /dev/null +++ b/tests/languages/ejs+pug/ejs_inclusion.test @@ -0,0 +1,25 @@ +:ejs + <% var foo = '', bar = false; %> + +---------------------------------------------------- + +[ + ["filter-ejs", [ + ["filter-name", ":ejs"], + ["text", [ + ["delimiter", "<%"], + ["language-javascript", [ + ["keyword", "var"], + " foo ", + ["operator", "="], + ["string", "''"], + ["punctuation", ","], + " bar ", + ["operator", "="], + ["boolean", "false"], + ["punctuation", ";"] + ]], + ["delimiter", "%>"] + ]] + ]] +] diff --git a/tests/languages/ejs/comment_feature.test b/tests/languages/ejs/comment_feature.test index 7f4a4c1e43..795353b71b 100644 --- a/tests/languages/ejs/comment_feature.test +++ b/tests/languages/ejs/comment_feature.test @@ -6,7 +6,7 @@ bar%> [ ["ejs", [ ["delimiter", "<%"], - ["comment", "#foo\nbar"], + ["comment", "#foo\r\nbar"], ["delimiter", "%>"] ]] ] diff --git a/tests/languages/elixir/attribute_feature.test b/tests/languages/elixir/attribute_feature.test index 273c2a402f..52c0bc1c6d 100644 --- a/tests/languages/elixir/attribute_feature.test +++ b/tests/languages/elixir/attribute_feature.test @@ -8,12 +8,10 @@ foobar [ ["attribute", "@vsn"], ["number", "2"], - ["attribute", "@moduledoc"], ["string", [ - "\"\"\"\r\nfoobar\r\n\"\"\"" - ]], + ["doc", [ ["attribute", "@moduledoc" ], [ "string", "\"\"\"\r\nfoobar\r\n\"\"\"" ] ] ], ["attribute", "@tag"], ["atom", ":external"] ] ---------------------------------------------------- -Checks for module attributes. \ No newline at end of file +Checks for module attributes. diff --git a/tests/languages/elixir/capture_feature.test b/tests/languages/elixir/capture_feature.test index 8a64b66154..caa9473be9 100644 --- a/tests/languages/elixir/capture_feature.test +++ b/tests/languages/elixir/capture_feature.test @@ -1,28 +1,56 @@ +&Math.zero?(0) fun = &Math.zero?/1 (&is_function/1).(fun) fun = &(&1 + 1) &List.flatten(&1, &2) +fun = &Math.zero?/invalid + ---------------------------------------------------- [ - "fun ", ["operator", "="], - ["capture", "&Math.zero?/1"], + ["operator", "&"], + ["module", "Math"], + ["punctuation", "."], + ["function", "zero?" ], ["punctuation", "("], - ["capture", "&is_function/1"], + ["number", "0"], + ["punctuation", ")"], + "\r\nfun ", ["operator", "="], + ["operator", "&"], + ["module", "Math"], + ["punctuation", "."], + ["function", "zero?" ], + ["operator", "/"], + ["number", "1"], + ["punctuation", "("], + ["operator", "&"], + ["function", "is_function"], + ["operator", "/"], + ["number", "1"], ["punctuation", ")"], ["punctuation", "."], ["punctuation", "("], "fun", ["punctuation", ")"], "\r\nfun ", ["operator", "="], - ["capture", "&"], + ["operator", "&"], ["punctuation", "("], ["argument", "&1"], ["operator", "+"], ["number", "1"], ["punctuation", ")"], - ["capture", "&List.flatten"], + ["operator", "&"], + ["module", "List"], + ["punctuation", "."], ["function", "flatten"], ["punctuation", "("], ["argument", "&1"], ["punctuation", ","], ["argument", "&2"], - ["punctuation", ")"] + ["punctuation", ")"], + "\r\n\r\nfun ", + [ "operator", "=" ], + [ "operator", "&" ], + [ "module", "Math" ], + [ "punctuation", "." ], + "zero?", + [ "operator", "/" ], + "invalid" ] ---------------------------------------------------- -Checks for function capturing and arguments. \ No newline at end of file +Checks for function capturing and arguments. diff --git a/tests/languages/elixir/doc_feature.test b/tests/languages/elixir/doc_feature.test new file mode 100644 index 0000000000..1def921e0b --- /dev/null +++ b/tests/languages/elixir/doc_feature.test @@ -0,0 +1,105 @@ +@doc "single" +@doc 'single' +@doc """triple""" +@doc '''triple''' +@doc ''' +multiline +''' +@doc """ +multiline +""" +@doc since: "1.3.0" +@doc deprecated: "phased out" + +@moduledoc "single" +@moduledoc 'single' +@moduledoc """triple""" +@moduledoc '''triple''' +@moduledoc ''' +multiline +''' +@moduledoc """ +multiline +""" +@moduledoc since: "1.3.0" +@moduledoc deprecated: "phased out" + +---------------------------------------------------- + +[ + ["doc", [ + ["attribute", "@doc"], + ["string", "\"single\""] + ]], + + ["doc", [ + ["attribute", "@doc"], + ["string", "'single'"] + ]], + + ["doc", [ + ["attribute", "@doc"], + ["string", "\"\"\"triple\"\"\""] + ]], + + ["doc", [ + ["attribute", "@doc"], + ["string", "'''triple'''"] + ]], + + ["doc", [ + ["attribute", "@doc"], + ["string", "'''\r\nmultiline\r\n'''"] + ]], + + ["doc", [ + ["attribute", "@doc"], + ["string", "\"\"\"\r\nmultiline\r\n\"\"\""] + ]], + + ["attribute", "@doc"], + ["attr-name", "since:"], + ["string", ["\"1.3.0\""]], + + ["attribute", "@doc"], + ["attr-name", "deprecated:"], + ["string", ["\"phased out\""]], + + ["doc", [ + ["attribute", "@moduledoc"], + ["string", "\"single\""] + ]], + + ["doc", [ + ["attribute", "@moduledoc"], + ["string", "'single'"] + ]], + + ["doc", [ + ["attribute", "@moduledoc"], + ["string", "\"\"\"triple\"\"\""] + ]], + + ["doc", [ + ["attribute", "@moduledoc"], + ["string", "'''triple'''"] + ]], + + ["doc", [ + ["attribute", "@moduledoc"], + ["string", "'''\r\nmultiline\r\n'''"] + ]], + + ["doc", [ + ["attribute", "@moduledoc"], + ["string", "\"\"\"\r\nmultiline\r\n\"\"\""] + ]], + + ["attribute", "@moduledoc"], + ["attr-name", "since:"], + ["string", ["\"1.3.0\""]], + + ["attribute", "@moduledoc"], + ["attr-name", "deprecated:"], + ["string", ["\"phased out\""]] +] diff --git a/tests/languages/elixir/issue1392.test b/tests/languages/elixir/issue1392.test index c7d20a8366..1c0c93b3aa 100644 --- a/tests/languages/elixir/issue1392.test +++ b/tests/languages/elixir/issue1392.test @@ -3,9 +3,9 @@ String.upcase(@fixed) ---------------------------------------------------- [ - "String", + ["module", "String"], ["punctuation", "."], - "upcase", + ["function", "upcase"], ["punctuation", "("], ["attribute", "@fixed"], ["punctuation", ")"] @@ -13,4 +13,4 @@ String.upcase(@fixed) ---------------------------------------------------- -Ensure module attributes don't consume punctuation. \ No newline at end of file +Ensure module attributes don't consume punctuation. diff --git a/tests/languages/elixir/issue775.test b/tests/languages/elixir/issue775.test index d3243f80a8..9804bba6d9 100644 --- a/tests/languages/elixir/issue775.test +++ b/tests/languages/elixir/issue775.test @@ -5,13 +5,16 @@ ---------------------------------------------------- [ - ["attribute", "@doc"], - ["string", [ - "\"\"\"\r\n## Parameters\r\n\"\"\"" - ]] + [ + "doc", + [ + [ "attribute", "@doc" ], + [ "string", "\"\"\"\r\n## Parameters\r\n\"\"\"" ] + ] + ] ] ---------------------------------------------------- Ensures that markdown headers are not highlighted as comments inside strings. -See #775 for details. \ No newline at end of file +See #775 for details. diff --git a/tests/languages/elixir/keyword_feature.test b/tests/languages/elixir/keyword_feature.test index e1b02a1ae3..78857b0b07 100644 --- a/tests/languages/elixir/keyword_feature.test +++ b/tests/languages/elixir/keyword_feature.test @@ -1,31 +1,39 @@ -after alias and case -catch cond def -defcallback -defexception -defimpl defmodule -defp defprotocol -defstruct do else -end fn for if -import not or -require rescue try -unless use when - ----------------------------------------------------- - -[ - ["keyword", "after"], ["keyword", "alias"], ["keyword", "and"], ["keyword", "case"], - ["keyword", "catch"], ["keyword", "cond"], ["keyword", "def"], - ["keyword", "defcallback"], - ["keyword", "defexception"], - ["keyword", "defimpl"], ["keyword", "defmodule"], - ["keyword", "defp"], ["keyword", "defprotocol"], - ["keyword", "defstruct"], ["keyword", "do"], ["keyword", "else"], - ["keyword", "end"], ["keyword", "fn"], ["keyword", "for"], ["keyword", "if"], - ["keyword", "import"], ["keyword", "not"], ["keyword", "or"], - ["keyword", "require"], ["keyword", "rescue"], ["keyword", "try"], - ["keyword", "unless"], ["keyword", "use"], ["keyword", "when"] -] - ----------------------------------------------------- - -Checks for all keywords. \ No newline at end of file +after alias and case +catch cond def +defcallback +defexception +defimpl defmodule +defp +defprotocol +defdelegate +defmacro quote unquote +defn defnp +defstruct do else +end fn for if +import not or +raise require rescue try +unless use when + +---------------------------------------------------- + +[ + ["keyword", "after"], ["keyword", "alias"], ["keyword", "and"], ["keyword", "case"], + ["keyword", "catch"], ["keyword", "cond"], ["keyword", "def"], + ["keyword", "defcallback"], + ["keyword", "defexception"], + ["keyword", "defimpl"], ["keyword", "defmodule"], + ["keyword", "defp"], + ["keyword", "defprotocol"], + ["keyword", "defdelegate"], + ["keyword", "defmacro"], ["keyword", "quote"], ["keyword", "unquote"], + ["keyword", "defn"], ["keyword", "defnp"], + ["keyword", "defstruct"], ["keyword", "do"], ["keyword", "else"], + ["keyword", "end"], ["keyword", "fn"], ["keyword", "for"], ["keyword", "if"], + ["keyword", "import"], ["keyword", "not"], ["keyword", "or"], + ["keyword", "raise"], ["keyword", "require"], ["keyword", "rescue"], ["keyword", "try"], + ["keyword", "unless"], ["keyword", "use"], ["keyword", "when"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/elixir/module_feature.test b/tests/languages/elixir/module_feature.test new file mode 100644 index 0000000000..4f84941673 --- /dev/null +++ b/tests/languages/elixir/module_feature.test @@ -0,0 +1,34 @@ +defmodule Math do + def sum(a, b) do + a + b + end +end + +---------------------------------------------------- + +[ + ["keyword", "defmodule"], + ["module", "Math"], + ["keyword", "do"], + + ["keyword", "def"], + ["function", "sum"], + ["punctuation", "("], + "a", + ["punctuation", ","], + " b", + ["punctuation", ")"], + ["keyword", "do"], + + "\r\n a ", + ["operator", "+"], + " b\r\n ", + + ["keyword", "end"], + + ["keyword", "end"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/elm/char_feature.test b/tests/languages/elm/char_feature.test index c4d33fcd2a..8fb06d33ce 100644 --- a/tests/languages/elm/char_feature.test +++ b/tests/languages/elm/char_feature.test @@ -3,6 +3,9 @@ '\n' '\23' '\xFE' +'\u{0000}' +'\u{1F648}' +'\u{10FFFF}' ---------------------------------------------------- @@ -11,9 +14,12 @@ ["char", "'\\''"], ["char", "'\\n'"], ["char", "'\\23'"], - ["char", "'\\xFE'"] + ["char", "'\\xFE'"], + ["char", "'\\u{0000}'"], + ["char", "'\\u{1F648}'"], + ["char", "'\\u{10FFFF}'"] ] ---------------------------------------------------- -Checks for chars. \ No newline at end of file +Checks for chars. diff --git a/tests/languages/elm/import_statement_feature.test b/tests/languages/elm/import-statement_feature.test similarity index 82% rename from tests/languages/elm/import_statement_feature.test rename to tests/languages/elm/import-statement_feature.test index c2940362dc..467d25f88e 100644 --- a/tests/languages/elm/import_statement_feature.test +++ b/tests/languages/elm/import-statement_feature.test @@ -7,23 +7,23 @@ import Json.Decode as Json exposing (Decoder) ---------------------------------------------------- [ - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], " Foo" ]], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], " Foo_42.Bar ", ["keyword", "as"], " Foobar" ]], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], " Foo.Bar ", ["keyword", "as"], " Foo.Baz" ]], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], " List ", ["keyword", "exposing"] @@ -31,7 +31,7 @@ import Json.Decode as Json exposing (Decoder) ["punctuation", "("], ["hvariable", "map"], ["punctuation", ")"], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], " Json.Decode ", ["keyword", "as"], diff --git a/tests/languages/erb+haml/erb_inclusion.test b/tests/languages/erb+haml/erb_inclusion.test new file mode 100644 index 0000000000..b070d61f81 --- /dev/null +++ b/tests/languages/erb+haml/erb_inclusion.test @@ -0,0 +1,42 @@ +:erb + <%= render @products || "empty_list" %> + +~ + :erb + <%= render @products || "empty_list" %> + +---------------------------------------------------- + +[ + ["filter-erb", [ + ["filter-name", ":erb"], + ["text", [ + ["delimiter", "<%="], + ["ruby", [ + " render ", + ["variable", "@products"], + ["operator", "||"], + ["string-literal", [ + ["string", "\"empty_list\""] + ]] + ]], + ["delimiter", "%>"] + ]] + ]], + ["punctuation", "~"], + ["filter-erb", [ + ["filter-name", ":erb"], + ["text", [ + ["delimiter", "<%="], + ["ruby", [ + " render ", + ["variable", "@products"], + ["operator", "||"], + ["string-literal", [ + ["string", "\"empty_list\""] + ]] + ]], + ["delimiter", "%>"] + ]] + ]] +] diff --git a/tests/languages/erb/erb_feature.test b/tests/languages/erb/erb_feature.test index cb86983d17..698383487a 100644 --- a/tests/languages/erb/erb_feature.test +++ b/tests/languages/erb/erb_feature.test @@ -7,30 +7,38 @@ [ ["erb", [ ["delimiter", "<%"], - ["comment", "# comment "], + ["ruby", [ + ["comment", "# comment "] + ]], ["delimiter", "%>"] ]], ["erb", [ ["delimiter", "<%="], - " render ", - ["variable", "@products"], - ["operator", "||"], - ["string", ["\"empty_list\""]], + ["ruby", [ + " render ", + ["variable", "@products"], + ["operator", "||"], + ["string-literal", [ + ["string", "\"empty_list\""] + ]] + ]], ["delimiter", "%>"] ]], ["erb", [ ["delimiter", "<%"], - ["variable", "@books"], - ["punctuation", "."], - ["keyword", "each"], - ["keyword", "do"], - ["operator", "|"], - "book", - ["operator", "|"], + ["ruby", [ + ["variable", "@books"], + ["punctuation", "."], + ["keyword", "each"], + ["keyword", "do"], + ["operator", "|"], + "book", + ["operator", "|"] + ]], ["delimiter", "%>"] ]] ] ---------------------------------------------------- -Checks for ERB tags. \ No newline at end of file +Checks for ERB tags. diff --git a/tests/languages/erb/erb_in_markup_feature.test b/tests/languages/erb/erb_in_markup_feature.test index 20719ea8c6..abc557e686 100644 --- a/tests/languages/erb/erb_in_markup_feature.test +++ b/tests/languages/erb/erb_in_markup_feature.test @@ -15,30 +15,39 @@ ___ERB1___<%= 1 %>___ERB2___<%= 2 %> ["punctuation", "\""], ["erb", [ ["delimiter", "<%="], - ["builtin", "Time"], - ["punctuation", "."], - "now", - ["punctuation", "."], - "strftime", - ["punctuation", "("], - ["string", ["'%A'"]], - ["punctuation", ")"], + ["ruby", [ + ["builtin", "Time"], + ["punctuation", "."], + "now", + ["punctuation", "."], + "strftime", + ["punctuation", "("], + ["string-literal", [ + ["string", "'%A'"] + ]], + ["punctuation", ")"] + ]], ["delimiter", "%>"] ]], ["punctuation", "\""] ]], ["punctuation", ">"] ]], + "\r\n___ERB1___", ["erb", [ ["delimiter", "<%="], - ["number", "1"], + ["ruby", [ + ["number", "1"] + ]], ["delimiter", "%>"] ]], "___ERB2___", ["erb", [ ["delimiter", "<%="], - ["number", "2"], + ["ruby", [ + ["number", "2"] + ]], ["delimiter", "%>"] ]] ] diff --git a/tests/languages/erb/issue1767.test b/tests/languages/erb/issue1767.test index 6a5a1f2cc3..57b71a943e 100644 --- a/tests/languages/erb/issue1767.test +++ b/tests/languages/erb/issue1767.test @@ -18,35 +18,41 @@ [ ["erb", [ ["delimiter", "<%"], - ["comment", "# this is a block comment "], + ["ruby", [ + ["comment", "# this is a block comment "] + ]], ["delimiter", "%>"] ]], - ["erb", [ ["delimiter", "<%"], - ["comment", "=begin %>\n\tblock comment\n\t(both lines of both the begin and end tags must be at the start of their lines)\n<%\n=end"], + ["ruby", [ + ["comment", "=begin %>\r\n\tblock comment\r\n\t(both lines of both the begin and end tags must be at the start of their lines)\r\n<%\r\n=end"] + ]], ["delimiter", "%>"] ]], ["erb", [ ["delimiter", "<%"], - ["comment", "# this is not "], + ["ruby", [ + ["comment", "# this is not "] + ]], ["delimiter", "%>"] ]], - ["erb", [ ["delimiter", "<%"], - ["operator", "="], - ["keyword", "begin"], + ["ruby", [ + ["operator", "="], + ["keyword", "begin"] + ]], ["delimiter", "%>"] ]], - - "\n\tnot a comment\n\t", - + "\r\n\tnot a comment\r\n\t", ["erb", [ ["delimiter", "<%"], - ["operator", "="], - ["keyword", "end"], + ["ruby", [ + ["operator", "="], + ["keyword", "end"] + ]], ["delimiter", "%>"] ]] ] diff --git a/tests/languages/excel-formula/comment_feature.test b/tests/languages/excel-formula/comment_feature.test new file mode 100644 index 0000000000..4a6c0de506 --- /dev/null +++ b/tests/languages/excel-formula/comment_feature.test @@ -0,0 +1,10 @@ +N("comment") + +---------------------------------------------------- + +[ + ["function-name", "N"], + ["punctuation", "("], + ["comment", "\"comment\""], + ["punctuation", ")"] +] diff --git a/tests/languages/factor/comments_feature.test b/tests/languages/factor/comments_feature.test index 5dc45765ea..8dba7827b1 100644 --- a/tests/languages/factor/comments_feature.test +++ b/tests/languages/factor/comments_feature.test @@ -1,6 +1,7 @@ a! ! word !a ! word ! comment +! TODO: something ! bad ! fine ! "also a comment" @@ -28,47 +29,47 @@ ment*/ /* "comment" */ "/* "strings" */" - ---------------------------------------------------- [ - [ "conventionally-named-word", "a!"], - [ "comment", [ "! word" ] ], - [ "normal-word", "!a"], - [ "comment", [ "! word" ] ], - [ "comment", [ "! comment" ] ], + ["conventionally-named-word", "a!"], + ["comment", ["! word"]], + ["normal-word", "!a"], + ["comment", ["! word"]], + ["comment", ["! comment"]], + ["comment", [ + "! ", + ["function", "TODO"], + ": something" + ]], + ["normal-word", "!"], + ["normal-word", "bad"], + ["comment", ["! \tfine"]], + ["comment", ["! \"also a comment\""]], + ["comment", ["! : ( -- ) ;"]], + ["comment", ["! ! leading comment-like token"]], + ["comment", ["! whitespace before"]], + ["normal-word", "words"], + ["normal-word", "blah"], + ["comment", ["! comment after code on a line"]], - [ "normal-word", "!" ], [ "normal-word", "bad" ], - [ "comment", [ "! \tfine" ] ], + ["comment", ["![[ comment ]]"]], + ["string", ["\"![[ string ]]\""]], + ["comment", ["![[ \"comment\" ]]"]], - [ "comment", [ "! \"also a comment\"" ] ], - [ "comment", [ "! : ( -- ) ;" ] ], - [ "comment", [ "! ! leading comment-like token" ] ], - [ "comment", [ "! whitespace before" ] ], - [ "normal-word", "words" ], - [ "normal-word", "blah" ], - [ "comment", [ "! comment after code on a line" ] ], + ["comment", ["![[ comment]]"]], + ["comment", ["![==[ comment ]==]"]], + ["comment", ["![==[ comment]==]"]], + ["normal-word", "![=[word"], + ["normal-word", "]=]"], + ["normal-word", "![=======["], + ["normal-word", "words"], + ["normal-word", "]=======]"], - [ "comment", [ "![[ comment ]]" ] ], - [ "string", [ "\"![[ string ]]\"" ] ], - [ "comment", [ "![[ \"comment\" ]]" ] ], - [ "comment", [ "![[ comment]]" ] ], - [ "comment", [ "![==[ comment ]==]" ] ], - [ "comment", [ "![==[ comment]==]" ] ], + ["comment", ["/* com\r\nment */"]], + ["comment", ["/* com\r\nment*/"]], + ["normal-word", "/*word"], ["normal-word", "*/"], - [ "normal-word", "![=[word" ], - [ "normal-word", "]=]" ], - [ "normal-word", "![=======[" ], - [ "normal-word", "words" ], - [ "normal-word", "]=======]" ], - [ "comment", [ "/* com\r\nment */" ] ], - [ "comment", [ "/* com\r\nment*/" ] ], - [ "normal-word", "/*word" ], - [ "normal-word", "*/" ], - [ "comment", ["/* \"comment\" */"] ], - [ "string", ["\"/* \""] ], - "strings", - [ "string", ["\" */\""] ] + ["comment", ["/* \"comment\" */"]], + ["string", ["\"/* \""]], "strings", ["string", ["\" */\""]] ] - ----------------------------------------------------- diff --git a/tests/languages/factor/numbers_feature.test b/tests/languages/factor/numbers_feature.test index 3526183d87..304f3d821c 100644 --- a/tests/languages/factor/numbers_feature.test +++ b/tests/languages/factor/numbers_feature.test @@ -8,42 +8,54 @@ NAN: 80000deadbeef ---------------------------------------------------- +0x1.0p3 +0b1.010p2 +0x1.p1 + +---------------------------------------------------- [ - [ "number", "5" ], - [ "number", "1/5" ], - [ "number", "+9" ], - [ "number", "-9" ], - [ "number", "+1/5" ], - [ "number", "-1/5" ], - [ "number", "23+1/5" ], - [ "number", "-23-1/5" ], - [ "normal-word", "23-1/5" ], - [ "comment", [ "! last one = word" ] ], - [ "number", "0.01" ], - [ "number", "0e0" ], - [ "number", "3E4" ], - [ "number", "3e-4" ], - [ "number", "3E-4" ], - [ "number", "030" ], - [ "number", "0xd" ], - [ "number", "0o30" ], - [ "number", "0b1100" ], - [ "number", "-0" ], - [ "number", "-0.01" ], - [ "number", "-0e0" ], - [ "number", "-3E4" ], - [ "number", "-3E-4" ], - [ "number", "-030" ], - [ "number", "-0xd" ], - [ "number", "-0o30" ], - [ "number", "-0b1100" ], - [ "number", "348756424956392657834385437598743583648756332457" ], - [ "number", "-348756424956392657834385437598743583648756332457" ], - [ "number", "NAN: 80000deadbeef" ] + ["number", "5"], + ["number", "1/5"], + ["number", "+9"], + ["number", "-9"], + ["number", "+1/5"], + ["number", "-1/5"], + ["number", "23+1/5"], + ["number", "-23-1/5"], + ["normal-word", "23-1/5"], + ["comment", ["! last one = word"]], + + ["number", "0.01"], + ["number", "0e0"], + ["number", "3E4"], + ["number", "3e-4"], + ["number", "3E-4"], + ["number", "030"], + ["number", "0xd"], + ["number", "0o30"], + ["number", "0b1100"], + + ["number", "-0"], + ["number", "-0.01"], + ["number", "-0e0"], + ["number", "-3E4"], + ["number", "-3E-4"], + ["number", "-030"], + ["number", "-0xd"], + ["number", "-0o30"], + ["number", "-0b1100"], + + ["number", "348756424956392657834385437598743583648756332457"], + ["number", "-348756424956392657834385437598743583648756332457"], + + ["number", "NAN: 80000deadbeef"], + + ["number", "0x1.0p3"], + ["number", "0b1.010p2"], + ["number", "0x1.p1"] ] ---------------------------------------------------- +---------------------------------------------------- numbers diff --git a/tests/languages/factor/strings_feature.test b/tests/languages/factor/strings_feature.test index 94e77b0c3f..08d7a3fc3b 100644 --- a/tests/languages/factor/strings_feature.test +++ b/tests/languages/factor/strings_feature.test @@ -19,6 +19,8 @@ "+5" "-5" +"sssssh" "(" ")" surround . + HEREDOC: marker text \n marker @@ -40,88 +42,81 @@ P" " P"" P" as\\"" ----------------------------------------------------------- +---------------------------------------------------- [ - [ "string", ["\"s\""] ], - [ "normal-word", "word\"word\"" ], - [ "comment", ["! word: word\"word\""] ], - [ "string", ["\"adjacent\""] ], - [ "string", ["\"strings\""] ], - [ "string", ["\" ! str not comment\""] ], - [ "comment", ["! comment"] ], - - [ "string", ["\"!\""] ], - [ "string", ["\" ! \""] ], - [ "string", ["\"! \""] ], - - [ "string", [ + ["string", ["\"s\""]], + ["normal-word", "word\"word\""], + ["comment", ["! word: word\"word\""]], + ["string", ["\"adjacent\""]], + ["string", ["\"strings\""]], + ["string", ["\" ! str not comment\""]], + ["comment", ["! comment"]], + ["string", ["\"!\""]], + ["string", ["\" ! \""]], + ["string", ["\"! \""]], + + ["string", [ "\"", - [ "number", "\\\"" ], + ["number", "\\\""], "\"" - ] ], - [ "string", ["\"'\""] ], - [ "string", [ + ]], + ["string", ["\"'\""]], + ["string", [ "\"", ["number", "\\n"], "\"" - ] ], - [ "string", ["\"", ["number", "\\\\"], "\""] ], - - [ "string", ["\"str\""] ], - "5\r\n", + ]], + ["string", [ + "\"", + ["number", "\\\\"], + "\"" + ]], + + ["string", ["\"str\""]], "5\r\n", + ["string", ["\"str\""]], "[ ", ["quotation-delimiter", "]"], + ["string", ["\"str\""]], "{ ", ["curly-brace-literal-delimiter", "}"], + ["curly-brace-literal-delimiter", "{"], ["string", ["\"a\""]], "}\r\n", + ["string", ["\"5\""]], + ["string", ["\"1/5\""]], + ["string", ["\"+5\""]], + ["string", ["\"-5\""]], + + ["string", ["\"sssssh\""]], + ["string", ["\"(\""]], + ["string", ["\")\""]], + ["sequences-builtin", "surround"], + ["normal-word", "."], + + ["multiline-string", [ + "HEREDOC: marker\r\ntext ", ["number", "\\n"], + "\r\nmarker" + ]], - ["string", ["\"str\""] ], - "[ ", - [ "quotation-delimiter", "]" ], + ["multiline-string", [ + "STRING: name\r\ntext ", ["number", "\\n"], + ["semicolon-or-setlocal", ";"] + ]], - [ "string", ["\"str\""] ], - "{ ", - [ "curly-brace-literal-delimiter", "}" ], + ["multiline-string", ["[[ string ]]"]], + ["multiline-string", ["[[ string]]"]], + ["multiline-string", ["[==[ string ]==]"]], + ["multiline-string", ["[==[ string]==]"]], - [ "curly-brace-literal-delimiter", "{" ], - [ "string", ["\"a\""] ], - "}\r\n", + ["normal-word", "[[word"], ["normal-word", "]]"], - [ "string", ["\"5\""] ], - [ "string", ["\"1/5\""] ], - [ "string", ["\"+5\""] ], - [ "string", ["\"-5\""] ], + ["custom-string", ["URL\" \""]], ["normal-word", "URL\"\""], + ["custom-string", ["SBUF\" \""]], ["normal-word", "SBUF\"\""], + ["custom-string", ["P\" \""]], ["normal-word", "P\"\""], - [ "multiline-string", [ - "HEREDOC: marker\r\ntext ", - [ "number", "\\n" ], - "\r\nmarker" - ] ], - - [ "multiline-string", [ - "STRING: name\r\ntext ", - [ "number", "\\n" ], - [ "semicolon-or-setlocal", ";" ] - ] ], - - [ "multiline-string", [ "[[ string ]]" ] ], - [ "multiline-string", [ "[[ string]]" ] ], - [ "multiline-string", [ "[==[ string ]==]" ] ], - [ "multiline-string", [ "[==[ string]==]" ] ], - [ "normal-word", "[[word" ], - [ "normal-word", "]]" ], - [ "custom-string", ["URL\" \""] ], - [ "normal-word", "URL\"\"" ], - - [ "custom-string", ["SBUF\" \""] ], - [ "normal-word", "SBUF\"\"" ], - - [ "custom-string", ["P\" \""] ], - [ "normal-word", "P\"\"" ], - [ "custom-string", [ + ["custom-string", [ "P\" as", - [ "number", "\\\\" ], + ["number", "\\\\"], "\"" - ] ], + ]], "\"" ] ----------------------------------------------------------- +---------------------------------------------------- string kinds diff --git a/tests/languages/false/assembler_code_feature.test b/tests/languages/false/assembler_code_feature.test new file mode 100644 index 0000000000..22eec549f4 --- /dev/null +++ b/tests/languages/false/assembler_code_feature.test @@ -0,0 +1,13 @@ +0` +65535` + +---------------------------------------------------- + +[ + ["assembler-code", "0`"], + ["assembler-code", "65535`"] +] + +---------------------------------------------------- + +Checks for assembler codes. diff --git a/tests/languages/false/character_code_feature.test b/tests/languages/false/character_code_feature.test new file mode 100644 index 0000000000..d95cbf6b79 --- /dev/null +++ b/tests/languages/false/character_code_feature.test @@ -0,0 +1,16 @@ +' +' +' +'' + +---------------------------------------------------- + +[ + ["character-code", "'\r\n"], ["character-code", "'\t"], + ["character-code", "' "], + ["character-code", "''"] +] + +---------------------------------------------------- + +Checks for character codes. diff --git a/tests/languages/false/comment_feature.test b/tests/languages/false/comment_feature.test new file mode 100644 index 0000000000..636841aea2 --- /dev/null +++ b/tests/languages/false/comment_feature.test @@ -0,0 +1,26 @@ +{ +} +{!#$%&'*+,-./:;=>?@[\]^_`|~ßø} +{""} +{foo} +{{} +{} +{}{} +{}} + +---------------------------------------------------- + +[ + ["comment", "{\r\n}"], + ["comment", "{!#$%&'*+,-./:;=>?@[\\]^_`|~ßø}"], + ["comment", "{\"\"}"], + ["comment", "{foo}"], + ["comment", "{{}"], + ["comment", "{}"], + ["comment", "{}"], ["comment", "{}"], + ["comment", "{}"], "}" +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/false/non-standard_feature.test b/tests/languages/false/non-standard_feature.test new file mode 100644 index 0000000000..6558de0240 --- /dev/null +++ b/tests/languages/false/non-standard_feature.test @@ -0,0 +1,13 @@ +( ) < B D O ® + +---------------------------------------------------- + +[ + ["non-standard", "("], + ["non-standard", ")"], + ["non-standard", "<"], + ["non-standard", "B"], + ["non-standard", "D"], + ["non-standard", "O"], + ["non-standard", "®"] +] diff --git a/tests/languages/false/operator_feature.test b/tests/languages/false/operator_feature.test new file mode 100644 index 0000000000..6b23f50e15 --- /dev/null +++ b/tests/languages/false/operator_feature.test @@ -0,0 +1,59 @@ +! +# +$ +% +& +* ++ +, +- +. +/ +: +; += +> +? +@ +\ +^ +_ +` +| +~ +ß +ø + +---------------------------------------------------- + +[ + ["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 operators. diff --git a/tests/languages/false/punctuation_feature.test b/tests/languages/false/punctuation_feature.test new file mode 100644 index 0000000000..d447862c08 --- /dev/null +++ b/tests/languages/false/punctuation_feature.test @@ -0,0 +1,13 @@ +[ +] + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["punctuation", "]"] +] + +---------------------------------------------------- + +Checks for punctuation marks. diff --git a/tests/languages/false/string_feature.test b/tests/languages/false/string_feature.test new file mode 100644 index 0000000000..b2a8a9bbf3 --- /dev/null +++ b/tests/languages/false/string_feature.test @@ -0,0 +1,22 @@ +" +" +"!#$%&'*+,-./:;=>?@[\]^_`|~ßø" +"" +"""" +"foo" +"{}" + +---------------------------------------------------- + +[ + ["string", "\"\r\n\""], + ["string", "\"!#$%&'*+,-./:;=>?@[\\]^_`|~ßø\""], + ["string", "\"\""], + ["string", "\"\""], ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"{}\""] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/false/variable_feature.test b/tests/languages/false/variable_feature.test new file mode 100644 index 0000000000..01f09bbf2a --- /dev/null +++ b/tests/languages/false/variable_feature.test @@ -0,0 +1,63 @@ +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +zzz + +---------------------------------------------------- + +[ + ["variable", "a"], + ["variable", "b"], + ["variable", "c"], + ["variable", "d"], + ["variable", "e"], + ["variable", "f"], + ["variable", "g"], + ["variable", "h"], + ["variable", "i"], + ["variable", "j"], + ["variable", "k"], + ["variable", "l"], + ["variable", "m"], + ["variable", "n"], + ["variable", "o"], + ["variable", "p"], + ["variable", "q"], + ["variable", "r"], + ["variable", "s"], + ["variable", "t"], + ["variable", "u"], + ["variable", "v"], + ["variable", "w"], + ["variable", "x"], + ["variable", "y"], + ["variable", "z"], + ["variable", "z"], ["variable", "z"], ["variable", "z"] +] + +---------------------------------------------------- + +Checks for variables. diff --git a/tests/languages/firestore-security-rules/path_feature.test b/tests/languages/firestore-security-rules/path_feature.test index 1ff01e6dc6..be4ec96aaf 100644 --- a/tests/languages/firestore-security-rules/path_feature.test +++ b/tests/languages/firestore-security-rules/path_feature.test @@ -5,6 +5,7 @@ /foo/{x}/{y}/{z}/bar /foo/$(x)/$(y)/bar/$(request.auth.uid) +/cities/{document=**} ---------------------------------------------------- @@ -15,6 +16,7 @@ ["punctuation", "/"], "foo" ]], + ["path", [ ["punctuation", "/"], "foo", @@ -61,6 +63,7 @@ ["punctuation", "/"], "bar" ]], + ["path", [ ["punctuation", "/"], "foo", @@ -91,6 +94,18 @@ "uid", ["punctuation", ")"] ]] + ]], + ["path", [ + ["punctuation", "/"], + "cities", + ["punctuation", "/"], + ["variable", [ + ["punctuation", "{"], + "document", + ["operator", "="], + ["keyword", "**"], + ["punctuation", "}"] + ]] ]] ] diff --git a/tests/languages/fortran/punctuation_feature.test b/tests/languages/fortran/punctuation_feature.test new file mode 100644 index 0000000000..62b123306d --- /dev/null +++ b/tests/languages/fortran/punctuation_feature.test @@ -0,0 +1,15 @@ +(/ /) +( ) , ; : & + +---------------------------------------------------- + +[ + ["punctuation", "(/"], + ["punctuation", "/)"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "&"] +] diff --git a/tests/languages/fsharp/char_feature.test b/tests/languages/fsharp/char_feature.test new file mode 100644 index 0000000000..2648a9f8ed --- /dev/null +++ b/tests/languages/fsharp/char_feature.test @@ -0,0 +1,21 @@ +'a' +'a'B +'\'' +'\\' +'\231' +'\x41' +'\u0041' +'\U0001F47D' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'a'B"], + ["char", "'\\''"], + ["char", "'\\\\'"], + ["char", "'\\231'"], + ["char", "'\\x41'"], + ["char", "'\\u0041'"], + ["char", "'\\U0001F47D'"] +] diff --git a/tests/languages/fsharp/class-name_feature.test b/tests/languages/fsharp/class-name_feature.test index 7939964246..3384ba7946 100644 --- a/tests/languages/fsharp/class-name_feature.test +++ b/tests/languages/fsharp/class-name_feature.test @@ -34,51 +34,172 @@ exception Error2 of string * int ---------------------------------------------------- [ - ["keyword", "let"], " func ", - ["punctuation", ":"], ["class-name", ["HttpFunc"]], - ["operator", "="], " handler ", ["punctuation", "("], - "Some ", ["operator", ">>"], " Task", ["punctuation", "."], "FromResult", + ["keyword", "let"], + " func ", + ["punctuation", ":"], + ["class-name", ["HttpFunc"]], + ["operator", "="], + " handler ", + ["punctuation", "("], + "Some ", + ["operator", ">>"], + " Task", + ["punctuation", "."], + "FromResult", ["punctuation", ")"], - ["keyword", "type"], ["class-name", ["Base1"]], ["punctuation", "("], ["punctuation", ")"], ["operator", "="], - ["keyword", "abstract"], ["keyword", "member"], " F ", ["punctuation", ":"], - ["class-name", [ - "unit ", ["operator", "->"], " unit"] - ], - ["keyword", "default"], " u", ["punctuation", "."], ["function", "F"], ["punctuation", "("], ["punctuation", ")"], - ["operator", "="], "\n printfn ", ["string", "\"F Base1\""], - - ["keyword", "type"], ["class-name", ["Derived1"]], ["punctuation", "("], ["punctuation", ")"], ["operator", "="], - ["keyword", "inherit"], ["class-name", ["Base1"]], ["punctuation", "("], ["punctuation", ")"], - ["keyword", "override"], " u", ["punctuation", "."], ["function", "F"], ["punctuation", "("], ["punctuation", ")"], ["operator", "="], - "\n printfn ", ["string", "\"F Derived1\""], - - ["keyword", "let"], " d1 ", ["punctuation", ":"], ["class-name", ["Derived1"]], ["operator", "="], - ["function", "Derived1"], ["punctuation", "("], ["punctuation", ")"], - - ["keyword", "let"], " base1 ", ["operator", "="], " d1 ", ["operator", ":>"], ["class-name", ["Base1"]], + ["keyword", "type"], + ["class-name", ["Base1"]], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "="], - ["keyword", "let"], " derived1 ", ["operator", "="], " base1 ", ["operator", ":?>"], ["class-name", ["Derived1"]], + ["keyword", "abstract"], + ["keyword", "member"], + " F ", + ["punctuation", ":"], + ["class-name", [ + "unit ", + ["operator", "->"], + " unit" + ]], + + ["keyword", "default"], + " u", + ["punctuation", "."], + ["function", "F"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "="], - ["keyword", "type"], ["class-name", ["PersonName"]], ["operator", "="], - ["operator", "|"], " FirstOnly ", ["keyword", "of"], ["class-name", ["string"]], - ["operator", "|"], " LastOnly ", ["keyword", "of"], ["class-name", ["string"]], - ["operator", "|"], " FirstLast ", ["keyword", "of"], ["class-name", ["string ", ["operator", "*"], " string"]], + "\r\n printfn ", + ["string", "\"F Base1\""], - ["keyword", "type"], ["class-name", ["Shape"]], ["operator", "="], - ["operator", "|"], " Rectangle ", ["keyword", "of"], - " height ", ["punctuation", ":"], ["class-name", ["float"]], ["operator", "*"], - " width ", ["punctuation", ":"], ["class-name", ["float"]], - ["operator", "|"], " Circle ", ["keyword", "of"], " radius ", ["punctuation", ":"], ["class-name", ["float"]], + ["keyword", "type"], + ["class-name", ["Derived1"]], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "="], - ["keyword", "type"], ["class-name", ["MyInterface"]], ["operator", "="], - ["keyword", "abstract"], ["keyword", "member"], " Add", ["punctuation", ":"], - ["class-name", ["int ", ["operator", "->"], " int ", ["operator", "->"], " int"]], - ["keyword", "abstract"], ["keyword", "member"], " Pi ", ["punctuation", ":"], ["class-name", ["float"]], + ["keyword", "inherit"], + ["class-name", ["Base1"]], + ["punctuation", "("], + ["punctuation", ")"], - ["keyword", "exception"], ["class-name", ["Error1"]], ["keyword", "of"], ["class-name", ["string"]], + ["keyword", "override"], + " u", + ["punctuation", "."], + ["function", "F"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "="], + + "\r\n printfn ", + ["string", "\"F Derived1\""], + + ["keyword", "let"], + " d1 ", + ["punctuation", ":"], + ["class-name", ["Derived1"]], + ["operator", "="], + ["function", "Derived1"], + ["punctuation", "("], + ["punctuation", ")"], - ["keyword", "exception"], ["class-name", ["Error2"]], ["keyword", "of"], ["class-name", ["string ", ["operator", "*"], " int"]] + ["keyword", "let"], + " base1 ", + ["operator", "="], + " d1 ", + ["operator", ":>"], + ["class-name", ["Base1"]], + + ["keyword", "let"], + " derived1 ", + ["operator", "="], + " base1 ", + ["operator", ":?>"], + ["class-name", ["Derived1"]], + + ["keyword", "type"], + ["class-name", ["PersonName"]], + ["operator", "="], + + ["operator", "|"], + " FirstOnly ", + ["keyword", "of"], + ["class-name", ["string"]], + + ["operator", "|"], + " LastOnly ", + ["keyword", "of"], + ["class-name", ["string"]], + + ["operator", "|"], + " FirstLast ", + ["keyword", "of"], + ["class-name", [ + "string ", + ["operator", "*"], + " string" + ]], + + ["keyword", "type"], + ["class-name", ["Shape"]], + ["operator", "="], + + ["operator", "|"], + " Rectangle ", + ["keyword", "of"], + " height ", + ["punctuation", ":"], + ["class-name", ["float"]], + ["operator", "*"], + " width ", + ["punctuation", ":"], + ["class-name", ["float"]], + + ["operator", "|"], + " Circle ", + ["keyword", "of"], + " radius ", + ["punctuation", ":"], + ["class-name", ["float"]], + + ["keyword", "type"], + ["class-name", ["MyInterface"]], + ["operator", "="], + + ["keyword", "abstract"], + ["keyword", "member"], + " Add", + ["punctuation", ":"], + ["class-name", [ + "int ", + ["operator", "->"], + " int ", + ["operator", "->"], + " int" + ]], + + ["keyword", "abstract"], + ["keyword", "member"], + " Pi ", + ["punctuation", ":"], + ["class-name", ["float"]], + + ["keyword", "exception"], + ["class-name", ["Error1"]], + ["keyword", "of"], + ["class-name", ["string"]], + + ["keyword", "exception"], + ["class-name", ["Error2"]], + ["keyword", "of"], + ["class-name", [ + "string ", + ["operator", "*"], + " int" + ]] ] ---------------------------------------------------- diff --git a/tests/languages/fsharp/comment_feature.test b/tests/languages/fsharp/comment_feature.test index ff9170b6b8..44849441ab 100644 --- a/tests/languages/fsharp/comment_feature.test +++ b/tests/languages/fsharp/comment_feature.test @@ -3,14 +3,26 @@ (* foo bar *) +// the next one is not a comment +(*) (*) + ---------------------------------------------------- [ ["comment", "// foobar"], ["comment", "(**)"], - ["comment", "(* foo\r\nbar *)"] + ["comment", "(* foo\r\nbar *)"], + + ["comment", "// the next one is not a comment"], + + ["punctuation", "("], + ["operator", "*"], + ["punctuation", ")"], + ["punctuation", "("], + ["operator", "*"], + ["punctuation", ")"] ] ---------------------------------------------------- -Checks for single-line and multi-line comments. \ No newline at end of file +Checks for single-line and multi-line comments. diff --git a/tests/languages/fsharp/issue2696.test b/tests/languages/fsharp/issue2696.test new file mode 100644 index 0000000000..1e7d26f84b --- /dev/null +++ b/tests/languages/fsharp/issue2696.test @@ -0,0 +1,285 @@ +let score category (dice:Die list) = + let iDice = dice |> List.map int |> List.sortDescending + let diced = iDice |> List.countBy id |> List.sortByDescending snd + let countScore cat = dice |> List.filter (fun d -> d=cat) |> List.length |> (*) (int cat) + let isStraight = iDice.[0] - iDice.[4] = 4 + + match category , List.map snd diced with + | Yacht , [5] -> 50 + | Ones , _ -> countScore Die.One + | Twos , _ -> countScore Die.Two + | Threes , _ -> countScore Die.Three + | Fours , _ -> countScore Die.Four + | Fives , _ -> countScore Die.Five + | Sixes , _ -> countScore Die.Six + | FourOfAKind , [4;1] + | FourOfAKind , [5] -> iDice |> List.head |> (*) 4 + | LittleStraight, [1;1;1;1;1] when isStraight && iDice.[0] = 5 -> 30 + | BigStraight , [1;1;1;1;1] when isStraight && iDice.[0] = 6 -> 30 + | FullHouse , [3;2] + | Choice , _ -> iDice |> List.sum + | _ , _ -> 0 + +---------------------------------------------------- + +[ + ["keyword", "let"], + " score category ", + ["punctuation", "("], + "dice", + ["punctuation", ":"], + ["class-name", ["Die"]], + " list", + ["punctuation", ")"], + ["operator", "="], + + ["keyword", "let"], + " iDice ", + ["operator", "="], + " dice ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "map int ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "sortDescending\r\n ", + + ["keyword", "let"], + " diced ", + ["operator", "="], + " iDice ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "countBy id ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "sortByDescending snd\r\n ", + + ["keyword", "let"], + " countScore cat ", + ["operator", "="], + " dice ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "filter ", + ["punctuation", "("], + ["keyword", "fun"], + " d ", + ["operator", "->"], + " d", + ["operator", "="], + "cat", + ["punctuation", ")"], + ["operator", "|>"], + " List", + ["punctuation", "."], + "length ", + ["operator", "|>"], + ["punctuation", "("], + ["operator", "*"], + ["punctuation", ")"], + ["punctuation", "("], + "int cat", + ["punctuation", ")"], + + ["keyword", "let"], + " isStraight ", + ["operator", "="], + " iDice", + ["punctuation", "."], + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"], + ["operator", "-"], + " iDice", + ["punctuation", "."], + ["punctuation", "["], + ["number", "4"], + ["punctuation", "]"], + ["operator", "="], + ["number", "4"], + + ["keyword", "match"], + " category ", + ["punctuation", ","], + " List", + ["punctuation", "."], + "map snd diced ", + ["keyword", "with"], + + ["operator", "|"], + " Yacht ", + ["punctuation", ","], + ["punctuation", "["], + ["number", "5"], + ["punctuation", "]"], + ["operator", "->"], + ["number", "50"], + + ["operator", "|"], + " Ones ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " countScore Die", + ["punctuation", "."], + "One\r\n ", + + ["operator", "|"], + " Twos ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " countScore Die", + ["punctuation", "."], + "Two\r\n ", + + ["operator", "|"], + " Threes ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " countScore Die", + ["punctuation", "."], + "Three\r\n ", + + ["operator", "|"], + " Fours ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " countScore Die", + ["punctuation", "."], + "Four\r\n ", + + ["operator", "|"], + " Fives ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " countScore Die", + ["punctuation", "."], + "Five\r\n ", + + ["operator", "|"], + " Sixes ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " countScore Die", + ["punctuation", "."], + "Six\r\n ", + + ["operator", "|"], + " FourOfAKind ", + ["punctuation", ","], + ["punctuation", "["], + ["number", "4"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", "]"], + + ["operator", "|"], + " FourOfAKind ", + ["punctuation", ","], + ["punctuation", "["], + ["number", "5"], + ["punctuation", "]"], + ["operator", "->"], + " iDice ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "head ", + ["operator", "|>"], + ["punctuation", "("], + ["operator", "*"], + ["punctuation", ")"], + ["number", "4"], + + ["operator", "|"], + " LittleStraight", + ["punctuation", ","], + ["punctuation", "["], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", "]"], + ["keyword", "when"], + " isStraight ", + ["operator", "&&"], + " iDice", + ["punctuation", "."], + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"], + ["operator", "="], + ["number", "5"], + ["operator", "->"], + ["number", "30"], + + ["operator", "|"], + " BigStraight ", + ["punctuation", ","], + ["punctuation", "["], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", ";"], + ["number", "1"], + ["punctuation", "]"], + ["keyword", "when"], + " isStraight ", + ["operator", "&&"], + " iDice", + ["punctuation", "."], + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"], + ["operator", "="], + ["number", "6"], + ["operator", "->"], + ["number", "30"], + + ["operator", "|"], + " FullHouse ", + ["punctuation", ","], + ["punctuation", "["], + ["number", "3"], + ["punctuation", ";"], + ["number", "2"], + ["punctuation", "]"], + + ["operator", "|"], + " Choice ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + " iDice ", + ["operator", "|>"], + " List", + ["punctuation", "."], + "sum\r\n ", + + ["operator", "|"], + " _ ", + ["punctuation", ","], + " _ ", + ["operator", "->"], + ["number", "0"] +] \ No newline at end of file diff --git a/tests/languages/fsharp/string_feature.test b/tests/languages/fsharp/string_feature.test index c6310d851b..a281856aaf 100644 --- a/tests/languages/fsharp/string_feature.test +++ b/tests/languages/fsharp/string_feature.test @@ -14,15 +14,6 @@ bar" bar""" """foo"""B -'a' -'a'B -'\'' -'\\' -'\231' -'\x41' -'\u0041' -'\U0001F47D' - ---------------------------------------------------- [ @@ -38,18 +29,9 @@ bar""" ["string", "\"\"\"\"\"\""], ["string", "\"\"\"fo\"\"o\"\r\nbar\"\"\""], - ["string", "\"\"\"foo\"\"\"B"], - - ["string", "'a'"], - ["string", "'a'B"], - ["string", "'\\''"], - ["string", "'\\\\'"], - ["string", "'\\231'"], - ["string", "'\\x41'"], - ["string", "'\\u0041'"], - ["string", "'\\U0001F47D'"] + ["string", "\"\"\"foo\"\"\"B"] ] ---------------------------------------------------- -Checks for normal strings, verbatim strings, triple-quoted strings and character literals. +Checks for normal strings, verbatim strings, and triple-quoted strings. diff --git a/tests/languages/ftl/directive_feature.test b/tests/languages/ftl/directive_feature.test index 783c3027b2..42a0c5f0d0 100644 --- a/tests/languages/ftl/directive_feature.test +++ b/tests/languages/ftl/directive_feature.test @@ -1,3 +1,5 @@ +<#import "/libs/commons.ftl" as com> + <#if a < b> a is less than b <#elseif (a > b)> @@ -12,6 +14,19 @@ ---------------------------------------------------- [ + ["ftl", [ + ["ftl-directive", [ + ["punctuation", "<"], + ["directive", "#import"], + ["content", [ + ["string", ["\"/libs/commons.ftl\""]], + ["keyword", "as"], + " com" + ]], + ["punctuation", ">"] + ]] + ]], + ["ftl", [ ["ftl-directive", [ ["punctuation", "<"], @@ -70,6 +85,7 @@ ["punctuation", ">"] ]] ]], + ["ftl", [ ["ftl-directive", [ ["punctuation", "<"], diff --git a/tests/languages/gap/boolean_feature.test b/tests/languages/gap/boolean_feature.test new file mode 100644 index 0000000000..dfd85e24f0 --- /dev/null +++ b/tests/languages/gap/boolean_feature.test @@ -0,0 +1,9 @@ +false +true + +---------------------------------------------------- + +[ + ["boolean", "false"], + ["boolean", "true"] +] diff --git a/tests/languages/gap/comment_feature.test b/tests/languages/gap/comment_feature.test new file mode 100644 index 0000000000..7883a734b3 --- /dev/null +++ b/tests/languages/gap/comment_feature.test @@ -0,0 +1,7 @@ +# comment + +---------------------------------------------------- + +[ + ["comment", "# comment"] +] diff --git a/tests/languages/gap/keyword_feature.test b/tests/languages/gap/keyword_feature.test new file mode 100644 index 0000000000..613244f401 --- /dev/null +++ b/tests/languages/gap/keyword_feature.test @@ -0,0 +1,71 @@ +Assert; +Info; +IsBound; +QUIT; +TryNextMethod; +Unbind; +and; +atomic; +break; +continue; +do; +elif; +else; +end; +fi; +for; +function; +if; +in; +local; +mod; +not; +od; +or; +quit; +readonly; +readwrite; +rec; +repeat; +return; +then; +until; +while; + +---------------------------------------------------- + +[ + ["keyword", "Assert"], ["punctuation", ";"], + ["keyword", "Info"], ["punctuation", ";"], + ["keyword", "IsBound"], ["punctuation", ";"], + ["keyword", "QUIT"], ["punctuation", ";"], + ["keyword", "TryNextMethod"], ["punctuation", ";"], + ["keyword", "Unbind"], ["punctuation", ";"], + ["keyword", "and"], ["punctuation", ";"], + ["keyword", "atomic"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "elif"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "end"], ["punctuation", ";"], + ["keyword", "fi"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "function"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "local"], ["punctuation", ";"], + ["keyword", "mod"], ["punctuation", ";"], + ["keyword", "not"], ["punctuation", ";"], + ["keyword", "od"], ["punctuation", ";"], + ["keyword", "or"], ["punctuation", ";"], + ["keyword", "quit"], ["punctuation", ";"], + ["keyword", "readonly"], ["punctuation", ";"], + ["keyword", "readwrite"], ["punctuation", ";"], + ["keyword", "rec"], ["punctuation", ";"], + ["keyword", "repeat"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "then"], ["punctuation", ";"], + ["keyword", "until"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"] +] diff --git a/tests/languages/gap/number_feature.test b/tests/languages/gap/number_feature.test new file mode 100644 index 0000000000..56b232e3fd --- /dev/null +++ b/tests/languages/gap/number_feature.test @@ -0,0 +1,43 @@ +0 +123134523423423412345132123123432744839127384723987497 ++123123 +-245435 + +66/123 +66/-123 + +3.14 +6.62606896e-34 +.1 +.1e1 +-.999 +1._ +1._l + +[1..100] + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123134523423423412345132123123432744839127384723987497"], + ["operator", "+"], ["number", "123123"], + ["operator", "-"], ["number", "245435"], + + ["number", "66"], ["operator", "/"], ["number", "123"], + ["number", "66"], ["operator", "/"], ["operator", "-"], ["number", "123"], + + ["number", "3.14"], + ["number", "6.62606896e-34"], + ["number", ".1"], + ["number", ".1e1"], + ["operator", "-"], ["number", ".999"], + ["number", "1._"], + ["number", "1._l"], + + ["punctuation", "["], + ["number", "1"], + ["operator", ".."], + ["number", "100"], + ["punctuation", "]"] +] diff --git a/tests/languages/gap/operator_feature.test b/tests/languages/gap/operator_feature.test new file mode 100644 index 0000000000..3c0625cbbe --- /dev/null +++ b/tests/languages/gap/operator_feature.test @@ -0,0 +1,34 @@ ++ - * / ^ ~ += <> < > <= >= +:= .. -> + +!. ![ !{ + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "-"], + ["operator", "*"], + ["operator", "/"], + ["operator", "^"], + ["operator", "~"], + + ["operator", "="], + ["operator", "<>"], + ["operator", "<"], + ["operator", ">"], + ["operator", "<="], + ["operator", ">="], + + ["operator", ":="], + ["operator", ".."], + ["operator", "->"], + + ["operator", "!"], + ["punctuation", "."], + ["operator", "!"], + ["punctuation", "["], + ["operator", "!"], + ["punctuation", "{"] +] diff --git a/tests/languages/gap/punctuation_feature.test b/tests/languages/gap/punctuation_feature.test new file mode 100644 index 0000000000..1713f5143c --- /dev/null +++ b/tests/languages/gap/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) [ ] { } +, ; . : + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + ["punctuation", ":"] +] diff --git a/tests/languages/gap/shell_feature.test b/tests/languages/gap/shell_feature.test new file mode 100644 index 0000000000..fbab6e61b9 --- /dev/null +++ b/tests/languages/gap/shell_feature.test @@ -0,0 +1,216 @@ +gap> i := 0;; s := 0;; +gap> while s <= 200 do +> i := i + 1; s := s + i^2; +> od; +gap> s; +204 +gap> l := [ 1, 2, 3, 4, 5, 6 ];; +gap> for i in l do +> Print( i, " " ); +> l := []; +> od; Print( "\n" ); +1 2 3 4 5 6 +gap> g := Group((1,2,3),(1,2)); +Group([ (1,2,3), (1,2) ]) +gap> for x in g do +> if Order(x) = 3 then +> continue; +> fi; Print(x,"\n"); od; +() +(2,3) +(1,3) +(1,2) +gap> continue; +Syntax error: 'continue' statement not enclosed in a loop + +---------------------------------------------------- + +[ + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + " i ", + ["operator", ":="], + ["number", "0"], + ["punctuation", ";"], + ["punctuation", ";"], + " s ", + ["operator", ":="], + ["number", "0"], + ["punctuation", ";"], + ["punctuation", ";"] + ]] + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + ["keyword", "while"], + " s ", + ["operator", "<="], + ["number", "200"], + ["keyword", "do"], + + ["continuation", ">"], + " i ", + ["operator", ":="], + " i ", + ["operator", "+"], + ["number", "1"], + ["punctuation", ";"], + " s ", + ["operator", ":="], + " s ", + ["operator", "+"], + " i", + ["operator", "^"], + ["number", "2"], + ["punctuation", ";"], + + ["continuation", ">"], + ["keyword", "od"], + ["punctuation", ";"] + ]] + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + " s", + ["punctuation", ";"] + ]], + + "\r\n204\r\n" + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + " l ", + ["operator", ":="], + ["punctuation", "["], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", ","], + ["number", "4"], + ["punctuation", ","], + ["number", "5"], + ["punctuation", ","], + ["number", "6"], + ["punctuation", "]"], + ["punctuation", ";"], + ["punctuation", ";"] + ]] + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + ["keyword", "for"], + " i ", + ["keyword", "in"], + " l ", + ["keyword", "do"], + + ["continuation", ">"], + ["function", "Print"], + ["punctuation", "("], + " i", + ["punctuation", ","], + ["string", ["\" \""]], + ["punctuation", ")"], + ["punctuation", ";"], + + ["continuation", ">"], + " l ", + ["operator", ":="], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"], + + ["continuation", ">"], + ["keyword", "od"], + ["punctuation", ";"], + ["function", "Print"], + ["punctuation", "("], + ["string", ["\"\\n\""]], + ["punctuation", ")"], + ["punctuation", ";"] + ]], + + "\r\n1 2 3 4 5 6\r\n" + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + " g ", + ["operator", ":="], + ["function", "Group"], + ["punctuation", "("], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ";"] + ]], + + "\r\nGroup([ (1,2,3), (1,2) ])\r\n" + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + ["keyword", "for"], + " x ", + ["keyword", "in"], + " g ", + ["keyword", "do"], + + ["continuation", ">"], + ["keyword", "if"], + ["function", "Order"], + ["punctuation", "("], + "x", + ["punctuation", ")"], + ["operator", "="], + ["number", "3"], + ["keyword", "then"], + + ["continuation", ">"], + ["keyword", "continue"], + ["punctuation", ";"], + + ["continuation", ">"], + ["keyword", "fi"], + ["punctuation", ";"], + ["function", "Print"], + ["punctuation", "("], + "x", + ["punctuation", ","], + ["string", ["\"\\n\""]], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "od"], + ["punctuation", ";"] + ]], + + "\r\n()\r\n(2,3)\r\n(1,3)\r\n(1,2)\r\n" + ]], + ["shell", [ + ["punctuation", "gap>"], + ["gap", [ + ["keyword", "continue"], + ["punctuation", ";"] + ]], + + "\r\nSyntax error: 'continue' statement not enclosed in a loop" + ]] +] diff --git a/tests/languages/gap/string_feature.test b/tests/languages/gap/string_feature.test new file mode 100644 index 0000000000..880b38fa78 --- /dev/null +++ b/tests/languages/gap/string_feature.test @@ -0,0 +1,27 @@ +'f' +'\n' + +"" +"foo" +"\"" + +"""""" +""" foo """ +""" +foo +""" + +---------------------------------------------------- + +[ + ["string", ["'f'"]], + ["string", ["'\\n'"]], + + ["string", ["\"\""]], + ["string", ["\"foo\""]], + ["string", ["\"\\\"\""]], + + ["string", ["\"\"\"\"\"\""]], + ["string", ["\"\"\" foo \"\"\""]], + ["string", ["\"\"\"\r\nfoo\r\n\"\"\""]] +] diff --git a/tests/languages/gcode/checksum_feature.test b/tests/languages/gcode/checksum_feature.test index d3ea45613a..166ae2bd09 100644 --- a/tests/languages/gcode/checksum_feature.test +++ b/tests/languages/gcode/checksum_feature.test @@ -4,7 +4,8 @@ G28*22 [ ["keyword", "G28"], - ["checksum", "*22"] + ["punctuation", "*"], + ["checksum", "22"] ] ---------------------------------------------------- diff --git a/tests/languages/gcode/property_feature.test b/tests/languages/gcode/property_feature.test index 9dee88682d..44348011fb 100644 --- a/tests/languages/gcode/property_feature.test +++ b/tests/languages/gcode/property_feature.test @@ -6,9 +6,9 @@ E420:420 ---------------------------------------------------- [ - ["property", "X"], "123\n", - ["property", "Y"], "0.2\n", - ["property", "Z"], "-3.1415\n", + ["property", "X"], "123\r\n", + ["property", "Y"], "0.2\r\n", + ["property", "Z"], "-3.1415\r\n", ["property", "E"], "420", ["punctuation", ":"], "420" ] diff --git a/tests/languages/gdscript/class-name_feature.test b/tests/languages/gdscript/class-name_feature.test index 02001c2641..d69aca064c 100644 --- a/tests/languages/gdscript/class-name_feature.test +++ b/tests/languages/gdscript/class-name_feature.test @@ -16,21 +16,18 @@ func add(reference: Item, amount: int) -> Item: ---------------------------------------------------- [ - ["keyword", "class_name"], - ["class-name", "Foo"], - ["keyword", "extends"], - ["class-name", "Bar"], + ["keyword", "class_name"], ["class-name", "Foo"], + ["keyword", "extends"], ["class-name", "Bar"], - ["keyword", "class"], - ["class-name", "InnerClass"], - ["punctuation", ":"], + ["keyword", "class"], ["class-name", "InnerClass"], ["punctuation", ":"], ["keyword", "export"], ["punctuation", "("], ["class-name", "int"], ["punctuation", ")"], ["keyword", "var"], - " baz\n", + " baz\r\n", + ["keyword", "export"], ["punctuation", "("], ["class-name", "int"], @@ -38,12 +35,9 @@ func add(reference: Item, amount: int) -> Item: ["number", "0"], ["punctuation", ")"], ["keyword", "var"], - " i\n\n", + " i\r\n\r\n", - ["keyword", "return"], - " foo ", - ["keyword", "as"], - ["class-name", "Node"], + ["keyword", "return"], " foo ", ["keyword", "as"], ["class-name", "Node"], ["keyword", "const"], ["constant", "FOO"], @@ -51,6 +45,7 @@ func add(reference: Item, amount: int) -> Item: ["class-name", "int"], ["operator", "="], ["number", "9"], + ["keyword", "var"], " bar", ["punctuation", ":"], diff --git a/tests/languages/gdscript/number_feature.test b/tests/languages/gdscript/number_feature.test index 00ad250b01..32f37f2275 100644 --- a/tests/languages/gdscript/number_feature.test +++ b/tests/languages/gdscript/number_feature.test @@ -11,12 +11,13 @@ 0xBAD_FACE 0b_0010_0010_0100_0100 +INF NAN PI TAU + ---------------------------------------------------- [ ["number", "123"], - ["operator", "-"], - ["number", "123"], + ["operator", "-"], ["number", "123"], ["number", "123.456"], ["number", ".5"], ["number", "1.2e-34"], @@ -26,7 +27,9 @@ ["number", "1_000_000_000_000"], ["number", "0xBAD_FACE"], - ["number", "0b_0010_0010_0100_0100"] + ["number", "0b_0010_0010_0100_0100"], + + ["number", "INF"], ["number", "NAN"], ["number", "PI"], ["number", "TAU"] ] ---------------------------------------------------- diff --git a/tests/languages/gdscript/string_feature.test b/tests/languages/gdscript/string_feature.test index ac938df0d3..8182c988a4 100644 --- a/tests/languages/gdscript/string_feature.test +++ b/tests/languages/gdscript/string_feature.test @@ -18,7 +18,9 @@ ["string", "'bar'"], ["string", "\"\\\"'foo'\\\"\""], ["string", "'\"\\'bar\\'\"'"], - ["string", "\"\"\"\n\"baz\"\n\"\"\""], + + ["string", "\"\"\"\r\n\"baz\"\r\n\"\"\""], + ["string", "@\"foo\""], ["string", "@'bar'"], ["string", "@\"\"\"baz\"\"\""] diff --git a/tests/languages/git/commit_sha1_feature.test b/tests/languages/git/commit-sha1_feature.test similarity index 54% rename from tests/languages/git/commit_sha1_feature.test rename to tests/languages/git/commit-sha1_feature.test index fbc58ed2bd..62f3e02f54 100644 --- a/tests/languages/git/commit_sha1_feature.test +++ b/tests/languages/git/commit-sha1_feature.test @@ -5,11 +5,11 @@ commit 3102416a90c431400d2e2a14e707fb7fd6d9e06d ---------------------------------------------------- [ - ["commit_sha1", "commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09"], - ["commit_sha1", "commit 87edc4ad8c71b95f6e46f736eb98b742859abd95"], - ["commit_sha1", "commit 3102416a90c431400d2e2a14e707fb7fd6d9e06d"] + ["commit-sha1", "commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09"], + ["commit-sha1", "commit 87edc4ad8c71b95f6e46f736eb98b742859abd95"], + ["commit-sha1", "commit 3102416a90c431400d2e2a14e707fb7fd6d9e06d"] ] ---------------------------------------------------- -Checks for commit SHA1. \ No newline at end of file +Checks for commit SHA1. diff --git a/tests/languages/gml/function_feature.test b/tests/languages/gml/function_feature.test new file mode 100644 index 0000000000..6351c8533a --- /dev/null +++ b/tests/languages/gml/function_feature.test @@ -0,0 +1,55 @@ +buff = buffer_create(16384, buffer_grow, 2); +ini_open("Save.ini"); +var str = ini_read_string("Save", "Slot1", ""); +buffer_base64_decode_ext(buff, str, 0); +ini_close(); + +---------------------------------------------------- + +[ + "buff ", + ["operator", "="], + ["function", "buffer_create"], + ["punctuation", "("], + ["number", "16384"], + ["punctuation", ","], + ["constant", "buffer_grow"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "ini_open"], + ["punctuation", "("], + ["string", "\"Save.ini\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "var"], + " str ", + ["operator", "="], + ["function", "ini_read_string"], + ["punctuation", "("], + ["string", "\"Save\""], + ["punctuation", ","], + ["string", "\"Slot1\""], + ["punctuation", ","], + ["string", "\"\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "buffer_base64_decode_ext"], + ["punctuation", "("], + "buff", + ["punctuation", ","], + " str", + ["punctuation", ","], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "ini_close"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] +] diff --git a/tests/languages/gml/keyword_feature.test b/tests/languages/gml/keyword_feature.test new file mode 100644 index 0000000000..2b4a7a8b60 --- /dev/null +++ b/tests/languages/gml/keyword_feature.test @@ -0,0 +1,39 @@ +if +else +switch +case +default +break +for +repeat +while +do +until +continue +exit +return +globalvar +var +enum + +---------------------------------------------------- + +[ + ["keyword", "if"], + ["keyword", "else"], + ["keyword", "switch"], + ["keyword", "case"], + ["keyword", "default"], + ["keyword", "break"], + ["keyword", "for"], + ["keyword", "repeat"], + ["keyword", "while"], + ["keyword", "do"], + ["keyword", "until"], + ["keyword", "continue"], + ["keyword", "exit"], + ["keyword", "return"], + ["keyword", "globalvar"], + ["keyword", "var"], + ["keyword", "enum"] +] diff --git a/tests/languages/gml/number_feature.test b/tests/languages/gml/number_feature.test new file mode 100644 index 0000000000..06358c5df5 --- /dev/null +++ b/tests/languages/gml/number_feature.test @@ -0,0 +1,25 @@ +0 +123 +123.456 +123. +.456 +1e5 +1.2e-5f + +0xFF +0xFFul + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"], + ["number", "123.456"], + ["number", "123."], + ["number", ".456"], + ["number", "1e5"], + ["number", "1.2e-5f"], + + ["number", "0xFF"], + ["number", "0xFFul"] +] diff --git a/tests/languages/gml/operator_feature.test b/tests/languages/gml/operator_feature.test new file mode 100644 index 0000000000..fb19b87241 --- /dev/null +++ b/tests/languages/gml/operator_feature.test @@ -0,0 +1,62 @@ ++ - % * ** / ++= -= %= *= **= /= +>> << ++ -- + += +== != <> +< <= => > + +& | ^ ~ +&& || ^^ + +or +and +not +with +at +xor + +---------------------------------------------------- + +[ + ["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", "or"], + ["operator", "and"], + ["operator", "not"], + ["operator", "with"], + ["operator", "at"], + ["operator", "xor"] +] diff --git a/tests/languages/gml/variable_feature.test b/tests/languages/gml/variable_feature.test new file mode 100644 index 0000000000..dd593062d9 --- /dev/null +++ b/tests/languages/gml/variable_feature.test @@ -0,0 +1,126 @@ +if browser_height > window_get_height() || browser_width > window_get_width() + { + var xx, yy; + if browser_width > window_get_width() + { + xx = (browser_width - window_get_width()) / 2; + } + else + { + xx = 0; + } + if browser_height > window_get_height() + { + yy = (browser_height - window_get_height()) / 2; + } + else + { + yy = 0; + } + window_set_position(xx, yy); + } + +---------------------------------------------------- + +[ + ["keyword", "if"], + ["variable", "browser_height"], + ["operator", ">"], + ["function", "window_get_height"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "||"], + ["variable", "browser_width"], + ["operator", ">"], + ["function", "window_get_width"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["keyword", "var"], + " xx", + ["punctuation", ","], + " yy", + ["punctuation", ";"], + + ["keyword", "if"], + ["variable", "browser_width"], + ["operator", ">"], + ["function", "window_get_width"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "{"], + + "\r\n\t\txx ", + ["operator", "="], + ["punctuation", "("], + ["variable", "browser_width"], + ["operator", "-"], + ["function", "window_get_width"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"], + ["operator", "/"], + ["number", "2"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "else"], + + ["punctuation", "{"], + + "\r\n\t\txx ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "if"], + ["variable", "browser_height"], + ["operator", ">"], + ["function", "window_get_height"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "{"], + + "\r\n\t\tyy ", + ["operator", "="], + ["punctuation", "("], + ["variable", "browser_height"], + ["operator", "-"], + ["function", "window_get_height"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"], + ["operator", "/"], + ["number", "2"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "else"], + + ["punctuation", "{"], + + "\r\n\t\tyy ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["function", "window_set_position"], + ["punctuation", "("], + "xx", + ["punctuation", ","], + " yy", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/gn/boolean_feature.test b/tests/languages/gn/boolean_feature.test new file mode 100644 index 0000000000..e002f72d44 --- /dev/null +++ b/tests/languages/gn/boolean_feature.test @@ -0,0 +1,8 @@ +true false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] diff --git a/tests/languages/gn/builtin-function_feature.test b/tests/languages/gn/builtin-function_feature.test new file mode 100644 index 0000000000..f167f9aeec --- /dev/null +++ b/tests/languages/gn/builtin-function_feature.test @@ -0,0 +1,49 @@ +assert() +defined() +foreach() +import() +pool() +print() +template() +tool() +toolchain() + +---------------------------------------------------- + +[ + ["builtin-function", "assert"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "defined"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "foreach"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "import"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "pool"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "print"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "template"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "tool"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "toolchain"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/gn/comment_feature.test b/tests/languages/gn/comment_feature.test new file mode 100644 index 0000000000..7883a734b3 --- /dev/null +++ b/tests/languages/gn/comment_feature.test @@ -0,0 +1,7 @@ +# comment + +---------------------------------------------------- + +[ + ["comment", "# comment"] +] diff --git a/tests/languages/gn/constant_feature.test b/tests/languages/gn/constant_feature.test new file mode 100644 index 0000000000..0992f0378f --- /dev/null +++ b/tests/languages/gn/constant_feature.test @@ -0,0 +1,31 @@ +current_cpu +current_os +current_toolchain +default_toolchain +host_cpu +host_os +root_build_dir +root_gen_dir +root_out_dir +target_cpu +target_gen_dir +target_os +target_out_dir + +---------------------------------------------------- + +[ + ["constant", "current_cpu"], + ["constant", "current_os"], + ["constant", "current_toolchain"], + ["constant", "default_toolchain"], + ["constant", "host_cpu"], + ["constant", "host_os"], + ["constant", "root_build_dir"], + ["constant", "root_gen_dir"], + ["constant", "root_out_dir"], + ["constant", "target_cpu"], + ["constant", "target_gen_dir"], + ["constant", "target_os"], + ["constant", "target_out_dir"] +] diff --git a/tests/languages/gn/function_feature.test b/tests/languages/gn/function_feature.test new file mode 100644 index 0000000000..896990e8e7 --- /dev/null +++ b/tests/languages/gn/function_feature.test @@ -0,0 +1,9 @@ +foo() + +---------------------------------------------------- + +[ + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/gn/keyword_feature.test b/tests/languages/gn/keyword_feature.test new file mode 100644 index 0000000000..8eaf16e7ff --- /dev/null +++ b/tests/languages/gn/keyword_feature.test @@ -0,0 +1,9 @@ +if +else + +---------------------------------------------------- + +[ + ["keyword", "if"], + ["keyword", "else"] +] diff --git a/tests/languages/gn/number_feature.test b/tests/languages/gn/number_feature.test new file mode 100644 index 0000000000..9eb1b8b987 --- /dev/null +++ b/tests/languages/gn/number_feature.test @@ -0,0 +1,11 @@ +0 +123 +-123 + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"], + ["number", "-123"] +] diff --git a/tests/languages/gn/operator_feature.test b/tests/languages/gn/operator_feature.test new file mode 100644 index 0000000000..61be6f76a1 --- /dev/null +++ b/tests/languages/gn/operator_feature.test @@ -0,0 +1,29 @@ ++ += +- -= +== != < > <= => +! = +&& || + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "+="], + + ["operator", "-"], + ["operator", "-="], + + ["operator", "=="], + ["operator", "!="], + ["operator", "<"], + ["operator", ">"], + ["operator", "<="], + ["operator", "="], + ["operator", ">"], + + ["operator", "!"], + ["operator", "="], + + ["operator", "&&"], + ["operator", "||"] +] diff --git a/tests/languages/gn/punctuation_feature.test b/tests/languages/gn/punctuation_feature.test new file mode 100644 index 0000000000..2f83bd4cfb --- /dev/null +++ b/tests/languages/gn/punctuation_feature.test @@ -0,0 +1,16 @@ +( ) [ ] { } +, . + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", "."] +] diff --git a/tests/languages/gn/string_feature.test b/tests/languages/gn/string_feature.test new file mode 100644 index 0000000000..322dd572b2 --- /dev/null +++ b/tests/languages/gn/string_feature.test @@ -0,0 +1,70 @@ +"" +"foo" +".$output_extension" +"$0xFF" +"$var_one/$var_two" +"${var_one}" +"$root_out_dir/lib${_output_name}${_shlib_extension}" + +---------------------------------------------------- + +[ + ["string-literal", [ + ["string", "\"\""] + ]], + ["string-literal", [ + ["string", "\"foo\""] + ]], + ["string-literal", [ + ["string", "\"."], + ["interpolation", [ + ["variable", "$output_extension"] + ]], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\""], + ["interpolation", [ + ["number", "$0xFF"] + ]], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\""], + ["interpolation", [ + ["variable", "$var_one"] + ]], + ["string", "/"], + ["interpolation", [ + ["variable", "$var_two"] + ]], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\""], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", ["var_one"]], + ["interpolation-punctuation", "}"] + ]], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\""], + ["interpolation", [ + ["variable", "$root_out_dir"] + ]], + ["string", "/lib"], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", ["_output_name"]], + ["interpolation-punctuation", "}"] + ]], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", ["_shlib_extension"]], + ["interpolation-punctuation", "}"] + ]], + ["string", "\""] + ]] +] diff --git a/tests/languages/go-module/comment_feature.test b/tests/languages/go-module/comment_feature.test new file mode 100644 index 0000000000..e2a62cb063 --- /dev/null +++ b/tests/languages/go-module/comment_feature.test @@ -0,0 +1,7 @@ +// comment + +---------------------------------------------------- + +[ + ["comment", "// comment"] +] diff --git a/tests/languages/go-module/directives_feature.test b/tests/languages/go-module/directives_feature.test new file mode 100644 index 0000000000..2aa07bce1a --- /dev/null +++ b/tests/languages/go-module/directives_feature.test @@ -0,0 +1,125 @@ +module golang.org/x/net + +go 1.14 + +require golang.org/x/net v1.2.3 + +require ( + golang.org/x/crypto v1.4.5 // indirect + golang.org/x/text v1.6.7 +) + +exclude golang.org/x/net v1.2.3 + +exclude ( + golang.org/x/crypto v1.4.5 + golang.org/x/text v1.6.7 +) + +replace golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5 + +replace ( + golang.org/x/net v1.2.3 => example.com/fork/net v1.4.5 + golang.org/x/net => example.com/fork/net v1.4.5 + golang.org/x/net v1.2.3 => ./fork/net + golang.org/x/net => ./fork/net +) + +retract ( + v1.0.0 // Published accidentally. + v1.0.1 // Contains retractions only. +) + +retract v1.0.0 +retract [v1.0.0, v1.9.9] +retract ( + v1.0.0 + [v1.0.0, v1.9.9] +) + +---------------------------------------------------- + +[ + ["keyword", "module"], " golang.org/x/net\r\n\r\n", + + ["keyword", "go"], ["go-version", "1.14"], + + ["keyword", "require"], " golang.org/x/net ", ["version", "v1.2.3"], + + ["keyword", "require"], + ["punctuation", "("], + + "\r\n golang.org/x/crypto ", + ["version", "v1.4.5"], + ["comment", "// indirect"], + + "\r\n golang.org/x/text ", + ["version", "v1.6.7"], + + ["punctuation", ")"], + + ["keyword", "exclude"], " golang.org/x/net ", ["version", "v1.2.3"], + + ["keyword", "exclude"], ["punctuation", "("], + "\r\n golang.org/x/crypto ", ["version", "v1.4.5"], + "\r\n golang.org/x/text ", ["version", "v1.6.7"], + ["punctuation", ")"], + + ["keyword", "replace"], + " golang.org/x/net ", + ["version", "v1.2.3"], + ["operator", "=>"], + " example.com/fork/net ", + ["version", "v1.4.5"], + + ["keyword", "replace"], + ["punctuation", "("], + + "\r\n golang.org/x/net ", + ["version", "v1.2.3"], + ["operator", "=>"], + " example.com/fork/net ", + ["version", "v1.4.5"], + + "\r\n golang.org/x/net ", + ["operator", "=>"], + " example.com/fork/net ", + ["version", "v1.4.5"], + + "\r\n golang.org/x/net ", + ["version", "v1.2.3"], + ["operator", "=>"], + " ./fork/net\r\n golang.org/x/net ", + ["operator", "=>"], + " ./fork/net\r\n", + + ["punctuation", ")"], + + ["keyword", "retract"], ["punctuation", "("], + ["version", "v1.0.0"], ["comment", "// Published accidentally."], + ["version", "v1.0.1"], ["comment", "// Contains retractions only."], + ["punctuation", ")"], + + ["keyword", "retract"], + ["version", "v1.0.0"], + + ["keyword", "retract"], + ["punctuation", "["], + ["version", "v1.0.0"], + ["punctuation", ","], + ["version", "v1.9.9"], + ["punctuation", "]"], + + ["keyword", "retract"], + ["punctuation", "("], + + ["version", "v1.0.0"], + + ["punctuation", "["], + ["version", "v1.0.0"], + ["punctuation", ","], + ["version", "v1.9.9"], + ["punctuation", "]"], + + ["punctuation", ")"] +] diff --git a/tests/languages/go-module/keyword_feature.test b/tests/languages/go-module/keyword_feature.test new file mode 100644 index 0000000000..935bd8dbce --- /dev/null +++ b/tests/languages/go-module/keyword_feature.test @@ -0,0 +1,17 @@ +exclude +go +module +replace +require +retract + +---------------------------------------------------- + +[ + ["keyword", "exclude"], + ["keyword", "go"], + ["keyword", "module"], + ["keyword", "replace"], + ["keyword", "require"], + ["keyword", "retract"] +] diff --git a/tests/languages/go-module/operator_feature.test b/tests/languages/go-module/operator_feature.test new file mode 100644 index 0000000000..b26589fe21 --- /dev/null +++ b/tests/languages/go-module/operator_feature.test @@ -0,0 +1,7 @@ +=> + +---------------------------------------------------- + +[ + ["operator", "=>"] +] diff --git a/tests/languages/go-module/punctuation_feature.test b/tests/languages/go-module/punctuation_feature.test new file mode 100644 index 0000000000..610a4aa703 --- /dev/null +++ b/tests/languages/go-module/punctuation_feature.test @@ -0,0 +1,13 @@ +( ) [ ] +, + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", ","] +] diff --git a/tests/languages/go-module/version_feature.test b/tests/languages/go-module/version_feature.test new file mode 100644 index 0000000000..5406b41095 --- /dev/null +++ b/tests/languages/go-module/version_feature.test @@ -0,0 +1,21 @@ +v0.0.0 +v1.12.134 +v8.0.5-pre +v2.0.9+meta +v1.5.0-beta +v0.0.0-20191109021931-daa7c04131f5 +v1.999.999-99999999999999-daa7c04131f5 +v1.2.4-0.20191109021931-daa7c04131f5 + +---------------------------------------------------- + +[ + ["version", "v0.0.0"], + ["version", "v1.12.134"], + ["version", "v8.0.5-pre"], + ["version", "v2.0.9+meta"], + ["version", "v1.5.0-beta"], + ["version", "v0.0.0-20191109021931-daa7c04131f5"], + ["version", "v1.999.999-99999999999999-daa7c04131f5"], + ["version", "v1.2.4-0.20191109021931-daa7c04131f5"] +] diff --git a/tests/languages/go/char_feature.test b/tests/languages/go/char_feature.test new file mode 100644 index 0000000000..32a3d1ec26 --- /dev/null +++ b/tests/languages/go/char_feature.test @@ -0,0 +1,29 @@ +'a' +'ä' +'本' +'\t' +'\000' +'\007' +'\377' +'\x07' +'\xff' +'\u12e4' +'\U00101234' +'\'' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'ä'"], + ["char", "'本'"], + ["char", "'\\t'"], + ["char", "'\\000'"], + ["char", "'\\007'"], + ["char", "'\\377'"], + ["char", "'\\x07'"], + ["char", "'\\xff'"], + ["char", "'\\u12e4'"], + ["char", "'\\U00101234'"], + ["char", "'\\''"] +] diff --git a/tests/languages/go/number_feature.test b/tests/languages/go/number_feature.test index f21b3e8750..86414774c0 100644 --- a/tests/languages/go/number_feature.test +++ b/tests/languages/go/number_feature.test @@ -2,19 +2,48 @@ 0600 0xBadFace 170141183460469231731687303715884105727 +42 +4_2 +0600 +0_600 +0o600 +0O600 // second character is capital letter 'O' +0xBadFace +0xBad_Face +0x_67_7a_2f_cc_40_c6 +170141183460469231731687303715884105727 +170_141183_460469_231731_687303_715884_105727 + +0. 72.40 -072.40 +072.40 // == 72.40 2.71828 1.e+0 6.67428e-11 1E6 +.25 +.12345E+5 +1_5. // == 15.0 +0.15e+0_2 // == 15.0 + +0x1p-2 // == 0.25 +0x2.p10 // == 2048.0 +0x1.Fp+0 // == 1.9375 +0X.8p-0 // == 0.5 +0X_1FFFP-16 // == 0.1249847412109375 + 0i -011i +0123i // == 123i for backward-compatibility +0o123i // == 0o123 * 1i == 83i +0xabci // == 0xabc * 1i == 2748i 0.i 2.71828i 1.e+0i 6.67428e-11i 1E6i +.25i +.12345E+5i +0x1p-2i // == 0x1p-2 * 1i == 0.25i ---------------------------------------------------- @@ -23,21 +52,51 @@ ["number", "0600"], ["number", "0xBadFace"], ["number", "170141183460469231731687303715884105727"], + ["number", "42"], + ["number", "4_2"], + ["number", "0600"], + ["number", "0_600"], + ["number", "0o600"], + ["number", "0O600"], + ["comment", "// second character is capital letter 'O'"], + ["number", "0xBadFace"], + ["number", "0xBad_Face"], + ["number", "0x_67_7a_2f_cc_40_c6"], + ["number", "170141183460469231731687303715884105727"], + ["number", "170_141183_460469_231731_687303_715884_105727"], + + ["number", "0."], ["number", "72.40"], - ["number", "072.40"], + ["number", "072.40"], ["comment", "// == 72.40"], ["number", "2.71828"], ["number", "1.e+0"], ["number", "6.67428e-11"], ["number", "1E6"], + ["number", ".25"], + ["number", ".12345E+5"], + ["number", "1_5."], ["comment", "// == 15.0"], + ["number", "0.15e+0_2"], ["comment", "// == 15.0"], + + ["number", "0x1p-2"], ["comment", "// == 0.25"], + ["number", "0x2.p10"], ["comment", "// == 2048.0"], + ["number", "0x1.Fp+0"], ["comment", "// == 1.9375"], + ["number", "0X.8p-0"], ["comment", "// == 0.5"], + ["number", "0X_1FFFP-16"], ["comment", "// == 0.1249847412109375"], + ["number", "0i"], - ["number", "011i"], + ["number", "0123i"], ["comment", "// == 123i for backward-compatibility"], + ["number", "0o123i"], ["comment", "// == 0o123 * 1i == 83i"], + ["number", "0xabci"], ["comment", "// == 0xabc * 1i == 2748i"], ["number", "0.i"], ["number", "2.71828i"], ["number", "1.e+0i"], ["number", "6.67428e-11i"], - ["number", "1E6i"] + ["number", "1E6i"], + ["number", ".25i"], + ["number", ".12345E+5i"], + ["number", "0x1p-2i"], ["comment", "// == 0x1p-2 * 1i == 0.25i"] ] ---------------------------------------------------- -Checks for integers, floats and imaginary numbers. \ No newline at end of file +Checks for integers, floats and imaginary numbers. diff --git a/tests/languages/go/punctuation_feature.test b/tests/languages/go/punctuation_feature.test new file mode 100644 index 0000000000..48cac5f7fc --- /dev/null +++ b/tests/languages/go/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) { } [ ] +, ; . : + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + ["punctuation", ":"] +] diff --git a/tests/languages/go/string_feature.test b/tests/languages/go/string_feature.test index 97e3960b72..93d9bf9a36 100644 --- a/tests/languages/go/string_feature.test +++ b/tests/languages/go/string_feature.test @@ -1,13 +1,10 @@ -'a' -'ä' -'本' -'\t' -'\xff' -'\u12e4' - +`` `abc` `\n \n` +`\` + +"" "\n" "\"" "Hello, world!\n" @@ -17,14 +14,12 @@ ---------------------------------------------------- [ - ["string", "'a'"], - ["string", "'ä'"], - ["string", "'本'"], - ["string", "'\\t'"], - ["string", "'\\xff'"], - ["string", "'\\u12e4'"], + ["string", "``"], ["string", "`abc`"], ["string", "`\\n\r\n\\n`"], + ["string", "`\\`"], + + ["string", "\"\""], ["string", "\"\\n\""], ["string", "\"\\\"\""], ["string", "\"Hello, world!\\n\""], @@ -34,4 +29,4 @@ ---------------------------------------------------- -Checks for runes and strings. \ No newline at end of file +Checks for runes and strings. diff --git a/tests/languages/graphql/atom-input_feature.test b/tests/languages/graphql/atom-input_feature.test new file mode 100644 index 0000000000..aae416211f --- /dev/null +++ b/tests/languages/graphql/atom-input_feature.test @@ -0,0 +1,7 @@ +FooInput + +---------------------------------------------------- + +[ + ["atom-input", "FooInput"] +] diff --git a/tests/languages/graphql/attr-name_feature.test b/tests/languages/graphql/attr-name_feature.test index 8f95fc25c6..fe1379fece 100644 --- a/tests/languages/graphql/attr-name_feature.test +++ b/tests/languages/graphql/attr-name_feature.test @@ -12,33 +12,35 @@ ["attr-name", "zuck"], ["punctuation", ":"], - " user", + ["property-query", "user"], ["punctuation", "("], ["attr-name", "id"], ["punctuation", ":"], ["number", "4"], ["punctuation", ")"], ["punctuation", "{"], - "\r\n\t\tname\r\n\t", + + ["property", "name"], + ["punctuation", "}"], ["attr-name", "foo"], ["punctuation", "("], ["attr-name", "bar"], ["punctuation", ":"], - " Int ", + ["scalar", "Int"], ["operator", "="], ["number", "0"], ["punctuation", ","], ["attr-name", "baz"], ["punctuation", ":"], - " String ", + ["scalar", "String"], ["operator", "="], ["string", "\"(\""], ["punctuation", ")"], ["punctuation", ":"], ["punctuation", "["], - "Int", + ["scalar", "Int"], ["operator", "!"], ["punctuation", "]"], ["operator", "!"], @@ -48,4 +50,4 @@ ---------------------------------------------------- -Checks for aliases, parameter names, etc. \ No newline at end of file +Checks for aliases, parameter names, etc. diff --git a/tests/languages/graphql/constant_feature.test b/tests/languages/graphql/constant_feature.test index b6ad2e7651..c06825272b 100644 --- a/tests/languages/graphql/constant_feature.test +++ b/tests/languages/graphql/constant_feature.test @@ -13,27 +13,29 @@ enum Color { ---------------------------------------------------- [ - ["keyword", "enum"], - ["class-name", "Color"], - ["punctuation", "{"], + ["keyword", "enum"], ["class-name", "Color"], ["punctuation", "{"], ["constant", "RED"], ["constant", "GREEN"], ["constant", "BLUE"], ["punctuation", "}"], ["punctuation", "{"], - "\n\tfoo", + + ["property-query", "foo"], ["punctuation", "("], ["attr-name", "bar"], ["punctuation", ":"], ["constant", "RED"], ["punctuation", ")"], ["punctuation", "{"], - "\n\t\tbaz\n\t", + + ["property", "baz"], + ["punctuation", "}"], + ["punctuation", "}"] ] ---------------------------------------------------- -Checks for constants. \ No newline at end of file +Checks for constants. diff --git a/tests/languages/graphql/fragment_feature.test b/tests/languages/graphql/fragment_feature.test index 7fdcc7f953..e61fe0164d 100644 --- a/tests/languages/graphql/fragment_feature.test +++ b/tests/languages/graphql/fragment_feature.test @@ -11,8 +11,7 @@ fragment frag on FooBar { [ ["punctuation", "{"], - ["operator", "..."], - ["fragment", "frag"], + ["operator", "..."], ["fragment", "frag"], ["punctuation", "}"], ["keyword", "fragment"], @@ -20,10 +19,14 @@ fragment frag on FooBar { ["keyword", "on"], ["class-name", "FooBar"], ["punctuation", "{"], - "\r\n\tfoo\r\n\tbar\r\n", + + ["property", "foo"], + + ["property", "bar"], + ["punctuation", "}"] ] ---------------------------------------------------- -Checks for fragments. \ No newline at end of file +Checks for fragments. diff --git a/tests/languages/graphql/mutation_feature.test b/tests/languages/graphql/mutation_feature.test new file mode 100644 index 0000000000..658a9c0ff8 --- /dev/null +++ b/tests/languages/graphql/mutation_feature.test @@ -0,0 +1,10 @@ +mutation foo {} + +---------------------------------------------------- + +[ + ["keyword", "mutation"], + ["definition-mutation", "foo"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/graphql/scalar_feature.test b/tests/languages/graphql/scalar_feature.test new file mode 100644 index 0000000000..3a4f400ac4 --- /dev/null +++ b/tests/languages/graphql/scalar_feature.test @@ -0,0 +1,15 @@ +Boolean +Float +ID +Int +String + +---------------------------------------------------- + +[ + ["scalar", "Boolean"], + ["scalar", "Float"], + ["scalar", "ID"], + ["scalar", "Int"], + ["scalar", "String"] +] diff --git a/tests/languages/groovy/issue1049.html.test b/tests/languages/groovy/issue1049.html.test new file mode 100644 index 0000000000..0f0c6182bd --- /dev/null +++ b/tests/languages/groovy/issue1049.html.test @@ -0,0 +1,15 @@ +"&" +"&&" +"<" +"<<" +"&lt;" +">" + +---------------------------------------------------- + +"&amp;" +"&amp;&amp;" +"&lt;" +"&lt;&lt;" +"&amp;lt;" +"&gt;" diff --git a/tests/languages/groovy/issue1049.js b/tests/languages/groovy/issue1049.js deleted file mode 100644 index 2ce81537a2..0000000000 --- a/tests/languages/groovy/issue1049.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - '"&"': '"&amp;"', - '"&&"': '"&amp;&amp;"', - '"<"': '"&lt;"', - '"<<"': '"&lt;&lt;"', - '"&lt;"': '"&amp;lt;"', - '">"': '"&gt;"', -}; diff --git a/tests/languages/groovy/string-interpolation_feature.html.test b/tests/languages/groovy/string-interpolation_feature.html.test new file mode 100644 index 0000000000..15541878bd --- /dev/null +++ b/tests/languages/groovy/string-interpolation_feature.html.test @@ -0,0 +1,133 @@ +// 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/groovy/string-interpolation_feature.js b/tests/languages/groovy/string-interpolation_feature.js deleted file mode 100644 index ddecdfd74f..0000000000 --- a/tests/languages/groovy/string-interpolation_feature.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - // Double quoted: interpolation - '"$foo"': '"$foo"', - '"${42}"': '"${42}"', - // Triple double quoted: interpolation - '"""$foo"""': '"""$foo"""', - '"""${42}"""': '"""${42}"""', - // Slashy string: interpolation - '/$foo/': '/$foo/', - '/${42}/': '/${42}/', - // Dollar slashy string: interpolation - '$/$foo/$': '$/$foo/$', - '$/${42}/$': '$/${42}/$', - - // Double quoted: no interpolation (escaped) - '"\\$foo \\${42}"': '"\\$foo \\${42}"', - // Triple double quoted: no interpolation (escaped) - '"""\\$foo \\${42}"""': '"""\\$foo \\${42}"""', - // Slashy string: no interpolation (escaped) - '/\\$foo \\${42}/': '/\\$foo \\${42}/', - // Dollar slashy string: no interpolation (escaped) - '$/$$foo $${42}/$': '$/$$foo $${42}/$', - - // Single quoted string: no interpolation - '\'$foo ${42}\'': '\'$foo ${42}\'', - // Triple single quoted string: no interpolation - '\'\'\'$foo ${42}\'\'\'': '\'\'\'$foo ${42}\'\'\'' -}; \ No newline at end of file diff --git a/tests/languages/haml/filter_feature.test b/tests/languages/haml/filter_feature.test new file mode 100644 index 0000000000..834d2ede5f --- /dev/null +++ b/tests/languages/haml/filter_feature.test @@ -0,0 +1,20 @@ +:some-language + some code + +~ + :some-language + some code + +---------------------------------------------------- + +[ + ["filter", [ + ["filter-name", ":some-language"], + "\r\n\tsome code\r\n\r" + ]], + ["punctuation", "~"], + ["filter", [ + ["filter-name", ":some-language"], + "\r\n\t\tsome code" + ]] +] diff --git a/tests/languages/haml/interpolation_feature.test b/tests/languages/haml/interpolation_feature.test index ed13c87a81..58cb497d07 100644 --- a/tests/languages/haml/interpolation_feature.test +++ b/tests/languages/haml/interpolation_feature.test @@ -6,16 +6,22 @@ [ ["interpolation", [ ["delimiter", "#{"], - ["number", "42"], + ["ruby", [ + ["number", "42"] + ]], ["delimiter", "}"] ]], ["interpolation", [ ["delimiter", "#{"], - ["string", ["\"foobar\""]], + ["ruby", [ + ["string-literal", [ + ["string", "\"foobar\""] + ]] + ]], ["delimiter", "}"] ]] ] ---------------------------------------------------- -Checks for interpolation in plain text. \ No newline at end of file +Checks for interpolation in plain text. diff --git a/tests/languages/haml/tag_feature.test b/tests/languages/haml/tag_feature.test index a1e0c0de8d..9bd73a2a5c 100644 --- a/tests/languages/haml/tag_feature.test +++ b/tests/languages/haml/tag_feature.test @@ -42,19 +42,24 @@ ["attributes", [ ["punctuation", "{"], ["symbol", ":type"], - ["operator", "="], ["operator", ">"], - ["string", ["\"text/javascript\""]], + ["operator", "=>"], + ["string-literal", [ + ["string", "\"text/javascript\""] + ]], ["punctuation", ","], + ["symbol", ":src"], - ["operator", "="], ["operator", ">"], - ["string", [ - "\"javascripts/script_", + ["operator", "=>"], + ["string-literal", [ + ["string", "\"javascripts/script_"], ["interpolation", [ ["delimiter", "#{"], - ["number", "42"], + ["content", [ + ["number", "42"] + ]], ["delimiter", "}"] ]], - "\"" + ["string", "\""] ]], ["punctuation", "}"] ]] @@ -65,7 +70,7 @@ ["attributes", [ ["punctuation", "{"], ["symbol", ":id"], - ["operator", "="], ["operator", ">"], + ["operator", "=>"], ["punctuation", "["], ["variable", "@item"], ["punctuation", "."], @@ -88,8 +93,8 @@ ["attr-value", "@title"], ["attr-name", "href"], ["punctuation", "="], - ["attr-value", "href"], - ["punctuation", ")"] + ["attr-value", "href"], + ["punctuation", ")"] ]] ]], ["tag", [ @@ -107,7 +112,9 @@ ["punctuation", "{"], "html_attrs", ["punctuation", "("], - ["string", ["'fr-fr'"]], + ["string-literal", [ + ["string", "'fr-fr'"] + ]], ["punctuation", ")"], ["punctuation", "}"] ]] @@ -138,7 +145,7 @@ ["attributes", [ ["punctuation", "{"], ["symbol", ":id"], - ["operator", "="], ["operator", ">"], + ["operator", "=>"], ["variable", "@article"], ["punctuation", "."], "number", @@ -150,8 +157,14 @@ ["tag", [".item"]], ["tag", ["%br/"]], - ["tag", ["%blockquote", ["punctuation", "<"]]], - ["tag", ["%img", ["punctuation", ">"]]] + ["tag", [ + "%blockquote", + ["punctuation", "<"] + ]], + ["tag", [ + "%img", + ["punctuation", ">"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/handlebars+pug/handlebars_inclusion.test b/tests/languages/handlebars+pug/handlebars_inclusion.test index c69751fd06..156cf8a651 100644 --- a/tests/languages/handlebars+pug/handlebars_inclusion.test +++ b/tests/languages/handlebars+pug/handlebars_inclusion.test @@ -6,10 +6,12 @@ [ ["filter-handlebars", [ ["filter-name", ":handlebars"], - ["comment", "{{!comment}}"] + ["text", [ + ["comment", "{{!comment}}"] + ]] ]] ] ---------------------------------------------------- -Checks for handlebars filter in Jade. \ No newline at end of file +Checks for handlebars filter in pug. diff --git a/tests/languages/haskell/comment_feature.test b/tests/languages/haskell/comment_feature.test index d8c8cdda20..75c1f1bec4 100644 --- a/tests/languages/haskell/comment_feature.test +++ b/tests/languages/haskell/comment_feature.test @@ -1,14 +1,18 @@ +-- -- foo {- foo bar -} +{--} ---------------------------------------------------- [ + ["comment", "--"], ["comment", "-- foo"], - ["comment", "{- foo\r\nbar -}"] + ["comment", "{- foo\r\nbar -}"], + ["comment", "{--}"] ] ---------------------------------------------------- -Checks for single-line and multi-line comments. \ No newline at end of file +Checks for single-line and multi-line comments. diff --git a/tests/languages/haskell/constant_feature.test b/tests/languages/haskell/constant_feature.test index 06f25f10e5..e477b737f7 100644 --- a/tests/languages/haskell/constant_feature.test +++ b/tests/languages/haskell/constant_feature.test @@ -1,15 +1,25 @@ Foo +Foo' Foo.Bar Baz.Foobar_42 ---------------------------------------------------- [ - ["constant", "Foo"], - ["constant", "Foo.Bar"], - ["constant", "Baz.Foobar_42"] + ["constant", ["Foo"]], + ["constant", ["Foo'"]], + ["constant", [ + "Foo", + ["punctuation", "."], + "Bar" + ]], + ["constant", [ + "Baz", + ["punctuation", "."], + "Foobar_42" + ]] ] ---------------------------------------------------- -Checks for constants. \ No newline at end of file +Checks for constants. diff --git a/tests/languages/haskell/hvariable_feature.test b/tests/languages/haskell/hvariable_feature.test index defa3ba74d..f7a6fc94dc 100644 --- a/tests/languages/haskell/hvariable_feature.test +++ b/tests/languages/haskell/hvariable_feature.test @@ -1,15 +1,25 @@ foo +foo' Foo.bar Baz.foobar_42 ---------------------------------------------------- [ - ["hvariable", "foo"], - ["hvariable", "Foo.bar"], - ["hvariable", "Baz.foobar_42"] + ["hvariable", ["foo"]], + ["hvariable", ["foo'"]], + ["hvariable", [ + "Foo", + ["punctuation", "."], + "bar" + ]], + ["hvariable", [ + "Baz", + ["punctuation", "."], + "foobar_42" + ]] ] ---------------------------------------------------- -Checks for hvariables. \ No newline at end of file +Checks for hvariables. diff --git a/tests/languages/haskell/import_statement_feature.test b/tests/languages/haskell/import_statement_feature.test index 120fbe7511..afd7ddc74b 100644 --- a/tests/languages/haskell/import_statement_feature.test +++ b/tests/languages/haskell/import_statement_feature.test @@ -6,30 +6,36 @@ import Foo.Bar as Foo.Baz hiding ---------------------------------------------------- [ - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], " Foo" ]], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], ["keyword", "qualified"], " Foobar" ]], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], - " Foo_42.Bar ", + " Foo_42", + ["punctuation", "."], + "Bar ", ["keyword", "as"], " Foobar" ]], - ["import_statement", [ + ["import-statement", [ ["keyword", "import"], - " Foo.Bar ", + " Foo", + ["punctuation", "."], + "Bar ", ["keyword", "as"], - " Foo.Baz ", + " Foo", + ["punctuation", "."], + "Baz ", ["keyword", "hiding"] ]] ] ---------------------------------------------------- -Checks for import statement. \ No newline at end of file +Checks for import statement. diff --git a/tests/languages/haskell/operator_feature.test b/tests/languages/haskell/operator_feature.test index 9cd8339fbf..80cebc3d6e 100644 --- a/tests/languages/haskell/operator_feature.test +++ b/tests/languages/haskell/operator_feature.test @@ -17,21 +17,58 @@ reverse . sort [ ["operator", ".."], - ["builtin", "reverse"], ["operator", " . "], ["builtin", "sort"], + + ["builtin", "reverse"], + ["operator", "."], + ["builtin", "sort"], + ["operator", "`foo`"], + ["operator", "`Foo.bar`"], - ["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", "<="], + ["operator", "=="], + ["operator", "/="], + + ["operator", ">="], + ["operator", ">"], + ["operator", "\\"], + ["operator", "|"], + + ["operator", "++"], + ["operator", ":"], + ["operator", "!!"], + + ["operator", "\\\\"], + ["operator", "<-"], + ["operator", "->"], + + ["operator", "="], + ["operator", "::"], + ["operator", "=>"], + + ["operator", ">>"], + ["operator", ">>="], + ["operator", ">@>"], + + ["operator", "~"], + ["operator", "!"], + ["operator", "@"] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/haxe!+regex/regex_inclusion.test b/tests/languages/haxe!+regex/regex_inclusion.test new file mode 100644 index 0000000000..b6a24a3b74 --- /dev/null +++ b/tests/languages/haxe!+regex/regex_inclusion.test @@ -0,0 +1,99 @@ +~/ha\/xe/i +~/[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z][A-Z][A-Z]?/i +~/(dog|fox)/igmsu + +---------------------------------------------------- + +[ + ["regex", [ + ["regex-delimiter", "~/"], + ["regex-source", [ + "ha", + ["escape", "\\/"], + "xe" + ]], + ["regex-delimiter", "/"], + ["regex-flags", "i"] + ]], + ["regex", [ + ["regex-delimiter", "~/"], + ["regex-source", [ + ["char-class", [ + ["char-class-punctuation", "["], + ["range", [ + "A", + ["range-punctuation", "-"], + "Z" + ]], + ["range", [ + "0", + ["range-punctuation", "-"], + "9" + ]], + "._%-", + ["char-class-punctuation", "]"] + ]], + ["quantifier", "+"], + "@", + ["char-class", [ + ["char-class-punctuation", "["], + ["range", [ + "A", + ["range-punctuation", "-"], + "Z" + ]], + ["range", [ + "0", + ["range-punctuation", "-"], + "9" + ]], + ".-", + ["char-class-punctuation", "]"] + ]], + ["quantifier", "+"], + ["char-set", "."], + ["char-class", [ + ["char-class-punctuation", "["], + ["range", [ + "A", + ["range-punctuation", "-"], + "Z" + ]], + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + ["range", [ + "A", + ["range-punctuation", "-"], + "Z" + ]], + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + ["range", [ + "A", + ["range-punctuation", "-"], + "Z" + ]], + ["char-class-punctuation", "]"] + ]], + ["quantifier", "?"] + ]], + ["regex-delimiter", "/"], + ["regex-flags", "i"] + ]], + ["regex", [ + ["regex-delimiter", "~/"], + ["regex-source", [ + ["group", ["("]], + "dog", + ["alternation", "|"], + "fox", + ["group", ")"] + ]], + ["regex-delimiter", "/"], + ["regex-flags", "igmsu"] + ]] +] diff --git a/tests/languages/haxe/class-name_feature.test b/tests/languages/haxe/class-name_feature.test new file mode 100644 index 0000000000..794a0549ad --- /dev/null +++ b/tests/languages/haxe/class-name_feature.test @@ -0,0 +1,258 @@ +class Main {} + +typedef Player = { name: String, move: Move } + +enum Move { Rock; Paper; Scissors; } + +abstract MyAbstractInt(Int) from Int to Int { + @:op(A > B) static function gt(a:MyAbstractInt, b:MyAbstractInt):Bool; +} + +new A(); + +var b:B = a; + +class Game { + // Haxe applications have a static entry point called main + static function main() { + // Anonymous structures. + var playerA = { name: "Simon", move: Paper } + var playerB = { name: "Nicolas", move: Rock } + + // Array pattern matching. A switch can return a value. + var result = switch [playerA.move, playerB.move] { + case [Rock, Scissors] | + [Paper, Rock] | + [Scissors, Paper]: Winner(playerA); + + case [Rock, Paper] | + [Paper, Scissors] | + [Scissors, Rock]: Winner(playerB); + + case _: Draw; + } + // Paper vs Rock, who wins? + trace('result: $result'); + } +} + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", "Main"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "typedef"], + ["class-name", "Player"], + ["operator", "="], + ["punctuation", "{"], + " name", + ["operator", ":"], + ["class-name", "String"], + ["punctuation", ","], + " move", + ["operator", ":"], + ["class-name", "Move"], + ["punctuation", "}"], + + ["keyword", "enum"], + ["class-name", "Move"], + ["punctuation", "{"], + ["class-name", "Rock"], + ["punctuation", ";"], + ["class-name", "Paper"], + ["punctuation", ";"], + ["class-name", "Scissors"], + ["punctuation", ";"], + ["punctuation", "}"], + + ["keyword", "abstract"], + ["class-name", "MyAbstractInt"], + ["punctuation", "("], + ["class-name", "Int"], + ["punctuation", ")"], + ["keyword", "from"], + ["class-name", "Int"], + ["keyword", "to"], + ["class-name", "Int"], + ["punctuation", "{"], + + ["metadata", "@:op"], + ["punctuation", "("], + ["class-name", "A"], + ["operator", ">"], + ["class-name", "B"], + ["punctuation", ")"], + ["keyword", "static"], + ["keyword", "function"], + ["function", "gt"], + ["punctuation", "("], + "a", + ["operator", ":"], + ["class-name", "MyAbstractInt"], + ["punctuation", ","], + " b", + ["operator", ":"], + ["class-name", "MyAbstractInt"], + ["punctuation", ")"], + ["operator", ":"], + ["class-name", "Bool"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "new"], + ["class-name", "A"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "var"], + " b", + ["operator", ":"], + ["class-name", "B"], + ["operator", "="], + " a", + ["punctuation", ";"], + + ["keyword", "class"], + ["class-name", "Game"], + ["punctuation", "{"], + + ["comment", "// Haxe applications have a static entry point called main"], + + ["keyword", "static"], + ["keyword", "function"], + ["function", "main"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + + ["comment", "// Anonymous structures."], + + ["keyword", "var"], + " playerA ", + ["operator", "="], + ["punctuation", "{"], + " name", + ["operator", ":"], + ["string", "\"Simon\""], + ["punctuation", ","], + " move", + ["operator", ":"], + ["class-name", "Paper"], + ["punctuation", "}"], + + ["keyword", "var"], + " playerB ", + ["operator", "="], + ["punctuation", "{"], + " name", + ["operator", ":"], + ["string", "\"Nicolas\""], + ["punctuation", ","], + " move", + ["operator", ":"], + ["class-name", "Rock"], + ["punctuation", "}"], + + ["comment", "// Array pattern matching. A switch can return a value."], + + ["keyword", "var"], + " result ", + ["operator", "="], + ["keyword", "switch"], + ["punctuation", "["], + "playerA", + ["punctuation", "."], + "move", + ["punctuation", ","], + " playerB", + ["punctuation", "."], + "move", + ["punctuation", "]"], + ["punctuation", "{"], + + ["keyword", "case"], + ["punctuation", "["], + ["class-name", "Rock"], + ["punctuation", ","], + ["class-name", "Scissors"], + ["punctuation", "]"], + ["operator", "|"], + + ["punctuation", "["], + ["class-name", "Paper"], + ["punctuation", ","], + ["class-name", "Rock"], + ["punctuation", "]"], + ["operator", "|"], + + ["punctuation", "["], + ["class-name", "Scissors"], + ["punctuation", ","], + ["class-name", "Paper"], + ["punctuation", "]"], + ["operator", ":"], + ["class-name", "Winner"], + ["punctuation", "("], + "playerA", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "case"], + ["punctuation", "["], + ["class-name", "Rock"], + ["punctuation", ","], + ["class-name", "Paper"], + ["punctuation", "]"], + ["operator", "|"], + + ["punctuation", "["], + ["class-name", "Paper"], + ["punctuation", ","], + ["class-name", "Scissors"], + ["punctuation", "]"], + ["operator", "|"], + + ["punctuation", "["], + ["class-name", "Scissors"], + ["punctuation", ","], + ["class-name", "Rock"], + ["punctuation", "]"], + ["operator", ":"], + ["class-name", "Winner"], + ["punctuation", "("], + "playerB", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "case"], + " _", + ["operator", ":"], + ["class-name", "Draw"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["comment", "// Paper vs Rock, who wins?"], + + ["function", "trace"], + ["punctuation", "("], + ["string-interpolation", [ + ["string", "'result: "], + ["interpolation", [ + ["interpolation-punctuation", "$"], + ["expression", ["result"]] + ]], + ["string", "'"] + ]], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"] +] diff --git a/tests/languages/haxe/function_feature.test b/tests/languages/haxe/function_feature.test new file mode 100644 index 0000000000..d71fda5899 --- /dev/null +++ b/tests/languages/haxe/function_feature.test @@ -0,0 +1,37 @@ +foo() +foo () +function identity(arg:T):T { + return arg; +} + +---------------------------------------------------- + +[ + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "function"], + ["function", "identity"], + ["operator", "<"], + ["class-name", "T"], + ["operator", ">"], + ["punctuation", "("], + "arg", + ["operator", ":"], + ["class-name", "T"], + ["punctuation", ")"], + ["operator", ":"], + ["class-name", "T"], + ["punctuation", "{"], + + ["keyword", "return"], + " arg", + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/haxe/keyword_feature.test b/tests/languages/haxe/keyword_feature.test index 6a26bd0962..6c825015eb 100644 --- a/tests/languages/haxe/keyword_feature.test +++ b/tests/languages/haxe/keyword_feature.test @@ -1,93 +1,103 @@ -this -abstract -as -break -case -cast -catch -class -continue -default -do -dynamic -else -enum -extends -extern -from -for -function -if -implements -import -in -inline -interface -macro -new -null -override -public -private -return -static -super -switch -throw -to -try -typedef -using -var -while +abstract; +as; +break; +case; +cast; +catch; +class; +continue; +default; +do; +dynamic; +else; +enum; +extends; +extern; +final; +for; +from; +function; +if; +implements; +import; +in; +inline; +interface; +macro; +new; +null; +operator; +overload; +override; +package; +private; +public; +return; +static; +super; +switch; +this; +throw; +to; +try; +typedef; +untyped; +using; +var; +while; ---------------------------------------------------- [ - ["keyword", "this"], - ["keyword", "abstract"], - ["keyword", "as"], - ["keyword", "break"], - ["keyword", "case"], - ["keyword", "cast"], - ["keyword", "catch"], - ["keyword", "class"], - ["keyword", "continue"], - ["keyword", "default"], - ["keyword", "do"], - ["keyword", "dynamic"], - ["keyword", "else"], - ["keyword", "enum"], - ["keyword", "extends"], - ["keyword", "extern"], - ["keyword", "from"], - ["keyword", "for"], - ["keyword", "function"], - ["keyword", "if"], - ["keyword", "implements"], - ["keyword", "import"], - ["keyword", "in"], - ["keyword", "inline"], - ["keyword", "interface"], - ["keyword", "macro"], - ["keyword", "new"], - ["keyword", "null"], - ["keyword", "override"], - ["keyword", "public"], - ["keyword", "private"], - ["keyword", "return"], - ["keyword", "static"], - ["keyword", "super"], - ["keyword", "switch"], - ["keyword", "throw"], - ["keyword", "to"], - ["keyword", "try"], - ["keyword", "typedef"], - ["keyword", "using"], - ["keyword", "var"], - ["keyword", "while"] + ["keyword", "abstract"], ["punctuation", ";"], + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "case"], ["punctuation", ";"], + ["keyword", "cast"], ["punctuation", ";"], + ["keyword", "catch"], ["punctuation", ";"], + ["keyword", "class"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "default"], ["punctuation", ";"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "dynamic"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "extends"], ["punctuation", ";"], + ["keyword", "extern"], ["punctuation", ";"], + ["keyword", "final"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "from"], ["punctuation", ";"], + ["keyword", "function"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "implements"], ["punctuation", ";"], + ["keyword", "import"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "inline"], ["punctuation", ";"], + ["keyword", "interface"], ["punctuation", ";"], + ["keyword", "macro"], ["punctuation", ";"], + ["keyword", "new"], ["punctuation", ";"], + ["keyword", "null"], ["punctuation", ";"], + ["keyword", "operator"], ["punctuation", ";"], + ["keyword", "overload"], ["punctuation", ";"], + ["keyword", "override"], ["punctuation", ";"], + ["keyword", "package"], ["punctuation", ";"], + ["keyword", "private"], ["punctuation", ";"], + ["keyword", "public"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "super"], ["punctuation", ";"], + ["keyword", "switch"], ["punctuation", ";"], + ["keyword", "this"], ["punctuation", ";"], + ["keyword", "throw"], ["punctuation", ";"], + ["keyword", "to"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "typedef"], ["punctuation", ";"], + ["keyword", "untyped"], ["punctuation", ";"], + ["keyword", "using"], ["punctuation", ";"], + ["keyword", "var"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"] ] ---------------------------------------------------- -Checks for keywords. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/haxe/metadata_feature.test b/tests/languages/haxe/metadata_feature.test index 312114d9a5..4e6d71d42e 100644 --- a/tests/languages/haxe/metadata_feature.test +++ b/tests/languages/haxe/metadata_feature.test @@ -5,11 +5,16 @@ ---------------------------------------------------- [ - ["metadata", "@author"], ["punctuation", "("], ["string", ["\"Nicolas\""]], ["punctuation", ")"], + ["metadata", "@author"], + ["punctuation", "("], + ["string", "\"Nicolas\""], + ["punctuation", ")"], + ["metadata", "@debug"], + ["metadata", "@:noCompletion"] ] ---------------------------------------------------- -Checks for metadata. \ No newline at end of file +Checks for metadata. diff --git a/tests/languages/haxe/number_feature.test b/tests/languages/haxe/number_feature.test new file mode 100644 index 0000000000..9146451632 --- /dev/null +++ b/tests/languages/haxe/number_feature.test @@ -0,0 +1,15 @@ +42 +0xFF42 +0.32 +3. +2.1e5 + +---------------------------------------------------- + +[ + ["number", "42"], + ["number", "0xFF42"], + ["number", "0.32"], + ["number", "3."], + ["number", "2.1e5"] +] diff --git a/tests/languages/haxe/operator_feature.test b/tests/languages/haxe/operator_feature.test index 6963f80066..56049b8d79 100644 --- a/tests/languages/haxe/operator_feature.test +++ b/tests/languages/haxe/operator_feature.test @@ -1,29 +1,72 @@ ++ - * / % ++= -= *= /= %= +++ -- + +== != < <= > >= +! && || + +& | << >> >>> ^ ~ +&= |= <<= >>= >>>= ^= + +? : + += +-> +=> ... -+ ++ -- -- -> -= == -! != -& && -| || -< <= << -> >= >> -* / % ~ ^ ---------------------------------------------------- [ - ["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", ">="], + + ["operator", "!"], + ["operator", "&&"], + ["operator", "||"], + + ["operator", "&"], + ["operator", "|"], + ["operator", "<<"], + ["operator", ">>"], + ["operator", ">>>"], + ["operator", "^"], + ["operator", "~"], + + ["operator", "&="], + ["operator", "|="], + ["operator", "<<="], + ["operator", ">>="], + ["operator", ">>>="], + ["operator", "^="], + + ["operator", "?"], ["operator", ":"], + + ["operator", "="], + ["operator", "->"], + ["operator", "=>"], + ["operator", "..."] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/haxe/preprocessor_feature.test b/tests/languages/haxe/preprocessor_feature.test index 3cadacf654..2697f22a11 100644 --- a/tests/languages/haxe/preprocessor_feature.test +++ b/tests/languages/haxe/preprocessor_feature.test @@ -3,15 +3,69 @@ #else #end +class Main { + public static function main() { + #if !debug + trace("ok"); + #elseif (debug_level > 3) + trace(3); + #else + trace("debug level too low"); + #end + } +} + ---------------------------------------------------- [ ["preprocessor", "#if"], ["preprocessor", "#elseif"], ["preprocessor", "#else"], - ["preprocessor", "#end"] + ["preprocessor", "#end"], + + ["keyword", "class"], + ["class-name", "Main"], + ["punctuation", "{"], + + ["keyword", "public"], + ["keyword", "static"], + ["keyword", "function"], + ["function", "main"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + + ["preprocessor", "#if !debug"], + + ["function", "trace"], + ["punctuation", "("], + ["string", "\"ok\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["preprocessor", "#elseif (debug_level > 3)"], + + ["function", "trace"], + ["punctuation", "("], + ["number", "3"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["preprocessor", "#else"], + + ["function", "trace"], + ["punctuation", "("], + ["string", "\"debug level too low\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["preprocessor", "#end"], + + ["punctuation", "}"], + + ["punctuation", "}"] ] ---------------------------------------------------- -Checks for preprocessor directives. \ No newline at end of file +Checks for preprocessor directives. diff --git a/tests/languages/haxe/punctuation_feature.test b/tests/languages/haxe/punctuation_feature.test new file mode 100644 index 0000000000..472d052f1b --- /dev/null +++ b/tests/languages/haxe/punctuation_feature.test @@ -0,0 +1,17 @@ +( ) [ ] { } +, ; . + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."] +] diff --git a/tests/languages/haxe/regex_feature.test b/tests/languages/haxe/regex_feature.test index 577cab7b9a..1c8ef7fc39 100644 --- a/tests/languages/haxe/regex_feature.test +++ b/tests/languages/haxe/regex_feature.test @@ -5,11 +5,26 @@ ---------------------------------------------------- [ - ["regex", "~/ha\\/xe/i"], - ["regex", "~/[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z][A-Z][A-Z]?/i"], - ["regex", "~/(dog|fox)/igmsu"] + ["regex", [ + ["regex-delimiter", "~/"], + ["regex-source", "ha\\/xe"], + ["regex-delimiter", "/"], + ["regex-flags", "i"] + ]], + ["regex", [ + ["regex-delimiter", "~/"], + ["regex-source", "[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z][A-Z][A-Z]?"], + ["regex-delimiter", "/"], + ["regex-flags", "i"] + ]], + ["regex", [ + ["regex-delimiter", "~/"], + ["regex-source", "(dog|fox)"], + ["regex-delimiter", "/"], + ["regex-flags", "igmsu"] + ]] ] ---------------------------------------------------- -Checks for regexes. \ No newline at end of file +Checks for regexes. diff --git a/tests/languages/haxe/string_feature.test b/tests/languages/haxe/string_feature.test index 61f1985fcc..ec3393c142 100644 --- a/tests/languages/haxe/string_feature.test +++ b/tests/languages/haxe/string_feature.test @@ -2,36 +2,62 @@ "Foo \"bar\" baz" -"$bar ${4+2}" '' 'Foo \'bar\' baz' +'$bar ${4+2}' +'The sum of $x and 3 is ${x + 3}' ---------------------------------------------------- [ - ["string", ["\"\""]], - ["string", ["\"Foo\r\n\\\"bar\\\"\r\nbaz\""]], - ["string", [ - "\"", + ["string", "\"\""], + ["string", "\"Foo\r\n\\\"bar\\\"\r\nbaz\""], + ["string-interpolation", [ + ["string", "''"] + ]], + ["string-interpolation", [ + ["string", "'Foo\r\n\\'bar\\'\r\nbaz'"] + ]], + ["string-interpolation", [ + ["string", "'"], ["interpolation", [ - ["interpolation", "$bar"] + ["interpolation-punctuation", "$"], + ["expression", ["bar"]] ]], + ["string", " "], ["interpolation", [ - ["interpolation", "$"], - ["punctuation", "{"], - ["number", "4"], - ["operator", "+"], - ["number", "2"], - ["punctuation", "}"] + ["interpolation-punctuation", "${"], + ["expression", [ + ["number", "4"], + ["operator", "+"], + ["number", "2"] + ]], + ["interpolation-punctuation", "}"] ]], - "\"" + ["string", "'"] ]], - ["string", ["''"]], - ["string", ["'Foo\r\n\\'bar\\'\r\nbaz'"]] + ["string-interpolation", [ + ["string", "'The sum of "], + ["interpolation", [ + ["interpolation-punctuation", "$"], + ["expression", ["x"]] + ]], + ["string", " and 3 is "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", [ + "x ", + ["operator", "+"], + ["number", "3"] + ]], + ["interpolation-punctuation", "}"] + ]], + ["string", "'"] + ]] ] ---------------------------------------------------- -Checks for strings and string interpolation. \ No newline at end of file +Checks for strings and string interpolation. diff --git a/tests/languages/hcl/interpolation_feature.test b/tests/languages/hcl/interpolation_feature.test index fc2b9b79f6..0a8f50eb37 100644 --- a/tests/languages/hcl/interpolation_feature.test +++ b/tests/languages/hcl/interpolation_feature.test @@ -8,199 +8,246 @@ "${replace(var.sub_domain, ".", "\\\\\\\\.")}" "${filepath.foo}" +// keywords +"${terraform}" +"${var}" +"${self}" +"${count}" +"${module}" +"${path}" +"${data}" +"${local}" + ---------------------------------------------------- [ - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["keyword", "data"], - ["punctuation", "."], - ["type", "aws_availability_zones"], - ["punctuation", "."], - "available", - ["punctuation", "."], - "names", - ["punctuation", "["], - ["number", "0"], - ["punctuation", "]"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - "aws_db_subnet_group", - ["punctuation", "."], - "default", - ["punctuation", "."], - "id", - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["keyword", "var"], - ["punctuation", "."], - ["type", "something"], - ["punctuation", "?"], - ["number", "1"], - ["punctuation", ":"], - ["number", "0"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["keyword", "var"], - ["punctuation", "."], - ["type", "num"], - ["punctuation", "?"], - ["number", "1.02"], - ["punctuation", ":"], - ["number", "0"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "length"], - ["punctuation", "("], - ["keyword", "var"], - ["punctuation", "."], - ["type", "hostnames"], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "format"], - ["punctuation", "("], - ["string", "\"web-%03d\""], - ["punctuation", ","], - ["keyword", "count"], - ["punctuation", "."], - ["type", "index"], - ["punctuation", "+"], - ["number", "1"], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "file"], - ["punctuation", "("], - ["string", "\"templates/web_init.tpl\""], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "replace"], - ["punctuation", "("], - ["keyword", "var"], - ["punctuation", "."], - ["type", "sub_domain"], - ["punctuation", ","], - ["string", "\".\""], - ["punctuation", ","], - ["string", "\"\\\\\\\\\\\\\\\\.\""], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - "filepath", - ["punctuation", "."], - "foo", - ["punctuation", "}"] - ] - ], - "\"" - ] - ] + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "data"], + ["punctuation", "."], + ["type", "aws_availability_zones"], + ["punctuation", "."], + "available", + ["punctuation", "."], + "names", + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + "aws_db_subnet_group", + ["punctuation", "."], + "default", + ["punctuation", "."], + "id", + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "var"], + ["punctuation", "."], + ["type", "something"], + ["punctuation", "?"], + ["number", "1"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "var"], + ["punctuation", "."], + ["type", "num"], + ["punctuation", "?"], + ["number", "1.02"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "length"], + ["punctuation", "("], + ["keyword", "var"], + ["punctuation", "."], + ["type", "hostnames"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "format"], + ["punctuation", "("], + ["string", "\"web-%03d\""], + ["punctuation", ","], + ["keyword", "count"], + ["punctuation", "."], + ["type", "index"], + ["punctuation", "+"], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "file"], + ["punctuation", "("], + ["string", "\"templates/web_init.tpl\""], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "replace"], + ["punctuation", "("], + ["keyword", "var"], + ["punctuation", "."], + ["type", "sub_domain"], + ["punctuation", ","], + ["string", "\".\""], + ["punctuation", ","], + ["string", "\"\\\\\\\\\\\\\\\\.\""], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + "filepath", + ["punctuation", "."], + "foo", + ["punctuation", "}"] + ]], + "\"" + ]], + + ["comment", "// keywords"], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "terraform"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "var"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "self"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "count"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "module"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "path"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "data"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "local"], + ["punctuation", "}"] + ]], + "\"" + ]] ] ---------------------------------------------------- -Checks for all interpolation. \ No newline at end of file +Checks for all interpolation. diff --git a/tests/languages/hlsl/keyword_feature.test b/tests/languages/hlsl/keyword_feature.test index 9af9d38290..6365cd28ed 100644 --- a/tests/languages/hlsl/keyword_feature.test +++ b/tests/languages/hlsl/keyword_feature.test @@ -1,709 +1,709 @@ -asm -asm_fragment -auto -break -case -catch -cbuffer -centroid -char -class -column_major -compile -compile_fragment -const -const_cast -continue -default -delete -discard -do -dynamic_cast -else -enum -explicit -export -extern -for -friend -fxgroup -goto -groupshared -if -in -inline -inout -interface -line -lineadj -linear -long -matrix -mutable -namespace -new -nointerpolation -noperspective -operator -out -packoffset -pass -pixelfragment -point -precise -private -protected -public -register -reinterpret_cast -return -row_major -sample -sampler -shared -short -signed -sizeof -snorm -stateblock -stateblock_state -static -static_cast -string -struct -switch -tbuffer -technique -technique10 -technique11 -template -texture -this -throw -triangle -triangleadj -try -typedef -typename -uniform -union -unorm -unsigned -using -vector -vertexfragment -virtual -void -volatile -while - -bool -bool1 -bool1x1 -bool1x2 -bool1x3 -bool1x4 -bool2 -bool2x1 -bool2x2 -bool2x3 -bool2x4 -bool3 -bool3x1 -bool3x2 -bool3x3 -bool3x4 -bool4 -bool4x1 -bool4x2 -bool4x3 -bool4x4 -double -double1 -double1x1 -double1x2 -double1x3 -double1x4 -double2 -double2x1 -double2x2 -double2x3 -double2x4 -double3 -double3x1 -double3x2 -double3x3 -double3x4 -double4 -double4x1 -double4x2 -double4x3 -double4x4 -dword -dword1 -dword1x1 -dword1x2 -dword1x3 -dword1x4 -dword2 -dword2x1 -dword2x2 -dword2x3 -dword2x4 -dword3 -dword3x1 -dword3x2 -dword3x3 -dword3x4 -dword4 -dword4x1 -dword4x2 -dword4x3 -dword4x4 -float -float1 -float1x1 -float1x2 -float1x3 -float1x4 -float2 -float2x1 -float2x2 -float2x3 -float2x4 -float3 -float3x1 -float3x2 -float3x3 -float3x4 -float4 -float4x1 -float4x2 -float4x3 -float4x4 -half -half1 -half1x1 -half1x2 -half1x3 -half1x4 -half2 -half2x1 -half2x2 -half2x3 -half2x4 -half3 -half3x1 -half3x2 -half3x3 -half3x4 -half4 -half4x1 -half4x2 -half4x3 -half4x4 -int -int1 -int1x1 -int1x2 -int1x3 -int1x4 -int2 -int2x1 -int2x2 -int2x3 -int2x4 -int3 -int3x1 -int3x2 -int3x3 -int3x4 -int4 -int4x1 -int4x2 -int4x3 -int4x4 -min10float -min10float1 -min10float1x1 -min10float1x2 -min10float1x3 -min10float1x4 -min10float2 -min10float2x1 -min10float2x2 -min10float2x3 -min10float2x4 -min10float3 -min10float3x1 -min10float3x2 -min10float3x3 -min10float3x4 -min10float4 -min10float4x1 -min10float4x2 -min10float4x3 -min10float4x4 -min12int -min12int1 -min12int1x1 -min12int1x2 -min12int1x3 -min12int1x4 -min12int2 -min12int2x1 -min12int2x2 -min12int2x3 -min12int2x4 -min12int3 -min12int3x1 -min12int3x2 -min12int3x3 -min12int3x4 -min12int4 -min12int4x1 -min12int4x2 -min12int4x3 -min12int4x4 -min16float -min16float1 -min16float1x1 -min16float1x2 -min16float1x3 -min16float1x4 -min16float2 -min16float2x1 -min16float2x2 -min16float2x3 -min16float2x4 -min16float3 -min16float3x1 -min16float3x2 -min16float3x3 -min16float3x4 -min16float4 -min16float4x1 -min16float4x2 -min16float4x3 -min16float4x4 -min16int -min16int1 -min16int1x1 -min16int1x2 -min16int1x3 -min16int1x4 -min16int2 -min16int2x1 -min16int2x2 -min16int2x3 -min16int2x4 -min16int3 -min16int3x1 -min16int3x2 -min16int3x3 -min16int3x4 -min16int4 -min16int4x1 -min16int4x2 -min16int4x3 -min16int4x4 -min16uint -min16uint1 -min16uint1x1 -min16uint1x2 -min16uint1x3 -min16uint1x4 -min16uint2 -min16uint2x1 -min16uint2x2 -min16uint2x3 -min16uint2x4 -min16uint3 -min16uint3x1 -min16uint3x2 -min16uint3x3 -min16uint3x4 -min16uint4 -min16uint4x1 -min16uint4x2 -min16uint4x3 -min16uint4x4 -uint -uint1 -uint1x1 -uint1x2 -uint1x3 -uint1x4 -uint2 -uint2x1 -uint2x2 -uint2x3 -uint2x4 -uint3 -uint3x1 -uint3x2 -uint3x3 -uint3x4 -uint4 -uint4x1 -uint4x2 -uint4x3 -uint4x4 +asm; +asm_fragment; +auto; +break; +case; +catch; +cbuffer; +centroid; +char; +class; +column_major; +compile; +compile_fragment; +const; +const_cast; +continue; +default; +delete; +discard; +do; +dynamic_cast; +else; +enum; +explicit; +export; +extern; +for; +friend; +fxgroup; +goto; +groupshared; +if; +in; +inline; +inout; +interface; +line; +lineadj; +linear; +long; +matrix; +mutable; +namespace; +new; +nointerpolation; +noperspective; +operator; +out; +packoffset; +pass; +pixelfragment; +point; +precise; +private; +protected; +public; +register; +reinterpret_cast; +return; +row_major; +sample; +sampler; +shared; +short; +signed; +sizeof; +snorm; +stateblock; +stateblock_state; +static; +static_cast; +string; +struct; +switch; +tbuffer; +technique; +technique10; +technique11; +template; +texture; +this; +throw; +triangle; +triangleadj; +try; +typedef; +typename; +uniform; +union; +unorm; +unsigned; +using; +vector; +vertexfragment; +virtual; +void; +volatile; +while; +; +bool; +bool1; +bool1x1; +bool1x2; +bool1x3; +bool1x4; +bool2; +bool2x1; +bool2x2; +bool2x3; +bool2x4; +bool3; +bool3x1; +bool3x2; +bool3x3; +bool3x4; +bool4; +bool4x1; +bool4x2; +bool4x3; +bool4x4; +double; +double1; +double1x1; +double1x2; +double1x3; +double1x4; +double2; +double2x1; +double2x2; +double2x3; +double2x4; +double3; +double3x1; +double3x2; +double3x3; +double3x4; +double4; +double4x1; +double4x2; +double4x3; +double4x4; +dword; +dword1; +dword1x1; +dword1x2; +dword1x3; +dword1x4; +dword2; +dword2x1; +dword2x2; +dword2x3; +dword2x4; +dword3; +dword3x1; +dword3x2; +dword3x3; +dword3x4; +dword4; +dword4x1; +dword4x2; +dword4x3; +dword4x4; +float; +float1; +float1x1; +float1x2; +float1x3; +float1x4; +float2; +float2x1; +float2x2; +float2x3; +float2x4; +float3; +float3x1; +float3x2; +float3x3; +float3x4; +float4; +float4x1; +float4x2; +float4x3; +float4x4; +half; +half1; +half1x1; +half1x2; +half1x3; +half1x4; +half2; +half2x1; +half2x2; +half2x3; +half2x4; +half3; +half3x1; +half3x2; +half3x3; +half3x4; +half4; +half4x1; +half4x2; +half4x3; +half4x4; +int; +int1; +int1x1; +int1x2; +int1x3; +int1x4; +int2; +int2x1; +int2x2; +int2x3; +int2x4; +int3; +int3x1; +int3x2; +int3x3; +int3x4; +int4; +int4x1; +int4x2; +int4x3; +int4x4; +min10float; +min10float1; +min10float1x1; +min10float1x2; +min10float1x3; +min10float1x4; +min10float2; +min10float2x1; +min10float2x2; +min10float2x3; +min10float2x4; +min10float3; +min10float3x1; +min10float3x2; +min10float3x3; +min10float3x4; +min10float4; +min10float4x1; +min10float4x2; +min10float4x3; +min10float4x4; +min12int; +min12int1; +min12int1x1; +min12int1x2; +min12int1x3; +min12int1x4; +min12int2; +min12int2x1; +min12int2x2; +min12int2x3; +min12int2x4; +min12int3; +min12int3x1; +min12int3x2; +min12int3x3; +min12int3x4; +min12int4; +min12int4x1; +min12int4x2; +min12int4x3; +min12int4x4; +min16float; +min16float1; +min16float1x1; +min16float1x2; +min16float1x3; +min16float1x4; +min16float2; +min16float2x1; +min16float2x2; +min16float2x3; +min16float2x4; +min16float3; +min16float3x1; +min16float3x2; +min16float3x3; +min16float3x4; +min16float4; +min16float4x1; +min16float4x2; +min16float4x3; +min16float4x4; +min16int; +min16int1; +min16int1x1; +min16int1x2; +min16int1x3; +min16int1x4; +min16int2; +min16int2x1; +min16int2x2; +min16int2x3; +min16int2x4; +min16int3; +min16int3x1; +min16int3x2; +min16int3x3; +min16int3x4; +min16int4; +min16int4x1; +min16int4x2; +min16int4x3; +min16int4x4; +min16uint; +min16uint1; +min16uint1x1; +min16uint1x2; +min16uint1x3; +min16uint1x4; +min16uint2; +min16uint2x1; +min16uint2x2; +min16uint2x3; +min16uint2x4; +min16uint3; +min16uint3x1; +min16uint3x2; +min16uint3x3; +min16uint3x4; +min16uint4; +min16uint4x1; +min16uint4x2; +min16uint4x3; +min16uint4x4; +uint; +uint1; +uint1x1; +uint1x2; +uint1x3; +uint1x4; +uint2; +uint2x1; +uint2x2; +uint2x3; +uint2x4; +uint3; +uint3x1; +uint3x2; +uint3x3; +uint3x4; +uint4; +uint4x1; +uint4x2; +uint4x3; +uint4x4; ---------------------------------------------------- [ - ["keyword", "asm"], - ["keyword", "asm_fragment"], - ["keyword", "auto"], - ["keyword", "break"], - ["keyword", "case"], - ["keyword", "catch"], - ["keyword", "cbuffer"], - ["keyword", "centroid"], - ["keyword", "char"], - ["keyword", "class"], - ["keyword", "column_major"], - ["keyword", "compile"], - ["keyword", "compile_fragment"], - ["keyword", "const"], - ["keyword", "const_cast"], - ["keyword", "continue"], - ["keyword", "default"], - ["keyword", "delete"], - ["keyword", "discard"], - ["keyword", "do"], - ["keyword", "dynamic_cast"], - ["keyword", "else"], - ["keyword", "enum"], - ["class-name", "explicit"], - ["keyword", "export"], - ["keyword", "extern"], - ["keyword", "for"], - ["keyword", "friend"], - ["keyword", "fxgroup"], - ["keyword", "goto"], - ["keyword", "groupshared"], - ["keyword", "if"], - ["keyword", "in"], - ["keyword", "inline"], - ["keyword", "inout"], - ["keyword", "interface"], - ["keyword", "line"], - ["keyword", "lineadj"], - ["keyword", "linear"], - ["keyword", "long"], - ["keyword", "matrix"], - ["keyword", "mutable"], - ["keyword", "namespace"], - ["keyword", "new"], - ["keyword", "nointerpolation"], - ["keyword", "noperspective"], - ["keyword", "operator"], - ["keyword", "out"], - ["keyword", "packoffset"], - ["keyword", "pass"], - ["keyword", "pixelfragment"], - ["keyword", "point"], - ["keyword", "precise"], - ["keyword", "private"], - ["keyword", "protected"], - ["keyword", "public"], - ["keyword", "register"], - ["keyword", "reinterpret_cast"], - ["keyword", "return"], - ["keyword", "row_major"], - ["keyword", "sample"], - ["keyword", "sampler"], - ["keyword", "shared"], - ["keyword", "short"], - ["keyword", "signed"], - ["keyword", "sizeof"], - ["keyword", "snorm"], - ["keyword", "stateblock"], - ["keyword", "stateblock_state"], - ["keyword", "static"], - ["keyword", "static_cast"], - ["keyword", "string"], - ["keyword", "struct"], - ["class-name", "switch"], - ["keyword", "tbuffer"], - ["keyword", "technique"], - ["keyword", "technique10"], - ["keyword", "technique11"], - ["keyword", "template"], - ["keyword", "texture"], - ["keyword", "this"], - ["keyword", "throw"], - ["keyword", "triangle"], - ["keyword", "triangleadj"], - ["keyword", "try"], - ["keyword", "typedef"], - ["keyword", "typename"], - ["keyword", "uniform"], - ["keyword", "union"], - ["keyword", "unorm"], - ["keyword", "unsigned"], - ["keyword", "using"], - ["keyword", "vector"], - ["keyword", "vertexfragment"], - ["keyword", "virtual"], - ["keyword", "void"], - ["keyword", "volatile"], - ["keyword", "while"], - - ["keyword", "bool"], - ["keyword", "bool1"], - ["keyword", "bool1x1"], - ["keyword", "bool1x2"], - ["keyword", "bool1x3"], - ["keyword", "bool1x4"], - ["keyword", "bool2"], - ["keyword", "bool2x1"], - ["keyword", "bool2x2"], - ["keyword", "bool2x3"], - ["keyword", "bool2x4"], - ["keyword", "bool3"], - ["keyword", "bool3x1"], - ["keyword", "bool3x2"], - ["keyword", "bool3x3"], - ["keyword", "bool3x4"], - ["keyword", "bool4"], - ["keyword", "bool4x1"], - ["keyword", "bool4x2"], - ["keyword", "bool4x3"], - ["keyword", "bool4x4"], - ["keyword", "double"], - ["keyword", "double1"], - ["keyword", "double1x1"], - ["keyword", "double1x2"], - ["keyword", "double1x3"], - ["keyword", "double1x4"], - ["keyword", "double2"], - ["keyword", "double2x1"], - ["keyword", "double2x2"], - ["keyword", "double2x3"], - ["keyword", "double2x4"], - ["keyword", "double3"], - ["keyword", "double3x1"], - ["keyword", "double3x2"], - ["keyword", "double3x3"], - ["keyword", "double3x4"], - ["keyword", "double4"], - ["keyword", "double4x1"], - ["keyword", "double4x2"], - ["keyword", "double4x3"], - ["keyword", "double4x4"], - ["keyword", "dword"], - ["keyword", "dword1"], - ["keyword", "dword1x1"], - ["keyword", "dword1x2"], - ["keyword", "dword1x3"], - ["keyword", "dword1x4"], - ["keyword", "dword2"], - ["keyword", "dword2x1"], - ["keyword", "dword2x2"], - ["keyword", "dword2x3"], - ["keyword", "dword2x4"], - ["keyword", "dword3"], - ["keyword", "dword3x1"], - ["keyword", "dword3x2"], - ["keyword", "dword3x3"], - ["keyword", "dword3x4"], - ["keyword", "dword4"], - ["keyword", "dword4x1"], - ["keyword", "dword4x2"], - ["keyword", "dword4x3"], - ["keyword", "dword4x4"], - ["keyword", "float"], - ["keyword", "float1"], - ["keyword", "float1x1"], - ["keyword", "float1x2"], - ["keyword", "float1x3"], - ["keyword", "float1x4"], - ["keyword", "float2"], - ["keyword", "float2x1"], - ["keyword", "float2x2"], - ["keyword", "float2x3"], - ["keyword", "float2x4"], - ["keyword", "float3"], - ["keyword", "float3x1"], - ["keyword", "float3x2"], - ["keyword", "float3x3"], - ["keyword", "float3x4"], - ["keyword", "float4"], - ["keyword", "float4x1"], - ["keyword", "float4x2"], - ["keyword", "float4x3"], - ["keyword", "float4x4"], - ["keyword", "half"], - ["keyword", "half1"], - ["keyword", "half1x1"], - ["keyword", "half1x2"], - ["keyword", "half1x3"], - ["keyword", "half1x4"], - ["keyword", "half2"], - ["keyword", "half2x1"], - ["keyword", "half2x2"], - ["keyword", "half2x3"], - ["keyword", "half2x4"], - ["keyword", "half3"], - ["keyword", "half3x1"], - ["keyword", "half3x2"], - ["keyword", "half3x3"], - ["keyword", "half3x4"], - ["keyword", "half4"], - ["keyword", "half4x1"], - ["keyword", "half4x2"], - ["keyword", "half4x3"], - ["keyword", "half4x4"], - ["keyword", "int"], - ["keyword", "int1"], - ["keyword", "int1x1"], - ["keyword", "int1x2"], - ["keyword", "int1x3"], - ["keyword", "int1x4"], - ["keyword", "int2"], - ["keyword", "int2x1"], - ["keyword", "int2x2"], - ["keyword", "int2x3"], - ["keyword", "int2x4"], - ["keyword", "int3"], - ["keyword", "int3x1"], - ["keyword", "int3x2"], - ["keyword", "int3x3"], - ["keyword", "int3x4"], - ["keyword", "int4"], - ["keyword", "int4x1"], - ["keyword", "int4x2"], - ["keyword", "int4x3"], - ["keyword", "int4x4"], - ["keyword", "min10float"], - ["keyword", "min10float1"], - ["keyword", "min10float1x1"], - ["keyword", "min10float1x2"], - ["keyword", "min10float1x3"], - ["keyword", "min10float1x4"], - ["keyword", "min10float2"], - ["keyword", "min10float2x1"], - ["keyword", "min10float2x2"], - ["keyword", "min10float2x3"], - ["keyword", "min10float2x4"], - ["keyword", "min10float3"], - ["keyword", "min10float3x1"], - ["keyword", "min10float3x2"], - ["keyword", "min10float3x3"], - ["keyword", "min10float3x4"], - ["keyword", "min10float4"], - ["keyword", "min10float4x1"], - ["keyword", "min10float4x2"], - ["keyword", "min10float4x3"], - ["keyword", "min10float4x4"], - ["keyword", "min12int"], - ["keyword", "min12int1"], - ["keyword", "min12int1x1"], - ["keyword", "min12int1x2"], - ["keyword", "min12int1x3"], - ["keyword", "min12int1x4"], - ["keyword", "min12int2"], - ["keyword", "min12int2x1"], - ["keyword", "min12int2x2"], - ["keyword", "min12int2x3"], - ["keyword", "min12int2x4"], - ["keyword", "min12int3"], - ["keyword", "min12int3x1"], - ["keyword", "min12int3x2"], - ["keyword", "min12int3x3"], - ["keyword", "min12int3x4"], - ["keyword", "min12int4"], - ["keyword", "min12int4x1"], - ["keyword", "min12int4x2"], - ["keyword", "min12int4x3"], - ["keyword", "min12int4x4"], - ["keyword", "min16float"], - ["keyword", "min16float1"], - ["keyword", "min16float1x1"], - ["keyword", "min16float1x2"], - ["keyword", "min16float1x3"], - ["keyword", "min16float1x4"], - ["keyword", "min16float2"], - ["keyword", "min16float2x1"], - ["keyword", "min16float2x2"], - ["keyword", "min16float2x3"], - ["keyword", "min16float2x4"], - ["keyword", "min16float3"], - ["keyword", "min16float3x1"], - ["keyword", "min16float3x2"], - ["keyword", "min16float3x3"], - ["keyword", "min16float3x4"], - ["keyword", "min16float4"], - ["keyword", "min16float4x1"], - ["keyword", "min16float4x2"], - ["keyword", "min16float4x3"], - ["keyword", "min16float4x4"], - ["keyword", "min16int"], - ["keyword", "min16int1"], - ["keyword", "min16int1x1"], - ["keyword", "min16int1x2"], - ["keyword", "min16int1x3"], - ["keyword", "min16int1x4"], - ["keyword", "min16int2"], - ["keyword", "min16int2x1"], - ["keyword", "min16int2x2"], - ["keyword", "min16int2x3"], - ["keyword", "min16int2x4"], - ["keyword", "min16int3"], - ["keyword", "min16int3x1"], - ["keyword", "min16int3x2"], - ["keyword", "min16int3x3"], - ["keyword", "min16int3x4"], - ["keyword", "min16int4"], - ["keyword", "min16int4x1"], - ["keyword", "min16int4x2"], - ["keyword", "min16int4x3"], - ["keyword", "min16int4x4"], - ["keyword", "min16uint"], - ["keyword", "min16uint1"], - ["keyword", "min16uint1x1"], - ["keyword", "min16uint1x2"], - ["keyword", "min16uint1x3"], - ["keyword", "min16uint1x4"], - ["keyword", "min16uint2"], - ["keyword", "min16uint2x1"], - ["keyword", "min16uint2x2"], - ["keyword", "min16uint2x3"], - ["keyword", "min16uint2x4"], - ["keyword", "min16uint3"], - ["keyword", "min16uint3x1"], - ["keyword", "min16uint3x2"], - ["keyword", "min16uint3x3"], - ["keyword", "min16uint3x4"], - ["keyword", "min16uint4"], - ["keyword", "min16uint4x1"], - ["keyword", "min16uint4x2"], - ["keyword", "min16uint4x3"], - ["keyword", "min16uint4x4"], - ["keyword", "uint"], - ["keyword", "uint1"], - ["keyword", "uint1x1"], - ["keyword", "uint1x2"], - ["keyword", "uint1x3"], - ["keyword", "uint1x4"], - ["keyword", "uint2"], - ["keyword", "uint2x1"], - ["keyword", "uint2x2"], - ["keyword", "uint2x3"], - ["keyword", "uint2x4"], - ["keyword", "uint3"], - ["keyword", "uint3x1"], - ["keyword", "uint3x2"], - ["keyword", "uint3x3"], - ["keyword", "uint3x4"], - ["keyword", "uint4"], - ["keyword", "uint4x1"], - ["keyword", "uint4x2"], - ["keyword", "uint4x3"], - ["keyword", "uint4x4"] + ["keyword", "asm"], ["punctuation", ";"], + ["keyword", "asm_fragment"], ["punctuation", ";"], + ["keyword", "auto"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "case"], ["punctuation", ";"], + ["keyword", "catch"], ["punctuation", ";"], + ["keyword", "cbuffer"], ["punctuation", ";"], + ["keyword", "centroid"], ["punctuation", ";"], + ["keyword", "char"], ["punctuation", ";"], + ["keyword", "class"], ["punctuation", ";"], + ["keyword", "column_major"], ["punctuation", ";"], + ["keyword", "compile"], ["punctuation", ";"], + ["keyword", "compile_fragment"], ["punctuation", ";"], + ["keyword", "const"], ["punctuation", ";"], + ["keyword", "const_cast"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "default"], ["punctuation", ";"], + ["keyword", "delete"], ["punctuation", ";"], + ["keyword", "discard"], ["punctuation", ";"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "dynamic_cast"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "explicit"], ["punctuation", ";"], + ["keyword", "export"], ["punctuation", ";"], + ["keyword", "extern"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "friend"], ["punctuation", ";"], + ["keyword", "fxgroup"], ["punctuation", ";"], + ["keyword", "goto"], ["punctuation", ";"], + ["keyword", "groupshared"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "inline"], ["punctuation", ";"], + ["keyword", "inout"], ["punctuation", ";"], + ["keyword", "interface"], ["punctuation", ";"], + ["keyword", "line"], ["punctuation", ";"], + ["keyword", "lineadj"], ["punctuation", ";"], + ["keyword", "linear"], ["punctuation", ";"], + ["keyword", "long"], ["punctuation", ";"], + ["keyword", "matrix"], ["punctuation", ";"], + ["keyword", "mutable"], ["punctuation", ";"], + ["keyword", "namespace"], ["punctuation", ";"], + ["keyword", "new"], ["punctuation", ";"], + ["keyword", "nointerpolation"], ["punctuation", ";"], + ["keyword", "noperspective"], ["punctuation", ";"], + ["keyword", "operator"], ["punctuation", ";"], + ["keyword", "out"], ["punctuation", ";"], + ["keyword", "packoffset"], ["punctuation", ";"], + ["keyword", "pass"], ["punctuation", ";"], + ["keyword", "pixelfragment"], ["punctuation", ";"], + ["keyword", "point"], ["punctuation", ";"], + ["keyword", "precise"], ["punctuation", ";"], + ["keyword", "private"], ["punctuation", ";"], + ["keyword", "protected"], ["punctuation", ";"], + ["keyword", "public"], ["punctuation", ";"], + ["keyword", "register"], ["punctuation", ";"], + ["keyword", "reinterpret_cast"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "row_major"], ["punctuation", ";"], + ["keyword", "sample"], ["punctuation", ";"], + ["keyword", "sampler"], ["punctuation", ";"], + ["keyword", "shared"], ["punctuation", ";"], + ["keyword", "short"], ["punctuation", ";"], + ["keyword", "signed"], ["punctuation", ";"], + ["keyword", "sizeof"], ["punctuation", ";"], + ["keyword", "snorm"], ["punctuation", ";"], + ["keyword", "stateblock"], ["punctuation", ";"], + ["keyword", "stateblock_state"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "static_cast"], ["punctuation", ";"], + ["keyword", "string"], ["punctuation", ";"], + ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "switch"], ["punctuation", ";"], + ["keyword", "tbuffer"], ["punctuation", ";"], + ["keyword", "technique"], ["punctuation", ";"], + ["keyword", "technique10"], ["punctuation", ";"], + ["keyword", "technique11"], ["punctuation", ";"], + ["keyword", "template"], ["punctuation", ";"], + ["keyword", "texture"], ["punctuation", ";"], + ["keyword", "this"], ["punctuation", ";"], + ["keyword", "throw"], ["punctuation", ";"], + ["keyword", "triangle"], ["punctuation", ";"], + ["keyword", "triangleadj"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "typedef"], ["punctuation", ";"], + ["keyword", "typename"], ["punctuation", ";"], + ["keyword", "uniform"], ["punctuation", ";"], + ["keyword", "union"], ["punctuation", ";"], + ["keyword", "unorm"], ["punctuation", ";"], + ["keyword", "unsigned"], ["punctuation", ";"], + ["keyword", "using"], ["punctuation", ";"], + ["keyword", "vector"], ["punctuation", ";"], + ["keyword", "vertexfragment"], ["punctuation", ";"], + ["keyword", "virtual"], ["punctuation", ";"], + ["keyword", "void"], ["punctuation", ";"], + ["keyword", "volatile"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["punctuation", ";"], + ["keyword", "bool"], ["punctuation", ";"], + ["keyword", "bool1"], ["punctuation", ";"], + ["keyword", "bool1x1"], ["punctuation", ";"], + ["keyword", "bool1x2"], ["punctuation", ";"], + ["keyword", "bool1x3"], ["punctuation", ";"], + ["keyword", "bool1x4"], ["punctuation", ";"], + ["keyword", "bool2"], ["punctuation", ";"], + ["keyword", "bool2x1"], ["punctuation", ";"], + ["keyword", "bool2x2"], ["punctuation", ";"], + ["keyword", "bool2x3"], ["punctuation", ";"], + ["keyword", "bool2x4"], ["punctuation", ";"], + ["keyword", "bool3"], ["punctuation", ";"], + ["keyword", "bool3x1"], ["punctuation", ";"], + ["keyword", "bool3x2"], ["punctuation", ";"], + ["keyword", "bool3x3"], ["punctuation", ";"], + ["keyword", "bool3x4"], ["punctuation", ";"], + ["keyword", "bool4"], ["punctuation", ";"], + ["keyword", "bool4x1"], ["punctuation", ";"], + ["keyword", "bool4x2"], ["punctuation", ";"], + ["keyword", "bool4x3"], ["punctuation", ";"], + ["keyword", "bool4x4"], ["punctuation", ";"], + ["keyword", "double"], ["punctuation", ";"], + ["keyword", "double1"], ["punctuation", ";"], + ["keyword", "double1x1"], ["punctuation", ";"], + ["keyword", "double1x2"], ["punctuation", ";"], + ["keyword", "double1x3"], ["punctuation", ";"], + ["keyword", "double1x4"], ["punctuation", ";"], + ["keyword", "double2"], ["punctuation", ";"], + ["keyword", "double2x1"], ["punctuation", ";"], + ["keyword", "double2x2"], ["punctuation", ";"], + ["keyword", "double2x3"], ["punctuation", ";"], + ["keyword", "double2x4"], ["punctuation", ";"], + ["keyword", "double3"], ["punctuation", ";"], + ["keyword", "double3x1"], ["punctuation", ";"], + ["keyword", "double3x2"], ["punctuation", ";"], + ["keyword", "double3x3"], ["punctuation", ";"], + ["keyword", "double3x4"], ["punctuation", ";"], + ["keyword", "double4"], ["punctuation", ";"], + ["keyword", "double4x1"], ["punctuation", ";"], + ["keyword", "double4x2"], ["punctuation", ";"], + ["keyword", "double4x3"], ["punctuation", ";"], + ["keyword", "double4x4"], ["punctuation", ";"], + ["keyword", "dword"], ["punctuation", ";"], + ["keyword", "dword1"], ["punctuation", ";"], + ["keyword", "dword1x1"], ["punctuation", ";"], + ["keyword", "dword1x2"], ["punctuation", ";"], + ["keyword", "dword1x3"], ["punctuation", ";"], + ["keyword", "dword1x4"], ["punctuation", ";"], + ["keyword", "dword2"], ["punctuation", ";"], + ["keyword", "dword2x1"], ["punctuation", ";"], + ["keyword", "dword2x2"], ["punctuation", ";"], + ["keyword", "dword2x3"], ["punctuation", ";"], + ["keyword", "dword2x4"], ["punctuation", ";"], + ["keyword", "dword3"], ["punctuation", ";"], + ["keyword", "dword3x1"], ["punctuation", ";"], + ["keyword", "dword3x2"], ["punctuation", ";"], + ["keyword", "dword3x3"], ["punctuation", ";"], + ["keyword", "dword3x4"], ["punctuation", ";"], + ["keyword", "dword4"], ["punctuation", ";"], + ["keyword", "dword4x1"], ["punctuation", ";"], + ["keyword", "dword4x2"], ["punctuation", ";"], + ["keyword", "dword4x3"], ["punctuation", ";"], + ["keyword", "dword4x4"], ["punctuation", ";"], + ["keyword", "float"], ["punctuation", ";"], + ["keyword", "float1"], ["punctuation", ";"], + ["keyword", "float1x1"], ["punctuation", ";"], + ["keyword", "float1x2"], ["punctuation", ";"], + ["keyword", "float1x3"], ["punctuation", ";"], + ["keyword", "float1x4"], ["punctuation", ";"], + ["keyword", "float2"], ["punctuation", ";"], + ["keyword", "float2x1"], ["punctuation", ";"], + ["keyword", "float2x2"], ["punctuation", ";"], + ["keyword", "float2x3"], ["punctuation", ";"], + ["keyword", "float2x4"], ["punctuation", ";"], + ["keyword", "float3"], ["punctuation", ";"], + ["keyword", "float3x1"], ["punctuation", ";"], + ["keyword", "float3x2"], ["punctuation", ";"], + ["keyword", "float3x3"], ["punctuation", ";"], + ["keyword", "float3x4"], ["punctuation", ";"], + ["keyword", "float4"], ["punctuation", ";"], + ["keyword", "float4x1"], ["punctuation", ";"], + ["keyword", "float4x2"], ["punctuation", ";"], + ["keyword", "float4x3"], ["punctuation", ";"], + ["keyword", "float4x4"], ["punctuation", ";"], + ["keyword", "half"], ["punctuation", ";"], + ["keyword", "half1"], ["punctuation", ";"], + ["keyword", "half1x1"], ["punctuation", ";"], + ["keyword", "half1x2"], ["punctuation", ";"], + ["keyword", "half1x3"], ["punctuation", ";"], + ["keyword", "half1x4"], ["punctuation", ";"], + ["keyword", "half2"], ["punctuation", ";"], + ["keyword", "half2x1"], ["punctuation", ";"], + ["keyword", "half2x2"], ["punctuation", ";"], + ["keyword", "half2x3"], ["punctuation", ";"], + ["keyword", "half2x4"], ["punctuation", ";"], + ["keyword", "half3"], ["punctuation", ";"], + ["keyword", "half3x1"], ["punctuation", ";"], + ["keyword", "half3x2"], ["punctuation", ";"], + ["keyword", "half3x3"], ["punctuation", ";"], + ["keyword", "half3x4"], ["punctuation", ";"], + ["keyword", "half4"], ["punctuation", ";"], + ["keyword", "half4x1"], ["punctuation", ";"], + ["keyword", "half4x2"], ["punctuation", ";"], + ["keyword", "half4x3"], ["punctuation", ";"], + ["keyword", "half4x4"], ["punctuation", ";"], + ["keyword", "int"], ["punctuation", ";"], + ["keyword", "int1"], ["punctuation", ";"], + ["keyword", "int1x1"], ["punctuation", ";"], + ["keyword", "int1x2"], ["punctuation", ";"], + ["keyword", "int1x3"], ["punctuation", ";"], + ["keyword", "int1x4"], ["punctuation", ";"], + ["keyword", "int2"], ["punctuation", ";"], + ["keyword", "int2x1"], ["punctuation", ";"], + ["keyword", "int2x2"], ["punctuation", ";"], + ["keyword", "int2x3"], ["punctuation", ";"], + ["keyword", "int2x4"], ["punctuation", ";"], + ["keyword", "int3"], ["punctuation", ";"], + ["keyword", "int3x1"], ["punctuation", ";"], + ["keyword", "int3x2"], ["punctuation", ";"], + ["keyword", "int3x3"], ["punctuation", ";"], + ["keyword", "int3x4"], ["punctuation", ";"], + ["keyword", "int4"], ["punctuation", ";"], + ["keyword", "int4x1"], ["punctuation", ";"], + ["keyword", "int4x2"], ["punctuation", ";"], + ["keyword", "int4x3"], ["punctuation", ";"], + ["keyword", "int4x4"], ["punctuation", ";"], + ["keyword", "min10float"], ["punctuation", ";"], + ["keyword", "min10float1"], ["punctuation", ";"], + ["keyword", "min10float1x1"], ["punctuation", ";"], + ["keyword", "min10float1x2"], ["punctuation", ";"], + ["keyword", "min10float1x3"], ["punctuation", ";"], + ["keyword", "min10float1x4"], ["punctuation", ";"], + ["keyword", "min10float2"], ["punctuation", ";"], + ["keyword", "min10float2x1"], ["punctuation", ";"], + ["keyword", "min10float2x2"], ["punctuation", ";"], + ["keyword", "min10float2x3"], ["punctuation", ";"], + ["keyword", "min10float2x4"], ["punctuation", ";"], + ["keyword", "min10float3"], ["punctuation", ";"], + ["keyword", "min10float3x1"], ["punctuation", ";"], + ["keyword", "min10float3x2"], ["punctuation", ";"], + ["keyword", "min10float3x3"], ["punctuation", ";"], + ["keyword", "min10float3x4"], ["punctuation", ";"], + ["keyword", "min10float4"], ["punctuation", ";"], + ["keyword", "min10float4x1"], ["punctuation", ";"], + ["keyword", "min10float4x2"], ["punctuation", ";"], + ["keyword", "min10float4x3"], ["punctuation", ";"], + ["keyword", "min10float4x4"], ["punctuation", ";"], + ["keyword", "min12int"], ["punctuation", ";"], + ["keyword", "min12int1"], ["punctuation", ";"], + ["keyword", "min12int1x1"], ["punctuation", ";"], + ["keyword", "min12int1x2"], ["punctuation", ";"], + ["keyword", "min12int1x3"], ["punctuation", ";"], + ["keyword", "min12int1x4"], ["punctuation", ";"], + ["keyword", "min12int2"], ["punctuation", ";"], + ["keyword", "min12int2x1"], ["punctuation", ";"], + ["keyword", "min12int2x2"], ["punctuation", ";"], + ["keyword", "min12int2x3"], ["punctuation", ";"], + ["keyword", "min12int2x4"], ["punctuation", ";"], + ["keyword", "min12int3"], ["punctuation", ";"], + ["keyword", "min12int3x1"], ["punctuation", ";"], + ["keyword", "min12int3x2"], ["punctuation", ";"], + ["keyword", "min12int3x3"], ["punctuation", ";"], + ["keyword", "min12int3x4"], ["punctuation", ";"], + ["keyword", "min12int4"], ["punctuation", ";"], + ["keyword", "min12int4x1"], ["punctuation", ";"], + ["keyword", "min12int4x2"], ["punctuation", ";"], + ["keyword", "min12int4x3"], ["punctuation", ";"], + ["keyword", "min12int4x4"], ["punctuation", ";"], + ["keyword", "min16float"], ["punctuation", ";"], + ["keyword", "min16float1"], ["punctuation", ";"], + ["keyword", "min16float1x1"], ["punctuation", ";"], + ["keyword", "min16float1x2"], ["punctuation", ";"], + ["keyword", "min16float1x3"], ["punctuation", ";"], + ["keyword", "min16float1x4"], ["punctuation", ";"], + ["keyword", "min16float2"], ["punctuation", ";"], + ["keyword", "min16float2x1"], ["punctuation", ";"], + ["keyword", "min16float2x2"], ["punctuation", ";"], + ["keyword", "min16float2x3"], ["punctuation", ";"], + ["keyword", "min16float2x4"], ["punctuation", ";"], + ["keyword", "min16float3"], ["punctuation", ";"], + ["keyword", "min16float3x1"], ["punctuation", ";"], + ["keyword", "min16float3x2"], ["punctuation", ";"], + ["keyword", "min16float3x3"], ["punctuation", ";"], + ["keyword", "min16float3x4"], ["punctuation", ";"], + ["keyword", "min16float4"], ["punctuation", ";"], + ["keyword", "min16float4x1"], ["punctuation", ";"], + ["keyword", "min16float4x2"], ["punctuation", ";"], + ["keyword", "min16float4x3"], ["punctuation", ";"], + ["keyword", "min16float4x4"], ["punctuation", ";"], + ["keyword", "min16int"], ["punctuation", ";"], + ["keyword", "min16int1"], ["punctuation", ";"], + ["keyword", "min16int1x1"], ["punctuation", ";"], + ["keyword", "min16int1x2"], ["punctuation", ";"], + ["keyword", "min16int1x3"], ["punctuation", ";"], + ["keyword", "min16int1x4"], ["punctuation", ";"], + ["keyword", "min16int2"], ["punctuation", ";"], + ["keyword", "min16int2x1"], ["punctuation", ";"], + ["keyword", "min16int2x2"], ["punctuation", ";"], + ["keyword", "min16int2x3"], ["punctuation", ";"], + ["keyword", "min16int2x4"], ["punctuation", ";"], + ["keyword", "min16int3"], ["punctuation", ";"], + ["keyword", "min16int3x1"], ["punctuation", ";"], + ["keyword", "min16int3x2"], ["punctuation", ";"], + ["keyword", "min16int3x3"], ["punctuation", ";"], + ["keyword", "min16int3x4"], ["punctuation", ";"], + ["keyword", "min16int4"], ["punctuation", ";"], + ["keyword", "min16int4x1"], ["punctuation", ";"], + ["keyword", "min16int4x2"], ["punctuation", ";"], + ["keyword", "min16int4x3"], ["punctuation", ";"], + ["keyword", "min16int4x4"], ["punctuation", ";"], + ["keyword", "min16uint"], ["punctuation", ";"], + ["keyword", "min16uint1"], ["punctuation", ";"], + ["keyword", "min16uint1x1"], ["punctuation", ";"], + ["keyword", "min16uint1x2"], ["punctuation", ";"], + ["keyword", "min16uint1x3"], ["punctuation", ";"], + ["keyword", "min16uint1x4"], ["punctuation", ";"], + ["keyword", "min16uint2"], ["punctuation", ";"], + ["keyword", "min16uint2x1"], ["punctuation", ";"], + ["keyword", "min16uint2x2"], ["punctuation", ";"], + ["keyword", "min16uint2x3"], ["punctuation", ";"], + ["keyword", "min16uint2x4"], ["punctuation", ";"], + ["keyword", "min16uint3"], ["punctuation", ";"], + ["keyword", "min16uint3x1"], ["punctuation", ";"], + ["keyword", "min16uint3x2"], ["punctuation", ";"], + ["keyword", "min16uint3x3"], ["punctuation", ";"], + ["keyword", "min16uint3x4"], ["punctuation", ";"], + ["keyword", "min16uint4"], ["punctuation", ";"], + ["keyword", "min16uint4x1"], ["punctuation", ";"], + ["keyword", "min16uint4x2"], ["punctuation", ";"], + ["keyword", "min16uint4x3"], ["punctuation", ";"], + ["keyword", "min16uint4x4"], ["punctuation", ";"], + ["keyword", "uint"], ["punctuation", ";"], + ["keyword", "uint1"], ["punctuation", ";"], + ["keyword", "uint1x1"], ["punctuation", ";"], + ["keyword", "uint1x2"], ["punctuation", ";"], + ["keyword", "uint1x3"], ["punctuation", ";"], + ["keyword", "uint1x4"], ["punctuation", ";"], + ["keyword", "uint2"], ["punctuation", ";"], + ["keyword", "uint2x1"], ["punctuation", ";"], + ["keyword", "uint2x2"], ["punctuation", ";"], + ["keyword", "uint2x3"], ["punctuation", ";"], + ["keyword", "uint2x4"], ["punctuation", ";"], + ["keyword", "uint3"], ["punctuation", ";"], + ["keyword", "uint3x1"], ["punctuation", ";"], + ["keyword", "uint3x2"], ["punctuation", ";"], + ["keyword", "uint3x3"], ["punctuation", ";"], + ["keyword", "uint3x4"], ["punctuation", ";"], + ["keyword", "uint4"], ["punctuation", ";"], + ["keyword", "uint4x1"], ["punctuation", ";"], + ["keyword", "uint4x2"], ["punctuation", ";"], + ["keyword", "uint4x3"], ["punctuation", ";"], + ["keyword", "uint4x4"], ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/hoon/comments_and_leaves.test b/tests/languages/hoon/comments_and_leaves.test new file mode 100644 index 0000000000..17f61a6b48 --- /dev/null +++ b/tests/languages/hoon/comments_and_leaves.test @@ -0,0 +1,58 @@ +:: Arvo formal interface + :: + :: this lifecycle wrapper makes the arvo door (multi-armed core) + :: look like a gate (function or single-armed core), to fit + :: urbit's formal lifecycle function. a practical interpreter + :: can ignore it. + :: + |= [now=@da ovo=*] + ^- * + ~> %slog.[0 leaf+"arvo-event"] + .(+> +:(poke now ovo)) + +---------------------------------------------------- + +[ + ["comment", ":: Arvo formal interface"], + + ["comment", "::"], + + ["comment", ":: this lifecycle wrapper makes the arvo door (multi-armed core)"], + + ["comment", ":: look like a gate (function or single-armed core), to fit"], + + ["comment", ":: urbit's formal lifecycle function. a practical interpreter"], + + ["comment", ":: can ignore it."], + + ["comment", "::"], + + ["keyword", "|="], + " [", + ["function", "now"], + "=", + ["class-name", "@da"], + ["function", "ovo"], + "=", + ["class-name", "*"], + "]\r\n ", + + ["keyword", "^-"], + ["class-name", "*"], + + ["keyword", "~>"], + ["constant", "%slog"], + ".[0 ", + ["function", "leaf"], + "+", + ["string", "\"arvo-event\""], + "]\r\n .(+> +:(", + ["function", "poke"], + ["function", "now"], + ["function", "ovo"], + "))" +] + +---------------------------------------------------- + +Tests for block comments and the inclusion of tapes and leaves inline in cells. diff --git a/tests/languages/hoon/core_with_arms.test b/tests/languages/hoon/core_with_arms.test new file mode 100644 index 0000000000..673859fa1f --- /dev/null +++ b/tests/languages/hoon/core_with_arms.test @@ -0,0 +1,83 @@ +|% +:: # %math +:: unsigned arithmetic ++| %math +++ add + ~/ %add + :: unsigned addition + :: + :: a: augend + :: b: addend + |= [a=@ b=@] + :: sum + ^- @ + ?: =(0 a) b + $(a (dec a), b +(b)) +:: +++ dec + +---------------------------------------------------- + +[ + ["keyword", "|%"], + + ["comment", ":: # %math"], + + ["comment", ":: unsigned arithmetic"], + + ["keyword", "+|"], + ["constant", "%math"], + + ["function", "++ add"], + + ["keyword", "~/"], + ["constant", "%add"], + + ["comment", ":: unsigned addition"], + + ["comment", "::"], + + ["comment", ":: a: augend"], + + ["comment", ":: b: addend"], + + ["keyword", "|="], + " [", + ["function", "a"], + "=", + ["class-name", "@"], + ["function", "b"], + "=", + ["class-name", "@"], + "]\r\n ", + + ["comment", ":: sum"], + + ["keyword", "^-"], + ["class-name", "@"], + + ["keyword", "?:"], + " =(0 ", + ["function", "a"], + ") ", + ["function", "b"], + + "\r\n $(", + ["function", "a"], + " (", + ["function", "dec"], + ["function", "a"], + "), ", + ["function", "b"], + " +(", + ["function", "b"], + "))\r\n", + + ["comment", "::"], + + ["function", "++ dec"] +] + +---------------------------------------------------- + +Tests for a sample definition of a core with an arm. diff --git a/tests/languages/hoon/nested_strings.test b/tests/languages/hoon/nested_strings.test new file mode 100644 index 0000000000..b2ca9ddc03 --- /dev/null +++ b/tests/languages/hoon/nested_strings.test @@ -0,0 +1,122 @@ +|= [a=@ b=tape] +^- tape +?: (gth a 25) + $(a (sub a 26)) +%+ turn b +|= c=@tD +?: &((gte c 'A') (lte c 'Z')) + =. c (add c a) + ?. (gth c 'Z') c + (sub c 26) +?: &((gte c 'a') (lte c 'z')) + =. c (add c a) + ?. (gth c 'z') c + (sub c 26) +c + +---------------------------------------------------- + +[ + ["keyword", "|="], + " [", + ["function", "a"], + "=", + ["class-name", "@"], + ["function", "b"], + "=", + ["function", "tape"], + "]\r\n", + + ["keyword", "^-"], + ["function", "tape"], + + ["keyword", "?:"], + " (", + ["function", "gth"], + ["function", "a"], + " 25)\r\n $(", + ["function", "a"], + " (", + ["function", "sub"], + ["function", "a"], + " 26))\r\n", + + ["keyword", "%+"], + ["function", "turn"], + ["function", "b"], + + ["keyword", "|="], + ["function", "c"], + "=", + ["class-name", "@tD"], + + ["keyword", "?:"], + " &((", + ["function", "gte"], + ["function", "c"], + ["string", "'A'"], + ") (", + ["function", "lte"], + ["function", "c"], + ["string", "'Z'"], + "))\r\n ", + + ["keyword", "=."], + ["function", "c"], + " (", + ["function", "add"], + ["function", "c"], + ["function", "a"], + ")\r\n ", + + ["keyword", "?."], + " (", + ["function", "gth"], + ["function", "c"], + ["string", "'Z'"], + ") ", + ["function", "c"], + + "\r\n (", + ["function", "sub"], + ["function", "c"], + " 26)\r\n", + + ["keyword", "?:"], + " &((", + ["function", "gte"], + ["function", "c"], + ["string", "'a'"], + ") (", + ["function", "lte"], + ["function", "c"], + ["string", "'z'"], + "))\r\n ", + + ["keyword", "=."], + ["function", "c"], + " (", + ["function", "add"], + ["function", "c"], + ["function", "a"], + ")\r\n ", + + ["keyword", "?."], + " (", + ["function", "gth"], + ["function", "c"], + ["string", "'z'"], + ") ", + ["function", "c"], + + "\r\n (", + ["function", "sub"], + ["function", "c"], + " 26)\r\n", + + ["function", "c"] +] + +---------------------------------------------------- + +Tests using the Caesar cipher to demonstrate multiple occasions of cords and tapes on the same line, correcting avoiding clobbering two cord and tape definitions into one. diff --git a/tests/languages/hpkp/max-age_feature.test b/tests/languages/hpkp/max-age_feature.test new file mode 100644 index 0000000000..9b1ae76390 --- /dev/null +++ b/tests/languages/hpkp/max-age_feature.test @@ -0,0 +1,13 @@ +max-age=123; +max-age=31536000 + +---------------------------------------------------- + +[ + ["directive", "max-age"], ["operator", "="], "123", ["punctuation", ";"], + ["directive", "max-age"], ["operator", "="], "31536000" +] + +---------------------------------------------------- + +Checks for HPKP with an "unsafe" max-age. diff --git a/tests/languages/hpkp/safe_maxage_feature.test b/tests/languages/hpkp/safe_maxage_feature.test deleted file mode 100644 index 169f23cd5e..0000000000 --- a/tests/languages/hpkp/safe_maxage_feature.test +++ /dev/null @@ -1,12 +0,0 @@ -max-age=31536000 - ----------------------------------------------------- - -[ - ["directive", "max-age="], - ["safe", "31536000"] -] - ----------------------------------------------------- - -Checks for HPKP with a "safe" max-age. diff --git a/tests/languages/hpkp/sha256_pin_feature.test b/tests/languages/hpkp/sha256_pin_feature.test index 45adf1c878..e9b46c7f34 100644 --- a/tests/languages/hpkp/sha256_pin_feature.test +++ b/tests/languages/hpkp/sha256_pin_feature.test @@ -3,7 +3,11 @@ pin-sha256="EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4=" ---------------------------------------------------- [ - ["directive", "pin-sha256=\"EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4=\""] + ["directive", "pin-sha256"], + ["operator", "="], + "\"EpOpN/ahUF6jhWShDUdy+NvvtaGcu5F7qM6+x2mfkh4", + ["operator", "="], + "\"" ] ---------------------------------------------------- diff --git a/tests/languages/hpkp/unsafe_maxage_feature.test b/tests/languages/hpkp/unsafe_maxage_feature.test deleted file mode 100644 index 4f1ff96158..0000000000 --- a/tests/languages/hpkp/unsafe_maxage_feature.test +++ /dev/null @@ -1,12 +0,0 @@ -max-age=123 - ----------------------------------------------------- - -[ - ["directive", "max-age="], - ["unsafe", "123"] -] - ----------------------------------------------------- - -Checks for HPKP with an "unsafe" max-age. diff --git a/tests/languages/hsts/max-age_feature.test b/tests/languages/hsts/max-age_feature.test new file mode 100644 index 0000000000..55d6453496 --- /dev/null +++ b/tests/languages/hsts/max-age_feature.test @@ -0,0 +1,27 @@ +max-age=0; +max-age="0"; +max-age=31536000; +max-age="31536000" + +---------------------------------------------------- + +[ + ["directive", "max-age"], + ["operator", "="], + "0", + ["punctuation", ";"], + + ["directive", "max-age"], + ["operator", "="], + "\"0\"", + ["punctuation", ";"], + + ["directive", "max-age"], + ["operator", "="], + "31536000", + ["punctuation", ";"], + + ["directive", "max-age"], + ["operator", "="], + "\"31536000\"" +] diff --git a/tests/languages/hsts/safe_maxage_feature.test b/tests/languages/hsts/safe_maxage_feature.test deleted file mode 100644 index 6797fff3b1..0000000000 --- a/tests/languages/hsts/safe_maxage_feature.test +++ /dev/null @@ -1,12 +0,0 @@ -max-age=31536000 - ----------------------------------------------------- - -[ - ["directive", "max-age="], - ["safe", "31536000"] -] - ----------------------------------------------------- - -Checks for HSTS with a "safe" max-age. diff --git a/tests/languages/hsts/unsafe_maxage_feature.test b/tests/languages/hsts/unsafe_maxage_feature.test deleted file mode 100644 index dba69dc304..0000000000 --- a/tests/languages/hsts/unsafe_maxage_feature.test +++ /dev/null @@ -1,12 +0,0 @@ -max-age=123 - ----------------------------------------------------- - -[ - ["directive", "max-age="], - ["unsafe", "123"] -] - ----------------------------------------------------- - -Checks for HSTS with an "unsafe" max-age. diff --git a/tests/languages/http!+csp/inclusion.test b/tests/languages/http!+csp/inclusion.test new file mode 100644 index 0000000000..ffcc29a9c8 --- /dev/null +++ b/tests/languages/http!+csp/inclusion.test @@ -0,0 +1,20 @@ +Content-Security-Policy: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports + +---------------------------------------------------- + +[ + ["header", [ + ["header-name", "Content-Security-Policy"], + ["punctuation", ":"], + ["header-value", [ + ["directive", "default-src"], + ["none", "'none'"], + ["punctuation", ";"], + ["directive", "style-src"], + ["host", ["cdn.example.com"]], + ["punctuation", ";"], + ["directive", "report-uri"], + " /_/csp-reports" + ]] + ]] +] diff --git a/tests/languages/http!+hpkp/inclusion.test b/tests/languages/http!+hpkp/inclusion.test new file mode 100644 index 0000000000..1020d4c2d1 --- /dev/null +++ b/tests/languages/http!+hpkp/inclusion.test @@ -0,0 +1,31 @@ +Public-Key-Pins: max-age=3000; + pin-sha256="d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM="; + pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=" + +---------------------------------------------------- + +[ + ["header", [ + ["header-name", "Public-Key-Pins"], + ["punctuation", ":"], + ["header-value", [ + ["directive", "max-age"], + ["operator", "="], + "3000", + ["punctuation", ";"], + + ["directive", "pin-sha256"], + ["operator", "="], + "\"d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM", + ["operator", "="], + "\"", + ["punctuation", ";"], + + ["directive", "pin-sha256"], + ["operator", "="], + "\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g", + ["operator", "="], + "\"" + ]] + ]] +] diff --git a/tests/languages/http!+hsts/inclusion.test b/tests/languages/http!+hsts/inclusion.test new file mode 100644 index 0000000000..87e6b4985b --- /dev/null +++ b/tests/languages/http!+hsts/inclusion.test @@ -0,0 +1,15 @@ +Strict-Transport-Security: max-age=31536000 + +---------------------------------------------------- + +[ + ["header", [ + ["header-name", "Strict-Transport-Security"], + ["punctuation", ":"], + ["header-value", [ + ["directive", "max-age"], + ["operator", "="], + "31536000" + ]] + ]] +] diff --git a/tests/languages/http!+uri/request-line_feature.test b/tests/languages/http!+uri/request-line_feature.test new file mode 100644 index 0000000000..aeb90963e0 --- /dev/null +++ b/tests/languages/http!+uri/request-line_feature.test @@ -0,0 +1,162 @@ +POST http://example.com HTTP/1.0 +GET http://localhost:9999/foo.html HTTP/1.1 +PUT http://www.example.com HTTP/2.0 +DELETE https://example.com HTTP/1.1 +OPTIONS https://www.example.com HTTP/1.1 +PATCH http://example.com HTTP/1.0 +TRACE http://example.com HTTP/1.0 +CONNECT http://example.com HTTP/1.0 +GET /path/to/foo.html HTTP/1.1 +GET / HTTP/1.1 + +---------------------------------------------------- + +[ + ["request-line", [ + ["method", "POST"], + ["request-target", [ + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]] + ]], + ["http-version", "HTTP/1.0"] + ]], + ["request-line", [ + ["method", "GET"], + ["request-target", [ + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["localhost"]], + ["port-segment", [ + ["port-delimiter", ":"], + ["port", "9999"] + ]] + ]], + ["path", [ + ["path-separator", "/"], + "foo.html" + ]] + ]], + ["http-version", "HTTP/1.1"] + ]], + ["request-line", [ + ["method", "PUT"], + ["request-target", [ + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["www.example.com"]] + ]] + ]], + ["http-version", "HTTP/2.0"] + ]], + ["request-line", [ + ["method", "DELETE"], + ["request-target", [ + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]] + ]], + ["http-version", "HTTP/1.1"] + ]], + ["request-line", [ + ["method", "OPTIONS"], + ["request-target", [ + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["www.example.com"]] + ]] + ]], + ["http-version", "HTTP/1.1"] + ]], + ["request-line", [ + ["method", "PATCH"], + ["request-target", [ + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]] + ]], + ["http-version", "HTTP/1.0"] + ]], + ["request-line", [ + ["method", "TRACE"], + ["request-target", [ + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]] + ]], + ["http-version", "HTTP/1.0"] + ]], + ["request-line", [ + ["method", "CONNECT"], + ["request-target", [ + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]] + ]], + ["http-version", "HTTP/1.0"] + ]], + ["request-line", [ + ["method", "GET"], + ["request-target", [ + ["path", [ + ["path-separator", "/"], + "path", + ["path-separator", "/"], + "to", + ["path-separator", "/"], + "foo.html" + ]] + ]], + ["http-version", "HTTP/1.1"] + ]], + ["request-line", [ + ["method", "GET"], + ["request-target", [ + ["path", [ + ["path-separator", "/"] + ]] + ]], + ["http-version", "HTTP/1.1"] + ]] +] + +---------------------------------------------------- + +Checks for request lines. diff --git a/tests/languages/http/header-name_feature.test b/tests/languages/http/header-name_feature.test deleted file mode 100644 index cd2612fa66..0000000000 --- a/tests/languages/http/header-name_feature.test +++ /dev/null @@ -1,24 +0,0 @@ -Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 -Accept-Encoding: gzip, deflate -Server: GitHub.com -Date: Mon, 22 Dec 2014 18:25:30 GMT -Content-Type: text/html; charset=utf-8 - ----------------------------------------------------- - -[ - ["header-name", "Accept-Language:"], - " fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3\r\n", - ["header-name", "Accept-Encoding:"], - " gzip, deflate\r\n", - ["header-name", "Server:"], - " GitHub.com\r\n", - ["header-name", "Date:"], - " Mon, 22 Dec 2014 18:25:30 GMT\r\n", - ["header-name", "Content-Type:"], - " text/html; charset=utf-8" -] - ----------------------------------------------------- - -Checks for header names. \ No newline at end of file diff --git a/tests/languages/http/header_feature.test b/tests/languages/http/header_feature.test new file mode 100644 index 0000000000..8287185f0e --- /dev/null +++ b/tests/languages/http/header_feature.test @@ -0,0 +1,59 @@ +Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 +Accept-Encoding: gzip, deflate +Server: GitHub.com +Date: Mon, 22 Dec 2014 18:25:30 GMT +Content-Type: text/html; charset=utf-8 +Content-Security-Policy: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports +Public-Key-Pins: max-age=3000; + pin-sha256="d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM="; + pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=" +Strict-Transport-Security: max-age=31536000 + +---------------------------------------------------- + +[ + ["header", [ + ["header-name", "Accept-Language"], + ["punctuation", ":"], + ["header-value", "fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3"] + ]], + ["header", [ + ["header-name", "Accept-Encoding"], + ["punctuation", ":"], + ["header-value", "gzip, deflate"] + ]], + ["header", [ + ["header-name", "Server"], + ["punctuation", ":"], + ["header-value", "GitHub.com"] + ]], + ["header", [ + ["header-name", "Date"], + ["punctuation", ":"], + ["header-value", "Mon, 22 Dec 2014 18:25:30 GMT"] + ]], + ["header", [ + ["header-name", "Content-Type"], + ["punctuation", ":"], + ["header-value", "text/html; charset=utf-8"] + ]], + ["header", [ + ["header-name", "Content-Security-Policy"], + ["punctuation", ":"], + ["header-value", "default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports"] + ]], + ["header", [ + ["header-name", "Public-Key-Pins"], + ["punctuation", ":"], + ["header-value", "max-age=3000;\r\n pin-sha256=\"d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM=\";\r\n pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\""] + ]], + ["header", [ + ["header-name", "Strict-Transport-Security"], + ["punctuation", ":"], + ["header-value", "max-age=31536000"] + ]] +] + +---------------------------------------------------- + +Checks for header names. diff --git a/tests/languages/http/request-line_feature.test b/tests/languages/http/request-line_feature.test index 70db1a9f38..7bf007620a 100644 --- a/tests/languages/http/request-line_feature.test +++ b/tests/languages/http/request-line_feature.test @@ -7,50 +7,63 @@ PATCH http://example.com HTTP/1.0 TRACE http://example.com HTTP/1.0 CONNECT http://example.com HTTP/1.0 GET /path/to/foo.html HTTP/1.1 +GET / HTTP/1.1 ---------------------------------------------------- [ ["request-line", [ - ["property", "POST"], - " http://example.com HTTP/1.0" + ["method", "POST"], + ["request-target", "http://example.com"], + ["http-version", "HTTP/1.0"] ]], ["request-line", [ - ["property", "GET"], - " http://localhost", - ["attr-name", ":9999"], - "/foo.html HTTP/1.1" + ["method", "GET"], + ["request-target", "http://localhost:9999/foo.html"], + ["http-version", "HTTP/1.1"] ]], ["request-line", [ - ["property", "PUT"], - " http://www.example.com HTTP/2.0" + ["method", "PUT"], + ["request-target", "http://www.example.com"], + ["http-version", "HTTP/2.0"] ]], ["request-line", [ - ["property", "DELETE"], - " https://example.com HTTP/1.1" + ["method", "DELETE"], + ["request-target", "https://example.com"], + ["http-version", "HTTP/1.1"] ]], ["request-line", [ - ["property", "OPTIONS"], - " https://www.example.com HTTP/1.1" + ["method", "OPTIONS"], + ["request-target", "https://www.example.com"], + ["http-version", "HTTP/1.1"] ]], ["request-line", [ - ["property", "PATCH"], - " http://example.com HTTP/1.0" + ["method", "PATCH"], + ["request-target", "http://example.com"], + ["http-version", "HTTP/1.0"] ]], ["request-line", [ - ["property", "TRACE"], - " http://example.com HTTP/1.0" + ["method", "TRACE"], + ["request-target", "http://example.com"], + ["http-version", "HTTP/1.0"] ]], ["request-line", [ - ["property", "CONNECT"], - " http://example.com HTTP/1.0" + ["method", "CONNECT"], + ["request-target", "http://example.com"], + ["http-version", "HTTP/1.0"] ]], ["request-line", [ - ["property", "GET"], - " /path/to/foo.html HTTP/1.1" + ["method", "GET"], + ["request-target", "/path/to/foo.html"], + ["http-version", "HTTP/1.1"] + ]], + ["request-line", [ + ["method", "GET"], + ["request-target", "/"], + ["http-version", "HTTP/1.1"] ]] ] ---------------------------------------------------- -Checks for request lines. \ No newline at end of file +Checks for request lines. diff --git a/tests/languages/http/response-status_feature.test b/tests/languages/http/response-status_feature.test index 7384ff2a89..c882621ba3 100644 --- a/tests/languages/http/response-status_feature.test +++ b/tests/languages/http/response-status_feature.test @@ -7,23 +7,27 @@ HTTP/1.0 418 I'm a teapot [ ["response-status", [ - "HTTP/1.0 ", - ["property", "200 OK"] + ["http-version", "HTTP/1.0"], + ["status-code", "200"], + ["reason-phrase", "OK"] ]], ["response-status", [ - "HTTP/1.1 ", - ["property", "403 Forbidden"] + ["http-version", "HTTP/1.1"], + ["status-code", "403"], + ["reason-phrase", "Forbidden"] ]], ["response-status", [ - "HTTP/1.1 ", - ["property", "404 Not Found"] + ["http-version", "HTTP/1.1"], + ["status-code", "404"], + ["reason-phrase", "Not Found"] ]], ["response-status", [ - "HTTP/1.0 ", - ["property", "418 I'm a teapot"] + ["http-version", "HTTP/1.0"], + ["status-code", "418"], + ["reason-phrase", "I'm a teapot"] ]] ] ---------------------------------------------------- -Checks for response statuses. \ No newline at end of file +Checks for response statuses. diff --git a/tests/languages/http/text-plain_feature.test b/tests/languages/http/text-plain_feature.test new file mode 100644 index 0000000000..e0ba53d10b --- /dev/null +++ b/tests/languages/http/text-plain_feature.test @@ -0,0 +1,14 @@ +Content-Type: text/plain + +Hello World! + +---------------------------------------------------- + +[ + ["header", [ + ["header-name", "Content-Type"], + ["punctuation", ":"], + ["header-value", "text/plain"] + ]], + ["text-plain", ["\r\nHello World!"]] +] diff --git a/tests/languages/ichigojam/punctuation_feature.test b/tests/languages/ichigojam/punctuation_feature.test new file mode 100644 index 0000000000..5bd5632654 --- /dev/null +++ b/tests/languages/ichigojam/punctuation_feature.test @@ -0,0 +1,13 @@ +[ ] , ; : ( ) + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/icu-message-format/arg-skeleton_feature.test b/tests/languages/icu-message-format/arg-skeleton_feature.test new file mode 100644 index 0000000000..c822826fce --- /dev/null +++ b/tests/languages/icu-message-format/arg-skeleton_feature.test @@ -0,0 +1,83 @@ +At {1,time,::jmm} on {1,date,::dMMMM}, there was {2} on planet {3,number,integer}. + +{foo,spellout} +{foo,ordinal} +{foo,duration} + +---------------------------------------------------- + +[ + "At ", + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "1"], + ["punctuation", ","], + ["arg-type", "time"], + ["punctuation", ","], + ["arg-skeleton", "::jmm"] + ]], + ["argument-delimiter", "}"] + ]], + " on ", + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "1"], + ["punctuation", ","], + ["arg-type", "date"], + ["punctuation", ","], + ["arg-skeleton", "::dMMMM"] + ]], + ["argument-delimiter", "}"] + ]], + ", there was ", + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "2"] + ]], + ["argument-delimiter", "}"] + ]], + " on planet ", + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "3"], + ["punctuation", ","], + ["arg-type", "number"], + ["punctuation", ","], + ["arg-style", "integer"] + ]], + ["argument-delimiter", "}"] + ]], + ".\r\n\r\n", + + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-type", "spellout"] + ]], + ["argument-delimiter", "}"] + ]], + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-type", "ordinal"] + ]], + ["argument-delimiter", "}"] + ]], + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-type", "duration"] + ]], + ["argument-delimiter", "}"] + ]] +] diff --git a/tests/languages/icu-message-format/choice-style_feature.test b/tests/languages/icu-message-format/choice-style_feature.test new file mode 100644 index 0000000000..0778367cb4 --- /dev/null +++ b/tests/languages/icu-message-format/choice-style_feature.test @@ -0,0 +1,105 @@ +The disk {1} contains {0,choice,0#no files|1#one file|1<{0,number,integer} files} + +{3, choice, -1#is negative| 0#is zero or fraction | 1#is one |1.0= > \ | +++ : !! +\\ <- -> += :: => +>> >>= >@> +~ ! @ + +---------------------------------------------------- + +[ + ["operator", ".."], + + ["hvariable", ["reverse"]], + ["operator", "."], + ["hvariable", ["sort"]], + + ["operator", "`foo`"], + + ["operator", "`Foo.bar`"], + + ["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 operators. diff --git a/tests/languages/idris/string_feature.test b/tests/languages/idris/string_feature.test new file mode 100644 index 0000000000..49c2cfbf23 --- /dev/null +++ b/tests/languages/idris/string_feature.test @@ -0,0 +1,19 @@ +"" +"fo\"o" +"foo \ + \ bar" +"foo -- comment \ + \ bar" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"fo\\\"o\""], + ["string", "\"foo \\\r\n \\ bar\""], + ["string", "\"foo -- comment \\\r\n \\ bar\""] +] + +---------------------------------------------------- + +Checks for strings. \ No newline at end of file diff --git a/tests/languages/iecst/symbol.test b/tests/languages/iecst/address_feature.test similarity index 70% rename from tests/languages/iecst/symbol.test rename to tests/languages/iecst/address_feature.test index 8b210cdc2d..e556407b22 100644 --- a/tests/languages/iecst/symbol.test +++ b/tests/languages/iecst/address_feature.test @@ -5,16 +5,18 @@ END_VAR ---------------------------------------------------- [ - ["class-name", "VAR"], - "\n varname ", + ["keyword", "VAR"], + + "\r\n varname ", ["keyword", "AT"], - ["symbol", "%QX1.0.0"], + ["address", "%QX1.0.0"], ["operator", ":"], - ["variable", "BOOL"], + ["class-name", "BOOL"], ["operator", ":="], ["boolean", "TRUE"], ["punctuation", ";"], - ["class-name", "END_VAR"] + + ["keyword", "END_VAR"] ] ---------------------------------------------------- diff --git a/tests/languages/iecst/boolean_feature.test b/tests/languages/iecst/boolean_feature.test new file mode 100644 index 0000000000..5860b1f4a9 --- /dev/null +++ b/tests/languages/iecst/boolean_feature.test @@ -0,0 +1,11 @@ +TRUE +FALSE +NULL + +---------------------------------------------------- + +[ + ["boolean", "TRUE"], + ["boolean", "FALSE"], + ["boolean", "NULL"] +] diff --git a/tests/languages/iecst/comment_feature.test b/tests/languages/iecst/comment_feature.test new file mode 100644 index 0000000000..90cfdeadc6 --- /dev/null +++ b/tests/languages/iecst/comment_feature.test @@ -0,0 +1,11 @@ +// comment +(* comment *) +/* comment */ + +---------------------------------------------------- + +[ + ["comment", "// comment"], + ["comment", "(* comment *)"], + ["comment", "/* comment */"] +] diff --git a/tests/languages/iecst/number.test b/tests/languages/iecst/number_feature.test similarity index 100% rename from tests/languages/iecst/number.test rename to tests/languages/iecst/number_feature.test diff --git a/tests/languages/iecst/operator_feature.test b/tests/languages/iecst/operator_feature.test new file mode 100644 index 0000000000..68b5b74e1d --- /dev/null +++ b/tests/languages/iecst/operator_feature.test @@ -0,0 +1,54 @@ += <> < <= > >= ++ - * / ** ^ & && + +: := +# + +AND +EQ +EXPT +GE +GT +LE +LT +MOD +NE +NOT +OR +XOR + +---------------------------------------------------- + +[ + ["operator", "="], + ["operator", "<>"], + ["operator", "<"], + ["operator", "<="], + ["operator", ">"], + ["operator", ">="], + + ["operator", "+"], + ["operator", "-"], + ["operator", "*"], + ["operator", "/"], + ["operator", "**"], + ["operator", "^"], + ["operator", "&"], + ["operator", "&&"], + + ["operator", ":"], ["operator", ":="], + ["operator", "#"], + + ["operator", "AND"], + ["operator", "EQ"], + ["operator", "EXPT"], + ["operator", "GE"], + ["operator", "GT"], + ["operator", "LE"], + ["operator", "LT"], + ["operator", "MOD"], + ["operator", "NE"], + ["operator", "NOT"], + ["operator", "OR"], + ["operator", "XOR"] +] diff --git a/tests/languages/iecst/punctuation_feature.test b/tests/languages/iecst/punctuation_feature.test new file mode 100644 index 0000000000..b1400d0cae --- /dev/null +++ b/tests/languages/iecst/punctuation_feature.test @@ -0,0 +1,15 @@ +( ) [ ] +, ; . + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."] +] diff --git a/tests/languages/ini/comment_feature.test b/tests/languages/ini/comment_feature.test index 30e373c63a..3503173f3e 100644 --- a/tests/languages/ini/comment_feature.test +++ b/tests/languages/ini/comment_feature.test @@ -1,15 +1,50 @@ -; -; foobar -# foobar - ----------------------------------------------------- - -[ - ["comment", ";"], - ["comment", "; foobar"], - ["comment", "# foobar"] -] - ----------------------------------------------------- - -Checks for comments. +# + ; + # + ; +# +# +# +#; +#[foo] +#foo=bar +#foobar +; +; +; +;# +;[foo] +;foo=bar +;foobar +foo#bar +foobar# +foo;bar +foobar; + +---------------------------------------------------- + +[ + ["comment", "#"], + ["comment", ";"], + ["comment", "#"], + ["comment", ";"], + ["comment", "#"], + ["comment", "#\t"], + ["comment", "# "], + ["comment", "#;"], + ["comment", "#[foo]"], + ["comment", "#foo=bar"], + ["comment", "#foobar"], + ["comment", ";"], + ["comment", ";\t"], + ["comment", "; "], + ["comment", ";#"], + ["comment", ";[foo]"], + ["comment", ";foo=bar"], + ["comment", ";foobar"], + "\r\nfoo#bar\r\nfoobar#\r\nfoo;bar\r\nfoobar;" +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/ini/key_value_feature.test b/tests/languages/ini/key_value_feature.test index 5d25d9d3cf..9ee6af8723 100644 --- a/tests/languages/ini/key_value_feature.test +++ b/tests/languages/ini/key_value_feature.test @@ -1,21 +1,160 @@ -foo=Bar Baz -foobar=42 - ----------------------------------------------------- - -[ - ["constant", "foo"], - ["attr-value", [ - ["punctuation", "="], - "Bar Baz" - ]], - ["constant", "foobar"], - ["attr-value", [ - ["punctuation", "="], - "42" - ]] -] - ----------------------------------------------------- - -Checks for key/value pairs. \ No newline at end of file +bar1 = + "bar2" = + 'bar3' = + bar4 = +" bar5 "= +"bar6"= +' bar7 '= +'bar8'= += baz9 += "baz10" += 'baz11' += baz12 +=" baz13 " +="b14"a14"z14" +="baz15" +="baz16 +=' baz17 ' +='baz18' +=b19"a19"z19 +=b20"az20 +=ba21"z21 +=baz22 +=baz23" +bar24 +bar25 baz25=qux25 +bar26= +bar27==baz27 +bar28=baz28 +bar29=baz29 qux29 +bar30=baz30=qux30 + +---------------------------------------------------- + +[ + ["key", "bar1"], + ["punctuation", "="], + + ["key", "\"bar2\""], + ["punctuation", "="], + + ["key", "'bar3'"], + ["punctuation", "="], + + ["key", "bar4"], + ["punctuation", "="], + + ["key", "\" bar5 \""], + ["punctuation", "="], + + ["key", "\"bar6\""], + ["punctuation", "="], + + ["key", "' bar7 '"], + ["punctuation", "="], + + ["key", "'bar8'"], + ["punctuation", "="], + + ["punctuation", "="], + ["value", ["baz9"]], + + ["punctuation", "="], + ["value", [ + "\"", + ["inner-value", "baz10"], + "\"" + ]], + + ["punctuation", "="], + ["value", [ + "'", + ["inner-value", "baz11"], + "'" + ]], + + ["punctuation", "="], + ["value", ["baz12"]], + + ["punctuation", "="], + ["value", [ + "\"", + ["inner-value", " baz13 "], + "\"" + ]], + + ["punctuation", "="], + ["value", [ + "\"", + ["inner-value", "b14\"a14\"z14"], + "\"" + ]], + + ["punctuation", "="], + ["value", [ + "\"", + ["inner-value", "baz15"], + "\"" + ]], + + ["punctuation", "="], + ["value", ["\"baz16"]], + + ["punctuation", "="], + ["value", [ + "'", + ["inner-value", " baz17 "], + "'" + ]], + + ["punctuation", "="], + ["value", [ + "'", + ["inner-value", "baz18"], + "'" + ]], + + ["punctuation", "="], + ["value", ["b19\"a19\"z19"]], + + ["punctuation", "="], + ["value", ["b20\"az20"]], + + ["punctuation", "="], + ["value", ["ba21\"z21"]], + + ["punctuation", "="], + ["value", ["baz22"]], + + ["punctuation", "="], + ["value", ["baz23\""]], + + "\r\nbar24\r\n", + + ["key", "bar25 baz25"], + ["punctuation", "="], + ["value", ["qux25"]], + + ["key", "bar26"], + ["punctuation", "="], + + ["key", "bar27"], + ["punctuation", "="], + ["value", ["=baz27"]], + + ["key", "bar28"], + ["punctuation", "="], + ["value", ["baz28"]], + + ["key", "bar29"], + ["punctuation", "="], + ["value", ["baz29 qux29"]], + + ["key", "bar30"], + ["punctuation", "="], + ["value", ["baz30=qux30"]] +] + +---------------------------------------------------- + +Checks for key-value pairs. diff --git a/tests/languages/ini/punctuation_feature.test b/tests/languages/ini/punctuation_feature.test new file mode 100644 index 0000000000..c72a16d0a1 --- /dev/null +++ b/tests/languages/ini/punctuation_feature.test @@ -0,0 +1,11 @@ += + +---------------------------------------------------- + +[ + ["punctuation", "="] +] + +---------------------------------------------------- + +Checks for punctuation marks. diff --git a/tests/languages/ini/section_feature.test b/tests/languages/ini/section_feature.test new file mode 100644 index 0000000000..386ec3139e --- /dev/null +++ b/tests/languages/ini/section_feature.test @@ -0,0 +1,86 @@ + [foo1] +[ "foo2" ] +[ foo3 ] +[" foo4 "] +["foo5 bar5"] +["foo6"] +[foo7 +[foo8 bar8] +[foo9[bar9] +[foo10] +[foo11]bar11] + +---------------------------------------------------- + +[ + ["section", [ + ["punctuation", "["], + ["section-name", "foo1"], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "\"foo2\""], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "foo3"], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "\" foo4 \""], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "\"foo5 bar5\""], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "\"foo6\""], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "foo7"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "foo8 bar8"], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "foo9[bar9"], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "foo10"], + ["punctuation", "]"] + ]], + + ["section", [ + ["punctuation", "["], + ["section-name", "foo11"], + ["punctuation", "]"] + ]], + + "bar11]" +] + +---------------------------------------------------- + +Checks for sections (and section names). diff --git a/tests/languages/io/builtin_feature.test b/tests/languages/io/builtin_feature.test new file mode 100644 index 0000000000..6dbfd21216 --- /dev/null +++ b/tests/languages/io/builtin_feature.test @@ -0,0 +1,161 @@ +Array +AudioDevice +AudioMixer +Block +Box +Buffer +CFunction +CGI +Color +Curses +DBM +DNSResolver +DOConnection +DOProxy +DOServer +Date +Directory +Duration +DynLib +Error +Exception +FFT +File +Fnmatch +Font +Future +GL +GLE +GLScissor +GLU +GLUCylinder +GLUQuadric +GLUSphere +GLUT +Host +Image +Importer +LinkList +List +Lobby +Locals +MD5 +MP3Decoder +MP3Encoder +Map +Message +Movie +Notification +Number +Object +OpenGL +Point +Protos +Regex +SGML +SGMLElement +SGMLParser +SQLite +Server +Sequence +ShowMessage +SleepyCat +SleepyCatCursor +Socket +SocketManager +Sound +Soup +Store +String +Tree +UDPSender +UPDReceiver +URL +User +Warning +WeakLink +Random +BigNum + +---------------------------------------------------- + +[ + ["builtin", "Array"], + ["builtin", "AudioDevice"], + ["builtin", "AudioMixer"], + ["builtin", "Block"], + ["builtin", "Box"], + ["builtin", "Buffer"], + ["builtin", "CFunction"], + ["builtin", "CGI"], + ["builtin", "Color"], + ["builtin", "Curses"], + ["builtin", "DBM"], + ["builtin", "DNSResolver"], + ["builtin", "DOConnection"], + ["builtin", "DOProxy"], + ["builtin", "DOServer"], + ["builtin", "Date"], + ["builtin", "Directory"], + ["builtin", "Duration"], + ["builtin", "DynLib"], + ["builtin", "Error"], + ["builtin", "Exception"], + ["builtin", "FFT"], + ["builtin", "File"], + ["builtin", "Fnmatch"], + ["builtin", "Font"], + ["builtin", "Future"], + ["builtin", "GL"], + ["builtin", "GLE"], + ["builtin", "GLScissor"], + ["builtin", "GLU"], + ["builtin", "GLUCylinder"], + ["builtin", "GLUQuadric"], + ["builtin", "GLUSphere"], + ["builtin", "GLUT"], + ["builtin", "Host"], + ["builtin", "Image"], + ["builtin", "Importer"], + ["builtin", "LinkList"], + ["builtin", "List"], + ["builtin", "Lobby"], + ["builtin", "Locals"], + ["builtin", "MD5"], + ["builtin", "MP3Decoder"], + ["builtin", "MP3Encoder"], + ["builtin", "Map"], + ["builtin", "Message"], + ["builtin", "Movie"], + ["builtin", "Notification"], + ["builtin", "Number"], + ["builtin", "Object"], + ["builtin", "OpenGL"], + ["builtin", "Point"], + ["builtin", "Protos"], + ["builtin", "Regex"], + ["builtin", "SGML"], + ["builtin", "SGMLElement"], + ["builtin", "SGMLParser"], + ["builtin", "SQLite"], + ["builtin", "Server"], + ["builtin", "Sequence"], + ["builtin", "ShowMessage"], + ["builtin", "SleepyCat"], + ["builtin", "SleepyCatCursor"], + ["builtin", "Socket"], + ["builtin", "SocketManager"], + ["builtin", "Sound"], + ["builtin", "Soup"], + ["builtin", "Store"], + ["builtin", "String"], + ["builtin", "Tree"], + ["builtin", "UDPSender"], + ["builtin", "UPDReceiver"], + ["builtin", "URL"], + ["builtin", "User"], + ["builtin", "Warning"], + ["builtin", "WeakLink"], + ["builtin", "Random"], + ["builtin", "BigNum"] +] diff --git a/tests/languages/io/comment_feature.test b/tests/languages/io/comment_feature.test index fb67d07b4d..e432fece6a 100644 --- a/tests/languages/io/comment_feature.test +++ b/tests/languages/io/comment_feature.test @@ -11,7 +11,7 @@ comment ["comment", "//"], ["comment", "// Foobar"], ["comment", "#!/usr/bin/env io"], - ["comment", "/* multiline\ncomment\n*/"] + ["comment", "/* multiline\r\ncomment\r\n*/"] ] ---------------------------------------------------- diff --git a/tests/languages/io/keyword_feature.test b/tests/languages/io/keyword_feature.test new file mode 100644 index 0000000000..35cc9070c8 --- /dev/null +++ b/tests/languages/io/keyword_feature.test @@ -0,0 +1,141 @@ +activate +activeCoroCount +asString +block +break +catch +clone +collectGarbage +compileString +continue +do +doFile +doMessage +doString +else +elseif +exit +for +foreach +forward +getSlot +getEnvironmentVariable +hasSlot +if +ifFalse +ifNil +ifNilEval +ifTrue +isActive +isNil +isResumable +list +message +method +parent +pass +pause +perform +performWithArgList +print +println +proto +raise +raiseResumable +removeSlot +resend +resume +schedulerSleepSeconds +self +sender +setSchedulerSleepSeconds +setSlot +shallowCopy +slotNames +super +system +then +thisBlock +thisContext +call +try +type +uniqueId +updateSlot +wait +while +write +yield + +---------------------------------------------------- + +[ + ["keyword", "activate"], + ["keyword", "activeCoroCount"], + ["keyword", "asString"], + ["keyword", "block"], + ["keyword", "break"], + ["keyword", "catch"], + ["keyword", "clone"], + ["keyword", "collectGarbage"], + ["keyword", "compileString"], + ["keyword", "continue"], + ["keyword", "do"], + ["keyword", "doFile"], + ["keyword", "doMessage"], + ["keyword", "doString"], + ["keyword", "else"], + ["keyword", "elseif"], + ["keyword", "exit"], + ["keyword", "for"], + ["keyword", "foreach"], + ["keyword", "forward"], + ["keyword", "getSlot"], + ["keyword", "getEnvironmentVariable"], + ["keyword", "hasSlot"], + ["keyword", "if"], + ["keyword", "ifFalse"], + ["keyword", "ifNil"], + ["keyword", "ifNilEval"], + ["keyword", "ifTrue"], + ["keyword", "isActive"], + ["keyword", "isNil"], + ["keyword", "isResumable"], + ["keyword", "list"], + ["keyword", "message"], + ["keyword", "method"], + ["keyword", "parent"], + ["keyword", "pass"], + ["keyword", "pause"], + ["keyword", "perform"], + ["keyword", "performWithArgList"], + ["keyword", "print"], + ["keyword", "println"], + ["keyword", "proto"], + ["keyword", "raise"], + ["keyword", "raiseResumable"], + ["keyword", "removeSlot"], + ["keyword", "resend"], + ["keyword", "resume"], + ["keyword", "schedulerSleepSeconds"], + ["keyword", "self"], + ["keyword", "sender"], + ["keyword", "setSchedulerSleepSeconds"], + ["keyword", "setSlot"], + ["keyword", "shallowCopy"], + ["keyword", "slotNames"], + ["keyword", "super"], + ["keyword", "system"], + ["keyword", "then"], + ["keyword", "thisBlock"], + ["keyword", "thisContext"], + ["keyword", "call"], + ["keyword", "try"], + ["keyword", "type"], + ["keyword", "uniqueId"], + ["keyword", "updateSlot"], + ["keyword", "wait"], + ["keyword", "while"], + ["keyword", "write"], + ["keyword", "yield"] +] diff --git a/tests/languages/io/string_feature.test b/tests/languages/io/string_feature.test index 5b4f003eb8..7edc74188b 100644 --- a/tests/languages/io/string_feature.test +++ b/tests/languages/io/string_feature.test @@ -4,15 +4,15 @@ """this is a "test". This is only a test.""" -------------------------------------------------------------------------- +---------------------------------------------------- [ ["string", "\"\""], ["triple-quoted-string", "\"\"\"\"\"\""], ["string", "\"this is a \\\"test\\\".\\nThis is only a test.\""], - ["triple-quoted-string", "\"\"\"this is a \"test\".\nThis is only a test.\"\"\""] + ["triple-quoted-string", "\"\"\"this is a \"test\".\r\nThis is only a test.\"\"\""] ] -------------------------------------------------------------------------- +---------------------------------------------------- Check strings. diff --git a/tests/languages/j/operator_feature.test b/tests/languages/j/operator_feature.test new file mode 100644 index 0000000000..2094f0990b --- /dev/null +++ b/tests/languages/j/operator_feature.test @@ -0,0 +1,14 @@ +_. +=. =: +a. +a: + +---------------------------------------------------- + +[ + ["operator", "_."], + ["operator", "=."], + ["operator", "=:"], + ["operator", "a."], + ["operator", "a:"] +] diff --git a/tests/languages/java/annotation_feature.test b/tests/languages/java/annotation_feature.test new file mode 100644 index 0000000000..3c645542c8 --- /dev/null +++ b/tests/languages/java/annotation_feature.test @@ -0,0 +1,32 @@ +@Override +@Documented +@java.long.annotation.Documented + +@Retention(value=SOURCE) +@Target(value={PACKAGE,TYPE}) + +---------------------------------------------------- + +[ + ["annotation", "@Override"], + ["annotation", "@Documented"], + ["annotation", "@java.long.annotation.Documented"], + + ["annotation", "@Retention"], + ["punctuation", "("], + "value", + ["operator", "="], + "SOURCE", + ["punctuation", ")"], + + ["annotation", "@Target"], + ["punctuation", "("], + "value", + ["operator", "="], + ["punctuation", "{"], + "PACKAGE", + ["punctuation", ","], + "TYPE", + ["punctuation", "}"], + ["punctuation", ")"] +] diff --git a/tests/languages/java/char_feature.test b/tests/languages/java/char_feature.test new file mode 100644 index 0000000000..f376ee9220 --- /dev/null +++ b/tests/languages/java/char_feature.test @@ -0,0 +1,11 @@ +'A' +'\n' +'\u0041' + +---------------------------------------------------- + +[ + ["char", "'A'"], + ["char", "'\\n'"], + ["char", "'\\u0041'"] +] diff --git a/tests/languages/java/class-name_feature.test b/tests/languages/java/class-name_feature.test new file mode 100644 index 0000000000..71530bb5be --- /dev/null +++ b/tests/languages/java/class-name_feature.test @@ -0,0 +1,122 @@ +class Foo extends foo.bar.Foo { + + java.util.List bar(foo.bar.Baz bat) throws java.lang.Exception { + var foo = new java.lang.UnsupportedOperationException("Not implemented"); + Exception e = foo; + throw e; + } + +} + +ID id; + +String.valueOf(5); + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", ["Foo"]], + ["keyword", "extends"], + ["class-name", [ + ["namespace", [ + "foo", + ["punctuation", "."], + "bar", + ["punctuation", "."] + ]], + "Foo" + ]], + ["punctuation", "{"], + + ["class-name", [ + ["namespace", [ + "java", + ["punctuation", "."], + "util", + ["punctuation", "."] + ]], + "List" + ]], + ["generics", [ + ["punctuation", "<"], + ["class-name", [ + ["namespace", [ + "foo", + ["punctuation", "."], + "bar", + ["punctuation", "."] + ]], + "Foo", + ["punctuation", "."], + "Bar" + ]], + ["punctuation", ">"] + ]], + ["function", "bar"], + ["punctuation", "("], + ["class-name", [ + ["namespace", [ + "foo", + ["punctuation", "."], + "bar", + ["punctuation", "."] + ]], + "Baz" + ]], + " bat", + ["punctuation", ")"], + ["keyword", "throws"], + ["class-name", [ + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."] + ]], + "Exception" + ]], + ["punctuation", "{"], + + ["keyword", "var"], + " foo ", + ["operator", "="], + ["keyword", "new"], + ["class-name", [ + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."] + ]], + "UnsupportedOperationException" + ]], + ["punctuation", "("], + ["string", "\"Not implemented\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", ["Exception"]], + " e ", + ["operator", "="], + " foo", + ["punctuation", ";"], + + ["keyword", "throw"], + " e", + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["class-name", ["ID"]], " id", ["punctuation", ";"], + + ["class-name", ["String"]], + ["punctuation", "."], + ["function", "valueOf"], + ["punctuation", "("], + ["number", "5"], + ["punctuation", ")"], + ["punctuation", ";"] +] diff --git a/tests/languages/java/function_featrue.test b/tests/languages/java/function_featrue.test index 065e2c3e1c..d54e5941ec 100644 --- a/tests/languages/java/function_featrue.test +++ b/tests/languages/java/function_featrue.test @@ -20,7 +20,9 @@ Bar::foo; ["punctuation", ")"], ["punctuation", ";"], - ["class-name", "Bar"], + ["class-name", [ + "Bar" + ]], ["operator", "::"], ["function", "foo"], ["punctuation", ";"] diff --git a/tests/languages/java/generics_feature.test b/tests/languages/java/generics_feature.test index d1d5e5363a..989187b949 100644 --- a/tests/languages/java/generics_feature.test +++ b/tests/languages/java/generics_feature.test @@ -1,65 +1,230 @@ -public class Solo {} -Solo val = new Solo(); +public class Solo {} +Solo val = new Solo<>(); Duo dual = new Duo(12.2585, 'C'); +List list +List nums = ints; +List list +Entry pair = Entry.twice("Hello"); + +public class Entry {} +class D {} + +public void throwMeConditional(boolean conditional, T exception) throws T {} + + T instantiateElementType(List arg) {} + +// not generics +if (a<6&&b>6){} + ---------------------------------------------------- [ ["keyword", "public"], ["keyword", "class"], - ["class-name", "Solo"], + ["class-name", ["Solo"]], ["generics", [ ["punctuation", "<"], - ["class-name", "T"], + ["class-name", ["T"]], + ["keyword", "extends"], + ["class-name", [ + ["namespace", [ + "com", + ["punctuation", "."], + "foo", + ["punctuation", "."] + ]], + "Foo", + ["punctuation", "."], + "Bar" + ]], ["punctuation", ">"] ]], ["punctuation", "{"], ["punctuation", "}"], - ["class-name", "Solo"], + ["class-name", ["Solo"]], ["generics", [ ["punctuation", "<"], - ["class-name", "Integer"], + ["class-name", ["Integer"]], ["punctuation", ">"] ]], " val ", ["operator", "="], ["keyword", "new"], - ["class-name", "Solo"], + ["class-name", ["Solo"]], ["generics", [ ["punctuation", "<"], - ["class-name", "Integer"], ["punctuation", ">"] ]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], - ["class-name", "Duo"], + ["class-name", ["Duo"]], ["generics", [ ["punctuation", "<"], - ["class-name", "Double"], + ["class-name", ["Double"]], ["punctuation", ","], - ["class-name", "Character"], + ["class-name", ["Character"]], ["punctuation", ">"] ]], " dual ", ["operator", "="], ["keyword", "new"], - ["class-name", "Duo"], + ["class-name", ["Duo"]], ["generics", [ ["punctuation", "<"], - ["class-name", "Double"], + ["class-name", ["Double"]], ["punctuation", ","], - ["class-name", "Character"], + ["class-name", ["Character"]], ["punctuation", ">"] ]], ["punctuation", "("], ["number", "12.2585"], ["punctuation", ","], - ["string", "'C'"], + ["char", "'C'"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", ["List"]], + ["generics", [ + ["punctuation", "<"], + ["operator", "?"], + ["punctuation", ">"] + ]], + " list\r\n", + + ["class-name", ["List"]], + ["generics", [ + ["punctuation", "<"], + ["operator", "?"], + ["keyword", "extends"], + ["class-name", ["Number"]], + ["punctuation", ">"] + ]], + " nums ", + ["operator", "="], + " ints", + ["punctuation", ";"], + + ["class-name", ["List"]], + ["generics", [ + ["punctuation", "<"], + ["operator", "?"], + ["keyword", "super"], + ["class-name", ["Integer"]], + ["punctuation", ">"] + ]], + " list\r\n", + + ["class-name", ["Entry"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", ["String"]], + ["punctuation", ","], + ["class-name", ["String"]], + ["punctuation", ">"] + ]], + " pair ", + ["operator", "="], + ["class-name", ["Entry"]], + ["punctuation", "."], + ["generics", [ + ["punctuation", "<"], + ["class-name", ["String"]], + ["punctuation", ">"] + ]], + ["function", "twice"], + ["punctuation", "("], + ["string", "\"Hello\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "class"], + ["class-name", ["Entry"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", ["KeyType"]], + ["punctuation", ","], + ["class-name", ["ValueType"]], + ["punctuation", ">"] + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", ["D"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", ["T"]], + ["keyword", "extends"], + ["class-name", ["A"]], + ["operator", "&"], + ["class-name", ["B"]], + ["operator", "&"], + ["class-name", ["C"]], + ["punctuation", ">"] + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "public"], + ["generics", [ + ["punctuation", "<"], + ["class-name", ["T"]], + ["keyword", "extends"], + ["class-name", ["Throwable"]], + ["punctuation", ">"] + ]], + ["keyword", "void"], + ["function", "throwMeConditional"], + ["punctuation", "("], + ["keyword", "boolean"], + " conditional", + ["punctuation", ","], + ["class-name", ["T"]], + " exception", ["punctuation", ")"], - ["punctuation", ";"] + ["keyword", "throws"], + ["class-name", ["T"]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["generics", [ + ["punctuation", "<"], + ["class-name", ["T"]], + ["punctuation", ">"] + ]], + ["class-name", ["T"]], + ["function", "instantiateElementType"], + ["punctuation", "("], + ["class-name", ["List"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", ["T"]], + ["punctuation", ">"] + ]], + " arg", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["comment", "// not generics"], + + ["keyword", "if"], + ["punctuation", "("], + "a", + ["operator", "<"], + ["number", "6"], + ["operator", "&&"], + "b", + ["operator", ">"], + ["number", "6"], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] ] ---------------------------------------------------- diff --git a/tests/languages/java/issue1351.test b/tests/languages/java/issue1351.test index 3034e3e857..4bb0817d26 100644 --- a/tests/languages/java/issue1351.test +++ b/tests/languages/java/issue1351.test @@ -5,18 +5,28 @@ public class AllChangesIndexer extends SiteIndexer"] ]], ["punctuation", "{"] @@ -24,4 +34,4 @@ public class AllChangesIndexer extends SiteIndexer"] ]], + "\r\n * ", ["tag", [ ["tag", [ @@ -104,7 +105,7 @@ ["code-section", [ ["line", [ ["code", [ - ["class-name", "Foo"] + ["class-name", ["Foo"]] ]] ]] ]], @@ -115,6 +116,7 @@ ]], ["punctuation", ">"] ]], + "\r\n *\r\n * ", ["tag", [ ["tag", [ @@ -130,6 +132,7 @@ ]], ["punctuation", ">"] ]], + ["code-section", [ "* ", ["line", [ @@ -153,6 +156,7 @@ ["punctuation", "{"] ]] ]], + "\r\n * ", ["line", [ ["code", [ @@ -165,12 +169,14 @@ ["punctuation", ";"] ]] ]], + "\r\n * ", ["line", [ ["code", [ ["punctuation", "}"] ]] ]], + "\r\n * ", ["line", [ ["code", [ @@ -179,6 +185,7 @@ ["punctuation", ";"] ]] ]], + "\r\n *" ]], ["tag", [ @@ -195,6 +202,7 @@ ]], ["punctuation", ">"] ]], + "\r\n *\r\n * ", ["tag", [ ["tag", [ @@ -205,13 +213,14 @@ ]], ["punctuation", "{"], ["keyword", "@code"], + ["code-section", [ "* ", ["code", [ - ["class-name", "String"], + ["class-name", ["String"]], " message ", ["operator", "="], - ["class-name", "String"], + ["class-name", ["String"]], ["punctuation", "."], ["function", "join"], ["punctuation", "("], @@ -225,10 +234,12 @@ ["punctuation", ")"], ["punctuation", ";"] ]], + "\r\n * ", ["code", [ ["comment", "// message returned is: \"Java-is-cool\""] ]], + "\r\n *" ]], ["punctuation", "}"], @@ -239,6 +250,7 @@ ]], ["punctuation", ">"] ]], + "\r\n *\r\n * ", ["tag", [ ["tag", [ @@ -247,6 +259,7 @@ ]], ["punctuation", ">"] ]], + ["code-section", [ "* ", ["line", [ @@ -262,6 +275,7 @@ ["number", "1"] ]] ]], + "\r\n *" ]], ["tag", [ @@ -271,6 +285,7 @@ ]], ["punctuation", ">"] ]], + "\r\n *\r\n * ", ["tag", [ ["tag", [ @@ -279,6 +294,7 @@ ]], ["punctuation", ">"] ]], + ["code-section", [ "* ", ["line", [ @@ -296,9 +312,7 @@ ]], ["punctuation", ">"] ]], - ["code", [ - "c" - ]], + ["code", ["c"]], ["tag", [ ["tag", [ ["punctuation", ""] ]], - ["code", [ - "b" - ]], + ["code", ["b"]], ["tag", [ ["tag", [ ["punctuation", ""] ]], + "\r\n *\r\n * ", ["tag", [ ["tag", [ @@ -400,53 +415,59 @@ ]], ["punctuation", "{"], ["keyword", "@code"], + ["code-section", [ "* ", ["code", [ ["keyword", "interface"], - ["class-name", "ArchiveSearcher"], + ["class-name", ["ArchiveSearcher"]], ["punctuation", "{"], - ["class-name", "String"], + ["class-name", ["String"]], ["function", "search"], ["punctuation", "("], - ["class-name", "String"], + ["class-name", ["String"]], " target", ["punctuation", ")"], ["punctuation", ";"], ["punctuation", "}"] ]], + "\r\n * ", ["code", [ ["keyword", "class"], - ["class-name", "App"], + ["class-name", ["App"]], ["punctuation", "{"] ]], + "\r\n * ", ["code", [ ["keyword", "void"], ["function", "showSearch"], ["punctuation", "("], ["keyword", "final"], - ["class-name", "String"], + ["class-name", ["String"]], " target", ["punctuation", ")"] ]], + "\r\n * ", ["code", [ ["keyword", "throws"], - ["class-name", "InterruptedException"], + ["class-name", ["InterruptedException"]], ["punctuation", "{"] ]], + "\r\n * ", ["code", [ - ["class-name", "Future"], + ["class-name", ["Future"]], ["generics", [ ["punctuation", "<"], - ["class-name", "String"], + ["class-name", ["String"]], ["punctuation", ">"] ]], " future" ]], + "\r\n * ", ["code", [ ["operator", "="], @@ -455,25 +476,27 @@ ["function", "submit"], ["punctuation", "("], ["keyword", "new"], - ["class-name", "Callable"], + ["class-name", ["Callable"]], ["generics", [ ["punctuation", "<"], - ["class-name", "String"], + ["class-name", ["String"]], ["punctuation", ">"] ]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", "{"] ]], + "\r\n * ", ["code", [ ["keyword", "public"], - ["class-name", "String"], + ["class-name", ["String"]], ["function", "call"], ["punctuation", "("], ["punctuation", ")"], ["punctuation", "{"] ]], + "\r\n * ", ["code", [ ["keyword", "return"], @@ -485,6 +508,7 @@ ["punctuation", ")"], ["punctuation", ";"] ]], + "\r\n * ", ["code", [ ["punctuation", "}"], @@ -492,6 +516,7 @@ ["punctuation", ")"], ["punctuation", ";"] ]], + "\r\n * ", ["code", [ ["function", "displayOtherThings"], @@ -500,11 +525,13 @@ ["punctuation", ";"], ["comment", "// do other things while searching"] ]], + "\r\n * ", ["code", [ ["keyword", "try"], ["punctuation", "{"] ]], + "\r\n * ", ["code", [ ["function", "displayText"], @@ -518,12 +545,13 @@ ["punctuation", ";"], ["comment", "// use future"] ]], + "\r\n * ", ["code", [ ["punctuation", "}"], ["keyword", "catch"], ["punctuation", "("], - ["class-name", "ExecutionException"], + ["class-name", ["ExecutionException"]], " ex", ["punctuation", ")"], ["punctuation", "{"], @@ -535,10 +563,12 @@ ["punctuation", ";"], ["punctuation", "}"] ]], + "\r\n * ", ["code", [ ["punctuation", "}"] ]], + "\r\n * ", ["code", [ ["punctuation", "}"] @@ -552,6 +582,7 @@ ]], ["punctuation", ">"] ]], + "\r\n */" ] diff --git a/tests/languages/javascript!+graphql+js-templates/graphql_inclusion.test b/tests/languages/javascript!+graphql+js-templates/graphql_inclusion.test index e1f6963589..64059f5150 100644 --- a/tests/languages/javascript!+graphql+js-templates/graphql_inclusion.test +++ b/tests/languages/javascript!+graphql+js-templates/graphql_inclusion.test @@ -10,21 +10,23 @@ graphql.experimental`{ foo }` ["template-punctuation", "`"], ["graphql", [ ["punctuation", "{"], - " foo ", + ["property", "foo"], ["punctuation", "}"] ]], ["template-punctuation", "`"] ]], + "\r\ngraphql", ["template-string", [ ["template-punctuation", "`"], ["graphql", [ ["punctuation", "{"], - " foo ", + ["property", "foo"], ["punctuation", "}"] ]], ["template-punctuation", "`"] ]], + "\r\ngraphql", ["punctuation", "."], "experimental", @@ -32,7 +34,7 @@ graphql.experimental`{ foo }` ["template-punctuation", "`"], ["graphql", [ ["punctuation", "{"], - " foo ", + ["property", "foo"], ["punctuation", "}"] ]], ["template-punctuation", "`"] diff --git a/tests/languages/javascript!+js-extras/control-flow_feature.test b/tests/languages/javascript!+js-extras/control-flow_feature.test new file mode 100644 index 0000000000..7dd9d4683d --- /dev/null +++ b/tests/languages/javascript!+js-extras/control-flow_feature.test @@ -0,0 +1,35 @@ +await +break +catch +continue +do +else +finally +for +if +return +switch +throw +try +while +yield + +---------------------------------------------------- + +[ + ["keyword", "await"], + ["keyword", "break"], + ["keyword", "catch"], + ["keyword", "continue"], + ["keyword", "do"], + ["keyword", "else"], + ["keyword", "finally"], + ["keyword", "for"], + ["keyword", "if"], + ["keyword", "return"], + ["keyword", "switch"], + ["keyword", "throw"], + ["keyword", "try"], + ["keyword", "while"], + ["keyword", "yield"] +] diff --git a/tests/languages/javascript!+js-extras/exports_feature.test b/tests/languages/javascript!+js-extras/exports_feature.test new file mode 100644 index 0000000000..4c7aa50c4f --- /dev/null +++ b/tests/languages/javascript!+js-extras/exports_feature.test @@ -0,0 +1,173 @@ +export * from "mod"; +export * as Foo from "mod"; +export {} from "mod"; +export {x} from "mod"; +export {d} from "mod"; +export {d,} from "mod"; +export {d as Foo, b as Bar} from "mod"; +export {d as Foo, b as Bar,} from "mod"; +export {} +export {x} +export {d} +export {d,} +export {d as Foo, b as Bar} +export {d as Foo, b as Bar,} +export default function() { } + +---------------------------------------------------- + +[ + ["keyword", "export"], + ["exports", [ + ["operator", "*"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["operator", "*"], + ["keyword", "as"], + ["maybe-class-name", "Foo"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "x", + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d", + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d", + ["punctuation", ","], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d ", + ["keyword", "as"], + ["maybe-class-name", "Foo"], + ["punctuation", ","], + " b ", + ["keyword", "as"], + ["maybe-class-name", "Bar"], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d ", + ["keyword", "as"], + ["maybe-class-name", "Foo"], + ["punctuation", ","], + " b ", + ["keyword", "as"], + ["maybe-class-name", "Bar"], + ["punctuation", ","], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + ["punctuation", "}"] + ]], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "x", + ["punctuation", "}"] + ]], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d", + ["punctuation", "}"] + ]], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d", + ["punctuation", ","], + ["punctuation", "}"] + ]], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d ", + ["keyword", "as"], + ["maybe-class-name", "Foo"], + ["punctuation", ","], + " b ", + ["keyword", "as"], + ["maybe-class-name", "Bar"], + ["punctuation", "}"] + ]], + + ["keyword", "export"], + ["exports", [ + ["punctuation", "{"], + "d ", + ["keyword", "as"], + ["maybe-class-name", "Foo"], + ["punctuation", ","], + " b ", + ["keyword", "as"], + ["maybe-class-name", "Bar"], + ["punctuation", ","], + ["punctuation", "}"] + ]], + + ["keyword", "export"], + ["keyword", "default"], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/javascript!+js-extras/imports_feature.test b/tests/languages/javascript!+js-extras/imports_feature.test new file mode 100644 index 0000000000..6e69c6f53d --- /dev/null +++ b/tests/languages/javascript!+js-extras/imports_feature.test @@ -0,0 +1,124 @@ +import React from 'react'; +import x from "mod"; +import * as Foo from "mod"; +import {} from "mod"; +import {d} from "mod"; +import {d,} from "mod"; +import {d as Foo, b as Bar} from "mod"; +import {d as Foo, b as Bar,} from "mod"; +import Foo, { Bar } from "mod"; +import Foo, * as Bar from "mod"; + +import "mod"; + +---------------------------------------------------- + +[ + ["keyword", "import"], + ["imports", [ + ["maybe-class-name", "React"] + ]], + ["keyword", "from"], + ["string", "'react'"], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + "x" + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["operator", "*"], + ["keyword", "as"], + ["maybe-class-name", "Foo"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["punctuation", "{"], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["punctuation", "{"], + "d", + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["punctuation", "{"], + "d", + ["punctuation", ","], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["punctuation", "{"], + "d ", + ["keyword", "as"], + ["maybe-class-name", "Foo"], + ["punctuation", ","], + " b ", + ["keyword", "as"], + ["maybe-class-name", "Bar"], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["punctuation", "{"], + "d ", + ["keyword", "as"], + ["maybe-class-name", "Foo"], + ["punctuation", ","], + " b ", + ["keyword", "as"], + ["maybe-class-name", "Bar"], + ["punctuation", ","], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["maybe-class-name", "Foo"], + ["punctuation", ","], + ["punctuation", "{"], + ["maybe-class-name", "Bar"], + ["punctuation", "}"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + ["keyword", "import"], + ["imports", [ + ["maybe-class-name", "Foo"], + ["punctuation", ","], + ["operator", "*"], + ["keyword", "as"], + ["maybe-class-name", "Bar"] + ]], + ["keyword", "from"], + ["string", "\"mod\""], + ["punctuation", ";"], + + ["keyword", "import"], + ["string", "\"mod\""], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/javascript!+js-extras/maybe-class-name_feature.test b/tests/languages/javascript!+js-extras/maybe-class-name_feature.test index 061164b981..f58658d965 100644 --- a/tests/languages/javascript!+js-extras/maybe-class-name_feature.test +++ b/tests/languages/javascript!+js-extras/maybe-class-name_feature.test @@ -25,9 +25,7 @@ foo.Bar = function() {}; ["maybe-class-name", "Baz"], ["punctuation", "."], - ["method", [ - "foo" - ]], + ["method", ["foo"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], @@ -44,7 +42,7 @@ foo.Bar = function() {}; ["punctuation", "}"], ["punctuation", ";"], - "\nfoo", + "\r\nfoo", ["punctuation", "."], ["method-variable", [ ["maybe-class-name", "Bar"] diff --git a/tests/languages/javascript!+js-extras/method-variable_feature.test b/tests/languages/javascript!+js-extras/method-variable_feature.test index 2ceaf13abe..64d59fe5d3 100644 --- a/tests/languages/javascript!+js-extras/method-variable_feature.test +++ b/tests/languages/javascript!+js-extras/method-variable_feature.test @@ -7,9 +7,7 @@ this.bar = () => {}; [ "foo", ["punctuation", "."], - ["method-variable", [ - "bar" - ]], + ["method-variable", ["bar"]], ["operator", "="], ["keyword", "function"], ["punctuation", "("], @@ -18,11 +16,9 @@ this.bar = () => {}; ["punctuation", "}"], ["punctuation", ";"], - "\nfoo", + "\r\nfoo", ["punctuation", "."], - ["method-variable", [ - "bar" - ]], + ["method-variable", ["bar"]], ["operator", "="], ["keyword", "async"], ["punctuation", "("], @@ -34,9 +30,7 @@ this.bar = () => {}; ["keyword", "this"], ["punctuation", "."], - ["method-variable", [ - "bar" - ]], + ["method-variable", ["bar"]], ["operator", "="], ["punctuation", "("], ["punctuation", ")"], diff --git a/tests/languages/javascript!+js-extras/method_feature.test b/tests/languages/javascript!+js-extras/method_feature.test index 9e79a635d7..80e2c51a6c 100644 --- a/tests/languages/javascript!+js-extras/method_feature.test +++ b/tests/languages/javascript!+js-extras/method_feature.test @@ -7,31 +7,23 @@ this.#bar(); [ "foo", ["punctuation", "."], - ["method", [ - "bar" - ]], + ["method", ["bar"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], - "\nfoo", + "\r\nfoo", ["punctuation", "."], - ["method", [ - "bar" - ]], + ["method", ["bar"]], ["punctuation", "."], - ["method", [ - "call" - ]], + ["method", ["call"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], ["keyword", "this"], ["punctuation", "."], - ["method", [ - "#bar" - ]], + ["method", ["#bar"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"] diff --git a/tests/languages/javascript!+js-extras/nil_feature.test b/tests/languages/javascript!+js-extras/nil_feature.test new file mode 100644 index 0000000000..e5dded24a4 --- /dev/null +++ b/tests/languages/javascript!+js-extras/nil_feature.test @@ -0,0 +1,9 @@ +null +undefined + +---------------------------------------------------- + +[ + ["keyword", "null"], + ["keyword", "undefined"] +] diff --git a/tests/languages/javascript!+regex/regex_inclusion.test b/tests/languages/javascript!+regex/regex_inclusion.test index 6de6922438..bb787a2f5a 100644 --- a/tests/languages/javascript!+regex/regex_inclusion.test +++ b/tests/languages/javascript!+regex/regex_inclusion.test @@ -5,21 +5,21 @@ [ ["regex", [ ["regex-delimiter", "/"], - ["language-regex", [ + ["regex-source", [ "a", ["quantifier", "+"], ["group", ["(?:"]], - ["charset", [ - ["charset-punctuation", "["], + ["char-class", [ + ["char-class-punctuation", "["], ["range", [ "a", ["range-punctuation", "-"], "z" ]], - ["charset-punctuation", "]"] + ["char-class-punctuation", "]"] ]], ["alternation", "|"], - ["charclass", "\\d"], + ["char-set", "\\d"], ["group", ")"], ["quantifier", "?"] ]], diff --git a/tests/languages/javascript!+sql+js-templates/sql_inclusion.test b/tests/languages/javascript!+sql+js-templates/sql_inclusion.test new file mode 100644 index 0000000000..ffde8a0891 --- /dev/null +++ b/tests/languages/javascript!+sql+js-templates/sql_inclusion.test @@ -0,0 +1,36 @@ +const users = await sql` + SELECT * FROM users WHERE id = ${id} +`; + +---------------------------------------------------- + +[ + ["keyword", "const"], + " users ", + ["operator", "="], + ["keyword", "await"], + " sql", + ["template-string", [ + ["template-punctuation", "`"], + ["sql", [ + ["keyword", "SELECT"], + ["operator", "*"], + ["keyword", "FROM"], + " users ", + ["keyword", "WHERE"], + " id ", + ["operator", "="], + ["interpolation", [ + ["interpolation-punctuation", "${"], + "id", + ["interpolation-punctuation", "}"] + ]] + ]], + ["template-punctuation", "`"] + ]], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for tagged template literals containing SQL code. diff --git a/tests/languages/javascript+haml/javascript_inclusion.test b/tests/languages/javascript+haml/javascript_inclusion.test index 2420e60f12..2faae7b676 100644 --- a/tests/languages/javascript+haml/javascript_inclusion.test +++ b/tests/languages/javascript+haml/javascript_inclusion.test @@ -10,15 +10,19 @@ [ ["filter-javascript", [ ["filter-name", ":javascript"], - ["number", "0xBadFace"] + ["text", [ + ["number", "0xBadFace"] + ]] ]], ["punctuation", "~"], ["filter-javascript", [ ["filter-name", ":javascript"], - ["number", "0xBadFace"] + ["text", [ + ["number", "0xBadFace"] + ]] ]] ] ---------------------------------------------------- -Checks for JavaScript filter in Haml. The tilde serves only as a separator. \ No newline at end of file +Checks for JavaScript filter in Haml. The tilde serves only as a separator. diff --git a/tests/languages/javascript+http/issue2733.test b/tests/languages/javascript+http/issue2733.test new file mode 100644 index 0000000000..d041490d46 --- /dev/null +++ b/tests/languages/javascript+http/issue2733.test @@ -0,0 +1,128 @@ +HTTP/1.1 200 OK +connection: keep-alive +content-type: application/json +date: Sat, 23 Jan 2021 20:36:14 GMT +keep-alive: timeout=60 +transfer-encoding: chunked + +{ + "id": 1, + "name": "John Doe", + "userName": "jdoe", + "email": "whatever@something.zzz", + "phone": "1234567890", + "birthDate": "1878-05-06", + "address": { + "street": "Fake St", + "street2": "Apt. 556", + "city": "Gwenborough", + "state": "ZZ", + "zip": "12345" + } +} + +---------------------------------------------------- + +[ + ["response-status", [ + ["http-version", "HTTP/1.1"], + ["status-code", "200"], + ["reason-phrase", "OK"] + ]], + + ["header", [ + ["header-name", "connection"], + ["punctuation", ":"], + ["header-value", "keep-alive"] + ]], + + ["header", [ + ["header-name", "content-type"], + ["punctuation", ":"], + ["header-value", "application/json"] + ]], + + ["header", [ + ["header-name", "date"], + ["punctuation", ":"], + ["header-value", "Sat, 23 Jan 2021 20:36:14 GMT"] + ]], + + ["header", [ + ["header-name", "keep-alive"], + ["punctuation", ":"], + ["header-value", "timeout=60"] + ]], + + ["header", [ + ["header-name", "transfer-encoding"], + ["punctuation", ":"], + ["header-value", "chunked"] + ]], + + ["application-json", [ + ["punctuation", "{"], + + ["string-property", "\"id\""], + ["operator", ":"], + ["number", "1"], + ["punctuation", ","], + + ["string-property", "\"name\""], + ["operator", ":"], + ["string", "\"John Doe\""], + ["punctuation", ","], + + ["string-property", "\"userName\""], + ["operator", ":"], + ["string", "\"jdoe\""], + ["punctuation", ","], + + ["string-property", "\"email\""], + ["operator", ":"], + ["string", "\"whatever@something.zzz\""], + ["punctuation", ","], + + ["string-property", "\"phone\""], + ["operator", ":"], + ["string", "\"1234567890\""], + ["punctuation", ","], + + ["string-property", "\"birthDate\""], + ["operator", ":"], + ["string", "\"1878-05-06\""], + ["punctuation", ","], + + ["string-property", "\"address\""], + ["operator", ":"], + ["punctuation", "{"], + + ["string-property", "\"street\""], + ["operator", ":"], + ["string", "\"Fake St\""], + ["punctuation", ","], + + ["string-property", "\"street2\""], + ["operator", ":"], + ["string", "\"Apt. 556\""], + ["punctuation", ","], + + ["string-property", "\"city\""], + ["operator", ":"], + ["string", "\"Gwenborough\""], + ["punctuation", ","], + + ["string-property", "\"state\""], + ["operator", ":"], + ["string", "\"ZZ\""], + ["punctuation", ","], + + ["string-property", "\"zip\""], + ["operator", ":"], + ["string", "\"12345\""], + + ["punctuation", "}"], + + ["punctuation", "}"] + ]] +] diff --git a/tests/languages/javascript+http/javascript_inclusion.test b/tests/languages/javascript+http/javascript_inclusion.test index 32aa765330..b1886b300f 100644 --- a/tests/languages/javascript+http/javascript_inclusion.test +++ b/tests/languages/javascript+http/javascript_inclusion.test @@ -5,8 +5,11 @@ var a = true; ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " application/javascript", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "application/javascript"] + ]], ["application-javascript", [ ["keyword", "var"], " a ", diff --git a/tests/languages/javascript/class-method_feature.test b/tests/languages/javascript/class-method_feature.test index f2f1e2dedf..31d08e3415 100644 --- a/tests/languages/javascript/class-method_feature.test +++ b/tests/languages/javascript/class-method_feature.test @@ -57,10 +57,10 @@ class Test { ["punctuation", "("], ["parameter", [ ["punctuation", "{"], - " props", + ["literal-property", "props"], ["operator", ":"], ["punctuation", "{"], - " a", + ["literal-property", "a"], ["operator", ":"], " _A", ["punctuation", ","], diff --git a/tests/languages/javascript/constant_feature.test b/tests/languages/javascript/constant_feature.test index 760d0f4f9e..3ddcefecae 100644 --- a/tests/languages/javascript/constant_feature.test +++ b/tests/languages/javascript/constant_feature.test @@ -6,10 +6,22 @@ gl.FLOAT_MAT2x4; ---------------------------------------------------- [ - ["keyword", "var"], ["constant", "FOO"], ["punctuation", ";"], - ["keyword", "const"], ["constant", "FOO_BAR"], ["punctuation", ";"], - ["keyword", "const"], ["constant", "BAZ42"], ["punctuation", ";"], - "\ngl", ["punctuation", "."], ["constant", "FLOAT_MAT2x4"], ["punctuation", ";"] + ["keyword", "var"], + ["constant", "FOO"], + ["punctuation", ";"], + + ["keyword", "const"], + ["constant", "FOO_BAR"], + ["punctuation", ";"], + + ["keyword", "const"], + ["constant", "BAZ42"], + ["punctuation", ";"], + + "\r\ngl", + ["punctuation", "."], + ["constant", "FLOAT_MAT2x4"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/javascript/function-variable_feature.test b/tests/languages/javascript/function-variable_feature.test index 37d08f9c18..2ebc2a97e5 100644 --- a/tests/languages/javascript/function-variable_feature.test +++ b/tests/languages/javascript/function-variable_feature.test @@ -43,8 +43,8 @@ a = function () {}, b = () => {} ["punctuation", "("], ["punctuation", ")"], ["punctuation", "{"], - ["punctuation","}"], - ["punctuation","}"], + ["punctuation", "}"], + ["punctuation", "}"], ["function-variable", "bar"], ["operator", "="], @@ -52,9 +52,7 @@ a = function () {}, b = () => {} ["keyword", "function"], ["function", "baz"], ["punctuation", "("], - ["parameter", [ - "x" - ]], + ["parameter", ["x"]], ["punctuation", ")"], ["punctuation", "{"], ["punctuation", "}"], @@ -63,18 +61,16 @@ a = function () {}, b = () => {} ["operator", "="], ["keyword", "async"], ["punctuation", "("], - ["parameter", [ - "x" - ]], + ["parameter", ["x"]], ["punctuation", ")"], - ["operator", "=>"], " x\r\n", + ["operator", "=>"], + " x\r\n", ["function-variable", "fooBar"], ["operator", "="], - ["parameter", [ - "x" - ]], - ["operator", "=>"], " x\r\n", + ["parameter", ["x"]], + ["operator", "=>"], + " x\r\n", ["function-variable", "fooBar"], ["operator", "="], @@ -85,7 +81,8 @@ a = function () {}, b = () => {} " y" ]], ["punctuation", ")"], - ["operator", "=>"], " x\r\n", + ["operator", "=>"], + " x\r\n", ["function-variable", "ಠ_ಠ"], ["operator", "="], @@ -118,10 +115,10 @@ a = function () {}, b = () => {} ["punctuation", "("], ["parameter", [ ["punctuation", "{"], - " props", + ["literal-property", "props"], ["operator", ":"], ["punctuation", "{"], - " a", + ["literal-property", "a"], ["operator", ":"], " _A", ["punctuation", ","], diff --git a/tests/languages/javascript/function_feature.test b/tests/languages/javascript/function_feature.test index 3665f673c1..fcd88c97f3 100644 --- a/tests/languages/javascript/function_feature.test +++ b/tests/languages/javascript/function_feature.test @@ -15,19 +15,70 @@ foo({ y: fun() }) ---------------------------------------------------- [ - ["function", "foo"], ["punctuation", "("], ["punctuation", ")"], - ["function", "foo"], ["punctuation", "("], ["punctuation", ")"], - ["function", "foo"], ["punctuation", "."], ["function", "call"], ["punctuation", "("], ["punctuation", ")"], - ["function", "foo_bar"], ["punctuation", "("], ["punctuation", ")"], - ["function", "foo_bar"], ["punctuation", "("], ["punctuation", ")"], - ["function", "f42"], ["punctuation", "("], ["punctuation", ")"], - ["function", "_"], ["punctuation", "("], ["punctuation", ")"], - ["function", "$"], ["punctuation", "("], ["punctuation", ")"], - ["function", "ಠ_ಠ"], ["punctuation", "("], ["punctuation", ")"], - ["function", "Ƞȡ_҇"], ["punctuation", "("], ["punctuation", ")"], - ["keyword", "if"], ["punctuation", "("], "notAFunction", ["punctuation", ")"], - ["function", "foo"], ["punctuation", "("], ["punctuation", "{"], " x ", ["punctuation", "}"], ["punctuation", ")"], - ["function", "foo"], ["punctuation", "("], ["punctuation", "{"], " y", ["operator", ":"], ["function", "fun"], ["punctuation", "("], ["punctuation", ")"], ["punctuation", "}"], ["punctuation", ")"] + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "."], + ["function", "call"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo_bar"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo_bar"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "f42"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "_"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "$"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "ಠ_ಠ"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "Ƞȡ_҇"], + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "if"], + ["punctuation", "("], + "notAFunction", + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["punctuation", "{"], + " x ", + ["punctuation", "}"], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["punctuation", "{"], + ["literal-property", "y"], + ["operator", ":"], + ["function", "fun"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", ")"] ] ---------------------------------------------------- diff --git a/tests/languages/javascript/getter-setter_feature.test b/tests/languages/javascript/getter-setter_feature.test index a86a7dc661..6063b09b6b 100644 --- a/tests/languages/javascript/getter-setter_feature.test +++ b/tests/languages/javascript/getter-setter_feature.test @@ -1,115 +1,121 @@ -const obj = { - get name() { return 'bar'; }, - get [expr]() { return 'bar'; }, - async get name() { return 'bar'; }, - set name(val) { }, - set [expr](val) { }, - async set [expr](val) { }, -}; - -// not keywords -get(); -set(foo); - ----------------------------------------------------- - -[ - ["keyword", "const"], - " obj ", - ["operator", "="], - ["punctuation", "{"], - - ["keyword", "get"], - ["function", "name"], - ["punctuation", "("], - ["punctuation", ")"], - ["punctuation", "{"], - ["keyword", "return"], - ["string", "'bar'"], - ["punctuation", ";"], - ["punctuation", "}"], - ["punctuation", ","], - - ["keyword", "get"], - ["punctuation", "["], - "expr", - ["punctuation", "]"], - ["punctuation", "("], - ["punctuation", ")"], - ["punctuation", "{"], - ["keyword", "return"], - ["string", "'bar'"], - ["punctuation", ";"], - ["punctuation", "}"], - ["punctuation", ","], - - ["keyword", "async"], - ["keyword", "get"], - ["function", "name"], - ["punctuation", "("], - ["punctuation", ")"], - ["punctuation", "{"], - ["keyword", "return"], - ["string", "'bar'"], - ["punctuation", ";"], - ["punctuation", "}"], - ["punctuation", ","], - - ["keyword", "set"], - ["function", "name"], - ["punctuation", "("], - ["parameter", [ - "val" - ]], - ["punctuation", ")"], - ["punctuation", "{"], - ["punctuation", "}"], - ["punctuation", ","], - - ["keyword", "set"], - ["punctuation", "["], - "expr", - ["punctuation", "]"], - ["punctuation", "("], - ["parameter", [ - "val" - ]], - ["punctuation", ")"], - ["punctuation", "{"], - ["punctuation", "}"], - ["punctuation", ","], - - ["keyword", "async"], - ["keyword", "set"], - ["punctuation", "["], - "expr", - ["punctuation", "]"], - ["punctuation", "("], - ["parameter", [ - "val" - ]], - ["punctuation", ")"], - ["punctuation", "{"], - ["punctuation", "}"], - ["punctuation", ","], - - ["punctuation", "}"], - ["punctuation", ";"], - - ["comment", "// not keywords"], - - ["function", "get"], - ["punctuation", "("], - ["punctuation", ")"], - ["punctuation", ";"], - - ["function", "set"], - ["punctuation", "("], - "foo", - ["punctuation", ")"], - ["punctuation", ";"] -] - ----------------------------------------------------- - -Checks for getters and setters. +const obj = { + get name() { return 'bar'; }, + get [expr]() { return 'bar'; }, + async get name() { return 'bar'; }, + set name(val) { }, + set [expr](val) { }, + async set [expr](val) { }, + get #x() { return #xValue; }, +}; + +// not keywords +get(); +set(foo); + +---------------------------------------------------- + +[ + ["keyword", "const"], + " obj ", + ["operator", "="], + ["punctuation", "{"], + + ["keyword", "get"], + ["function", "name"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "return"], + ["string", "'bar'"], + ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "get"], + ["punctuation", "["], + "expr", + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "return"], + ["string", "'bar'"], + ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "async"], + ["keyword", "get"], + ["function", "name"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "return"], + ["string", "'bar'"], + ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "set"], + ["function", "name"], + ["punctuation", "("], + ["parameter", ["val"]], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "set"], + ["punctuation", "["], + "expr", + ["punctuation", "]"], + ["punctuation", "("], + ["parameter", ["val"]], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "async"], + ["keyword", "set"], + ["punctuation", "["], + "expr", + ["punctuation", "]"], + ["punctuation", "("], + ["parameter", ["val"]], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + + ["keyword", "get"], + ["function", "#x"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "return"], + " #xValue", + ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", ","], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["comment", "// not keywords"], + + ["function", "get"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "set"], + ["punctuation", "("], + "foo", + ["punctuation", ")"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for getters and setters. diff --git a/tests/languages/javascript/hashbang_feature.test b/tests/languages/javascript/hashbang_feature.test new file mode 100644 index 0000000000..ba423f33f0 --- /dev/null +++ b/tests/languages/javascript/hashbang_feature.test @@ -0,0 +1,23 @@ +#!/usr/bin/env node +// in the Script Goal +'use strict'; +console.log(1); + +---------------------------------------------------- + +[ + ["hashbang", "#!/usr/bin/env node"], + + ["comment", "// in the Script Goal"], + + ["string", "'use strict'"], + ["punctuation", ";"], + + "\r\nconsole", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/javascript/issue1807.test b/tests/languages/javascript/issue1807.test index 4f65d9e78c..24bb08e91a 100644 --- a/tests/languages/javascript/issue1807.test +++ b/tests/languages/javascript/issue1807.test @@ -10,7 +10,8 @@ foo.var.new; ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], - "\nfoo", + + "\r\nfoo", ["punctuation", "."], "var", ["punctuation", "."], diff --git a/tests/languages/javascript/issue2694.test b/tests/languages/javascript/issue2694.test new file mode 100644 index 0000000000..53c06c9a2a --- /dev/null +++ b/tests/languages/javascript/issue2694.test @@ -0,0 +1,70 @@ +replace(/'/, `'`) + +const var1 = `this is fine`; +const var2 = `this is fine`; + +// `load bearing comment` + +const var3 = `break starts here`; +const var4 = `break ends here`; + +---------------------------------------------------- + +[ + ["function", "replace"], + ["punctuation", "("], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "'"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ","], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "'"], + ["template-punctuation", "`"] + ]], + ["punctuation", ")"], + + ["keyword", "const"], + " var1 ", + ["operator", "="], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "this is fine"], + ["template-punctuation", "`"] + ]], + ["punctuation", ";"], + + ["keyword", "const"], + " var2 ", + ["operator", "="], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "this is fine"], + ["template-punctuation", "`"] + ]], + ["punctuation", ";"], + + ["comment", "// `load bearing comment`"], + + ["keyword", "const"], + " var3 ", + ["operator", "="], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "break starts here"], + ["template-punctuation", "`"] + ]], + ["punctuation", ";"], + + ["keyword", "const"], + " var4 ", + ["operator", "="], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "break ends here"], + ["template-punctuation", "`"] + ]], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/javascript/keyword_feature.test b/tests/languages/javascript/keyword_feature.test index c5ae92ad74..b303733569 100644 --- a/tests/languages/javascript/keyword_feature.test +++ b/tests/languages/javascript/keyword_feature.test @@ -1,27 +1,71 @@ -catch finally; -async function; - -as; await; break; case; -class; const; continue; debugger; -default; delete; do; else; enum; -export; extends; for; -from; if; implements; -import; in; instanceof; interface; let; -new; null; of; package; private; -protected; public; return; static; -super; switch; this; throw; try; -typeof; undefined; var; void; while; -with; yield; +as; +await; +break; +case; +class; +const; +continue; +debugger; +default; +delete; +do; +else; +enum; +export; +extends; +for; +if; +implements; +import; +in; +instanceof; +interface; +let; +new; +null; +of; +package; +private; +protected; +public; +return; +static; +super; +switch; +this; +throw; +try; +typeof; +undefined; +var; +void; +while; +with; +yield; ----------------------------------------------------- +// contextual keywords -[ - ["keyword", "catch"], - ["keyword", "finally"], ["punctuation", ";"], +try {} catch {} finally {} +try {} catch (e) {} finally {} +async function (){} +async a => {} +async (a,b,c) => {} +import {} from "foo" +import {} from 'foo' +class { get foo(){} set baz(){} get [value](){} } - ["keyword", "async"], - ["keyword", "function"], ["punctuation", ";"], +// import assertion +import json from "./foo.json" assert { type: "json" }; + +// variables, not keywords + +const { async, from, to } = bar; +promise.catch(foo).finally(bar); +assert.equal(foo, bar); + +---------------------------------------------------- +[ ["keyword", "as"], ["punctuation", ";"], ["keyword", "await"], ["punctuation", ";"], ["keyword", "break"], ["punctuation", ";"], @@ -38,7 +82,6 @@ with; yield; ["keyword", "export"], ["punctuation", ";"], ["keyword", "extends"], ["punctuation", ";"], ["keyword", "for"], ["punctuation", ";"], - ["keyword", "from"], ["punctuation", ";"], ["keyword", "if"], ["punctuation", ";"], ["keyword", "implements"], ["punctuation", ";"], ["keyword", "import"], ["punctuation", ";"], @@ -66,7 +109,146 @@ with; yield; ["keyword", "void"], ["punctuation", ";"], ["keyword", "while"], ["punctuation", ";"], ["keyword", "with"], ["punctuation", ";"], - ["keyword", "yield"], ["punctuation", ";"] + ["keyword", "yield"], ["punctuation", ";"], + + ["comment", "// contextual keywords"], + + ["keyword", "try"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "catch"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "finally"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "try"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "catch"], + ["punctuation", "("], + "e", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "finally"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "async"], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "async"], + ["parameter", ["a"]], + ["operator", "=>"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "async"], + ["punctuation", "("], + ["parameter", [ + "a", + ["punctuation", ","], + "b", + ["punctuation", ","], + "c" + ]], + ["punctuation", ")"], + ["operator", "=>"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "import"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "from"], + ["string", "\"foo\""], + + ["keyword", "import"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'foo'"], + + ["keyword", "class"], + ["punctuation", "{"], + ["keyword", "get"], + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "set"], + ["function", "baz"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "get"], + ["punctuation", "["], + "value", + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "}"], + + ["comment", "// import assertion"], + + ["keyword", "import"], + " json ", + ["keyword", "from"], + ["string", "\"./foo.json\""], + ["keyword", "assert"], + ["punctuation", "{"], + ["literal-property", "type"], + ["operator", ":"], + ["string", "\"json\""], + ["punctuation", "}"], + ["punctuation", ";"], + + ["comment", "// variables, not keywords"], + + ["keyword", "const"], + ["punctuation", "{"], + " async", + ["punctuation", ","], + " from", + ["punctuation", ","], + " to ", + ["punctuation", "}"], + ["operator", "="], + " bar", + ["punctuation", ";"], + + "\r\npromise", + ["punctuation", "."], + ["function", "catch"], + ["punctuation", "("], + "foo", + ["punctuation", ")"], + ["punctuation", "."], + ["function", "finally"], + ["punctuation", "("], + "bar", + ["punctuation", ")"], + ["punctuation", ";"], + + "\r\nassert", + ["punctuation", "."], + ["function", "equal"], + ["punctuation", "("], + "foo", + ["punctuation", ","], + " bar", + ["punctuation", ")"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/javascript/number_feature.test b/tests/languages/javascript/number_feature.test index 817a7b0d68..d31c70ae02 100644 --- a/tests/languages/javascript/number_feature.test +++ b/tests/languages/javascript/number_feature.test @@ -23,6 +23,39 @@ Infinity 0.000_001 1e10_000 +0xf_f_f_f_ffn +0xf_f_f_f_f +0b1_1_1_1 +0b0_0_1_0_1_0_1n +0o1_1_3_2 +0o1_1_3_2n +2.2_4_54e64_33 +2.2_4_54e+64_33 +2.2_4_54e-64_33 +3_4_5 +3_4_5n +3_4_5.5_5_6 + +// not numbers +$1234; +$0xFF; +$0b0101; +$1234n; +$0xFFn; +$0b0101n; +_1234; +_0xFF; +_0b0101; +_1234n; +_0xFFn; +_0b0101n; +abc1234; +abc0xFF; +abc0b0101; +abc1234n; +abc0xFFn; +abc0b0101n; + ---------------------------------------------------- [ @@ -35,10 +68,13 @@ Infinity ["number", "0o571"], ["number", "0xbabe"], ["number", "0xBABE"], + ["number", "NaN"], ["number", "Infinity"], + ["number", "123n"], ["number", "0x123n"], + ["number", "1_000_000_000_000"], ["number", "1_000_000.220_720"], ["number", "0b0101_0110_0011_1000"], @@ -46,7 +82,40 @@ Infinity ["number", "0x40_76_38_6A_73"], ["number", "4_642_473_943_484_686_707n"], ["number", "0.000_001"], - ["number", "1e10_000"] + ["number", "1e10_000"], + + ["number", "0xf_f_f_f_ffn"], + ["number", "0xf_f_f_f_f"], + ["number", "0b1_1_1_1"], + ["number", "0b0_0_1_0_1_0_1n"], + ["number", "0o1_1_3_2"], + ["number", "0o1_1_3_2n"], + ["number", "2.2_4_54e64_33"], + ["number", "2.2_4_54e+64_33"], + ["number", "2.2_4_54e-64_33"], + ["number", "3_4_5"], + ["number", "3_4_5n"], + ["number", "3_4_5.5_5_6"], + + ["comment", "// not numbers"], + "\r\n$1234", ["punctuation", ";"], + "\r\n$0xFF", ["punctuation", ";"], + "\r\n$0b0101", ["punctuation", ";"], + "\r\n$1234n", ["punctuation", ";"], + "\r\n$0xFFn", ["punctuation", ";"], + "\r\n$0b0101n", ["punctuation", ";"], + "\r\n_1234", ["punctuation", ";"], + "\r\n_0xFF", ["punctuation", ";"], + "\r\n_0b0101", ["punctuation", ";"], + "\r\n_1234n", ["punctuation", ";"], + "\r\n_0xFFn", ["punctuation", ";"], + "\r\n_0b0101n", ["punctuation", ";"], + "\r\nabc1234", ["punctuation", ";"], + "\r\nabc0xFF", ["punctuation", ";"], + "\r\nabc0b0101", ["punctuation", ";"], + "\r\nabc1234n", ["punctuation", ";"], + "\r\nabc0xFFn", ["punctuation", ";"], + "\r\nabc0b0101n", ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/javascript/property_feature.test b/tests/languages/javascript/property_feature.test new file mode 100644 index 0000000000..594cfb4cc2 --- /dev/null +++ b/tests/languages/javascript/property_feature.test @@ -0,0 +1,159 @@ +{ foo: 0, bar: 0 }; +{ 'foo': 0, "bar": 0 }; +{ + // comment + foo: 0, + // comment + "bar": 0 +} + +const test = new TYPE.Application({ + key1: viewDim.x, + key2: viewDim.y, + key3: 0x89ddff, + key4: window.devicePixelRatio || 1, + key5: resize() +}); + +// doesn't conflict with function properties +{ + foo: () => 0, + bar: async function () {} +} + +// no problem with keywords +switch(foo) { + default: return true; +} + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["literal-property", "foo"], + ["operator", ":"], + ["number", "0"], + ["punctuation", ","], + ["literal-property", "bar"], + ["operator", ":"], + ["number", "0"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["punctuation", "{"], + ["string-property", "'foo'"], + ["operator", ":"], + ["number", "0"], + ["punctuation", ","], + ["string-property", "\"bar\""], + ["operator", ":"], + ["number", "0"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["punctuation", "{"], + + ["comment", "// comment"], + + ["literal-property", "foo"], + ["operator", ":"], + ["number", "0"], + ["punctuation", ","], + + ["comment", "// comment"], + + ["string-property", "\"bar\""], + ["operator", ":"], + ["number", "0"], + + ["punctuation", "}"], + + ["keyword", "const"], + " test ", + ["operator", "="], + ["keyword", "new"], + ["class-name", [ + "TYPE", + ["punctuation", "."], + "Application" + ]], + ["punctuation", "("], + ["punctuation", "{"], + + ["literal-property", "key1"], + ["operator", ":"], + " viewDim", + ["punctuation", "."], + "x", + ["punctuation", ","], + + ["literal-property", "key2"], + ["operator", ":"], + " viewDim", + ["punctuation", "."], + "y", + ["punctuation", ","], + + ["literal-property", "key3"], + ["operator", ":"], + ["number", "0x89ddff"], + ["punctuation", ","], + + ["literal-property", "key4"], + ["operator", ":"], + " window", + ["punctuation", "."], + "devicePixelRatio ", + ["operator", "||"], + ["number", "1"], + ["punctuation", ","], + + ["literal-property", "key5"], + ["operator", ":"], + ["function", "resize"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["comment", "// doesn't conflict with function properties"], + + ["punctuation", "{"], + + ["function-variable", "foo"], + ["operator", ":"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "=>"], + ["number", "0"], + ["punctuation", ","], + + ["function-variable", "bar"], + ["operator", ":"], + ["keyword", "async"], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "}"], + + ["comment", "// no problem with keywords"], + + ["keyword", "switch"], + ["punctuation", "("], + "foo", + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "default"], + ["operator", ":"], + ["keyword", "return"], + ["boolean", "true"], + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/javascript/regex_feature.test b/tests/languages/javascript/regex_feature.test index dddb74eb30..e9e52ef6c6 100644 --- a/tests/languages/javascript/regex_feature.test +++ b/tests/languages/javascript/regex_feature.test @@ -1,5 +1,5 @@ /foo bar/; -/foo/gimyus, +/foo/dgimyus, /[\[\]]{2,4}(?:foo)*/; /foo"test"bar/; /foo\//; @@ -17,35 +17,119 @@ yield /regex/; ---------------------------------------------------- [ - ["regex", "/foo bar/"], ["punctuation", ";"], - ["regex", "/foo/gimyus"], ["punctuation", ","], - ["regex", "/[\\[\\]]{2,4}(?:foo)*/"], ["punctuation", ";"], - ["regex", "/foo\"test\"bar/"], ["punctuation", ";"], - ["regex", "/foo\\//"], ["punctuation", ";"], - ["regex", "/[]/"], ["punctuation", ";"], - ["regex", "/[\\]/]/"], ["punctuation", ";"], - ["number", "1"], ["operator", "/"], ["number", "4"], ["operator", "+"], ["string", "\"/, not a regex\""], ["punctuation", ";"], - ["regex", "/ '1' '2' '3' '4' '5' /"], - ["punctuation", "["], ["regex", "/foo/"], ["punctuation", "]"], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "foo bar"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ";"], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "foo"], + ["regex-delimiter", "/"], + ["regex-flags", "dgimyus"] + ]], + ["punctuation", ","], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "[\\[\\]]{2,4}(?:foo)*"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ";"], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "foo\"test\"bar"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ";"], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "foo\\/"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ";"], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "[]"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ";"], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "[\\]/]"], + ["regex-delimiter", "/"] + ]], + ["punctuation", ";"], + + ["number", "1"], + ["operator", "/"], + ["number", "4"], + ["operator", "+"], + ["string", "\"/, not a regex\""], + ["punctuation", ";"], + + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", " '1' '2' '3' '4' '5' "], + ["regex-delimiter", "/"] + ]], + + ["punctuation", "["], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "foo"], + ["regex-delimiter", "/"] + ]], + ["punctuation", "]"], ["keyword", "let"], " a ", ["operator", "="], - ["regex", "/regex/m"], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "regex"], + ["regex-delimiter", "/"], + ["regex-flags", "m"] + ]], ["comment", "// comment"], + ["keyword", "let"], " b ", ["operator", "="], " condition ", ["operator", "?"], - ["regex", "/regex/"], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "regex"], + ["regex-delimiter", "/"] + ]], ["operator", ":"], - ["regex", "/another one/"], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "another one"], + ["regex-delimiter", "/"] + ]], + ["keyword", "return"], - ["regex", "/regex/"], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "regex"], + ["regex-delimiter", "/"] + ]], ["punctuation", ";"], + ["keyword", "yield"], - ["regex", "/regex/"], + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "regex"], + ["regex-delimiter", "/"] + ]], ["punctuation", ";"] ] diff --git a/tests/languages/javascript/supposed-classes_feature.test b/tests/languages/javascript/supposed-classes_feature.test index df85fd4fc5..32af49b89a 100644 --- a/tests/languages/javascript/supposed-classes_feature.test +++ b/tests/languages/javascript/supposed-classes_feature.test @@ -17,7 +17,7 @@ fooBar.prototype.bar; "constructor", ["punctuation", ";"], - "\nfooBar", + "\r\nfooBar", ["punctuation", "."], "prototype", ["punctuation", "."], diff --git a/tests/languages/javascript/template-string_feature.test b/tests/languages/javascript/template-string_feature.test index 97e7d0e396..10a2924581 100644 --- a/tests/languages/javascript/template-string_feature.test +++ b/tests/languages/javascript/template-string_feature.test @@ -18,11 +18,13 @@ console.log(`This is ${it.with({ type: false })}!`) ["string", "foo bar"], ["template-punctuation", "`"] ]], + ["template-string", [ ["template-punctuation", "`"], ["string", "foo\r\nbar"], ["template-punctuation", "`"] ]], + ["template-string", [ ["template-punctuation", "`"], ["string", "40+2="], @@ -35,6 +37,7 @@ console.log(`This is ${it.with({ type: false })}!`) ]], ["template-punctuation", "`"] ]], + ["template-string", [ ["template-punctuation", "`"], ["interpolation", [ @@ -46,6 +49,7 @@ console.log(`This is ${it.with({ type: false })}!`) ]], ["template-punctuation", "`"] ]], + ["template-string", [ ["template-punctuation", "`"], ["string", "\\${foo}"], @@ -56,13 +60,16 @@ console.log(`This is ${it.with({ type: false })}!`) ]], ["template-punctuation", "`"] ]], + ["string", "\"foo `a` `b` `c` `d` bar\""], + ["string", "\"test // test\""], ["template-string", [ ["template-punctuation", "`"], ["string", "template"], ["template-punctuation", "`"] ]], + "\r\n\r\nconsole", ["punctuation", "."], ["function", "log"], @@ -77,7 +84,7 @@ console.log(`This is ${it.with({ type: false })}!`) ["function", "with"], ["punctuation", "("], ["punctuation", "{"], - " type", + ["literal-property", "type"], ["operator", ":"], ["boolean", "false"], ["punctuation", "}"], @@ -88,12 +95,13 @@ console.log(`This is ${it.with({ type: false })}!`) ["template-punctuation", "`"] ]], ["punctuation", ")"], + ["template-string", [ ["template-punctuation", "`"], ["interpolation", [ ["interpolation-punctuation", "${"], ["punctuation", "{"], - "foo", + ["literal-property", "foo"], ["operator", ":"], ["string", "'bar'"], ["punctuation", "}"], diff --git a/tests/languages/javastacktrace/stack-frame_feature.test b/tests/languages/javastacktrace/stack-frame_feature.test index b4c400e458..e6cc3cc472 100644 --- a/tests/languages/javastacktrace/stack-frame_feature.test +++ b/tests/languages/javastacktrace/stack-frame_feature.test @@ -2,6 +2,15 @@ at Main.main(Main.java:13) at Main.main(Main.java:13) Same but with some additional notes at com.foo.bar.Main$FooBar.main(Native Method) at Main$FooBar.(Unknown Source) + at java.base/java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69) + at java.base/java.lang.Class.forName0(Native Method) +at com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101) +at com.foo.loader//com.foo.bar.App.run(App.java:12) +at acme@2.1/org.acme.Lib.test(Lib.java:80) +at MyClass.mash(MyClass.java:9) + +// not to forget our swiss friends +at at.foo.bar.Main$FooBar.main(Native Method) ---------------------------------------------------- @@ -33,16 +42,18 @@ at Main$FooBar.(Unknown Source) ]], ["punctuation", ")"] ]], - " Same but with some additional notes\n", + " Same but with some additional notes\r\n", ["stack-frame", [ ["keyword", "at"], - ["namespace", "com"], - ["punctuation", "."], - ["namespace", "foo"], - ["punctuation", "."], - ["namespace", "bar"], - ["punctuation", "."], + ["namespace", [ + "com", + ["punctuation", "."], + "foo", + ["punctuation", "."], + "bar", + ["punctuation", "."] + ]], ["class-name", "Main$FooBar"], ["punctuation", "."], ["function", "main"], @@ -63,6 +74,184 @@ at Main$FooBar.(Unknown Source) ["keyword", "Unknown Source"] ]], ["punctuation", ")"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["module", [ + "java", + ["punctuation", "."], + "base" + ]], + ["punctuation", "/"], + ["namespace", [ + "java", + ["punctuation", "."], + "util", + ["punctuation", "."], + "jar", + ["punctuation", "."] + ]], + ["class-name", "JavaUtilJarAccessImpl"], + ["punctuation", "."], + ["function", "ensureInitialization"], + ["punctuation", "("], + ["source", [ + ["file", "JavaUtilJarAccessImpl.java"], + ["punctuation", ":"], + ["line-number", "69"] + ]], + ["punctuation", ")"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["module", [ + "java", + ["punctuation", "."], + "base" + ]], + ["punctuation", "/"], + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."] + ]], + ["class-name", "Class"], + ["punctuation", "."], + ["function", "forName0"], + ["punctuation", "("], + ["source", [ + ["keyword", "Native Method"] + ]], + ["punctuation", ")"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["class-loader", [ + "com", + ["punctuation", "."], + "foo", + ["punctuation", "."], + "loader" + ]], + ["punctuation", "/"], + ["module", [ + "foo", + ["punctuation", "@"], + ["version", "9.0"] + ]], + ["punctuation", "/"], + ["namespace", [ + "com", + ["punctuation", "."], + "foo", + ["punctuation", "."] + ]], + ["class-name", "Main"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Main.java"], + ["punctuation", ":"], + ["line-number", "101"] + ]], + ["punctuation", ")"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["class-loader", [ + "com", + ["punctuation", "."], + "foo", + ["punctuation", "."], + "loader" + ]], + ["punctuation", "/"], + ["punctuation", "/"], + ["namespace", [ + "com", + ["punctuation", "."], + "foo", + ["punctuation", "."], + "bar", + ["punctuation", "."] + ]], + ["class-name", "App"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "App.java"], + ["punctuation", ":"], + ["line-number", "12"] + ]], + ["punctuation", ")"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["module", [ + "acme", + ["punctuation", "@"], + ["version", "2.1"] + ]], + ["punctuation", "/"], + ["namespace", [ + "org", + ["punctuation", "."], + "acme", + ["punctuation", "."] + ]], + ["class-name", "Lib"], + ["punctuation", "."], + ["function", "test"], + ["punctuation", "("], + ["source", [ + ["file", "Lib.java"], + ["punctuation", ":"], + ["line-number", "80"] + ]], + ["punctuation", ")"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["class-name", "MyClass"], + ["punctuation", "."], + ["function", "mash"], + ["punctuation", "("], + ["source", [ + ["file", "MyClass.java"], + ["punctuation", ":"], + ["line-number", "9"] + ]], + ["punctuation", ")"] + ]], + + "\r\n\r\n// not to forget our swiss friends\r\n", + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "at", + ["punctuation", "."], + "foo", + ["punctuation", "."], + "bar", + ["punctuation", "."] + ]], + ["class-name", "Main$FooBar"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["keyword", "Native Method"] + ]], + ["punctuation", ")"] ]] ] diff --git a/tests/languages/jexl/boolean_feature.test b/tests/languages/jexl/boolean_feature.test new file mode 100644 index 0000000000..4019c444f8 --- /dev/null +++ b/tests/languages/jexl/boolean_feature.test @@ -0,0 +1,13 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] + +---------------------------------------------------- + +Checks for booleans. \ No newline at end of file diff --git a/tests/languages/jexl/function_feature.test b/tests/languages/jexl/function_feature.test new file mode 100644 index 0000000000..37a325e041 --- /dev/null +++ b/tests/languages/jexl/function_feature.test @@ -0,0 +1,96 @@ +foo() +foo () +foo +() +foo . bar () +foo_bar() +foo_bar ( ) +f42() +_() +$() +ä() +Ý() +foo({ x: 1 }) +foo({ y: fun() }) +foo(bar()) + +---------------------------------------------------- + +[ + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo "], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo\r\n"], + ["punctuation", "("], + ["punctuation", ")"], + + "\r\nfoo ", + ["punctuation", "."], + ["function", "bar "], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo_bar"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo_bar "], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "f42"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "_"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "$"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "ä"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "Ý"], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["punctuation", "{"], + " x", + ["operator", ":"], + ["number", "1"], + ["punctuation", "}"], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["punctuation", "{"], + " y", + ["operator", ":"], + ["function", "fun"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "("], + ["function", "bar"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for functions. Also checks for unicode characters in identifiers. diff --git a/tests/languages/jexl/keyword_feature.test b/tests/languages/jexl/keyword_feature.test new file mode 100644 index 0000000000..4dc6bc035f --- /dev/null +++ b/tests/languages/jexl/keyword_feature.test @@ -0,0 +1,23 @@ +in +"foo" in ["foo"] +"f" in "foo" + +---------------------------------------------------- + +[ + ["keyword", "in"], + + ["string", "\"foo\""], + ["keyword", "in"], + ["punctuation", "["], + ["string", "\"foo\""], + ["punctuation", "]"], + + ["string", "\"f\""], + ["keyword", "in"], + ["string", "\"foo\""] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/jexl/number_feature.test b/tests/languages/jexl/number_feature.test new file mode 100644 index 0000000000..6ef7af7cb7 --- /dev/null +++ b/tests/languages/jexl/number_feature.test @@ -0,0 +1,15 @@ +42 +3.14159 +-5.7 + +---------------------------------------------------- + +[ + ["number", "42"], + ["number", "3.14159"], + ["operator", "-"], ["number", "5.7"] +] + +---------------------------------------------------- + +Checks for integers and floats. Negative numbers are handled differently than in Jexl for simplicity: In Jexl, the minus sign in "-1" is parsed as an operator in "1-1" and as part of the number literal in ("-1"). diff --git a/tests/languages/jexl/operator_feature.test b/tests/languages/jexl/operator_feature.test new file mode 100644 index 0000000000..c534dab044 --- /dev/null +++ b/tests/languages/jexl/operator_feature.test @@ -0,0 +1,33 @@ +- ++ +< <= +> >= +== +! != +&& || +* +/ // +^ +? : +% + +---------------------------------------------------- + +[ + ["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/jexl/string_feature.test b/tests/languages/jexl/string_feature.test new file mode 100644 index 0000000000..c95ee0ef88 --- /dev/null +++ b/tests/languages/jexl/string_feature.test @@ -0,0 +1,35 @@ +'a' +'ä' +'本' +'À' +'\'' +'""' +'Hello, +world!' + +"\n" +"\"" +"Hello, +world!" +"日本語" + +---------------------------------------------------- + +[ + ["string", "'a'"], + ["string", "'ä'"], + ["string", "'本'"], + ["string", "'À'"], + ["string", "'\\''"], + ["string", "'\"\"'"], + ["string", "'Hello,\r\nworld!'"], + + ["string", "\"\\n\""], + ["string", "\"\\\"\""], + ["string", "\"Hello,\r\nworld!\""], + ["string", "\"日本語\""] +] + +---------------------------------------------------- + +Jexl strings can contain special characters, and even linebreaks. \ No newline at end of file diff --git a/tests/languages/jexl/transform_feature.test b/tests/languages/jexl/transform_feature.test new file mode 100644 index 0000000000..576a793c2f --- /dev/null +++ b/tests/languages/jexl/transform_feature.test @@ -0,0 +1,55 @@ +"foo"|bar +"foo"| bar +"foo" +| +bar + +foo|Ý + +foo|bar() +foo|bar(1,2) +foo|bar( +1,2 +) + +---------------------------------------------------- + +[ + ["string", "\"foo\""], ["operator", "|"], ["transform", "bar"], + ["string", "\"foo\""], ["operator", "|"], ["transform", "bar"], + ["string", "\"foo\""], + ["operator", "|"], + ["transform", "bar"], + + "\r\n\r\nfoo", ["operator", "|"], ["transform", "Ý"], + + "\r\n\r\nfoo", + ["operator", "|"], + ["transform", "bar"], + ["punctuation", "("], + ["punctuation", ")"], + + "\r\nfoo", + ["operator", "|"], + ["transform", "bar"], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ")"], + + "\r\nfoo", + ["operator", "|"], + ["transform", "bar"], + ["punctuation", "("], + + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for transforms. Transforms follow the same naming rules as functions. diff --git a/tests/languages/jolie/builtin_feature.test b/tests/languages/jolie/builtin_feature.test new file mode 100644 index 0000000000..e76e16fbde --- /dev/null +++ b/tests/languages/jolie/builtin_feature.test @@ -0,0 +1,35 @@ +Byte +any +bool +char +double +enum +float +int +length +long +ranges +regex +string +undefined +void + +---------------------------------------------------- + +[ + ["builtin", "Byte"], + ["builtin", "any"], + ["builtin", "bool"], + ["builtin", "char"], + ["builtin", "double"], + ["builtin", "enum"], + ["builtin", "float"], + ["builtin", "int"], + ["builtin", "length"], + ["builtin", "long"], + ["builtin", "ranges"], + ["builtin", "regex"], + ["builtin", "string"], + ["builtin", "undefined"], + ["builtin", "void"] +] diff --git a/tests/languages/jolie/comment_feature.test b/tests/languages/jolie/comment_feature.test new file mode 100644 index 0000000000..90816a5b11 --- /dev/null +++ b/tests/languages/jolie/comment_feature.test @@ -0,0 +1,14 @@ +// single line + +/* +multiple +lines +*/ + +---------------------------------------------------- + +[ + ["comment", "// single line"], + + ["comment", "/*\r\nmultiple\r\nlines\r\n*/"] +] diff --git a/tests/languages/jolie/deployment_features.test b/tests/languages/jolie/deployment_features.test index e17a2a19c5..52e8f5122b 100644 --- a/tests/languages/jolie/deployment_features.test +++ b/tests/languages/jolie/deployment_features.test @@ -1,52 +1,152 @@ Aggregates: First, Second with Third + Redirects: First => Second, Third => Fourth + Jolie: "logger.ol" in LoggerService + log@LoggerService( new )(); println @ Console( "none" )() +outputPort OutputPort3 { + location: "socket://localhost:9002/" + protocol: sodep + interfaces: Interface3 +} + +interface MyInterface { +OneWay: + myOW( string ) +RequestResponse: + myRR( string )( string ) +} + +private service MainService { + embed ConfigurationService( ) as Conf + main { + getDBConn@Conf( )( res ) + } +} + ---------------------------------------------------- [ - ["keyword", "Aggregates"], - ["operator", ":"], + ["property", "Aggregates"], + ["punctuation", ":"], ["aggregates", [ - ["function", "First"], + ["class-name", "First"], ["punctuation", ","], - ["function", "Second"], - ["with-extension", [ - ["keyword", "with"], - " Third" - ]] + ["class-name", "Second"], + ["keyword", "with"], + ["class-name", "Third"] ]], - ["keyword", "Redirects"], - ["operator", ":"], + + ["property", "Redirects"], + ["punctuation", ":"], ["redirects", [ - ["function", "First"], - ["symbol", "=>"], - ["function", "Second"], + ["class-name", "First"], + ["operator", "=>"], + ["class-name", "Second"], ["punctuation", ","], - ["function", "Third"], - ["symbol", "=>"], - ["function", "Fourth"] + ["class-name", "Third"], + ["operator", "=>"], + ["class-name", "Fourth"] ]], - ["keyword", "Jolie"], - ["operator", ":"], + + ["property", "Jolie"], + ["punctuation", ":"], ["string", "\"logger.ol\""], ["keyword", "in"], - ["function", "LoggerService"], - "\nlog", - ["symbol", "@"], - ["function", "LoggerService"], - "( ", + ["class-name", "LoggerService"], + + ["function", "log"], + ["operator", "@"], + ["class-name", "LoggerService"], + ["punctuation", "("], ["keyword", "new"], - " )()", - ["symbol", ";"], - "\nprintln ", - ["symbol", "@"], - ["function", "Console"], - "( ", + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "println"], + ["operator", "@"], + ["class-name", "Console"], + ["punctuation", "("], ["string", "\"none\""], - " )()" + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "outputPort"], + ["class-name", "OutputPort3"], + ["punctuation", "{"], + + ["property", "location"], + ["punctuation", ":"], + ["string", "\"socket://localhost:9002/\""], + + ["property", "protocol"], + ["punctuation", ":"], + " sodep\r\n ", + + ["property", "interfaces"], + ["punctuation", ":"], + " Interface3\r\n", + + ["punctuation", "}"], + + ["keyword", "interface"], + " MyInterface ", + ["punctuation", "{"], + + ["property", "OneWay"], + ["punctuation", ":"], + + ["function", "myOW"], + ["punctuation", "("], + ["builtin", "string"], + ["punctuation", ")"], + + ["property", "RequestResponse"], + ["punctuation", ":"], + + ["function", "myRR"], + ["punctuation", "("], + ["builtin", "string"], + ["punctuation", ")"], + ["punctuation", "("], + ["builtin", "string"], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "private"], + ["keyword", "service"], + ["class-name", "MainService"], + ["punctuation", "{"], + + ["keyword", "embed"], + ["class-name", "ConfigurationService"], + ["punctuation", "("], + ["punctuation", ")"], + ["keyword", "as"], + ["class-name", "Conf"], + + ["keyword", "main"], + ["punctuation", "{"], + + ["function", "getDBConn"], + ["operator", "@"], + ["class-name", "Conf"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "("], + " res ", + ["punctuation", ")"], + + ["punctuation", "}"], + + ["punctuation", "}"] ] ---------------------------------------------------- diff --git a/tests/languages/jolie/keyword_feature.test b/tests/languages/jolie/keyword_feature.test index 9f04596221..b6b5fac9fb 100644 --- a/tests/languages/jolie/keyword_feature.test +++ b/tests/languages/jolie/keyword_feature.test @@ -1,130 +1,117 @@ -include -define -is_defined -undef -main -init -outputPort ; -inputPort ; -Location -Protocol -Interfaces -RequestResponse -OneWay -type -interface -extender -throws -cset -csets -forward -courier ; -Aggregates -Redirects -embedded -extender -execution -sequential -concurrent -single -scope -install -throw -comp -cH -default -global -linkIn -linkOut -synchronized -this -new -for -if -else -while -in ; -Jolie -Java -Javascript -nullProcess -spawn -constants -with -provide -until -exit -foreach -instanceof -over -service +as; +cH; +comp; +concurrent; +constants; +courier; +cset; +csets; +default; +define; +else; +embed; +embedded; +execution; +exit; +extender; +for; +foreach; +forward; +from; +global; +if; +import; +in; +include; +init; +inputPort; +install; +instanceof; +interface; +is_defined; +linkIn; +linkOut; +main; +new; +nullProcess; +outputPort; +over; +private; +provide; +public; +scope; +sequential; +service; +single; +spawn; +synchronized; +this; +throw; +throws; +type; +undef; +until; +while; +with; ---------------------------------------------------- + [ - ["keyword", "include"], - ["keyword", "define"], - ["keyword", "is_defined"], - ["keyword", "undef"], - ["keyword", "main"], - ["keyword", "init"], - ["keyword", "outputPort"], - ["symbol", ";"], - ["keyword", "inputPort"], - ["symbol", ";"], - ["keyword", "Location"], - ["keyword", "Protocol"], - ["keyword", "Interfaces"], - ["keyword", "RequestResponse"], - ["keyword", "OneWay"], - ["keyword", "type"], - ["keyword", "interface"], - ["keyword", "extender"], - ["keyword", "throws"], - ["keyword", "cset"], - ["keyword", "csets"], - ["keyword", "forward"], - ["keyword", "courier"], - ["symbol", ";"], - ["keyword", "Aggregates"], - ["keyword", "Redirects"], - ["keyword", "embedded"], - ["keyword", "extender"], - ["keyword", "execution"], - ["keyword", "sequential"], - ["keyword", "concurrent"], - ["keyword", "single"], - ["keyword", "scope"], - ["keyword", "install"], - ["keyword", "throw"], - ["keyword", "comp"], - ["keyword", "cH"], - ["keyword", "default"], - ["keyword", "global"], - ["keyword", "linkIn"], - ["keyword", "linkOut"], - ["keyword", "synchronized"], - ["keyword", "this"], - ["keyword", "new"], - ["keyword", "for"], - ["keyword", "if"], - ["keyword", "else"], - ["keyword", "while"], - ["keyword", "in"], - ["symbol", ";"], - ["keyword", "Jolie"], - ["keyword", "Java"], - ["keyword", "Javascript"], - ["keyword", "nullProcess"], - ["keyword", "spawn"], - ["keyword", "constants"], - ["keyword", "with"], - ["keyword", "provide"], - ["keyword", "until"], - ["keyword", "exit"], - ["keyword", "foreach"], - ["keyword", "instanceof"], - ["keyword", "over"], - ["keyword", "service"] + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "cH"], ["punctuation", ";"], + ["keyword", "comp"], ["punctuation", ";"], + ["keyword", "concurrent"], ["punctuation", ";"], + ["keyword", "constants"], ["punctuation", ";"], + ["keyword", "courier"], ["punctuation", ";"], + ["keyword", "cset"], ["punctuation", ";"], + ["keyword", "csets"], ["punctuation", ";"], + ["keyword", "default"], ["punctuation", ";"], + ["keyword", "define"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "embed"], ["punctuation", ";"], + ["keyword", "embedded"], ["punctuation", ";"], + ["keyword", "execution"], ["punctuation", ";"], + ["keyword", "exit"], ["punctuation", ";"], + ["keyword", "extender"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "foreach"], ["punctuation", ";"], + ["keyword", "forward"], ["punctuation", ";"], + ["keyword", "from"], ["punctuation", ";"], + ["keyword", "global"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "import"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "include"], ["punctuation", ";"], + ["keyword", "init"], ["punctuation", ";"], + ["keyword", "inputPort"], ["punctuation", ";"], + ["keyword", "install"], ["punctuation", ";"], + ["keyword", "instanceof"], ["punctuation", ";"], + ["keyword", "interface"], ["punctuation", ";"], + ["keyword", "is_defined"], ["punctuation", ";"], + ["keyword", "linkIn"], ["punctuation", ";"], + ["keyword", "linkOut"], ["punctuation", ";"], + ["keyword", "main"], ["punctuation", ";"], + ["keyword", "new"], ["punctuation", ";"], + ["keyword", "nullProcess"], ["punctuation", ";"], + ["keyword", "outputPort"], ["punctuation", ";"], + ["keyword", "over"], ["punctuation", ";"], + ["keyword", "private"], ["punctuation", ";"], + ["keyword", "provide"], ["punctuation", ";"], + ["keyword", "public"], ["punctuation", ";"], + ["keyword", "scope"], ["punctuation", ";"], + ["keyword", "sequential"], ["punctuation", ";"], + ["keyword", "service"], ["punctuation", ";"], + ["keyword", "single"], ["punctuation", ";"], + ["keyword", "spawn"], ["punctuation", ";"], + ["keyword", "synchronized"], ["punctuation", ";"], + ["keyword", "this"], ["punctuation", ";"], + ["keyword", "throw"], ["punctuation", ";"], + ["keyword", "throws"], ["punctuation", ";"], + ["keyword", "type"], ["punctuation", ";"], + ["keyword", "undef"], ["punctuation", ";"], + ["keyword", "until"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["keyword", "with"], ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/jolie/operator_feature.test b/tests/languages/jolie/operator_feature.test index 7e329b027b..3789605d0b 100644 --- a/tests/languages/jolie/operator_feature.test +++ b/tests/languages/jolie/operator_feature.test @@ -4,7 +4,7 @@ < <= > >= -> << = == && -? * / % ; : | @ +? * / % | @ ---------------------------------------------------- @@ -12,28 +12,32 @@ ["operator", "+"], ["operator", "++"], ["operator", "+="], + ["operator", "-"], ["operator", "--"], ["operator", "-="], + ["operator", "!"], ["operator", "!="], + ["operator", "<"], ["operator", "<="], ["operator", ">"], ["operator", ">="], ["operator", "->"], ["operator", "<<"], + ["operator", "="], ["operator", "=="], + ["operator", "&&"], + ["operator", "?"], ["operator", "*"], ["operator", "/"], ["operator", "%"], - ["symbol", ";"], - ["operator", ":"], - ["symbol", "|"], - ["symbol", "@"] + ["operator", "|"], + ["operator", "@"] ] ---------------------------------------------------- diff --git a/tests/languages/jolie/punctuation_feature.test b/tests/languages/jolie/punctuation_feature.test new file mode 100644 index 0000000000..1713f5143c --- /dev/null +++ b/tests/languages/jolie/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) [ ] { } +, ; . : + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + ["punctuation", ":"] +] diff --git a/tests/languages/jolie/string_feature.test b/tests/languages/jolie/string_feature.test new file mode 100644 index 0000000000..f84281043b --- /dev/null +++ b/tests/languages/jolie/string_feature.test @@ -0,0 +1,40 @@ +"" +"10" +" +JOLIE preserves formatting. + This line will be indented. + This line too. +" + +jsonValue = "{ + \"int\": 123, + \"bool\": true, + \"long\": 124, + \"double\": 123.4, + \"string\": \"string\", + \"void\": {}, + \"array\": [123, true,\"ciccio\",124,{}], + \"obj\" : { + \"int\": 1243, + \"bool\": true, + \"long\": 1234, + \"double\": 1234.4, + \"string\": \"string\", + \"void\": {} + } + }" +; + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"10\""], + ["string", "\"\r\nJOLIE preserves formatting.\r\n This line will be indented.\r\n This line too.\r\n\""], + + "\r\n\r\njsonValue ", + ["operator", "="], + ["string", "\"{\r\n \\\"int\\\": 123,\r\n \\\"bool\\\": true,\r\n \\\"long\\\": 124,\r\n \\\"double\\\": 123.4,\r\n \\\"string\\\": \\\"string\\\",\r\n \\\"void\\\": {},\r\n \\\"array\\\": [123, true,\\\"ciccio\\\",124,{}],\r\n \\\"obj\\\" : {\r\n \\\"int\\\": 1243,\r\n \\\"bool\\\": true,\r\n \\\"long\\\": 1234,\r\n \\\"double\\\": 1234.4,\r\n \\\"string\\\": \\\"string\\\",\r\n \\\"void\\\": {}\r\n }\r\n }\""], + + ["punctuation", ";"] +] diff --git a/tests/languages/jsdoc/class-name_feature.test b/tests/languages/jsdoc/class-name_feature.test index b8ad2c647e..854dce6bb8 100644 --- a/tests/languages/jsdoc/class-name_feature.test +++ b/tests/languages/jsdoc/class-name_feature.test @@ -28,14 +28,15 @@ ---------------------------------------------------- [ - "/**\n * ", + "/**\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], "number", ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -44,7 +45,8 @@ " string", ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -63,7 +65,8 @@ ["punctuation", ">"], ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -87,7 +90,8 @@ ["punctuation", "}"], ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -110,7 +114,8 @@ ["punctuation", "]"], ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -121,7 +126,8 @@ ["number", "2"], ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -130,7 +136,8 @@ " string", ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -139,7 +146,8 @@ " Type2", ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -152,7 +160,8 @@ "Bar", ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -162,14 +171,16 @@ ["punctuation", "]"], ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], ["operator", "*"], ["punctuation", "}"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -179,73 +190,63 @@ ["keyword", "void"], ["punctuation", "}"] ]], - "\n *\n * ", + + "\r\n *\r\n * ", ["keyword", "@typedef"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@typedef"], ["class-name", [ ["punctuation", "{"], "Bar", ["punctuation", "}"] ]], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@template"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@template"], ["class-name", [ ["punctuation", "{"], "Bar", ["punctuation", "}"] ]], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@augments"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@extends"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@class"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@interface"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@memberof"], - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@memberof"], "! ", - ["class-name", [ - "Foo" - ]], - "\n * ", + ["class-name", ["Foo"]], + + "\r\n * ", ["keyword", "@this"], - ["class-name", [ - "Foo" - ]], - "\n */" + ["class-name", ["Foo"]], + + "\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/jsdoc/example_feature.test b/tests/languages/jsdoc/example_feature.test index 61febb2092..3a4c453902 100644 --- a/tests/languages/jsdoc/example_feature.test +++ b/tests/languages/jsdoc/example_feature.test @@ -7,14 +7,16 @@ ---------------------------------------------------- [ - "/**\n * ", + "/**\r\n * ", ["keyword", "@example"], + ["example", [ "* ", ["code", [ ["comment", "// returns 3"] ]], - "\n * ", + + "\r\n * ", ["code", [ "globalNS", ["punctuation", "."], @@ -27,7 +29,8 @@ ["punctuation", ";"] ]] ]], - "\n */" + + "\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/jsdoc/keyword_feature.test b/tests/languages/jsdoc/keyword_feature.test index 6a74fc7cba..2010eb29bd 100644 --- a/tests/languages/jsdoc/keyword_feature.test +++ b/tests/languages/jsdoc/keyword_feature.test @@ -89,92 +89,92 @@ ---------------------------------------------------- [ - "/**\n * ", ["keyword", "@abstract"], - "\n * ", ["keyword", "@virtual"], - "\n * ", ["keyword", "@access"], - "\n * ", ["keyword", "@alias"], - "\n * ", ["keyword", "@async"], - "\n * ", ["keyword", "@augments"], - "\n * ", ["keyword", "@extends"], - "\n * ", ["keyword", "@author"], - "\n * ", ["keyword", "@borrows"], - "\n * ", ["keyword", "@callback"], - "\n * ", ["keyword", "@class"], - "\n * ", ["keyword", "@constructor"], - "\n * ", ["keyword", "@hideconstructor"], - "\n * ", ["keyword", "@classdesc"], - "\n * ", ["keyword", "@constant"], - "\n * ", ["keyword", "@const"], - "\n * ", ["keyword", "@constructs"], - "\n * ", ["keyword", "@copyright"], - "\n * ", ["keyword", "@default"], - "\n * ", ["keyword", "@defaultValue"], - "\n * ", ["keyword", "@deprecated"], - "\n * ", ["keyword", "@description"], - "\n * ", ["keyword", "@desc"], - "\n * ", ["keyword", "@enum"], - "\n * ", ["keyword", "@event"], - "\n * ", ["keyword", "@exports"], - "\n * ", ["keyword", "@external"], - "\n * ", ["keyword", "@host"], - "\n * ", ["keyword", "@file"], - "\n * ", ["keyword", "@overview"], - "\n * ", ["keyword", "@fileoverview"], - "\n * ", ["keyword", "@fires"], - "\n * ", ["keyword", "@emits"], - "\n * ", ["keyword", "@function"], - "\n * ", ["keyword", "@func"], - "\n * ", ["keyword", "@method"], - "\n * ", ["keyword", "@generator"], - "\n * ", ["keyword", "@global"], - "\n * ", ["keyword", "@ignore"], - "\n * ", ["keyword", "@implements"], - "\n * ", ["keyword", "@inheritdoc"], - "\n * ", ["keyword", "@inner"], - "\n * ", ["keyword", "@instance"], - "\n * ", ["keyword", "@interface"], - "\n * ", ["keyword", "@kind"], - "\n * ", ["keyword", "@lends"], - "\n * ", ["keyword", "@license"], - "\n * ", ["keyword", "@listens"], - "\n * ", ["keyword", "@member"], - "\n * ", ["keyword", "@var"], - "\n * ", ["keyword", "@memberof"], - "\n * ", ["keyword", "@mixes"], - "\n * ", ["keyword", "@mixin"], - "\n * ", ["keyword", "@module"], - "\n * ", ["keyword", "@name"], - "\n * ", ["keyword", "@namespace"], - "\n * ", ["keyword", "@override"], - "\n * ", ["keyword", "@package"], - "\n * ", ["keyword", "@param"], - "\n * ", ["keyword", "@arg"], - "\n * ", ["keyword", "@argument"], - "\n * ", ["keyword", "@private"], - "\n * ", ["keyword", "@property"], - "\n * ", ["keyword", "@prop"], - "\n * ", ["keyword", "@protected"], - "\n * ", ["keyword", "@public"], - "\n * ", ["keyword", "@readonly"], - "\n * ", ["keyword", "@requires"], - "\n * ", ["keyword", "@return"], - "\n * ", ["keyword", "@returns"], - "\n * ", ["keyword", "@see"], - "\n * ", ["keyword", "@since"], - "\n * ", ["keyword", "@static"], - "\n * ", ["keyword", "@summary"], - "\n * ", ["keyword", "@this"], - "\n * ", ["keyword", "@throws"], - "\n * ", ["keyword", "@exception"], - "\n * ", ["keyword", "@todo"], - "\n * ", ["keyword", "@tutorial"], - "\n * ", ["keyword", "@type"], - "\n * ", ["keyword", "@typedef"], - "\n * ", ["keyword", "@variation"], - "\n * ", ["keyword", "@version"], - "\n * ", ["keyword", "@yield"], - "\n * ", ["keyword", "@yields"], - "\n */" + "/**\r\n * ", ["keyword", "@abstract"], + "\r\n * ", ["keyword", "@virtual"], + "\r\n * ", ["keyword", "@access"], + "\r\n * ", ["keyword", "@alias"], + "\r\n * ", ["keyword", "@async"], + "\r\n * ", ["keyword", "@augments"], + "\r\n * ", ["keyword", "@extends"], + "\r\n * ", ["keyword", "@author"], + "\r\n * ", ["keyword", "@borrows"], + "\r\n * ", ["keyword", "@callback"], + "\r\n * ", ["keyword", "@class"], + "\r\n * ", ["keyword", "@constructor"], + "\r\n * ", ["keyword", "@hideconstructor"], + "\r\n * ", ["keyword", "@classdesc"], + "\r\n * ", ["keyword", "@constant"], + "\r\n * ", ["keyword", "@const"], + "\r\n * ", ["keyword", "@constructs"], + "\r\n * ", ["keyword", "@copyright"], + "\r\n * ", ["keyword", "@default"], + "\r\n * ", ["keyword", "@defaultValue"], + "\r\n * ", ["keyword", "@deprecated"], + "\r\n * ", ["keyword", "@description"], + "\r\n * ", ["keyword", "@desc"], + "\r\n * ", ["keyword", "@enum"], + "\r\n * ", ["keyword", "@event"], + "\r\n * ", ["keyword", "@exports"], + "\r\n * ", ["keyword", "@external"], + "\r\n * ", ["keyword", "@host"], + "\r\n * ", ["keyword", "@file"], + "\r\n * ", ["keyword", "@overview"], + "\r\n * ", ["keyword", "@fileoverview"], + "\r\n * ", ["keyword", "@fires"], + "\r\n * ", ["keyword", "@emits"], + "\r\n * ", ["keyword", "@function"], + "\r\n * ", ["keyword", "@func"], + "\r\n * ", ["keyword", "@method"], + "\r\n * ", ["keyword", "@generator"], + "\r\n * ", ["keyword", "@global"], + "\r\n * ", ["keyword", "@ignore"], + "\r\n * ", ["keyword", "@implements"], + "\r\n * ", ["keyword", "@inheritdoc"], + "\r\n * ", ["keyword", "@inner"], + "\r\n * ", ["keyword", "@instance"], + "\r\n * ", ["keyword", "@interface"], + "\r\n * ", ["keyword", "@kind"], + "\r\n * ", ["keyword", "@lends"], + "\r\n * ", ["keyword", "@license"], + "\r\n * ", ["keyword", "@listens"], + "\r\n * ", ["keyword", "@member"], + "\r\n * ", ["keyword", "@var"], + "\r\n * ", ["keyword", "@memberof"], + "\r\n * ", ["keyword", "@mixes"], + "\r\n * ", ["keyword", "@mixin"], + "\r\n * ", ["keyword", "@module"], + "\r\n * ", ["keyword", "@name"], + "\r\n * ", ["keyword", "@namespace"], + "\r\n * ", ["keyword", "@override"], + "\r\n * ", ["keyword", "@package"], + "\r\n * ", ["keyword", "@param"], + "\r\n * ", ["keyword", "@arg"], + "\r\n * ", ["keyword", "@argument"], + "\r\n * ", ["keyword", "@private"], + "\r\n * ", ["keyword", "@property"], + "\r\n * ", ["keyword", "@prop"], + "\r\n * ", ["keyword", "@protected"], + "\r\n * ", ["keyword", "@public"], + "\r\n * ", ["keyword", "@readonly"], + "\r\n * ", ["keyword", "@requires"], + "\r\n * ", ["keyword", "@return"], + "\r\n * ", ["keyword", "@returns"], + "\r\n * ", ["keyword", "@see"], + "\r\n * ", ["keyword", "@since"], + "\r\n * ", ["keyword", "@static"], + "\r\n * ", ["keyword", "@summary"], + "\r\n * ", ["keyword", "@this"], + "\r\n * ", ["keyword", "@throws"], + "\r\n * ", ["keyword", "@exception"], + "\r\n * ", ["keyword", "@todo"], + "\r\n * ", ["keyword", "@tutorial"], + "\r\n * ", ["keyword", "@type"], + "\r\n * ", ["keyword", "@typedef"], + "\r\n * ", ["keyword", "@variation"], + "\r\n * ", ["keyword", "@version"], + "\r\n * ", ["keyword", "@yield"], + "\r\n * ", ["keyword", "@yields"], + "\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/jsdoc/parameter_feature.test b/tests/languages/jsdoc/parameter_feature.test index 1a7750cef1..b076fb0167 100644 --- a/tests/languages/jsdoc/parameter_feature.test +++ b/tests/languages/jsdoc/parameter_feature.test @@ -10,27 +10,21 @@ ---------------------------------------------------- [ - "/**\n * ", + "/**\r\n * ", ["keyword", "@param"], - ["parameter", [ - "n" - ]], - " - A number.\n * ", + ["parameter", ["n"]], + " - A number.\r\n * ", ["keyword", "@param"], ["optional-parameter", [ ["punctuation", "["], - ["parameter", [ - "n" - ]], + ["parameter", ["n"]], ["punctuation", "]"] ]], - " - A number.\n * ", + " - A number.\r\n * ", ["keyword", "@param"], ["optional-parameter", [ ["punctuation", "["], - ["parameter", [ - "n" - ]], + ["parameter", ["n"]], ["punctuation", "="], ["code", [ ["number", "1"], @@ -39,17 +33,15 @@ ]], ["punctuation", "]"] ]], - " - A number.\n * ", + " - A number.\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], "number", ["punctuation", "}"] ]], - ["parameter", [ - "n" - ]], - " - A number.\n * ", + ["parameter", ["n"]], + " - A number.\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -73,10 +65,9 @@ ["punctuation", "}"], ["punctuation", "}"] ]], - ["parameter", [ - "map" - ]], - "\n * ", + ["parameter", ["map"]], + + "\r\n * ", ["keyword", "@param"], ["class-name", [ ["punctuation", "{"], @@ -88,7 +79,8 @@ ["punctuation", "."], "bar" ]], - "\n */" + + "\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/json+http/issue2733.test b/tests/languages/json+http/issue2733.test new file mode 100644 index 0000000000..39ed2bb728 --- /dev/null +++ b/tests/languages/json+http/issue2733.test @@ -0,0 +1,128 @@ +HTTP/1.1 200 OK +connection: keep-alive +content-type: application/json +date: Sat, 23 Jan 2021 20:36:14 GMT +keep-alive: timeout=60 +transfer-encoding: chunked + +{ + "id": 1, + "name": "John Doe", + "userName": "jdoe", + "email": "whatever@something.zzz", + "phone": "1234567890", + "birthDate": "1878-05-06", + "address": { + "street": "Fake St", + "street2": "Apt. 556", + "city": "Gwenborough", + "state": "ZZ", + "zip": "12345" + } +} + +---------------------------------------------------- + +[ + ["response-status", [ + ["http-version", "HTTP/1.1"], + ["status-code", "200"], + ["reason-phrase", "OK"] + ]], + + ["header", [ + ["header-name", "connection"], + ["punctuation", ":"], + ["header-value", "keep-alive"] + ]], + + ["header", [ + ["header-name", "content-type"], + ["punctuation", ":"], + ["header-value", "application/json"] + ]], + + ["header", [ + ["header-name", "date"], + ["punctuation", ":"], + ["header-value", "Sat, 23 Jan 2021 20:36:14 GMT"] + ]], + + ["header", [ + ["header-name", "keep-alive"], + ["punctuation", ":"], + ["header-value", "timeout=60"] + ]], + + ["header", [ + ["header-name", "transfer-encoding"], + ["punctuation", ":"], + ["header-value", "chunked"] + ]], + + ["application-json", [ + ["punctuation", "{"], + + ["property", "\"id\""], + ["operator", ":"], + ["number", "1"], + ["punctuation", ","], + + ["property", "\"name\""], + ["operator", ":"], + ["string", "\"John Doe\""], + ["punctuation", ","], + + ["property", "\"userName\""], + ["operator", ":"], + ["string", "\"jdoe\""], + ["punctuation", ","], + + ["property", "\"email\""], + ["operator", ":"], + ["string", "\"whatever@something.zzz\""], + ["punctuation", ","], + + ["property", "\"phone\""], + ["operator", ":"], + ["string", "\"1234567890\""], + ["punctuation", ","], + + ["property", "\"birthDate\""], + ["operator", ":"], + ["string", "\"1878-05-06\""], + ["punctuation", ","], + + ["property", "\"address\""], + ["operator", ":"], + ["punctuation", "{"], + + ["property", "\"street\""], + ["operator", ":"], + ["string", "\"Fake St\""], + ["punctuation", ","], + + ["property", "\"street2\""], + ["operator", ":"], + ["string", "\"Apt. 556\""], + ["punctuation", ","], + + ["property", "\"city\""], + ["operator", ":"], + ["string", "\"Gwenborough\""], + ["punctuation", ","], + + ["property", "\"state\""], + ["operator", ":"], + ["string", "\"ZZ\""], + ["punctuation", ","], + + ["property", "\"zip\""], + ["operator", ":"], + ["string", "\"12345\""], + + ["punctuation", "}"], + + ["punctuation", "}"] + ]] +] diff --git a/tests/languages/json+http/issue3168.test b/tests/languages/json+http/issue3168.test new file mode 100644 index 0000000000..d0054f5e66 --- /dev/null +++ b/tests/languages/json+http/issue3168.test @@ -0,0 +1,169 @@ +HTTP/1.1 200 OK +Access-Control-Allow-Credentials: true +Access-Control-Allow-Origin: * +Connection: keep-alive +Content-Length: 523 +Content-Type: application/json +Server: gunicorn/19.9.0 +X-Kong-Proxy-Latency: 1 +X-Kong-Upstream-Latency: 1 +{ + "args": {}, + "data": "", + "files": {}, + "form": {}, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "close", + "Host": "httpbin.org", + "User-Agent": "HTTPie/1.0.2", + "X-Forwarded-Host": "example.com" + }, + "json": null, + "method": "GET", + "origin": "172.19.0.1, 52.201.239.166", + "url": "http://example.com/anything" +} + +---------------------------------------------------- + +[ + ["response-status", [ + ["http-version", "HTTP/1.1"], + ["status-code", "200"], + ["reason-phrase", "OK"] + ]], + + ["header", [ + ["header-name", "Access-Control-Allow-Credentials"], + ["punctuation", ":"], + ["header-value", "true"] + ]], + + ["header", [ + ["header-name", "Access-Control-Allow-Origin"], + ["punctuation", ":"], + ["header-value", "*"] + ]], + + ["header", [ + ["header-name", "Connection"], + ["punctuation", ":"], + ["header-value", "keep-alive"] + ]], + + ["header", [ + ["header-name", "Content-Length"], + ["punctuation", ":"], + ["header-value", "523"] + ]], + + ["header", [ + ["header-name", "Content-Type"], + ["punctuation", ":"], + ["header-value", "application/json"] + ]], + + ["header", [ + ["header-name", "Server"], + ["punctuation", ":"], + ["header-value", "gunicorn/19.9.0"] + ]], + + ["header", [ + ["header-name", "X-Kong-Proxy-Latency"], + ["punctuation", ":"], + ["header-value", "1"] + ]], + + ["header", [ + ["header-name", "X-Kong-Upstream-Latency"], + ["punctuation", ":"], + ["header-value", "1"] + ]], + + ["application-json", [ + ["punctuation", "{"], + + ["property", "\"args\""], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + + ["property", "\"data\""], + ["operator", ":"], + ["string", "\"\""], + ["punctuation", ","], + + ["property", "\"files\""], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + + ["property", "\"form\""], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + + ["property", "\"headers\""], + ["operator", ":"], + ["punctuation", "{"], + + ["property", "\"Accept\""], + ["operator", ":"], + ["string", "\"*/*\""], + ["punctuation", ","], + + ["property", "\"Accept-Encoding\""], + ["operator", ":"], + ["string", "\"gzip, deflate\""], + ["punctuation", ","], + + ["property", "\"Connection\""], + ["operator", ":"], + ["string", "\"close\""], + ["punctuation", ","], + + ["property", "\"Host\""], + ["operator", ":"], + ["string", "\"httpbin.org\""], + ["punctuation", ","], + + ["property", "\"User-Agent\""], + ["operator", ":"], + ["string", "\"HTTPie/1.0.2\""], + ["punctuation", ","], + + ["property", "\"X-Forwarded-Host\""], + ["operator", ":"], + ["string", "\"example.com\""], + + ["punctuation", "}"], + ["punctuation", ","], + + ["property", "\"json\""], + ["operator", ":"], + ["null", "null"], + ["punctuation", ","], + + ["property", "\"method\""], + ["operator", ":"], + ["string", "\"GET\""], + ["punctuation", ","], + + ["property", "\"origin\""], + ["operator", ":"], + ["string", "\"172.19.0.1, 52.201.239.166\""], + ["punctuation", ","], + + ["property", "\"url\""], + ["operator", ":"], + ["string", "\"http://example.com/anything\""], + + ["punctuation", "}"] + ]] +] diff --git a/tests/languages/json+http/json-suffix_inclusion.test b/tests/languages/json+http/json-suffix_inclusion.test index 0cb82163c8..9d2ac576d5 100644 --- a/tests/languages/json+http/json-suffix_inclusion.test +++ b/tests/languages/json+http/json-suffix_inclusion.test @@ -5,8 +5,11 @@ Content-type: application/x.foo+bar+json ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " application/x.foo+bar+json", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "application/x.foo+bar+json"] + ]], ["application-json", [ ["punctuation", "{"], ["property", "\"foo\""], diff --git a/tests/languages/json+http/json_inclusion.test b/tests/languages/json+http/json_inclusion.test index d680a6b261..62330e8a24 100644 --- a/tests/languages/json+http/json_inclusion.test +++ b/tests/languages/json+http/json_inclusion.test @@ -5,8 +5,11 @@ Content-type: application/json ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " application/json", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "application/json"] + ]], ["application-json", [ ["punctuation", "{"], ["property", "\"foo\""], diff --git a/tests/languages/json5/string_feature.test b/tests/languages/json5/string_feature.test index 1e94df3608..2654f63ccd 100644 --- a/tests/languages/json5/string_feature.test +++ b/tests/languages/json5/string_feature.test @@ -12,8 +12,11 @@ newline" [ ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"foo\\\"bar\\\"baz\""], + ["string", "\"\\u2642\\\\ \""], ["punctuation", "{"], @@ -27,8 +30,10 @@ newline" ["punctuation", "}"], ["string", "'foo\"bar\"baz'"], + ["string", "'\\u0001'"], - ["string", "\"\\\nnewline\""] + + ["string", "\"\\\r\nnewline\""] ] ---------------------------------------------------- diff --git a/tests/languages/jsstacktrace/alias_feature.test b/tests/languages/jsstacktrace/alias_feature.test new file mode 100644 index 0000000000..2c925f21cb --- /dev/null +++ b/tests/languages/jsstacktrace/alias_feature.test @@ -0,0 +1,26 @@ +Foo + at REPLServer.runBound [as eval] (domain.js:293:12) + +---------------------------------------------------- + +[ + ["error-message", "Foo"], + ["stack-frame", [ + ["keyword", "at"], + ["function", [ + "REPLServer", + ["punctuation", "."], + "runBound" + ]], + ["alias", "[as eval]"], + ["punctuation", "("], + ["filename", "domain.js"], + ["line-number", [ + ["punctuation", ":"], + "293", + ["punctuation", ":"], + "12" + ]], + ["punctuation", ")"] + ]] +] diff --git a/tests/languages/jsstacktrace/function_feature.test b/tests/languages/jsstacktrace/function_feature.test index 2b5b51ce0f..f6ec334359 100644 --- a/tests/languages/jsstacktrace/function_feature.test +++ b/tests/languages/jsstacktrace/function_feature.test @@ -1,24 +1,47 @@ Some text at foo.bar + at DenoError (deno/js/errors.ts:22:5) + at new (_http_common.js:159:16) ---------------------------------------------------- [ ["error-message", "Some text"], - [ - "stack-frame", - [ - ["keyword", "at"], - [ - "function", - [ - "foo", - [ "punctuation", "." ], - "bar" - ] - ] - ] - ] + ["stack-frame", [ + ["keyword", "at"], + ["function", [ + "foo", + ["punctuation", "."], + "bar" + ]] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["function", ["DenoError"]], + ["punctuation", "("], + ["filename", "deno/js/errors.ts"], + ["line-number", [ + ["punctuation", ":"], + "22", + ["punctuation", ":"], + "5" + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["keyword", "new"], + ["function", [""]], + ["punctuation", "("], + ["filename", "_http_common.js"], + ["line-number", [ + ["punctuation", ":"], + "159", + ["punctuation", ":"], + "16" + ]], + ["punctuation", ")"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/jsstacktrace/notmycode_feature.test b/tests/languages/jsstacktrace/notmycode_feature.test index 8f3aba22c3..05fa15c2a3 100644 --- a/tests/languages/jsstacktrace/notmycode_feature.test +++ b/tests/languages/jsstacktrace/notmycode_feature.test @@ -1,16 +1,40 @@ Some text + at new Foo (foo.js:3:7) at processTicksAndRejections (internal/process/task_queues.js:98:32) +Foo + at throwsA (:1:23) + at :1:13 + ---------------------------------------------------- [ ["error-message", "Some text"], - [ - "stack-frame", - [ - ["not-my-code", "\tat processTicksAndRejections (internal/process/task_queues.js:98:32)"] - ] - ] + ["stack-frame", [ + ["keyword", "at"], + ["keyword", "new"], + ["function", ["Foo"]], + ["punctuation", "("], + ["filename", "foo.js"], + ["line-number", [ + ["punctuation", ":"], + "3", + ["punctuation", ":"], + "7" + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["not-my-code", "at processTicksAndRejections (internal/process/task_queues.js:98:32)"] + ]], + + ["error-message", "Foo"], + ["stack-frame", [ + ["not-my-code", "at throwsA (:1:23)"] + ]], + ["stack-frame", [ + ["not-my-code", "at :1:13"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/jsx!+graphql+js-templates/graphql_inclusion.test b/tests/languages/jsx!+graphql+js-templates/graphql_inclusion.test new file mode 100644 index 0000000000..a869435b98 --- /dev/null +++ b/tests/languages/jsx!+graphql+js-templates/graphql_inclusion.test @@ -0,0 +1,223 @@ +import React from 'react'; +import gql from 'graphql-tag'; +import { Query } from 'react-apollo'; +import { + Card, + ResourceList, + Stack, + TextStyle, + Thumbnail, +} from '@shopify/polaris'; +import store from 'store-js'; +import { Redirect } from '@shopify/app-bridge/actions'; +import { Context } from '@shopify/app-bridge-react'; + +// GraphQL query to retrieve products by IDs. +// The price field belongs to the variants object because +// variations of a product can have different prices. +const GET_PRODUCTS_BY_ID = gql` + query getProducts($ids: [ID!]!) { + nodes(ids: $ids) { + ... on Product { + title + handle + descriptionHtml + id + images(first: 1) { + edges { + node { + originalSrc + altText + } + } + } + variants(first: 1) { + edges { + node { + price + id + } + } + } + } + } + } +`; + +---------------------------------------------------- + +[ + ["keyword", "import"], + " React ", + ["keyword", "from"], + ["string", "'react'"], + ["punctuation", ";"], + + ["keyword", "import"], + " gql ", + ["keyword", "from"], + ["string", "'graphql-tag'"], + ["punctuation", ";"], + + ["keyword", "import"], + ["punctuation", "{"], + " Query ", + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'react-apollo'"], + ["punctuation", ";"], + + ["keyword", "import"], + ["punctuation", "{"], + + "\r\n Card", + ["punctuation", ","], + + "\r\n ResourceList", + ["punctuation", ","], + + "\r\n Stack", + ["punctuation", ","], + + "\r\n TextStyle", + ["punctuation", ","], + + "\r\n Thumbnail", + ["punctuation", ","], + + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'@shopify/polaris'"], + ["punctuation", ";"], + + ["keyword", "import"], + " store ", + ["keyword", "from"], + ["string", "'store-js'"], + ["punctuation", ";"], + + ["keyword", "import"], + ["punctuation", "{"], + " Redirect ", + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'@shopify/app-bridge/actions'"], + ["punctuation", ";"], + + ["keyword", "import"], + ["punctuation", "{"], + " Context ", + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'@shopify/app-bridge-react'"], + ["punctuation", ";"], + + ["comment", "// GraphQL query to retrieve products by IDs."], + + ["comment", "// The price field belongs to the variants object because"], + + ["comment", "// variations of a product can have different prices."], + + ["keyword", "const"], + ["constant", "GET_PRODUCTS_BY_ID"], + ["operator", "="], + " gql", + ["template-string", [ + ["template-punctuation", "`"], + ["graphql", [ + ["keyword", "query"], + ["definition-query", "getProducts"], + ["punctuation", "("], + ["variable", "$ids"], + ["punctuation", ":"], + ["punctuation", "["], + ["scalar", "ID"], + ["operator", "!"], + ["punctuation", "]"], + ["operator", "!"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["property-query", "nodes"], + ["punctuation", "("], + ["attr-name", "ids"], + ["punctuation", ":"], + ["variable", "$ids"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["operator", "..."], + ["keyword", "on"], + ["class-name", "Product"], + ["punctuation", "{"], + + ["property", "title"], + + ["property", "handle"], + + ["property", "descriptionHtml"], + + ["property", "id"], + + ["property-query", "images"], + ["punctuation", "("], + ["attr-name", "first"], + ["punctuation", ":"], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["object", "edges"], + ["punctuation", "{"], + + ["object", "node"], + ["punctuation", "{"], + + ["property", "originalSrc"], + + ["property", "altText"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["property-query", "variants"], + ["punctuation", "("], + ["attr-name", "first"], + ["punctuation", ":"], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["object", "edges"], + ["punctuation", "{"], + + ["object", "node"], + ["punctuation", "{"], + + ["property", "price"], + + ["property", "id"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["punctuation", "}"] + ]], + ["template-punctuation", "`"] + ]], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for tagged template literals containing GraphQL code. diff --git a/tests/languages/jsx/issue1235.test b/tests/languages/jsx/issue1235.test index 97c5178683..7021b8de37 100644 --- a/tests/languages/jsx/issue1235.test +++ b/tests/languages/jsx/issue1235.test @@ -13,7 +13,7 @@ ["script-punctuation", "="], ["punctuation", "{"], ["punctuation", "{"], - " track", + ["literal-property", "track"], ["operator", ":"], ["boolean", "true"], ["punctuation", "}"], diff --git a/tests/languages/jsx/issue1236.test b/tests/languages/jsx/issue1236.test index 3cc3ae2b8a..bf93cf2940 100644 --- a/tests/languages/jsx/issue1236.test +++ b/tests/languages/jsx/issue1236.test @@ -10,10 +10,10 @@ ]], ["spread", [ ["punctuation", "{"], - ["punctuation", "..."], - ["attr-value", "this"], + ["operator", "..."], + ["keyword", "this"], ["punctuation", "."], - ["attr-value", "props"], + "props", ["punctuation", "}"] ]], ["punctuation", ">"] diff --git a/tests/languages/jsx/issue1335.test b/tests/languages/jsx/issue1335.test index c7863f27b8..be0d3e0b4b 100644 --- a/tests/languages/jsx/issue1335.test +++ b/tests/languages/jsx/issue1335.test @@ -16,16 +16,12 @@ ["punctuation", "<"], ["class-name", "Button"] ]], - ["attr-name", [ - "onClick" - ]], + ["attr-name", ["onClick"]], ["script", [ ["script-punctuation", "="], ["punctuation", "{"], ["punctuation", "("], - ["parameter", [ - "e" - ]], + ["parameter", ["e"]], ["punctuation", ")"], ["operator", "=>"], ["keyword", "this"], @@ -33,7 +29,7 @@ ["function", "setState"], ["punctuation", "("], ["punctuation", "{"], - "clicked", + ["literal-property", "clicked"], ["operator", ":"], ["boolean", "true"], ["punctuation", "}"], @@ -42,51 +38,54 @@ ]], ["punctuation", "/>"] ]], + ["tag", [ ["tag", [ ["punctuation", "<"], ["class-name", "Component"] ]], - ["attr-name", [ - "data" - ]], + + ["attr-name", ["data"]], ["script", [ ["script-punctuation", "="], ["punctuation", "{"], ["punctuation", "["], + ["punctuation", "{"], - "id", + ["literal-property", "id"], ["operator", ":"], ["number", "0"], ["punctuation", ","], - " name", + ["literal-property", "name"], ["operator", ":"], ["string", "'Joe'"], ["punctuation", "}"], ["punctuation", ","], + ["punctuation", "{"], - "id", + ["literal-property", "id"], ["operator", ":"], ["number", "1"], ["punctuation", ","], - " name", + ["literal-property", "name"], ["operator", ":"], ["string", "'Sue'"], ["punctuation", "}"], ["punctuation", ","], + ["punctuation", "]"], ["punctuation", "}"] ]], + ["punctuation", "/>"] ]], + ["tag", [ ["tag", [ ["punctuation", "<"], ["class-name", "Component"] ]], - ["attr-name", [ - "title" - ]], + ["attr-name", ["title"]], ["script", [ ["script-punctuation", "="], ["punctuation", "{"], @@ -103,14 +102,13 @@ ]], ["punctuation", "/>"] ]], + ["tag", [ ["tag", [ ["punctuation", "<"], ["class-name", "Component"] ]], - ["attr-name", [ - "title" - ]], + ["attr-name", ["title"]], ["script", [ ["script-punctuation", "="], ["punctuation", "{"], diff --git a/tests/languages/jsx/issue1408.test b/tests/languages/jsx/issue1408.test index 395f1dd317..2e458670b8 100644 --- a/tests/languages/jsx/issue1408.test +++ b/tests/languages/jsx/issue1408.test @@ -8,14 +8,12 @@ ["punctuation", "<"], "div" ]], - ["attr-name", [ - "style" - ]], + ["attr-name", ["style"]], ["script", [ ["script-punctuation", "="], ["punctuation", "{"], ["punctuation", "{"], - " marginLeft", + ["literal-property", "marginLeft"], ["operator", ":"], ["template-string", [ ["template-punctuation", "`"], diff --git a/tests/languages/jsx/issue2727.test b/tests/languages/jsx/issue2727.test new file mode 100644 index 0000000000..d0321a7277 --- /dev/null +++ b/tests/languages/jsx/issue2727.test @@ -0,0 +1,820 @@ +import React from 'react' + +import * as MaxMSP from 'maxmsp-gui' +import 'maxmsp-gui/dist/index.css' + +export default function App() { + return ( + + + console.log('bang')} + /> + + console.log(bool)} // true or false + /> + + console.log('bang')} + /> + + + + console.log(bool)} + onChange={(i) => console.log(`My value is ${i}`)} // 0 - this.props.fidelity + /> + + console.log(`My value is ${i}`)} + /> + + console.log(`My value is ${i}`)} // 0 - this.props.fidelity + /> + + console.log('bang')} + // mode 1 onClick + onClick={(bool) => console.log(bool)} + /> + + console.log(bool)} + /> + + console.log(`My index/item is ${x}`)} + /> + + + ) +} + +---------------------------------------------------- + +[ + ["keyword", "import"], " React ", ["keyword", "from"], ["string", "'react'"], + + ["keyword", "import"], + ["operator", "*"], + ["keyword", "as"], + " MaxMSP ", + ["keyword", "from"], + ["string", "'maxmsp-gui'"], + + ["keyword", "import"], + ["string", "'maxmsp-gui/dist/index.css'"], + + ["keyword", "export"], + ["keyword", "default"], + ["keyword", "function"], + ["function", "App"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["punctuation", "("], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "React.Fragment"] + ]], + ["punctuation", ">"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Bang"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["ariaPressed"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default null"], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["string", "'bang'"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Ezdac"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default false"], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["bool"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "bool", + ["punctuation", ")"], + ["punctuation", "}"] + ]], + ["comment", "// true or false"], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Message"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["ariaPressed"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default null"], + + ["attr-name", ["text"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "What does the message say?", + ["punctuation", "'"] + ]], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["string", "'bang'"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Object"] + ]], + + ["attr-name", ["inactive"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default false"], + + ["attr-name", ["text"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "What is the object called?", + ["punctuation", "'"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Playbar"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["fidelity"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "100"], + ["punctuation", "}"] + ]], + ["comment", "// max output of slider, default 100"], + + ["attr-name", ["inactive"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// diable user interaction, default false"], + + ["attr-name", ["setPlaying"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// set isPlaying externally"], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "50"], + ["punctuation", "}"] + ]], + ["comment", "// inital/updated state, 0 to this.props.fidelity, default 0"], + + ["attr-name", ["width"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "200"], + ["punctuation", "}"] + ]], + ["comment", "// width of the slider in pixels, default 200"], + + ["attr-name", ["isPlaying"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["bool"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "bool", + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["attr-name", ["onChange"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["i"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "My value is "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + "i", + ["interpolation-punctuation", "}"] + ]], + ["template-punctuation", "`"] + ]], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + ["comment", "// 0 - this.props.fidelity"], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.RadioGroup"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["items"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "["], + ["string", "'array'"], + ["punctuation", ","], + ["string", "'of'"], + ["punctuation", ","], + ["string", "'items'"], + ["punctuation", "]"], + ["punctuation", "}"] + ]], + ["comment", "// this sets the amount of radiobuttons, strings create text alongside each button"], + + ["attr-name", ["spacing"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "24"], + ["punctuation", "}"] + ]], + ["comment", "// the height of each button in pixels, defualt 20"], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "i", + ["punctuation", "}"] + ]], + ["comment", "// this.props.items[i], default 0"], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["i"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "My value is "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + "i", + ["interpolation-punctuation", "}"] + ]], + ["template-punctuation", "`"] + ]], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Slider"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["fidelity"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "100"], + ["punctuation", "}"] + ]], + ["comment", "// max output of slider, default 100"], + + ["attr-name", ["length"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "200"], + ["punctuation", "}"] + ]], + ["comment", "// width of the slider in pixels, default 200"], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "50"], + ["punctuation", "}"] + ]], + ["comment", "// inital/updated state, 0 to this.props.fidelity, default 0"], + + ["attr-name", ["onChange"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["i"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "My value is "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + "i", + ["interpolation-punctuation", "}"] + ]], + ["template-punctuation", "`"] + ]], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + ["comment", "// 0 - this.props.fidelity"], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.TextButton"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["ariaPressed"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default null, for mode 'false' only"], + + ["attr-name", ["inactive"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// diable user interaction, default false"], + + ["attr-name", ["mode"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// true for toggle, false for bang, default false"], + + ["attr-name", ["text"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "What does the textbutton say?", + ["punctuation", "'"] + ]], + + ["attr-name", ["toggleText"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "What does the toggled textbutton say?", + ["punctuation", "'"] + ]], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default false, for mode 'true' only"], + + ["comment", "// mode 0 onClick"], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["string", "'bang'"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["comment", "// mode 1 onClick"], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["bool"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "bool", + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Toggle"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// default false"], + + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["bool"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "bool", + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "MaxMSP.Umenu"] + ]], + + ["attr-name", ["ariaLabel"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "'"], + "set the aria-label tag", + ["punctuation", "'"] + ]], + ["comment", "// defaults to the object name"], + + ["attr-name", ["items"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "["], + ["string", "'array'"], + ["punctuation", ","], + ["string", "'of'"], + ["punctuation", ","], + ["string", "'items'"], + ["punctuation", "]"], + ["punctuation", "}"] + ]], + + ["attr-name", ["outputSymbol"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["operator", "||"], + ["boolean", "false"], + ["punctuation", "}"] + ]], + ["comment", "// true for symbol false for int, default false"], + + ["attr-name", ["value"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "i", + ["punctuation", "}"] + ]], + ["comment", "// this.props.items[i], default 0"], + + ["attr-name", ["width"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["number", "200"], + ["punctuation", "}"] + ]], + ["comment", "// width of the umenu in pixels, default 100"], + + ["attr-name", ["onChange"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + ["punctuation", "("], + ["parameter", ["x"]], + ["punctuation", ")"], + ["operator", "=>"], + " console", + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "My index/item is "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + "x", + ["interpolation-punctuation", "}"] + ]], + ["template-punctuation", "`"] + ]], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["punctuation", ")"], + + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/jsx/issue2753.test b/tests/languages/jsx/issue2753.test new file mode 100644 index 0000000000..5a9342426d --- /dev/null +++ b/tests/languages/jsx/issue2753.test @@ -0,0 +1,103 @@ +const Test = () => { + return ( +
+ + +
+ ) +} + +---------------------------------------------------- + +[ + ["keyword", "const"], + ["function-variable", "Test"], + ["operator", "="], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "=>"], + ["punctuation", "{"], + + ["keyword", "return"], + ["punctuation", "("], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["plain-text", "\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "Button"] + ]], + ["spread", [ + ["punctuation", "{"], + ["operator", "..."], + ["punctuation", "{"], + "onClick", + ["punctuation", ","], + " disabled", + ["punctuation", "}"], + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["plain-text", "\r\n Click (Wrong Highlighting)\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["plain-text", "\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + ["class-name", "Button"] + ]], + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "onClick", + ["punctuation", "}"] + ]], + ["attr-name", ["disabled"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "disabled", + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["plain-text", "\r\n Click (Correct highlighting)\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["plain-text", "\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["punctuation", ")"], + + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/jsx/spread_in_tags.test b/tests/languages/jsx/spread_in_tags.test index 3ec4eebbe3..49faaf4270 100644 --- a/tests/languages/jsx/spread_in_tags.test +++ b/tests/languages/jsx/spread_in_tags.test @@ -1,6 +1,9 @@
+
+
+
---------------------------------------------------- @@ -12,8 +15,8 @@ ]], ["spread", [ ["punctuation", "{"], - ["punctuation", "..."], - ["attr-value", "foo"], + ["operator", "..."], + "foo", ["punctuation", "}"] ]], ["punctuation", ">"] @@ -25,6 +28,74 @@ ]], ["punctuation", ">"] ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["spread", [ + ["punctuation", "{"], + ["operator", "..."], + "foo ", + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["spread", [ + ["punctuation", "{"], + ["operator", "..."], + " foo ", + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["spread", [ + ["punctuation", "{"], + ["operator", "..."], + ["punctuation", "{"], + "onClick", + ["punctuation", ","], + " disabled", + ["punctuation", "}"], + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["tag", [ ["tag", [ ["punctuation", "<"], @@ -32,8 +103,10 @@ ]], ["spread", [ ["punctuation", "{"], - ["punctuation", "..."], - ["attr-value", "foo"], + ["operator", "..."], + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], ["punctuation", "}"] ]], ["punctuation", ">"] @@ -45,6 +118,7 @@ ]], ["punctuation", ">"] ]], + ["tag", [ ["tag", [ ["punctuation", "<"], @@ -52,8 +126,12 @@ ]], ["spread", [ ["punctuation", "{"], - ["punctuation", "..."], - ["attr-value", "foo"], + ["operator", "..."], + ["punctuation", "("], + "foo ", + ["operator", "??"], + " bar", + ["punctuation", ")"], ["punctuation", "}"] ]], ["punctuation", ">"] diff --git a/tests/languages/jsx/tag_feature.test b/tests/languages/jsx/tag_feature.test index 9255ea1e44..c76952c872 100644 --- a/tests/languages/jsx/tag_feature.test +++ b/tests/languages/jsx/tag_feature.test @@ -36,14 +36,15 @@ var myElement = ; ]], ["attr-name", ["someProperty"]], ["script", [ - ["script-punctuation", "="], - ["punctuation", "{"], - ["boolean", "true"], - ["punctuation", "}"] + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["punctuation", "}"] ]], ["punctuation", "/>"] ]], ["punctuation", ";"], + ["tag", [ ["tag", [ ["punctuation", "<"], @@ -51,8 +52,8 @@ var myElement = ; ]], ["spread", [ ["punctuation", "{"], - ["punctuation", "..."], - ["attr-value", "foo"], + ["operator", "..."], + "foo", ["punctuation", "}"] ]], ["punctuation", ">"] @@ -64,6 +65,7 @@ var myElement = ; ]], ["punctuation", ">"] ]], + ["tag", [ ["tag", [ ["punctuation", "<"] @@ -77,6 +79,7 @@ var myElement = ; ]], ["punctuation", ">"] ]], + ["tag", [ ["tag", [ ["punctuation", "<"], @@ -84,10 +87,10 @@ var myElement = ; ]], ["attr-name", ["leaf"]], ["script", [ - ["script-punctuation", "="], - ["punctuation", "{"], - ["boolean", "true"], - ["punctuation", "}"] + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["punctuation", "}"] ]], ["punctuation", ">"] ]], diff --git a/tests/languages/julia/char_feature.test b/tests/languages/julia/char_feature.test new file mode 100644 index 0000000000..062087e4f3 --- /dev/null +++ b/tests/languages/julia/char_feature.test @@ -0,0 +1,31 @@ +'x' +'\'' +'\u2200' +'\x80' +'\xe2\x88' +'∀' + +# not a character +A'b +A'b'' + +---------------------------------------------------- + +[ + ["char", "'x'"], + ["char", "'\\''"], + ["char", "'\\u2200'"], + ["char", "'\\x80'"], + ["char", "'\\xe2\\x88'"], + ["char", "'∀'"], + + ["comment", "# not a character"], + + "\r\nA", + ["operator", "'"], + "b\r\nA", + ["operator", "'"], + "b", + ["operator", "'"], + ["operator", "'"] +] diff --git a/tests/languages/julia/constant_feature.test b/tests/languages/julia/constant_feature.test index a79bbd0215..d38ffdfb9e 100644 --- a/tests/languages/julia/constant_feature.test +++ b/tests/languages/julia/constant_feature.test @@ -3,10 +3,7 @@ Inf Inf16 Inf32 Inf64 im pi π -e ℯ -catalan -eulergamma γ -golden φ +ℯ ---------------------------------------------------- @@ -23,13 +20,7 @@ golden φ ["constant", "im"], ["constant", "pi"], ["constant", "π"], - ["constant", "e"], - ["constant", "ℯ"], - ["constant", "catalan"], - ["constant", "eulergamma"], - ["constant", "γ"], - ["constant", "golden"], - ["constant", "φ"] + ["constant", "ℯ"] ] ---------------------------------------------------- diff --git a/tests/languages/julia/string_feature.test b/tests/languages/julia/string_feature.test index b88864a6e3..916d038675 100644 --- a/tests/languages/julia/string_feature.test +++ b/tests/languages/julia/string_feature.test @@ -2,13 +2,6 @@ "fo\"o" "\xe2\x88" -'x' -'\'' -'\u2200' -'\x80' -'\xe2\x88' -'∀' - """foo""" """fo"o bar""" @@ -22,10 +15,6 @@ b"DATA\xff\u2200" v"0.3-" raw"\\ \\\"" -# not a character -A'b -A'b'' - ---------------------------------------------------- [ @@ -33,13 +22,6 @@ A'b'' ["string", "\"fo\\\"o\""], ["string", "\"\\xe2\\x88\""], - ["string", "'x'"], - ["string", "'\\''"], - ["string", "'\\u2200'"], - ["string", "'\\x80'"], - ["string", "'\\xe2\\x88'"], - ["string", "'∀'"], - ["string", "\"\"\"foo\"\"\""], ["string", "\"\"\"fo\"o\r\nbar\"\"\""], @@ -50,16 +32,7 @@ A'b'' ["string", "s\"\\g<0>1\""], ["string", "b\"DATA\\xff\\u2200\""], ["string", "v\"0.3-\""], - ["string", "raw\"\\\\ \\\\\\\"\""], - - ["comment", "# not a character"], - "\r\nA", - ["operator", "'"], - "b\r\nA", - ["operator", "'"], - "b", - ["operator", "'"], - ["operator", "'"] + ["string", "raw\"\\\\ \\\\\\\"\""] ] ---------------------------------------------------- diff --git a/tests/languages/keepalived/boolean_feature.test b/tests/languages/keepalived/boolean_feature.test new file mode 100644 index 0000000000..921cbe2d01 --- /dev/null +++ b/tests/languages/keepalived/boolean_feature.test @@ -0,0 +1,23 @@ +strict_mode on +strict_mode off +strict_mode true +strict_mode false +strict_mode yes +strict_mode no + +---------------------------------------------------- + +[ + ["property", "strict_mode"], + ["boolean", "on"], + ["property", "strict_mode"], + ["boolean", "off"], + ["property", "strict_mode"], + ["boolean", "true"], + ["property", "strict_mode"], + ["boolean", "false"], + ["property", "strict_mode"], + ["boolean", "yes"], + ["property", "strict_mode"], + ["boolean", "no"] +] \ No newline at end of file diff --git a/tests/languages/keepalived/comment_feature.test b/tests/languages/keepalived/comment_feature.test new file mode 100644 index 0000000000..09493ab581 --- /dev/null +++ b/tests/languages/keepalived/comment_feature.test @@ -0,0 +1,13 @@ +# +# Foobar + +---------------------------------------------------- + +[ + ["comment", "#"], + ["comment", "# Foobar"] +] + +---------------------------------------------------- + +Checks for comments. \ No newline at end of file diff --git a/tests/languages/keepalived/conditional-configuration_feature.test b/tests/languages/keepalived/conditional-configuration_feature.test new file mode 100644 index 0000000000..7d630fffde --- /dev/null +++ b/tests/languages/keepalived/conditional-configuration_feature.test @@ -0,0 +1,37 @@ +global_defs { + @main router_id main_router +} + +vrrp_instance VRRP { + @main unicast_src_ip 1.2.3.4 + unicast_peer { + @^main 1.2.3.4 + } +} + +---------------------------------------------------- + +[ + ["property", "global_defs"], + ["punctuation", "{"], + ["conditional-configuration", "@main"], + ["property", "router_id"], + " main_router\r\n", + ["punctuation", "}"], + ["property", "vrrp_instance"], + " VRRP ", + ["punctuation", "{"], + ["conditional-configuration", "@main"], + ["property", "unicast_src_ip"], + ["ip", "1.2.3.4"], + ["property", "unicast_peer"], + ["punctuation", "{"], + ["conditional-configuration", "@^main"], + ["ip", "1.2.3.4"], + ["punctuation", "}"], + ["punctuation", "}"] +] + + + + diff --git a/tests/languages/keepalived/constant_feature.test b/tests/languages/keepalived/constant_feature.test new file mode 100644 index 0000000000..6d83175c63 --- /dev/null +++ b/tests/languages/keepalived/constant_feature.test @@ -0,0 +1,127 @@ +virtual_server 192.168.1.200 3306 { + lvs_sched rr + lvs_sched wrr + lvs_sched lc + lvs_sched wlc + lvs_sched lblc + lvs_sched sh + lvs_sched mh + lvs_sched dh + lvs_sched fo + lvs_sched ovf + lvs_sched lblcr + lvs_sched sed + lvs_sched nq + + lvs_method NAT + lvs_method DR + lvs_method TUN + + protocol TCP + protocol UDP + protocol SCTP +} + +vrrp_instance test { + state MASTER + state BACKUP + + authentication { + auth_type PASS + auth_type AH + } +} + +DNS_CHECK { + type A + type NS + type CNAME + type SOA + type MX + type TXT + type AAAA +} + +---------------------------------------------------- + +[ + ["property", "virtual_server"], + ["ip", "192.168.1.200"], + ["number", "3306"], + ["punctuation", "{"], + ["property", "lvs_sched"], + ["constant", "rr"], + ["property", "lvs_sched"], + ["constant", "wrr"], + ["property", "lvs_sched"], + ["constant", "lc"], + ["property", "lvs_sched"], + ["constant", "wlc"], + ["property", "lvs_sched"], + ["constant", "lblc"], + ["property", "lvs_sched"], + ["constant", "sh"], + ["property", "lvs_sched"], + ["constant", "mh"], + ["property", "lvs_sched"], + ["constant", "dh"], + ["property", "lvs_sched"], + ["constant", "fo"], + ["property", "lvs_sched"], + ["constant", "ovf"], + ["property", "lvs_sched"], + ["constant", "lblcr"], + ["property", "lvs_sched"], + ["constant", "sed"], + ["property", "lvs_sched"], + ["constant", "nq"], + ["property", "lvs_method"], + ["constant", "NAT"], + ["property", "lvs_method"], + ["constant", "DR"], + ["property", "lvs_method"], + ["constant", "TUN"], + ["property", "protocol"], + ["constant", "TCP"], + ["property", "protocol"], + ["constant", "UDP"], + ["property", "protocol"], + ["constant", "SCTP"], + ["punctuation", "}"], + ["property", "vrrp_instance"], + " test ", + ["punctuation", "{"], + ["property", "state"], + ["constant", "MASTER"], + ["property", "state"], + ["constant", "BACKUP"], + ["property", "authentication"], + ["punctuation", "{"], + ["property", "auth_type"], + ["constant", "PASS"], + ["property", "auth_type"], + ["constant", "AH"], + ["punctuation", "}"], + ["punctuation", "}"], + ["property", "DNS_CHECK"], + ["punctuation", "{"], + ["property", "type"], + ["constant", "A"], + ["property", "type"], + ["constant", "NS"], + ["property", "type"], + ["constant", "CNAME"], + ["property", "type"], + ["constant", "SOA"], + ["property", "type"], + ["constant", "MX"], + ["property", "type"], + ["constant", "TXT"], + ["property", "type"], + ["constant", "AAAA"], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for constants, number, punctuations. \ No newline at end of file diff --git a/tests/languages/keepalived/ip_feature.test b/tests/languages/keepalived/ip_feature.test new file mode 100644 index 0000000000..801d399fe6 --- /dev/null +++ b/tests/languages/keepalived/ip_feature.test @@ -0,0 +1,25 @@ +virtual_server 192.168.1.200 3306 +virtual_server 192.168.1.200/32 3306 +virtual_server ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 3306 +virtual_server ABCD:EF01:2345:6789:ABCD:EF01:2345:6789/128 3306 + +---------------------------------------------------- + +[ + ["property", "virtual_server"], + ["ip", "192.168.1.200"], + ["number", "3306"], + ["property", "virtual_server"], + ["ip", "192.168.1.200/32"], + ["number", "3306"], + ["property", "virtual_server"], + ["ip", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789"], + ["number", "3306"], + ["property", "virtual_server"], + ["ip", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789/128"], + ["number", "3306"] +] + +---------------------------------------------------- + +Checks for ip (IPv4, IPv6, subnet mask). \ No newline at end of file diff --git a/tests/languages/keepalived/path_feature.test b/tests/languages/keepalived/path_feature.test new file mode 100644 index 0000000000..d5c5ff2f2c --- /dev/null +++ b/tests/languages/keepalived/path_feature.test @@ -0,0 +1,27 @@ +vrrp_instance VI_1 { + notify_master /etc/keepalived/to_master.sh + notify_backup C:\keepalived\to_backup.bat + net_namespace /var/run/keepalived + net_namespace C:\users\prism\keepalived +} + +---------------------------------------------------- + +[ + ["property", "vrrp_instance"], + " VI_1 ", + ["punctuation", "{"], + ["property", "notify_master"], + ["path", "/etc/keepalived/to_master.sh"], + ["property", "notify_backup"], + ["path", "C:\\keepalived\\to_backup.bat"], + ["property", "net_namespace"], + ["path", "/var/run/keepalived"], + ["property", "net_namespace"], + ["path", "C:\\users\\prism\\keepalived"], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for path. \ No newline at end of file diff --git a/tests/languages/keepalived/property_feature.test b/tests/languages/keepalived/property_feature.test new file mode 100644 index 0000000000..2accd91338 --- /dev/null +++ b/tests/languages/keepalived/property_feature.test @@ -0,0 +1,625 @@ +BFD_CHECK +DNS_CHECK +FILE_CHECK +HTTP_GET +MISC_CHECK +NAME +PING_CHECK +SCRIPTS +SMTP_CHECK +SSL +SSL_GET +TCP_CHECK +UDP_CHECK +accept +advert_int +alpha +auth_pass +auth_type +authentication +bfd_cpu_affinity +bfd_instance +bfd_no_swap +bfd_priority +bfd_process_name +bfd_rlimit_rttime +bfd_rt_priority +bind_if +bind_port +bindto +ca +certificate +check_unicast_src +checker +checker_cpu_affinity +checker_log_all_failures +checker_no_swap +checker_priority +checker_rlimit_rttime +checker_rt_priority +child_wait_time +connect_ip +connect_port +connect_timeout +dbus_service_name +debug +default_interface +delay +delay_before_retry +delay_loop +digest +dont_track_primary +dynamic +dynamic_interfaces +enable_dbus +enable_script_security +enable_sni +enable_snmp_checker +enable_snmp_rfc +enable_snmp_rfcv2 +enable_snmp_rfcv3 +enable_snmp_vrrp +enable_traps +end +fall +fast_recovery +file +flag-1 +flag-2 +flag-3 +fork_delay +full_command +fwmark +garp_group +garp_interval +garp_lower_prio_delay +garp_lower_prio_repeat +garp_master_delay +garp_master_refresh +garp_master_refresh_repeat +garp_master_repeat +global_defs +global_tracking +gna_interval +group +ha_suspend +hashed +helo_name +higher_prio_send_advert +hoplimit +http_protocol +hysteresis +idle_tx +include +inhibit_on_failure +init_fail +init_file +instance +interface +interfaces +interval +ip_family +ipvs_process_name +keepalived.conf +kernel_rx_buf_size +key +linkbeat_interfaces +linkbeat_use_polling +log_all_failures +log_unknown_vrids +lower_prio_no_advert +lthreshold +lvs_flush +lvs_flush_onstop +lvs_method +lvs_netlink_cmd_rcv_bufs +lvs_netlink_cmd_rcv_bufs_force +lvs_netlink_monitor_rcv_bufs +lvs_netlink_monitor_rcv_bufs_force +lvs_notify_fifo +lvs_notify_fifo_script +lvs_sched +lvs_sync_daemon +max_auto_priority +max_hops +mcast_src_ip +mh-fallback +mh-port +min_auto_priority_delay +min_rx +min_tx +misc_dynamic +misc_path +misc_timeout +multiplier +name +namespace_with_ipsets +native_ipv6 +neighbor_ip +net_namespace +net_namespace_ipvs +nftables +nftables_counters +nftables_ifindex +nftables_priority +no_accept +no_checker_emails +no_email_faults +nopreempt +notification_email +notification_email_from +notify +notify_backup +notify_deleted +notify_down +notify_fault +notify_fifo +notify_fifo_script +notify_master +notify_master_rx_lower_pri +notify_priority_changes +notify_stop +notify_up +old_unicast_checksum +omega +ops +param_match +passive +password +path +persistence_engine +persistence_granularity +persistence_timeout +preempt +preempt_delay +priority +process +process_monitor_rcv_bufs +process_monitor_rcv_bufs_force +process_name +process_names +promote_secondaries +protocol +proxy_arp +proxy_arp_pvlan +quorum +quorum_down +quorum_max +quorum_up +random_seed +real_server +regex +regex_max_offset +regex_min_offset +regex_no_match +regex_options +regex_stack +reload_time_file +reload_repeat +require_reply +retry +rise +router_id +rs_init_notifies +script +script_user +sh-fallback +sh-port +shutdown_script +shutdown_script_timeout +skip_check_adv_addr +smtp_alert +smtp_alert_checker +smtp_alert_vrrp +smtp_connect_timeout +smtp_helo_name +smtp_server +snmp_socket +sorry_server +sorry_server_inhibit +sorry_server_lvs_method +source_ip +start +startup_script +startup_script_timeout +state +static_ipaddress +static_routes +static_rules +status_code +step +strict_mode +sync_group_tracking_weight +terminate_delay +timeout +track_bfd +track_file +track_group +track_interface +track_process +track_script +track_src_ip +ttl +type +umask +unicast_peer +unicast_src_ip +unicast_ttl +url +use_ipvlan +use_pid_dir +use_vmac +user +uthreshold +val1 +val2 +val3 +version +virtual_ipaddress +virtual_ipaddress_excluded +virtual_router_id +virtual_routes +virtual_rules +virtual_server +virtual_server_group +virtualhost +vmac_xmit_base +vrrp +vrrp_check_unicast_src +vrrp_cpu_affinity +vrrp_garp_interval +vrrp_garp_lower_prio_delay +vrrp_garp_lower_prio_repeat +vrrp_garp_master_delay +vrrp_garp_master_refresh +vrrp_garp_master_refresh_repeat +vrrp_garp_master_repeat +vrrp_gna_interval +vrrp_higher_prio_send_advert +vrrp_instance +vrrp_ipsets +vrrp_iptables +vrrp_lower_prio_no_advert +vrrp_mcast_group4 +vrrp_mcast_group6 +vrrp_min_garp +vrrp_netlink_cmd_rcv_bufs +vrrp_netlink_cmd_rcv_bufs_force +vrrp_netlink_monitor_rcv_bufs +vrrp_netlink_monitor_rcv_bufs_force +vrrp_no_swap +vrrp_notify_fifo +vrrp_notify_fifo_script +vrrp_notify_priority_changes +vrrp_priority +vrrp_process_name +vrrp_rlimit_rttime +vrrp_rt_priority +vrrp_rx_bufs_multiplier +vrrp_rx_bufs_policy +vrrp_script +vrrp_skip_check_adv_addr +vrrp_startup_delay +vrrp_strict +vrrp_sync_group +vrrp_track_process +vrrp_version +warmup +weight + +---------------------------------------------------- + +[ + ["property", "BFD_CHECK"], + ["property", "DNS_CHECK"], + ["property", "FILE_CHECK"], + ["property", "HTTP_GET"], + ["property", "MISC_CHECK"], + ["property", "NAME"], + ["property", "PING_CHECK"], + ["property", "SCRIPTS"], + ["property", "SMTP_CHECK"], + ["property", "SSL"], + ["property", "SSL_GET"], + ["property", "TCP_CHECK"], + ["property", "UDP_CHECK"], + ["property", "accept"], + ["property", "advert_int"], + ["property", "alpha"], + ["property", "auth_pass"], + ["property", "auth_type"], + ["property", "authentication"], + ["property", "bfd_cpu_affinity"], + ["property", "bfd_instance"], + ["property", "bfd_no_swap"], + ["property", "bfd_priority"], + ["property", "bfd_process_name"], + ["property", "bfd_rlimit_rttime"], + ["property", "bfd_rt_priority"], + ["property", "bind_if"], + ["property", "bind_port"], + ["property", "bindto"], + ["property", "ca"], + ["property", "certificate"], + ["property", "check_unicast_src"], + ["property", "checker"], + ["property", "checker_cpu_affinity"], + ["property", "checker_log_all_failures"], + ["property", "checker_no_swap"], + ["property", "checker_priority"], + ["property", "checker_rlimit_rttime"], + ["property", "checker_rt_priority"], + ["property", "child_wait_time"], + ["property", "connect_ip"], + ["property", "connect_port"], + ["property", "connect_timeout"], + ["property", "dbus_service_name"], + ["property", "debug"], + ["property", "default_interface"], + ["property", "delay"], + ["property", "delay_before_retry"], + ["property", "delay_loop"], + ["property", "digest"], + ["property", "dont_track_primary"], + ["property", "dynamic"], + ["property", "dynamic_interfaces"], + ["property", "enable_dbus"], + ["property", "enable_script_security"], + ["property", "enable_sni"], + ["property", "enable_snmp_checker"], + ["property", "enable_snmp_rfc"], + ["property", "enable_snmp_rfcv2"], + ["property", "enable_snmp_rfcv3"], + ["property", "enable_snmp_vrrp"], + ["property", "enable_traps"], + ["property", "end"], + ["property", "fall"], + ["property", "fast_recovery"], + ["property", "file"], + ["property", "flag-1"], + ["property", "flag-2"], + ["property", "flag-3"], + ["property", "fork_delay"], + ["property", "full_command"], + ["property", "fwmark"], + ["property", "garp_group"], + ["property", "garp_interval"], + ["property", "garp_lower_prio_delay"], + ["property", "garp_lower_prio_repeat"], + ["property", "garp_master_delay"], + ["property", "garp_master_refresh"], + ["property", "garp_master_refresh_repeat"], + ["property", "garp_master_repeat"], + ["property", "global_defs"], + ["property", "global_tracking"], + ["property", "gna_interval"], + ["property", "group"], + ["property", "ha_suspend"], + ["property", "hashed"], + ["property", "helo_name"], + ["property", "higher_prio_send_advert"], + ["property", "hoplimit"], + ["property", "http_protocol"], + ["property", "hysteresis"], + ["property", "idle_tx"], + ["property", "include"], + ["property", "inhibit_on_failure"], + ["property", "init_fail"], + ["property", "init_file"], + ["property", "instance"], + ["property", "interface"], + ["property", "interfaces"], + ["property", "interval"], + ["property", "ip_family"], + ["property", "ipvs_process_name"], + ["property", "keepalived.conf"], + ["property", "kernel_rx_buf_size"], + ["property", "key"], + ["property", "linkbeat_interfaces"], + ["property", "linkbeat_use_polling"], + ["property", "log_all_failures"], + ["property", "log_unknown_vrids"], + ["property", "lower_prio_no_advert"], + ["property", "lthreshold"], + ["property", "lvs_flush"], + ["property", "lvs_flush_onstop"], + ["property", "lvs_method"], + ["property", "lvs_netlink_cmd_rcv_bufs"], + ["property", "lvs_netlink_cmd_rcv_bufs_force"], + ["property", "lvs_netlink_monitor_rcv_bufs"], + ["property", "lvs_netlink_monitor_rcv_bufs_force"], + ["property", "lvs_notify_fifo"], + ["property", "lvs_notify_fifo_script"], + ["property", "lvs_sched"], + ["property", "lvs_sync_daemon"], + ["property", "max_auto_priority"], + ["property", "max_hops"], + ["property", "mcast_src_ip"], + ["property", "mh-fallback"], + ["property", "mh-port"], + ["property", "min_auto_priority_delay"], + ["property", "min_rx"], + ["property", "min_tx"], + ["property", "misc_dynamic"], + ["property", "misc_path"], + ["property", "misc_timeout"], + ["property", "multiplier"], + ["property", "name"], + ["property", "namespace_with_ipsets"], + ["property", "native_ipv6"], + ["property", "neighbor_ip"], + ["property", "net_namespace"], + ["property", "net_namespace_ipvs"], + ["property", "nftables"], + ["property", "nftables_counters"], + ["property", "nftables_ifindex"], + ["property", "nftables_priority"], + ["property", "no_accept"], + ["property", "no_checker_emails"], + ["property", "no_email_faults"], + ["property", "nopreempt"], + ["property", "notification_email"], + ["property", "notification_email_from"], + ["property", "notify"], + ["property", "notify_backup"], + ["property", "notify_deleted"], + ["property", "notify_down"], + ["property", "notify_fault"], + ["property", "notify_fifo"], + ["property", "notify_fifo_script"], + ["property", "notify_master"], + ["property", "notify_master_rx_lower_pri"], + ["property", "notify_priority_changes"], + ["property", "notify_stop"], + ["property", "notify_up"], + ["property", "old_unicast_checksum"], + ["property", "omega"], + ["property", "ops"], + ["property", "param_match"], + ["property", "passive"], + ["property", "password"], + ["property", "path"], + ["property", "persistence_engine"], + ["property", "persistence_granularity"], + ["property", "persistence_timeout"], + ["property", "preempt"], + ["property", "preempt_delay"], + ["property", "priority"], + ["property", "process"], + ["property", "process_monitor_rcv_bufs"], + ["property", "process_monitor_rcv_bufs_force"], + ["property", "process_name"], + ["property", "process_names"], + ["property", "promote_secondaries"], + ["property", "protocol"], + ["property", "proxy_arp"], + ["property", "proxy_arp_pvlan"], + ["property", "quorum"], + ["property", "quorum_down"], + ["property", "quorum_max"], + ["property", "quorum_up"], + ["property", "random_seed"], + ["property", "real_server"], + ["property", "regex"], + ["property", "regex_max_offset"], + ["property", "regex_min_offset"], + ["property", "regex_no_match"], + ["property", "regex_options"], + ["property", "regex_stack"], + ["property", "reload_time_file"], + ["property", "reload_repeat"], + ["property", "require_reply"], + ["property", "retry"], + ["property", "rise"], + ["property", "router_id"], + ["property", "rs_init_notifies"], + ["property", "script"], + ["property", "script_user"], + ["property", "sh-fallback"], + ["property", "sh-port"], + ["property", "shutdown_script"], + ["property", "shutdown_script_timeout"], + ["property", "skip_check_adv_addr"], + ["property", "smtp_alert"], + ["property", "smtp_alert_checker"], + ["property", "smtp_alert_vrrp"], + ["property", "smtp_connect_timeout"], + ["property", "smtp_helo_name"], + ["property", "smtp_server"], + ["property", "snmp_socket"], + ["property", "sorry_server"], + ["property", "sorry_server_inhibit"], + ["property", "sorry_server_lvs_method"], + ["property", "source_ip"], + ["property", "start"], + ["property", "startup_script"], + ["property", "startup_script_timeout"], + ["property", "state"], + ["property", "static_ipaddress"], + ["property", "static_routes"], + ["property", "static_rules"], + ["property", "status_code"], + ["property", "step"], + ["property", "strict_mode"], + ["property", "sync_group_tracking_weight"], + ["property", "terminate_delay"], + ["property", "timeout"], + ["property", "track_bfd"], + ["property", "track_file"], + ["property", "track_group"], + ["property", "track_interface"], + ["property", "track_process"], + ["property", "track_script"], + ["property", "track_src_ip"], + ["property", "ttl"], + ["property", "type"], + ["property", "umask"], + ["property", "unicast_peer"], + ["property", "unicast_src_ip"], + ["property", "unicast_ttl"], + ["property", "url"], + ["property", "use_ipvlan"], + ["property", "use_pid_dir"], + ["property", "use_vmac"], + ["property", "user"], + ["property", "uthreshold"], + ["property", "val1"], + ["property", "val2"], + ["property", "val3"], + ["property", "version"], + ["property", "virtual_ipaddress"], + ["property", "virtual_ipaddress_excluded"], + ["property", "virtual_router_id"], + ["property", "virtual_routes"], + ["property", "virtual_rules"], + ["property", "virtual_server"], + ["property", "virtual_server_group"], + ["property", "virtualhost"], + ["property", "vmac_xmit_base"], + ["property", "vrrp"], + ["property", "vrrp_check_unicast_src"], + ["property", "vrrp_cpu_affinity"], + ["property", "vrrp_garp_interval"], + ["property", "vrrp_garp_lower_prio_delay"], + ["property", "vrrp_garp_lower_prio_repeat"], + ["property", "vrrp_garp_master_delay"], + ["property", "vrrp_garp_master_refresh"], + ["property", "vrrp_garp_master_refresh_repeat"], + ["property", "vrrp_garp_master_repeat"], + ["property", "vrrp_gna_interval"], + ["property", "vrrp_higher_prio_send_advert"], + ["property", "vrrp_instance"], + ["property", "vrrp_ipsets"], + ["property", "vrrp_iptables"], + ["property", "vrrp_lower_prio_no_advert"], + ["property", "vrrp_mcast_group4"], + ["property", "vrrp_mcast_group6"], + ["property", "vrrp_min_garp"], + ["property", "vrrp_netlink_cmd_rcv_bufs"], + ["property", "vrrp_netlink_cmd_rcv_bufs_force"], + ["property", "vrrp_netlink_monitor_rcv_bufs"], + ["property", "vrrp_netlink_monitor_rcv_bufs_force"], + ["property", "vrrp_no_swap"], + ["property", "vrrp_notify_fifo"], + ["property", "vrrp_notify_fifo_script"], + ["property", "vrrp_notify_priority_changes"], + ["property", "vrrp_priority"], + ["property", "vrrp_process_name"], + ["property", "vrrp_rlimit_rttime"], + ["property", "vrrp_rt_priority"], + ["property", "vrrp_rx_bufs_multiplier"], + ["property", "vrrp_rx_bufs_policy"], + ["property", "vrrp_script"], + ["property", "vrrp_skip_check_adv_addr"], + ["property", "vrrp_startup_delay"], + ["property", "vrrp_strict"], + ["property", "vrrp_sync_group"], + ["property", "vrrp_track_process"], + ["property", "vrrp_version"], + ["property", "warmup"], + ["property", "weight"] +] + +---------------------------------------------------- + +Checks for properties. diff --git a/tests/languages/keepalived/string_feature.test b/tests/languages/keepalived/string_feature.test new file mode 100644 index 0000000000..c8b2993c3a --- /dev/null +++ b/tests/languages/keepalived/string_feature.test @@ -0,0 +1,34 @@ +global_defs { + notification_email { + example@163.com + } + notification_email_from example@example.com +} + +vrrp_instance VI_1 { + notify_fault "/etc/keepalived/to_fault.sh" +} + +---------------------------------------------------- + +[ + ["property", "global_defs"], + ["punctuation", "{"], + ["property", "notification_email"], + ["punctuation", "{"], + ["email", "example@163.com"], + ["punctuation", "}"], + ["property", "notification_email_from"], + ["email", "example@example.com"], + ["punctuation", "}"], + ["property", "vrrp_instance"], + " VI_1 ", + ["punctuation", "{"], + ["property", "notify_fault"], + ["string", "\"/etc/keepalived/to_fault.sh\""], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for string, email (alias string). \ No newline at end of file diff --git a/tests/languages/keepalived/variable_feature.test b/tests/languages/keepalived/variable_feature.test new file mode 100644 index 0000000000..751c374d4a --- /dev/null +++ b/tests/languages/keepalived/variable_feature.test @@ -0,0 +1,23 @@ +$ADDRESS_BASE=10.2.${ADDRESS_BASE_SUB} +$ADDRESS_BASE_SUB=0 +${ADDRESS_BASE}.100/32 +$ADDRESS_BASE_SUB=10 + +---------------------------------------------------- + +[ + ["variable", "$ADDRESS_BASE"], + ["operator", "="], + ["number", "10.2"], + ".", + ["variable", "${ADDRESS_BASE_SUB}"], + ["variable", "$ADDRESS_BASE_SUB"], + ["operator", "="], + ["number", "0"], + ["variable", "${ADDRESS_BASE}"], + ".100/", + ["number", "32"], + ["variable", "$ADDRESS_BASE_SUB"], + ["operator", "="], + ["number", "10"] +] \ No newline at end of file diff --git a/tests/languages/keyman/atrule_feature.test b/tests/languages/keyman/atrule_feature.test deleted file mode 100644 index 1171caf3be..0000000000 --- a/tests/languages/keyman/atrule_feature.test +++ /dev/null @@ -1,15 +0,0 @@ -ansi begin unicode -group using keys -match nomatch - ----------------------------------------------------- - -[ - ["atrule", "ansi"], ["atrule", "begin"], ["atrule", "unicode"], - ["atrule", "group"], ["atrule", "using keys"], - ["atrule", "match"], ["atrule", "nomatch"] -] - ----------------------------------------------------- - -Checks for all structural keywords. \ No newline at end of file diff --git a/tests/languages/keyman/bold_feature.test b/tests/languages/keyman/bold_feature.test deleted file mode 100644 index 58e731c2ce..0000000000 --- a/tests/languages/keyman/bold_feature.test +++ /dev/null @@ -1,59 +0,0 @@ -&baselayout &bitmap &capsononly -&capsalwaysoff &shiftfreescaps -©right ðnologuecode -&hotkey &includecodes -&keyboardversion &kmw_embedcss -&kmw_embedjs &kmw_helpfile -&kmw_helptext &kmw_rtl -&language &layer &layoutfile -&message &mnemoniclayout -&name &oldcharposmatching -&platform &targets &version -&visualkeyboard &windowslanguages - -bitmap -bitmaps -caps on only -caps always off -shift frees caps -copyright -hotkey -language -layout -message -name -version - ----------------------------------------------------- - -[ - ["bold", "&baselayout"], ["bold", "&bitmap"], ["bold", "&capsononly"], - ["bold", "&capsalwaysoff"], ["bold", "&shiftfreescaps"], - ["bold", "©right"], ["bold", "ðnologuecode"], - ["bold", "&hotkey"], ["bold", "&includecodes"], - ["bold", "&keyboardversion"], ["bold", "&kmw_embedcss"], - ["bold", "&kmw_embedjs"], ["bold", "&kmw_helpfile"], - ["bold", "&kmw_helptext"], ["bold", "&kmw_rtl"], - ["bold", "&language"], ["bold", "&layer"], ["bold", "&layoutfile"], - ["bold", "&message"], ["bold", "&mnemoniclayout"], - ["bold", "&name"], ["bold", "&oldcharposmatching"], - ["bold", "&platform"], ["bold", "&targets"], ["bold", "&version"], - ["bold", "&visualkeyboard"], ["bold", "&windowslanguages"], - - ["bold", "bitmap"], - ["bold", "bitmaps"], - ["bold", "caps on only"], - ["bold", "caps always off"], - ["bold", "shift frees caps"], - ["bold", "copyright"], - ["bold", "hotkey"], - ["bold", "language"], - ["bold", "layout"], - ["bold", "message"], - ["bold", "name"], - ["bold", "version"] -] - ----------------------------------------------------- - -Checks for header statements, system stores and variable system stores. \ No newline at end of file diff --git a/tests/languages/keyman/compile-target_feature.test b/tests/languages/keyman/compile-target_feature.test new file mode 100644 index 0000000000..5d0bbc446e --- /dev/null +++ b/tests/languages/keyman/compile-target_feature.test @@ -0,0 +1,27 @@ +$keyman: +$kmfl: +$weaver: +$keymanweb: +$keymanonly: + +c Note: return statement is only supported in .kmx in Keyman 13 +$keymanonly: + 'a' > 'a' return + +---------------------------------------------------- + +[ + ["compile-target", "$keyman:"], + ["compile-target", "$kmfl:"], + ["compile-target", "$weaver:"], + ["compile-target", "$keymanweb:"], + ["compile-target", "$keymanonly:"], + + ["comment", "c Note: return statement is only supported in .kmx in Keyman 13"], + + ["compile-target", "$keymanonly:"], + ["operator", "+"], + ["string", "'a'"], + ["operator", ">"], + ["string", "'a'"], + ["rule-keyword", "return"] +] diff --git a/tests/languages/keyman/function_feature.test b/tests/languages/keyman/function_feature.test deleted file mode 100644 index 3852ade1b2..0000000000 --- a/tests/languages/keyman/function_feature.test +++ /dev/null @@ -1,39 +0,0 @@ -['c'] -["f"] -[K_SEL] -[K_KANJI?15] -[T_SCHWA] -[U_0259] -[CTRL 'a'] -[SHIFT "b"] -[ALT K_C] -[LCTRL T_D] -[RCTRL U_E259] -[LALT K_F] -[RALT K_G] -[CAPS K_H] -[NCAPS K_I] - ----------------------------------------------------- - -[ - ["function", "['c']"], - ["function", "[\"f\"]"], - ["function", "[K_SEL]"], - ["function", "[K_KANJI?15]"], - ["function", "[T_SCHWA]"], - ["function", "[U_0259]"], - ["function", "[CTRL 'a']"], - ["function", "[SHIFT \"b\"]"], - ["function", "[ALT K_C]"], - ["function", "[LCTRL T_D]"], - ["function", "[RCTRL U_E259]"], - ["function", "[LALT K_F]"], - ["function", "[RALT K_G]"], - ["function", "[CAPS K_H]"], - ["function", "[NCAPS K_I]"] -] - ----------------------------------------------------- - -Checks for keys, with all possible modifiers. \ No newline at end of file diff --git a/tests/languages/keyman/header-keyword.test b/tests/languages/keyman/header-keyword.test new file mode 100644 index 0000000000..8dcdf8f6cd --- /dev/null +++ b/tests/languages/keyman/header-keyword.test @@ -0,0 +1,59 @@ +&baselayout +&bitmap +&capsononly +&capsalwaysoff +&shiftfreescaps +©right +ðnologuecode +&hotkey +&includecodes +&keyboardversion +&kmw_embedcss +&kmw_embedjs +&kmw_helpfile +&kmw_helptext +&kmw_rtl +&language +&layer +&layoutfile +&message +&mnemoniclayout +&name +&oldcharposmatching +&platform +&targets +&version +&visualkeyboard +&windowslanguages + +---------------------------------------------------- + +[ + ["header-keyword", "&baselayout"], + ["header-keyword", "&bitmap"], + ["header-keyword", "&capsononly"], + ["header-keyword", "&capsalwaysoff"], + ["header-keyword", "&shiftfreescaps"], + ["header-keyword", "©right"], + ["header-keyword", "ðnologuecode"], + ["header-keyword", "&hotkey"], + ["header-keyword", "&includecodes"], + ["header-keyword", "&keyboardversion"], + ["header-keyword", "&kmw_embedcss"], + ["header-keyword", "&kmw_embedjs"], + ["header-keyword", "&kmw_helpfile"], + ["header-keyword", "&kmw_helptext"], + ["header-keyword", "&kmw_rtl"], + ["header-keyword", "&language"], + ["header-keyword", "&layer"], + ["header-keyword", "&layoutfile"], + ["header-keyword", "&message"], + ["header-keyword", "&mnemoniclayout"], + ["header-keyword", "&name"], + ["header-keyword", "&oldcharposmatching"], + ["header-keyword", "&platform"], + ["header-keyword", "&targets"], + ["header-keyword", "&version"], + ["header-keyword", "&visualkeyboard"], + ["header-keyword", "&windowslanguages"] +] diff --git a/tests/languages/keyman/header-statement.test b/tests/languages/keyman/header-statement.test new file mode 100644 index 0000000000..c6b1043af4 --- /dev/null +++ b/tests/languages/keyman/header-statement.test @@ -0,0 +1,29 @@ +bitmap +bitmaps +caps on only +caps always off +shift frees caps +copyright +hotkey +language +layout +message +name +version + +---------------------------------------------------- + +[ + ["header-statement", "bitmap"], + ["header-statement", "bitmaps"], + ["header-statement", "caps on only"], + ["header-statement", "caps always off"], + ["header-statement", "shift frees caps"], + ["header-statement", "copyright"], + ["header-statement", "hotkey"], + ["header-statement", "language"], + ["header-statement", "layout"], + ["header-statement", "message"], + ["header-statement", "name"], + ["header-statement", "version"] +] diff --git a/tests/languages/keyman/keyword_feature.test b/tests/languages/keyman/keyword_feature.test deleted file mode 100644 index 7bbd2303ee..0000000000 --- a/tests/languages/keyman/keyword_feature.test +++ /dev/null @@ -1,21 +0,0 @@ -any baselayout beep -call context deadkey -dk if index layer -notany nul outs -platform return reset -save set store use - ----------------------------------------------------- - -[ - ["keyword", "any"], ["keyword", "baselayout"], ["keyword", "beep"], - ["keyword", "call"], ["keyword", "context"], ["keyword", "deadkey"], - ["keyword", "dk"], ["keyword", "if"], ["keyword", "index"], ["keyword", "layer"], - ["keyword", "notany"], ["keyword", "nul"], ["keyword", "outs"], - ["keyword", "platform"], ["keyword", "return"], ["keyword", "reset"], - ["keyword", "save"], ["keyword", "set"], ["keyword", "store"], ["keyword", "use"] -] - ----------------------------------------------------- - -Checks for all keywords. \ No newline at end of file diff --git a/tests/languages/keyman/operator_feature.test b/tests/languages/keyman/operator_feature.test index bc439e8597..833a370ba7 100644 --- a/tests/languages/keyman/operator_feature.test +++ b/tests/languages/keyman/operator_feature.test @@ -1,15 +1,17 @@ -+ > -\ , -( ) ++ > \ + +$vowel_a +'a' .. 'z' ---------------------------------------------------- [ - ["operator", "+"], ["operator", ">"], - ["operator", "\\"], ["operator", ","], - ["operator", "("], ["operator", ")"] + ["operator", "+"], ["operator", ">"], ["operator", "\\"], + + ["operator", "$"], "vowel_a\r\n", + ["string", "'a'"], ["operator", ".."], ["string", "'z'"] ] ---------------------------------------------------- -Checks for all operators. \ No newline at end of file +Checks for all operators. diff --git a/tests/languages/keyman/punctuation_feature.test b/tests/languages/keyman/punctuation_feature.test new file mode 100644 index 0000000000..5865966755 --- /dev/null +++ b/tests/languages/keyman/punctuation_feature.test @@ -0,0 +1,9 @@ +( ) +, = + +---------------------------------------------------- + +[ + ["punctuation", "("], ["punctuation", ")"], + ["punctuation", ","], ["punctuation", "="] +] diff --git a/tests/languages/keyman/rule-keyword_feature.test b/tests/languages/keyman/rule-keyword_feature.test new file mode 100644 index 0000000000..f2b3c488cd --- /dev/null +++ b/tests/languages/keyman/rule-keyword_feature.test @@ -0,0 +1,49 @@ +any +baselayout +beep +call +context +deadkey +dk +if +index +layer +notany +nul +outs +platform +reset +return +save +set +store +use + +---------------------------------------------------- + +[ + ["rule-keyword", "any"], + ["rule-keyword", "baselayout"], + ["rule-keyword", "beep"], + ["rule-keyword", "call"], + ["rule-keyword", "context"], + ["rule-keyword", "deadkey"], + ["rule-keyword", "dk"], + ["rule-keyword", "if"], + ["rule-keyword", "index"], + ["rule-keyword", "layer"], + ["rule-keyword", "notany"], + ["rule-keyword", "nul"], + ["rule-keyword", "outs"], + ["rule-keyword", "platform"], + ["rule-keyword", "reset"], + ["rule-keyword", "return"], + ["rule-keyword", "save"], + ["rule-keyword", "set"], + ["rule-keyword", "store"], + ["rule-keyword", "use"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/keyman/structural-keyword_feature.test b/tests/languages/keyman/structural-keyword_feature.test new file mode 100644 index 0000000000..f95e029468 --- /dev/null +++ b/tests/languages/keyman/structural-keyword_feature.test @@ -0,0 +1,23 @@ +ansi +begin +unicode +group +using keys +match +nomatch + +---------------------------------------------------- + +[ + ["structural-keyword", "ansi"], + ["structural-keyword", "begin"], + ["structural-keyword", "unicode"], + ["structural-keyword", "group"], + ["structural-keyword", "using keys"], + ["structural-keyword", "match"], + ["structural-keyword", "nomatch"] +] + +---------------------------------------------------- + +Checks for all structural keywords. diff --git a/tests/languages/keyman/tag_feature.test b/tests/languages/keyman/tag_feature.test deleted file mode 100644 index 2aa760ae32..0000000000 --- a/tests/languages/keyman/tag_feature.test +++ /dev/null @@ -1,19 +0,0 @@ -$keyman: -$kmfl: -$weaver: -$keymanweb: -$keymanonly: - ----------------------------------------------------- - -[ - ["tag", "$keyman:"], - ["tag", "$kmfl:"], - ["tag", "$weaver:"], - ["tag", "$keymanweb:"], - ["tag", "$keymanonly:"] -] - ----------------------------------------------------- - -Checks for all prefixes. \ No newline at end of file diff --git a/tests/languages/keyman/virtual-key_feature.test b/tests/languages/keyman/virtual-key_feature.test new file mode 100644 index 0000000000..8ecf649f8f --- /dev/null +++ b/tests/languages/keyman/virtual-key_feature.test @@ -0,0 +1,43 @@ +['c'] +["f"] +[K_SEL] +[K_KANJI?15] +[T_SCHWA] +[U_0259] +[CTRL 'a'] +[SHIFT "b"] +[ALT K_C] +[LCTRL T_D] +[RCTRL U_E259] +[LALT K_F] +[RALT K_G] +[CAPS K_H] +[NCAPS K_I] +[SHIFT CAPS K_A] +[SHIFT C01] + +---------------------------------------------------- + +[ + ["virtual-key", "['c']"], + ["virtual-key", "[\"f\"]"], + ["virtual-key", "[K_SEL]"], + ["virtual-key", "[K_KANJI?15]"], + ["virtual-key", "[T_SCHWA]"], + ["virtual-key", "[U_0259]"], + ["virtual-key", "[CTRL 'a']"], + ["virtual-key", "[SHIFT \"b\"]"], + ["virtual-key", "[ALT K_C]"], + ["virtual-key", "[LCTRL T_D]"], + ["virtual-key", "[RCTRL U_E259]"], + ["virtual-key", "[LALT K_F]"], + ["virtual-key", "[RALT K_G]"], + ["virtual-key", "[CAPS K_H]"], + ["virtual-key", "[NCAPS K_I]"], + ["virtual-key", "[SHIFT CAPS K_A]"], + ["virtual-key", "[SHIFT C01]"] +] + +---------------------------------------------------- + +Checks for keys, with all possible modifiers. diff --git a/tests/languages/kotlin/char_feature.test b/tests/languages/kotlin/char_feature.test new file mode 100644 index 0000000000..8f59a658da --- /dev/null +++ b/tests/languages/kotlin/char_feature.test @@ -0,0 +1,11 @@ +'a' +'\n' +'\uFFFF' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\n'"], + ["char", "'\\uFFFF'"] +] diff --git a/tests/languages/kotlin/function_feature.test b/tests/languages/kotlin/function_feature.test index 8bfd2b2261..29222ecf0c 100644 --- a/tests/languages/kotlin/function_feature.test +++ b/tests/languages/kotlin/function_feature.test @@ -1,6 +1,10 @@ foo() foo_Bar_42() list.filter {} +`function 1`() +` !"#$%^&()*+,=?@{|}~-_`() +list.`take 1` {} +`make fun`() ---------------------------------------------------- @@ -8,7 +12,12 @@ list.filter {} ["function", "foo"], ["punctuation", "("], ["punctuation", ")"], ["function", "foo_Bar_42"], ["punctuation", "("], ["punctuation", ")"], "\r\nlist", ["punctuation", "."], - ["function", "filter"], ["punctuation", "{"], ["punctuation", "}"] + ["function", "filter"], ["punctuation", "{"], ["punctuation", "}"], + ["function", "`function 1`"], ["punctuation", "("], ["punctuation", ")"], + ["function", "` !\"#$%^&()*+,=?@{|}~-_`"], ["punctuation", "("], ["punctuation", ")"], + "\r\nlist", ["punctuation", "."], + ["function", "`take 1`"], ["punctuation", "{"], ["punctuation", "}"], + ["function", "`make fun`"], ["punctuation", "("], ["punctuation", ")"] ] ---------------------------------------------------- diff --git a/tests/languages/kotlin/interpolation_feature.test b/tests/languages/kotlin/interpolation_feature.test deleted file mode 100644 index 44ec667d62..0000000000 --- a/tests/languages/kotlin/interpolation_feature.test +++ /dev/null @@ -1,46 +0,0 @@ -"$foo ${bar} ${'$'} ${foobar()}" -""" -$foo ${bar} -${'$'} ${foobar()} -""" - ----------------------------------------------------- - -[ - ["string", [ - "\"", - ["interpolation", "$foo"], - ["interpolation", [ - ["delimiter", "${"], "bar", ["delimiter", "}"] - ]], - ["interpolation", [ - ["delimiter", "${"], ["string", ["'$'"]], ["delimiter", "}"] - ]], - ["interpolation", [ - ["delimiter", "${"], - ["function", "foobar"], ["punctuation", "("], ["punctuation", ")"], - ["delimiter", "}"] - ]], - "\"" - ]], - ["raw-string", [ - "\"\"\"\r\n", - ["interpolation", "$foo"], - ["interpolation", [ - ["delimiter", "${"], "bar", ["delimiter", "}"] - ]], - ["interpolation", [ - ["delimiter", "${"], ["string", ["'$'"]], ["delimiter", "}"] - ]], - ["interpolation", [ - ["delimiter", "${"], - ["function", "foobar"], ["punctuation", "("], ["punctuation", ")"], - ["delimiter", "}"] - ]], - "\r\n\"\"\"" - ]] -] - ----------------------------------------------------- - -Checks for string interpolation. \ No newline at end of file diff --git a/tests/languages/kotlin/raw-string_feature.test b/tests/languages/kotlin/raw-string_feature.test deleted file mode 100644 index 5a5ca3309b..0000000000 --- a/tests/languages/kotlin/raw-string_feature.test +++ /dev/null @@ -1,18 +0,0 @@ -"""""" -"""Foo "bar"" baz""" -""" -"Foo" -bar -""" - ----------------------------------------------------- - -[ - ["raw-string", ["\"\"\"\"\"\""]], - ["raw-string", ["\"\"\"Foo \"bar\"\" baz\"\"\""]], - ["raw-string", ["\"\"\"\r\n\"Foo\"\r\nbar\r\n\"\"\""]] -] - ----------------------------------------------------- - -Checks for raw strings. \ No newline at end of file diff --git a/tests/languages/kotlin/string_feature.test b/tests/languages/kotlin/string_feature.test new file mode 100644 index 0000000000..921f51e5b8 --- /dev/null +++ b/tests/languages/kotlin/string_feature.test @@ -0,0 +1,113 @@ +"" +"foo" +"\"\"" + +"""""" +"""Foo "bar"" baz""" +""" +"Foo" +bar +""" + +// interpolation + +"$foo ${bar} ${'$'} ${foobar()}" +""" +$foo ${bar} +${'$'} ${foobar()} +""" + +---------------------------------------------------- + +[ + ["string-literal", [ + ["string", "\"\""] + ]], + ["string-literal", [ + ["string", "\"foo\""] + ]], + ["string-literal", [ + ["string", "\"\\\"\\\"\""] + ]], + + ["string-literal", [ + ["string", "\"\"\"\"\"\""] + ]], + ["string-literal", [ + ["string", "\"\"\"Foo \"bar\"\" baz\"\"\""] + ]], + ["string-literal", [ + ["string", "\"\"\"\r\n\"Foo\"\r\nbar\r\n\"\"\""] + ]], + + ["comment", "// interpolation"], + + ["string-literal", [ + ["string", "\""], + ["interpolation", [ + ["interpolation-punctuation", "$"], + ["expression", ["foo"]] + ]], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", ["bar"]], + ["interpolation-punctuation", "}"] + ]], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", [ + ["char", "'$'"] + ]], + ["interpolation-punctuation", "}"] + ]], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", [ + ["function", "foobar"], + ["punctuation", "("], + ["punctuation", ")"] + ]], + ["interpolation-punctuation", "}"] + ]], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\"\"\"\r\n"], + ["interpolation", [ + ["interpolation-punctuation", "$"], + ["expression", ["foo"]] + ]], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", ["bar"]], + ["interpolation-punctuation", "}"] + ]], + ["string", "\r\n"], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", [ + ["char", "'$'"] + ]], + ["interpolation-punctuation", "}"] + ]], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["expression", [ + ["function", "foobar"], + ["punctuation", "("], + ["punctuation", ")"] + ]], + ["interpolation-punctuation", "}"] + ]], + ["string", "\r\n\"\"\""] + ]] +] + +---------------------------------------------------- + +Checks for raw strings. diff --git a/tests/languages/kumir/boolean_feature.test b/tests/languages/kumir/boolean_feature.test new file mode 100644 index 0000000000..4e7ff5213e --- /dev/null +++ b/tests/languages/kumir/boolean_feature.test @@ -0,0 +1,13 @@ +да +нет + +---------------------------------------------------- + +[ + ["boolean", "да"], + ["boolean", "нет"] +] + +---------------------------------------------------- + +Checks for Booleans. diff --git a/tests/languages/kumir/comment_feature.test b/tests/languages/kumir/comment_feature.test new file mode 100644 index 0000000000..0b5da82970 --- /dev/null +++ b/tests/languages/kumir/comment_feature.test @@ -0,0 +1,27 @@ + |foo +| +| foo bar baz +|"" +|# +|'' +|+1 +|| +|алг + +---------------------------------------------------- + +[ + ["comment", "|foo"], + ["comment", "|"], + ["comment", "| foo bar baz"], + ["comment", "|\"\""], + ["comment", "|#"], + ["comment", "|''"], + ["comment", "|+1"], + ["comment", "||"], + ["comment", "|алг"] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/kumir/keyword_feature.test b/tests/languages/kumir/keyword_feature.test new file mode 100644 index 0000000000..a415d3a442 --- /dev/null +++ b/tests/languages/kumir/keyword_feature.test @@ -0,0 +1,35 @@ +арг +арг рез +арг рез +аргрез +рез +кон +кон исп +кон исп +кон_исп +кц +кц при +кц_при +при + +---------------------------------------------------- + +[ + ["keyword", "арг"], + ["keyword", "арг рез"], + ["keyword", "арг рез"], + ["keyword", "аргрез"], + ["keyword", "рез"], + ["keyword", "кон"], + ["keyword", "кон исп"], + ["keyword", "кон исп"], + ["keyword", "кон_исп"], + ["keyword", "кц"], + ["keyword", "кц при"], + ["keyword", "кц_при"], + ["keyword", "при"] +] + +---------------------------------------------------- + +Checks for keywords. diff --git a/tests/languages/kumir/name_feature.test b/tests/languages/kumir/name_feature.test new file mode 100644 index 0000000000..f2dc9179e7 --- /dev/null +++ b/tests/languages/kumir/name_feature.test @@ -0,0 +1,19 @@ +! +! 09 @ _ AZ az +@ +_ +аргумент + +---------------------------------------------------- + +[ + ["name", "!"], + ["name", "! 09 @ _ AZ az"], + ["name", "@"], + ["name", "_"], + ["name", "аргумент"] +] + +---------------------------------------------------- + +Checks for names. diff --git a/tests/languages/kumir/number_feature.test b/tests/languages/kumir/number_feature.test new file mode 100644 index 0000000000..c6869dda25 --- /dev/null +++ b/tests/languages/kumir/number_feature.test @@ -0,0 +1,35 @@ +$ +$1BADB002 +$1badb002 +. +.456 +123 +123. +123.456 +123.456E7 +123.456e7 +123e+4 +123e-4 +123e4 + +---------------------------------------------------- + +[ + "$\r\n", + ["number", "$1BADB002"], + ["number", "$1badb002"], + "\r\n.\r\n", + ["number", ".456"], + ["number", "123"], + ["number", "123."], + ["number", "123.456"], + ["number", "123.456E7"], + ["number", "123.456e7"], + ["number", "123e+4"], + ["number", "123e-4"], + ["number", "123e4"] +] + +---------------------------------------------------- + +Checks for numeric constants. diff --git a/tests/languages/kumir/operator_feature.test b/tests/languages/kumir/operator_feature.test new file mode 100644 index 0000000000..458aa05866 --- /dev/null +++ b/tests/languages/kumir/operator_feature.test @@ -0,0 +1,37 @@ +* +** ++ +- +/ +< +<= +<> += +> +>= +и +или +не + +---------------------------------------------------- + +[ + ["operator-char", "*"], + ["operator-char", "**"], + ["operator-char", "+"], + ["operator-char", "-"], + ["operator-char", "/"], + ["operator-char", "<"], + ["operator-char", "<="], + ["operator-char", "<>"], + ["operator-char", "="], + ["operator-char", ">"], + ["operator-char", ">="], + ["operator-word", "и"], + ["operator-word", "или"], + ["operator-word", "не"] +] + +---------------------------------------------------- + +Checks for operators. diff --git a/tests/languages/kumir/prolog_feature.test b/tests/languages/kumir/prolog_feature.test new file mode 100644 index 0000000000..9e6bc61492 --- /dev/null +++ b/tests/languages/kumir/prolog_feature.test @@ -0,0 +1,27 @@ + #foo +# +# foo bar baz +#"" +## +#'' +#+1 +#| +#алг + +---------------------------------------------------- + +[ + ["prolog", "#foo"], + ["prolog", "#"], + ["prolog", "# foo bar baz"], + ["prolog", "#\"\""], + ["prolog", "##"], + ["prolog", "#''"], + ["prolog", "#+1"], + ["prolog", "#|"], + ["prolog", "#алг"] +] + +---------------------------------------------------- + +Checks for prologs. diff --git a/tests/languages/kumir/punctuation_feature.test b/tests/languages/kumir/punctuation_feature.test new file mode 100644 index 0000000000..66108873e9 --- /dev/null +++ b/tests/languages/kumir/punctuation_feature.test @@ -0,0 +1,25 @@ +( +) +, +: +:= +; +[ +] + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", ":="], + ["punctuation", ";"], + ["punctuation", "["], + ["punctuation", "]"] +] + +---------------------------------------------------- + +Checks for punctuation marks. diff --git a/tests/languages/kumir/string_feature.test b/tests/languages/kumir/string_feature.test new file mode 100644 index 0000000000..da1db61ec0 --- /dev/null +++ b/tests/languages/kumir/string_feature.test @@ -0,0 +1,35 @@ +"" +"#" +"'" +"256/273" +"foo 'bar' baz" +"|" +"алг" +'"' +'' +'256/273' +'foo "bar" baz' +'|' +'алг' + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"#\""], + ["string", "\"'\""], + ["string", "\"256/273\""], + ["string", "\"foo 'bar' baz\""], + ["string", "\"|\""], + ["string", "\"алг\""], + ["string", "'\"'"], + ["string", "''"], + ["string", "'256/273'"], + ["string", "'foo \"bar\" baz'"], + ["string", "'|'"], + ["string", "'алг'"] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/kumir/system-variable_feature.test b/tests/languages/kumir/system-variable_feature.test new file mode 100644 index 0000000000..ee3a545089 --- /dev/null +++ b/tests/languages/kumir/system-variable_feature.test @@ -0,0 +1,7 @@ +знач + +---------------------------------------------------- + +[ + ["system-variable", "знач"] +] diff --git a/tests/languages/kumir/type_feature.test b/tests/languages/kumir/type_feature.test new file mode 100644 index 0000000000..02ad78ee0f --- /dev/null +++ b/tests/languages/kumir/type_feature.test @@ -0,0 +1,29 @@ +вещ +цел +цел таб +цел таб +целтаб + +компл +сканкод +файл +цвет + +---------------------------------------------------- + +[ + ["type", "вещ"], + ["type", "цел"], + ["type", "цел таб"], + ["type", "цел таб"], + ["type", "целтаб"], + + ["type", "компл"], + ["type", "сканкод"], + ["type", "файл"], + ["type", "цвет"] +] + +---------------------------------------------------- + +Checks for data type names. diff --git a/tests/languages/kusto/boolean_feature.test b/tests/languages/kusto/boolean_feature.test new file mode 100644 index 0000000000..7df12bca4a --- /dev/null +++ b/tests/languages/kusto/boolean_feature.test @@ -0,0 +1,24 @@ +true bool(true) +false bool(false) +bool(null) + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["class-name", "bool"], + ["punctuation", "("], + ["boolean", "true"], + ["punctuation", ")"], + + ["boolean", "false"], + ["class-name", "bool"], + ["punctuation", "("], + ["boolean", "false"], + ["punctuation", ")"], + + ["class-name", "bool"], + ["punctuation", "("], + ["boolean", "null"], + ["punctuation", ")"] +] diff --git a/tests/languages/kusto/class-name_feature.test b/tests/languages/kusto/class-name_feature.test new file mode 100644 index 0000000000..572b56e6ec --- /dev/null +++ b/tests/languages/kusto/class-name_feature.test @@ -0,0 +1,25 @@ +bool +datetime +decimal +dynamic +guid +int +long +real +string +timespan + +---------------------------------------------------- + +[ + ["class-name", "bool"], + ["class-name", "datetime"], + ["class-name", "decimal"], + ["class-name", "dynamic"], + ["class-name", "guid"], + ["class-name", "int"], + ["class-name", "long"], + ["class-name", "real"], + ["class-name", "string"], + ["class-name", "timespan"] +] diff --git a/tests/languages/kusto/command_feature.test b/tests/languages/kusto/command_feature.test new file mode 100644 index 0000000000..947976c0af --- /dev/null +++ b/tests/languages/kusto/command_feature.test @@ -0,0 +1,13 @@ +.show tables +| count + +.set foo=234 + +---------------------------------------------------- + +[ + ["command", ".show"], ["keyword", "tables"], + ["operator", "|"], ["verb", "count"], + + ["command", ".set"], " foo", ["operator", "="], ["number", "234"] +] diff --git a/tests/languages/kusto/comment_feature.test b/tests/languages/kusto/comment_feature.test new file mode 100644 index 0000000000..e2a62cb063 --- /dev/null +++ b/tests/languages/kusto/comment_feature.test @@ -0,0 +1,7 @@ +// comment + +---------------------------------------------------- + +[ + ["comment", "// comment"] +] diff --git a/tests/languages/kusto/datetime_feature.test b/tests/languages/kusto/datetime_feature.test new file mode 100644 index 0000000000..82d9397991 --- /dev/null +++ b/tests/languages/kusto/datetime_feature.test @@ -0,0 +1,61 @@ +// ISO 8601 +2014-05-25T08:20:03.123456Z +2014-05-25T08:20:03.123456 +2014-05-25T08:20 +2014-11-08 15:55:55.123456Z +2014-11-08 15:55:55 +2014-11-08 15:55 +2014-11-08 + +// RFC 822 +Sat, 8 Nov 14 15:05:02 GMT +Sat, 8 Nov 14 15:05:02 +Sat, 8 Nov 14 15:05 +Sat, 8 Nov 14 15:05 GMT +8 Nov 14 15:05:02 GMT +8 Nov 14 15:05:02 +8 Nov 14 15:05 +8 Nov 14 15:05 GMT + +// RFC 850 +Saturday, 08-Nov-14 15:05:02 GMT +Saturday, 08-Nov-14 15:05:02 +Saturday, 08-Nov-14 15:05 GMT +Saturday, 08-Nov-14 15:05 +08-Nov-14 15:05:02 GMT +08-Nov-14 15:05:02 +08-Nov-14 15:05 GMT +08-Nov-14 15:05 + +---------------------------------------------------- + +[ + ["comment", "// ISO 8601"], + ["datetime", "2014-05-25T08:20:03.123456Z"], + ["datetime", "2014-05-25T08:20:03.123456"], + ["datetime", "2014-05-25T08:20"], + ["datetime", "2014-11-08 15:55:55.123456Z"], + ["datetime", "2014-11-08 15:55:55"], + ["datetime", "2014-11-08 15:55"], + ["datetime", "2014-11-08"], + + ["comment", "// RFC 822"], + ["datetime", "Sat, 8 Nov 14 15:05:02 GMT"], + ["datetime", "Sat, 8 Nov 14 15:05:02"], + ["datetime", "Sat, 8 Nov 14 15:05"], + ["datetime", "Sat, 8 Nov 14 15:05 GMT"], + ["datetime", "8 Nov 14 15:05:02 GMT"], + ["datetime", "8 Nov 14 15:05:02"], + ["datetime", "8 Nov 14 15:05"], + ["datetime", "8 Nov 14 15:05 GMT"], + + ["comment", "// RFC 850"], + ["datetime", "Saturday, 08-Nov-14 15:05:02 GMT"], + ["datetime", "Saturday, 08-Nov-14 15:05:02"], + ["datetime", "Saturday, 08-Nov-14 15:05 GMT"], + ["datetime", "Saturday, 08-Nov-14 15:05"], + ["datetime", "08-Nov-14 15:05:02 GMT"], + ["datetime", "08-Nov-14 15:05:02"], + ["datetime", "08-Nov-14 15:05 GMT"], + ["datetime", "08-Nov-14 15:05"] +] diff --git a/tests/languages/kusto/function_feature.test b/tests/languages/kusto/function_feature.test new file mode 100644 index 0000000000..bc928df744 --- /dev/null +++ b/tests/languages/kusto/function_feature.test @@ -0,0 +1,9 @@ +min() + +---------------------------------------------------- + +[ + ["function", "min"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/kusto/keyword_feature.test b/tests/languages/kusto/keyword_feature.test new file mode 100644 index 0000000000..d59e4691d5 --- /dev/null +++ b/tests/languages/kusto/keyword_feature.test @@ -0,0 +1,145 @@ +access +alias +and +anti +as +asc +auto +between +by +contains +contains_cs +database +declare +desc +endswith +endswith_cs +external +from +fullouter +has +has_all +has_cs +hasperfix +hasperfix_cs +hassuffix +hassuffix_cs +in +ingestion +inline +inner +innerunique +into +left +leftanti +leftantisemi +leftinner +leftouter +leftsemi +let +like +local +matches regex +not +nulls first +nulls last +of +on +or +pattern +print +query_parameters +range +restrict +right +rightanti +rightantisemi +rightinner +rightouter +rightsemi +schema +set +startswith +startswith_cs +step +table +tables +to +view +where +with + +---------------------------------------------------- + +[ + ["keyword", "access"], + ["keyword", "alias"], + ["keyword", "and"], + ["keyword", "anti"], + ["keyword", "as"], + ["keyword", "asc"], + ["keyword", "auto"], + ["keyword", "between"], + ["keyword", "by"], + ["keyword", "contains"], + ["keyword", "contains_cs"], + ["keyword", "database"], + ["keyword", "declare"], + ["keyword", "desc"], + ["keyword", "endswith"], + ["keyword", "endswith_cs"], + ["keyword", "external"], + ["keyword", "from"], + ["keyword", "fullouter"], + ["keyword", "has"], + ["keyword", "has_all"], + ["keyword", "has_cs"], + ["keyword", "hasperfix"], + ["keyword", "hasperfix_cs"], + ["keyword", "hassuffix"], + ["keyword", "hassuffix_cs"], + ["keyword", "in"], + ["keyword", "ingestion"], + ["keyword", "inline"], + ["keyword", "inner"], + ["keyword", "innerunique"], + ["keyword", "into"], + ["keyword", "left"], + ["keyword", "leftanti"], + ["keyword", "leftantisemi"], + ["keyword", "leftinner"], + ["keyword", "leftouter"], + ["keyword", "leftsemi"], + ["keyword", "let"], + ["keyword", "like"], + ["keyword", "local"], + ["keyword", "matches regex"], + ["keyword", "not"], + ["keyword", "nulls first"], + ["keyword", "nulls last"], + ["keyword", "of"], + ["keyword", "on"], + ["keyword", "or"], + ["keyword", "pattern"], + ["keyword", "print"], + ["keyword", "query_parameters"], + ["keyword", "range"], + ["keyword", "restrict"], + ["keyword", "right"], + ["keyword", "rightanti"], + ["keyword", "rightantisemi"], + ["keyword", "rightinner"], + ["keyword", "rightouter"], + ["keyword", "rightsemi"], + ["keyword", "schema"], + ["keyword", "set"], + ["keyword", "startswith"], + ["keyword", "startswith_cs"], + ["keyword", "step"], + ["keyword", "table"], + ["keyword", "tables"], + ["keyword", "to"], + ["keyword", "view"], + ["keyword", "where"], + ["keyword", "with"] +] diff --git a/tests/languages/kusto/number_feature.test b/tests/languages/kusto/number_feature.test new file mode 100644 index 0000000000..511236bb26 --- /dev/null +++ b/tests/languages/kusto/number_feature.test @@ -0,0 +1,41 @@ +0 +123 +123.456 +123.456e-7 + +0xfF + ++inf +-inf + +// time +12d +12h +12m +12min +12s +12sec +12ms + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"], + ["number", "123.456"], + ["number", "123.456e-7"], + + ["number", "0xfF"], + + ["number", "+inf"], + ["number", "-inf"], + + ["comment", "// time"], + ["number", "12d"], + ["number", "12h"], + ["number", "12m"], + ["number", "12min"], + ["number", "12s"], + ["number", "12sec"], + ["number", "12ms"] +] diff --git a/tests/languages/kusto/operator_feature.test b/tests/languages/kusto/operator_feature.test new file mode 100644 index 0000000000..00fe1c1867 --- /dev/null +++ b/tests/languages/kusto/operator_feature.test @@ -0,0 +1,33 @@ ++ - * / % +== != < <= > >= +=~ !~ += ! + +=> +.. + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "-"], + ["operator", "*"], + ["operator", "/"], + ["operator", "%"], + + ["operator", "=="], + ["operator", "!="], + ["operator", "<"], + ["operator", "<="], + ["operator", ">"], + ["operator", ">="], + + ["operator", "=~"], + ["operator", "!~"], + + ["operator", "="], + ["operator", "!"], + + ["operator", "=>"], + ["operator", ".."] +] diff --git a/tests/languages/kusto/punctuation_feature.test b/tests/languages/kusto/punctuation_feature.test new file mode 100644 index 0000000000..1713f5143c --- /dev/null +++ b/tests/languages/kusto/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) [ ] { } +, ; . : + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + ["punctuation", ":"] +] diff --git a/tests/languages/kusto/string_feature.test b/tests/languages/kusto/string_feature.test new file mode 100644 index 0000000000..1b957eb532 --- /dev/null +++ b/tests/languages/kusto/string_feature.test @@ -0,0 +1,82 @@ +"" +'' +@"" +@'' +"foo\"" +'bar\'' +@"\" +@'\' + +``` +multiline +``` + +// Obfuscated string literals +h'hello' +h@'world' +h"hello" + +// string concatenation + +print strlen("Hello"', '@"world!"); // Nothing between them + +print strlen("Hello" ', ' @"world!"); // Separated by whitespace only + +print strlen("Hello" + // Comment + ', '@"world!"); // Separated by whitespace and a comment + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "''"], + ["string", "@\"\""], + ["string", "@''"], + ["string", "\"foo\\\"\""], + ["string", "'bar\\''"], + ["string", "@\"\\\""], + ["string", "@'\\'"], + + ["string", "```\r\nmultiline\r\n```"], + + ["comment", "// Obfuscated string literals"], + ["string", "h'hello'"], + ["string", "h@'world'"], + ["string", "h\"hello\""], + + ["comment", "// string concatenation"], + + ["keyword", "print"], + ["function", "strlen"], + ["punctuation", "("], + ["string", "\"Hello\""], + ["string", "', '"], + ["string", "@\"world!\""], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// Nothing between them"], + + ["keyword", "print"], + ["function", "strlen"], + ["punctuation", "("], + ["string", "\"Hello\""], + ["string", "', '"], + ["string", "@\"world!\""], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// Separated by whitespace only"], + + ["keyword", "print"], + ["function", "strlen"], + ["punctuation", "("], + ["string", "\"Hello\""], + + ["comment", "// Comment"], + + ["string", "', '"], + ["string", "@\"world!\""], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// Separated by whitespace and a comment"] +] diff --git a/tests/languages/kusto/verb_feature.test b/tests/languages/kusto/verb_feature.test new file mode 100644 index 0000000000..f351551b99 --- /dev/null +++ b/tests/languages/kusto/verb_feature.test @@ -0,0 +1,39 @@ +Logs +| where Timestamp > ago(1d) +| join +( + Events + | where continent == 'Europe' +) on RequestId + +---------------------------------------------------- + +[ + "Logs\r\n", + + ["operator", "|"], + ["verb", "where"], + " Timestamp ", + ["operator", ">"], + ["function", "ago"], + ["punctuation", "("], + ["number", "1d"], + ["punctuation", ")"], + + ["operator", "|"], + ["verb", "join"], + + ["punctuation", "("], + + "\r\n Events\r\n ", + + ["operator", "|"], + ["verb", "where"], + " continent ", + ["operator", "=="], + ["string", "'Europe'"], + + ["punctuation", ")"], + ["keyword", "on"], + " RequestId" +] diff --git a/tests/languages/latte/delimiter_feature.test b/tests/languages/latte/delimiter_feature.test index 23d0bac34b..6c7ddc5e64 100644 --- a/tests/languages/latte/delimiter_feature.test +++ b/tests/languages/latte/delimiter_feature.test @@ -14,17 +14,64 @@ line} ---------------------------------------------------- [ - ["latte", [["ld", [["punctuation", "{"], ["tag", "aa"]]], ["rd", [["punctuation", "}"]]]]], - ["latte", [["ld", [["punctuation", "{/"], ["tag", "aa"]]], ["rd", [["punctuation", "}"]]]]], - ["latte", [["ld", [["punctuation", "{"]]], ["php", [["operator", "/"]]], ["rd", [["punctuation", "}"]]]]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "aa"], + ["delimiter", "}"] + ]], + + ["latte", [ + ["delimiter", "{/"], + ["latte-tag", "aa"], + ["delimiter", "}"] + ]], + + ["latte", [ + ["delimiter", "{/"], + ["delimiter", "}"] + ]], + "\r\n{", - ["latte", [["ld", [["punctuation", "{"], ["tag", "aa"]]], ["rd", [["punctuation", "}"]]]]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "aa"], + ["delimiter", "}"] + ]], "}\r\n", - ["latte", [["ld", [["punctuation", "{"]]], ["php", [["number", "10"]]], ["rd", [["punctuation", "}"]]]]], - ["latte", [["ld", [["punctuation", "{"], ["tag", "="]]], ["php", [["number", "10"]]], ["rd", [["punctuation", "}"]]]]], - ["latte", [["ld", [["punctuation", "{"]]], ["php", [["function", "test"], ["punctuation", "("], ["punctuation", ")"]]], ["rd", [["punctuation", "}"]]]]], + + ["latte", [ + ["delimiter", "{"], + ["php", [ + ["number", "10"] + ]], + ["delimiter", "}"] + ]], + + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "="], + ["php", [ + ["number", "10"] + ]], + ["delimiter", "}"] + ]], + + ["latte", [ + ["delimiter", "{"], + ["php", [ + ["function", ["test"]], + ["punctuation", "("], + ["punctuation", ")"] + ]], + ["delimiter", "}"] + ]], + "\r\n{'no'}\r\n{\"no\"}\r\n{ no }\r\n", - ["latte", [["ld", [["punctuation", "{"], ["tag", "multi"]]], ["php", ["line"]], ["rd", [["punctuation", "}"]]]]] + + ["latte", [ + ["delimiter", "{"], ["latte-tag", "multi"], + ["php", ["line"]], ["delimiter", "}"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/latte/html_feature.test b/tests/languages/latte/html_feature.test index 3047eb0a27..02296ff518 100644 --- a/tests/languages/latte/html_feature.test +++ b/tests/languages/latte/html_feature.test @@ -12,42 +12,179 @@ ---------------------------------------------------- [ - ["tag", [["tag", [["punctuation", "<"], "a"]], - ["attr-name", ["href"]], ["attr-value", [["punctuation", "="], ["punctuation", "\""], - ["latte", [["ld", [["punctuation", "{"], ["tag", "link"]]], - ["php", ["Post", ["punctuation", ":"], "show ", ["variable", "$post"], ["operator", "-"], ["operator", ">"], ["property", "id"]]], - ["rd", [["punctuation", "}"]]]]], - ["punctuation", "\""]]], ["punctuation", ">"]]], - ["latte", [["ld", [["punctuation", "{"]]], ["php", [["variable", "$post"], ["operator", "-"], ["operator", ">"], ["property", "title"]]], ["rd", [["punctuation", "}"]]]]], - ["tag", [["tag", [["punctuation", ""]]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "a" + ]], + ["attr-name", ["href"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "link"], + ["php", [ + "Post", + ["punctuation", ":"], + ["class-name", "show"], + ["variable", "$post"], + ["operator", "->"], + ["property", "id"] + ]], + ["delimiter", "}"] + ]], + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + ["latte", [ + ["delimiter", "{"], + ["php", [ + ["variable", "$post"], + ["operator", "->"], + ["property", "title"] + ]], + ["delimiter", "}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], - ["tag", [["tag", [["punctuation", "<"], "a"]], - ["attr-name", - [["latte", [["ld", [["punctuation", "{"], ["tag", "if"]]], ["php", [["variable", "$post"], ["operator", "-"], ["operator", ">"], ["property", "id"]]], ["rd", [["punctuation", "}"]]]]], "title"] - ], - ["attr-value", [["punctuation", "="], ["punctuation", "\""], "ahoj", ["punctuation", "\""]]], - ["attr-name", [["latte", [["ld", [["punctuation", "{/"], ["tag", "if"]]], ["rd", [["punctuation", "}"]]]]]]], - ["punctuation", ">"]]], - ["latte", [["ld", [["punctuation", "{"]]], ["php", [["variable", "$post"], ["operator", "-"], ["operator", ">"], ["property", "title"]]], ["rd", [["punctuation", "}"]]]]], - ["tag", [["tag", [["punctuation", ""]]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "a" + ]], + ["attr-name", [ + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "if"], + ["php", [ + ["variable", "$post"], + ["operator", "->"], + ["property", "id"] + ]], + ["delimiter", "}"] + ]], + "title" + ]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "ahoj", + ["punctuation", "\""] + ]], + ["attr-name", [ + ["latte", [ + ["delimiter", "{/"], + ["latte-tag", "if"], + ["delimiter", "}"] + ]] + ]], + ["punctuation", ">"] + ]], + ["latte", [ + ["delimiter", "{"], + ["php", [ + ["variable", "$post"], + ["operator", "->"], + ["property", "title"] + ]], + ["delimiter", "}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], - ["latte", [["ld", [["punctuation", "{"], ["tag", "tag"]]], ["php", [["variable", "$a"], ["operator", "="], ["boolean", "true"], ["operator", "?"], ["number", "10"], ["operator", "*"], ["number", "5"]]], ["rd", [["punctuation", "}"]]]]], - - ["tag", [["tag", [["punctuation", "<"], "div"]], - ["n-attr", [["attr-name", "n:attr"], ["attr-value", [["punctuation", "="], ["punctuation", "\""], ["php", [["variable", "$a"], ["operator", "="], ["boolean", "true"], ["operator", "?"], ["number", "10"], ["operator", "*"], ["number", "5"]]], ["punctuation", "\""]]]]], - ["punctuation", ">"]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["single-quoted-string", "''"]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["double-quoted-string", ["\"\""]]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["double-quoted-string", ["\"ba\\\"r\""]]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["single-quoted-string", "'ba\\'z'"]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["comment", "/* \" */"]]], ["rd", [["punctuation", "}"]]]]] + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "tag"], + ["php", [ + ["variable", "$a"], + ["operator", "="], + ["constant", "true"], + ["operator", "?"], + ["number", "10"], + ["operator", "*"], + ["number", "5"] + ]], + ["delimiter", "}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["n-attr", [ + ["attr-name", "n:attr"], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["php", [ + ["variable", "$a"], + ["operator", "="], + ["constant", "true"], + ["operator", "?"], + ["number", "10"], + ["operator", "*"], + ["number", "5"] + ]], + ["punctuation", "\""] + ]] + ]], + ["punctuation", ">"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", "''"] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", ["\"\""]] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", ["\"ba\\\"r\""]] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", "'ba\\'z'"] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["comment", "/* \" */"] + ]], + ["delimiter", "}"] + ]] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/latte/n-attr_feature.test b/tests/languages/latte/n-attr_feature.test index 678f5a4e87..3effa4630c 100644 --- a/tests/languages/latte/n-attr_feature.test +++ b/tests/languages/latte/n-attr_feature.test @@ -9,13 +9,13 @@ [ ["tag", [["tag", [["punctuation", "<"], "a"]], ["n-attr", [["attr-name", "n:href"], - ["attr-value", [["punctuation", "="], ["punctuation", "\""], ["php", ["Post", ["punctuation", ":"], "show ", ["variable", "$post"], ["operator", "-"], ["operator", ">"], ["property", "id"]]], ["punctuation", "\""]]]]], + ["attr-value", [["punctuation", "="], ["punctuation", "\""], ["php", ["Post", ["punctuation", ":"], ["class-name", "show"], ["variable", "$post"], ["operator", "->"], ["property", "id"]]], ["punctuation", "\""]]]]], ["punctuation", ">"]]], "link", ["tag", [["tag", [["punctuation", ""]]], ["tag", [["tag", [["punctuation", "<"], "a"]], ["n-attr", [["attr-name", "n:href"], - ["attr-value", [["punctuation", "="], ["punctuation", "\""], ["php", ["Post", ["punctuation", ":"], "show ", ["variable", "$post"], ["operator", "-"], ["operator", ">"], ["property", "id"]]], ["punctuation", "\""]]]]], + ["attr-value", [["punctuation", "="], ["punctuation", "\""], ["php", ["Post", ["punctuation", ":"], ["class-name", "show"], ["variable", "$post"], ["operator", "->"], ["property", "id"]]], ["punctuation", "\""]]]]], ["punctuation", ">"]]], "link", ["tag", [["tag", [["punctuation", ""]]], diff --git a/tests/languages/latte/php_feature.test b/tests/languages/latte/php_feature.test index cc916a469d..7455f66db4 100644 --- a/tests/languages/latte/php_feature.test +++ b/tests/languages/latte/php_feature.test @@ -10,25 +10,94 @@ ---------------------------------------------------- [ - ["latte", [["ld", [["punctuation", "{"], ["tag", "tag"]]], ["php", [["variable", "$a"], ["operator", "="], ["boolean", "true"], ["operator", "?"], ["number", "10"], ["operator", "*"], ["number", "5"]]], ["rd", [["punctuation", "}"]]]]], - - ["tag", [["tag", [["punctuation", "<"], "div"]], ["n-attr", [["attr-name", "n:attr"], - ["attr-value", [["punctuation", "="], ["punctuation", "\""], ["php", [["variable", "$a"], ["operator", "="], ["boolean", "true"], ["operator", "?"], ["number", "10"], ["operator", "*"], ["number", "5"]]], ["punctuation", "\""]]]]], - ["punctuation", ">"]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["single-quoted-string", "''"]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["double-quoted-string", ["\"\""]]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["double-quoted-string", ["\"ba\\\"r\""]]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["single-quoted-string", "'ba\\'z'"]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["comment", "/* \" */"]]], ["rd", [["punctuation", "}"]]]]], - - ["latte", [["ld", [["punctuation", "{"], ["tag", "php"]]], ["php", [["comment", "/* } */"]]], ["rd", [["punctuation", "}"]]]]] + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "tag"], + ["php", [ + ["variable", "$a"], + ["operator", "="], + ["constant", "true"], + ["operator", "?"], + ["number", "10"], + ["operator", "*"], + ["number", "5"] + ]], + ["delimiter", "}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["n-attr", [ + ["attr-name", "n:attr"], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["php", [ + ["variable", "$a"], + ["operator", "="], + ["constant", "true"], + ["operator", "?"], + ["number", "10"], + ["operator", "*"], + ["number", "5"] + ]], + ["punctuation", "\""] + ]] + ]], + ["punctuation", ">"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", "''"] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", ["\"\""]] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", ["\"ba\\\"r\""]] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["string", "'ba\\'z'"] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["comment", "/* \" */"] + ]], + ["delimiter", "}"] + ]], + ["latte", [ + ["delimiter", "{"], + ["latte-tag", "php"], + ["php", [ + ["comment", "/* } */"] + ]], + ["delimiter", "}"] + ]] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/less+haml/less_inclusion.test b/tests/languages/less+haml/less_inclusion.test index fffe2ca74e..ae8db1a307 100644 --- a/tests/languages/less+haml/less_inclusion.test +++ b/tests/languages/less+haml/less_inclusion.test @@ -10,23 +10,27 @@ [ ["filter-less", [ ["filter-name", ":less"], - ["selector", [".foo"]], - ["punctuation", "{"], - ["mixin-usage", ".bar"], - ["punctuation", ";"], - ["punctuation", "}"] + ["text", [ + ["selector", [".foo"]], + ["punctuation", "{"], + ["mixin-usage", ".bar"], + ["punctuation", ";"], + ["punctuation", "}"] + ]] ]], ["punctuation", "~"], ["filter-less", [ ["filter-name", ":less"], - ["selector", [".foo"]], - ["punctuation", "{"], - ["mixin-usage", ".bar"], - ["punctuation", ";"], - ["punctuation", "}"] + ["text", [ + ["selector", [".foo"]], + ["punctuation", "{"], + ["mixin-usage", ".bar"], + ["punctuation", ";"], + ["punctuation", "}"] + ]] ]] ] ---------------------------------------------------- -Checks for Less filter in Haml. The tilde serves only as a separator. \ No newline at end of file +Checks for Less filter in Haml. The tilde serves only as a separator. diff --git a/tests/languages/less+pug/less_inclusion.test b/tests/languages/less+pug/less_inclusion.test index 1cc8b350c8..ccd5f6a2d0 100644 --- a/tests/languages/less+pug/less_inclusion.test +++ b/tests/languages/less+pug/less_inclusion.test @@ -6,15 +6,17 @@ [ ["filter-less", [ ["filter-name", ":less"], - ["variable", [ - "@foo", - ["punctuation", ":"] - ]], - " #123", - ["punctuation", ";"] + ["text", [ + ["variable", [ + "@foo", + ["punctuation", ":"] + ]], + " #123", + ["punctuation", ";"] + ]] ]] ] ---------------------------------------------------- -Checks for less filter in Jade. \ No newline at end of file +Checks for less filter in pug. diff --git a/tests/languages/less/variable_feature.test b/tests/languages/less/variable_feature.test new file mode 100644 index 0000000000..eb9152db0b --- /dev/null +++ b/tests/languages/less/variable_feature.test @@ -0,0 +1,9 @@ +@foo +@@foo + +---------------------------------------------------- + +[ + ["variable", "@foo"], + ["variable", "@@foo"] +] diff --git a/tests/languages/lilypond/class-name_feature.test b/tests/languages/lilypond/class-name_feature.test new file mode 100644 index 0000000000..6614ab30f5 --- /dev/null +++ b/tests/languages/lilypond/class-name_feature.test @@ -0,0 +1,15 @@ +\new Staff \hornNotes + +---------------------------------------------------- + +[ + ["keyword", [ + ["punctuation", "\\"], + "new" + ]], + ["class-name", "Staff"], + ["keyword", [ + ["punctuation", "\\"], + "hornNotes" + ]] +] diff --git a/tests/languages/lilypond/comment_feature.test b/tests/languages/lilypond/comment_feature.test index 3bfd8c6c47..c2bdd98b52 100644 --- a/tests/languages/lilypond/comment_feature.test +++ b/tests/languages/lilypond/comment_feature.test @@ -8,7 +8,8 @@ multiple lines [ ["comment", "% single line"], - ["comment", "%{\nmultiple lines\n%}"] + + ["comment", "%{\r\nmultiple lines\r\n%}"] ] ---------------------------------------------------- diff --git a/tests/languages/lilypond/keyword_feature.test b/tests/languages/lilypond/keyword_feature.test index fa4dcb1168..3a075616ab 100644 --- a/tests/languages/lilypond/keyword_feature.test +++ b/tests/languages/lilypond/keyword_feature.test @@ -14,16 +14,19 @@ h\fermata ["punctuation", "\\"], "set" ]], + ["keyword", [ ["punctuation", "\\"], "center-column" ]], + ["number", "5"], ["keyword", [ ["punctuation", "\\"], "mm" ]], - "\nh", + + "\r\nh", ["keyword", [ ["punctuation", "\\"], "fermata" diff --git a/tests/languages/lilypond/string_feature.test b/tests/languages/lilypond/string_feature.test index e8b3ae62b4..f9b6764720 100644 --- a/tests/languages/lilypond/string_feature.test +++ b/tests/languages/lilypond/string_feature.test @@ -6,7 +6,7 @@ bar\"" [ ["string", "\"foo\""], - ["string", "\"foo\nbar\\\"\""] + ["string", "\"foo\r\nbar\\\"\""] ] ---------------------------------------------------- diff --git a/tests/languages/liquid/boolean_feature.test b/tests/languages/liquid/boolean_feature.test new file mode 100644 index 0000000000..3a60cc8cb3 --- /dev/null +++ b/tests/languages/liquid/boolean_feature.test @@ -0,0 +1,26 @@ +{% if true and false and false or true %} + +{% nil %} + +---------------------------------------------------- + +[ + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "if"], + ["boolean", "true"], + ["operator", "and"], + ["boolean", "false"], + ["operator", "and"], + ["boolean", "false"], + ["operator", "or"], + ["boolean", "true"], + ["delimiter", "%}"] + ]], + + ["liquid", [ + ["delimiter", "{%"], + ["boolean", "nil"], + ["delimiter", "%}"] + ]] +] diff --git a/tests/languages/liquid/comment_feature.test b/tests/languages/liquid/comment_feature.test new file mode 100644 index 0000000000..2accf83002 --- /dev/null +++ b/tests/languages/liquid/comment_feature.test @@ -0,0 +1,61 @@ +My name is Wilson Abercrombie{% comment %}, esquire{% endcomment %}. + +{% assign verb = "turned" %} +{% comment %} +{% assign verb = "converted" %} +{% endcomment %} +Anything you put between {% comment %} and {% endcomment %} tags +is {{ verb }} into a comment. + +---------------------------------------------------- + +[ + "My name is Wilson Abercrombie", + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "comment"], + ["delimiter", "%}"], + ["comment", ", esquire"], + ["delimiter", "{%"], + ["keyword", "endcomment"], + ["delimiter", "%}"] + ]], + ".\r\n\r\n", + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " verb ", + ["operator", "="], + ["string", "\"turned\""], + ["delimiter", "%}"] + ]], + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "comment"], + ["delimiter", "%}"], + ["comment", "\r\n{% assign verb = \"converted\" %}\r\n"], + ["delimiter", "{%"], + ["keyword", "endcomment"], + ["delimiter", "%}"] + ]], + + "\r\nAnything you put between ", + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "comment"], + ["delimiter", "%}"], + ["comment", " and "], + ["delimiter", "{%"], + ["keyword", "endcomment"], + ["delimiter", "%}"] + ]], + " tags\r\nis ", + ["liquid", [ + ["delimiter", "{{"], + " verb ", + ["delimiter", "}}"] + ]], + " into a comment." +] diff --git a/tests/languages/liquid/empty_feature.test b/tests/languages/liquid/empty_feature.test new file mode 100644 index 0000000000..bfc7fefaa3 --- /dev/null +++ b/tests/languages/liquid/empty_feature.test @@ -0,0 +1,78 @@ +{% unless pages == empty %} + +

{{ pages.frontpage.not_empty_title }}

+
{{ pages.frontpage.content }}
+{% endunless %} + +---------------------------------------------------- + +[ + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "unless"], + " pages ", + ["operator", "=="], + ["empty", "empty"], + ["delimiter", "%}"] + ]], + + ["comment", ""], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "h1" + ]], + ["punctuation", ">"] + ]], + ["liquid", [ + ["delimiter", "{{"], + " pages", + ["punctuation", "."], + "frontpage", + ["punctuation", "."], + "not_empty_title ", + ["delimiter", "}}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["liquid", [ + ["delimiter", "{{"], + " pages", + ["punctuation", "."], + "frontpage", + ["punctuation", "."], + "content ", + ["delimiter", "}}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "endunless"], + ["delimiter", "%}"] + ]] +] + +---------------------------------------------------- + +Test for the 'empty' keyword / special thing. diff --git a/tests/languages/liquid/function_feature.test b/tests/languages/liquid/function_feature.test index 4689ef6a49..4853addaba 100644 --- a/tests/languages/liquid/function_feature.test +++ b/tests/languages/liquid/function_feature.test @@ -1,39 +1,442 @@ -abs append at_least at_most -capitalize ceil cols compact concat cycle -date decrement default divided_by downcase -escape escape_once -first floor -include increment -join -last lstrip -map minus modulo -newline_to_br -paginate plus prepend -remove remove_first replace replace_first reverse round rstrip -size slice sort sort_natural split strip strip_html strip_newlines -times truncate truncatewords -uniq upcase url_decode url_encode +{{ product.tags | first }} +{% if product.tags.first == "sale" %} +{{ product.tags | last }} +{% if product.tags.last == "sale"%} + +{% assign vegetables = "broccoli, carrots, lettuce, tomatoes" | split: ", " %} +{% assign plants = fruits | concat: vegetables %} +{{ plants | join: ", " }} +{{ my_array | reverse | join: ", " }} +{% assign products = collection.products | sort: 'price' %} +{% assign kitchen_products = collection.products | where: "type", "kitchen" %} + +{{ 'rgb(122, 181, 92)' | color_to_hex }} +{{ '#7ab55c' | color_modify: 'alpha', 0.85 }} + +{% assign bold_italic = settings.body_font | font_modify: 'weight', 'bold' | font_modify: 'style', 'italic' %} + +{{ 'smirking_gnome.gif' | asset_url | img_tag }} +{{ 'shop.js' | asset_url | script_tag }} +{{ article.published_at | time_tag: '%a, %b %d, %Y' }} + +{{ -17 | abs }} +{{ 4 | at_most: 3 }} +{{ product.price | divided_by: 10 }} +{{ product.price | times: 1.15 }} + +{{ product.featured_media | external_video_tag: class: "youtube_video" }} +{{ product.featured_media | img_url: 500x500 }} +{{ product.featured_media | media_tag: image_size: "1024x" }} + +{{ 'sales' | append: '.jpg' }} +{{ 'capitalize me' | capitalize }} + +{% assign my_secret_string = "ShopifyIsAwesome!" | hmac_sha256: "secret_key" %} +{{ "hello" | slice: 1, 3 }} + +{{ 'shop.css' | asset_url }} +{{ 'logo.png' | file_img_url: '1024x768' }} + +{{ article.published_at | date: "%a, %b %d, %y" }} +{{ settings.flag | default: true, allow_false: true }} +{{ product.variants.first.weight | weight_with_unit }} ---------------------------------------------------- [ - ["function", "abs"], ["function", "append"], ["function", "at_least"], ["function", "at_most"], - ["function", "capitalize"], ["function", "ceil"], ["function", "cols"], ["function", "compact"], ["function", "concat"], ["function", "cycle"], - ["function", "date"], ["function", "decrement"], ["function", "default"], ["function", "divided_by"], ["function", "downcase"], - ["function", "escape"], ["function", "escape_once"], - ["function", "first"], ["function", "floor"], - ["function", "include"], ["function", "increment"], - ["function", "join"], - ["function", "last"], ["function", "lstrip"], - ["function", "map"], ["function", "minus"], ["function", "modulo"], - ["function", "newline_to_br"], - ["function", "paginate"], ["function", "plus"], ["function", "prepend"], - ["function", "remove"], ["function", "remove_first"], ["function", "replace"], ["function", "replace_first"], ["function", "reverse"], ["function", "round"], ["function", "rstrip"], - ["function", "size"], ["function", "slice"], ["function", "sort"], ["function", "sort_natural"], ["function", "split"], ["function", "strip"], ["function", "strip_html"], ["function", "strip_newlines"], - ["function", "times"], ["function", "truncate"], ["function", "truncatewords"], - ["function", "uniq"], ["function", "upcase"], ["function", "url_decode"], ["function", "url_encode"] -] + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "tags ", + ["operator", "|"], + ["function", "first"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "if"], + ["object", "product"], + ["punctuation", "."], + "tags", + ["punctuation", "."], + ["function", "first"], + ["operator", "=="], + ["string", "\"sale\""], + ["delimiter", "%}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "tags ", + ["operator", "|"], + ["function", "last"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "if"], + ["object", "product"], + ["punctuation", "."], + "tags", + ["punctuation", "."], + ["function", "last"], + ["operator", "=="], + ["string", "\"sale\""], + ["delimiter", "%}"] + ]], ----------------------------------------------------- + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " vegetables ", + ["operator", "="], + ["string", "\"broccoli, carrots, lettuce, tomatoes\""], + ["operator", "|"], + ["function", "split"], + ["operator", ":"], + ["string", "\", \""], + ["delimiter", "%}"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " plants ", + ["operator", "="], + " fruits ", + ["operator", "|"], + ["function", "concat"], + ["operator", ":"], + " vegetables ", + ["delimiter", "%}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + " plants ", + ["operator", "|"], + ["function", "join"], + ["operator", ":"], + ["string", "\", \""], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + " my_array ", + ["operator", "|"], + ["function", "reverse"], + ["operator", "|"], + ["function", "join"], + ["operator", ":"], + ["string", "\", \""], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " products ", + ["operator", "="], + ["object", "collection"], + ["punctuation", "."], + "products ", + ["operator", "|"], + ["function", "sort"], + ["operator", ":"], + ["string", "'price'"], + ["delimiter", "%}"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " kitchen_products ", + ["operator", "="], + ["object", "collection"], + ["punctuation", "."], + "products ", + ["operator", "|"], + ["function", "where"], + ["operator", ":"], + ["string", "\"type\""], + ["punctuation", ","], + ["string", "\"kitchen\""], + ["delimiter", "%}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["string", "'rgb(122, 181, 92)'"], + ["operator", "|"], + ["function", "color_to_hex"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["string", "'#7ab55c'"], + ["operator", "|"], + ["function", "color_modify"], + ["operator", ":"], + ["string", "'alpha'"], + ["punctuation", ","], + ["number", "0.85"], + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " bold_italic ", + ["operator", "="], + " settings", + ["punctuation", "."], + "body_font ", + ["operator", "|"], + ["function", "font_modify"], + ["operator", ":"], + ["string", "'weight'"], + ["punctuation", ","], + ["string", "'bold'"], + ["operator", "|"], + ["function", "font_modify"], + ["operator", ":"], + ["string", "'style'"], + ["punctuation", ","], + ["string", "'italic'"], + ["delimiter", "%}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["string", "'smirking_gnome.gif'"], + ["operator", "|"], + ["function", "asset_url"], + ["operator", "|"], + ["function", "img_tag"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["string", "'shop.js'"], + ["operator", "|"], + ["function", "asset_url"], + ["operator", "|"], + ["function", "script_tag"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "article"], + ["punctuation", "."], + "published_at ", + ["operator", "|"], + ["function", "time_tag"], + ["operator", ":"], + ["string", "'%a, %b %d, %Y'"], + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["operator", "-"], + ["number", "17"], + ["operator", "|"], + ["function", "abs"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["number", "4"], + ["operator", "|"], + ["function", "at_most"], + ["operator", ":"], + ["number", "3"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "price ", + ["operator", "|"], + ["function", "divided_by"], + ["operator", ":"], + ["number", "10"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "price ", + ["operator", "|"], + ["function", "times"], + ["operator", ":"], + ["number", "1.15"], + ["delimiter", "}}"] + ]], -Checks for functions. Also checks for unicode characters in identifiers. + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "featured_media ", + ["operator", "|"], + ["function", "external_video_tag"], + ["operator", ":"], + " class", + ["operator", ":"], + ["string", "\"youtube_video\""], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "featured_media ", + ["operator", "|"], + ["function", "img_url"], + ["operator", ":"], + " 500x500 ", + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "featured_media ", + ["operator", "|"], + ["function", "media_tag"], + ["operator", ":"], + " image_size", + ["operator", ":"], + ["string", "\"1024x\""], + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["string", "'sales'"], + ["operator", "|"], + ["function", "append"], + ["operator", ":"], + ["string", "'.jpg'"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["string", "'capitalize me'"], + ["operator", "|"], + ["function", "capitalize"], + ["delimiter", "}}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "img" + ]], + ["attr-name", ["src"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "https://www.gravatar.com/avatar/", + ["liquid", [ + ["delimiter", "{{"], + ["keyword", "comment"], + ["punctuation", "."], + "email ", + ["operator", "|"], + ["function", "remove"], + ["operator", ":"], + ["string", "' '"], + ["operator", "|"], + ["function", "strip_newlines"], + ["operator", "|"], + ["function", "downcase"], + ["operator", "|"], + ["function", "md5"], + ["delimiter", "}}"] + ]], + ["punctuation", "\""] + ]], + ["punctuation", "/>"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " my_secret_string ", + ["operator", "="], + ["string", "\"ShopifyIsAwesome!\""], + ["operator", "|"], + ["function", "hmac_sha256"], + ["operator", ":"], + ["string", "\"secret_key\""], + ["delimiter", "%}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["string", "\"hello\""], + ["operator", "|"], + ["function", "slice"], + ["operator", ":"], + ["number", "1"], + ["punctuation", ","], + ["number", "3"], + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["string", "'shop.css'"], + ["operator", "|"], + ["function", "asset_url"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["string", "'logo.png'"], + ["operator", "|"], + ["function", "file_img_url"], + ["operator", ":"], + ["string", "'1024x768'"], + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["object", "article"], + ["punctuation", "."], + "published_at ", + ["operator", "|"], + ["object", "date"], + ["operator", ":"], + ["string", "\"%a, %b %d, %y\""], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + " settings", + ["punctuation", "."], + "flag ", + ["operator", "|"], + ["function", "default"], + ["operator", ":"], + ["boolean", "true"], + ["punctuation", ","], + " allow_false", + ["operator", ":"], + ["boolean", "true"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["punctuation", "."], + "variants", + ["punctuation", "."], + ["function", "first"], + ["punctuation", "."], + "weight ", + ["operator", "|"], + ["function", "weight_with_unit"], + ["delimiter", "}}"] + ]] +] diff --git a/tests/languages/liquid/keyword_feature.test b/tests/languages/liquid/keyword_feature.test index 84ffabd96a..65ab3d952c 100644 --- a/tests/languages/liquid/keyword_feature.test +++ b/tests/languages/liquid/keyword_feature.test @@ -1,29 +1,99 @@ -comment endcomment -if else elsif endif -unless endunless -for endfor in break -case endcase when -assign continue -limit offset range reversed -raw endraw -capture endcapture -tablerow endtablerow +{% + +as +assign +break +capture +case +comment +continue +cycle +decrement +echo +else +elsif +endcapture +endcase +endcomment +endfor +endform +endif +endpaginate +endraw +endtablerow +endunless +for +form +if +in +include +increment +limit +liquid +offset +paginate +range +raw +render +reversed +tablerow +unless +when +with + +%} ---------------------------------------------------- [ - ["keyword", "comment"], ["keyword", "endcomment"], - ["keyword", "if"], ["keyword", "else"], ["keyword", "elsif"], ["keyword", "endif"], - ["keyword", "unless"], ["keyword", "endunless"], - ["keyword", "for"], ["keyword", "endfor"], ["keyword", "in"], ["keyword", "break"], - ["keyword", "case"], ["keyword", "endcase"], ["keyword", "when"], - ["keyword", "assign"], ["keyword", "continue"], - ["keyword", "limit"], ["keyword", "offset"], ["keyword", "range"], ["keyword", "reversed"], - ["keyword", "raw"], ["keyword", "endraw"], - ["keyword", "capture"], ["keyword", "endcapture"], - ["keyword", "tablerow"], ["keyword", "endtablerow"] + ["liquid", [ + ["delimiter", "{%"], + + ["keyword", "as"], + ["keyword", "assign"], + ["keyword", "break"], + ["keyword", "capture"], + ["keyword", "case"], + ["keyword", "comment"], + ["keyword", "continue"], + ["keyword", "cycle"], + ["keyword", "decrement"], + ["keyword", "echo"], + ["keyword", "else"], + ["keyword", "elsif"], + ["keyword", "endcapture"], + ["keyword", "endcase"], + ["keyword", "endcomment"], + ["keyword", "endfor"], + ["keyword", "endform"], + ["keyword", "endif"], + ["keyword", "endpaginate"], + ["keyword", "endraw"], + ["keyword", "endtablerow"], + ["keyword", "endunless"], + ["keyword", "for"], + ["keyword", "form"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "include"], + ["keyword", "increment"], + ["keyword", "limit"], + ["keyword", "liquid"], + ["keyword", "offset"], + ["keyword", "paginate"], + ["keyword", "range"], + ["keyword", "raw"], + ["keyword", "render"], + ["keyword", "reversed"], + ["keyword", "tablerow"], + ["keyword", "unless"], + ["keyword", "when"], + ["keyword", "with"], + + ["delimiter", "%}"] + ]] ] ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/liquid/markup_feature.test b/tests/languages/liquid/markup_feature.test new file mode 100644 index 0000000000..ed0c311f0f --- /dev/null +++ b/tests/languages/liquid/markup_feature.test @@ -0,0 +1,56 @@ +link + +
+ +---------------------------------------------------- + +[ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "a" + ]], + ["attr-name", ["href"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["liquid", [ + ["delimiter", "{{"], + " url ", + ["delimiter", "}}"] + ]], + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + "link", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["attr-name", ["class"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "foo", + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] +] diff --git a/tests/languages/liquid/number_feature.test b/tests/languages/liquid/number_feature.test index b88f082c19..0b065247a1 100644 --- a/tests/languages/liquid/number_feature.test +++ b/tests/languages/liquid/number_feature.test @@ -1,27 +1,19 @@ -0b11110000 -0xBadFace -0x1.8p1 -0xa.fp-2 +{% + 42 -42d -1.2e3f -0.1E-4f -0.2e+1f +123.456 + +%} ---------------------------------------------------- [ - ["number", "0b11110000"], - ["number", "0xBadFace"], - ["number", "0x1.8p1"], - ["number", "0xa.fp-2"], - ["number", "42"], - ["number", "42d"], - ["number", "1.2e3f"], - ["number", "0.1E-4f"], - ["number", "0.2e+1f"] -] + ["liquid", [ + ["delimiter", "{%"], ----------------------------------------------------- + ["number", "42"], + ["number", "123.456"], -Checks for binary, hexadecimal and decimal numbers. \ No newline at end of file + ["delimiter", "%}"] + ]] +] diff --git a/tests/languages/liquid/object_feature.test b/tests/languages/liquid/object_feature.test new file mode 100644 index 0000000000..b2af4d4673 --- /dev/null +++ b/tests/languages/liquid/object_feature.test @@ -0,0 +1,447 @@ +{{ address }} +{{ all_country_option_tags }} +{{ article }} +{{ block }} +{{ blog }} +{{ cart }} +{{ checkout }} +{{ collection }} +{{ color }} +{{ country }} +{{ country_option_tags }} +{{ currency }} +{{ current_page }} +{{ current_tags }} +{{ customer }} +{{ customer_address }} +{{ date }} +{{ discount_allocation }} +{{ discount_application }} +{{ external_video }} +{{ filter }} +{{ filter_value }} +{{ font }} +{{ forloop }} +{{ fulfillment }} +{{ generic_file }} +{{ gift_card }} +{{ group }} +{{ handle }} +{{ image }} +{{ line_item }} +{{ link }} +{{ linklist }} +{{ localization }} +{{ location }} +{{ measurement }} +{{ media }} +{{ metafield }} +{{ model }} +{{ model_source }} +{{ order }} +{{ page }} +{{ page_description }} +{{ page_image }} +{{ page_title }} +{{ part }} +{{ policy }} +{{ product }} +{{ product_option }} +{{ recommendations }} +{{ request }} +{{ robots }} +{{ routes }} +{{ rule }} +{{ script }} +{{ search }} +{{ selling_plan }} +{{ selling_plan_allocation }} +{{ selling_plan_group }} +{{ shipping_method }} +{{ shop }} +{{ shop_locale }} +{{ sitemap }} +{{ store_availability }} +{{ tax_line }} +{{ template }} +{{ theme }} +{{ transaction }} +{{ unit_price_measurement }} +{{ user_agent }} +{{ variant }} +{{ video }} +{{ video_source }} + +---------------------------------------------------- + +[ + ["liquid", [ + ["delimiter", "{{"], + ["object", "address"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "all_country_option_tags"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "article"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "block"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "blog"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "cart"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "checkout"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "collection"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "color"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "country"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "country_option_tags"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "currency"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "current_page"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "current_tags"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "customer"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "customer_address"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "date"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "discount_allocation"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "discount_application"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "external_video"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "filter"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "filter_value"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "font"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "forloop"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "fulfillment"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "generic_file"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "gift_card"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "group"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "handle"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "image"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "line_item"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "link"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "linklist"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "localization"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "location"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "measurement"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "media"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "metafield"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "model"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "model_source"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "order"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "page"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "page_description"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "page_image"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "page_title"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "part"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "policy"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "product_option"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "recommendations"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "request"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "robots"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "routes"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "rule"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "script"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "search"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "selling_plan"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "selling_plan_allocation"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "selling_plan_group"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "shipping_method"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "shop"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "shop_locale"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "sitemap"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "store_availability"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "tax_line"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "template"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "theme"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "transaction"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "unit_price_measurement"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "user_agent"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "variant"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "video"], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["object", "video_source"], + ["delimiter", "}}"] + ]] +] + +---------------------------------------------------- + +Liquid objects sourced from https://shopify.dev/api/liquid/objects diff --git a/tests/languages/liquid/operator_feature.test b/tests/languages/liquid/operator_feature.test index 87f4906b6d..c6b78d2b31 100644 --- a/tests/languages/liquid/operator_feature.test +++ b/tests/languages/liquid/operator_feature.test @@ -1,33 +1,43 @@ -+ ++ += -- -- -= -! != -< << <= <<= -> >> >>> >= >>= >>>= -= == -& && &= -| || |= -? : ~ -* *= -/ /= -% %= +{% + +== != <> < <= > >= +| : ? - = +.. + +and or +contains foo + +%} ---------------------------------------------------- [ - ["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", "%="] + ["liquid", [ + ["delimiter", "{%"], + + ["operator", "=="], + ["operator", "!="], + ["operator", "<>"], + ["operator", "<"], + ["operator", "<="], + ["operator", ">"], + ["operator", ">="], + + ["operator", "|"], + ["operator", ":"], + ["operator", "?"], + ["operator", "-"], + ["operator", "="], + + ["range", ".."], + + ["operator", "and"], ["operator", "or"], + ["operator", "contains"], " foo\r\n\r\n", + + ["delimiter", "%}"] + ]] ] ---------------------------------------------------- -Checks for all operators. \ No newline at end of file +Checks for all operators. diff --git a/tests/languages/liquid/raw_feature.test b/tests/languages/liquid/raw_feature.test new file mode 100644 index 0000000000..dc93db8481 --- /dev/null +++ b/tests/languages/liquid/raw_feature.test @@ -0,0 +1,31 @@ +{{ this }} +{% raw %} +In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. +{% endraw %} +{{ this }} + +---------------------------------------------------- + +[ + ["liquid", [ + ["delimiter", "{{"], + " this ", + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "raw"], + ["delimiter", "%}"] + ]], + "\r\nIn Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not.\r\n", + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "endraw"], + ["delimiter", "%}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + " this ", + ["delimiter", "}}"] + ]] +] diff --git a/tests/languages/liquid/string_feature.test b/tests/languages/liquid/string_feature.test new file mode 100644 index 0000000000..3481ea4616 --- /dev/null +++ b/tests/languages/liquid/string_feature.test @@ -0,0 +1,21 @@ +{% + +'one-half' + +"foo bar" + +%} + +---------------------------------------------------- + +[ + ["liquid", [ + ["delimiter", "{%"], + + ["string", "'one-half'"], + + ["string", "\"foo bar\""], + + ["delimiter", "%}"] + ]] +] diff --git a/tests/languages/liquid/template_feature.test b/tests/languages/liquid/template_feature.test new file mode 100644 index 0000000000..ac6b44c550 --- /dev/null +++ b/tests/languages/liquid/template_feature.test @@ -0,0 +1,90 @@ +{{ page.title }} + +{% if user %} + Hello {{ user.name }}! +{% endif %} + +{{ "/my/fancy/url" | append: ".html" }} +{{ "adam!" | capitalize | prepend: "Hello " }} + +{% assign my_variable = "tomato" -%} + +{%- if username and username.size > 10 -%} + +---------------------------------------------------- + +[ + ["liquid", [ + ["delimiter", "{{"], + ["object", "page"], + ["punctuation", "."], + "title ", + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "if"], + " user ", + ["delimiter", "%}"] + ]], + + "\r\n Hello ", + ["liquid", [ + ["delimiter", "{{"], + " user", + ["punctuation", "."], + "name ", + ["delimiter", "}}"] + ]], + "!\r\n", + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "endif"], + ["delimiter", "%}"] + ]], + + ["liquid", [ + ["delimiter", "{{"], + ["string", "\"/my/fancy/url\""], + ["operator", "|"], + ["function", "append"], + ["operator", ":"], + ["string", "\".html\""], + ["delimiter", "}}"] + ]], + ["liquid", [ + ["delimiter", "{{"], + ["string", "\"adam!\""], + ["operator", "|"], + ["function", "capitalize"], + ["operator", "|"], + ["function", "prepend"], + ["operator", ":"], + ["string", "\"Hello \""], + ["delimiter", "}}"] + ]], + + ["liquid", [ + ["delimiter", "{%"], + ["keyword", "assign"], + " my_variable ", + ["operator", "="], + ["string", "\"tomato\""], + ["delimiter", "-%}"] + ]], + + ["liquid", [ + ["delimiter", "{%-"], + ["keyword", "if"], + " username ", + ["operator", "and"], + " username", + ["punctuation", "."], + ["function", "size"], + ["operator", ">"], + ["number", "10"], + ["delimiter", "-%}"] + ]] +] diff --git a/tests/languages/lisp/defun_feature.test b/tests/languages/lisp/defun_feature.test index b9c1f7fdc5..85fa71f2ab 100644 --- a/tests/languages/lisp/defun_feature.test +++ b/tests/languages/lisp/defun_feature.test @@ -1,27 +1,297 @@ (defun foo ()) (defun foo (bar)) + (defun foo (bar &body arg1) ) + (defun foo (bar &rest arg1) ) + (defun foo (bar &body arg1 arg2) ) + (defun foo (bar &key arg1) ) (defun foo (bar &key arg1 &allow-other-keys) ) + (defun foo (&optional arg1) ) + (defun defabc ()) +(defun show-members (a b &rest values) (write (list a b values))) +(cl-defun find-thing (thing &rest rest &key need &allow-other-keys) + (or (apply 'cl-member thing thing-list :allow-other-keys t rest) + (if need (error "Thing not found")))) + +(defun foo (a b &optional (c 3 c-supplied-p)) + (list a b c c-supplied-p)) + +(defun foo (&key ((:apple a)) ((:box b) 0) ((:charlie c) 0 c-supplied-p)) + (list a b c c-supplied-p)) + ---------------------------------------------------- [ - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", []], ["punctuation", ")"]]], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ]]], ["punctuation", ")"]]], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["rest-vars", [["lisp-marker", "&body" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["rest-vars", [["lisp-marker", "&rest" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["rest-vars", [["lisp-marker", "&body" ], ["argument", "arg1"], ["argument", "arg2"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["keys", [["lisp-marker", "&key" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["keys", [["lisp-marker", "&key" ], ["argument", "arg1"], ["lisp-marker", "&allow-other-keys"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [["other-marker-vars", [["lisp-marker", "&optional" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "defabc"], ["punctuation", "("], ["arguments", []], ["punctuation", ")"]]], ["punctuation", ")"] + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["rest-vars", [ + ["lisp-marker", "&body"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["rest-vars", [ + ["lisp-marker", "&rest"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["rest-vars", [ + ["lisp-marker", "&body"], + ["argument", "arg1"], + ["argument", "arg2"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["keys", [ + ["lisp-marker", "&key"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["keys", [ + ["lisp-marker", "&key"], + ["argument", "arg1"], + ["lisp-marker", "&allow-other-keys"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["other-marker-vars", [ + ["lisp-marker", "&optional"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "defabc"], + ["punctuation", "("], + ["arguments", [ + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "show-members"], + ["punctuation", "("], + ["arguments", [ + ["argument", "a"], + ["argument", "b"], + ["rest-vars", [ + ["lisp-marker", "&rest"], + ["argument", "values"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", "("], + ["car", "write"], + ["punctuation", "("], + ["car", "list"], + " a b values", + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "cl-defun"], + ["function", "find-thing"], + ["punctuation", "("], + ["arguments", [ + ["argument", "thing"], + ["rest-vars", [ + ["lisp-marker", "&rest"], + ["argument", "rest"], + ["lisp-marker", "&key"], + ["argument", "need"], + ["lisp-marker", "&allow-other-keys"] + ]] + ]], + ["punctuation", ")"] + ]], + + ["punctuation", "("], + ["keyword", "or"], + ["punctuation", "("], + ["car", "apply"], + ["quoted-symbol", "'cl-member"], + " thing thing-list ", + ["lisp-property", ":allow-other-keys"], + ["boolean", "t"], + " rest", + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "if"], + " need ", + ["punctuation", "("], + ["keyword", "error"], + ["string", ["\"Thing not found\""]], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "a"], + ["argument", "b"], + ["other-marker-vars", [ + ["lisp-marker", "&optional"], + ["varform", [ + ["punctuation", "("], + ["car", "c"], + ["number", "3"], + " c-supplied-p", + ["punctuation", ")"] + ]] + ]] + ]], + ["punctuation", ")"] + ]], + + ["punctuation", "("], + ["car", "list"], + " a b c c-supplied-p", + ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["keys", [ + ["lisp-marker", "&key"], + ["punctuation", "("], + ["punctuation", "("], + ["lisp-property", ":apple"], + ["argument", "a"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", "("], + ["lisp-property", ":box"], + ["argument", "b"], + ["punctuation", ")"], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", "("], + ["lisp-property", ":charlie"], + ["argument", "c"], + ["punctuation", ")"], + ["number", "0"], + ["argument", "c-supplied-p"], + ["punctuation", ")"] + ]] + ]], + ["punctuation", ")"] + ]], + + ["punctuation", "("], + ["car", "list"], + " a b c c-supplied-p", + ["punctuation", ")"], + ["punctuation", ")"] ] ---------------------------------------------------- -Checks for defun. \ No newline at end of file +Checks for defun. diff --git a/tests/languages/lisp/punctuation_feature.test b/tests/languages/lisp/punctuation_feature.test index 904ef79f48..d0dba5f017 100644 --- a/tests/languages/lisp/punctuation_feature.test +++ b/tests/languages/lisp/punctuation_feature.test @@ -1,16 +1,19 @@ () ( ) [] +. ( ---------------------------------------------------- [ - ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "["], ["punctuation", "]"], + ["punctuation", "("], ["punctuation", ")"], + ["punctuation", "("], ["punctuation", ")"], + ["punctuation", "["], ["punctuation", "]"], + ["punctuation", "."], ["punctuation", "("] ] + ---------------------------------------------------- -Checks for punctuation. \ No newline at end of file +Checks for punctuation. diff --git a/tests/languages/livescript+pug/livescript_inclusion.test b/tests/languages/livescript+pug/livescript_inclusion.test new file mode 100644 index 0000000000..cc9bafedc0 --- /dev/null +++ b/tests/languages/livescript+pug/livescript_inclusion.test @@ -0,0 +1,30 @@ +:livescript + "#foo #{ if /test/ == 'test' then 3 else 4}" + +---------------------------------------------------- + +[ + ["filter-livescript", [ + ["filter-name", ":livescript"], + ["text", [ + ["interpolated-string", [ + ["string", "\""], + ["variable", "#foo"], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "#{"], + ["keyword", "if"], + ["regex", "/test/"], + ["operator", "=="], + ["string", "'test'"], + ["keyword", "then"], + ["number", "3"], + ["keyword", "else"], + ["number", "4"], + ["interpolation-punctuation", "}"] + ]], + ["string", "\""] + ]] + ]] + ]] +] diff --git a/tests/languages/livescript/punctuation_feature.test b/tests/languages/livescript/punctuation_feature.test new file mode 100644 index 0000000000..4e419cc8aa --- /dev/null +++ b/tests/languages/livescript/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) { } [ ] | ., : ; ` + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "|"], + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", "`"] +] diff --git a/tests/languages/log!+javastacktrace/_hadoop_javastacktrace_inclusion.test b/tests/languages/log!+javastacktrace/_hadoop_javastacktrace_inclusion.test new file mode 100644 index 0000000000..9993da7931 --- /dev/null +++ b/tests/languages/log!+javastacktrace/_hadoop_javastacktrace_inclusion.test @@ -0,0 +1,1014 @@ +[2021-07-21 14:07:47.665]Container killed on request. Exit code is 143 +[2021-07-21 14:07:47.746]Container exited with a non-zero exit code 143. + +2021-07-21 14:08:47,137 INFO [main] mapreduce.Job (Job.java:printTaskEvents(1457)) - Task Id : attempt_1626702076395_0052_m_000404_1, Status : FAILED +[2021-07-21 14:07:48.433]Container [pid=33331,containerID=container_e102_1626702076395_0052_01_000877] is running beyond physical memory limits. Current usage: 2.5 GB of 2 GB physical memory used; 4.7 GB of 4.2 GB virtual memory used. Killing container. +Dump of the process-tree for container_e102_1626702076395_0052_01_000877 : + |- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE + |- 33331 33328 33331 33331 (bash) 0 1 7065600 846 /bin/bash -c /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx3072m -Djava.io.tmpdir=/tmp/hadoop/nm-local-dir/usercache/ms26bybu/appcache/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/tmp -Dlog4j.configuration=container-log4j.properties -Dyarn.app.container.log.dir=/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877 -Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog org.apache.hadoop.mapred.YarnChild 141.54.132.64 39863 attempt_1626702076395_0052_m_000404_1 112150186034029 1>/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stdout 2>/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stderr + |- 33340 33331 33331 33331 (java) 5424 755 5028823040 665860 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx3072m -Djava.io.tmpdir=/tmp/hadoop/nm-local-dir/usercache/ms26bybu/appcache/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/tmp -Dlog4j.configuration=container-log4j.properties -Dyarn.app.container.log.dir=/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877 -Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog org.apache.hadoop.mapred.YarnChild 141.54.132.64 39863 attempt_1626702076395_0052_m_000404_1 112150186034029 + +[2021-07-21 14:07:48.611]Container killed on request. Exit code is 143 +[2021-07-21 14:07:48.633]Container exited with a non-zero exit code 143. + +2021-07-21 14:08:47,233 INFO [main] mapreduce.Job (Job.java:monitorAndPrintJob(1431)) - Job job_1626702076395_0052 failed with state FAILED due to: Task failed task_1626702076395_0052_m_000000 +Job failed as tasks failed. failedMaps:1 failedReduces:0 + +2021-07-21 14:08:47,330 INFO [main] mapreduce.Job (Job.java:monitorAndPrintJob(1436)) - Counters: 14 + Job Counters + Failed map tasks=1436 + Killed map tasks=1527 + Killed reduce tasks=1 + Launched map tasks=1816 + Other local map tasks=1218 + Rack-local map tasks=598 + Total time spent by all maps in occupied slots (ms)=119609884 + Total time spent by all reduces in occupied slots (ms)=0 + Total time spent by all map tasks (ms)=59804942 + Total vcore-milliseconds taken by all map tasks=59804942 + Total megabyte-milliseconds taken by all map tasks=122480521216 + Map-Reduce Framework + CPU time spent (ms)=0 + Physical memory (bytes) snapshot=0 + Virtual memory (bytes) snapshot=0 +java.lang.RuntimeException: java.lang.RuntimeException: Job failed. + at org.netspeak.usage.Cli.run(Cli.java:272) + at picocli.CommandLine.executeUserObject(CommandLine.java:1919) + at picocli.CommandLine.access$1200(CommandLine.java:145) + at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2326) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2291) + at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159) + at picocli.CommandLine.execute(CommandLine.java:2058) + at org.netspeak.usage.Cli.main(Cli.java:292) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.apache.hadoop.util.RunJar.run(RunJar.java:239) + at org.apache.hadoop.util.RunJar.main(RunJar.java:153) +Caused by: java.lang.RuntimeException: Job failed. + at org.netspeak.hadoop.Merge.run(Merge.java:124) + at org.netspeak.usage.Cli.runHadoop(Cli.java:239) + at org.netspeak.usage.Cli.runWithExecption(Cli.java:259) + at org.netspeak.usage.Cli.run(Cli.java:270) + ... 14 more + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:47.665"], + ["punctuation", "]"], + "Container killed on request", + ["punctuation", "."], + " Exit code is ", + ["number", "143"], + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:47.746"], + ["punctuation", "]"], + "Container exited with a non", + ["operator", "-"], + "zero exit code ", + ["number", "143"], + ["punctuation", "."], + + ["date", "2021-07-21"], + ["time", "14:08:47,137"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " mapreduce", + ["punctuation", "."], + "Job ", + ["operator", "("], + "Job", + ["punctuation", "."], + "java", + ["operator", ":"], + "printTaskEvents", + ["operator", "("], + ["number", "1457"], + ["operator", ")"], + ["operator", ")"], + ["operator", "-"], + " Task Id ", + ["operator", ":"], + " attempt_1626702076395_0052_m_000404_1", + ["punctuation", ","], + " Status ", + ["operator", ":"], + " FAILED\r\n", + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.433"], + ["punctuation", "]"], + "Container ", + ["punctuation", "["], + "pid", + ["operator", "="], + ["number", "33331"], + ["punctuation", ","], + "containerID", + ["operator", "="], + "container_e102_1626702076395_0052_01_000877", + ["punctuation", "]"], + " is running beyond physical memory limits", + ["punctuation", "."], + " Current usage", + ["operator", ":"], + ["number", "2.5"], + " GB of ", + ["number", "2"], + " GB physical memory used", + ["operator", ";"], + ["number", "4.7"], + " GB of ", + ["number", "4.2"], + " GB virtual memory used", + ["punctuation", "."], + " Killing container", + ["punctuation", "."], + + "\r\nDump of the process", + ["operator", "-"], + "tree for container_e102_1626702076395_0052_01_000877 ", + ["operator", ":"], + + ["operator", "|"], + ["operator", "-"], + " PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME", + ["operator", "("], + "MILLIS", + ["operator", ")"], + " SYSTEM_TIME", + ["operator", "("], + "MILLIS", + ["operator", ")"], + " VMEM_USAGE", + ["operator", "("], + "BYTES", + ["operator", ")"], + " RSSMEM_USAGE", + ["operator", "("], + "PAGES", + ["operator", ")"], + " FULL_CMD_LINE\r\n ", + + ["operator", "|"], + ["operator", "-"], + ["number", "33331"], + ["number", "33328"], + ["number", "33331"], + ["number", "33331"], + ["operator", "("], + "bash", + ["operator", ")"], + ["number", "0"], + ["number", "1"], + ["number", "7065600"], + ["number", "846"], + ["file-path", "/bin/bash"], + ["operator", "-"], + "c ", + ["file-path", "/usr/lib/jvm/java-8-openjdk-amd64/bin/java"], + ["operator", "-"], + "Djava", + ["punctuation", "."], + "net", + ["punctuation", "."], + "preferIPv4Stack", + ["operator", "="], + ["boolean", "true"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "metrics", + ["punctuation", "."], + "log", + ["punctuation", "."], + "level", + ["operator", "="], + ["level", "WARN"], + ["operator", "-"], + "Xmx3072m ", + ["operator", "-"], + "Djava", + ["punctuation", "."], + "io", + ["punctuation", "."], + "tmpdir", + ["operator", "="], + ["operator", "/"], + "tmp", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "nm", + ["operator", "-"], + "local", + ["operator", "-"], + "dir", + ["operator", "/"], + "usercache", + ["operator", "/"], + "ms26bybu", + ["operator", "/"], + "appcache", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877", + ["operator", "/"], + "tmp ", + ["operator", "-"], + "Dlog4j", + ["punctuation", "."], + "configuration", + ["operator", "="], + "container", + ["operator", "-"], + "log4j", + ["punctuation", "."], + "properties ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "dir", + ["operator", "="], + ["operator", "/"], + "opt", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "logs", + ["operator", "/"], + "userlogs", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877 ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "filesize", + ["operator", "="], + ["number", "0"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logger", + ["operator", "="], + ["level", "INFO"], + ["punctuation", ","], + "CLA ", + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logfile", + ["operator", "="], + "syslog org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "mapred", + ["punctuation", "."], + "YarnChild ", + ["ip-address", "141.54.132.64"], + ["number", "39863"], + " attempt_1626702076395_0052_m_000404_1 ", + ["number", "112150186034029"], + ["number", "1"], + ["operator", ">"], + ["file-path", "/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stdout"], + ["number", "2"], + ["operator", ">"], + ["file-path", "/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stderr"], + + ["operator", "|"], + ["operator", "-"], + ["number", "33340"], + ["number", "33331"], + ["number", "33331"], + ["number", "33331"], + ["operator", "("], + "java", + ["operator", ")"], + ["number", "5424"], + ["number", "755"], + ["number", "5028823040"], + ["number", "665860"], + ["file-path", "/usr/lib/jvm/java-8-openjdk-amd64/bin/java"], + ["operator", "-"], + "Djava", + ["punctuation", "."], + "net", + ["punctuation", "."], + "preferIPv4Stack", + ["operator", "="], + ["boolean", "true"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "metrics", + ["punctuation", "."], + "log", + ["punctuation", "."], + "level", + ["operator", "="], + ["level", "WARN"], + ["operator", "-"], + "Xmx3072m ", + ["operator", "-"], + "Djava", + ["punctuation", "."], + "io", + ["punctuation", "."], + "tmpdir", + ["operator", "="], + ["operator", "/"], + "tmp", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "nm", + ["operator", "-"], + "local", + ["operator", "-"], + "dir", + ["operator", "/"], + "usercache", + ["operator", "/"], + "ms26bybu", + ["operator", "/"], + "appcache", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877", + ["operator", "/"], + "tmp ", + ["operator", "-"], + "Dlog4j", + ["punctuation", "."], + "configuration", + ["operator", "="], + "container", + ["operator", "-"], + "log4j", + ["punctuation", "."], + "properties ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "dir", + ["operator", "="], + ["operator", "/"], + "opt", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "logs", + ["operator", "/"], + "userlogs", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877 ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "filesize", + ["operator", "="], + ["number", "0"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logger", + ["operator", "="], + ["level", "INFO"], + ["punctuation", ","], + "CLA ", + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logfile", + ["operator", "="], + "syslog org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "mapred", + ["punctuation", "."], + "YarnChild ", + ["ip-address", "141.54.132.64"], + ["number", "39863"], + " attempt_1626702076395_0052_m_000404_1 ", + ["number", "112150186034029"], + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.611"], + ["punctuation", "]"], + "Container killed on request", + ["punctuation", "."], + " Exit code is ", + ["number", "143"], + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.633"], + ["punctuation", "]"], + "Container exited with a non", + ["operator", "-"], + "zero exit code ", + ["number", "143"], + ["punctuation", "."], + + ["date", "2021-07-21"], + ["time", "14:08:47,233"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " mapreduce", + ["punctuation", "."], + "Job ", + ["operator", "("], + "Job", + ["punctuation", "."], + "java", + ["operator", ":"], + "monitorAndPrintJob", + ["operator", "("], + ["number", "1431"], + ["operator", ")"], + ["operator", ")"], + ["operator", "-"], + " Job job_1626702076395_0052 failed with state FAILED due to", + ["operator", ":"], + " Task failed task_1626702076395_0052_m_000000\r\nJob failed as tasks failed", + ["punctuation", "."], + " failedMaps", + ["operator", ":"], + ["number", "1"], + " failedReduces", + ["operator", ":"], + ["number", "0"], + + ["date", "2021-07-21"], + ["time", "14:08:47,330"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " mapreduce", + ["punctuation", "."], + "Job ", + ["operator", "("], + "Job", + ["punctuation", "."], + "java", + ["operator", ":"], + "monitorAndPrintJob", + ["operator", "("], + ["number", "1436"], + ["operator", ")"], + ["operator", ")"], + ["operator", "-"], + " Counters", + ["operator", ":"], + ["number", "14"], + + "\r\n Job Counters\r\n Failed map tasks", + ["operator", "="], + ["number", "1436"], + + "\r\n Killed map tasks", + ["operator", "="], + ["number", "1527"], + + "\r\n Killed reduce tasks", + ["operator", "="], + ["number", "1"], + + "\r\n Launched map tasks", + ["operator", "="], + ["number", "1816"], + + "\r\n Other local map tasks", + ["operator", "="], + ["number", "1218"], + + "\r\n Rack", + ["operator", "-"], + "local map tasks", + ["operator", "="], + ["number", "598"], + + "\r\n Total time spent by all maps in occupied slots ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "119609884"], + + "\r\n Total time spent by all reduces in occupied slots ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "0"], + + "\r\n Total time spent by all map tasks ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "59804942"], + + "\r\n Total vcore", + ["operator", "-"], + "milliseconds taken by all map tasks", + ["operator", "="], + ["number", "59804942"], + + "\r\n Total megabyte", + ["operator", "-"], + "milliseconds taken by all map tasks", + ["operator", "="], + ["number", "122480521216"], + + "\r\n Map", + ["operator", "-"], + "Reduce Framework\r\n CPU time spent ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "0"], + + "\r\n Physical memory ", + ["operator", "("], + "bytes", + ["operator", ")"], + " snapshot", + ["operator", "="], + ["number", "0"], + + "\r\n Virtual memory ", + ["operator", "("], + "bytes", + ["operator", ")"], + " snapshot", + ["operator", "="], + ["number", "0"], + + ["exception", [ + ["summary", [ + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "lang"], + ["punctuation", "."], + ["class-name", "RuntimeException"] + ]], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "lang"], + ["punctuation", "."], + ["class-name", "RuntimeException"] + ]], + ["punctuation", ":"], + ["message", "Job failed."] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "272"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine"], + ["punctuation", "."], + ["function", "executeUserObject"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "1919"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine"], + ["punctuation", "."], + ["function", "access$1200"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "145"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$RunLast"], + ["punctuation", "."], + ["function", "executeUserObjectOfLastSubcommandWithSameParent"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2332"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$RunLast"], + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2326"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$RunLast"], + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2291"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$AbstractParseResultHandler"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2159"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2058"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "292"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "NativeMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke0"], + ["punctuation", "("], + ["source", [ + ["keyword", "Native Method"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "NativeMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "NativeMethodAccessorImpl.java"], + ["punctuation", ":"], + ["line-number", "62"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "DelegatingMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "DelegatingMethodAccessorImpl.java"], + ["punctuation", ":"], + ["line-number", "43"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "Method"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "Method.java"], + ["punctuation", ":"], + ["line-number", "498"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."] + ]], + ["class-name", "RunJar"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "RunJar.java"], + ["punctuation", ":"], + ["line-number", "239"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."] + ]], + ["class-name", "RunJar"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["file", "RunJar.java"], + ["punctuation", ":"], + ["line-number", "153"] + ]], + ["punctuation", ")"] + ]], + ["summary", [ + ["keyword", "Caused by"], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "lang"], + ["punctuation", "."], + ["class-name", "RuntimeException"] + ]], + ["punctuation", ":"], + ["message", "Job failed."] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "hadoop", + ["punctuation", "."] + ]], + ["class-name", "Merge"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Merge.java"], + ["punctuation", ":"], + ["line-number", "124"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "runHadoop"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "239"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "runWithExecption"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "259"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "270"] + ]], + ["punctuation", ")"] + ]], + ["more", [ + ["punctuation", "..."], + ["number", "14"], + ["keyword", "more"] + ]] + ]] +] diff --git a/tests/languages/log!+javastacktrace/_java_stack_trace_inclusion.test b/tests/languages/log!+javastacktrace/_java_stack_trace_inclusion.test new file mode 100644 index 0000000000..db9acad878 --- /dev/null +++ b/tests/languages/log!+javastacktrace/_java_stack_trace_inclusion.test @@ -0,0 +1,903 @@ +java.net.BindException: Address already in use + at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_171] + at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_171] + at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_171] + at sun.nio.ch.ServeISocketChannelImpl.bind(ServerSocketChannellmpl.java:223) ~[na:1.8.0_171] + +org.apache.maven.lifecycle.LifecycleExecutionException: Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) + at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) + at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) + at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) + at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) + at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) + at org.codehaus.classworlds.Launcher.main(Launcher.java:375) +Caused by: org.apache.maven.plugin.MojoExecutionException: Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:174) + at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) + ... 16 more +Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:102) + at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162) + ... 18 more +Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataDeploymentException: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:441) + at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:86) + ... 19 more +Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.wagon.providers.http.LightweightHttpWagon.put(LightweightHttpWagon.java:172) + at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:237) + at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifactMetadata(DefaultWagonManager.java:162) + at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:437) + ... 20 more + +---------------------------------------------------- + +[ + ["exception", [ + ["summary", [ + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "net"], + ["punctuation", "."], + ["class-name", "BindException"] + ]], + ["punctuation", ":"], + ["message", "Address already in use"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."] + ]], + ["class-name", "Net"], + ["punctuation", "."], + ["function", "bind0"], + ["punctuation", "("], + ["source", [ + ["keyword", "Native Method"] + ]], + ["punctuation", ")"] + ]], + " ~[na:1.8.0_171]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."] + ]], + ["class-name", "Net"], + ["punctuation", "."], + ["function", "bind"], + ["punctuation", "("], + ["source", [ + ["file", "Net.java"], + ["punctuation", ":"], + ["line-number", "433"] + ]], + ["punctuation", ")"] + ]], + " ~[na:1.8.0_171]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."] + ]], + ["class-name", "Net"], + ["punctuation", "."], + ["function", "bind"], + ["punctuation", "("], + ["source", [ + ["file", "Net.java"], + ["punctuation", ":"], + ["line-number", "425"] + ]], + ["punctuation", ")"] + ]], + " ~[na:1.8.0_171]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."] + ]], + ["class-name", "ServeISocketChannelImpl"], + ["punctuation", "."], + ["function", "bind"], + ["punctuation", "("], + ["source", [ + ["file", "ServerSocketChannellmpl.java"], + ["punctuation", ":"], + ["line-number", "223"] + ]], + ["punctuation", ")"] + ]], + " ~[na:1.8.0_171]" + ]], + + ["exception", [ + ["summary", [ + ["exceptions", [ + ["namespace", "org"], + ["punctuation", "."], + ["namespace", "apache"], + ["punctuation", "."], + ["namespace", "maven"], + ["punctuation", "."], + ["namespace", "lifecycle"], + ["punctuation", "."], + ["class-name", "LifecycleExecutionException"] + ]], + ["punctuation", ":"], + ["message", "Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "executeGoals"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "564"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "executeGoalWithLifecycle"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "480"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "executeGoal"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "459"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "executeGoalAndHandleFailures"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "311"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "executeTaskSegments"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "278"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "143"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."] + ]], + ["class-name", "DefaultMaven"], + ["punctuation", "."], + ["function", "doExecute"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultMaven.java"], + ["punctuation", ":"], + ["line-number", "334"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."] + ]], + ["class-name", "DefaultMaven"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultMaven.java"], + ["punctuation", ":"], + ["line-number", "125"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "cli", + ["punctuation", "."] + ]], + ["class-name", "MavenCli"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["file", "MavenCli.java"], + ["punctuation", ":"], + ["line-number", "280"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "NativeMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke0"], + ["punctuation", "("], + ["source", [ + ["keyword", "Native Method"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "NativeMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "NativeMethodAccessorImpl.java"], + ["punctuation", ":"], + ["line-number", "39"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "DelegatingMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "DelegatingMethodAccessorImpl.java"], + ["punctuation", ":"], + ["line-number", "25"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "Method"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "Method.java"], + ["punctuation", ":"], + ["line-number", "585"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."] + ]], + ["class-name", "Launcher"], + ["punctuation", "."], + ["function", "launchEnhanced"], + ["punctuation", "("], + ["source", [ + ["file", "Launcher.java"], + ["punctuation", ":"], + ["line-number", "315"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."] + ]], + ["class-name", "Launcher"], + ["punctuation", "."], + ["function", "launch"], + ["punctuation", "("], + ["source", [ + ["file", "Launcher.java"], + ["punctuation", ":"], + ["line-number", "255"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."] + ]], + ["class-name", "Launcher"], + ["punctuation", "."], + ["function", "mainWithExitCode"], + ["punctuation", "("], + ["source", [ + ["file", "Launcher.java"], + ["punctuation", ":"], + ["line-number", "430"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."] + ]], + ["class-name", "Launcher"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["file", "Launcher.java"], + ["punctuation", ":"], + ["line-number", "375"] + ]], + ["punctuation", ")"] + ]], + ["summary", [ + ["keyword", "Caused by"], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "org"], + ["punctuation", "."], + ["namespace", "apache"], + ["punctuation", "."], + ["namespace", "maven"], + ["punctuation", "."], + ["namespace", "plugin"], + ["punctuation", "."], + ["class-name", "MojoExecutionException"] + ]], + ["punctuation", ":"], + ["message", "Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."], + "deploy", + ["punctuation", "."] + ]], + ["class-name", "DeployMojo"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "DeployMojo.java"], + ["punctuation", ":"], + ["line-number", "174"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."] + ]], + ["class-name", "DefaultPluginManager"], + ["punctuation", "."], + ["function", "executeMojo"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultPluginManager.java"], + ["punctuation", ":"], + ["line-number", "443"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."] + ]], + ["class-name", "DefaultLifecycleExecutor"], + ["punctuation", "."], + ["function", "executeGoals"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultLifecycleExecutor.java"], + ["punctuation", ":"], + ["line-number", "539"] + ]], + ["punctuation", ")"] + ]], + ["more", [ + ["punctuation", "..."], + ["number", "16"], + ["keyword", "more"] + ]], + ["summary", [ + ["keyword", "Caused by"], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "org"], + ["punctuation", "."], + ["namespace", "apache"], + ["punctuation", "."], + ["namespace", "maven"], + ["punctuation", "."], + ["namespace", "artifact"], + ["punctuation", "."], + ["namespace", "deployer"], + ["punctuation", "."], + ["class-name", "ArtifactDeploymentException"] + ]], + ["punctuation", ":"], + ["message", "Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "deployer", + ["punctuation", "."] + ]], + ["class-name", "DefaultArtifactDeployer"], + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultArtifactDeployer.java"], + ["punctuation", ":"], + ["line-number", "102"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."], + "deploy", + ["punctuation", "."] + ]], + ["class-name", "DeployMojo"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "DeployMojo.java"], + ["punctuation", ":"], + ["line-number", "162"] + ]], + ["punctuation", ")"] + ]], + ["more", [ + ["punctuation", "..."], + ["number", "18"], + ["keyword", "more"] + ]], + ["summary", [ + ["keyword", "Caused by"], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "org"], + ["punctuation", "."], + ["namespace", "apache"], + ["punctuation", "."], + ["namespace", "maven"], + ["punctuation", "."], + ["namespace", "artifact"], + ["punctuation", "."], + ["namespace", "repository"], + ["punctuation", "."], + ["namespace", "metadata"], + ["punctuation", "."], + ["class-name", "RepositoryMetadataDeploymentException"] + ]], + ["punctuation", ":"], + ["message", "Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "repository", + ["punctuation", "."], + "metadata", + ["punctuation", "."] + ]], + ["class-name", "DefaultRepositoryMetadataManager"], + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultRepositoryMetadataManager.java"], + ["punctuation", ":"], + ["line-number", "441"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "deployer", + ["punctuation", "."] + ]], + ["class-name", "DefaultArtifactDeployer"], + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultArtifactDeployer.java"], + ["punctuation", ":"], + ["line-number", "86"] + ]], + ["punctuation", ")"] + ]], + ["more", [ + ["punctuation", "..."], + ["number", "19"], + ["keyword", "more"] + ]], + ["summary", [ + ["keyword", "Caused by"], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "org"], + ["punctuation", "."], + ["namespace", "apache"], + ["punctuation", "."], + ["namespace", "maven"], + ["punctuation", "."], + ["namespace", "wagon"], + ["punctuation", "."], + ["class-name", "TransferFailedException"] + ]], + ["punctuation", ":"], + ["message", "Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "wagon", + ["punctuation", "."], + "providers", + ["punctuation", "."], + "http", + ["punctuation", "."] + ]], + ["class-name", "LightweightHttpWagon"], + ["punctuation", "."], + ["function", "put"], + ["punctuation", "("], + ["source", [ + ["file", "LightweightHttpWagon.java"], + ["punctuation", ":"], + ["line-number", "172"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "manager", + ["punctuation", "."] + ]], + ["class-name", "DefaultWagonManager"], + ["punctuation", "."], + ["function", "putRemoteFile"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultWagonManager.java"], + ["punctuation", ":"], + ["line-number", "237"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "manager", + ["punctuation", "."] + ]], + ["class-name", "DefaultWagonManager"], + ["punctuation", "."], + ["function", "putArtifactMetadata"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultWagonManager.java"], + ["punctuation", ":"], + ["line-number", "162"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "repository", + ["punctuation", "."], + "metadata", + ["punctuation", "."] + ]], + ["class-name", "DefaultRepositoryMetadataManager"], + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + ["source", [ + ["file", "DefaultRepositoryMetadataManager.java"], + ["punctuation", ":"], + ["line-number", "437"] + ]], + ["punctuation", ")"] + ]], + ["more", [ + ["punctuation", "..."], + ["number", "20"], + ["keyword", "more"] + ]] + ]] +] diff --git a/tests/languages/log!+javastacktrace/_minecraft_javastacktrace_inclusion.test b/tests/languages/log!+javastacktrace/_minecraft_javastacktrace_inclusion.test new file mode 100644 index 0000000000..43f3ac30f7 --- /dev/null +++ b/tests/languages/log!+javastacktrace/_minecraft_javastacktrace_inclusion.test @@ -0,0 +1,408 @@ +[07:28:17] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting minecraft server version 1.12.2 +[07:28:17] [Server thread/INFO] [FML]: MinecraftForge v14.23.5.2847 Initialized +[07:28:17] [Server thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients. +[07:28:18] [Server thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingredient... +[07:28:19] [Server thread/INFO] [FML]: Replaced 1227 ore ingredients +[07:28:19] [Server thread/INFO] [FML]: Searching /home/minecraft/multicraft/servers/server99505/./mods for mods +[07:28:21] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load +[07:28:21] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang +[07:28:21] [Server thread/FATAL] [FML]: net.minecraftforge.fml.common.MissingModsException: Mod thaumcraft (Thaumcraft) requires [baubles@[1.5.2,)] +[07:28:21] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception +net.minecraftforge.fml.common.MissingModsException: Mod thaumcraft (Thaumcraft) requires [baubles@[1.5.2,)] + at net.minecraftforge.fml.common.Loader.sortModList(Loader.java:266) ~[Loader.class:?] + at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:572) ~[Loader.class:?] + at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98) ~[FMLServerHandler.class:?] + at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) ~[FMLCommonHandler.class:?] + at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) ~[nz.class:?] + at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486) [MinecraftServer.class:?] + at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222] + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["time", "07:28:17"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "dedicated", + ["punctuation", "."], + "DedicatedServer", + ["punctuation", "]"], + ["operator", ":"], + " Starting minecraft server version ", + ["number", "1.12.2"], + + ["punctuation", "["], + ["time", "07:28:17"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " MinecraftForge ", + ["number", "v14.23.5.2847"], + " Initialized\r\n", + + ["punctuation", "["], + ["time", "07:28:17"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Starts to replace vanilla recipe ingredients with ore ingredients", + ["punctuation", "."], + + ["punctuation", "["], + ["time", "07:28:18"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Invalid recipe found with multiple oredict ingredients in the same ingredient", + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + + ["punctuation", "["], + ["time", "07:28:19"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Replaced ", + ["number", "1227"], + " ore ingredients\r\n", + + ["punctuation", "["], + ["time", "07:28:19"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Searching ", + ["file-path", "/home/minecraft/multicraft/servers/server99505/./mods"], + " for mods\r\n", + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Forge Mod Loader has identified ", + ["number", "5"], + " mods to load\r\n", + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "WARN"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Missing English translation for FML", + ["operator", ":"], + " assets", + ["operator", "/"], + "fml", + ["operator", "/"], + "lang", + ["operator", "/"], + "en_us", + ["punctuation", "."], + "lang\r\n", + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "FATAL"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."], + "MissingModsException", + ["operator", ":"], + " Mod thaumcraft ", + ["operator", "("], + "Thaumcraft", + ["operator", ")"], + " requires ", + ["punctuation", "["], + "baubles", + ["operator", "@"], + ["punctuation", "["], + ["number", "1.5.2"], + ["punctuation", ","], + ["operator", ")"], + ["punctuation", "]"], + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "ERROR"], + ["punctuation", "]"], + ["punctuation", "["], + "net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "MinecraftServer", + ["punctuation", "]"], + ["operator", ":"], + " Encountered an unexpected exception\r\n", + + ["exception", [ + ["summary", [ + ["exceptions", [ + ["namespace", "net"], + ["punctuation", "."], + ["namespace", "minecraftforge"], + ["punctuation", "."], + ["namespace", "fml"], + ["punctuation", "."], + ["namespace", "common"], + ["punctuation", "."], + ["class-name", "MissingModsException"] + ]], + ["punctuation", ":"], + ["message", "Mod thaumcraft (Thaumcraft) requires [baubles@[1.5.2,)]"] + ]], + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."] + ]], + ["class-name", "Loader"], + ["punctuation", "."], + ["function", "sortModList"], + ["punctuation", "("], + ["source", [ + ["file", "Loader.java"], + ["punctuation", ":"], + ["line-number", "266"] + ]], + ["punctuation", ")"] + ]], + " ~[Loader.class:?]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."] + ]], + ["class-name", "Loader"], + ["punctuation", "."], + ["function", "loadMods"], + ["punctuation", "("], + ["source", [ + ["file", "Loader.java"], + ["punctuation", ":"], + ["line-number", "572"] + ]], + ["punctuation", ")"] + ]], + " ~[Loader.class:?]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "server", + ["punctuation", "."] + ]], + ["class-name", "FMLServerHandler"], + ["punctuation", "."], + ["function", "beginServerLoading"], + ["punctuation", "("], + ["source", [ + ["file", "FMLServerHandler.java"], + ["punctuation", ":"], + ["line-number", "98"] + ]], + ["punctuation", ")"] + ]], + " ~[FMLServerHandler.class:?]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."] + ]], + ["class-name", "FMLCommonHandler"], + ["punctuation", "."], + ["function", "onServerStart"], + ["punctuation", "("], + ["source", [ + ["file", "FMLCommonHandler.java"], + ["punctuation", ":"], + ["line-number", "333"] + ]], + ["punctuation", ")"] + ]], + " ~[FMLCommonHandler.class:?]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "dedicated", + ["punctuation", "."] + ]], + ["class-name", "DedicatedServer"], + ["punctuation", "."], + ["function", "func_71197_b"], + ["punctuation", "("], + ["source", [ + ["file", "DedicatedServer.java"], + ["punctuation", ":"], + ["line-number", "125"] + ]], + ["punctuation", ")"] + ]], + " ~[nz.class:?]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."] + ]], + ["class-name", "MinecraftServer"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "MinecraftServer.java"], + ["punctuation", ":"], + ["line-number", "486"] + ]], + ["punctuation", ")"] + ]], + " [MinecraftServer.class:?]\r\n\t", + + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."] + ]], + ["class-name", "Thread"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Thread.java"], + ["punctuation", ":"], + ["line-number", "748"] + ]], + ["punctuation", ")"] + ]], + " [?:1.8.0_222]" + ]] +] diff --git a/tests/languages/log!+javastacktrace/exception_javastacktrace_inclusion.test b/tests/languages/log!+javastacktrace/exception_javastacktrace_inclusion.test new file mode 100644 index 0000000000..d99b6d85ad --- /dev/null +++ b/tests/languages/log!+javastacktrace/exception_javastacktrace_inclusion.test @@ -0,0 +1,438 @@ +[2021-07-21 14:07:48.633] ERR java.lang.RuntimeException: java.lang.RuntimeException: Job failed. + at org.netspeak.usage.Cli.run(Cli.java:272) + at picocli.CommandLine.executeUserObject(CommandLine.java:1919) + at picocli.CommandLine.access$1200(CommandLine.java:145) + at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2326) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2291) + at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159) + at picocli.CommandLine.execute(CommandLine.java:2058) + at org.netspeak.usage.Cli.main(Cli.java:292) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.apache.hadoop.util.RunJar.run(RunJar.java:239) + at org.apache.hadoop.util.RunJar.main(RunJar.java:153) +Caused by: java.lang.RuntimeException: Job failed. + at org.netspeak.hadoop.Merge.run(Merge.java:124) + at org.netspeak.usage.Cli.runHadoop(Cli.java:239) + at org.netspeak.usage.Cli.runWithExecption(Cli.java:259) + at org.netspeak.usage.Cli.run(Cli.java:270) + ... 14 more + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.633"], + ["punctuation", "]"], + ["level", "ERR"], + ["exception", [ + ["summary", [ + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "lang"], + ["punctuation", "."], + ["class-name", "RuntimeException"] + ]], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "lang"], + ["punctuation", "."], + ["class-name", "RuntimeException"] + ]], + ["punctuation", ":"], + ["message", "Job failed."] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "272"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine"], + ["punctuation", "."], + ["function", "executeUserObject"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "1919"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine"], + ["punctuation", "."], + ["function", "access$1200"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "145"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$RunLast"], + ["punctuation", "."], + ["function", "executeUserObjectOfLastSubcommandWithSameParent"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2332"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$RunLast"], + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2326"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$RunLast"], + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2291"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine$AbstractParseResultHandler"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2159"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "picocli", + ["punctuation", "."] + ]], + ["class-name", "CommandLine"], + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + ["source", [ + ["file", "CommandLine.java"], + ["punctuation", ":"], + ["line-number", "2058"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "292"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "NativeMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke0"], + ["punctuation", "("], + ["source", [ + ["keyword", "Native Method"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "NativeMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "NativeMethodAccessorImpl.java"], + ["punctuation", ":"], + ["line-number", "62"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "DelegatingMethodAccessorImpl"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "DelegatingMethodAccessorImpl.java"], + ["punctuation", ":"], + ["line-number", "43"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "reflect", + ["punctuation", "."] + ]], + ["class-name", "Method"], + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + ["source", [ + ["file", "Method.java"], + ["punctuation", ":"], + ["line-number", "498"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."] + ]], + ["class-name", "RunJar"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "RunJar.java"], + ["punctuation", ":"], + ["line-number", "239"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."] + ]], + ["class-name", "RunJar"], + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + ["source", [ + ["file", "RunJar.java"], + ["punctuation", ":"], + ["line-number", "153"] + ]], + ["punctuation", ")"] + ]], + ["summary", [ + ["keyword", "Caused by"], + ["punctuation", ":"], + ["exceptions", [ + ["namespace", "java"], + ["punctuation", "."], + ["namespace", "lang"], + ["punctuation", "."], + ["class-name", "RuntimeException"] + ]], + ["punctuation", ":"], + ["message", "Job failed."] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "hadoop", + ["punctuation", "."] + ]], + ["class-name", "Merge"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Merge.java"], + ["punctuation", ":"], + ["line-number", "124"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "runHadoop"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "239"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "runWithExecption"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "259"] + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["namespace", [ + "org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."] + ]], + ["class-name", "Cli"], + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + ["source", [ + ["file", "Cli.java"], + ["punctuation", ":"], + ["line-number", "270"] + ]], + ["punctuation", ")"] + ]], + ["more", [ + ["punctuation", "..."], + ["number", "14"], + ["keyword", "more"] + ]] + ]] +] diff --git a/tests/languages/log/_discord.test b/tests/languages/log/_discord.test new file mode 100644 index 0000000000..064e815667 --- /dev/null +++ b/tests/languages/log/_discord.test @@ -0,0 +1,420 @@ +[2020-12-07][23:26:36][DEBUG][discord_dispatch::application_manager:195] App started. version="1.10.5" +[2020-12-07][23:26:36][DEBUG][discord_dispatch::application_manager:1030] Searching for applications. install_path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } +[2020-12-07][23:26:36][WARN][discord_dispatch::application_manager:1034] Failed to read install path. path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } error=Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } +[2020-12-09][17:25:53][DEBUG][discord_dispatch::application_manager:195] App started. version="1.10.5" +[2020-12-09][17:25:53][DEBUG][discord_dispatch::application_manager:1030] Searching for applications. install_path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } +[2020-12-09][17:25:53][WARN][discord_dispatch::application_manager:1034] Failed to read install path. path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } error=Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } +[2020-12-10][12:30:59][DEBUG][discord_dispatch::application_manager:195] App started. version="1.10.5" +[2020-12-10][12:30:59][DEBUG][discord_dispatch::application_manager:1030] Searching for applications. install_path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } +[2020-12-10][12:30:59][WARN][discord_dispatch::application_manager:1034] Failed to read install path. path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } error=Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } +[2020-12-10][21:42:22][DEBUG][discord_dispatch::application_manager:195] App started. version="1.10.5" +[2020-12-10][21:42:22][DEBUG][discord_dispatch::application_manager:1030] Searching for applications. install_path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } +[2020-12-10][21:42:22][WARN][discord_dispatch::application_manager:1034] Failed to read install path. path=AbsolutePath { path_buf: "C:\\Users\\micha\\AppData\\Local\\DiscordGames" } error=Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } +[2020-12-11][13:05:13][DEBUG][discord_dispatch::application_manager:195] App started. version="1.10.5" + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["date", "2020-12-07"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "23:26:36"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "195"], + ["punctuation", "]"], + " App started", + ["punctuation", "."], + " version", + ["operator", "="], + ["string", "\"1.10.5\""], + + ["punctuation", "["], + ["date", "2020-12-07"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "23:26:36"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1030"], + ["punctuation", "]"], + " Searching for applications", + ["punctuation", "."], + " install_path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-07"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "23:26:36"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "WARN"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1034"], + ["punctuation", "]"], + " Failed to read install path", + ["punctuation", "."], + " path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + " error", + ["operator", "="], + "Os ", + ["operator", "{"], + " code", + ["operator", ":"], + ["number", "3"], + ["punctuation", ","], + " kind", + ["operator", ":"], + " NotFound", + ["punctuation", ","], + " message", + ["operator", ":"], + ["string", "\"Das System kann den angegebenen Pfad nicht finden.\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-09"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "17:25:53"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "195"], + ["punctuation", "]"], + " App started", + ["punctuation", "."], + " version", + ["operator", "="], + ["string", "\"1.10.5\""], + + ["punctuation", "["], + ["date", "2020-12-09"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "17:25:53"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1030"], + ["punctuation", "]"], + " Searching for applications", + ["punctuation", "."], + " install_path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-09"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "17:25:53"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "WARN"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1034"], + ["punctuation", "]"], + " Failed to read install path", + ["punctuation", "."], + " path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + " error", + ["operator", "="], + "Os ", + ["operator", "{"], + " code", + ["operator", ":"], + ["number", "3"], + ["punctuation", ","], + " kind", + ["operator", ":"], + " NotFound", + ["punctuation", ","], + " message", + ["operator", ":"], + ["string", "\"Das System kann den angegebenen Pfad nicht finden.\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-10"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "12:30:59"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "195"], + ["punctuation", "]"], + " App started", + ["punctuation", "."], + " version", + ["operator", "="], + ["string", "\"1.10.5\""], + + ["punctuation", "["], + ["date", "2020-12-10"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "12:30:59"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1030"], + ["punctuation", "]"], + " Searching for applications", + ["punctuation", "."], + " install_path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-10"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "12:30:59"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "WARN"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1034"], + ["punctuation", "]"], + " Failed to read install path", + ["punctuation", "."], + " path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + " error", + ["operator", "="], + "Os ", + ["operator", "{"], + " code", + ["operator", ":"], + ["number", "3"], + ["punctuation", ","], + " kind", + ["operator", ":"], + " NotFound", + ["punctuation", ","], + " message", + ["operator", ":"], + ["string", "\"Das System kann den angegebenen Pfad nicht finden.\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-10"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "21:42:22"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "195"], + ["punctuation", "]"], + " App started", + ["punctuation", "."], + " version", + ["operator", "="], + ["string", "\"1.10.5\""], + + ["punctuation", "["], + ["date", "2020-12-10"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "21:42:22"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1030"], + ["punctuation", "]"], + " Searching for applications", + ["punctuation", "."], + " install_path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-10"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "21:42:22"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "WARN"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "1034"], + ["punctuation", "]"], + " Failed to read install path", + ["punctuation", "."], + " path", + ["operator", "="], + "AbsolutePath ", + ["operator", "{"], + " path_buf", + ["operator", ":"], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Local\\\\DiscordGames\""], + ["operator", "}"], + " error", + ["operator", "="], + "Os ", + ["operator", "{"], + " code", + ["operator", ":"], + ["number", "3"], + ["punctuation", ","], + " kind", + ["operator", ":"], + " NotFound", + ["punctuation", ","], + " message", + ["operator", ":"], + ["string", "\"Das System kann den angegebenen Pfad nicht finden.\""], + ["operator", "}"], + + ["punctuation", "["], + ["date", "2020-12-11"], + ["punctuation", "]"], + ["punctuation", "["], + ["time", "13:05:13"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DEBUG"], + ["punctuation", "]"], + ["punctuation", "["], + "discord_dispatch", + ["operator", ":"], + ["operator", ":"], + "application_manager", + ["operator", ":"], + ["number", "195"], + ["punctuation", "]"], + " App started", + ["punctuation", "."], + " version", + ["operator", "="], + ["string", "\"1.10.5\""] +] \ No newline at end of file diff --git a/tests/languages/log/_docker.test b/tests/languages/log/_docker.test new file mode 100644 index 0000000000..ff5b5fd552 --- /dev/null +++ b/tests/languages/log/_docker.test @@ -0,0 +1,335 @@ +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.314696100Z" level=info msg="starting containerd" revision=269548fa27e0089a8b8278fc4fc781d7f65a939b version=v1.4.3 +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.314743500Z" level=debug msg="changing OOM score to -500" +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.336716900Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.336891100Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.338482500Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: can't change directory to '4.19.128-microsoft-standard': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1 +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.338523700Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." type=io.containerd.snapshotter.v1 +2021-01-12T13:38:16Z containerd time="2021-01-12T13:38:16.338835400Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." error="path /var/lib/desktop-containerd/daemon/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1 + +2021-03-05T17:58:29Z kmsg (977696) - 2021-03-05T17:58:28.2836488Z: init: (141) ERROR: StartHostListener:356: write failed 32 +2021-03-05T17:58:30Z kmsg (977697) - 2021-03-05T17:58:29.2863708Z: init: (141) ERROR: StartHostListener:356: write failed 32 +2021-03-05T17:58:31Z kmsg (977698) - 2021-03-05T17:58:30.2888998Z: init: (141) ERROR: StartHostListener:356: write failed 32 +2021-03-05T17:58:32Z kmsg (977699) - 2021-03-05T17:58:31.2917718Z: init: (141) ERROR: StartHostListener:356: write failed 32 +2021-03-05T17:58:33Z kmsg (977700) - 2021-03-05T17:58:32.2944488Z: init: (141) ERROR: StartHostListener:356: write failed 32 +2021-03-05T17:58:34Z kmsg (977701) - 2021-03-05T17:58:33.2979438Z: init: (141) ERROR: StartHostListener:356: write failed 32 + +time="2021-01-12T14:38:11+01:00" level=info msg="🍀 socket server listening : \\\\.\\pipe\\dockerGuiToDriver" +time="2021-01-12T14:38:13+01:00" level=info msg="NewSharer: WSL2 engine is enabled so no file sharer is required." +time="2021-01-12T14:38:13+01:00" level=info msg=waitForDockerUp +time="2021-01-12T14:38:13+01:00" level=info msg="🍀 socket server starting : \\\\.\\pipe\\dockerGuiToDriver" + +---------------------------------------------------- + +[ + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.314696100Z\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"starting containerd\""], + " revision", + ["operator", "="], + ["number", "269548fa27e0089a8b8278fc4fc781d7f65a939b"], + " version", + ["operator", "="], + ["number", "v1.4.3"], + + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.314743500Z\""], + " level", + ["operator", "="], + "debug msg", + ["operator", "="], + ["string", "\"changing OOM score to -500\""], + + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.336716900Z\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"loading plugin \\\"io.containerd.content.v1.content\\\"...\""], + " type", + ["operator", "="], + "io", + ["punctuation", "."], + "containerd", + ["punctuation", "."], + "content", + ["punctuation", "."], + "v1\r\n", + + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.336891100Z\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"loading plugin \\\"io.containerd.snapshotter.v1.aufs\\\"...\""], + " type", + ["operator", "="], + "io", + ["punctuation", "."], + "containerd", + ["punctuation", "."], + "snapshotter", + ["punctuation", "."], + "v1\r\n", + + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.338482500Z\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"skip loading plugin \\\"io.containerd.snapshotter.v1.aufs\\\"...\""], + " error", + ["operator", "="], + ["string", "\"aufs is not supported (modprobe aufs failed: exit status 1 \\\"modprobe: can't change directory to '4.19.128-microsoft-standard': No such file or directory\\\\n\\\"): skip plugin\""], + " type", + ["operator", "="], + "io", + ["punctuation", "."], + "containerd", + ["punctuation", "."], + "snapshotter", + ["punctuation", "."], + "v1\r\n", + + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.338523700Z\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"loading plugin \\\"io.containerd.snapshotter.v1.btrfs\\\"...\""], + " type", + ["operator", "="], + "io", + ["punctuation", "."], + "containerd", + ["punctuation", "."], + "snapshotter", + ["punctuation", "."], + "v1\r\n", + + ["date", "2021-01-12T"], + ["time", "13:38:16Z"], + " containerd time", + ["operator", "="], + ["string", "\"2021-01-12T13:38:16.338835400Z\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"skip loading plugin \\\"io.containerd.snapshotter.v1.btrfs\\\"...\""], + " error", + ["operator", "="], + ["string", "\"path /var/lib/desktop-containerd/daemon/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin\""], + " type", + ["operator", "="], + "io", + ["punctuation", "."], + "containerd", + ["punctuation", "."], + "snapshotter", + ["punctuation", "."], + "v1\r\n\r\n", + + ["date", "2021-03-05T"], + ["time", "17:58:29Z"], + " kmsg ", + ["operator", "("], + ["number", "977696"], + ["operator", ")"], + ["operator", "-"], + ["date", "2021-03-05T"], + ["time", "17:58:28.2836488Z"], + ["operator", ":"], + " init", + ["operator", ":"], + ["operator", "("], + ["number", "141"], + ["operator", ")"], + ["level", "ERROR"], + ["operator", ":"], + " StartHostListener", + ["operator", ":"], + ["number", "356"], + ["operator", ":"], + " write failed ", + ["number", "32"], + + ["date", "2021-03-05T"], + ["time", "17:58:30Z"], + " kmsg ", + ["operator", "("], + ["number", "977697"], + ["operator", ")"], + ["operator", "-"], + ["date", "2021-03-05T"], + ["time", "17:58:29.2863708Z"], + ["operator", ":"], + " init", + ["operator", ":"], + ["operator", "("], + ["number", "141"], + ["operator", ")"], + ["level", "ERROR"], + ["operator", ":"], + " StartHostListener", + ["operator", ":"], + ["number", "356"], + ["operator", ":"], + " write failed ", + ["number", "32"], + + ["date", "2021-03-05T"], + ["time", "17:58:31Z"], + " kmsg ", + ["operator", "("], + ["number", "977698"], + ["operator", ")"], + ["operator", "-"], + ["date", "2021-03-05T"], + ["time", "17:58:30.2888998Z"], + ["operator", ":"], + " init", + ["operator", ":"], + ["operator", "("], + ["number", "141"], + ["operator", ")"], + ["level", "ERROR"], + ["operator", ":"], + " StartHostListener", + ["operator", ":"], + ["number", "356"], + ["operator", ":"], + " write failed ", + ["number", "32"], + + ["date", "2021-03-05T"], + ["time", "17:58:32Z"], + " kmsg ", + ["operator", "("], + ["number", "977699"], + ["operator", ")"], + ["operator", "-"], + ["date", "2021-03-05T"], + ["time", "17:58:31.2917718Z"], + ["operator", ":"], + " init", + ["operator", ":"], + ["operator", "("], + ["number", "141"], + ["operator", ")"], + ["level", "ERROR"], + ["operator", ":"], + " StartHostListener", + ["operator", ":"], + ["number", "356"], + ["operator", ":"], + " write failed ", + ["number", "32"], + + ["date", "2021-03-05T"], + ["time", "17:58:33Z"], + " kmsg ", + ["operator", "("], + ["number", "977700"], + ["operator", ")"], + ["operator", "-"], + ["date", "2021-03-05T"], + ["time", "17:58:32.2944488Z"], + ["operator", ":"], + " init", + ["operator", ":"], + ["operator", "("], + ["number", "141"], + ["operator", ")"], + ["level", "ERROR"], + ["operator", ":"], + " StartHostListener", + ["operator", ":"], + ["number", "356"], + ["operator", ":"], + " write failed ", + ["number", "32"], + + ["date", "2021-03-05T"], + ["time", "17:58:34Z"], + " kmsg ", + ["operator", "("], + ["number", "977701"], + ["operator", ")"], + ["operator", "-"], + ["date", "2021-03-05T"], + ["time", "17:58:33.2979438Z"], + ["operator", ":"], + " init", + ["operator", ":"], + ["operator", "("], + ["number", "141"], + ["operator", ")"], + ["level", "ERROR"], + ["operator", ":"], + " StartHostListener", + ["operator", ":"], + ["number", "356"], + ["operator", ":"], + " write failed ", + ["number", "32"], + + "\r\n\r\ntime", + ["operator", "="], + ["string", "\"2021-01-12T14:38:11+01:00\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"🍀 socket server listening : \\\\\\\\.\\\\pipe\\\\dockerGuiToDriver\""], + + "\r\ntime", + ["operator", "="], + ["string", "\"2021-01-12T14:38:13+01:00\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"NewSharer: WSL2 engine is enabled so no file sharer is required.\""], + + "\r\ntime", + ["operator", "="], + ["string", "\"2021-01-12T14:38:13+01:00\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + "waitForDockerUp\r\ntime", + ["operator", "="], + ["string", "\"2021-01-12T14:38:13+01:00\""], + " level", + ["operator", "="], + "info msg", + ["operator", "="], + ["string", "\"🍀 socket server starting : \\\\\\\\.\\\\pipe\\\\dockerGuiToDriver\""] +] \ No newline at end of file diff --git a/tests/languages/log/_hadoop.test b/tests/languages/log/_hadoop.test new file mode 100644 index 0000000000..7d55346f29 --- /dev/null +++ b/tests/languages/log/_hadoop.test @@ -0,0 +1,948 @@ +[2021-07-21 14:07:47.665]Container killed on request. Exit code is 143 +[2021-07-21 14:07:47.746]Container exited with a non-zero exit code 143. + +2021-07-21 14:08:47,137 INFO [main] mapreduce.Job (Job.java:printTaskEvents(1457)) - Task Id : attempt_1626702076395_0052_m_000404_1, Status : FAILED +[2021-07-21 14:07:48.433]Container [pid=33331,containerID=container_e102_1626702076395_0052_01_000877] is running beyond physical memory limits. Current usage: 2.5 GB of 2 GB physical memory used; 4.7 GB of 4.2 GB virtual memory used. Killing container. +Dump of the process-tree for container_e102_1626702076395_0052_01_000877 : + |- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE + |- 33331 33328 33331 33331 (bash) 0 1 7065600 846 /bin/bash -c /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx3072m -Djava.io.tmpdir=/tmp/hadoop/nm-local-dir/usercache/ms26bybu/appcache/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/tmp -Dlog4j.configuration=container-log4j.properties -Dyarn.app.container.log.dir=/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877 -Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog org.apache.hadoop.mapred.YarnChild 141.54.132.64 39863 attempt_1626702076395_0052_m_000404_1 112150186034029 1>/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stdout 2>/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stderr + |- 33340 33331 33331 33331 (java) 5424 755 5028823040 665860 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx3072m -Djava.io.tmpdir=/tmp/hadoop/nm-local-dir/usercache/ms26bybu/appcache/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/tmp -Dlog4j.configuration=container-log4j.properties -Dyarn.app.container.log.dir=/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877 -Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog org.apache.hadoop.mapred.YarnChild 141.54.132.64 39863 attempt_1626702076395_0052_m_000404_1 112150186034029 + +[2021-07-21 14:07:48.611]Container killed on request. Exit code is 143 +[2021-07-21 14:07:48.633]Container exited with a non-zero exit code 143. + +2021-07-21 14:08:47,233 INFO [main] mapreduce.Job (Job.java:monitorAndPrintJob(1431)) - Job job_1626702076395_0052 failed with state FAILED due to: Task failed task_1626702076395_0052_m_000000 +Job failed as tasks failed. failedMaps:1 failedReduces:0 + +2021-07-21 14:08:47,330 INFO [main] mapreduce.Job (Job.java:monitorAndPrintJob(1436)) - Counters: 14 + Job Counters + Failed map tasks=1436 + Killed map tasks=1527 + Killed reduce tasks=1 + Launched map tasks=1816 + Other local map tasks=1218 + Rack-local map tasks=598 + Total time spent by all maps in occupied slots (ms)=119609884 + Total time spent by all reduces in occupied slots (ms)=0 + Total time spent by all map tasks (ms)=59804942 + Total vcore-milliseconds taken by all map tasks=59804942 + Total megabyte-milliseconds taken by all map tasks=122480521216 + Map-Reduce Framework + CPU time spent (ms)=0 + Physical memory (bytes) snapshot=0 + Virtual memory (bytes) snapshot=0 +java.lang.RuntimeException: java.lang.RuntimeException: Job failed. + at org.netspeak.usage.Cli.run(Cli.java:272) + at picocli.CommandLine.executeUserObject(CommandLine.java:1919) + at picocli.CommandLine.access$1200(CommandLine.java:145) + at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2326) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2291) + at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159) + at picocli.CommandLine.execute(CommandLine.java:2058) + at org.netspeak.usage.Cli.main(Cli.java:292) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.apache.hadoop.util.RunJar.run(RunJar.java:239) + at org.apache.hadoop.util.RunJar.main(RunJar.java:153) +Caused by: java.lang.RuntimeException: Job failed. + at org.netspeak.hadoop.Merge.run(Merge.java:124) + at org.netspeak.usage.Cli.runHadoop(Cli.java:239) + at org.netspeak.usage.Cli.runWithExecption(Cli.java:259) + at org.netspeak.usage.Cli.run(Cli.java:270) + ... 14 more + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:47.665"], + ["punctuation", "]"], + "Container killed on request", + ["punctuation", "."], + " Exit code is ", + ["number", "143"], + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:47.746"], + ["punctuation", "]"], + "Container exited with a non", + ["operator", "-"], + "zero exit code ", + ["number", "143"], + ["punctuation", "."], + + ["date", "2021-07-21"], + ["time", "14:08:47,137"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " mapreduce", + ["punctuation", "."], + "Job ", + ["operator", "("], + "Job", + ["punctuation", "."], + "java", + ["operator", ":"], + "printTaskEvents", + ["operator", "("], + ["number", "1457"], + ["operator", ")"], + ["operator", ")"], + ["operator", "-"], + " Task Id ", + ["operator", ":"], + " attempt_1626702076395_0052_m_000404_1", + ["punctuation", ","], + " Status ", + ["operator", ":"], + " FAILED\r\n", + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.433"], + ["punctuation", "]"], + "Container ", + ["punctuation", "["], + "pid", + ["operator", "="], + ["number", "33331"], + ["punctuation", ","], + "containerID", + ["operator", "="], + "container_e102_1626702076395_0052_01_000877", + ["punctuation", "]"], + " is running beyond physical memory limits", + ["punctuation", "."], + " Current usage", + ["operator", ":"], + ["number", "2.5"], + " GB of ", + ["number", "2"], + " GB physical memory used", + ["operator", ";"], + ["number", "4.7"], + " GB of ", + ["number", "4.2"], + " GB virtual memory used", + ["punctuation", "."], + " Killing container", + ["punctuation", "."], + + "\r\nDump of the process", + ["operator", "-"], + "tree for container_e102_1626702076395_0052_01_000877 ", + ["operator", ":"], + + ["operator", "|"], + ["operator", "-"], + " PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME", + ["operator", "("], + "MILLIS", + ["operator", ")"], + " SYSTEM_TIME", + ["operator", "("], + "MILLIS", + ["operator", ")"], + " VMEM_USAGE", + ["operator", "("], + "BYTES", + ["operator", ")"], + " RSSMEM_USAGE", + ["operator", "("], + "PAGES", + ["operator", ")"], + " FULL_CMD_LINE\r\n ", + + ["operator", "|"], + ["operator", "-"], + ["number", "33331"], + ["number", "33328"], + ["number", "33331"], + ["number", "33331"], + ["operator", "("], + "bash", + ["operator", ")"], + ["number", "0"], + ["number", "1"], + ["number", "7065600"], + ["number", "846"], + ["file-path", "/bin/bash"], + ["operator", "-"], + "c ", + ["file-path", "/usr/lib/jvm/java-8-openjdk-amd64/bin/java"], + ["operator", "-"], + "Djava", + ["punctuation", "."], + "net", + ["punctuation", "."], + "preferIPv4Stack", + ["operator", "="], + ["boolean", "true"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "metrics", + ["punctuation", "."], + "log", + ["punctuation", "."], + "level", + ["operator", "="], + ["level", "WARN"], + ["operator", "-"], + "Xmx3072m ", + ["operator", "-"], + "Djava", + ["punctuation", "."], + "io", + ["punctuation", "."], + "tmpdir", + ["operator", "="], + ["operator", "/"], + "tmp", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "nm", + ["operator", "-"], + "local", + ["operator", "-"], + "dir", + ["operator", "/"], + "usercache", + ["operator", "/"], + "ms26bybu", + ["operator", "/"], + "appcache", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877", + ["operator", "/"], + "tmp ", + ["operator", "-"], + "Dlog4j", + ["punctuation", "."], + "configuration", + ["operator", "="], + "container", + ["operator", "-"], + "log4j", + ["punctuation", "."], + "properties ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "dir", + ["operator", "="], + ["operator", "/"], + "opt", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "logs", + ["operator", "/"], + "userlogs", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877 ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "filesize", + ["operator", "="], + ["number", "0"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logger", + ["operator", "="], + ["level", "INFO"], + ["punctuation", ","], + "CLA ", + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logfile", + ["operator", "="], + "syslog org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "mapred", + ["punctuation", "."], + "YarnChild ", + ["ip-address", "141.54.132.64"], + ["number", "39863"], + " attempt_1626702076395_0052_m_000404_1 ", + ["number", "112150186034029"], + ["number", "1"], + ["operator", ">"], + ["file-path", "/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stdout"], + ["number", "2"], + ["operator", ">"], + ["file-path", "/opt/hadoop/logs/userlogs/application_1626702076395_0052/container_e102_1626702076395_0052_01_000877/stderr"], + + ["operator", "|"], + ["operator", "-"], + ["number", "33340"], + ["number", "33331"], + ["number", "33331"], + ["number", "33331"], + ["operator", "("], + "java", + ["operator", ")"], + ["number", "5424"], + ["number", "755"], + ["number", "5028823040"], + ["number", "665860"], + ["file-path", "/usr/lib/jvm/java-8-openjdk-amd64/bin/java"], + ["operator", "-"], + "Djava", + ["punctuation", "."], + "net", + ["punctuation", "."], + "preferIPv4Stack", + ["operator", "="], + ["boolean", "true"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "metrics", + ["punctuation", "."], + "log", + ["punctuation", "."], + "level", + ["operator", "="], + ["level", "WARN"], + ["operator", "-"], + "Xmx3072m ", + ["operator", "-"], + "Djava", + ["punctuation", "."], + "io", + ["punctuation", "."], + "tmpdir", + ["operator", "="], + ["operator", "/"], + "tmp", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "nm", + ["operator", "-"], + "local", + ["operator", "-"], + "dir", + ["operator", "/"], + "usercache", + ["operator", "/"], + "ms26bybu", + ["operator", "/"], + "appcache", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877", + ["operator", "/"], + "tmp ", + ["operator", "-"], + "Dlog4j", + ["punctuation", "."], + "configuration", + ["operator", "="], + "container", + ["operator", "-"], + "log4j", + ["punctuation", "."], + "properties ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "dir", + ["operator", "="], + ["operator", "/"], + "opt", + ["operator", "/"], + "hadoop", + ["operator", "/"], + "logs", + ["operator", "/"], + "userlogs", + ["operator", "/"], + "application_1626702076395_0052", + ["operator", "/"], + "container_e102_1626702076395_0052_01_000877 ", + ["operator", "-"], + "Dyarn", + ["punctuation", "."], + "app", + ["punctuation", "."], + "container", + ["punctuation", "."], + "log", + ["punctuation", "."], + "filesize", + ["operator", "="], + ["number", "0"], + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logger", + ["operator", "="], + ["level", "INFO"], + ["punctuation", ","], + "CLA ", + ["operator", "-"], + "Dhadoop", + ["punctuation", "."], + "root", + ["punctuation", "."], + "logfile", + ["operator", "="], + "syslog org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "mapred", + ["punctuation", "."], + "YarnChild ", + ["ip-address", "141.54.132.64"], + ["number", "39863"], + " attempt_1626702076395_0052_m_000404_1 ", + ["number", "112150186034029"], + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.611"], + ["punctuation", "]"], + "Container killed on request", + ["punctuation", "."], + " Exit code is ", + ["number", "143"], + + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.633"], + ["punctuation", "]"], + "Container exited with a non", + ["operator", "-"], + "zero exit code ", + ["number", "143"], + ["punctuation", "."], + + ["date", "2021-07-21"], + ["time", "14:08:47,233"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " mapreduce", + ["punctuation", "."], + "Job ", + ["operator", "("], + "Job", + ["punctuation", "."], + "java", + ["operator", ":"], + "monitorAndPrintJob", + ["operator", "("], + ["number", "1431"], + ["operator", ")"], + ["operator", ")"], + ["operator", "-"], + " Job job_1626702076395_0052 failed with state FAILED due to", + ["operator", ":"], + " Task failed task_1626702076395_0052_m_000000\r\nJob failed as tasks failed", + ["punctuation", "."], + " failedMaps", + ["operator", ":"], + ["number", "1"], + " failedReduces", + ["operator", ":"], + ["number", "0"], + + ["date", "2021-07-21"], + ["time", "14:08:47,330"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " mapreduce", + ["punctuation", "."], + "Job ", + ["operator", "("], + "Job", + ["punctuation", "."], + "java", + ["operator", ":"], + "monitorAndPrintJob", + ["operator", "("], + ["number", "1436"], + ["operator", ")"], + ["operator", ")"], + ["operator", "-"], + " Counters", + ["operator", ":"], + ["number", "14"], + + "\r\n Job Counters\r\n Failed map tasks", + ["operator", "="], + ["number", "1436"], + + "\r\n Killed map tasks", + ["operator", "="], + ["number", "1527"], + + "\r\n Killed reduce tasks", + ["operator", "="], + ["number", "1"], + + "\r\n Launched map tasks", + ["operator", "="], + ["number", "1816"], + + "\r\n Other local map tasks", + ["operator", "="], + ["number", "1218"], + + "\r\n Rack", + ["operator", "-"], + "local map tasks", + ["operator", "="], + ["number", "598"], + + "\r\n Total time spent by all maps in occupied slots ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "119609884"], + + "\r\n Total time spent by all reduces in occupied slots ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "0"], + + "\r\n Total time spent by all map tasks ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "59804942"], + + "\r\n Total vcore", + ["operator", "-"], + "milliseconds taken by all map tasks", + ["operator", "="], + ["number", "59804942"], + + "\r\n Total megabyte", + ["operator", "-"], + "milliseconds taken by all map tasks", + ["operator", "="], + ["number", "122480521216"], + + "\r\n Map", + ["operator", "-"], + "Reduce Framework\r\n CPU time spent ", + ["operator", "("], + "ms", + ["operator", ")"], + ["operator", "="], + ["number", "0"], + + "\r\n Physical memory ", + ["operator", "("], + "bytes", + ["operator", ")"], + " snapshot", + ["operator", "="], + ["number", "0"], + + "\r\n Virtual memory ", + ["operator", "("], + "bytes", + ["operator", ")"], + " snapshot", + ["operator", "="], + ["number", "0"], + + ["exception", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "RuntimeException", + ["punctuation", ":"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "RuntimeException", + ["punctuation", ":"], + " Job failed", + ["punctuation", "."], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "272", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine", + ["punctuation", "."], + ["function", "executeUserObject"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "1919", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine", + ["punctuation", "."], + ["function", "access$1200"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "145", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$RunLast", + ["punctuation", "."], + ["function", "executeUserObjectOfLastSubcommandWithSameParent"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2332", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$RunLast", + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2326", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$RunLast", + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2291", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$AbstractParseResultHandler", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2159", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2058", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "292", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "NativeMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke0"], + ["punctuation", "("], + "Native Method", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "NativeMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "NativeMethodAccessorImpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "62", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "DelegatingMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "DelegatingMethodAccessorImpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "43", + ["punctuation", ")"], + + ["keyword", "at"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "Method", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "Method", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "498", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."], + "RunJar", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "RunJar", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "239", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."], + "RunJar", + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + "RunJar", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "153", + ["punctuation", ")"], + + "\r\nCaused by", + ["punctuation", ":"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "RuntimeException", + ["punctuation", ":"], + " Job failed", + ["punctuation", "."], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "Merge", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Merge", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "124", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "runHadoop"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "239", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "runWithExecption"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "259", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "270", + ["punctuation", ")"], + + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + " 14 more" + ]] +] diff --git a/tests/languages/log/_java_stack_trace.test b/tests/languages/log/_java_stack_trace.test new file mode 100644 index 0000000000..2eeb1261a7 --- /dev/null +++ b/tests/languages/log/_java_stack_trace.test @@ -0,0 +1,881 @@ +java.net.BindException: Address already in use + at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_171] + at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_171] + at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_171] + at sun.nio.ch.ServeISocketChannelImpl.bind(ServerSocketChannellmpl.java:223) ~[na:1.8.0_171] + +org.apache.maven.lifecycle.LifecycleExecutionException: Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) + at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) + at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) + at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) + at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) + at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) + at org.codehaus.classworlds.Launcher.main(Launcher.java:375) +Caused by: org.apache.maven.plugin.MojoExecutionException: Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:174) + at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) + ... 16 more +Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error installing artifact's metadata: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:102) + at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162) + ... 18 more +Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataDeploymentException: Error while deploying metadata: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:441) + at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:86) + ... 19 more +Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is: 500 + at org.apache.maven.wagon.providers.http.LightweightHttpWagon.put(LightweightHttpWagon.java:172) + at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:237) + at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifactMetadata(DefaultWagonManager.java:162) + at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:437) + ... 20 more + +---------------------------------------------------- + +[ + ["exception", [ + "java", + ["punctuation", "."], + "net", + ["punctuation", "."], + "BindException", + ["punctuation", ":"], + " Address already in use\r\n\t", + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."], + "Net", + ["punctuation", "."], + ["function", "bind0"], + ["punctuation", "("], + "Native Method", + ["punctuation", ")"], + " ~[na", + ["punctuation", ":"], + "1", + ["punctuation", "."], + "8", + ["punctuation", "."], + "0_171]\r\n\t", + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."], + "Net", + ["punctuation", "."], + ["function", "bind"], + ["punctuation", "("], + "Net", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "433", + ["punctuation", ")"], + " ~[na", + ["punctuation", ":"], + "1", + ["punctuation", "."], + "8", + ["punctuation", "."], + "0_171]\r\n\t", + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."], + "Net", + ["punctuation", "."], + ["function", "bind"], + ["punctuation", "("], + "Net", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "425", + ["punctuation", ")"], + " ~[na", + ["punctuation", ":"], + "1", + ["punctuation", "."], + "8", + ["punctuation", "."], + "0_171]\r\n\t", + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "nio", + ["punctuation", "."], + "ch", + ["punctuation", "."], + "ServeISocketChannelImpl", + ["punctuation", "."], + ["function", "bind"], + ["punctuation", "("], + "ServerSocketChannellmpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "223", + ["punctuation", ")"], + " ~[na", + ["punctuation", ":"], + "1", + ["punctuation", "."], + "8", + ["punctuation", "."], + "0_171]" + ]], + + ["exception", [ + "org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "LifecycleExecutionException", + ["punctuation", ":"], + " Error installing artifact's metadata", + ["punctuation", ":"], + " Error while deploying metadata", + ["punctuation", ":"], + " Failed to transfer file", + ["punctuation", ":"], + " http", + ["punctuation", ":"], + "//repo", + ["punctuation", "."], + "xxxx", + ["punctuation", "."], + "com/foo/bar", + ["punctuation", "."], + "pom", + ["punctuation", "."], + " Return code is", + ["punctuation", ":"], + " 500\r\n ", + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "executeGoals"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "564", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "executeGoalWithLifecycle"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "480", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "executeGoal"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "459", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "executeGoalAndHandleFailures"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "311", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "executeTaskSegments"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "278", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "143", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "DefaultMaven", + ["punctuation", "."], + ["function", "doExecute"], + ["punctuation", "("], + "DefaultMaven", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "334", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "DefaultMaven", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "DefaultMaven", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "125", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "cli", + ["punctuation", "."], + "MavenCli", + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + "MavenCli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "280", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "NativeMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke0"], + ["punctuation", "("], + "Native Method", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "NativeMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "NativeMethodAccessorImpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "39", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "DelegatingMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "DelegatingMethodAccessorImpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "25", + ["punctuation", ")"], + + ["keyword", "at"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "Method", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "Method", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "585", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."], + "Launcher", + ["punctuation", "."], + ["function", "launchEnhanced"], + ["punctuation", "("], + "Launcher", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "315", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."], + "Launcher", + ["punctuation", "."], + ["function", "launch"], + ["punctuation", "("], + "Launcher", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "255", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."], + "Launcher", + ["punctuation", "."], + ["function", "mainWithExitCode"], + ["punctuation", "("], + "Launcher", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "430", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "codehaus", + ["punctuation", "."], + "classworlds", + ["punctuation", "."], + "Launcher", + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + "Launcher", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "375", + ["punctuation", ")"], + + "\r\nCaused by", + ["punctuation", ":"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."], + "MojoExecutionException", + ["punctuation", ":"], + " Error installing artifact's metadata", + ["punctuation", ":"], + " Error while deploying metadata", + ["punctuation", ":"], + " Failed to transfer file", + ["punctuation", ":"], + " http", + ["punctuation", ":"], + "//repo", + ["punctuation", "."], + "xxxx", + ["punctuation", "."], + "com/foo/bar", + ["punctuation", "."], + "pom", + ["punctuation", "."], + " Return code is", + ["punctuation", ":"], + " 500\r\n ", + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."], + "deploy", + ["punctuation", "."], + "DeployMojo", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "DeployMojo", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "174", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."], + "DefaultPluginManager", + ["punctuation", "."], + ["function", "executeMojo"], + ["punctuation", "("], + "DefaultPluginManager", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "443", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "lifecycle", + ["punctuation", "."], + "DefaultLifecycleExecutor", + ["punctuation", "."], + ["function", "executeGoals"], + ["punctuation", "("], + "DefaultLifecycleExecutor", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "539", + ["punctuation", ")"], + + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + " 16 more\r\nCaused by", + ["punctuation", ":"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "deployer", + ["punctuation", "."], + "ArtifactDeploymentException", + ["punctuation", ":"], + " Error installing artifact's metadata", + ["punctuation", ":"], + " Error while deploying metadata", + ["punctuation", ":"], + " Failed to transfer file", + ["punctuation", ":"], + " http", + ["punctuation", ":"], + "//repo", + ["punctuation", "."], + "xxxx", + ["punctuation", "."], + "com/foo/bar", + ["punctuation", "."], + "pom", + ["punctuation", "."], + " Return code is", + ["punctuation", ":"], + " 500\r\n ", + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "deployer", + ["punctuation", "."], + "DefaultArtifactDeployer", + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + "DefaultArtifactDeployer", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "102", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "plugin", + ["punctuation", "."], + "deploy", + ["punctuation", "."], + "DeployMojo", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "DeployMojo", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "162", + ["punctuation", ")"], + + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + " 18 more\r\nCaused by", + ["punctuation", ":"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "repository", + ["punctuation", "."], + "metadata", + ["punctuation", "."], + "RepositoryMetadataDeploymentException", + ["punctuation", ":"], + " Error while deploying metadata", + ["punctuation", ":"], + " Failed to transfer file", + ["punctuation", ":"], + " http", + ["punctuation", ":"], + "//repo", + ["punctuation", "."], + "xxxx", + ["punctuation", "."], + "com/foo/bar", + ["punctuation", "."], + "pom", + ["punctuation", "."], + " Return code is", + ["punctuation", ":"], + " 500\r\n ", + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "repository", + ["punctuation", "."], + "metadata", + ["punctuation", "."], + "DefaultRepositoryMetadataManager", + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + "DefaultRepositoryMetadataManager", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "441", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "deployer", + ["punctuation", "."], + "DefaultArtifactDeployer", + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + "DefaultArtifactDeployer", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "86", + ["punctuation", ")"], + + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + " 19 more\r\nCaused by", + ["punctuation", ":"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "wagon", + ["punctuation", "."], + "TransferFailedException", + ["punctuation", ":"], + " Failed to transfer file", + ["punctuation", ":"], + " http", + ["punctuation", ":"], + "//repo", + ["punctuation", "."], + "xxxx", + ["punctuation", "."], + "com/foo/bar", + ["punctuation", "."], + "pom", + ["punctuation", "."], + " Return code is", + ["punctuation", ":"], + " 500\r\n ", + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "wagon", + ["punctuation", "."], + "providers", + ["punctuation", "."], + "http", + ["punctuation", "."], + "LightweightHttpWagon", + ["punctuation", "."], + ["function", "put"], + ["punctuation", "("], + "LightweightHttpWagon", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "172", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "manager", + ["punctuation", "."], + "DefaultWagonManager", + ["punctuation", "."], + ["function", "putRemoteFile"], + ["punctuation", "("], + "DefaultWagonManager", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "237", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "manager", + ["punctuation", "."], + "DefaultWagonManager", + ["punctuation", "."], + ["function", "putArtifactMetadata"], + ["punctuation", "("], + "DefaultWagonManager", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "162", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "maven", + ["punctuation", "."], + "artifact", + ["punctuation", "."], + "repository", + ["punctuation", "."], + "metadata", + ["punctuation", "."], + "DefaultRepositoryMetadataManager", + ["punctuation", "."], + ["function", "deploy"], + ["punctuation", "("], + "DefaultRepositoryMetadataManager", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "437", + ["punctuation", ")"], + + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + " 20 more" + ]] +] diff --git a/tests/languages/log/_minecraft.test b/tests/languages/log/_minecraft.test new file mode 100644 index 0000000000..5b002c4b9a --- /dev/null +++ b/tests/languages/log/_minecraft.test @@ -0,0 +1,416 @@ +[07:28:17] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting minecraft server version 1.12.2 +[07:28:17] [Server thread/INFO] [FML]: MinecraftForge v14.23.5.2847 Initialized +[07:28:17] [Server thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients. +[07:28:18] [Server thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingredient... +[07:28:19] [Server thread/INFO] [FML]: Replaced 1227 ore ingredients +[07:28:19] [Server thread/INFO] [FML]: Searching /home/minecraft/multicraft/servers/server99505/./mods for mods +[07:28:21] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load +[07:28:21] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang +[07:28:21] [Server thread/FATAL] [FML]: net.minecraftforge.fml.common.MissingModsException: Mod thaumcraft (Thaumcraft) requires [baubles@[1.5.2,)] +[07:28:21] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception +net.minecraftforge.fml.common.MissingModsException: Mod thaumcraft (Thaumcraft) requires [baubles@[1.5.2,)] + at net.minecraftforge.fml.common.Loader.sortModList(Loader.java:266) ~[Loader.class:?] + at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:572) ~[Loader.class:?] + at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98) ~[FMLServerHandler.class:?] + at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) ~[FMLCommonHandler.class:?] + at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) ~[nz.class:?] + at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486) [MinecraftServer.class:?] + at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222] + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["time", "07:28:17"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "dedicated", + ["punctuation", "."], + "DedicatedServer", + ["punctuation", "]"], + ["operator", ":"], + " Starting minecraft server version ", + ["number", "1.12.2"], + + ["punctuation", "["], + ["time", "07:28:17"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " MinecraftForge ", + ["number", "v14.23.5.2847"], + " Initialized\r\n", + + ["punctuation", "["], + ["time", "07:28:17"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Starts to replace vanilla recipe ingredients with ore ingredients", + ["punctuation", "."], + + ["punctuation", "["], + ["time", "07:28:18"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Invalid recipe found with multiple oredict ingredients in the same ingredient", + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + + ["punctuation", "["], + ["time", "07:28:19"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Replaced ", + ["number", "1227"], + " ore ingredients\r\n", + + ["punctuation", "["], + ["time", "07:28:19"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Searching ", + ["file-path", "/home/minecraft/multicraft/servers/server99505/./mods"], + " for mods\r\n", + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "INFO"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Forge Mod Loader has identified ", + ["number", "5"], + " mods to load\r\n", + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "WARN"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " Missing English translation for FML", + ["operator", ":"], + " assets", + ["operator", "/"], + "fml", + ["operator", "/"], + "lang", + ["operator", "/"], + "en_us", + ["punctuation", "."], + "lang\r\n", + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "FATAL"], + ["punctuation", "]"], + ["punctuation", "["], + "FML", + ["punctuation", "]"], + ["operator", ":"], + " net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."], + "MissingModsException", + ["operator", ":"], + " Mod thaumcraft ", + ["operator", "("], + "Thaumcraft", + ["operator", ")"], + " requires ", + ["punctuation", "["], + "baubles", + ["operator", "@"], + ["punctuation", "["], + ["number", "1.5.2"], + ["punctuation", ","], + ["operator", ")"], + ["punctuation", "]"], + + ["punctuation", "["], + ["time", "07:28:21"], + ["punctuation", "]"], + ["punctuation", "["], + "Server thread", + ["operator", "/"], + ["level", "ERROR"], + ["punctuation", "]"], + ["punctuation", "["], + "net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "MinecraftServer", + ["punctuation", "]"], + ["operator", ":"], + " Encountered an unexpected exception\r\n", + + ["exception", [ + "net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."], + "MissingModsException", + ["punctuation", ":"], + " Mod thaumcraft ", + ["punctuation", "("], + "Thaumcraft", + ["punctuation", ")"], + " requires [baubles@[1", + ["punctuation", "."], + "5", + ["punctuation", "."], + "2,", + ["punctuation", ")"], + "]\r\n\t", + + ["keyword", "at"], + " net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."], + "Loader", + ["punctuation", "."], + ["function", "sortModList"], + ["punctuation", "("], + "Loader", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "266", + ["punctuation", ")"], + " ~[Loader", + ["punctuation", "."], + "class", + ["punctuation", ":"], + "?]\r\n\t", + + ["keyword", "at"], + " net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."], + "Loader", + ["punctuation", "."], + ["function", "loadMods"], + ["punctuation", "("], + "Loader", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "572", + ["punctuation", ")"], + " ~[Loader", + ["punctuation", "."], + "class", + ["punctuation", ":"], + "?]\r\n\t", + + ["keyword", "at"], + " net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "server", + ["punctuation", "."], + "FMLServerHandler", + ["punctuation", "."], + ["function", "beginServerLoading"], + ["punctuation", "("], + "FMLServerHandler", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "98", + ["punctuation", ")"], + " ~[FMLServerHandler", + ["punctuation", "."], + "class", + ["punctuation", ":"], + "?]\r\n\t", + + ["keyword", "at"], + " net", + ["punctuation", "."], + "minecraftforge", + ["punctuation", "."], + "fml", + ["punctuation", "."], + "common", + ["punctuation", "."], + "FMLCommonHandler", + ["punctuation", "."], + ["function", "onServerStart"], + ["punctuation", "("], + "FMLCommonHandler", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "333", + ["punctuation", ")"], + " ~[FMLCommonHandler", + ["punctuation", "."], + "class", + ["punctuation", ":"], + "?]\r\n\t", + + ["keyword", "at"], + " net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "dedicated", + ["punctuation", "."], + "DedicatedServer", + ["punctuation", "."], + ["function", "func_71197_b"], + ["punctuation", "("], + "DedicatedServer", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "125", + ["punctuation", ")"], + " ~[nz", + ["punctuation", "."], + "class", + ["punctuation", ":"], + "?]\r\n\t", + + ["keyword", "at"], + " net", + ["punctuation", "."], + "minecraft", + ["punctuation", "."], + "server", + ["punctuation", "."], + "MinecraftServer", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "MinecraftServer", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "486", + ["punctuation", ")"], + " [MinecraftServer", + ["punctuation", "."], + "class", + ["punctuation", ":"], + "?]\r\n\t", + + ["keyword", "at"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "Thread", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Thread", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "748", + ["punctuation", ")"], + " [?", + ["punctuation", ":"], + "1", + ["punctuation", "."], + "8", + ["punctuation", "."], + "0_222]" + ]] +] diff --git a/tests/languages/log/_nginx.test b/tests/languages/log/_nginx.test new file mode 100644 index 0000000000..a013ecb971 --- /dev/null +++ b/tests/languages/log/_nginx.test @@ -0,0 +1,141 @@ +47.29.201.179 - - [28/Feb/2019:13:17:10 +0000] "GET /?p=1 HTTP/2.0" 200 5316 "https://domain1.com/?p=1" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" "2.75" + +Mar 19 22:10:18 xxxxxx journal: xxxxxxx.mylabserver.com nginx: photos.example.com 127.0.0.1 - - [19/Mar/2018:22:10:18 +0000] "GET / HTTP/1.1" 200 1863 "-" "curl/7.29.0" "-" +Mar 19 22:10:24 xxxxxxx journal: xxxxxxxx.mylabserver.com nginx: photos.example.com 127.0.0.1 - - [19/Mar/2018:22:10:24 +0000] "GET / HTTP/1.1" 200 53324 "-" "curl/7.29.0" "-" + +TLSv1.2 AES128-SHA 1.1.1.1 "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 2.2.2.2 "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1" +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 3.3.3.3 "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0" +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 4.4.4.4 "Mozilla/5.0 (Android 4.4.2; Tablet; rv:65.0) Gecko/65.0 Firefox/65.0" +TLSv1 AES128-SHA 5.5.5.5 "Mozilla/5.0 (Android 4.4.2; Tablet; rv:65.0) Gecko/65.0 Firefox/65.0" +TLSv1.2 ECDHE-RSA-CHACHA20-POLY1305 6.6.6.6 "Mozilla/5.0 (Linux; U; Android 5.0.2; en-US; XT1068 Build/LXB22.46-28) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.10.2.1164 Mobile Safari/537.36" + +---------------------------------------------------- + +[ + ["ip-address", "47.29.201.179"], + ["separator", "- - "], + ["punctuation", "["], + ["date", "28/Feb/2019"], + ["operator", ":"], + ["time", "13:17:10 +0000"], + ["punctuation", "]"], + ["string", "\"GET /?p=1 HTTP/2.0\""], + ["number", "200"], + ["number", "5316"], + ["string", "\"https://domain1.com/?p=1\""], + ["string", "\"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36\""], + ["string", "\"2.75\""], + + ["date", "Mar 19"], + ["time", "22:10:18"], + " xxxxxx journal", + ["operator", ":"], + ["domain", "xxxxxxx.mylabserver.com"], + " nginx", + ["operator", ":"], + ["domain", "photos.example.com"], + ["ip-address", "127.0.0.1"], + ["separator", "- - "], + ["punctuation", "["], + ["date", "19/Mar/2018"], + ["operator", ":"], + ["time", "22:10:18 +0000"], + ["punctuation", "]"], + ["string", "\"GET / HTTP/1.1\""], + ["number", "200"], + ["number", "1863"], + ["string", "\"-\""], + ["string", "\"curl/7.29.0\""], + ["string", "\"-\""], + + ["date", "Mar 19"], + ["time", "22:10:24"], + " xxxxxxx journal", + ["operator", ":"], + ["domain", "xxxxxxxx.mylabserver.com"], + " nginx", + ["operator", ":"], + ["domain", "photos.example.com"], + ["ip-address", "127.0.0.1"], + ["separator", "- - "], + ["punctuation", "["], + ["date", "19/Mar/2018"], + ["operator", ":"], + ["time", "22:10:24 +0000"], + ["punctuation", "]"], + ["string", "\"GET / HTTP/1.1\""], + ["number", "200"], + ["number", "53324"], + ["string", "\"-\""], + ["string", "\"curl/7.29.0\""], + ["string", "\"-\""], + + "\r\n\r\nTLSv1", + ["punctuation", "."], + "2 AES128", + ["operator", "-"], + "SHA ", + ["ip-address", "1.1.1.1"], + ["string", "\"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0\""], + + "\r\nTLSv1", + ["punctuation", "."], + "2 ECDHE", + ["operator", "-"], + "RSA", + ["operator", "-"], + "AES128", + ["operator", "-"], + "GCM", + ["operator", "-"], + "SHA256 ", + ["ip-address", "2.2.2.2"], + ["string", "\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\""], + + "\r\nTLSv1", + ["punctuation", "."], + "2 ECDHE", + ["operator", "-"], + "RSA", + ["operator", "-"], + "AES128", + ["operator", "-"], + "GCM", + ["operator", "-"], + "SHA256 ", + ["ip-address", "3.3.3.3"], + ["string", "\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0\""], + + "\r\nTLSv1", + ["punctuation", "."], + "2 ECDHE", + ["operator", "-"], + "RSA", + ["operator", "-"], + "AES128", + ["operator", "-"], + "GCM", + ["operator", "-"], + "SHA256 ", + ["ip-address", "4.4.4.4"], + ["string", "\"Mozilla/5.0 (Android 4.4.2; Tablet; rv:65.0) Gecko/65.0 Firefox/65.0\""], + + "\r\nTLSv1 AES128", + ["operator", "-"], + "SHA ", + ["ip-address", "5.5.5.5"], + ["string", "\"Mozilla/5.0 (Android 4.4.2; Tablet; rv:65.0) Gecko/65.0 Firefox/65.0\""], + + "\r\nTLSv1", + ["punctuation", "."], + "2 ECDHE", + ["operator", "-"], + "RSA", + ["operator", "-"], + "CHACHA20", + ["operator", "-"], + "POLY1305 ", + ["ip-address", "6.6.6.6"], + ["string", "\"Mozilla/5.0 (Linux; U; Android 5.0.2; en-US; XT1068 Build/LXB22.46-28) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.10.2.1164 Mobile Safari/537.36\""] +] \ No newline at end of file diff --git a/tests/languages/log/_npm_console.test b/tests/languages/log/_npm_console.test new file mode 100644 index 0000000000..643cc4afd9 --- /dev/null +++ b/tests/languages/log/_npm_console.test @@ -0,0 +1,83 @@ +npm ERR! code E404 +npm ERR! 404 Not Found - GET https://registry.npmjs.org/asdasvsdffafwedsfvfasdfkigpodkfphd - Not found +npm ERR! 404 +npm ERR! 404 'asdasvsdffafwedsfvfasdfkigpodkfphd@latest' is not in the npm registry. +npm ERR! 404 You should bug the author to publish it (or use the name yourself!) +npm ERR! 404 +npm ERR! 404 Note that you can also install from a +npm ERR! 404 tarball, folder, http url, or git url. + +npm ERR! A complete log of this run can be found in: +npm ERR! C:\Users\micha\AppData\Roaming\npm-cache\_logs\2021-03-08T19_15_44_229Z-debug.log + +---------------------------------------------------- + +[ + "npm ", + ["level", "ERR"], + ["operator", "!"], + " code E404\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + " Not Found ", + ["operator", "-"], + " GET ", + ["url", "https://registry.npmjs.org/asdasvsdffafwedsfvfasdfkigpodkfphd"], + ["operator", "-"], + " Not found\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + + "\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + ["string", "'asdasvsdffafwedsfvfasdfkigpodkfphd@latest'"], + " is not in the npm registry", + ["punctuation", "."], + + "\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + " You should bug the author to publish it ", + ["operator", "("], + "or use the name yourself", + ["operator", "!"], + ["operator", ")"], + + "\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + + "\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + " Note that you can also install from a\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["number", "404"], + " tarball", + ["punctuation", ","], + " folder", + ["punctuation", ","], + " http url", + ["punctuation", ","], + " or git url", + ["punctuation", "."], + + "\r\n\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + " A complete log of this run can be found in", + ["operator", ":"], + + "\r\nnpm ", + ["level", "ERR"], + ["operator", "!"], + ["file-path", "C:\\Users\\micha\\AppData\\Roaming\\npm-cache\\_logs\\2021-03-08T19_15_44_229Z-debug.log"] +] \ No newline at end of file diff --git a/tests/languages/log/_npm_log.test b/tests/languages/log/_npm_log.test new file mode 100644 index 0000000000..da8be10bec --- /dev/null +++ b/tests/languages/log/_npm_log.test @@ -0,0 +1,401 @@ +0 info it worked if it ends with ok +1 verbose cli [ +1 verbose cli 'C:\\Program Files\\nodejs\\node.exe', +1 verbose cli 'C:\\Users\\micha\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', +1 verbose cli 'run', +1 verbose cli 'test:aliases' +1 verbose cli ] +2 info using npm@6.14.10 +3 info using node@v14.15.4 +4 verbose run-script [ 'pretest:aliases', 'test:aliases', 'posttest:aliases' ] +5 info lifecycle prismjs@1.23.0~pretest:aliases: prismjs@1.23.0 +6 info lifecycle prismjs@1.23.0~test:aliases: prismjs@1.23.0 +7 verbose lifecycle prismjs@1.23.0~test:aliases: unsafe-perm in lifecycle true +8 verbose lifecycle prismjs@1.23.0~test:aliases: PATH: ... +9 verbose lifecycle prismjs@1.23.0~test:aliases: CWD: C:\Users\micha\Git\prism +10 silly lifecycle prismjs@1.23.0~test:aliases: Args: [ '/d /s /c', 'mocha tests/aliases-test.js' ] +11 silly lifecycle prismjs@1.23.0~test:aliases: Returned: code: 1 signal: null +12 info lifecycle prismjs@1.23.0~test:aliases: Failed to exec test:aliases script +13 verbose stack Error: prismjs@1.23.0 test:aliases: `mocha tests/aliases-test.js` +13 verbose stack Exit status 1 +13 verbose stack at EventEmitter. (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) +13 verbose stack at EventEmitter.emit (events.js:315:20) +13 verbose stack at ChildProcess. (C:\Users\micha\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) +13 verbose stack at ChildProcess.emit (events.js:315:20) +13 verbose stack at maybeClose (internal/child_process.js:1048:16) +13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) +14 verbose pkgid prismjs@1.23.0 +15 verbose cwd C:\Users\micha\Git\prism +16 verbose Windows_NT 10.0.19042 +17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\micha\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "test:aliases" +18 verbose node v14.15.4 +19 verbose npm v6.14.10 +20 error code ELIFECYCLE +21 error errno 1 +22 error prismjs@1.23.0 test:aliases: `mocha tests/aliases-test.js` +22 error Exit status 1 +23 error Failed at the prismjs@1.23.0 test:aliases script. +23 error This is probably not a problem with npm. There is likely additional logging output above. +24 verbose exit [ 1, true ] + +---------------------------------------------------- + +[ + ["number", "0"], + " info it worked if it ends with ok\r\n", + + ["number", "1"], + " verbose cli ", + ["punctuation", "["], + + ["number", "1"], + " verbose cli ", + ["string", "'C:\\\\Program Files\\\\nodejs\\\\node.exe'"], + ["punctuation", ","], + + ["number", "1"], + " verbose cli ", + ["string", "'C:\\\\Users\\\\micha\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js'"], + ["punctuation", ","], + + ["number", "1"], + " verbose cli ", + ["string", "'run'"], + ["punctuation", ","], + + ["number", "1"], + " verbose cli ", + ["string", "'test:aliases'"], + + ["number", "1"], + " verbose cli ", + ["punctuation", "]"], + + ["number", "2"], + " info using npm", + ["operator", "@"], + ["number", "6.14.10"], + + ["number", "3"], + " info using node", + ["operator", "@"], + ["number", "v14.15.4"], + + ["number", "4"], + " verbose run", + ["operator", "-"], + "script ", + ["punctuation", "["], + ["string", "'pretest:aliases'"], + ["punctuation", ","], + ["string", "'test:aliases'"], + ["punctuation", ","], + ["string", "'posttest:aliases'"], + ["punctuation", "]"], + + ["number", "5"], + " info lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "pretest", + ["operator", ":"], + "aliases", + ["operator", ":"], + " prismjs", + ["operator", "@"], + ["number", "1.23.0"], + + ["number", "6"], + " info lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " prismjs", + ["operator", "@"], + ["number", "1.23.0"], + + ["number", "7"], + " verbose lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " unsafe", + ["operator", "-"], + "perm in lifecycle ", + ["boolean", "true"], + + ["number", "8"], + " verbose lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " PATH", + ["operator", ":"], + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + + ["number", "9"], + " verbose lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " CWD", + ["operator", ":"], + ["file-path", "C:\\Users\\micha\\Git\\prism"], + + ["number", "10"], + " silly lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " Args", + ["operator", ":"], + ["punctuation", "["], + ["string", "'/d /s /c'"], + ["punctuation", ","], + ["string", "'mocha tests/aliases-test.js'"], + ["punctuation", "]"], + + ["number", "11"], + " silly lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " Returned", + ["operator", ":"], + " code", + ["operator", ":"], + ["number", "1"], + " signal", + ["operator", ":"], + ["boolean", "null"], + + ["number", "12"], + " info lifecycle prismjs", + ["operator", "@"], + ["number", "1.23.0"], + ["operator", "~"], + "test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " Failed to exec test", + ["operator", ":"], + "aliases script\r\n", + + ["number", "13"], + " verbose stack Error", + ["operator", ":"], + " prismjs", + ["operator", "@"], + ["number", "1.23.0"], + " test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " `mocha tests", + ["operator", "/"], + "aliases", + ["operator", "-"], + "test", + ["punctuation", "."], + "js`\r\n", + + ["number", "13"], + " verbose stack Exit status ", + ["number", "1"], + + ["number", "13"], + " verbose stack at EventEmitter", + ["punctuation", "."], + ["operator", "<"], + "anonymous", + ["operator", ">"], + ["operator", "("], + ["file-path", "C:\\Users\\micha\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\index.js"], + ["operator", ":"], + ["number", "332"], + ["operator", ":"], + ["number", "16"], + ["operator", ")"], + + ["number", "13"], + " verbose stack at EventEmitter", + ["punctuation", "."], + "emit ", + ["operator", "("], + "events", + ["punctuation", "."], + "js", + ["operator", ":"], + ["number", "315"], + ["operator", ":"], + ["number", "20"], + ["operator", ")"], + + ["number", "13"], + " verbose stack at ChildProcess", + ["punctuation", "."], + ["operator", "<"], + "anonymous", + ["operator", ">"], + ["operator", "("], + ["file-path", "C:\\Users\\micha\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\lib\\spawn.js"], + ["operator", ":"], + ["number", "55"], + ["operator", ":"], + ["number", "14"], + ["operator", ")"], + + ["number", "13"], + " verbose stack at ChildProcess", + ["punctuation", "."], + "emit ", + ["operator", "("], + "events", + ["punctuation", "."], + "js", + ["operator", ":"], + ["number", "315"], + ["operator", ":"], + ["number", "20"], + ["operator", ")"], + + ["number", "13"], + " verbose stack at maybeClose ", + ["operator", "("], + "internal", + ["operator", "/"], + "child_process", + ["punctuation", "."], + "js", + ["operator", ":"], + ["number", "1048"], + ["operator", ":"], + ["number", "16"], + ["operator", ")"], + + ["number", "13"], + " verbose stack at Process", + ["punctuation", "."], + "ChildProcess", + ["punctuation", "."], + "_handle", + ["punctuation", "."], + "onexit ", + ["operator", "("], + "internal", + ["operator", "/"], + "child_process", + ["punctuation", "."], + "js", + ["operator", ":"], + ["number", "288"], + ["operator", ":"], + ["number", "5"], + ["operator", ")"], + + ["number", "14"], + " verbose pkgid prismjs", + ["operator", "@"], + ["number", "1.23.0"], + + ["number", "15"], + " verbose cwd ", + ["file-path", "C:\\Users\\micha\\Git\\prism"], + + ["number", "16"], + " verbose Windows_NT ", + ["number", "10.0.19042"], + + ["number", "17"], + " verbose argv ", + ["string", "\"C:\\\\Program Files\\\\nodejs\\\\node.exe\""], + ["string", "\"C:\\\\Users\\\\micha\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js\""], + ["string", "\"run\""], + ["string", "\"test:aliases\""], + + ["number", "18"], + " verbose node ", + ["number", "v14.15.4"], + + ["number", "19"], + " verbose npm ", + ["number", "v6.14.10"], + + ["number", "20"], + " error code ELIFECYCLE\r\n", + + ["number", "21"], + " error errno ", + ["number", "1"], + + ["number", "22"], + " error prismjs", + ["operator", "@"], + ["number", "1.23.0"], + " test", + ["operator", ":"], + "aliases", + ["operator", ":"], + " `mocha tests", + ["operator", "/"], + "aliases", + ["operator", "-"], + "test", + ["punctuation", "."], + "js`\r\n", + + ["number", "22"], + " error Exit status ", + ["number", "1"], + + ["number", "23"], + " error Failed at the prismjs", + ["operator", "@"], + ["number", "1.23.0"], + " test", + ["operator", ":"], + "aliases script", + ["punctuation", "."], + + ["number", "23"], + " error This is probably not a problem with npm", + ["punctuation", "."], + " There is likely additional logging output above", + ["punctuation", "."], + + ["number", "24"], + " verbose exit ", + ["punctuation", "["], + ["number", "1"], + ["punctuation", ","], + ["boolean", "true"], + ["punctuation", "]"] +] \ No newline at end of file diff --git a/tests/languages/log/_table.test b/tests/languages/log/_table.test new file mode 100644 index 0000000000..81ea6811e6 --- /dev/null +++ b/tests/languages/log/_table.test @@ -0,0 +1,523 @@ +00:29:13:356 [14204] | INFO | > Dumping swap chain description: +00:29:13:356 [14204] | INFO | +-----------------------------------------+-----------------------------------------+ +00:29:13:356 [14204] | INFO | | Parameter | Value | +00:29:13:357 [14204] | INFO | +-----------------------------------------+-----------------------------------------+ +00:29:13:357 [14204] | INFO | | flags | 0x4 | +00:29:13:357 [14204] | INFO | | surface | 0000000014A9A320 | +00:29:13:357 [14204] | INFO | | minImageCount | 4 | +00:29:13:357 [14204] | INFO | | imageFormat | VK_FORMAT_B8G8R8A8_UNORM | +00:29:13:358 [14204] | INFO | | imageColorSpace | 0 | +00:29:13:358 [14204] | INFO | | imageExtent | 1280 720 | +00:29:13:358 [14204] | INFO | | imageArrayLayers | 1 | +00:29:13:358 [14204] | INFO | | imageUsage | 0x13 | +00:29:13:358 [14204] | INFO | | imageSharingMode | 0 | +00:29:13:359 [14204] | INFO | | queueFamilyIndexCount | 0 | +00:29:13:359 [14204] | INFO | | preTransform | 0x1 | +00:29:13:359 [14204] | INFO | | compositeAlpha | 0x1 | +00:29:13:359 [14204] | INFO | | presentMode | 0 | +00:29:13:359 [14204] | INFO | | clipped | true | +00:29:13:359 [14204] | INFO | | oldSwapchain | 0000000000000000 | +00:29:13:360 [14204] | INFO | +-----------------------------------------+-----------------------------------------+ + +---------------------------------------------------- + +[ + ["time", "00:29:13:356"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", ">"], + " Dumping swap chain description", + ["operator", ":"], + + ["time", "00:29:13:356"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["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", "-"], + ["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", "+"], + + ["time", "00:29:13:356"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " Parameter ", + ["operator", "|"], + " Value ", + ["operator", "|"], + + ["time", "00:29:13:357"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["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", "-"], + ["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", "+"], + + ["time", "00:29:13:357"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " flags ", + ["operator", "|"], + ["number", "0x4"], + ["operator", "|"], + + ["time", "00:29:13:357"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " surface ", + ["operator", "|"], + ["number", "0000000014A9A320"], + ["operator", "|"], + + ["time", "00:29:13:357"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " minImageCount ", + ["operator", "|"], + ["number", "4"], + ["operator", "|"], + + ["time", "00:29:13:357"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " imageFormat ", + ["operator", "|"], + " VK_FORMAT_B8G8R8A8_UNORM ", + ["operator", "|"], + + ["time", "00:29:13:358"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " imageColorSpace ", + ["operator", "|"], + ["number", "0"], + ["operator", "|"], + + ["time", "00:29:13:358"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " imageExtent ", + ["operator", "|"], + ["number", "1280"], + ["number", "720"], + ["operator", "|"], + + ["time", "00:29:13:358"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " imageArrayLayers ", + ["operator", "|"], + ["number", "1"], + ["operator", "|"], + + ["time", "00:29:13:358"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " imageUsage ", + ["operator", "|"], + ["number", "0x13"], + ["operator", "|"], + + ["time", "00:29:13:358"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " imageSharingMode ", + ["operator", "|"], + ["number", "0"], + ["operator", "|"], + + ["time", "00:29:13:359"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " queueFamilyIndexCount ", + ["operator", "|"], + ["number", "0"], + ["operator", "|"], + + ["time", "00:29:13:359"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " preTransform ", + ["operator", "|"], + ["number", "0x1"], + ["operator", "|"], + + ["time", "00:29:13:359"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " compositeAlpha ", + ["operator", "|"], + ["number", "0x1"], + ["operator", "|"], + + ["time", "00:29:13:359"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " presentMode ", + ["operator", "|"], + ["number", "0"], + ["operator", "|"], + + ["time", "00:29:13:359"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " clipped ", + ["operator", "|"], + ["boolean", "true"], + ["operator", "|"], + + ["time", "00:29:13:359"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["operator", "|"], + ["operator", "|"], + " oldSwapchain ", + ["operator", "|"], + ["number", "0000000000000000"], + ["operator", "|"], + + ["time", "00:29:13:360"], + ["punctuation", "["], + ["number", "14204"], + ["punctuation", "]"], + ["operator", "|"], + ["level", "INFO"], + ["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", "-"], + ["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", "+"] +] \ No newline at end of file diff --git a/tests/languages/log/_tomcat.test b/tests/languages/log/_tomcat.test new file mode 100644 index 0000000000..eb15792251 --- /dev/null +++ b/tests/languages/log/_tomcat.test @@ -0,0 +1,162 @@ +23-Jan-2020 16:05:51.597 INFO [http-nio-8080-exec-9] org.apache.catalina.core.ApplicationContext.log HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' +23-Jan-2020 16:05:51.598 INFO [http-nio-8080-exec-9] org.apache.catalina.core.ApplicationContext.log HTMLManager: init: Global resources are available +23-Jan-2020 16:05:51.606 INFO [http-nio-8080-exec-9] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost' +23-Jan-2020 16:06:11.673 INFO [http-nio-8080-exec-8] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost' +21-Nov-2017 11:15:34.986 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-08046 Found camunda bpm platform configuration in CATALINA_BASE/CATALINA_HOME conf directory [C:\asdasd.xml] at 'file:/C:/asdasd.xml' +21-Nov-2017 11:15:35.310 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-12003 Plugin 'ProcessApplicationEventListenerPlugin' activated on process engine 'default' +21-Nov-2017 11:15:35.319 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-12003 Plugin 'SpinProcessEnginePlugin' activated on process engine 'default' + +---------------------------------------------------- + +[ + ["date", "23-Jan-2020"], + ["time", "16:05:51.597"], + ["level", "INFO"], + ["punctuation", "["], + "http", + ["operator", "-"], + "nio", + ["operator", "-"], + ["number", "8080"], + ["operator", "-"], + "exec", + ["operator", "-"], + ["number", "9"], + ["punctuation", "]"], + ["property", "org.apache.catalina.core.ApplicationContext.log HTMLManager:"], + ["property", "init:"], + " Associated with Deployer ", + ["string", "'Catalina:type=Deployer,host=localhost'"], + + ["date", "23-Jan-2020"], + ["time", "16:05:51.598"], + ["level", "INFO"], + ["punctuation", "["], + "http", + ["operator", "-"], + "nio", + ["operator", "-"], + ["number", "8080"], + ["operator", "-"], + "exec", + ["operator", "-"], + ["number", "9"], + ["punctuation", "]"], + ["property", "org.apache.catalina.core.ApplicationContext.log HTMLManager:"], + ["property", "init:"], + " Global resources are available\r\n", + + ["date", "23-Jan-2020"], + ["time", "16:05:51.606"], + ["level", "INFO"], + ["punctuation", "["], + "http", + ["operator", "-"], + "nio", + ["operator", "-"], + ["number", "8080"], + ["operator", "-"], + "exec", + ["operator", "-"], + ["number", "9"], + ["punctuation", "]"], + ["property", "org.apache.catalina.core.ApplicationContext.log HTMLManager:"], + ["property", "list:"], + " Listing contexts for virtual host ", + ["string", "'localhost'"], + + ["date", "23-Jan-2020"], + ["time", "16:06:11.673"], + ["level", "INFO"], + ["punctuation", "["], + "http", + ["operator", "-"], + "nio", + ["operator", "-"], + ["number", "8080"], + ["operator", "-"], + "exec", + ["operator", "-"], + ["number", "8"], + ["punctuation", "]"], + ["property", "org.apache.catalina.core.ApplicationContext.log HTMLManager:"], + ["property", "list:"], + " Listing contexts for virtual host ", + ["string", "'localhost'"], + + ["date", "21-Nov-2017"], + ["time", "11:15:34.986"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " org", + ["punctuation", "."], + "camunda", + ["punctuation", "."], + "commons", + ["punctuation", "."], + "logging", + ["punctuation", "."], + "BaseLogger", + ["punctuation", "."], + "logInfo ENGINE", + ["operator", "-"], + ["number", "08046"], + " Found camunda bpm platform configuration in CATALINA_BASE", + ["operator", "/"], + "CATALINA_HOME conf directory ", + ["punctuation", "["], + ["file-path", "C:\\asdasd.xml"], + ["punctuation", "]"], + " at ", + ["string", "'file:/C:/asdasd.xml'"], + + ["date", "21-Nov-2017"], + ["time", "11:15:35.310"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " org", + ["punctuation", "."], + "camunda", + ["punctuation", "."], + "commons", + ["punctuation", "."], + "logging", + ["punctuation", "."], + "BaseLogger", + ["punctuation", "."], + "logInfo ENGINE", + ["operator", "-"], + ["number", "12003"], + " Plugin ", + ["string", "'ProcessApplicationEventListenerPlugin'"], + " activated on process engine ", + ["string", "'default'"], + + ["date", "21-Nov-2017"], + ["time", "11:15:35.319"], + ["level", "INFO"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + " org", + ["punctuation", "."], + "camunda", + ["punctuation", "."], + "commons", + ["punctuation", "."], + "logging", + ["punctuation", "."], + "BaseLogger", + ["punctuation", "."], + "logInfo ENGINE", + ["operator", "-"], + ["number", "12003"], + " Plugin ", + ["string", "'SpinProcessEnginePlugin'"], + " activated on process engine ", + ["string", "'default'"] +] \ No newline at end of file diff --git a/tests/languages/log/_windows.test b/tests/languages/log/_windows.test new file mode 100644 index 0000000000..77fd4e210c --- /dev/null +++ b/tests/languages/log/_windows.test @@ -0,0 +1,278 @@ +4/1/2020 14:15:27 - PFRO Error: \??\C:\Windows\system32\spool\DRIVERS\x64\3\New\FXSWZRD.DLL, \??\C:\Windows\system32\spool\DRIVERS\x64\3\FXSWZRD.DLL, 0xc000003a +4/1/2020 14:15:27 - PFRO Error: \??\C:\Windows\system32\spool\DRIVERS\x64\3\New\FXSTIFF.DLL, \??\C:\Windows\system32\spool\DRIVERS\x64\3\FXSTIFF.DLL, 0xc000003a +4/1/2020 14:15:27 - PFRO Error: \??\C:\Windows\system32\spool\DRIVERS\x64\3\New\FXSRES.DLL, \??\C:\Windows\system32\spool\DRIVERS\x64\3\FXSRES.DLL, 0xc000003a +4/1/2020 14:15:27 - PFRO Error: \??\C:\Windows\system32\spool\DRIVERS\x64\3\New\FXSAPI.DLL, \??\C:\Windows\system32\spool\DRIVERS\x64\3\FXSAPI.DLL, 0xc000003a + +AudMig: Device Ids match - {5}.\?hdaudio#func_03&ven_40de&dev_0083&subsys_50de130f&rev_4003#1&13efefe3&0&0004#{6993ad03-95ef-33d0-a2cc-00a0c9322596} opo04/00040002 {2}.\?hdaudio#func_01&ven_40de&dev_0084&subsys_10de310f&rev_1004#2&22efefe2&0&0004#{6994ad04-94ef-32d0-a1cc-00a0c9181396} opo04/00030001 +AudMig: Migrated {a31c434e-df4c-1efd-8010-67d416a840e0},2 property at 3 +AudMig: Migrated {9627b1b9-13ee-5c33-b54c-7b3555c991cc},4 property at 7 +AudMig: Migrated {339abffc-30a7-47ce-af08-68c9a7d74466},22 property at 14 +AudMig: Migrating role and device state from SOFTWAREMicrosoftWindowsCurrentVersionMMDevicesAudioRender{8B3B1D07-43C4-2BB5-B0ED-DCD49D5F3BCC} to SOFTWAREMicrosoftWindowsCurrentVersionMMDevicesAudioRender{C4B8172F-B522-160B-A3A9-180AC778147E} +AudMig: Device Ids match - {5}.\?hdaudio#func_01&ven_40de&dev_0081&subsys_20de310f&rev_2004#2&22efefe1&0&0005#{6993ad02-93ef-31d0-a5cc-00a0c9354396} opo05/00020000 {2}.\?hdaudio#func_03&ven_30de&dev_0081&subsys_30de240f&rev_4002#2&34efefe4&0&0003#{6991ad01-95ef-34d0-a1cc-00a0c9543296} opo03/00050000 +AudMig: Migrated {a51c424e-df5c-4efd-8020-67d126a820e0},1 property at 5 + +---------------------------------------------------- + +[ + ["date", "4/1/2020"], + ["time", "14:15:27"], + ["operator", "-"], + " PFRO Error", + ["operator", ":"], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\New\\FXSWZRD.DLL"], + ["punctuation", ","], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\FXSWZRD.DLL"], + ["punctuation", ","], + ["number", "0xc000003a"], + + ["date", "4/1/2020"], + ["time", "14:15:27"], + ["operator", "-"], + " PFRO Error", + ["operator", ":"], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\New\\FXSTIFF.DLL"], + ["punctuation", ","], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\FXSTIFF.DLL"], + ["punctuation", ","], + ["number", "0xc000003a"], + + ["date", "4/1/2020"], + ["time", "14:15:27"], + ["operator", "-"], + " PFRO Error", + ["operator", ":"], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\New\\FXSRES.DLL"], + ["punctuation", ","], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\FXSRES.DLL"], + ["punctuation", ","], + ["number", "0xc000003a"], + + ["date", "4/1/2020"], + ["time", "14:15:27"], + ["operator", "-"], + " PFRO Error", + ["operator", ":"], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\New\\FXSAPI.DLL"], + ["punctuation", ","], + " \\", + ["operator", "?"], + ["operator", "?"], + "\\", + ["file-path", "C:\\Windows\\system32\\spool\\DRIVERS\\x64\\3\\FXSAPI.DLL"], + ["punctuation", ","], + ["number", "0xc000003a"], + + ["property", "AudMig:"], + " Device Ids match ", + ["operator", "-"], + ["operator", "{"], + ["number", "5"], + ["operator", "}"], + ["punctuation", "."], + "\\", + ["operator", "?"], + "hdaudio", + ["operator", "#"], + "func_03", + ["operator", "&"], + "ven_40de", + ["operator", "&"], + "dev_0083", + ["operator", "&"], + "subsys_50de130f", + ["operator", "&"], + "rev_4003", + ["operator", "#"], + ["number", "1"], + ["operator", "&"], + ["number", "13efefe3"], + ["operator", "&"], + ["number", "0"], + ["operator", "&"], + ["number", "0004"], + ["operator", "#"], + ["operator", "{"], + ["uuid", "6993ad03-95ef-33d0-a2cc-00a0c9322596"], + ["operator", "}"], + " opo04", + ["operator", "/"], + ["number", "00040002"], + ["operator", "{"], + ["number", "2"], + ["operator", "}"], + ["punctuation", "."], + "\\", + ["operator", "?"], + "hdaudio", + ["operator", "#"], + "func_01", + ["operator", "&"], + "ven_40de", + ["operator", "&"], + "dev_0084", + ["operator", "&"], + "subsys_10de310f", + ["operator", "&"], + "rev_1004", + ["operator", "#"], + ["number", "2"], + ["operator", "&"], + ["number", "22efefe2"], + ["operator", "&"], + ["number", "0"], + ["operator", "&"], + ["number", "0004"], + ["operator", "#"], + ["operator", "{"], + ["uuid", "6994ad04-94ef-32d0-a1cc-00a0c9181396"], + ["operator", "}"], + " opo04", + ["operator", "/"], + ["number", "00030001"], + + ["property", "AudMig:"], + " Migrated ", + ["operator", "{"], + ["uuid", "a31c434e-df4c-1efd-8010-67d416a840e0"], + ["operator", "}"], + ["punctuation", ","], + ["number", "2"], + " property at ", + ["number", "3"], + + ["property", "AudMig:"], + " Migrated ", + ["operator", "{"], + ["uuid", "9627b1b9-13ee-5c33-b54c-7b3555c991cc"], + ["operator", "}"], + ["punctuation", ","], + ["number", "4"], + " property at ", + ["number", "7"], + + ["property", "AudMig:"], + " Migrated ", + ["operator", "{"], + ["uuid", "339abffc-30a7-47ce-af08-68c9a7d74466"], + ["operator", "}"], + ["punctuation", ","], + ["number", "22"], + " property at ", + ["number", "14"], + + ["property", "AudMig:"], + " Migrating role and device state from SOFTWAREMicrosoftWindowsCurrentVersionMMDevicesAudioRender", + ["operator", "{"], + ["uuid", "8B3B1D07-43C4-2BB5-B0ED-DCD49D5F3BCC"], + ["operator", "}"], + " to SOFTWAREMicrosoftWindowsCurrentVersionMMDevicesAudioRender", + ["operator", "{"], + ["uuid", "C4B8172F-B522-160B-A3A9-180AC778147E"], + ["operator", "}"], + + ["property", "AudMig:"], + " Device Ids match ", + ["operator", "-"], + ["operator", "{"], + ["number", "5"], + ["operator", "}"], + ["punctuation", "."], + "\\", + ["operator", "?"], + "hdaudio", + ["operator", "#"], + "func_01", + ["operator", "&"], + "ven_40de", + ["operator", "&"], + "dev_0081", + ["operator", "&"], + "subsys_20de310f", + ["operator", "&"], + "rev_2004", + ["operator", "#"], + ["number", "2"], + ["operator", "&"], + ["number", "22efefe1"], + ["operator", "&"], + ["number", "0"], + ["operator", "&"], + ["number", "0005"], + ["operator", "#"], + ["operator", "{"], + ["uuid", "6993ad02-93ef-31d0-a5cc-00a0c9354396"], + ["operator", "}"], + " opo05", + ["operator", "/"], + ["number", "00020000"], + ["operator", "{"], + ["number", "2"], + ["operator", "}"], + ["punctuation", "."], + "\\", + ["operator", "?"], + "hdaudio", + ["operator", "#"], + "func_03", + ["operator", "&"], + "ven_30de", + ["operator", "&"], + "dev_0081", + ["operator", "&"], + "subsys_30de240f", + ["operator", "&"], + "rev_4002", + ["operator", "#"], + ["number", "2"], + ["operator", "&"], + ["number", "34efefe4"], + ["operator", "&"], + ["number", "0"], + ["operator", "&"], + ["number", "0003"], + ["operator", "#"], + ["operator", "{"], + ["uuid", "6991ad01-95ef-34d0-a1cc-00a0c9543296"], + ["operator", "}"], + " opo03", + ["operator", "/"], + ["number", "00050000"], + + ["property", "AudMig:"], + " Migrated ", + ["operator", "{"], + ["uuid", "a51c424e-df5c-4efd-8020-67d126a820e0"], + ["operator", "}"], + ["punctuation", ","], + ["number", "1"], + " property at ", + ["number", "5"] +] \ No newline at end of file diff --git a/tests/languages/log/date_feature.test b/tests/languages/log/date_feature.test new file mode 100644 index 0000000000..d51263fd87 --- /dev/null +++ b/tests/languages/log/date_feature.test @@ -0,0 +1,27 @@ +2020-03-11 +28/Jul/1995 +2017-05-11 +Mar 2 +Apr 26 +Sun Mar 2 +23 SEP 2013 +1/26/2021 +4/1/2020 + +2020-03-23T04:21:20Z + +---------------------------------------------------- + +[ + ["date", "2020-03-11"], + ["date", "28/Jul/1995"], + ["date", "2017-05-11"], + ["date", "Mar 2"], + ["date", "Apr 26"], + ["date", "Sun Mar 2"], + ["date", "23 SEP 2013"], + ["date", "1/26/2021"], + ["date", "4/1/2020"], + + ["date", "2020-03-23T"], ["time", "04:21:20Z"] +] \ No newline at end of file diff --git a/tests/languages/log/email_feature.test b/tests/languages/log/email_feature.test new file mode 100644 index 0000000000..19ffd0e285 --- /dev/null +++ b/tests/languages/log/email_feature.test @@ -0,0 +1,10 @@ +foo.bar@mail.com ... + +---------------------------------------------------- + +[ + ["email", "foo.bar@mail.com"], + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."] +] diff --git a/tests/languages/log/exception_feature.test b/tests/languages/log/exception_feature.test new file mode 100644 index 0000000000..d62c42a177 --- /dev/null +++ b/tests/languages/log/exception_feature.test @@ -0,0 +1,372 @@ +[2021-07-21 14:07:48.633] ERR java.lang.RuntimeException: java.lang.RuntimeException: Job failed. + at org.netspeak.usage.Cli.run(Cli.java:272) + at picocli.CommandLine.executeUserObject(CommandLine.java:1919) + at picocli.CommandLine.access$1200(CommandLine.java:145) + at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2326) + at picocli.CommandLine$RunLast.handle(CommandLine.java:2291) + at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159) + at picocli.CommandLine.execute(CommandLine.java:2058) + at org.netspeak.usage.Cli.main(Cli.java:292) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.apache.hadoop.util.RunJar.run(RunJar.java:239) + at org.apache.hadoop.util.RunJar.main(RunJar.java:153) +Caused by: java.lang.RuntimeException: Job failed. + at org.netspeak.hadoop.Merge.run(Merge.java:124) + at org.netspeak.usage.Cli.runHadoop(Cli.java:239) + at org.netspeak.usage.Cli.runWithExecption(Cli.java:259) + at org.netspeak.usage.Cli.run(Cli.java:270) + ... 14 more + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["date", "2021-07-21"], + ["time", "14:07:48.633"], + ["punctuation", "]"], + ["level", "ERR"], + ["exception", [ + "java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "RuntimeException", + ["punctuation", ":"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "RuntimeException", + ["punctuation", ":"], + " Job failed", + ["punctuation", "."], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "272", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine", + ["punctuation", "."], + ["function", "executeUserObject"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "1919", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine", + ["punctuation", "."], + ["function", "access$1200"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "145", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$RunLast", + ["punctuation", "."], + ["function", "executeUserObjectOfLastSubcommandWithSameParent"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2332", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$RunLast", + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2326", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$RunLast", + ["punctuation", "."], + ["function", "handle"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2291", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine$AbstractParseResultHandler", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2159", + ["punctuation", ")"], + + ["keyword", "at"], + " picocli", + ["punctuation", "."], + "CommandLine", + ["punctuation", "."], + ["function", "execute"], + ["punctuation", "("], + "CommandLine", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "2058", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "292", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "NativeMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke0"], + ["punctuation", "("], + "Native Method", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "NativeMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "NativeMethodAccessorImpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "62", + ["punctuation", ")"], + + ["keyword", "at"], + " sun", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "DelegatingMethodAccessorImpl", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "DelegatingMethodAccessorImpl", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "43", + ["punctuation", ")"], + + ["keyword", "at"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "reflect", + ["punctuation", "."], + "Method", + ["punctuation", "."], + ["function", "invoke"], + ["punctuation", "("], + "Method", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "498", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."], + "RunJar", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "RunJar", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "239", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "apache", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "util", + ["punctuation", "."], + "RunJar", + ["punctuation", "."], + ["function", "main"], + ["punctuation", "("], + "RunJar", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "153", + ["punctuation", ")"], + + "\r\nCaused by", + ["punctuation", ":"], + " java", + ["punctuation", "."], + "lang", + ["punctuation", "."], + "RuntimeException", + ["punctuation", ":"], + " Job failed", + ["punctuation", "."], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "hadoop", + ["punctuation", "."], + "Merge", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Merge", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "124", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "runHadoop"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "239", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "runWithExecption"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "259", + ["punctuation", ")"], + + ["keyword", "at"], + " org", + ["punctuation", "."], + "netspeak", + ["punctuation", "."], + "usage", + ["punctuation", "."], + "Cli", + ["punctuation", "."], + ["function", "run"], + ["punctuation", "("], + "Cli", + ["punctuation", "."], + "java", + ["punctuation", ":"], + "270", + ["punctuation", ")"], + + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."], + " 14 more" + ]] +] diff --git a/tests/languages/log/hash_feature.test b/tests/languages/log/hash_feature.test new file mode 100644 index 0000000000..67618e11b5 --- /dev/null +++ b/tests/languages/log/hash_feature.test @@ -0,0 +1,9 @@ +A3DCB4D229DE6FDE0DB5686DEE47145D +0c5259c3dd0a7c46f4835221645f62a0638c9b9faa02af08676e8069e1ff964b + +---------------------------------------------------- + +[ + ["hash", "A3DCB4D229DE6FDE0DB5686DEE47145D"], + ["hash", "0c5259c3dd0a7c46f4835221645f62a0638c9b9faa02af08676e8069e1ff964b"] +] \ No newline at end of file diff --git a/tests/languages/log/level_feature.test b/tests/languages/log/level_feature.test new file mode 100644 index 0000000000..0ea1163dbd --- /dev/null +++ b/tests/languages/log/level_feature.test @@ -0,0 +1,67 @@ +ALERT +CRIT +CRITICAL +EMERG +EMERGENCY +ERR +ERROR +FAILURE +FATAL +SEVERE + +WARN +WARNING +WRN + +DISPLAY +INFO +INF +NOTICE +STATUS + +DBG +DEBUG +FINE + +FINER +FINEST +TRACE +TRC +VERBOSE +VRB + +---------------------------------------------------- + +[ + ["level", "ALERT"], + ["level", "CRIT"], + ["level", "CRITICAL"], + ["level", "EMERG"], + ["level", "EMERGENCY"], + ["level", "ERR"], + ["level", "ERROR"], + ["level", "FAILURE"], + ["level", "FATAL"], + ["level", "SEVERE"], + + ["level", "WARN"], + ["level", "WARNING"], + ["level", "WRN"], + + ["level", "DISPLAY"], + ["level", "INFO"], + ["level", "INF"], + ["level", "NOTICE"], + ["level", "STATUS"], + + ["level", "DBG"], + ["level", "DEBUG"], + ["level", "FINE"], + + ["level", "FINER"], + ["level", "FINEST"], + ["level", "TRACE"], + ["level", "TRC"], + ["level", "VERBOSE"], + ["level", "VRB"] +] diff --git a/tests/languages/log/mac-address_feature.test b/tests/languages/log/mac-address_feature.test new file mode 100644 index 0000000000..24424a2afd --- /dev/null +++ b/tests/languages/log/mac-address_feature.test @@ -0,0 +1,7 @@ +01:23:45:67:89:ab + +---------------------------------------------------- + +[ + ["mac-address", "01:23:45:67:89:ab"] +] diff --git a/tests/languages/log/number_feature.test b/tests/languages/log/number_feature.test new file mode 100644 index 0000000000..39740e1ab9 --- /dev/null +++ b/tests/languages/log/number_feature.test @@ -0,0 +1,41 @@ +123 +213.456 +0000000014A9A320 + +0xff +0x3000 +0b01010 +0o777 + +1.2 +v1.2 +v1.2.3 + +32ms +3.70GHz +0.000000s +59.951Hz +1TB + +---------------------------------------------------- + +[ + ["number", "123"], + ["number", "213.456"], + ["number", "0000000014A9A320"], + + ["number", "0xff"], + ["number", "0x3000"], + ["number", "0b01010"], + ["number", "0o777"], + + ["number", "1.2"], + ["number", "v1.2"], + ["number", "v1.2.3"], + + ["number", "32ms"], + ["number", "3.70GHz"], + ["number", "0.000000s"], + ["number", "59.951Hz"], + ["number", "1TB"] +] \ No newline at end of file diff --git a/tests/languages/log/path_feature.test b/tests/languages/log/path_feature.test new file mode 100644 index 0000000000..01221a4fc6 --- /dev/null +++ b/tests/languages/log/path_feature.test @@ -0,0 +1,34 @@ +c:/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg +C:\stuff\workspace\quickpoll\quickpollEJB\pom.xml +C:\WINDOWS\system32\DRIVERS\storahci.sys + +/USR/SBIN/CRON +/etc/ppp/ip-down + +/usr/share/doc/tama/examples/tama-nanny.exp 2>/dev/null >/dev/null + +/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14 + +---------------------------------------------------- + +[ + ["file-path", "c:/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg"], + ["file-path", "C:\\stuff\\workspace\\quickpoll\\quickpollEJB\\pom.xml"], + ["file-path", "C:\\WINDOWS\\system32\\DRIVERS\\storahci.sys"], + + ["file-path", "/USR/SBIN/CRON"], + ["file-path", "/etc/ppp/ip-down"], + + ["file-path", "/usr/share/doc/tama/examples/tama-nanny.exp"], + ["number", "2"], + ["operator", ">"], + ["file-path", "/dev/null"], + ["operator", ">"], + ["file-path", "/dev/null"], + + ["file-path", "/usr/local/lib/node_modules/npm/lib/utils/spawn.js"], + ["operator", ":"], + ["number", "24"], + ["operator", ":"], + ["number", "14"] +] \ No newline at end of file diff --git a/tests/languages/log/property_feature.test b/tests/languages/log/property_feature.test new file mode 100644 index 0000000000..dfe4784759 --- /dev/null +++ b/tests/languages/log/property_feature.test @@ -0,0 +1,100 @@ +[1119/000645.591:ERROR:process_info.cc(329)] VirtualQueryEx: Zugriff verweigert (0x5) + +Video: + Renderer: Vulkan + Resolution: 1280x720 + Aspect ratio: 16:9 + Frame limit: Auto + Vulkan: + Adapter: GeForce GTX 1080 Ti + Force FIFO present mode: false + Force primitive restart flag: false + Force Disable Exclusive Fullscreen Mode: false + Performance Overlay: + Enabled: false + Enable Framerate Graph: false + Enable Frametime Graph: false + Detail level: Medium + Metrics update interval (ms): 350 + Font size (px): 10 + Body Color (hex): "#FFE138FF" + Body Background (hex): "#002339FF" + Title Color (hex): "#F26C24FF" + Title Background (hex): "#00000000" + Shader Compilation Hint: + Position X (px): 20 + Position Y (px): 690 + +[2020-06-11 16:12:02.642] [DISPLAY] [Main ] [main] Build type: FMB + +Min/Max Sample Rate: 100, 200000 + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["number", "1119"], + ["operator", "/"], + ["number", "000645.591"], + ["operator", ":"], + ["level", "ERROR"], + ["operator", ":"], + "process_info", + ["punctuation", "."], + "cc", + ["operator", "("], + ["number", "329"], + ["operator", ")"], + ["punctuation", "]"], + ["property", "VirtualQueryEx:"], + " Zugriff verweigert ", + ["operator", "("], + ["number", "0x5"], + ["operator", ")"], + + ["property", "Video:"], + ["property", "Renderer:"], " Vulkan\r\n ", + ["property", "Resolution:"], " 1280x720\r\n ", + ["property", "Aspect ratio:"], ["number", "16"], ["operator", ":"], ["number", "9"], + ["property", "Frame limit:"], " Auto\r\n ", + ["property", "Vulkan:"], + ["property", "Adapter:"], " GeForce GTX ", ["number", "1080"], " Ti\r\n ", + ["property", "Force FIFO present mode:"], ["boolean", "false"], + ["property", "Force primitive restart flag:"], ["boolean", "false"], + ["property", "Force Disable Exclusive Fullscreen Mode:"], ["boolean", "false"], + ["property", "Performance Overlay:"], + ["property", "Enabled:"], ["boolean", "false"], + ["property", "Enable Framerate Graph:"], ["boolean", "false"], + ["property", "Enable Frametime Graph:"], ["boolean", "false"], + ["property", "Detail level:"], " Medium\r\n ", + ["property", "Metrics update interval (ms):"], ["number", "350"], + ["property", "Font size (px):"], ["number", "10"], + ["property", "Body Color (hex):"], ["string", "\"#FFE138FF\""], + ["property", "Body Background (hex):"], ["string", "\"#002339FF\""], + ["property", "Title Color (hex):"], ["string", "\"#F26C24FF\""], + ["property", "Title Background (hex):"], ["string", "\"#00000000\""], + ["property", "Shader Compilation Hint:"], + ["property", "Position X (px):"], ["number", "20"], + ["property", "Position Y (px):"], ["number", "690"], + + ["punctuation", "["], + ["date", "2020-06-11"], + ["time", "16:12:02.642"], + ["punctuation", "]"], + ["punctuation", "["], + ["level", "DISPLAY"], + ["punctuation", "]"], + ["punctuation", "["], + "Main ", + ["punctuation", "]"], + ["punctuation", "["], + "main", + ["punctuation", "]"], + ["property", "Build type:"], + " FMB\r\n\r\n", + + ["property", "Min/Max Sample Rate:"], + ["number", "100"], + ["punctuation", ","], + ["number", "200000"] +] \ No newline at end of file diff --git a/tests/languages/log/separator_feature.test b/tests/languages/log/separator_feature.test new file mode 100644 index 0000000000..ddc0fd2243 --- /dev/null +++ b/tests/languages/log/separator_feature.test @@ -0,0 +1,50 @@ +----- + +sysadm.bda.nasa.gov - - [28/Jul/1995:13:30:20 -0400] "GET /elv/endba11.gif HTTP/1.0" 200 306 + +2017-05-11 15:05:28.889 INFO 30284 --- [ost-staItStop-1] o.s.web.context.ContextLoadeI : Root WebApplicationContext: initialization completed in 911 ms + +---------------------------------------------------- + +[ + ["separator", "-----"], + + ["domain", "sysadm.bda.nasa.gov"], + ["separator", "- - "], + ["punctuation", "["], + ["date", "28/Jul/1995"], + ["operator", ":"], + ["time", "13:30:20 -0400"], + ["punctuation", "]"], + ["string", "\"GET /elv/endba11.gif HTTP/1.0\""], + ["number", "200"], + ["number", "306"], + + ["date", "2017-05-11"], + ["time", "15:05:28.889"], + ["level", "INFO"], + ["number", "30284"], + ["separator", "---"], + ["punctuation", "["], + "ost", + ["operator", "-"], + "staItStop", + ["operator", "-"], + ["number", "1"], + ["punctuation", "]"], + " o", + ["punctuation", "."], + "s", + ["punctuation", "."], + "web", + ["punctuation", "."], + "context", + ["punctuation", "."], + "ContextLoadeI ", + ["operator", ":"], + " Root WebApplicationContext", + ["operator", ":"], + " initialization completed in ", + ["number", "911"], + " ms" +] \ No newline at end of file diff --git a/tests/languages/log/string_feature.test b/tests/languages/log/string_feature.test new file mode 100644 index 0000000000..76ae838cb5 --- /dev/null +++ b/tests/languages/log/string_feature.test @@ -0,0 +1,39 @@ +"GET /history/apollo/images/apollo-log01.gif HTTP/1.0" +"{[/],methods=[GET]}" + +TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 2.2.2.2 "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1" + +13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" + +This isn't a string but this is: 'string' + +---------------------------------------------------- + +[ + ["string", "\"GET /history/apollo/images/apollo-log01.gif HTTP/1.0\""], + ["string", "\"{[/],methods=[GET]}\""], + + "\r\n\r\nTLSv1", + ["punctuation", "."], + "2 ECDHE", + ["operator", "-"], + "RSA", + ["operator", "-"], + "AES128", + ["operator", "-"], + "GCM", + ["operator", "-"], + "SHA256 ", + ["ip-address", "2.2.2.2"], + ["string", "\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\""], + + ["number", "13"], + " error argv ", + ["string", "\"/usr/local/bin/node\""], + ["string", "\"/usr/local/bin/npm\""], + ["string", "\"start\""], + + "\r\n\r\nThis isn't a string but this is", + ["operator", ":"], + ["string", "'string'"] +] \ No newline at end of file diff --git a/tests/languages/log/time_feature.test b/tests/languages/log/time_feature.test new file mode 100644 index 0000000000..0e88f3422f --- /dev/null +++ b/tests/languages/log/time_feature.test @@ -0,0 +1,25 @@ +9:52:58 +15:05:28.889 +19:38:12,729 +00:29:13:038 +13:30:12 + +13:30:19 -0400 +13:30:15 +9400 + +2020-03-23T04:21:20Z + +---------------------------------------------------- + +[ + ["time", "9:52:58"], + ["time", "15:05:28.889"], + ["time", "19:38:12,729"], + ["time", "00:29:13:038"], + ["time", "13:30:12"], + + ["time", "13:30:19 -0400"], + ["time", "13:30:15 +9400"], + + ["date", "2020-03-23T"], ["time", "04:21:20Z"] +] \ No newline at end of file diff --git a/tests/languages/log/url_feature.test b/tests/languages/log/url_feature.test new file mode 100644 index 0000000000..4562b7645d --- /dev/null +++ b/tests/languages/log/url_feature.test @@ -0,0 +1,30 @@ +http://66.140.25.157:802/ +file://c:/repository + +Foo + +- Mapping virtual host: http://download.spinetix.com/spxjslibs + +Failed to transfer file: http://repo.xxxx.com/foo/bar.pom. Return code is + +---------------------------------------------------- + +[ + ["url", "http://66.140.25.157:802/"], + ["url", "file://c:/repository"], + + "\r\n\r\nFoo ", + ["operator", "<"], + ["url", "https://foo.bar/contact.html"], + ["operator", ">"], + + ["operator", "-"], + " Mapping virtual host", + ["operator", ":"], + ["url", "http://download.spinetix.com/spxjslibs"], + + ["property", "Failed to transfer file:"], + ["url", "http://repo.xxxx.com/foo/bar.pom"], + ["punctuation", "."], + " Return code is" +] \ No newline at end of file diff --git a/tests/languages/log/uuid_feature.test b/tests/languages/log/uuid_feature.test new file mode 100644 index 0000000000..cf7a1716e0 --- /dev/null +++ b/tests/languages/log/uuid_feature.test @@ -0,0 +1,9 @@ +86695F12-340E-4F04-9FD3-9253DD327460 +F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB + +---------------------------------------------------- + +[ + ["uuid", "86695F12-340E-4F04-9FD3-9253DD327460"], + ["uuid", "F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB"] +] \ No newline at end of file diff --git a/tests/languages/lolcode/punctuation_feature.test b/tests/languages/lolcode/punctuation_feature.test new file mode 100644 index 0000000000..3b865b7bec --- /dev/null +++ b/tests/languages/lolcode/punctuation_feature.test @@ -0,0 +1,10 @@ +... … , ! + +---------------------------------------------------- + +[ + ["punctuation", "..."], + ["punctuation", "…"], + ["punctuation", ","], + ["punctuation", "!"] +] diff --git a/tests/languages/lolcode/string_feature.test b/tests/languages/lolcode/string_feature.test index e3a25a9cda..67555db892 100644 --- a/tests/languages/lolcode/string_feature.test +++ b/tests/languages/lolcode/string_feature.test @@ -2,6 +2,8 @@ "foobar" "fo:"o" "foo:)bar:>baz" +"foo:(FF)baz" +"foo:[bar]baz" "foo:{bar}baz" "foo BTW bar" BTW and out @@ -9,12 +11,15 @@ [ ["string", ["\"\""]], + ["string", ["\"foobar\""]], + ["string", [ "\"fo", ["symbol", ":\""], "o\"" ]], + ["string", [ "\"foo", ["symbol", ":)"], @@ -22,15 +27,29 @@ ["symbol", ":>"], "baz\"" ]], + + ["string", [ + "\"foo", + ["symbol", ":(FF)"], + "baz\"" + ]], + + ["string", [ + "\"foo", + ["symbol", ":[bar]"], + "baz\"" + ]], + ["string", [ "\"foo", ["variable", ":{bar}"], "baz\"" ]], + ["string", ["\"foo BTW bar\""]], ["comment", "BTW and out"] ] ---------------------------------------------------- -Checks for strings, with variables and symbols in them. \ No newline at end of file +Checks for strings, with variables and symbols in them. diff --git a/tests/languages/magma/boolean_feature.test b/tests/languages/magma/boolean_feature.test new file mode 100644 index 0000000000..d342140d7b --- /dev/null +++ b/tests/languages/magma/boolean_feature.test @@ -0,0 +1,9 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] diff --git a/tests/languages/magma/comment_feature.test b/tests/languages/magma/comment_feature.test new file mode 100644 index 0000000000..861791f743 --- /dev/null +++ b/tests/languages/magma/comment_feature.test @@ -0,0 +1,13 @@ +// comment + +/* + comment + */ + +---------------------------------------------------- + +[ + ["comment", "// comment"], + + ["comment", "/*\r\n comment\r\n */"] +] diff --git a/tests/languages/magma/generator_feature.test b/tests/languages/magma/generator_feature.test new file mode 100644 index 0000000000..2e1728c8d4 --- /dev/null +++ b/tests/languages/magma/generator_feature.test @@ -0,0 +1,36 @@ +G := Group; + +---------------------------------------------------- + +[ + ["generator", "G"], + ["punctuation", "<"], + "a", + ["punctuation", ","], + " b", + ["punctuation", ">"], + ["operator", ":="], + ["generator", "Group"], + ["punctuation", "<"], + "a", + ["punctuation", ","], + " b ", + ["operator", "|"], + " a", + ["operator", "^"], + ["number", "2"], + ["operator", "="], + " b", + ["operator", "^"], + ["number", "3"], + ["operator", "="], + " a", + ["operator", "^"], + "b", + ["operator", "*"], + "b", + ["operator", "^"], + ["number", "2"], + ["punctuation", ">"], + ["punctuation", ";"] +] diff --git a/tests/languages/magma/keyword_feature.test b/tests/languages/magma/keyword_feature.test new file mode 100644 index 0000000000..7cdc58cdb3 --- /dev/null +++ b/tests/languages/magma/keyword_feature.test @@ -0,0 +1,177 @@ +_; +adj; +and; +assert; +assert2; +assert3; +assigned; +break; +by; +case; +cat; +catch; +clear; +cmpeq; +cmpne; +continue; +declare; +default; +delete; +diff; +div; +do; +elif; +else; +end; +eq; +error; +eval; +exists; +exit; +for; +forall; +forward; +fprintf; +freeze; +function; +ge; +gt; +if; +iload; +import; +in; +intrinsic; +is; +join; +le; +load; +local; +lt; +meet; +mod; +ne; +not; +notadj; +notin; +notsubset; +or; +print; +printf; +procedure; +quit; +random; +read; +readi; +repeat; +require; +requirege; +requirerange; +restore; +return; +save; +sdiff; +select; +subset; +then; +time; +to; +try; +until; +vprint; +vprintf; +vtime; +when; +where; +while; +xor; + +---------------------------------------------------- + +[ + ["keyword", "_"], ["punctuation", ";"], + ["keyword", "adj"], ["punctuation", ";"], + ["keyword", "and"], ["punctuation", ";"], + ["keyword", "assert"], ["punctuation", ";"], + ["keyword", "assert2"], ["punctuation", ";"], + ["keyword", "assert3"], ["punctuation", ";"], + ["keyword", "assigned"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "by"], ["punctuation", ";"], + ["keyword", "case"], ["punctuation", ";"], + ["keyword", "cat"], ["punctuation", ";"], + ["keyword", "catch"], ["punctuation", ";"], + ["keyword", "clear"], ["punctuation", ";"], + ["keyword", "cmpeq"], ["punctuation", ";"], + ["keyword", "cmpne"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "declare"], ["punctuation", ";"], + ["keyword", "default"], ["punctuation", ";"], + ["keyword", "delete"], ["punctuation", ";"], + ["keyword", "diff"], ["punctuation", ";"], + ["keyword", "div"], ["punctuation", ";"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "elif"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "end"], ["punctuation", ";"], + ["keyword", "eq"], ["punctuation", ";"], + ["keyword", "error"], ["punctuation", ";"], + ["keyword", "eval"], ["punctuation", ";"], + ["keyword", "exists"], ["punctuation", ";"], + ["keyword", "exit"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "forall"], ["punctuation", ";"], + ["keyword", "forward"], ["punctuation", ";"], + ["keyword", "fprintf"], ["punctuation", ";"], + ["keyword", "freeze"], ["punctuation", ";"], + ["keyword", "function"], ["punctuation", ";"], + ["keyword", "ge"], ["punctuation", ";"], + ["keyword", "gt"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "iload"], ["punctuation", ";"], + ["keyword", "import"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "intrinsic"], ["punctuation", ";"], + ["keyword", "is"], ["punctuation", ";"], + ["keyword", "join"], ["punctuation", ";"], + ["keyword", "le"], ["punctuation", ";"], + ["keyword", "load"], ["punctuation", ";"], + ["keyword", "local"], ["punctuation", ";"], + ["keyword", "lt"], ["punctuation", ";"], + ["keyword", "meet"], ["punctuation", ";"], + ["keyword", "mod"], ["punctuation", ";"], + ["keyword", "ne"], ["punctuation", ";"], + ["keyword", "not"], ["punctuation", ";"], + ["keyword", "notadj"], ["punctuation", ";"], + ["keyword", "notin"], ["punctuation", ";"], + ["keyword", "notsubset"], ["punctuation", ";"], + ["keyword", "or"], ["punctuation", ";"], + ["keyword", "print"], ["punctuation", ";"], + ["keyword", "printf"], ["punctuation", ";"], + ["keyword", "procedure"], ["punctuation", ";"], + ["keyword", "quit"], ["punctuation", ";"], + ["keyword", "random"], ["punctuation", ";"], + ["keyword", "read"], ["punctuation", ";"], + ["keyword", "readi"], ["punctuation", ";"], + ["keyword", "repeat"], ["punctuation", ";"], + ["keyword", "require"], ["punctuation", ";"], + ["keyword", "requirege"], ["punctuation", ";"], + ["keyword", "requirerange"], ["punctuation", ";"], + ["keyword", "restore"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "save"], ["punctuation", ";"], + ["keyword", "sdiff"], ["punctuation", ";"], + ["keyword", "select"], ["punctuation", ";"], + ["keyword", "subset"], ["punctuation", ";"], + ["keyword", "then"], ["punctuation", ";"], + ["keyword", "time"], ["punctuation", ";"], + ["keyword", "to"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "until"], ["punctuation", ";"], + ["keyword", "vprint"], ["punctuation", ";"], + ["keyword", "vprintf"], ["punctuation", ";"], + ["keyword", "vtime"], ["punctuation", ";"], + ["keyword", "when"], ["punctuation", ";"], + ["keyword", "where"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["keyword", "xor"], ["punctuation", ";"] +] diff --git a/tests/languages/magma/number_feature.test b/tests/languages/magma/number_feature.test new file mode 100644 index 0000000000..ca029eb7ee --- /dev/null +++ b/tests/languages/magma/number_feature.test @@ -0,0 +1,17 @@ +123 +-123 + +1.234 + +0..100 + +---------------------------------------------------- + +[ + ["number", "123"], + ["operator", "-"], ["number", "123"], + + ["number", "1.234"], + + ["number", "0"], ["operator", ".."], ["number", "100"] +] diff --git a/tests/languages/magma/operator_feature.test b/tests/languages/magma/operator_feature.test new file mode 100644 index 0000000000..8411ae2bc3 --- /dev/null +++ b/tests/languages/magma/operator_feature.test @@ -0,0 +1,25 @@ ++ - * / ^ ~ ! += +:= -> .. +| # + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "-"], + ["operator", "*"], + ["operator", "/"], + ["operator", "^"], + ["operator", "~"], + ["operator", "!"], + + ["operator", "="], + + ["operator", ":="], + ["operator", "->"], + ["operator", ".."], + + ["operator", "|"], + ["operator", "#"] +] diff --git a/tests/languages/magma/punctuation_feature.test b/tests/languages/magma/punctuation_feature.test new file mode 100644 index 0000000000..f9cb42a344 --- /dev/null +++ b/tests/languages/magma/punctuation_feature.test @@ -0,0 +1,20 @@ +( ) [ ] { } < > +, ; . : + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "<"], + ["punctuation", ">"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + ["punctuation", ":"] +] diff --git a/tests/languages/magma/shell_feature.test b/tests/languages/magma/shell_feature.test new file mode 100644 index 0000000000..2ef308c6f5 --- /dev/null +++ b/tests/languages/magma/shell_feature.test @@ -0,0 +1,9 @@ +> 1 +1 + +---------------------------------------------------- + +[ + ["punctuation", ">"], ["number", "1"], + ["output", "1"] +] diff --git a/tests/languages/magma/string_feature.test b/tests/languages/magma/string_feature.test new file mode 100644 index 0000000000..d93a89eabe --- /dev/null +++ b/tests/languages/magma/string_feature.test @@ -0,0 +1,13 @@ +"" +"foo" +"\"" +"\n\n" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"\\\"\""], + ["string", "\"\\n\\n\""] +] diff --git a/tests/languages/makefile/builtin-target_feature.test b/tests/languages/makefile/builtin-target_feature.test new file mode 100644 index 0000000000..d1eeffe5d6 --- /dev/null +++ b/tests/languages/makefile/builtin-target_feature.test @@ -0,0 +1,15 @@ +.PHONY: +.DELETE_ON_ERROR: +.SECONDEXPANSION: + +---------------------------------------------------- + +[ + ["builtin-target", ".PHONY"], ["punctuation", ":"], + ["builtin-target", ".DELETE_ON_ERROR"], ["punctuation", ":"], + ["builtin-target", ".SECONDEXPANSION"], ["punctuation", ":"] +] + +---------------------------------------------------- + +Checks for built-in target names. diff --git a/tests/languages/makefile/builtin_feature.test b/tests/languages/makefile/builtin_feature.test deleted file mode 100644 index 6f6a1a30e4..0000000000 --- a/tests/languages/makefile/builtin_feature.test +++ /dev/null @@ -1,15 +0,0 @@ -.PHONY: -.DELETE_ON_ERROR: -.SECONDEXPANSION: - ----------------------------------------------------- - -[ - ["builtin", ".PHONY"], ["punctuation", ":"], - ["builtin", ".DELETE_ON_ERROR"], ["punctuation", ":"], - ["builtin", ".SECONDEXPANSION"], ["punctuation", ":"] -] - ----------------------------------------------------- - -Checks for built-in target names. \ No newline at end of file diff --git a/tests/languages/makefile/function_feature.test b/tests/languages/makefile/function_feature.test new file mode 100644 index 0000000000..f45fd8134d --- /dev/null +++ b/tests/languages/makefile/function_feature.test @@ -0,0 +1,226 @@ +(abspath foo) +(addsuffix foo) +(and foo) +(basename foo) +(call foo) +(dir foo) +(error foo) +(eval foo) +(file foo) +(filter foo) +(filter-out foo) +(findstring foo) +(firstword foo) +(flavor foo) +(foreach foo) +(guile foo) +(if foo) +(info foo) +(join foo) +(lastword foo) +(load foo) +(notdir foo) +(or foo) +(origin foo) +(patsubst foo) +(realpath foo) +(shell foo) +(sort foo) +(strip foo) +(subst foo) +(suffix foo) +(value foo) +(warning foo) +(wildcard foo) +(word foo) +(wordlist foo) +(words foo) + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["function", "abspath"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "addsuffix"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "and"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "basename"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "call"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "dir"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "error"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "eval"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "file"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "filter"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "filter-out"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "findstring"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "firstword"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "flavor"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "foreach"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "guile"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "if"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "info"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "join"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "lastword"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "load"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "notdir"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "or"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "origin"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "patsubst"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "realpath"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "shell"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "sort"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "strip"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "subst"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "suffix"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "value"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "warning"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "wildcard"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "word"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "wordlist"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "words"], + " foo", + ["punctuation", ")"] +] diff --git a/tests/languages/makefile/keyword_feature.test b/tests/languages/makefile/keyword_feature.test index dcbbcc895a..06bf2dc109 100644 --- a/tests/languages/makefile/keyword_feature.test +++ b/tests/languages/makefile/keyword_feature.test @@ -1,73 +1,43 @@ -define else endef endif -export ifdef ifndef ifeq -ifneq -include include -override private sinclude -undefine unexport vpath - -(addsuffix foo) (abspath foo) -(and foo) (basename foo) -(call foo) (dir foo) (error foo) -(eval foo) (file foo) (filter foo) -(filter-out foo) (findstring foo) -(firstword foo) (flavor foo) -(foreach foo) (guile foo) -(if foo) (info foo) (join foo) -(lastword foo) (load foo) -(notdir foo) (or foo) (origin foo) -(patsubst foo) (realpath foo) -(shell foo) (sort foo) (strip foo) -(subst foo) (suffix foo) (value foo) -(warning foo) (wildcard foo) -(word foo) (words foo) (wordlist foo) +-include +define +else +endef +endif +export +ifdef +ifeq +ifndef +ifneq +include +override +private +sinclude +undefine +unexport +vpath ---------------------------------------------------- [ - ["keyword", "define"], ["keyword", "else"], ["keyword", "endef"], ["keyword", "endif"], - ["keyword", "export"], ["keyword", "ifdef"], ["keyword", "ifndef"], ["keyword", "ifeq"], - ["keyword", "ifneq"], ["keyword", "-include"], ["keyword", "include"], - ["keyword", "override"], ["keyword", "private"], ["keyword", "sinclude"], - ["keyword", "undefine"], ["keyword", "unexport"], ["keyword", "vpath"], - - ["punctuation", "("], ["keyword", "addsuffix"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "abspath"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "and"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "basename"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "call"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "dir"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "error"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "eval"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "file"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "filter"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "filter-out"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "findstring"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "firstword"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "flavor"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "foreach"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "guile"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "if"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "info"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "join"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "lastword"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "load"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "notdir"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "or"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "origin"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "patsubst"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "realpath"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "shell"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "sort"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "strip"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "subst"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "suffix"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "value"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "warning"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "wildcard"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "word"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "words"], " foo", ["punctuation", ")"], - ["punctuation", "("], ["keyword", "wordlist"], " foo", ["punctuation", ")"] + ["keyword", "-include"], + ["keyword", "define"], + ["keyword", "else"], + ["keyword", "endef"], + ["keyword", "endif"], + ["keyword", "export"], + ["keyword", "ifdef"], + ["keyword", "ifeq"], + ["keyword", "ifndef"], + ["keyword", "ifneq"], + ["keyword", "include"], + ["keyword", "override"], + ["keyword", "private"], + ["keyword", "sinclude"], + ["keyword", "undefine"], + ["keyword", "unexport"], + ["keyword", "vpath"] ] ---------------------------------------------------- -Checks for keywords and functions. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/makefile/symbol_feature.test b/tests/languages/makefile/symbol_feature.test deleted file mode 100644 index d1fe40b5d0..0000000000 --- a/tests/languages/makefile/symbol_feature.test +++ /dev/null @@ -1,18 +0,0 @@ -edit : -%oo: -$(foo): - ----------------------------------------------------- - -[ - ["symbol", ["edit "]], ["punctuation", ":"], - ["symbol", ["%oo"]], ["punctuation", ":"], - ["symbol", [ - ["variable", "$"], - "(foo)" - ]], ["punctuation", ":"] -] - ----------------------------------------------------- - -Checks for targets, optionally containing interpolation. \ No newline at end of file diff --git a/tests/languages/makefile/target_feature.test b/tests/languages/makefile/target_feature.test new file mode 100644 index 0000000000..bfbdfe99ca --- /dev/null +++ b/tests/languages/makefile/target_feature.test @@ -0,0 +1,23 @@ +edit : +%oo: +$(foo): + +---------------------------------------------------- + +[ + ["target", ["edit"]], + ["punctuation", ":"], + + ["target", ["%oo"]], + ["punctuation", ":"], + + ["target", [ + ["variable", "$"], + "(foo)" + ]], + ["punctuation", ":"] +] + +---------------------------------------------------- + +Checks for targets, optionally containing interpolation. diff --git a/tests/languages/markdown+haml/markdown_inclusion.test b/tests/languages/markdown+haml/markdown_inclusion.test index 4a75fa9cc2..c0b9224640 100644 --- a/tests/languages/markdown+haml/markdown_inclusion.test +++ b/tests/languages/markdown+haml/markdown_inclusion.test @@ -10,18 +10,22 @@ [ ["filter-markdown", [ ["filter-name", ":markdown"], - ["title", [ - ["punctuation", "#"], - " Title 1" + ["text", [ + ["title", [ + ["punctuation", "#"], + " Title 1" + ]] ]] ]], ["punctuation", "~"], ["filter-markdown", [ ["filter-name", ":markdown"], - ["title", [ - ["punctuation", "#"], - " Title 1" - ]] + ["text", [ + ["title", [ + ["punctuation", "#"], + " Title 1" + ]] + ]] ]] ] @@ -29,4 +33,4 @@ Checks for Markdown filter in Haml. The tilde serves only as a separator. Indentation is intentionally less than 1 tab, otherwise markdown is -interpreted as code. \ No newline at end of file +interpreted as code. diff --git a/tests/languages/markdown+pug/markdown_inclusion.test b/tests/languages/markdown+pug/markdown_inclusion.test index 01e6c3e796..cd3fb26278 100644 --- a/tests/languages/markdown+pug/markdown_inclusion.test +++ b/tests/languages/markdown+pug/markdown_inclusion.test @@ -6,13 +6,15 @@ [ ["filter-markdown", [ ["filter-name", ":markdown"], - ["title", [ - ["punctuation", "#"], - " title" + ["text", [ + ["title", [ + ["punctuation", "#"], + " title" + ]] ]] ]] ] ---------------------------------------------------- -Checks for markdown filter in Jade. \ No newline at end of file +Checks for markdown filter in pug. diff --git a/tests/languages/markdown/bold_feature.test b/tests/languages/markdown/bold_feature.test index 8d1cdb2048..9bfef198e4 100644 --- a/tests/languages/markdown/bold_feature.test +++ b/tests/languages/markdown/bold_feature.test @@ -10,12 +10,14 @@ __foo _bar_ baz__ __foo ~bar~ baz__ __foo ~~bar~~ baz__ __foo[bar](baz)__ +__foo `bar`__ **foo *bar* baz** **foo _bar_ baz** **foo ~bar~ baz** **foo ~~bar~~ baz** **foo[bar](baz)** +**foo `bar`** not__bold__ __this__either @@ -24,41 +26,32 @@ not__bold__ __this__either [ ["bold", [ ["punctuation", "**"], - ["content", [ - "foobar" - ]], + ["content", ["foobar"]], ["punctuation", "**"] ]], ["bold", [ ["punctuation", "**"], - ["content", [ - "foo\r\nbar" - ]], + ["content", ["foo\r\nbar"]], ["punctuation", "**"] ]], ["bold", [ ["punctuation", "__"], - ["content", [ - "foobar" - ]], + ["content", ["foobar"]], ["punctuation", "__"] ]], ["bold", [ ["punctuation", "__"], - ["content", [ - "foo\r\nbar" - ]], + ["content", ["foo\r\nbar"]], ["punctuation", "__"] ]], + ["bold", [ ["punctuation", "__"], ["content", [ "foo ", ["italic", [ ["punctuation", "*"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "*"] ]], " baz" @@ -71,9 +64,7 @@ not__bold__ __this__either "foo ", ["italic", [ ["punctuation", "_"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "_"] ]], " baz" @@ -86,9 +77,7 @@ not__bold__ __this__either "foo ", ["strike", [ ["punctuation", "~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~"] ]], " baz" @@ -101,9 +90,7 @@ not__bold__ __this__either "foo ", ["strike", [ ["punctuation", "~~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~~"] ]], " baz" @@ -116,23 +103,30 @@ not__bold__ __this__either "foo", ["url", [ "[", - ["content", [ - "bar" - ]], - "](baz)" + ["content", ["bar"]], + "](", + ["url", "baz"], + ")" ]] ]], ["punctuation", "__"] ]], + ["bold", [ + ["punctuation", "__"], + ["content", [ + "foo ", + ["code-snippet", "`bar`"] + ]], + ["punctuation", "__"] + ]], + ["bold", [ ["punctuation", "**"], ["content", [ "foo ", ["italic", [ ["punctuation", "*"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "*"] ]], " baz" @@ -145,9 +139,7 @@ not__bold__ __this__either "foo ", ["italic", [ ["punctuation", "_"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "_"] ]], " baz" @@ -160,9 +152,7 @@ not__bold__ __this__either "foo ", ["strike", [ ["punctuation", "~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~"] ]], " baz" @@ -175,9 +165,7 @@ not__bold__ __this__either "foo ", ["strike", [ ["punctuation", "~~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~~"] ]], " baz" @@ -190,14 +178,23 @@ not__bold__ __this__either "foo", ["url", [ "[", - ["content", [ - "bar" - ]], - "](baz)" + ["content", ["bar"]], + "](", + ["url", "baz"], + ")" ]] ]], ["punctuation", "**"] ]], + ["bold", [ + ["punctuation", "**"], + ["content", [ + "foo ", + ["code-snippet", "`bar`"] + ]], + ["punctuation", "**"] + ]], + "\r\n\r\nnot__bold__ __this__either" ] diff --git a/tests/languages/markdown/code-block_feature.html.test b/tests/languages/markdown/code-block_feature.html.test new file mode 100644 index 0000000000..7a5e8562c1 --- /dev/null +++ b/tests/languages/markdown/code-block_feature.html.test @@ -0,0 +1,49 @@ +```html +Click me! & +``` + +```unknownLanguage +Click me! & +``` + +---------------------------------------------------- + + + ``` + html + + + + < + a + + href + + = + " + #foo + " + + > + + Click me! + + + </ + a + + > + + &amp; + + ``` + + + + ``` + unknownLanguage + + <a href="#foo">Click me!</a> &amp; + + ``` + diff --git a/tests/languages/markdown/code_block_language_detection_feature.html.test b/tests/languages/markdown/code_block_language_detection_feature.html.test new file mode 100644 index 0000000000..d47fcba0d3 --- /dev/null +++ b/tests/languages/markdown/code_block_language_detection_feature.html.test @@ -0,0 +1,45 @@ +```js +let a = 0; +``` + +``` c++ +int a = 0; +``` + +``` c# +var a = 0; +``` + +```{r pressure, echo=FALSE} +plot(pressure) +``` + +---------------------------------------------------- + + + ``` + js + let a = 0; + ``` + + + + ``` + c++ + int a = 0; + ``` + + + + ``` + c# + var a = 0; + ``` + + + + ``` + {r pressure, echo=FALSE} + plot(pressure) + ``` + diff --git a/tests/languages/markdown/code_block_language_detection_feature.js b/tests/languages/markdown/code_block_language_detection_feature.js deleted file mode 100644 index c980b6cf5f..0000000000 --- a/tests/languages/markdown/code_block_language_detection_feature.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - - '```js\nlet a = 0;\n```': '```js\nlet a = 0;\n```', - - '``` c++\nint a = 0;\n```': '``` c++\nint a = 0;\n```', - - '``` c#\nvar a = 0;\n```': '``` c#\nvar a = 0;\n```', - - '```{r pressure, echo=FALSE}\nplot(pressure)\n```': '```{r pressure, echo=FALSE}\nplot(pressure)\n```' - -}; diff --git a/tests/languages/markdown/code_feature.test b/tests/languages/markdown/code_feature.test index 3f7abf3e0a..b2e5a77f83 100644 --- a/tests/languages/markdown/code_feature.test +++ b/tests/languages/markdown/code_feature.test @@ -13,14 +13,15 @@ var a = 0; ---------------------------------------------------- [ - ["code", "`foo bar baz`"], - ["code", "``foo `bar` baz``"], + ["code-snippet", "`foo bar baz`"], + ["code-snippet", "``foo `bar` baz``"], + ["code", " foobar"], + ["code", "\tfoobar\r\n\tcontinuous"], ["code", [ - ["punctuation", "```"], - ["code-language", " js"], + ["punctuation", "```"], ["code-language", " js"], ["code-block", "var a = 0;"], ["punctuation", "```"] ]] diff --git a/tests/languages/markdown/front-matter-block_empty_feature.test b/tests/languages/markdown/front-matter-block_empty_feature.test new file mode 100644 index 0000000000..094690ad48 --- /dev/null +++ b/tests/languages/markdown/front-matter-block_empty_feature.test @@ -0,0 +1,28 @@ +--- +--- + +# Title + +--- +normal paragraph + +--- + +---------------------------------------------------- + +[ + ["front-matter-block", [ + ["punctuation", "---"], + ["punctuation", "---"] + ]], + + ["title", [ + ["punctuation", "#"], + " Title" + ]], + + ["hr", "---"], + "\r\nnormal paragraph\r\n\r\n", + + ["hr", "---"] +] \ No newline at end of file diff --git a/tests/languages/markdown/front-matter-block_feature.test b/tests/languages/markdown/front-matter-block_feature.test new file mode 100644 index 0000000000..27588063d1 --- /dev/null +++ b/tests/languages/markdown/front-matter-block_feature.test @@ -0,0 +1,31 @@ +--- +layout: post +title: Blogging Like a Hacker +--- + +# Title + +--- +normal paragraph + +--- + +---------------------------------------------------- + +[ + ["front-matter-block", [ + ["punctuation", "---"], + ["front-matter", "layout: post\r\ntitle: Blogging Like a Hacker"], + ["punctuation", "---"] + ]], + + ["title", [ + ["punctuation", "#"], + " Title" + ]], + + ["hr", "---"], + "\r\nnormal paragraph\r\n\r\n", + + ["hr", "---"] +] diff --git a/tests/languages/markdown/issue2966.test b/tests/languages/markdown/issue2966.test new file mode 100644 index 0000000000..a4a10c0264 --- /dev/null +++ b/tests/languages/markdown/issue2966.test @@ -0,0 +1,17 @@ +* foo +* `asd` afsdfsdfsdf +* foo + * foo + * `REM` + * foo + +---------------------------------------------------- + +[ + ["list", "*"], " foo\r\n", + ["list", "*"], ["code-snippet", "`asd`"], " afsdfsdfsdf\r\n", + ["list", "*"], " foo\r\n ", + ["list", "*"], " foo\r\n ", + ["list", "*"], ["code-snippet", "`REM`"], + ["list", "*"], " foo" +] diff --git a/tests/languages/markdown/italic_feature.test b/tests/languages/markdown/italic_feature.test index ca9fc5d6a8..c513d58e1a 100644 --- a/tests/languages/markdown/italic_feature.test +++ b/tests/languages/markdown/italic_feature.test @@ -10,12 +10,14 @@ _foo **bar** baz_ _foo ~bar~ baz_ _foo ~~bar~~ baz_ _foo[bar](baz)_ +_foo `bar`_ *foo __bar__ baz* *foo **bar** baz* *foo ~bar~ baz* *foo ~~bar~~ baz* *foo[bar](baz)* +*foo `bar`* not_italic_ _this_either @@ -24,41 +26,32 @@ not_italic_ _this_either [ ["italic", [ ["punctuation", "*"], - ["content", [ - "foobar" - ]], + ["content", ["foobar"]], ["punctuation", "*"] ]], ["italic", [ ["punctuation", "*"], - ["content", [ - "foo\r\nbar" - ]], + ["content", ["foo\r\nbar"]], ["punctuation", "*"] ]], ["italic", [ ["punctuation", "_"], - ["content", [ - "foobar" - ]], + ["content", ["foobar"]], ["punctuation", "_"] ]], ["italic", [ ["punctuation", "_"], - ["content", [ - "foo\r\nbar" - ]], + ["content", ["foo\r\nbar"]], ["punctuation", "_"] ]], + ["italic", [ ["punctuation", "_"], ["content", [ "foo ", ["bold", [ ["punctuation", "__"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "__"] ]], " baz" @@ -71,9 +64,7 @@ not_italic_ _this_either "foo ", ["bold", [ ["punctuation", "**"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "**"] ]], " baz" @@ -86,9 +77,7 @@ not_italic_ _this_either "foo ", ["strike", [ ["punctuation", "~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~"] ]], " baz" @@ -101,9 +90,7 @@ not_italic_ _this_either "foo ", ["strike", [ ["punctuation", "~~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~~"] ]], " baz" @@ -116,23 +103,30 @@ not_italic_ _this_either "foo", ["url", [ "[", - ["content", [ - "bar" - ]], - "](baz)" + ["content", ["bar"]], + "](", + ["url", "baz"], + ")" ]] ]], ["punctuation", "_"] ]], + ["italic", [ + ["punctuation", "_"], + ["content", [ + "foo ", + ["code-snippet", "`bar`"] + ]], + ["punctuation", "_"] + ]], + ["italic", [ ["punctuation", "*"], ["content", [ "foo ", ["bold", [ ["punctuation", "__"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "__"] ]], " baz" @@ -145,9 +139,7 @@ not_italic_ _this_either "foo ", ["bold", [ ["punctuation", "**"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "**"] ]], " baz" @@ -160,9 +152,7 @@ not_italic_ _this_either "foo ", ["strike", [ ["punctuation", "~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~"] ]], " baz" @@ -175,9 +165,7 @@ not_italic_ _this_either "foo ", ["strike", [ ["punctuation", "~~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~~"] ]], " baz" @@ -190,14 +178,23 @@ not_italic_ _this_either "foo", ["url", [ "[", - ["content", [ - "bar" - ]], - "](baz)" + ["content", ["bar"]], + "](", + ["url", "baz"], + ")" ]] ]], ["punctuation", "*"] ]], + ["italic", [ + ["punctuation", "*"], + ["content", [ + "foo ", + ["code-snippet", "`bar`"] + ]], + ["punctuation", "*"] + ]], + "\r\n\r\nnot_italic_ _this_either" ] diff --git a/tests/languages/markdown/strike_feature.test b/tests/languages/markdown/strike_feature.test index 4a0ced00e0..9aeda5f231 100644 --- a/tests/languages/markdown/strike_feature.test +++ b/tests/languages/markdown/strike_feature.test @@ -10,53 +10,46 @@ bar~ ~foo **bar** baz~ ~foo __bar__ baz~ ~foo[bar](baz)~ +~foo `bar`~ ~~foo *bar* baz~~ ~~foo _bar_ baz~~ ~~foo **bar** baz~~ ~~foo __bar__ baz~~ ~~foo[bar](baz)~~ +~~foo `bar`~~ ---------------------------------------------------- [ ["strike", [ ["punctuation", "~~"], - ["content", [ - "foobar" - ]], + ["content", ["foobar"]], ["punctuation", "~~"] ]], ["strike", [ ["punctuation", "~~"], - ["content", [ - "foo\r\nbar" - ]], + ["content", ["foo\r\nbar"]], ["punctuation", "~~"] ]], ["strike", [ ["punctuation", "~"], - ["content", [ - "foobar" - ]], + ["content", ["foobar"]], ["punctuation", "~"] ]], ["strike", [ ["punctuation", "~"], - ["content", [ - "foo\r\nbar" - ]], + ["content", ["foo\r\nbar"]], ["punctuation", "~"] ]], + ["strike", [ ["punctuation", "~"], ["content", [ "foo ", ["italic", [ ["punctuation", "*"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "*"] ]], " baz" @@ -69,9 +62,7 @@ bar~ "foo ", ["italic", [ ["punctuation", "_"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "_"] ]], " baz" @@ -84,9 +75,7 @@ bar~ "foo ", ["bold", [ ["punctuation", "**"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "**"] ]], " baz" @@ -99,9 +88,7 @@ bar~ "foo ", ["bold", [ ["punctuation", "__"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "__"] ]], " baz" @@ -114,23 +101,30 @@ bar~ "foo", ["url", [ "[", - ["content", [ - "bar" - ]], - "](baz)" + ["content", ["bar"]], + "](", + ["url", "baz"], + ")" ]] ]], ["punctuation", "~"] ]], + ["strike", [ + ["punctuation", "~"], + ["content", [ + "foo ", + ["code-snippet", "`bar`"] + ]], + ["punctuation", "~"] + ]], + ["strike", [ ["punctuation", "~~"], ["content", [ "foo ", ["italic", [ ["punctuation", "*"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "*"] ]], " baz" @@ -143,9 +137,7 @@ bar~ "foo ", ["italic", [ ["punctuation", "_"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "_"] ]], " baz" @@ -158,9 +150,7 @@ bar~ "foo ", ["bold", [ ["punctuation", "**"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "**"] ]], " baz" @@ -173,9 +163,7 @@ bar~ "foo ", ["bold", [ ["punctuation", "__"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "__"] ]], " baz" @@ -188,13 +176,21 @@ bar~ "foo", ["url", [ "[", - ["content", [ - "bar" - ]], - "](baz)" + ["content", ["bar"]], + "](", + ["url", "baz"], + ")" ]] ]], ["punctuation", "~~"] + ]], + ["strike", [ + ["punctuation", "~~"], + ["content", [ + "foo ", + ["code-snippet", "`bar`"] + ]], + ["punctuation", "~~"] ]] ] diff --git a/tests/languages/markdown/table_feature.test b/tests/languages/markdown/table_feature.test index 3182f1b1c4..f4b3365a89 100644 --- a/tests/languages/markdown/table_feature.test +++ b/tests/languages/markdown/table_feature.test @@ -19,17 +19,11 @@ Markdown | Less | Pretty ["table", [ ["table-header-row", [ ["punctuation", "|"], - ["table-header", [ - " Tables " - ]], + ["table-header", [" Tables "]], ["punctuation", "|"], - ["table-header", [ - " Are " - ]], + ["table-header", [" Are "]], ["punctuation", "|"], - ["table-header", [ - " Cool " - ]], + ["table-header", [" Cool "]], ["punctuation", "|"] ]], ["table-line", [ @@ -43,60 +37,38 @@ Markdown | Less | Pretty ]], ["table-data-rows", [ ["punctuation", "|"], - ["table-data", [ - " col 3 is " - ]], + ["table-data", [" col 3 is "]], ["punctuation", "|"], - ["table-data", [ - " right-aligned " - ]], + ["table-data", [" right-aligned "]], ["punctuation", "|"], - ["table-data", [ - " $1600 " - ]], + ["table-data", [" $1600 "]], ["punctuation", "|"], + ["punctuation", "|"], - ["table-data", [ - " col 2 is " - ]], + ["table-data", [" col 2 is "]], ["punctuation", "|"], - ["table-data", [ - " centered " - ]], + ["table-data", [" centered "]], ["punctuation", "|"], - ["table-data", [ - " $12 " - ]], + ["table-data", [" $12 "]], ["punctuation", "|"], + ["punctuation", "|"], - ["table-data", [ - " zebra stripes " - ]], + ["table-data", [" zebra stripes "]], ["punctuation", "|"], - ["table-data", [ - " are neat " - ]], + ["table-data", [" are neat "]], ["punctuation", "|"], - ["table-data", [ - " $1 " - ]], + ["table-data", [" $1 "]], ["punctuation", "|"] ]] ]], ["table", [ ["table-header-row", [ - ["table-header", [ - "Markdown " - ]], + ["table-header", ["Markdown "]], ["punctuation", "|"], - ["table-header", [ - " Less " - ]], + ["table-header", [" Less "]], ["punctuation", "|"], - ["table-header", [ - " Pretty" - ]] + ["table-header", [" Pretty"]] ]], ["table-line", [ ["punctuation", "---"], @@ -109,50 +81,37 @@ Markdown | Less | Pretty ["table-data", [ ["italic", [ ["punctuation", "*"], - ["content", [ - "Still" - ]], + ["content", ["Still"]], ["punctuation", "*"] ]] ]], ["punctuation", "|"], ["table-data", [ - ["code", "`renders`"] + ["code-snippet", "`renders`"] ]], ["punctuation", "|"], ["table-data", [ ["bold", [ ["punctuation", "**"], - ["content", [ - "nicely" - ]], + ["content", ["nicely"]], ["punctuation", "**"] ]] ]], - ["table-data", [ - "1 " - ]], + + ["table-data", ["1 "]], ["punctuation", "|"], - ["table-data", [ - " 2 " - ]], + ["table-data", [" 2 "]], ["punctuation", "|"], - ["table-data", [ - " 3" - ]] + ["table-data", [" 3"]] ]] ]], ["table", [ ["table-header-row", [ ["punctuation", "|"], - ["table-header", [ - "Abc " - ]], + ["table-header", ["Abc "]], ["punctuation", "|"], - ["table-header", [ - " Def " - ]], + ["table-header", [" Def "]], ["punctuation", "|"] ]], ["table-line", [ @@ -163,12 +122,10 @@ Markdown | Less | Pretty ["table-data-rows", [ ["punctuation", "|"], ["table-data", [ - ["code", "`` `. ``"] + ["code-snippet", "`` `. ``"] ]], ["punctuation", "|"], - ["table-data", [ - "2" - ]], + ["table-data", ["2"]], ["punctuation", "|"] ]] ]] diff --git a/tests/languages/markdown/url_feature.test b/tests/languages/markdown/url_feature.test index 455009f0dd..bc72965bcd 100644 --- a/tests/languages/markdown/url_feature.test +++ b/tests/languages/markdown/url_feature.test @@ -12,65 +12,65 @@ bar](http://prismjs.com) [foo __bar__ baz](http://prismjs.com) [foo ~bar~ baz](http://prismjs.com) [foo ~~bar~~ baz](http://prismjs.com) +[foo `bar` baz](http://prismjs.com) +[`bar`](http://prismjs.com) ---------------------------------------------------- [ ["url", [ "[", - ["content", [ - "foo" - ]], - "](http://prismjs.com)" + ["content", ["foo"]], + "](", + ["url", "http://prismjs.com"], + ")" ]], ["url", [ - "![", - ["content", [ - "foo" - ]], - "](http://prismjs.com ", + ["operator", "!"], + "[", + ["content", ["foo"]], + "](", + ["url", "http://prismjs.com"], ["string", "\"Foo\\\"bar\""], ")" ]], ["url", [ "[", - ["content", [ - "foo" - ]], + ["content", ["foo"]], "][", ["variable", "bar"], "]" ]], ["url", [ "[", - ["content", [ - "foo" - ]], + ["content", ["foo"]], "] [", ["variable", "bar"], "]" ]], + ["url", [ "[", - ["content", [ - "foo\r\nbar" - ]], - "](http://prismjs.com)" + ["content", ["foo\r\nbar"]], + "](", + ["url", "http://prismjs.com"], + ")" ]], + ["url", [ "[", ["content", [ "foo ", ["italic", [ ["punctuation", "*"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "*"] ]], " baz" ]], - "](http://prismjs.com)" + "](", + ["url", "http://prismjs.com"], + ")" ]], ["url", [ "[", @@ -78,14 +78,14 @@ bar](http://prismjs.com) "foo ", ["italic", [ ["punctuation", "_"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "_"] ]], " baz" ]], - "](http://prismjs.com)" + "](", + ["url", "http://prismjs.com"], + ")" ]], ["url", [ "[", @@ -93,14 +93,14 @@ bar](http://prismjs.com) "foo ", ["bold", [ ["punctuation", "**"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "**"] ]], " baz" ]], - "](http://prismjs.com)" + "](", + ["url", "http://prismjs.com"], + ")" ]], ["url", [ "[", @@ -108,14 +108,14 @@ bar](http://prismjs.com) "foo ", ["bold", [ ["punctuation", "__"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "__"] ]], " baz" ]], - "](http://prismjs.com)" + "](", + ["url", "http://prismjs.com"], + ")" ]], ["url", [ "[", @@ -123,14 +123,14 @@ bar](http://prismjs.com) "foo ", ["strike", [ ["punctuation", "~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~"] ]], " baz" ]], - "](http://prismjs.com)" + "](", + ["url", "http://prismjs.com"], + ")" ]], ["url", [ "[", @@ -138,14 +138,34 @@ bar](http://prismjs.com) "foo ", ["strike", [ ["punctuation", "~~"], - ["content", [ - "bar" - ]], + ["content", ["bar"]], ["punctuation", "~~"] ]], " baz" ]], - "](http://prismjs.com)" + "](", + ["url", "http://prismjs.com"], + ")" + ]], + ["url", [ + "[", + ["content", [ + "foo ", + ["code-snippet", "`bar`"], + " baz" + ]], + "](", + ["url", "http://prismjs.com"], + ")" + ]], + ["url", [ + "[", + ["content", [ + ["code-snippet", "`bar`"] + ]], + "](", + ["url", "http://prismjs.com"], + ")" ]] ] diff --git a/tests/languages/markup!+css/css_inclusion.test b/tests/languages/markup!+css/css_inclusion.test index 69264dbc4e..84631ab746 100644 --- a/tests/languages/markup!+css/css_inclusion.test +++ b/tests/languages/markup!+css/css_inclusion.test @@ -35,12 +35,8 @@ foo { ]], ["style", [ ["language-css", [ - ["selector", "foo"], - ["punctuation", "{"], - ["property", "bar"], - ["punctuation", ":"], - " baz", - ["punctuation", ";"], + ["selector", "foo"], ["punctuation", "{"], + ["property", "bar"], ["punctuation", ":"], " baz", ["punctuation", ";"], ["punctuation", "}"] ]] ]], @@ -68,12 +64,8 @@ foo { ["included-cdata", [ ["cdata", ""] @@ -97,18 +89,19 @@ foo { ["punctuation", "<"], "foo" ]], - ["style-attr", [ - ["attr-name", [ - ["attr-name", ["style"]] - ]], - ["punctuation", "=\""], + ["special-attr", [ + ["attr-name", "style"], ["attr-value", [ - ["property", "bar"], - ["punctuation", ":"], - "baz", - ["punctuation", ";"] - ]], - ["punctuation", "\""] + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["property", "bar"], + ["punctuation", ":"], + "baz", + ["punctuation", ";"] + ]], + ["punctuation", "\""] + ]] ]], ["punctuation", ">"] ]] diff --git a/tests/languages/markup!+javascript/javascript_inclusion.test b/tests/languages/markup!+javascript/javascript_inclusion.test index 098e8c1e61..ccff9d0e81 100644 --- a/tests/languages/markup!+javascript/javascript_inclusion.test +++ b/tests/languages/markup!+javascript/javascript_inclusion.test @@ -12,6 +12,9 @@ let foo = ''; "foo" + + + ---------------------------------------------------- [ @@ -107,6 +110,46 @@ let foo = ''; "script" ]], ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "foo" + ]], + ["special-attr", [ + ["attr-name", "onclick"], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["keyword", "this"], + ["punctuation", "."], + "textContent", + ["operator", "="], + ["string", "'Clicked!'"] + ]], + ["punctuation", "\""] + ]] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "foo" + ]], + ["attr-name", ["mouseover"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "this.textContent=", + ["punctuation", "'"], + "Over!", + ["punctuation", "'"], + ["punctuation", "\""] + ]], + ["punctuation", ">"] ]] ] diff --git a/tests/languages/markup+css+wiki/table-tag_feature.test b/tests/languages/markup+css+wiki/table-tag_feature.test index e3965f9694..a17b2ad4e6 100644 --- a/tests/languages/markup+css+wiki/table-tag_feature.test +++ b/tests/languages/markup+css+wiki/table-tag_feature.test @@ -67,16 +67,19 @@ baz ["punctuation", "{|"], ["punctuation", "!"], ["table-tag", [ - ["style-attr", [ - ["attr-name", [["attr-name", ["style"]]]], - ["punctuation", "=\""], + ["special-attr", [ + ["attr-name", "style"], ["attr-value", [ - ["property", "text-align"], - ["punctuation", ":"], - "left", - ["punctuation", ";"] - ]], - ["punctuation", "\""] + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["property", "text-align"], + ["punctuation", ":"], + "left", + ["punctuation", ";"] + ]], + ["punctuation", "\""] + ]] ]], ["table-bar", "|"] ]], " Foo\r\n", @@ -91,31 +94,37 @@ baz ["punctuation", "{|"], ["punctuation", "!"], ["table-tag", [ - ["style-attr", [ - ["attr-name", [["attr-name", ["style"]]]], - ["punctuation", "=\""], + ["special-attr", [ + ["attr-name", "style"], ["attr-value", [ - ["property", "color"], - ["punctuation", ":"], - "red", - ["punctuation", ";"] - ]], - ["punctuation", "\""] + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["property", "color"], + ["punctuation", ":"], + "red", + ["punctuation", ";"] + ]], + ["punctuation", "\""] + ]] ]], ["table-bar", "|"] ]], " Foo ", ["punctuation", "!!"], ["table-tag", [ - ["style-attr", [ - ["attr-name", [["attr-name", ["style"]]]], - ["punctuation", "=\""], + ["special-attr", [ + ["attr-name", "style"], ["attr-value", [ - ["property", "color"], - ["punctuation", ":"], - "blue", - ["punctuation", ";"] - ]], - ["punctuation", "\""] + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["property", "color"], + ["punctuation", ":"], + "blue", + ["punctuation", ";"] + ]], + ["punctuation", "\""] + ]] ]], ["table-bar", "|"] ]], " Bar ", @@ -124,16 +133,19 @@ baz ["punctuation", "|"], " foo ", ["punctuation", "||"], ["table-tag", [ - ["style-attr", [ - ["attr-name", [["attr-name", ["style"]]]], - ["punctuation", "=\""], + ["special-attr", [ + ["attr-name", "style"], ["attr-value", [ - ["property", "font-weight"], - ["punctuation", ":"], - "bold", - ["punctuation", ";"] - ]], - ["punctuation", "\""] + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["property", "font-weight"], + ["punctuation", ":"], + "bold", + ["punctuation", ";"] + ]], + ["punctuation", "\""] + ]] ]], ["table-bar", "|"] ]], " bar ", @@ -144,4 +156,4 @@ baz ---------------------------------------------------- Checks for tables and cell attributes. -Note: Markup is loaded before CSS so that inline styles are added into grammar. \ No newline at end of file +Note: Markup is loaded before CSS so that inline styles are added into grammar. diff --git a/tests/languages/markup+http/html_inclusion.test b/tests/languages/markup+http/html_inclusion.test index a0d9d975ba..4d000818ab 100644 --- a/tests/languages/markup+http/html_inclusion.test +++ b/tests/languages/markup+http/html_inclusion.test @@ -5,8 +5,11 @@ Content-type: text/html ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " text/html", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "text/html"] + ]], ["text-html", [ ["tag", [ ["tag", [ diff --git a/tests/languages/markup+http/issue2733.test b/tests/languages/markup+http/issue2733.test new file mode 100644 index 0000000000..dd5d2f5b73 --- /dev/null +++ b/tests/languages/markup+http/issue2733.test @@ -0,0 +1,101 @@ +HTTP/1.1 200 OK +connection: keep-alive +content-type: application/xml +date: Sat, 23 Jan 2021 20:36:14 GMT +keep-alive: timeout=60 +transfer-encoding: chunked + + + Data + More Data + + +---------------------------------------------------- + +[ + ["response-status", [ + ["http-version", "HTTP/1.1"], + ["status-code", "200"], + ["reason-phrase", "OK"] + ]], + + ["header", [ + ["header-name", "connection"], + ["punctuation", ":"], + ["header-value", "keep-alive"] + ]], + + ["header", [ + ["header-name", "content-type"], + ["punctuation", ":"], + ["header-value", "application/xml"] + ]], + + ["header", [ + ["header-name", "date"], + ["punctuation", ":"], + ["header-value", "Sat, 23 Jan 2021 20:36:14 GMT"] + ]], + + ["header", [ + ["header-name", "keep-alive"], + ["punctuation", ":"], + ["header-value", "timeout=60"] + ]], + + ["header", [ + ["header-name", "transfer-encoding"], + ["punctuation", ":"], + ["header-value", "chunked"] + ]], + + ["application-xml", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "xml" + ]], + ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "one" + ]], + ["punctuation", ">"] + ]], + "Data", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "two" + ]], + ["punctuation", ">"] + ]], + "More Data", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]] +] diff --git a/tests/languages/markup+http/text-xml_inclusion.test b/tests/languages/markup+http/text-xml_inclusion.test new file mode 100644 index 0000000000..34fe5e5f20 --- /dev/null +++ b/tests/languages/markup+http/text-xml_inclusion.test @@ -0,0 +1,33 @@ +Content-type: text/xml + + + +---------------------------------------------------- + +[ + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "text/xml"] + ]], + ["text-xml", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "foo" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]] +] + +---------------------------------------------------- + +Checks for XML content in HTTP. diff --git a/tests/languages/markup+http/xml-suffix_inclusion.test b/tests/languages/markup+http/xml-suffix_inclusion.test index 82b9df450b..90ffee527f 100644 --- a/tests/languages/markup+http/xml-suffix_inclusion.test +++ b/tests/languages/markup+http/xml-suffix_inclusion.test @@ -5,8 +5,11 @@ Content-type: text/x.anything+something-else+xml ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " text/x.anything+something-else+xml", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "text/x.anything+something-else+xml"] + ]], ["application-xml", [ ["tag", [ ["tag", [ diff --git a/tests/languages/markup+http/xml_inclusion.test b/tests/languages/markup+http/xml_inclusion.test index 36f2dfea17..3bce7feefe 100644 --- a/tests/languages/markup+http/xml_inclusion.test +++ b/tests/languages/markup+http/xml_inclusion.test @@ -5,8 +5,11 @@ Content-type: application/xml ---------------------------------------------------- [ - ["header-name", "Content-type:"], - " application/xml", + ["header", [ + ["header-name", "Content-type"], + ["punctuation", ":"], + ["header-value", "application/xml"] + ]], ["application-xml", [ ["tag", [ ["tag", [ diff --git a/tests/languages/markup+javascript+csharp+aspnet/script_feature.test b/tests/languages/markup+javascript+csharp+aspnet/script_feature.test index 375a02fb4b..6e48573cf3 100644 --- a/tests/languages/markup+javascript+csharp+aspnet/script_feature.test +++ b/tests/languages/markup+javascript+csharp+aspnet/script_feature.test @@ -21,7 +21,10 @@ ["punctuation", ">"] ]], ["asp-script", [ - ["preprocessor", ["#", ["directive", "pragma"]]] + ["preprocessor", [ + "#", + ["directive", "pragma"] + ]] ]], ["tag", [ ["tag", [ @@ -40,7 +43,11 @@ ]], ["script", [ ["language-javascript", [ - ["regex", "/foo/"] + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "foo"], + ["regex-delimiter", "/"] + ]] ]] ]], ["tag", [ diff --git a/tests/languages/markup+php/issue1582.test b/tests/languages/markup+php/issue1582.test index 255f97e74e..9ed8faec0e 100644 --- a/tests/languages/markup+php/issue1582.test +++ b/tests/languages/markup+php/issue1582.test @@ -1,23 +1,23 @@ -'; - echo PHP_EOL; - ----------------------------------------------------- - -[ - ["php", [ - ["delimiter", "'"], - ["punctuation", ";"], - ["keyword", "echo"], - ["constant", "PHP_EOL"], - ["punctuation", ";"] - ]] -] - ----------------------------------------------------- - -Checks for PHP closing tags '?>' inside of strings. -See #1582 for details. +'; + echo PHP_EOL; + +---------------------------------------------------- + +[ + ["php", [ + ["delimiter", "'"], + ["punctuation", ";"], + ["keyword", "echo"], + ["constant", "PHP_EOL"], + ["punctuation", ";"] + ]] +] + +---------------------------------------------------- + +Checks for PHP closing tags '?>' inside of strings. +See #1582 for details. diff --git a/tests/languages/markup+php/php_with_closing_tag_in_markup_feature.test b/tests/languages/markup+php/php_with_closing_tag_in_markup_feature.test index 8067d7c0b4..c3c5135b8f 100644 --- a/tests/languages/markup+php/php_with_closing_tag_in_markup_feature.test +++ b/tests/languages/markup+php/php_with_closing_tag_in_markup_feature.test @@ -1,44 +1,44 @@ -' + "?>"; /* ?> */ - echo PHP_EOL; - // */ - // ?> - - - ----------------------------------------------------- - -[ - ["php", [ - ["delimiter", "'"], - ["operator", "+"], - ["double-quoted-string", ["\"?>\""]], - ["punctuation", ";"], - ["comment", "/* ?> */"], - ["keyword", "echo"], - ["constant", "PHP_EOL"], - ["punctuation", ";"], - ["comment", "// */"], - ["comment", "// "], - ["delimiter", "?>"] - ]], - - ["php", [ - ["delimiter", ""] - ]] -] - ----------------------------------------------------- - -Checks for PHP closing tags '?>' inside of strings and comments. +' + "?>"; /* ?> */ + echo PHP_EOL; + // */ + // ?> + + + +---------------------------------------------------- + +[ + ["php", [ + ["delimiter", "'"], + ["operator", "+"], + ["string", ["\"?>\""]], + ["punctuation", ";"], + ["comment", "/* ?> */"], + ["keyword", "echo"], + ["constant", "PHP_EOL"], + ["punctuation", ";"], + ["comment", "// */"], + ["comment", "// "], + ["delimiter", "?>"] + ]], + + ["php", [ + ["delimiter", ""] + ]] +] + +---------------------------------------------------- + +Checks for PHP closing tags '?>' inside of strings and comments. diff --git a/tests/languages/markup/entity_feature.html.test b/tests/languages/markup/entity_feature.html.test new file mode 100644 index 0000000000..5bcf3517a7 --- /dev/null +++ b/tests/languages/markup/entity_feature.html.test @@ -0,0 +1,17 @@ +& +ϑ +A +A +⛵ + +---------------------------------------------------- + +&amp; +&thetasym; +&#65; +&#x41; +&#x26f5; + +---------------------------------------------------- + +Checks for HTML/XML character entity references. diff --git a/tests/languages/markup/entity_feature.js b/tests/languages/markup/entity_feature.js deleted file mode 100644 index ec74c9e394..0000000000 --- a/tests/languages/markup/entity_feature.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - '&': '&amp;', - 'ϑ': '&thetasym;', - 'A': '&#65;', - 'A': '&#x41;' -}; diff --git a/tests/languages/markup/entity_feature.test b/tests/languages/markup/entity_feature.test deleted file mode 100644 index 44f0f83d6a..0000000000 --- a/tests/languages/markup/entity_feature.test +++ /dev/null @@ -1,14 +0,0 @@ -& ϑ ⛵   - ----------------------------------------------------- - -[ - ["entity", "&"], - ["entity", "ϑ"], - ["entity", "⛵"], - ["entity", " "] -] - ----------------------------------------------------- - -Checks for HTML/XML character entity references. \ No newline at end of file diff --git a/tests/languages/maxscript/boolean_feature.test b/tests/languages/maxscript/boolean_feature.test new file mode 100644 index 0000000000..4d678006fc --- /dev/null +++ b/tests/languages/maxscript/boolean_feature.test @@ -0,0 +1,11 @@ +true; +false; + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["punctuation", ";"], + ["boolean", "false"], + ["punctuation", ";"] +] diff --git a/tests/languages/maxscript/color_feature.test b/tests/languages/maxscript/color_feature.test new file mode 100644 index 0000000000..f2fad5fff9 --- /dev/null +++ b/tests/languages/maxscript/color_feature.test @@ -0,0 +1,23 @@ +black +blue +brown +gray +green +orange +red +white +yellow + +---------------------------------------------------- + +[ + ["color", "black"], + ["color", "blue"], + ["color", "brown"], + ["color", "gray"], + ["color", "green"], + ["color", "orange"], + ["color", "red"], + ["color", "white"], + ["color", "yellow"] +] diff --git a/tests/languages/maxscript/comment_feature.test b/tests/languages/maxscript/comment_feature.test new file mode 100644 index 0000000000..8d088d07ec --- /dev/null +++ b/tests/languages/maxscript/comment_feature.test @@ -0,0 +1,29 @@ +/* this is a long comment +blah blah +print "debug 1" -- code commented out +more comments +*/ + +for i in 1 to 10 do(/* messageBox "in loop"; */frabulate i ) + +-- comment + +---------------------------------------------------- + +[ + ["comment", "/* this is a long comment\r\nblah blah\r\nprint \"debug 1\" -- code commented out\r\nmore comments\r\n*/"], + + ["keyword", "for"], + " i ", + ["keyword", "in"], + ["number", "1"], + ["keyword", "to"], + ["number", "10"], + ["keyword", "do"], + ["punctuation", "("], + ["comment", "/* messageBox \"in loop\"; */"], + "frabulate i ", + ["punctuation", ")"], + + ["comment", "-- comment"] +] diff --git a/tests/languages/maxscript/constant_feature.test b/tests/languages/maxscript/constant_feature.test new file mode 100644 index 0000000000..fc5a9c9ad5 --- /dev/null +++ b/tests/languages/maxscript/constant_feature.test @@ -0,0 +1,15 @@ +dontcollect +ok +silentValue +undefined +unsupplied + +---------------------------------------------------- + +[ + ["constant", "dontcollect"], + ["constant", "ok"], + ["constant", "silentValue"], + ["constant", "undefined"], + ["constant", "unsupplied"] +] diff --git a/tests/languages/maxscript/function_feature.test b/tests/languages/maxscript/function_feature.test new file mode 100644 index 0000000000..baf28df386 --- /dev/null +++ b/tests/languages/maxscript/function_feature.test @@ -0,0 +1,152 @@ +function my_add a b = a + b + +fn factorial n = if n <= 0 then 1 else n * factorial (n - 1) + +mapped function rand_color x = + x.wireColor = random (color 0 0 0) (color 255 255 255) + +fn starfield count extent:[200,200,200] pos:[0,0,0] = + ( + -- something + ) + +fn saddle x y = sin x * sin y + +print "build math mesh" +in_name = getOpenFileName() +val.x=random -100 100 +append vert_array (readValue in_file) +while not eof f do +on pressme pressed do print "Pressed!" + +---------------------------------------------------- + +[ + ["keyword", "function"], + ["function-definition", "my_add"], + " a b ", + ["operator", "="], + " a ", + ["operator", "+"], + " b\r\n\r\n", + + ["keyword", "fn"], + ["function-definition", "factorial"], + " n ", + ["operator", "="], + ["keyword", "if"], + " n ", + ["operator", "<="], + ["number", "0"], + ["keyword", "then"], + ["number", "1"], + ["keyword", "else"], + " n ", + ["operator", "*"], + ["function-call", "factorial"], + ["punctuation", "("], + "n ", + ["operator", "-"], + ["number", "1"], + ["punctuation", ")"], + + ["keyword", "mapped"], + ["keyword", "function"], + ["function-definition", "rand_color"], + " x ", + ["operator", "="], + + "\r\n x", + ["punctuation", "."], + "wireColor ", + ["operator", "="], + ["function-call", "random"], + ["punctuation", "("], + ["function-call", "color"], + ["number", "0"], + ["number", "0"], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", "("], + ["function-call", "color"], + ["number", "255"], + ["number", "255"], + ["number", "255"], + ["punctuation", ")"], + + ["keyword", "fn"], + ["function-definition", "starfield"], + " count ", + ["argument", "extent"], + ["punctuation", ":"], + ["punctuation", "["], + ["number", "200"], + ["punctuation", ","], + ["number", "200"], + ["punctuation", ","], + ["number", "200"], + ["punctuation", "]"], + ["argument", "pos"], + ["punctuation", ":"], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", "]"], + ["operator", "="], + + ["punctuation", "("], + + ["comment", "-- something"], + + ["punctuation", ")"], + + ["keyword", "fn"], + ["function-definition", "saddle"], + " x y ", + ["operator", "="], + ["function-call", "sin"], + " x ", + ["operator", "*"], + ["function-call", "sin"], + " y\r\n\r\n", + + ["function-call", "print"], + ["string", "\"build math mesh\""], + + "\r\nin_name ", + ["operator", "="], + ["function-call", "getOpenFileName"], + ["punctuation", "("], + ["punctuation", ")"], + + "\r\nval", + ["punctuation", "."], + "x", + ["operator", "="], + ["function-call", "random"], + ["operator", "-"], + ["number", "100"], + ["number", "100"], + + ["function-call", "append"], + " vert_array ", + ["punctuation", "("], + ["function-call", "readValue"], + " in_file", + ["punctuation", ")"], + + ["keyword", "while"], + ["keyword", "not"], + ["function-call", "eof"], + " f ", + ["keyword", "do"], + + ["keyword", "on"], + " pressme pressed ", + ["keyword", "do"], + ["function-call", "print"], + ["string", "\"Pressed!\""] +] diff --git a/tests/languages/maxscript/keyword_feature.test b/tests/languages/maxscript/keyword_feature.test new file mode 100644 index 0000000000..200aac37ca --- /dev/null +++ b/tests/languages/maxscript/keyword_feature.test @@ -0,0 +1,105 @@ +about; +and; +animate; +as; +at; +attributes; +by; +case; +catch; +collect; +continue; +coordsys; +do; +else; +exit; +fn; +for; +from; +function; +global; +if; +in; +local; +macroscript; +mapped; +max; +not; +of; +off; +on; +or; +parameters; +persistent; +plugin; +rcmenu; +return; +rollout; +set; +struct; +then; +throw; +to; +tool; +try; +undo; +utility; +when; +where; +while; +with; + +---------------------------------------------------- + +[ + ["keyword", "about"], ["punctuation", ";"], + ["keyword", "and"], ["punctuation", ";"], + ["keyword", "animate"], ["punctuation", ";"], + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "at"], ["punctuation", ";"], + ["keyword", "attributes"], ["punctuation", ";"], + ["keyword", "by"], ["punctuation", ";"], + ["keyword", "case"], ["punctuation", ";"], + ["keyword", "catch"], ["punctuation", ";"], + ["keyword", "collect"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "coordsys"], ["punctuation", ";"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "exit"], ["punctuation", ";"], + ["keyword", "fn"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "from"], ["punctuation", ";"], + ["keyword", "function"], ["punctuation", ";"], + ["keyword", "global"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "local"], ["punctuation", ";"], + ["keyword", "macroscript"], ["punctuation", ";"], + ["keyword", "mapped"], ["punctuation", ";"], + ["keyword", "max"], ["punctuation", ";"], + ["keyword", "not"], ["punctuation", ";"], + ["keyword", "of"], ["punctuation", ";"], + ["keyword", "off"], ["punctuation", ";"], + ["keyword", "on"], ["punctuation", ";"], + ["keyword", "or"], ["punctuation", ";"], + ["keyword", "parameters"], ["punctuation", ";"], + ["keyword", "persistent"], ["punctuation", ";"], + ["keyword", "plugin"], ["punctuation", ";"], + ["keyword", "rcmenu"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "rollout"], ["punctuation", ";"], + ["keyword", "set"], ["punctuation", ";"], + ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "then"], ["punctuation", ";"], + ["keyword", "throw"], ["punctuation", ";"], + ["keyword", "to"], ["punctuation", ";"], + ["keyword", "tool"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "undo"], ["punctuation", ";"], + ["keyword", "utility"], ["punctuation", ";"], + ["keyword", "when"], ["punctuation", ";"], + ["keyword", "where"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["keyword", "with"], ["punctuation", ";"] +] diff --git a/tests/languages/maxscript/number_feature.test b/tests/languages/maxscript/number_feature.test new file mode 100644 index 0000000000..c01246e683 --- /dev/null +++ b/tests/languages/maxscript/number_feature.test @@ -0,0 +1,23 @@ +123 +123.45 +-0.00345 +1.0e-6 +0x0E +.1 + +e +pi + +---------------------------------------------------- + +[ + ["number", "123"], + ["number", "123.45"], + ["operator", "-"], ["number", "0.00345"], + ["number", "1.0e-6"], + ["number", "0x0E"], + ["number", ".1"], + + ["number", "e"], + ["number", "pi"] +] diff --git a/tests/languages/maxscript/operator_feature.test b/tests/languages/maxscript/operator_feature.test new file mode 100644 index 0000000000..e09006ecc1 --- /dev/null +++ b/tests/languages/maxscript/operator_feature.test @@ -0,0 +1,32 @@ ++ - * / ++= -= *= /= + += +== != < <= > >= + +^ & # + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "-"], + ["operator", "*"], + ["operator", "/"], + + ["operator", "+="], + ["operator", "-="], + ["operator", "*="], + ["operator", "/="], + + ["operator", "="], + + ["operator", "=="], + ["operator", "!="], + ["operator", "<"], + ["operator", "<="], + ["operator", ">"], + ["operator", ">="], + + ["operator", "^"], ["operator", "&"], ["operator", "#"] +] diff --git a/tests/languages/maxscript/path_feature.test b/tests/languages/maxscript/path_feature.test new file mode 100644 index 0000000000..a4334f25aa --- /dev/null +++ b/tests/languages/maxscript/path_feature.test @@ -0,0 +1,89 @@ +$box01 -- object named 'box01' +$torso/left_up_arm/left_low_arm -- hierarchy path name +$*box* -- all objects with 'box' in +-- the name +$torso/* -- all the direct children of +-- $torso +$helpers/d* -- all helper objects whose name starts with 'd' + +$dummy/head/neck +$dummy/* +$neck* +$box0? +$dummy/*/* +$dummy/.../box* +$dummy...* +$*box*.position += [10, 10, 0] + +$.pos = [0,0,0] +hide $ +rotate $ 35 z_axis + +$'a silly name!!' +$'what the \*' +bodyPart=$'Bip01 L UpperArm' +bodyPart=$Bip01_L_UpperArm + +---------------------------------------------------- + +[ + ["path", "$box01"], + ["comment", "-- object named 'box01'"], + ["path", "$torso/left_up_arm/left_low_arm"], + ["comment", "-- hierarchy path name"], + ["path", "$*box*"], + ["comment", "-- all objects with 'box' in"], + ["comment", "-- the name"], + ["path", "$torso/*"], + ["comment", "-- all the direct children of"], + ["comment", "-- $torso"], + ["path", "$helpers/d*"], + ["comment", "-- all helper objects whose name starts with 'd'"], + + ["path", "$dummy/head/neck"], + + ["path", "$dummy/*"], + + ["path", "$neck*"], + + ["path", "$box0?"], + + ["path", "$dummy/*/*"], + + ["path", "$dummy/.../box*"], + + ["path", "$dummy...*"], + + ["path", "$*box*.position"], + ["operator", "+="], + ["punctuation", "["], + ["number", "10"], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", "]"], + + ["path", "$.pos"], + ["operator", "="], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", "]"], + + ["function-call", "hide"], + ["path", "$"], + + ["function-call", "rotate"], + ["path", "$"], + ["number", "35"], + " z_axis\r\n\r\n", + + ["path", "$'a silly name!!'"], + ["path", "$'what the \\*'"], + "\r\nbodyPart", ["operator", "="], ["path", "$'Bip01 L UpperArm'"], + "\r\nbodyPart", ["operator", "="], ["path", "$Bip01_L_UpperArm"] +] diff --git a/tests/languages/maxscript/punctuation_feature.test b/tests/languages/maxscript/punctuation_feature.test new file mode 100644 index 0000000000..136dc90685 --- /dev/null +++ b/tests/languages/maxscript/punctuation_feature.test @@ -0,0 +1,25 @@ +( ) [ ] { } +. : , ; +#( +\ + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "."], + ["punctuation", ":"], + ["punctuation", ","], + ["punctuation", ";"], + + ["punctuation", "#"], + ["punctuation", "("], + + ["punctuation", "\\"] +] diff --git a/tests/languages/maxscript/string_feature.test b/tests/languages/maxscript/string_feature.test new file mode 100644 index 0000000000..f2bf20ae12 --- /dev/null +++ b/tests/languages/maxscript/string_feature.test @@ -0,0 +1,17 @@ +"" +"foo should be quoted like this: \"foo\" and a new line: \n" +"Twas brillig and the slithy tobes +did gyre and gimbol in the wabe +or something like that..." +"g:\\3dsmax25\\scenes" +@"g:\temp\newfolder\render" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo should be quoted like this: \\\"foo\\\" and a new line: \\n\""], + ["string", "\"Twas brillig and the slithy tobes\r\ndid gyre and gimbol in the wabe\r\nor something like that...\""], + ["string", "\"g:\\\\3dsmax25\\\\scenes\""], + ["string", "@\"g:\\temp\\newfolder\\render\""] +] diff --git a/tests/languages/maxscript/time_feature.test b/tests/languages/maxscript/time_feature.test new file mode 100644 index 0000000000..0405771f5c --- /dev/null +++ b/tests/languages/maxscript/time_feature.test @@ -0,0 +1,21 @@ +2.5s +1m15s +2m30s5f2t +125f +18.25f +1f20t +2:10.0 +0:0.29 + +---------------------------------------------------- + +[ + ["time", "2.5s"], + ["time", "1m15s"], + ["time", "2m30s5f2t"], + ["time", "125f"], + ["time", "18.25f"], + ["time", "1f20t"], + ["time", "2:10.0"], + ["time", "0:0.29"] +] diff --git a/tests/languages/mermaid/arrow_feature.test b/tests/languages/mermaid/arrow_feature.test new file mode 100644 index 0000000000..6205a313ff --- /dev/null +++ b/tests/languages/mermaid/arrow_feature.test @@ -0,0 +1,125 @@ +%% flow chart + +--- ---- ----- +--> ---> ----> +<-- <--- <---- +=== ==== ===== +==> ===> ====> +<== <=== <==== +-.- -..- -...- +-.-> -..-> -...-> +<-.- <-..- <-...- +--x ---x ----x +--x -.-x -..-x +x-- x--- x---- +x-- x-.- x-..- +--o ---o ----o +--o -.-o -..-o +o-- o--- o---- +o-- o-.- o-..- + +<--> <----> <-..-> <====> +x--x x----x x-..-x x====x +o--o o----o o-..-o o====o + +%% sequence diagram + +-> --> ->> -->> +<- <-- <<- <<-- +-x --x -) --) +x- x-- (- (-- + +%% class diagram + +<|-- *-- o-- <-- <.. <|.. +--|> --* --o --> ..> ..|> +-- .. + +%% ER diagram + +|o--o| |o..o| +||--|| ||..|| +}o--o{ }o..o{ +}|--|{ }|..|{ + +|o--o| |o..o| +||--o{ ||..o{ +}o--|{ }o..|{ +}|--|| }|..|| + +---------------------------------------------------- + +[ + ["comment", "%% flow chart"], + + ["arrow", "---"], ["arrow", "----"], ["arrow", "-----"], + ["arrow", "-->"], ["arrow", "--->"], ["arrow", "---->"], + ["arrow", "<--"], ["arrow", "<---"], ["arrow", "<----"], + ["arrow", "==="], ["arrow", "===="], ["arrow", "====="], + ["arrow", "==>"], ["arrow", "===>"], ["arrow", "====>"], + ["arrow", "<=="], ["arrow", "<==="], ["arrow", "<===="], + ["arrow", "-.-"], ["arrow", "-..-"], ["arrow", "-...-"], + ["arrow", "-.->"], ["arrow", "-..->"], ["arrow", "-...->"], + ["arrow", "<-.-"], ["arrow", "<-..-"], ["arrow", "<-...-"], + ["arrow", "--x"], ["arrow", "---x"], ["arrow", "----x"], + ["arrow", "--x"], ["arrow", "-.-x"], ["arrow", "-..-x"], + ["arrow", "x--"], ["arrow", "x---"], ["arrow", "x----"], + ["arrow", "x--"], ["arrow", "x-.-"], ["arrow", "x-..-"], + ["arrow", "--o"], ["arrow", "---o"], ["arrow", "----o"], + ["arrow", "--o"], ["arrow", "-.-o"], ["arrow", "-..-o"], + ["arrow", "o--"], ["arrow", "o---"], ["arrow", "o----"], + ["arrow", "o--"], ["arrow", "o-.-"], ["arrow", "o-..-"], + + ["arrow", "<-->"], + ["arrow", "<---->"], + ["arrow", "<-..->"], + ["arrow", "<====>"], + + ["arrow", "x--x"], + ["arrow", "x----x"], + ["arrow", "x-..-x"], + ["arrow", "x====x"], + + ["arrow", "o--o"], + ["arrow", "o----o"], + ["arrow", "o-..-o"], + ["arrow", "o====o"], + + ["comment", "%% sequence diagram"], + + ["arrow", "->"], ["arrow", "-->"], ["arrow", "->>"], ["arrow", "-->>"], + ["arrow", "<-"], ["arrow", "<--"], ["arrow", "<<-"], ["arrow", "<<--"], + ["arrow", "-x"], ["arrow", "--x"], ["arrow", "-)"], ["arrow", "--)"], + ["arrow", "x-"], ["arrow", "x--"], ["arrow", "(-"], ["arrow", "(--"], + + ["comment", "%% class diagram"], + + ["arrow", "<|--"], + ["arrow", "*--"], + ["arrow", "o--"], + ["arrow", "<--"], + ["arrow", "<.."], + ["arrow", "<|.."], + + ["arrow", "--|>"], + ["arrow", "--*"], + ["arrow", "--o"], + ["arrow", "-->"], + ["arrow", "..>"], + ["arrow", "..|>"], + + ["arrow", "--"], + ["arrow", ".."], + + ["comment", "%% ER diagram"], + + ["arrow", "|o--o|"], ["arrow", "|o..o|"], + ["arrow", "||--||"], ["arrow", "||..||"], + ["arrow", "}o--o{"], ["arrow", "}o..o{"], + ["arrow", "}|--|{"], ["arrow", "}|..|{"], + + ["arrow", "|o--o|"], ["arrow", "|o..o|"], + ["arrow", "||--o{"], ["arrow", "||..o{"], + ["arrow", "}o--|{"], ["arrow", "}o..|{"], + ["arrow", "}|--||"], ["arrow", "}|..||"] +] diff --git a/tests/languages/mermaid/comment_feature.test b/tests/languages/mermaid/comment_feature.test new file mode 100644 index 0000000000..90b8493fba --- /dev/null +++ b/tests/languages/mermaid/comment_feature.test @@ -0,0 +1,7 @@ +%% comment + +---------------------------------------------------- + +[ + ["comment", "%% comment"] +] diff --git a/tests/languages/mermaid/full_classdiagram.test b/tests/languages/mermaid/full_classdiagram.test new file mode 100644 index 0000000000..e612373f67 --- /dev/null +++ b/tests/languages/mermaid/full_classdiagram.test @@ -0,0 +1,656 @@ +classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + Animal : +int age + Animal : +String gender + Animal: +isMammal() + Animal: +mate() + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } + +classDiagram + class BankAccount + BankAccount : +String owner + BankAccount : +Bigdecimal balance + BankAccount : +deposit(amount) + BankAccount : +withdrawl(amount) + +classDiagram + class Animal + Vehicle <|-- Car + +class BankAccount + BankAccount : +String owner + BankAccount : +BigDecimal balance + BankAccount : +deposit(amount) + BankAccount : +withdrawal(amount) + +class BankAccount{ + +String owner + +BigDecimal balance + +deposit(amount) + +withdrawl(amount) +} + +class BankAccount{ + +String owner + +BigDecimal balance + +deposit(amount) bool + +withdrawl(amount) int +} + +classDiagram +class Square~Shape~{ + int id + List~int~ position + setPoints(List~int~ points) + getPoints() List~int~ +} + +Square : -List~string~ messages +Square : +setMessages(List~string~ messages) +Square : +getMessages() List~string~ + +classDiagram +classA <|-- classB +classC *-- classD +classE o-- classF +classG <-- classH +classI -- classJ +classK <.. classL +classM <|.. classN +classO .. classP + +classDiagram +classA --|> classB : Inheritance +classC --* classD : Composition +classE --o classF : Aggregation +classG --> classH : Association +classI -- classJ : Link(Solid) +classK ..> classL : Dependency +classM ..|> classN : Realization +classO .. classP : Link(Dashed) + +classDiagram +classA <|-- classB : implements +classC *-- classD : composition +classE o-- classF : association + +classDiagram + Customer "1" --> "*" Ticket + Student "1" --> "1..*" Course + Galaxy --> "many" Star : Contains + +classDiagram +class Shape +<> Shape + +classDiagram +class Shape{ + <> + noOfVertices + draw() +} +class Color{ + <> + RED + BLUE + GREEN + WHITE + BLACK +} + +classDiagram +%% This whole line is a comment classDiagram class Shape <> +class Shape{ + <> + noOfVertices + draw() +} + +classDiagram + direction RL + class Student { + -idCard : IdCard + } + class IdCard{ + -id : int + -name : string + } + class Bike{ + -id : int + -name : string + } + Student "1" --o "1" IdCard : carries + Student "1" --o "1" Bike : rides + +action className "reference" "tooltip" +click className call callback() "tooltip" +click className href "url" "tooltip" + +classDiagram +class Shape +link Shape "http://www.github.com" "This is a tooltip for a link" +class Shape2 +click Shape2 href "http://www.github.com" "This is a tooltip for a link" + +classDiagram +class Shape +callback Shape "callbackFunction" "This is a tooltip for a callback" +class Shape2 +click Shape2 call callbackFunction() "This is a tooltip for a callback" + +classDiagram +Animal <|-- Duck +Animal <|-- Fish +Animal <|-- Zebra +Animal : +int age +Animal : +String gender +Animal: +isMammal() +Animal: +mate() +class Duck{ + +String beakColor + +swim() + +quack() + } +class Fish{ + -int sizeInFeet + -canEat() + } +class Zebra{ + +bool is_wild + +run() + } + + callback Duck callback "Tooltip" + link Zebra "http://www.github.com" "This is a link" + +classDiagram + class Animal:::cssClass + +classDiagram + class Animal:::cssClass { + -int sizeInFeet + -canEat() + } + +---------------------------------------------------- + +[ + ["keyword", "classDiagram"], + + "\r\n Animal ", + ["arrow", "<|--"], + " Duck\r\n Animal ", + ["arrow", "<|--"], + " Fish\r\n Animal ", + ["arrow", "<|--"], + " Zebra\r\n Animal ", + ["operator", ":"], + " +int age\r\n Animal ", + ["operator", ":"], + " +String gender\r\n Animal", + ["operator", ":"], + " +isMammal", + ["punctuation", "("], + ["punctuation", ")"], + + "\r\n Animal", + ["operator", ":"], + " +mate", + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "class"], + " Duck", + ["punctuation", "{"], + + "\r\n +String beakColor\r\n +swim", + ["punctuation", "("], + ["punctuation", ")"], + + "\r\n +quack", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "class"], + " Fish", + ["punctuation", "{"], + + "\r\n -int sizeInFeet\r\n -canEat", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "class"], + " Zebra", + ["punctuation", "{"], + + "\r\n +bool is_wild\r\n +run", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "classDiagram"], + + ["keyword", "class"], + " BankAccount\r\n BankAccount ", + ["operator", ":"], + " +String owner\r\n BankAccount ", + ["operator", ":"], + " +Bigdecimal balance\r\n BankAccount ", + ["operator", ":"], + " +deposit", + ["text", "(amount)"], + + "\r\n BankAccount ", + ["operator", ":"], + " +withdrawl", + ["text", "(amount)"], + + ["keyword", "classDiagram"], + + ["keyword", "class"], + " Animal\r\n Vehicle ", + ["arrow", "<|--"], + " Car\r\n\r\n", + + ["keyword", "class"], + " BankAccount\r\n BankAccount ", + ["operator", ":"], + " +String owner\r\n BankAccount ", + ["operator", ":"], + " +BigDecimal balance\r\n BankAccount ", + ["operator", ":"], + " +deposit", + ["text", "(amount)"], + + "\r\n BankAccount ", + ["operator", ":"], + " +withdrawal", + ["text", "(amount)"], + + ["keyword", "class"], + " BankAccount", + ["punctuation", "{"], + + "\r\n +String owner\r\n +BigDecimal balance\r\n +deposit", + ["text", "(amount)"], + + "\r\n +withdrawl", + ["text", "(amount)"], + + ["punctuation", "}"], + + ["keyword", "class"], + " BankAccount", + ["punctuation", "{"], + + "\r\n +String owner\r\n +BigDecimal balance\r\n +deposit", + ["text", "(amount)"], + " bool\r\n +withdrawl", + ["text", "(amount)"], + " int\r\n", + + ["punctuation", "}"], + + ["keyword", "classDiagram"], + + ["keyword", "class"], + " Square~Shape~", + ["punctuation", "{"], + + "\r\n int id\r\n List~int~ position\r\n setPoints", + ["text", "(List~int~ points)"], + + "\r\n getPoints", + ["punctuation", "("], + ["punctuation", ")"], + " List~int~\r\n", + + ["punctuation", "}"], + + "\r\n\r\nSquare ", + ["operator", ":"], + " -List~string~ messages\r\nSquare ", + ["operator", ":"], + " +setMessages", + ["text", "(List~string~ messages)"], + + "\r\nSquare ", + ["operator", ":"], + " +getMessages", + ["punctuation", "("], + ["punctuation", ")"], + " List~string~\r\n\r\n", + + ["keyword", "classDiagram"], + + "\r\nclassA ", + ["arrow", "<|--"], + " classB\r\nclassC ", + ["arrow", "*--"], + " classD\r\nclassE ", + ["arrow", "o--"], + " classF\r\nclassG ", + ["arrow", "<--"], + " classH\r\nclassI ", + ["arrow", "--"], + " classJ\r\nclassK ", + ["arrow", "<.."], + " classL\r\nclassM ", + ["arrow", "<|.."], + " classN\r\nclassO ", + ["arrow", ".."], + " classP\r\n\r\n", + + ["keyword", "classDiagram"], + + "\r\nclassA ", + ["arrow", "--|>"], + " classB ", + ["operator", ":"], + " Inheritance\r\nclassC ", + ["arrow", "--*"], + " classD ", + ["operator", ":"], + " Composition\r\nclassE ", + ["arrow", "--o"], + " classF ", + ["operator", ":"], + " Aggregation\r\nclassG ", + ["arrow", "-->"], + " classH ", + ["operator", ":"], + " Association\r\nclassI ", + ["arrow", "--"], + " classJ ", + ["operator", ":"], + " Link", + ["text", "(Solid)"], + + "\r\nclassK ", + ["arrow", "..>"], + " classL ", + ["operator", ":"], + " Dependency\r\nclassM ", + ["arrow", "..|>"], + " classN ", + ["operator", ":"], + " Realization\r\nclassO ", + ["arrow", ".."], + " classP ", + ["operator", ":"], + " Link", + ["text", "(Dashed)"], + + ["keyword", "classDiagram"], + + "\r\nclassA ", + ["arrow", "<|--"], + " classB ", + ["operator", ":"], + " implements\r\nclassC ", + ["arrow", "*--"], + " classD ", + ["operator", ":"], + " composition\r\nclassE ", + ["arrow", "o--"], + " classF ", + ["operator", ":"], + " association\r\n\r\n", + + ["keyword", "classDiagram"], + + "\r\n Customer ", + ["string", "\"1\""], + ["arrow", "-->"], + ["string", "\"*\""], + " Ticket\r\n Student ", + ["string", "\"1\""], + ["arrow", "-->"], + ["string", "\"1..*\""], + " Course\r\n Galaxy ", + ["arrow", "-->"], + ["string", "\"many\""], + " Star ", + ["operator", ":"], + " Contains\r\n\r\n", + + ["keyword", "classDiagram"], + ["keyword", "class"], " Shape\r\n", + ["annotation", "<>"], " Shape\r\n\r\n", + + ["keyword", "classDiagram"], + ["keyword", "class"], + " Shape", + ["punctuation", "{"], + ["annotation", "<>"], + "\r\n noOfVertices\r\n draw", + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["keyword", "class"], + " Color", + ["punctuation", "{"], + ["annotation", "<>"], + "\r\n RED\r\n BLUE\r\n GREEN\r\n WHITE\r\n BLACK\r\n", + ["punctuation", "}"], + + ["keyword", "classDiagram"], + ["comment", "%% This whole line is a comment classDiagram class Shape <>"], + ["keyword", "class"], + " Shape", + ["punctuation", "{"], + ["annotation", "<>"], + "\r\n noOfVertices\r\n draw", + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + + ["keyword", "classDiagram"], + + ["keyword", "direction"], + " RL\r\n ", + + ["keyword", "class"], + " Student ", + ["punctuation", "{"], + + "\r\n -idCard ", + ["operator", ":"], + " IdCard\r\n ", + + ["punctuation", "}"], + + ["keyword", "class"], + " IdCard", + ["punctuation", "{"], + + "\r\n -id ", + ["operator", ":"], + " int\r\n -name ", + ["operator", ":"], + " string\r\n ", + + ["punctuation", "}"], + + ["keyword", "class"], + " Bike", + ["punctuation", "{"], + + "\r\n -id ", + ["operator", ":"], + " int\r\n -name ", + ["operator", ":"], + " string\r\n ", + + ["punctuation", "}"], + + "\r\n Student ", + ["string", "\"1\""], + ["arrow", "--o"], + ["string", "\"1\""], + " IdCard ", + ["operator", ":"], + " carries\r\n Student ", + ["string", "\"1\""], + ["arrow", "--o"], + ["string", "\"1\""], + " Bike ", + ["operator", ":"], + " rides\r\n\r\n", + + ["keyword", "action"], + " className ", + ["string", "\"reference\""], + ["string", "\"tooltip\""], + + ["keyword", "click"], + " className call callback", + ["punctuation", "("], + ["punctuation", ")"], + ["string", "\"tooltip\""], + + ["keyword", "click"], + " className href ", + ["string", "\"url\""], + ["string", "\"tooltip\""], + + ["keyword", "classDiagram"], + + ["keyword", "class"], + " Shape\r\n", + + ["keyword", "link"], + " Shape ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a tooltip for a link\""], + + ["keyword", "class"], + " Shape2\r\n", + + ["keyword", "click"], + " Shape2 href ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a tooltip for a link\""], + + ["keyword", "classDiagram"], + + ["keyword", "class"], + " Shape\r\n", + + ["keyword", "callback"], + " Shape ", + ["string", "\"callbackFunction\""], + ["string", "\"This is a tooltip for a callback\""], + + ["keyword", "class"], + " Shape2\r\n", + + ["keyword", "click"], + " Shape2 call callbackFunction", + ["punctuation", "("], + ["punctuation", ")"], + ["string", "\"This is a tooltip for a callback\""], + + ["keyword", "classDiagram"], + + "\r\nAnimal ", + ["arrow", "<|--"], + " Duck\r\nAnimal ", + ["arrow", "<|--"], + " Fish\r\nAnimal ", + ["arrow", "<|--"], + " Zebra\r\nAnimal ", + ["operator", ":"], + " +int age\r\nAnimal ", + ["operator", ":"], + " +String gender\r\nAnimal", + ["operator", ":"], + " +isMammal", + ["punctuation", "("], + ["punctuation", ")"], + + "\r\nAnimal", + ["operator", ":"], + " +mate", + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "class"], + " Duck", + ["punctuation", "{"], + + "\r\n +String beakColor\r\n +swim", + ["punctuation", "("], + ["punctuation", ")"], + + "\r\n +quack", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "class"], + " Fish", + ["punctuation", "{"], + + "\r\n -int sizeInFeet\r\n -canEat", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "class"], + " Zebra", + ["punctuation", "{"], + + "\r\n +bool is_wild\r\n +run", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"], + + ["keyword", "callback"], + " Duck callback ", + ["string", "\"Tooltip\""], + + ["keyword", "link"], + " Zebra ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a link\""], + + ["keyword", "classDiagram"], + ["keyword", "class"], " Animal", ["operator", ":::"], "cssClass\r\n\r\n", + + ["keyword", "classDiagram"], + + ["keyword", "class"], + " Animal", + ["operator", ":::"], + "cssClass ", + ["punctuation", "{"], + + "\r\n -int sizeInFeet\r\n -canEat", + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "}"] +] diff --git a/tests/languages/mermaid/full_erdiagram.test b/tests/languages/mermaid/full_erdiagram.test new file mode 100644 index 0000000000..c88f2d46c6 --- /dev/null +++ b/tests/languages/mermaid/full_erdiagram.test @@ -0,0 +1,168 @@ +erDiagram + CUSTOMER ||--o{ ORDER : places + ORDER ||--|{ LINE-ITEM : contains + CUSTOMER }|..|{ DELIVERY-ADDRESS : uses + +erDiagram + CUSTOMER ||--o{ ORDER : places + CUSTOMER { + string name + string custNumber + string sector + } + ORDER ||--|{ LINE-ITEM : contains + ORDER { + int orderNumber + string deliveryAddress + } + LINE-ITEM { + string productCode + int quantity + float pricePerUnit + } + +PROPERTY ||--|{ ROOM : contains + +CAR ||--o{ NAMED-DRIVER : allows + PERSON ||--o{ NAMED-DRIVER : is + +erDiagram + CAR ||--o{ NAMED-DRIVER : allows + CAR { + string registrationNumber + string make + string model + } + PERSON ||--o{ NAMED-DRIVER : is + PERSON { + string firstName + string lastName + int age + } + +erDiagram + CAR ||--o{ NAMED-DRIVER : allows + CAR { + string registrationNumber + string make + string model + } + PERSON ||--o{ NAMED-DRIVER : is + PERSON { + string firstName + string lastName + int age + } + +---------------------------------------------------- + +[ + ["keyword", "erDiagram"], + + "\r\n CUSTOMER ", + ["arrow", "||--o{"], + " ORDER ", + ["operator", ":"], + " places\r\n ORDER ", + ["arrow", "||--|{"], + " LINE-ITEM ", + ["operator", ":"], + " contains\r\n CUSTOMER ", + ["arrow", "}|..|{"], + " DELIVERY-ADDRESS ", + ["operator", ":"], + " uses\r\n\r\n", + + ["keyword", "erDiagram"], + + "\r\n CUSTOMER ", + ["arrow", "||--o{"], + " ORDER ", + ["operator", ":"], + " places\r\n CUSTOMER ", + ["punctuation", "{"], + + "\r\n string name\r\n string custNumber\r\n string sector\r\n ", + + ["punctuation", "}"], + + "\r\n ORDER ", + ["arrow", "||--|{"], + " LINE-ITEM ", + ["operator", ":"], + " contains\r\n ORDER ", + ["punctuation", "{"], + + "\r\n int orderNumber\r\n string deliveryAddress\r\n ", + + ["punctuation", "}"], + + "\r\n LINE-ITEM ", + ["punctuation", "{"], + + "\r\n string productCode\r\n int quantity\r\n float pricePerUnit\r\n ", + + ["punctuation", "}"], + + "\r\n\r\nPROPERTY ", + ["arrow", "||--|{"], + " ROOM ", + ["operator", ":"], + " contains\r\n\r\nCAR ", + ["arrow", "||--o{"], + " NAMED-DRIVER ", + ["operator", ":"], + " allows\r\n PERSON ", + ["arrow", "||--o{"], + " NAMED-DRIVER ", + ["operator", ":"], + " is\r\n\r\n", + + ["keyword", "erDiagram"], + + "\r\n CAR ", + ["arrow", "||--o{"], + " NAMED-DRIVER ", + ["operator", ":"], + " allows\r\n CAR ", + ["punctuation", "{"], + + "\r\n string registrationNumber\r\n string make\r\n string model\r\n ", + + ["punctuation", "}"], + + "\r\n PERSON ", + ["arrow", "||--o{"], + " NAMED-DRIVER ", + ["operator", ":"], + " is\r\n PERSON ", + ["punctuation", "{"], + + "\r\n string firstName\r\n string lastName\r\n int age\r\n ", + + ["punctuation", "}"], + + ["keyword", "erDiagram"], + + "\r\n CAR ", + ["arrow", "||--o{"], + " NAMED-DRIVER ", + ["operator", ":"], + " allows\r\n CAR ", + ["punctuation", "{"], + + "\r\n string registrationNumber\r\n string make\r\n string model\r\n ", + + ["punctuation", "}"], + + "\r\n PERSON ", + ["arrow", "||--o{"], + " NAMED-DRIVER ", + ["operator", ":"], + " is\r\n PERSON ", + ["punctuation", "{"], + + "\r\n string firstName\r\n string lastName\r\n int age\r\n ", + + ["punctuation", "}"] +] diff --git a/tests/languages/mermaid/full_flowchart.test b/tests/languages/mermaid/full_flowchart.test new file mode 100644 index 0000000000..948af017cb --- /dev/null +++ b/tests/languages/mermaid/full_flowchart.test @@ -0,0 +1,930 @@ +flowchart LR + id + +flowchart LR + id1[This is the text in the box] + +flowchart TD + Start --> Stop + +flowchart LR + Start --> Stop + +flowchart LR + id1(This is the text in the box) + +flowchart LR + id1([This is the text in the box]) + +flowchart LR + id1[[This is the text in the box]] + +flowchart LR + id1[(Database)] + +flowchart LR + id1((This is the text in the circle)) + +flowchart LR + id1>This is the text in the box] + +flowchart LR + id1{This is the text in the box} + +flowchart LR + id1{{This is the text in the box}} + +flowchart TD + id1[/This is the text in the box/] + +flowchart TD + id1[\This is the text in the box\] + +flowchart TD + A[/Christmas\] + +flowchart TD + B[\Go shopping/] + +flowchart LR + A-->B + +flowchart LR + A --- B + +flowchart LR + A-- This is the text! ---B + +flowchart LR + A---|This is the text|B + +flowchart LR + A-->|text|B + +flowchart LR + A-- text -->B + +flowchart LR; + A-.->B; + +flowchart LR + A-. text .-> B + +flowchart LR + A ==> B + +flowchart LR + A == text ==> B + +flowchart LR + A -- text --> B -- text2 --> C + +flowchart LR + a --> b & c--> d + +flowchart TB + A & B--> C & D + +flowchart TB + A --> C + A --> D + B --> C + B --> D + +flowchart LR + A --o B + B --x C + +flowchart LR + A o--o B + B <--> C + C x--x D + +flowchart TD + A[Start] --> B{Is it?}; + B -->|Yes| C[OK]; + C --> D[Rethink]; + D --> B; + B ---->|No| E[End]; + +flowchart TD + A[Start] --> B{Is it?}; + B -- Yes --> C[OK]; + C --> D[Rethink]; + D --> B; + B -- No ----> E[End]; + +flowchart LR + id1["This is the (text) in the box"] + +flowchart LR + A["A double quote:#quot;"] -->B["A dec char:#9829;"] + +subgraph title + graph definition +end + +flowchart TB + c1-->a2 + subgraph one + a1-->a2 + end + subgraph two + b1-->b2 + end + subgraph three + c1-->c2 + end + +flowchart TB + c1-->a2 + subgraph ide1 [one] + a1-->a2 + end + +flowchart TB + c1-->a2 + subgraph one + a1-->a2 + end + subgraph two + b1-->b2 + end + subgraph three + c1-->c2 + end + one --> two + three --> two + two --> c2 + +flowchart LR + subgraph TOP + direction TB + subgraph B1 + direction RL + i1 -->f1 + end + subgraph B2 + direction BT + i2 -->f2 + end + end + A --> TOP --> B + B1 --> B2 + +click nodeId callback +click nodeId call callback() + +flowchart LR; + A-->B; + B-->C; + C-->D; + click A callback "Tooltip for a callback" + click B "http://www.github.com" "This is a tooltip for a link" + click A call callback() "Tooltip for a callback" + click B href "http://www.github.com" "This is a tooltip for a link" + +flowchart LR; + A-->B; + B-->C; + C-->D; + D-->E; + click A "http://www.github.com" _blank + click B "http://www.github.com" "Open this in a new tab" _blank + click C href "http://www.github.com" _blank + click D href "http://www.github.com" "Open this in a new tab" _blank + +flowchart LR +%% this is a comment A -- text --> B{node} + A -- text --> B -- text2 --> C + +linkStyle 3 stroke:#ff3,stroke-width:4px,color:red; + +flowchart LR + id1(Start)-->id2(Stop) + style id1 fill:#f9f,stroke:#333,stroke-width:4px + style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5 + +classDef className fill:#f9f,stroke:#333,stroke-width:4px; + +class nodeId1 className; + +class nodeId1,nodeId2 className; + +flowchart LR + A:::someclass --> B + classDef someclass fill:#f96; + +flowchart LR; + A-->B[AAABBB]; + B-->D; + class A cssClass; + +classDef default fill:#f9f,stroke:#333,stroke-width:4px; + +flowchart TD + B["fa:fa-twitter for peace"] + B-->C[fa:fa-ban forbidden] + B-->D(fa:fa-spinner); + B-->E(A fa:fa-camera-retro perhaps?); + +flowchart LR + A[Hard edge] -->|Link text| B(Round edge) + B --> C{Decision} + C -->|One| D[Result one] + C -->|Two| E[Result two] + + flowchart LR; + A-->B; + B-->C; + C-->D; + click A callback "Tooltip" + click B "http://www.github.com" "This is a link" + click C call callback() "Tooltip" + click D href "http://www.github.com" "This is a link" + +---------------------------------------------------- + +[ + ["keyword", "flowchart"], " LR\r\n id\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "[This is the text in the box]"], + + ["keyword", "flowchart"], + " TD\r\n Start ", + ["arrow", "-->"], + " Stop\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n Start ", + ["arrow", "-->"], + " Stop\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "(This is the text in the box)"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "([This is the text in the box])"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "[[This is the text in the box]]"], + + ["keyword", "flowchart"], " LR\r\n id1", ["text", "[(Database)]"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "((This is the text in the circle))"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", ">This is the text in the box]"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "{This is the text in the box}"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "{{This is the text in the box}}"], + + ["keyword", "flowchart"], + " TD\r\n id1", + ["text", "[/This is the text in the box/]"], + + ["keyword", "flowchart"], + " TD\r\n id1", + ["text", "[\\This is the text in the box\\]"], + + ["keyword", "flowchart"], " TD\r\n A", ["text", "[/Christmas\\]"], + + ["keyword", "flowchart"], " TD\r\n B", ["text", "[\\Go shopping/]"], + + ["keyword", "flowchart"], " LR\r\n A", ["arrow", "-->"], "B\r\n\r\n", + + ["keyword", "flowchart"], " LR\r\n A ", ["arrow", "---"], " B\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "This is the text!"], + ["arrow", "---"] + ]], + "B\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A", + ["arrow", "---"], + ["label", "|This is the text|"], + "B\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A", + ["arrow", "-->"], + ["label", "|text|"], + "B\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "text"], + ["arrow", "-->"] + ]], + "B\r\n\r\n", + + ["keyword", "flowchart"], " LR", ["punctuation", ";"], + "\r\n A", ["arrow", "-.->"], "B", ["punctuation", ";"], + + ["keyword", "flowchart"], + " LR\r\n A", + ["inter-arrow-label", [ + ["arrow-head", "-."], + ["label", "text"], + ["arrow", ".->"] + ]], + " B\r\n\r\n", + + ["keyword", "flowchart"], " LR\r\n A ", ["arrow", "==>"], " B\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A ", + ["inter-arrow-label", [ + ["arrow-head", "=="], + ["label", "text"], + ["arrow", "==>"] + ]], + " B\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "text"], + ["arrow", "-->"] + ]], + " B ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "text2"], + ["arrow", "-->"] + ]], + " C\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n a ", + ["arrow", "-->"], + " b ", + ["operator", "&"], + " c", + ["arrow", "-->"], + " d\r\n\r\n", + + ["keyword", "flowchart"], + " TB\r\n A ", + ["operator", "&"], + " B", + ["arrow", "-->"], + " C ", + ["operator", "&"], + " D\r\n\r\n", + + ["keyword", "flowchart"], + " TB\r\n A ", + ["arrow", "-->"], + " C\r\n A ", + ["arrow", "-->"], + " D\r\n B ", + ["arrow", "-->"], + " C\r\n B ", + ["arrow", "-->"], + " D\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A ", + ["arrow", "--o"], + " B\r\n B ", + ["arrow", "--x"], + " C\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n A ", + ["arrow", "o--o"], + " B\r\n B ", + ["arrow", "<-->"], + " C\r\n C ", + ["arrow", "x--x"], + " D\r\n\r\n", + + ["keyword", "flowchart"], + " TD\r\n A", + ["text", "[Start]"], + ["arrow", "-->"], + " B", + ["text", "{Is it?}"], + ["punctuation", ";"], + + "\r\n B ", + ["arrow", "-->"], + ["label", "|Yes|"], + " C", + ["text", "[OK]"], + ["punctuation", ";"], + + "\r\n C ", + ["arrow", "-->"], + " D", + ["text", "[Rethink]"], + ["punctuation", ";"], + + "\r\n D ", + ["arrow", "-->"], + " B", + ["punctuation", ";"], + + "\r\n B ", + ["arrow", "---->"], + ["label", "|No|"], + " E", + ["text", "[End]"], + ["punctuation", ";"], + + ["keyword", "flowchart"], + " TD\r\n A", + ["text", "[Start]"], + ["arrow", "-->"], + " B", + ["text", "{Is it?}"], + ["punctuation", ";"], + + "\r\n B ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "Yes"], + ["arrow", "-->"] + ]], + " C", + ["text", "[OK]"], + ["punctuation", ";"], + + "\r\n C ", + ["arrow", "-->"], + " D", + ["text", "[Rethink]"], + ["punctuation", ";"], + + "\r\n D ", + ["arrow", "-->"], + " B", + ["punctuation", ";"], + + "\r\n B ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "No"], + ["arrow", "---->"] + ]], + " E", + ["text", "[End]"], + ["punctuation", ";"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "[\"This is the (text) in the box\"]"], + + ["keyword", "flowchart"], + " LR\r\n A", + ["text", "[\"A double quote:#quot;\"]"], + ["arrow", "-->"], + "B", + ["text", "[\"A dec char:#9829;\"]"], + + ["keyword", "subgraph"], " title\r\n ", + ["keyword", "graph"], " definition\r\n", + ["keyword", "end"], + + ["keyword", "flowchart"], " TB\r\n c1", ["arrow", "-->"], "a2\r\n ", + ["keyword", "subgraph"], " one\r\n a1", ["arrow", "-->"], "a2\r\n ", + ["keyword", "end"], + ["keyword", "subgraph"], " two\r\n b1", ["arrow", "-->"], "b2\r\n ", + ["keyword", "end"], + ["keyword", "subgraph"], " three\r\n c1", ["arrow", "-->"], "c2\r\n ", + ["keyword", "end"], + + ["keyword", "flowchart"], " TB\r\n c1", ["arrow", "-->"], "a2\r\n ", + ["keyword", "subgraph"], " ide1 ", ["text", "[one]"], + "\r\n a1", ["arrow", "-->"], "a2\r\n ", + ["keyword", "end"], + + ["keyword", "flowchart"], + " TB\r\n c1", + ["arrow", "-->"], + "a2\r\n ", + + ["keyword", "subgraph"], + " one\r\n a1", + ["arrow", "-->"], + "a2\r\n ", + + ["keyword", "end"], + + ["keyword", "subgraph"], + " two\r\n b1", + ["arrow", "-->"], + "b2\r\n ", + + ["keyword", "end"], + + ["keyword", "subgraph"], + " three\r\n c1", + ["arrow", "-->"], + "c2\r\n ", + + ["keyword", "end"], + + "\r\n one ", + ["arrow", "-->"], + " two\r\n three ", + ["arrow", "-->"], + " two\r\n two ", + ["arrow", "-->"], + " c2\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n ", + + ["keyword", "subgraph"], + " TOP\r\n ", + + ["keyword", "direction"], + " TB\r\n ", + + ["keyword", "subgraph"], + " B1\r\n ", + + ["keyword", "direction"], + " RL\r\n i1 ", + ["arrow", "-->"], + "f1\r\n ", + + ["keyword", "end"], + + ["keyword", "subgraph"], + " B2\r\n ", + + ["keyword", "direction"], + " BT\r\n i2 ", + ["arrow", "-->"], + "f2\r\n ", + + ["keyword", "end"], + + ["keyword", "end"], + + "\r\n A ", + ["arrow", "-->"], + " TOP ", + ["arrow", "-->"], + " B\r\n B1 ", + ["arrow", "-->"], + " B2\r\n\r\n", + + ["keyword", "click"], + " nodeId callback\r\n", + + ["keyword", "click"], + " nodeId call callback", + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "flowchart"], + " LR", + ["punctuation", ";"], + + "\r\n A", + ["arrow", "-->"], + "B", + ["punctuation", ";"], + + "\r\n B", + ["arrow", "-->"], + "C", + ["punctuation", ";"], + + "\r\n C", + ["arrow", "-->"], + "D", + ["punctuation", ";"], + + ["keyword", "click"], + " A callback ", + ["string", "\"Tooltip for a callback\""], + + ["keyword", "click"], + " B ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a tooltip for a link\""], + + ["keyword", "click"], + " A call callback", + ["punctuation", "("], + ["punctuation", ")"], + ["string", "\"Tooltip for a callback\""], + + ["keyword", "click"], + " B href ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a tooltip for a link\""], + + ["keyword", "flowchart"], + " LR", + ["punctuation", ";"], + + "\r\n A", + ["arrow", "-->"], + "B", + ["punctuation", ";"], + + "\r\n B", + ["arrow", "-->"], + "C", + ["punctuation", ";"], + + "\r\n C", + ["arrow", "-->"], + "D", + ["punctuation", ";"], + + "\r\n D", + ["arrow", "-->"], + "E", + ["punctuation", ";"], + + ["keyword", "click"], + " A ", + ["string", "\"http://www.github.com\""], + " _blank\r\n ", + + ["keyword", "click"], + " B ", + ["string", "\"http://www.github.com\""], + ["string", "\"Open this in a new tab\""], + " _blank\r\n ", + + ["keyword", "click"], + " C href ", + ["string", "\"http://www.github.com\""], + " _blank\r\n ", + + ["keyword", "click"], + " D href ", + ["string", "\"http://www.github.com\""], + ["string", "\"Open this in a new tab\""], + " _blank\r\n\r\n", + + ["keyword", "flowchart"], + " LR\r\n", + + ["comment", "%% this is a comment A -- text --> B{node}"], + + "\r\n A ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "text"], + ["arrow", "-->"] + ]], + " B ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "text2"], + ["arrow", "-->"] + ]], + " C\r\n\r\n", + + ["keyword", "linkStyle"], + " 3 ", + ["style", [ + ["property", "stroke"], + ["operator", ":"], + "#ff3", + ["punctuation", ","], + ["property", "stroke-width"], + ["operator", ":"], + "4px", + ["punctuation", ","], + ["property", "color"], + ["operator", ":"], + "red" + ]], + ["punctuation", ";"], + + ["keyword", "flowchart"], + " LR\r\n id1", + ["text", "(Start)"], + ["arrow", "-->"], + "id2", + ["text", "(Stop)"], + + ["keyword", "style"], + " id1 ", + ["style", [ + ["property", "fill"], + ["operator", ":"], + "#f9f", + ["punctuation", ","], + ["property", "stroke"], + ["operator", ":"], + "#333", + ["punctuation", ","], + ["property", "stroke-width"], + ["operator", ":"], + "4px" + ]], + + ["keyword", "style"], + " id2 ", + ["style", [ + ["property", "fill"], + ["operator", ":"], + "#bbf", + ["punctuation", ","], + ["property", "stroke"], + ["operator", ":"], + "#f66", + ["punctuation", ","], + ["property", "stroke-width"], + ["operator", ":"], + "2px", + ["punctuation", ","], + ["property", "color"], + ["operator", ":"], + "#fff", + ["punctuation", ","], + ["property", "stroke-dasharray"], + ["operator", ":"], + " 5 5" + ]], + + ["keyword", "classDef"], + " className ", + ["style", [ + ["property", "fill"], + ["operator", ":"], + "#f9f", + ["punctuation", ","], + ["property", "stroke"], + ["operator", ":"], + "#333", + ["punctuation", ","], + ["property", "stroke-width"], + ["operator", ":"], + "4px" + ]], + ["punctuation", ";"], + + ["keyword", "class"], " nodeId1 className", ["punctuation", ";"], + + ["keyword", "class"], " nodeId1,nodeId2 className", ["punctuation", ";"], + + ["keyword", "flowchart"], + " LR\r\n A", + ["operator", ":::"], + "someclass ", + ["arrow", "-->"], + " B\r\n ", + + ["keyword", "classDef"], + " someclass ", + ["style", [ + ["property", "fill"], + ["operator", ":"], + "#f96" + ]], + ["punctuation", ";"], + + ["keyword", "flowchart"], + " LR", + ["punctuation", ";"], + + "\r\n A", + ["arrow", "-->"], + "B", + ["text", "[AAABBB]"], + ["punctuation", ";"], + + "\r\n B", + ["arrow", "-->"], + "D", + ["punctuation", ";"], + + ["keyword", "class"], + " A cssClass", + ["punctuation", ";"], + + ["keyword", "classDef"], + " default ", + ["style", [ + ["property", "fill"], + ["operator", ":"], + "#f9f", + ["punctuation", ","], + ["property", "stroke"], + ["operator", ":"], + "#333", + ["punctuation", ","], + ["property", "stroke-width"], + ["operator", ":"], + "4px" + ]], + ["punctuation", ";"], + + ["keyword", "flowchart"], + " TD\r\n B", + ["text", "[\"fa:fa-twitter for peace\"]"], + + "\r\n B", + ["arrow", "-->"], + "C", + ["text", "[fa:fa-ban forbidden]"], + + "\r\n B", + ["arrow", "-->"], + "D", + ["text", "(fa:fa-spinner)"], + ["punctuation", ";"], + + "\r\n B", + ["arrow", "-->"], + "E", + ["text", "(A fa:fa-camera-retro perhaps?)"], + ["punctuation", ";"], + + ["keyword", "flowchart"], + " LR\r\n A", + ["text", "[Hard edge]"], + ["arrow", "-->"], + ["label", "|Link text|"], + " B", + ["text", "(Round edge)"], + + "\r\n B ", + ["arrow", "-->"], + " C", + ["text", "{Decision}"], + + "\r\n C ", + ["arrow", "-->"], + ["label", "|One|"], + " D", + ["text", "[Result one]"], + + "\r\n C ", + ["arrow", "-->"], + ["label", "|Two|"], + " E", + ["text", "[Result two]"], + + ["keyword", "flowchart"], + " LR", + ["punctuation", ";"], + + "\r\n A", + ["arrow", "-->"], + "B", + ["punctuation", ";"], + + "\r\n B", + ["arrow", "-->"], + "C", + ["punctuation", ";"], + + "\r\n C", + ["arrow", "-->"], + "D", + ["punctuation", ";"], + + ["keyword", "click"], + " A callback ", + ["string", "\"Tooltip\""], + + ["keyword", "click"], + " B ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a link\""], + + ["keyword", "click"], + " C call callback", + ["punctuation", "("], + ["punctuation", ")"], + ["string", "\"Tooltip\""], + + ["keyword", "click"], + " D href ", + ["string", "\"http://www.github.com\""], + ["string", "\"This is a link\""] +] diff --git a/tests/languages/mermaid/full_sequencediagram.test b/tests/languages/mermaid/full_sequencediagram.test new file mode 100644 index 0000000000..ec954bc24d --- /dev/null +++ b/tests/languages/mermaid/full_sequencediagram.test @@ -0,0 +1,389 @@ +sequenceDiagram + Alice->>John: Hello John, how are you? + John-->>Alice: Great! + Alice-)John: See you later! + +sequenceDiagram + participant John + participant Alice + Alice->>John: Hello John, how are you? + John-->>Alice: Great! + +sequenceDiagram + participant A as Alice + participant J as John + A->>J: Hello John, how are you? + J->>A: Great! + +[Actor][Arrow][Actor]:Message text + +sequenceDiagram + Alice->>John: Hello John, how are you? + activate John + John-->>Alice: Great! + deactivate John + +sequenceDiagram + Alice->>+John: Hello John, how are you? + John-->>-Alice: Great! + +sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! + +sequenceDiagram + participant John + Note right of John: Text in note + +sequenceDiagram + Alice->John: Hello John, how are you? + Note over Alice,John: A typical interaction + +loop Loop text +... statements ... +end + +sequenceDiagram + Alice->John: Hello John, how are you? + loop Every minute + John-->Alice: Great! + end + +alt Describing text +... statements ... +else +... statements ... +end + +opt Describing text +... statements ... +end + +sequenceDiagram + Alice->>Bob: Hello Bob, how are you? + alt is sick + Bob->>Alice: Not so good :( + else is well + Bob->>Alice: Feeling fresh like a daisy + end + opt Extra response + Bob->>Alice: Thanks for asking + end + +par [Action 1] +... statements ... +and [Action 2] +... statements ... +and [Action N] +... statements ... +end + +rect rgb(0, 255, 0) +... content ... +end + +rect rgba(0, 0, 255, .1) +... content ... +end + +sequenceDiagram + Alice->>John: Hello John, how are you? + %% this is a comment + John-->>Alice: Great! + +sequenceDiagram + A->>B: I #9829; you! + B->>A: I #9829; you #infin; times more! + +sequenceDiagram + autonumber + Alice->>John: Hello John, how are you? + loop Healthcheck + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! + +---------------------------------------------------- + +[ + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->>"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n John", + ["arrow", "-->>"], + "Alice", + ["operator", ":"], + " Great!\r\n Alice", + ["arrow", "-)"], + "John", + ["operator", ":"], + " See you later!\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + ["keyword", "participant"], + " John\r\n ", + + ["keyword", "participant"], + " Alice\r\n Alice", + ["arrow", "->>"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n John", + ["arrow", "-->>"], + "Alice", + ["operator", ":"], + " Great!\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + ["keyword", "participant"], + " A as Alice\r\n ", + + ["keyword", "participant"], + " J as John\r\n A", + ["arrow", "->>"], + "J", + ["operator", ":"], + " Hello John, how are you?\r\n J", + ["arrow", "->>"], + "A", + ["operator", ":"], + " Great!\r\n\r\n", + + ["text", "[Actor]"], + ["text", "[Arrow]"], + ["text", "[Actor]"], + ["operator", ":"], + "Message text\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->>"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n ", + + ["keyword", "activate"], + " John\r\n John", + ["arrow", "-->>"], + "Alice", + ["operator", ":"], + " Great!\r\n ", + + ["keyword", "deactivate"], + " John\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->>"], + "+John", + ["operator", ":"], + " Hello John, how are you?\r\n John", + ["arrow", "-->>"], + "-Alice", + ["operator", ":"], + " Great!\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->>"], + "+John", + ["operator", ":"], + " Hello John, how are you?\r\n Alice", + ["arrow", "->>"], + "+John", + ["operator", ":"], + " John, can you hear me?\r\n John", + ["arrow", "-->>"], + "-Alice", + ["operator", ":"], + " Hi Alice, I can hear you!\r\n John", + ["arrow", "-->>"], + "-Alice", + ["operator", ":"], + " I feel great!\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + ["keyword", "participant"], + " John\r\n ", + + ["keyword", "Note right of"], + " John", + ["operator", ":"], + " Text in note\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n ", + + ["keyword", "Note over"], + " Alice,John", + ["operator", ":"], + " A typical interaction\r\n\r\n", + + ["keyword", "loop"], " Loop text\r\n... statements ...\r\n", + ["keyword", "end"], + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n ", + + ["keyword", "loop"], + " Every minute\r\n John", + ["arrow", "-->"], + "Alice", + ["operator", ":"], + " Great!\r\n ", + + ["keyword", "end"], + + ["keyword", "alt"], " Describing text\r\n... statements ...\r\n", + ["keyword", "else"], + "\r\n... statements ...\r\n", + ["keyword", "end"], + + ["keyword", "opt"], " Describing text\r\n... statements ...\r\n", + ["keyword", "end"], + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->>"], + "Bob", + ["operator", ":"], + " Hello Bob, how are you?\r\n ", + + ["keyword", "alt"], + " is sick\r\n Bob", + ["arrow", "->>"], + "Alice", + ["operator", ":"], + " Not so good ", + ["operator", ":"], + ["punctuation", "("], + + ["keyword", "else"], + " is well\r\n Bob", + ["arrow", "->>"], + "Alice", + ["operator", ":"], + " Feeling fresh like a daisy\r\n ", + + ["keyword", "end"], + + ["keyword", "opt"], + " Extra response\r\n Bob", + ["arrow", "->>"], + "Alice", + ["operator", ":"], + " Thanks for asking\r\n ", + + ["keyword", "end"], + + ["keyword", "par"], ["text", "[Action 1]"], + "\r\n... statements ...\r\n", + ["keyword", "and"], ["text", "[Action 2]"], + "\r\n... statements ...\r\n", + ["keyword", "and"], ["text", "[Action N]"], + "\r\n... statements ...\r\n", + ["keyword", "end"], + + ["keyword", "rect"], " rgb", ["text", "(0, 255, 0)"], + "\r\n... content ...\r\n", + ["keyword", "end"], + + ["keyword", "rect"], " rgba", ["text", "(0, 0, 255, .1)"], + "\r\n... content ...\r\n", + ["keyword", "end"], + + ["keyword", "sequenceDiagram"], + + "\r\n Alice", + ["arrow", "->>"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n ", + + ["comment", "%% this is a comment"], + + "\r\n John", + ["arrow", "-->>"], + "Alice", + ["operator", ":"], + " Great!\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + "\r\n A", + ["arrow", "->>"], + "B", + ["operator", ":"], + " I ", + ["entity", "#9829;"], + " you!\r\n B", + ["arrow", "->>"], + "A", + ["operator", ":"], + " I ", + ["entity", "#9829;"], + " you ", + ["entity", "#infin;"], + " times more!\r\n\r\n", + + ["keyword", "sequenceDiagram"], + + ["keyword", "autonumber"], + + "\r\n Alice", + ["arrow", "->>"], + "John", + ["operator", ":"], + " Hello John, how are you?\r\n ", + + ["keyword", "loop"], + " Healthcheck\r\n John", + ["arrow", "->>"], + "John", + ["operator", ":"], + " Fight against hypochondria\r\n ", + + ["keyword", "end"], + + ["keyword", "Note right of"], + " John", + ["operator", ":"], + " Rational thoughts!\r\n John", + ["arrow", "-->>"], + "Alice", + ["operator", ":"], + " Great!\r\n John", + ["arrow", "->>"], + "Bob", + ["operator", ":"], + " How about you?\r\n Bob", + ["arrow", "-->>"], + "John", + ["operator", ":"], + " Jolly good!" +] diff --git a/tests/languages/mermaid/full_statediagram.test b/tests/languages/mermaid/full_statediagram.test new file mode 100644 index 0000000000..a5d1f27bf4 --- /dev/null +++ b/tests/languages/mermaid/full_statediagram.test @@ -0,0 +1,430 @@ +stateDiagram-v2 + [*] --> Still + Still --> [*] + + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] + +stateDiagram-v2 + s1 --> s2 + +stateDiagram-v2 + s1 --> s2: A transition + +stateDiagram-v2 + [*] --> s1 + s1 --> [*] + +stateDiagram-v2 + [*] --> First + state First { + [*] --> second + second --> [*] + } + +stateDiagram-v2 + [*] --> First + + state First { + [*] --> Second + + state Second { + [*] --> second + second --> Third + + state Third { + [*] --> third + third --> [*] + } + } + } + +stateDiagram-v2 + [*] --> First + First --> Second + First --> Third + + state First { + [*] --> fir + fir --> [*] + } + state Second { + [*] --> sec + sec --> [*] + } + state Third { + [*] --> thi + thi --> [*] + } + +stateDiagram-v2 + state if_state <> + [*] --> IsPositive + IsPositive --> if_state + if_state --> False: if n < 0 + if_state --> True : if n >= 0 + +stateDiagram-v2 + state fork_state <> + [*] --> fork_state + fork_state --> State2 + fork_state --> State3 + + state join_state <> + State2 --> join_state + State3 --> join_state + join_state --> State4 + State4 --> [*] + +stateDiagram-v2 + State1: The state with a note + note right of State1 + Important information! You can write + notes. + end note + State1 --> State2 + note left of State2 : This is the note to the left. + +stateDiagram-v2 + [*] --> Active + + state Active { + [*] --> NumLockOff + NumLockOff --> NumLockOn : EvNumLockPressed + NumLockOn --> NumLockOff : EvNumLockPressed + -- + [*] --> CapsLockOff + CapsLockOff --> CapsLockOn : EvCapsLockPressed + CapsLockOn --> CapsLockOff : EvCapsLockPressed + -- + [*] --> ScrollLockOff + ScrollLockOff --> ScrollLockOn : EvScrollLockPressed + ScrollLockOn --> ScrollLockOff : EvScrollLockPressed + } + +stateDiagram + direction LR + [*] --> A + A --> B + B --> C + state B { + direction LR + a --> b + } + B --> D + +stateDiagram-v2 + [*] --> Still + Still --> [*] +%% this is a comment + Still --> Moving + Moving --> Still %% another comment + Moving --> Crash + Crash --> [*] + +---------------------------------------------------- + +[ + ["keyword", "stateDiagram-v2"], + + ["text", "[*]"], + ["arrow", "-->"], + " Still\r\n Still ", + ["arrow", "-->"], + ["text", "[*]"], + + "\r\n\r\n Still ", + ["arrow", "-->"], + " Moving\r\n Moving ", + ["arrow", "-->"], + " Still\r\n Moving ", + ["arrow", "-->"], + " Crash\r\n Crash ", + ["arrow", "-->"], + ["text", "[*]"], + + ["keyword", "stateDiagram-v2"], + "\r\n s1 ", ["arrow", "-->"], " s2\r\n\r\n", + + ["keyword", "stateDiagram-v2"], + + "\r\n s1 ", + ["arrow", "-->"], + " s2", + ["operator", ":"], + " A transition\r\n\r\n", + + ["keyword", "stateDiagram-v2"], + + ["text", "[*]"], + ["arrow", "-->"], + " s1\r\n s1 ", + ["arrow", "-->"], + ["text", "[*]"], + + ["keyword", "stateDiagram-v2"], + + ["text", "[*]"], + ["arrow", "-->"], + " First\r\n ", + + ["keyword", "state"], + " First ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " second\r\n second ", + ["arrow", "-->"], + ["text", "[*]"], + + ["punctuation", "}"], + + ["keyword", "stateDiagram-v2"], + ["text", "[*]"], ["arrow", "-->"], " First\r\n\r\n ", + + ["keyword", "state"], " First ", ["punctuation", "{"], + ["text", "[*]"], ["arrow", "-->"], " Second\r\n\r\n ", + + ["keyword", "state"], + " Second ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " second\r\n second ", + ["arrow", "-->"], + " Third\r\n\r\n ", + + ["keyword", "state"], + " Third ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " third\r\n third ", + ["arrow", "-->"], + ["text", "[*]"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["keyword", "stateDiagram-v2"], + + ["text", "[*]"], + ["arrow", "-->"], + " First\r\n First ", + ["arrow", "-->"], + " Second\r\n First ", + ["arrow", "-->"], + " Third\r\n\r\n ", + + ["keyword", "state"], + " First ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " fir\r\n fir ", + ["arrow", "-->"], + ["text", "[*]"], + + ["punctuation", "}"], + + ["keyword", "state"], + " Second ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " sec\r\n sec ", + ["arrow", "-->"], + ["text", "[*]"], + + ["punctuation", "}"], + + ["keyword", "state"], + " Third ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " thi\r\n thi ", + ["arrow", "-->"], + ["text", "[*]"], + + ["punctuation", "}"], + + ["keyword", "stateDiagram-v2"], + + ["keyword", "state"], + " if_state ", + ["annotation", "<>"], + + ["text", "[*]"], + ["arrow", "-->"], + " IsPositive\r\n IsPositive ", + ["arrow", "-->"], + " if_state\r\n if_state ", + ["arrow", "-->"], + " False", + ["operator", ":"], + " if n < 0\r\n if_state ", + ["arrow", "-->"], + " True ", + ["operator", ":"], + " if n >= 0\r\n\r\n", + + ["keyword", "stateDiagram-v2"], + + ["keyword", "state"], + " fork_state ", + ["annotation", "<>"], + + ["text", "[*]"], + ["arrow", "-->"], + " fork_state\r\n fork_state ", + ["arrow", "-->"], + " State2\r\n fork_state ", + ["arrow", "-->"], + " State3\r\n\r\n ", + + ["keyword", "state"], + " join_state ", + ["annotation", "<>"], + + "\r\n State2 ", + ["arrow", "-->"], + " join_state\r\n State3 ", + ["arrow", "-->"], + " join_state\r\n join_state ", + ["arrow", "-->"], + " State4\r\n State4 ", + ["arrow", "-->"], + ["text", "[*]"], + + ["keyword", "stateDiagram-v2"], + + "\r\n State1", + ["operator", ":"], + " The state with a note\r\n ", + + ["keyword", "note right of"], + " State1\r\n Important information! You can write\r\n notes.\r\n ", + + ["keyword", "end note"], + + "\r\n State1 ", + ["arrow", "-->"], + " State2\r\n ", + + ["keyword", "note left of"], + " State2 ", + ["operator", ":"], + " This is the note to the left.\r\n\r\n", + + ["keyword", "stateDiagram-v2"], + ["text", "[*]"], ["arrow", "-->"], " Active\r\n\r\n ", + + ["keyword", "state"], + " Active ", + ["punctuation", "{"], + + ["text", "[*]"], + ["arrow", "-->"], + " NumLockOff\r\n NumLockOff ", + ["arrow", "-->"], + " NumLockOn ", + ["operator", ":"], + " EvNumLockPressed\r\n NumLockOn ", + ["arrow", "-->"], + " NumLockOff ", + ["operator", ":"], + " EvNumLockPressed\r\n ", + + ["arrow", "--"], + + ["text", "[*]"], + ["arrow", "-->"], + " CapsLockOff\r\n CapsLockOff ", + ["arrow", "-->"], + " CapsLockOn ", + ["operator", ":"], + " EvCapsLockPressed\r\n CapsLockOn ", + ["arrow", "-->"], + " CapsLockOff ", + ["operator", ":"], + " EvCapsLockPressed\r\n ", + + ["arrow", "--"], + + ["text", "[*]"], + ["arrow", "-->"], + " ScrollLockOff\r\n ScrollLockOff ", + ["arrow", "-->"], + " ScrollLockOn ", + ["operator", ":"], + " EvScrollLockPressed\r\n ScrollLockOn ", + ["arrow", "-->"], + " ScrollLockOff ", + ["operator", ":"], + " EvScrollLockPressed\r\n ", + + ["punctuation", "}"], + + ["keyword", "stateDiagram"], + + ["keyword", "direction"], + " LR\r\n ", + + ["text", "[*]"], + ["arrow", "-->"], + " A\r\n A ", + ["arrow", "-->"], + " B\r\n B ", + ["arrow", "-->"], + " C\r\n ", + + ["keyword", "state"], + " B ", + ["punctuation", "{"], + + ["keyword", "direction"], + " LR\r\n a ", + ["arrow", "-->"], + " b\r\n ", + + ["punctuation", "}"], + + "\r\n B ", + ["arrow", "-->"], + " D\r\n\r\n", + + ["keyword", "stateDiagram-v2"], + + ["text", "[*]"], + ["arrow", "-->"], + " Still\r\n Still ", + ["arrow", "-->"], + ["text", "[*]"], + + ["comment", "%% this is a comment"], + + "\r\n Still ", + ["arrow", "-->"], + " Moving\r\n Moving ", + ["arrow", "-->"], + " Still ", + ["comment", "%% another comment"], + + "\r\n Moving ", + ["arrow", "-->"], + " Crash\r\n Crash ", + ["arrow", "-->"], + ["text", "[*]"] +] diff --git a/tests/languages/mermaid/inter-arrow-label_feature.test b/tests/languages/mermaid/inter-arrow-label_feature.test new file mode 100644 index 0000000000..8c07daf5a3 --- /dev/null +++ b/tests/languages/mermaid/inter-arrow-label_feature.test @@ -0,0 +1,62 @@ +A -.s .- C +A -. s .- C +A -. "asdasd" .- C +A -- "asdasd" --> C +A -- "asdasd" --> C +A -- "asdasd" .- C +A -- "asdasd" === C +A -- "asdasd" ==> C + +---------------------------------------------------- + +[ + "A ", + ["inter-arrow-label", [ + ["arrow-head", "-."], + ["label", "s"], + ["arrow", ".-"] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "-."], + ["label", "s"], + ["arrow", ".-"] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "-."], + ["label", "\"asdasd\""], + ["arrow", ".-"] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "\"asdasd\""], + ["arrow", "-->"] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "\"asdasd\""], + ["arrow", "-->"] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "\"asdasd\""], + ["arrow", ".-"] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "\"asdasd\""], + ["arrow", "==="] + ]], + " C\r\nA ", + ["inter-arrow-label", [ + ["arrow-head", "--"], + ["label", "\"asdasd\""], + ["arrow", "==>"] + ]], + " C" +] diff --git a/tests/languages/mermaid/operator_feature.test b/tests/languages/mermaid/operator_feature.test new file mode 100644 index 0000000000..7ee9a5fbe6 --- /dev/null +++ b/tests/languages/mermaid/operator_feature.test @@ -0,0 +1,11 @@ +A & B + +: ::: + +---------------------------------------------------- + +[ + "A ", ["operator", "&"], " B\r\n\r\n", + + ["operator", ":"], ["operator", ":::"] +] diff --git a/tests/languages/mongodb/document_feature.test b/tests/languages/mongodb/document_feature.test new file mode 100644 index 0000000000..6d5c5fff1f --- /dev/null +++ b/tests/languages/mongodb/document_feature.test @@ -0,0 +1,206 @@ +{ + '_id': ObjectId('5ec72ffe00316be87cab3927'), + 'code': Code('function () { return 22; }'), + 'binary': BinData(1, '232sa3d323sd232a32sda3s2d3a2s1d23s21d3sa'), + 'dbref': DBRef('namespace', ObjectId('5ec72f4200316be87cab3926'), 'db'), + 'timestamp': Timestamp(0, 0), + 'long': NumberLong(9223372036854775807), + 'decimal': NumberDecimal('1000.55'), + 'integer': 100, + 'maxkey': MaxKey(), + 'minkey': MinKey(), + 'isodate': ISODate('2012-01-01T00:00:00.000Z'), + 'regexp': RegExp('prism(js)?', 'i'), + 'string': 'Hello World', + 'numberArray': [1, 2, 3], + 'stringArray': ['1','2','3'], + 'randomKey': null, + 'object': { 'a': 1, 'b': 2 }, + 'max_key2': MaxKey(), + 'number': 1234, + 'invalid-key': 123, + noQuotesKey: 'value', +} + +---------------------------------------------------- + +[ + ["punctuation", "{"], + + ["string-property", "'_id'"], + ["operator", ":"], + ["builtin", "ObjectId"], + ["punctuation", "("], + ["string", ["'5ec72ffe00316be87cab3927'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'code'"], + ["operator", ":"], + ["builtin", "Code"], + ["punctuation", "("], + ["string", ["'function () { return 22; }'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'binary'"], + ["operator", ":"], + ["builtin", "BinData"], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ","], + ["string", ["'232sa3d323sd232a32sda3s2d3a2s1d23s21d3sa'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'dbref'"], + ["operator", ":"], + ["builtin", "DBRef"], + ["punctuation", "("], + ["string", ["'namespace'"]], + ["punctuation", ","], + ["builtin", "ObjectId"], + ["punctuation", "("], + ["string", ["'5ec72f4200316be87cab3926'"]], + ["punctuation", ")"], + ["punctuation", ","], + ["string", ["'db'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'timestamp'"], + ["operator", ":"], + ["builtin", "Timestamp"], + ["punctuation", "("], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'long'"], + ["operator", ":"], + ["builtin", "NumberLong"], + ["punctuation", "("], + ["number", "9223372036854775807"], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'decimal'"], + ["operator", ":"], + ["builtin", "NumberDecimal"], + ["punctuation", "("], + ["string", ["'1000.55'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'integer'"], + ["operator", ":"], + ["number", "100"], + ["punctuation", ","], + + ["string-property", "'maxkey'"], + ["operator", ":"], + ["builtin", "MaxKey"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'minkey'"], + ["operator", ":"], + ["builtin", "MinKey"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'isodate'"], + ["operator", ":"], + ["builtin", "ISODate"], + ["punctuation", "("], + ["string", ["'2012-01-01T00:00:00.000Z'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'regexp'"], + ["operator", ":"], + ["builtin", "RegExp"], + ["punctuation", "("], + ["string", ["'prism(js)?'"]], + ["punctuation", ","], + ["string", ["'i'"]], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'string'"], + ["operator", ":"], + ["string", ["'Hello World'"]], + ["punctuation", ","], + + ["string-property", "'numberArray'"], + ["operator", ":"], + ["punctuation", "["], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", "]"], + ["punctuation", ","], + + ["string-property", "'stringArray'"], + ["operator", ":"], + ["punctuation", "["], + ["string", ["'1'"]], + ["punctuation", ","], + ["string", ["'2'"]], + ["punctuation", ","], + ["string", ["'3'"]], + ["punctuation", "]"], + ["punctuation", ","], + + ["string-property", "'randomKey'"], + ["operator", ":"], + ["keyword", "null"], + ["punctuation", ","], + + ["string-property", "'object'"], + ["operator", ":"], + ["punctuation", "{"], + ["string-property", "'a'"], + ["operator", ":"], + ["number", "1"], + ["punctuation", ","], + ["string-property", "'b'"], + ["operator", ":"], + ["number", "2"], + ["punctuation", "}"], + ["punctuation", ","], + + ["string-property", "'max_key2'"], + ["operator", ":"], + ["builtin", "MaxKey"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + + ["string-property", "'number'"], + ["operator", ":"], + ["number", "1234"], + ["punctuation", ","], + + ["string-property", "'invalid-key'"], + ["operator", ":"], + ["number", "123"], + ["punctuation", ","], + + ["property", ["noQuotesKey"]], + ["operator", ":"], + ["string", ["'value'"]], + ["punctuation", ","], + + ["punctuation", "}"] +] + +---------------------------------------------------- + +Common document. diff --git a/tests/languages/mongodb/functions_feature.test b/tests/languages/mongodb/functions_feature.test new file mode 100644 index 0000000000..e3ccaaaa52 --- /dev/null +++ b/tests/languages/mongodb/functions_feature.test @@ -0,0 +1,61 @@ +ObjectId() +ObjectId () +Code() +BinData() +DBRef() +Timestamp() +NumberLong() +NumberDecimal() +MaxKey() +MinKey() +RegExp() +ISODate() +UUID() + +---------------------------------------------------- + +[ + ["builtin", "ObjectId"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "ObjectId"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "Code"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "BinData"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "DBRef"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "Timestamp"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "NumberLong"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "NumberDecimal"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "MaxKey"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "MinKey"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "RegExp"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "ISODate"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "UUID"], + ["punctuation", "("], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for built-in functions. diff --git a/tests/languages/mongodb/operations_feature.test b/tests/languages/mongodb/operations_feature.test new file mode 100644 index 0000000000..057a6873be --- /dev/null +++ b/tests/languages/mongodb/operations_feature.test @@ -0,0 +1,1823 @@ +{ + $eq: {}, + $gt: {}, + $gte: {}, + $in: {}, + $lt: {}, + $lte: {}, + $ne: {}, + $nin: {}, + $and: {}, + $not: {}, + $nor: {}, + $or: {}, + $exists: {}, + $type: {}, + $expr: {}, + $jsonSchema: {}, + $mod: {}, + $regex: {}, + $text: {}, + $where: {}, + $geoIntersects: {}, + $geoWithin: {}, + $near: {}, + $nearSphere: {}, + $all: {}, + $elemMatch: {}, + $size: {}, + $bitsAllClear: {}, + $bitsAllSet: {}, + $bitsAnyClear: {}, + $bitsAnySet: {}, + $comment: {}, + $elemMatch: {}, + $meta: {}, + $slice: {}, + $currentDate: {}, + $inc: {}, + $min: {}, + $max: {}, + $mul: {}, + $rename: {}, + $set: {}, + $setOnInsert: {}, + $unset: {}, + $addToSet: {}, + $pop: {}, + $pull: {}, + $push: {}, + $pullAll: {}, + $each: {}, + $position: {}, + $slice: {}, + $sort: {}, + $bit: {}, + $addFields: {}, + $bucket: {}, + $bucketAuto: {}, + $collStats: {}, + $count: {}, + $currentOp: {}, + $facet: {}, + $geoNear: {}, + $graphLookup: {}, + $group: {}, + $indexStats: {}, + $limit: {}, + $listLocalSessions: {}, + $listSessions: {}, + $lookup: {}, + $match: {}, + $merge: {}, + $out: {}, + $planCacheStats: {}, + $project: {}, + $redact: {}, + $replaceRoot: {}, + $replaceWith: {}, + $sample: {}, + $set: {}, + $skip: {}, + $sort: {}, + $sortByCount: {}, + $unionWith: {}, + $unset: {}, + $unwind: {}, + $abs: {}, + $accumulator: {}, + $acos: {}, + $acosh: {}, + $add: {}, + $addToSet: {}, + $allElementsTrue: {}, + $and: {}, + $anyElementTrue: {}, + $arrayElemAt: {}, + $arrayToObject: {}, + $asin: {}, + $asinh: {}, + $atan: {}, + $atan2: {}, + $atanh: {}, + $avg: {}, + $binarySize: {}, + $bsonSize: {}, + $ceil: {}, + $cmp: {}, + $concat: {}, + $concatArrays: {}, + $cond: {}, + $convert: {}, + $cos: {}, + $dateFromParts: {}, + $dateToParts: {}, + $dateFromString: {}, + $dateToString: {}, + $dayOfMonth: {}, + $dayOfWeek: {}, + $dayOfYear: {}, + $degreesToRadians: {}, + $divide: {}, + $eq: {}, + $exp: {}, + $filter: {}, + $first: {}, + $floor: {}, + $function: {}, + $gt: {}, + $gte: {}, + $hour: {}, + $ifNull: {}, + $in: {}, + $indexOfArray: {}, + $indexOfBytes: {}, + $indexOfCP: {}, + $isArray: {}, + $isNumber: {}, + $isoDayOfWeek: {}, + $isoWeek: {}, + $isoWeekYear: {}, + $last: {}, + $last: {}, + $let: {}, + $literal: {}, + $ln: {}, + $log: {}, + $log10: {}, + $lt: {}, + $lte: {}, + $ltrim: {}, + $map: {}, + $max: {}, + $mergeObjects: {}, + $meta: {}, + $min: {}, + $millisecond: {}, + $minute: {}, + $mod: {}, + $month: {}, + $multiply: {}, + $ne: {}, + $not: {}, + $objectToArray: {}, + $or: {}, + $pow: {}, + $push: {}, + $radiansToDegrees: {}, + $range: {}, + $reduce: {}, + $regexFind: {}, + $regexFindAll: {}, + $regexMatch: {}, + $replaceOne: {}, + $replaceAll: {}, + $reverseArray: {}, + $round: {}, + $rtrim: {}, + $second: {}, + $setDifference: {}, + $setEquals: {}, + $setIntersection: {}, + $setIsSubset: {}, + $setUnion: {}, + $size: {}, + $sin: {}, + $slice: {}, + $split: {}, + $sqrt: {}, + $stdDevPop: {}, + $stdDevSamp: {}, + $strcasecmp: {}, + $strLenBytes: {}, + $strLenCP: {}, + $substr: {}, + $substrBytes: {}, + $substrCP: {}, + $subtract: {}, + $sum: {}, + $switch: {}, + $tan: {}, + $toBool: {}, + $toDate: {}, + $toDecimal: {}, + $toDouble: {}, + $toInt: {}, + $toLong: {}, + $toObjectId: {}, + $toString: {}, + $toLower: {}, + $toUpper: {}, + $trim: {}, + $trunc: {}, + $type: {}, + $week: {}, + $year: {}, + $zip: {}, + $comment: {}, + $explain: {}, + $hint: {}, + $max: {}, + $maxTimeMS: {}, + $min: {}, + $orderby: {}, + $query: {}, + $returnKey: {}, + $showDiskLoc: {}, + $natural: {}, +} + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["property", [ + ["keyword", "$eq"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$gt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$gte"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$in"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$lt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$lte"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$ne"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$nin"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$and"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$not"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$nor"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$or"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$exists"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$type"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$expr"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$jsonSchema"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$mod"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$regex"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$text"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$where"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$geoIntersects"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$geoWithin"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$near"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$nearSphere"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$all"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$elemMatch"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$size"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bitsAllClear"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bitsAllSet"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bitsAnyClear"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bitsAnySet"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$comment"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$elemMatch"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$meta"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$slice"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$currentDate"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$inc"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$min"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$max"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$mul"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$rename"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$set"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$setOnInsert"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$unset"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$addToSet"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$pop"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$pull"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$push"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$pullAll"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$each"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$position"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$slice"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sort"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bit"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$addFields"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bucket"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bucketAuto"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$collStats"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$count"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$currentOp"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$facet"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$geoNear"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$graphLookup"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$group"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$indexStats"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$limit"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$listLocalSessions"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$listSessions"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$lookup"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$match"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$merge"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$out"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$planCacheStats"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$project"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$redact"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$replaceRoot"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$replaceWith"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sample"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$set"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$skip"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sort"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sortByCount"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$unionWith"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$unset"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$unwind"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$abs"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$accumulator"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$acos"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$acosh"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$add"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$addToSet"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$allElementsTrue"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$and"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$anyElementTrue"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$arrayElemAt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$arrayToObject"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$asin"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$asinh"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$atan"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$atan2"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$atanh"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$avg"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$binarySize"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$bsonSize"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$ceil"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$cmp"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$concat"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$concatArrays"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$cond"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$convert"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$cos"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dateFromParts"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dateToParts"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dateFromString"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dateToString"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dayOfMonth"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dayOfWeek"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$dayOfYear"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$degreesToRadians"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$divide"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$eq"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$exp"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$filter"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$first"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$floor"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$function"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$gt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$gte"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$hour"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$ifNull"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$in"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$indexOfArray"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$indexOfBytes"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$indexOfCP"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$isArray"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$isNumber"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$isoDayOfWeek"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$isoWeek"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$isoWeekYear"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$last"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$last"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$let"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$literal"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$ln"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$log"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$log10"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$lt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$lte"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$ltrim"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$map"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$max"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$mergeObjects"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$meta"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$min"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$millisecond"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$minute"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$mod"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$month"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$multiply"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$ne"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$not"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$objectToArray"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$or"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$pow"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$push"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$radiansToDegrees"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$range"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$reduce"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$regexFind"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$regexFindAll"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$regexMatch"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$replaceOne"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$replaceAll"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$reverseArray"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$round"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$rtrim"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$second"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$setDifference"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$setEquals"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$setIntersection"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$setIsSubset"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$setUnion"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$size"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sin"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$slice"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$split"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sqrt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$stdDevPop"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$stdDevSamp"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$strcasecmp"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$strLenBytes"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$strLenCP"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$substr"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$substrBytes"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$substrCP"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$subtract"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$sum"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$switch"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$tan"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toBool"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toDate"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toDecimal"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toDouble"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toInt"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toLong"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toObjectId"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toString"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toLower"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$toUpper"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$trim"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$trunc"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$type"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$week"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$year"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$zip"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$comment"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$explain"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$hint"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$max"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$maxTimeMS"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$min"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$orderby"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$query"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$returnKey"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$showDiskLoc"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$natural"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["punctuation", "}"] +] + + + +---------------------------------------------------- + +Checks for operations. diff --git a/tests/languages/mongodb/query_feature.test b/tests/languages/mongodb/query_feature.test new file mode 100644 index 0000000000..2cfa1004f1 --- /dev/null +++ b/tests/languages/mongodb/query_feature.test @@ -0,0 +1,71 @@ +db.users.find({ + _id: { $nin: ObjectId('5ec72ffe00316be87cab3927') }, + age: { $gte: 18, $lte: 99 }, + field: { $exists: true } +}) + +---------------------------------------------------- + +[ + "db", + ["punctuation", "."], + "users", + ["punctuation", "."], + ["function", "find"], + ["punctuation", "("], + ["punctuation", "{"], + ["property", [ + "_id" + ]], + ["operator", ":"], + ["punctuation", "{"], + ["property", [ + ["keyword", "$nin"] + ]], + ["operator", ":"], + ["builtin", "ObjectId"], + ["punctuation", "("], + ["string", [ + "'5ec72ffe00316be87cab3927'" + ]], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + "age" + ]], + ["operator", ":"], + ["punctuation", "{"], + ["property", [ + ["keyword", "$gte"] + ]], + ["operator", ":"], + ["number", "18"], + ["punctuation", ","], + ["property", [ + ["keyword", "$lte"] + ]], + ["operator", ":"], + ["number", "99"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + "field" + ]], + ["operator", ":"], + ["punctuation", "{"], + ["property", [ + ["keyword", "$exists"] + ]], + ["operator", ":"], + ["boolean", "true"], + ["punctuation", "}"], + ["punctuation", "}"], + ["punctuation", ")"] +] + + + +---------------------------------------------------- + +Common query. diff --git a/tests/languages/mongodb/string_url_and_ip_feature.test b/tests/languages/mongodb/string_url_and_ip_feature.test new file mode 100644 index 0000000000..a4003c0ed3 --- /dev/null +++ b/tests/languages/mongodb/string_url_and_ip_feature.test @@ -0,0 +1,33 @@ +{ + field1: 'Here is url: http://prismjs.com/' + field2: 'Here is ip: 192.168.0.1' +} + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["property", [ + "field1" + ]], + ["operator", ":"], + ["string", [ + "'Here is url: ", + ["url", "http://prismjs.com/"], + "'" + ]], + ["property", [ + "field2" + ]], + ["operator", ":"], + ["string", [ + "'Here is ip: ", + ["entity", "192.168.0.1"], + "'" + ]], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for URL and IP highlighting inside string. diff --git a/tests/languages/mongodb/update_feature.test b/tests/languages/mongodb/update_feature.test new file mode 100644 index 0000000000..9f2867ff2c --- /dev/null +++ b/tests/languages/mongodb/update_feature.test @@ -0,0 +1,81 @@ +db.users.updateOne( + { + _id: ObjectId('5ec72ffe00316be87cab3927') + }, + { + $set: { age: 30 }, + $inc: { updateCount: 1 }, + $push: { updateDates: new Date() } + } +) + +---------------------------------------------------- + +[ + "db", + ["punctuation", "."], + "users", + ["punctuation", "."], + ["function", "updateOne"], + ["punctuation", "("], + ["punctuation", "{"], + ["property", [ + "_id" + ]], + ["operator", ":"], + ["builtin", "ObjectId"], + ["punctuation", "("], + ["string", [ + "'5ec72ffe00316be87cab3927'" + ]], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", ","], + ["punctuation", "{"], + ["property", [ + ["keyword", "$set"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["property", [ + "age" + ]], + ["operator", ":"], + ["number", "30"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$inc"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["property", [ + "updateCount" + ]], + ["operator", ":"], + ["number", "1"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", [ + ["keyword", "$push"] + ]], + ["operator", ":"], + ["punctuation", "{"], + ["property", [ + "updateDates" + ]], + ["operator", ":"], + ["keyword", "new"], + ["class-name", [ + "Date" + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", "}"], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Common update. diff --git a/tests/languages/moonscript/function_feature.test b/tests/languages/moonscript/function_feature.test new file mode 100644 index 0000000000..697ac714f4 --- /dev/null +++ b/tests/languages/moonscript/function_feature.test @@ -0,0 +1,715 @@ +_G +_VERSION +assert +collectgarbage +coroutine.create +coroutine.resume +coroutine.running +coroutine.status +coroutine.wrap +coroutine.yield +debug.debug +debug.getfenv +debug.gethook +debug.getinfo +debug.getlocal +debug.getmetatable +debug.getregistry +debug.getupvalue +debug.setfenv +debug.sethook +debug.setlocal +debug.setmetatable +debug.setupvalue +debug.traceback +dofile +error +getfenv +getmetatable +io.close +io.flush +io.input +io.lines +io.open +io.output +io.popen +io.read +io.stderr +io.stdin +io.stdout +io.tmpfile +io.type +io.write +ipairs +load +loadfile +loadstring +math.abs +math.acos +math.asin +math.atan +math.atan2 +math.ceil +math.cos +math.cosh +math.deg +math.exp +math.floor +math.fmod +math.frexp +math.ldexp +math.log +math.log10 +math.max +math.min +math.modf +math.pi +math.pow +math.rad +math.random +math.randomseed +math.sin +math.sinh +math.sqrt +math.tan +math.tanh +module +next +os.clock +os.date +os.difftime +os.execute +os.exit +os.getenv +os.remove +os.rename +os.setlocale +os.time +os.tmpname +package.cpath +package.loaded +package.loadlib +package.path +package.preload +package.seeall +pairs +pcall +print +rawequal +rawget +rawset +require +select +setfenv +setmetatable +string.byte +string.char +string.dump +string.find +string.format +string.gmatch +string.gsub +string.len +string.lower +string.match +string.rep +string.reverse +string.sub +string.upper +table.concat +table.insert +table.maxn +table.remove +table.sort +tonumber +tostring +type +unpack +xpcall + +---------------------------------------------------- + +[ + ["function", [ + "_G" + ]], + ["function", [ + "_VERSION" + ]], + ["function", [ + "assert" + ]], + ["function", [ + "collectgarbage" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "create" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "resume" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "running" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "status" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "wrap" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "yield" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "debug" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getfenv" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "gethook" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getinfo" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getlocal" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getmetatable" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getregistry" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getupvalue" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setfenv" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "sethook" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setlocal" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setmetatable" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setupvalue" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "traceback" + ]], + ["function", [ + "dofile" + ]], + ["function", [ + "error" + ]], + ["function", [ + "getfenv" + ]], + ["function", [ + "getmetatable" + ]], + ["function", [ + "io", + ["punctuation", "."], + "close" + ]], + ["function", [ + "io", + ["punctuation", "."], + "flush" + ]], + ["function", [ + "io", + ["punctuation", "."], + "input" + ]], + ["function", [ + "io", + ["punctuation", "."], + "lines" + ]], + ["function", [ + "io", + ["punctuation", "."], + "open" + ]], + ["function", [ + "io", + ["punctuation", "."], + "output" + ]], + ["function", [ + "io", + ["punctuation", "."], + "popen" + ]], + ["function", [ + "io", + ["punctuation", "."], + "read" + ]], + ["function", [ + "io", + ["punctuation", "."], + "stderr" + ]], + ["function", [ + "io", + ["punctuation", "."], + "stdin" + ]], + ["function", [ + "io", + ["punctuation", "."], + "stdout" + ]], + ["function", [ + "io", + ["punctuation", "."], + "tmpfile" + ]], + ["function", [ + "io", + ["punctuation", "."], + "type" + ]], + ["function", [ + "io", + ["punctuation", "."], + "write" + ]], + ["function", [ + "ipairs" + ]], + ["function", [ + "load" + ]], + ["function", [ + "loadfile" + ]], + ["function", [ + "loadstring" + ]], + ["function", [ + "math", + ["punctuation", "."], + "abs" + ]], + ["function", [ + "math", + ["punctuation", "."], + "acos" + ]], + ["function", [ + "math", + ["punctuation", "."], + "asin" + ]], + ["function", [ + "math", + ["punctuation", "."], + "atan" + ]], + ["function", [ + "math", + ["punctuation", "."], + "atan2" + ]], + ["function", [ + "math", + ["punctuation", "."], + "ceil" + ]], + ["function", [ + "math", + ["punctuation", "."], + "cos" + ]], + ["function", [ + "math", + ["punctuation", "."], + "cosh" + ]], + ["function", [ + "math", + ["punctuation", "."], + "deg" + ]], + ["function", [ + "math", + ["punctuation", "."], + "exp" + ]], + ["function", [ + "math", + ["punctuation", "."], + "floor" + ]], + ["function", [ + "math", + ["punctuation", "."], + "fmod" + ]], + ["function", [ + "math", + ["punctuation", "."], + "frexp" + ]], + ["function", [ + "math", + ["punctuation", "."], + "ldexp" + ]], + ["function", [ + "math", + ["punctuation", "."], + "log" + ]], + ["function", [ + "math", + ["punctuation", "."], + "log10" + ]], + ["function", [ + "math", + ["punctuation", "."], + "max" + ]], + ["function", [ + "math", + ["punctuation", "."], + "min" + ]], + ["function", [ + "math", + ["punctuation", "."], + "modf" + ]], + ["function", [ + "math", + ["punctuation", "."], + "pi" + ]], + ["function", [ + "math", + ["punctuation", "."], + "pow" + ]], + ["function", [ + "math", + ["punctuation", "."], + "rad" + ]], + ["function", [ + "math", + ["punctuation", "."], + "random" + ]], + ["function", [ + "math", + ["punctuation", "."], + "randomseed" + ]], + ["function", [ + "math", + ["punctuation", "."], + "sin" + ]], + ["function", [ + "math", + ["punctuation", "."], + "sinh" + ]], + ["function", [ + "math", + ["punctuation", "."], + "sqrt" + ]], + ["function", [ + "math", + ["punctuation", "."], + "tan" + ]], + ["function", [ + "math", + ["punctuation", "."], + "tanh" + ]], + ["function", [ + "module" + ]], + ["function", [ + "next" + ]], + ["function", [ + "os", + ["punctuation", "."], + "clock" + ]], + ["function", [ + "os", + ["punctuation", "."], + "date" + ]], + ["function", [ + "os", + ["punctuation", "."], + "difftime" + ]], + ["function", [ + "os", + ["punctuation", "."], + "execute" + ]], + ["function", [ + "os", + ["punctuation", "."], + "exit" + ]], + ["function", [ + "os", + ["punctuation", "."], + "getenv" + ]], + ["function", [ + "os", + ["punctuation", "."], + "remove" + ]], + ["function", [ + "os", + ["punctuation", "."], + "rename" + ]], + ["function", [ + "os", + ["punctuation", "."], + "setlocale" + ]], + ["function", [ + "os", + ["punctuation", "."], + "time" + ]], + ["function", [ + "os", + ["punctuation", "."], + "tmpname" + ]], + ["function", [ + "package", + ["punctuation", "."], + "cpath" + ]], + ["function", [ + "package", + ["punctuation", "."], + "loaded" + ]], + ["function", [ + "package", + ["punctuation", "."], + "loadlib" + ]], + ["function", [ + "package", + ["punctuation", "."], + "path" + ]], + ["function", [ + "package", + ["punctuation", "."], + "preload" + ]], + ["function", [ + "package", + ["punctuation", "."], + "seeall" + ]], + ["function", [ + "pairs" + ]], + ["function", [ + "pcall" + ]], + ["function", [ + "print" + ]], + ["function", [ + "rawequal" + ]], + ["function", [ + "rawget" + ]], + ["function", [ + "rawset" + ]], + ["function", [ + "require" + ]], + ["function", [ + "select" + ]], + ["function", [ + "setfenv" + ]], + ["function", [ + "setmetatable" + ]], + ["function", [ + "string", + ["punctuation", "."], + "byte" + ]], + ["function", [ + "string", + ["punctuation", "."], + "char" + ]], + ["function", [ + "string", + ["punctuation", "."], + "dump" + ]], + ["function", [ + "string", + ["punctuation", "."], + "find" + ]], + ["function", [ + "string", + ["punctuation", "."], + "format" + ]], + ["function", [ + "string", + ["punctuation", "."], + "gmatch" + ]], + ["function", [ + "string", + ["punctuation", "."], + "gsub" + ]], + ["function", [ + "string", + ["punctuation", "."], + "len" + ]], + ["function", [ + "string", + ["punctuation", "."], + "lower" + ]], + ["function", [ + "string", + ["punctuation", "."], + "match" + ]], + ["function", [ + "string", + ["punctuation", "."], + "rep" + ]], + ["function", [ + "string", + ["punctuation", "."], + "reverse" + ]], + ["function", [ + "string", + ["punctuation", "."], + "sub" + ]], + ["function", [ + "string", + ["punctuation", "."], + "upper" + ]], + ["function", [ + "table", + ["punctuation", "."], + "concat" + ]], + ["function", [ + "table", + ["punctuation", "."], + "insert" + ]], + ["function", [ + "table", + ["punctuation", "."], + "maxn" + ]], + ["function", [ + "table", + ["punctuation", "."], + "remove" + ]], + ["function", [ + "table", + ["punctuation", "."], + "sort" + ]], + ["function", [ + "tonumber" + ]], + ["function", [ + "tostring" + ]], + ["function", [ + "type" + ]], + ["function", [ + "unpack" + ]], + ["function", [ + "xpcall" + ]] +] diff --git a/tests/languages/n1ql/comment_feature.test b/tests/languages/n1ql/comment_feature.test index f8752fb7d9..e392709fec 100644 --- a/tests/languages/n1ql/comment_feature.test +++ b/tests/languages/n1ql/comment_feature.test @@ -2,13 +2,17 @@ /* foo bar */ +-- comment + ---------------------------------------------------- [ ["comment", "/**/"], - ["comment", "/* foo\r\nbar */"] + ["comment", "/* foo\r\nbar */"], + + ["comment", "-- comment"] ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for comments. diff --git a/tests/languages/n1ql/keyword_feature.test b/tests/languages/n1ql/keyword_feature.test index 4e9aace092..83acd3e2e0 100644 --- a/tests/languages/n1ql/keyword_feature.test +++ b/tests/languages/n1ql/keyword_feature.test @@ -1,8 +1,10 @@ +ADVISE ALL ALTER ANALYZE AS ASC +AT BEGIN BINARY BOOLEAN @@ -16,11 +18,14 @@ CLUSTER COLLATE COLLECTION COMMIT +COMMITTED CONNECT CONTINUE CORRELATE +CORRELATED COVER CREATE +CURRENT DATABASE DATASET DATASTORE @@ -40,14 +45,21 @@ EXCLUDE EXECUTE EXPLAIN FETCH +FILTER FLATTEN +FLUSH +FOLLOWING FOR FORCE FROM +FTS FUNCTION +GOLANG GRANT GROUP +GROUPS GSI +HASH HAVING IF IGNORE @@ -62,15 +74,19 @@ INSERT INTERSECT INTO IS +ISOLATION +JAVASCRIPT JOIN KEY KEYS KEYSPACE KNOWN +LANGUAGE LAST LEFT LET LETTING +LEVEL LIMIT LSM MAP @@ -82,13 +98,19 @@ MINUS MISSING NAMESPACE NEST +NL +NO +NTH_VALUE NULL +NULLS NUMBER OBJECT OFFSET ON OPTION +OPTIONS ORDER +OTHERS OUTER OVER PARSE @@ -96,24 +118,32 @@ PARTITION PASSWORD PATH POOL +PRECEDING PREPARE PRIMARY PRIVATE PRIVILEGE +PROBE PROCEDURE PUBLIC +RANGE RAW REALM REDUCE RENAME +RESPECT RETURN RETURNING REVOKE RIGHT ROLE ROLLBACK +ROW +ROWS SATISFIES +SAVEPOINT SCHEMA +SCOPE SELECT SELF SEMI @@ -124,10 +154,13 @@ START STATISTICS STRING SYSTEM +TIES TO +TRAN TRANSACTION TRIGGER TRUNCATE +UNBOUNDED UNDER UNION UNIQUE @@ -146,6 +179,7 @@ VIA VIEW WHERE WHILE +WINDOW WITH WORK XOR @@ -153,11 +187,13 @@ XOR ---------------------------------------------------- [ + ["keyword", "ADVISE"], ["keyword", "ALL"], ["keyword", "ALTER"], ["keyword", "ANALYZE"], ["keyword", "AS"], ["keyword", "ASC"], + ["keyword", "AT"], ["keyword", "BEGIN"], ["keyword", "BINARY"], ["keyword", "BOOLEAN"], @@ -171,11 +207,14 @@ XOR ["keyword", "COLLATE"], ["keyword", "COLLECTION"], ["keyword", "COMMIT"], + ["keyword", "COMMITTED"], ["keyword", "CONNECT"], ["keyword", "CONTINUE"], ["keyword", "CORRELATE"], + ["keyword", "CORRELATED"], ["keyword", "COVER"], ["keyword", "CREATE"], + ["keyword", "CURRENT"], ["keyword", "DATABASE"], ["keyword", "DATASET"], ["keyword", "DATASTORE"], @@ -195,14 +234,21 @@ XOR ["keyword", "EXECUTE"], ["keyword", "EXPLAIN"], ["keyword", "FETCH"], + ["keyword", "FILTER"], ["keyword", "FLATTEN"], + ["keyword", "FLUSH"], + ["keyword", "FOLLOWING"], ["keyword", "FOR"], ["keyword", "FORCE"], ["keyword", "FROM"], + ["keyword", "FTS"], ["keyword", "FUNCTION"], + ["keyword", "GOLANG"], ["keyword", "GRANT"], ["keyword", "GROUP"], + ["keyword", "GROUPS"], ["keyword", "GSI"], + ["keyword", "HASH"], ["keyword", "HAVING"], ["keyword", "IF"], ["keyword", "IGNORE"], @@ -217,15 +263,19 @@ XOR ["keyword", "INTERSECT"], ["keyword", "INTO"], ["keyword", "IS"], + ["keyword", "ISOLATION"], + ["keyword", "JAVASCRIPT"], ["keyword", "JOIN"], ["keyword", "KEY"], ["keyword", "KEYS"], ["keyword", "KEYSPACE"], ["keyword", "KNOWN"], + ["keyword", "LANGUAGE"], ["keyword", "LAST"], ["keyword", "LEFT"], ["keyword", "LET"], ["keyword", "LETTING"], + ["keyword", "LEVEL"], ["keyword", "LIMIT"], ["keyword", "LSM"], ["keyword", "MAP"], @@ -237,13 +287,19 @@ XOR ["keyword", "MISSING"], ["keyword", "NAMESPACE"], ["keyword", "NEST"], + ["keyword", "NL"], + ["keyword", "NO"], + ["keyword", "NTH_VALUE"], ["keyword", "NULL"], + ["keyword", "NULLS"], ["keyword", "NUMBER"], ["keyword", "OBJECT"], ["keyword", "OFFSET"], ["keyword", "ON"], ["keyword", "OPTION"], + ["keyword", "OPTIONS"], ["keyword", "ORDER"], + ["keyword", "OTHERS"], ["keyword", "OUTER"], ["keyword", "OVER"], ["keyword", "PARSE"], @@ -251,24 +307,32 @@ XOR ["keyword", "PASSWORD"], ["keyword", "PATH"], ["keyword", "POOL"], + ["keyword", "PRECEDING"], ["keyword", "PREPARE"], ["keyword", "PRIMARY"], ["keyword", "PRIVATE"], ["keyword", "PRIVILEGE"], + ["keyword", "PROBE"], ["keyword", "PROCEDURE"], ["keyword", "PUBLIC"], + ["keyword", "RANGE"], ["keyword", "RAW"], ["keyword", "REALM"], ["keyword", "REDUCE"], ["keyword", "RENAME"], + ["keyword", "RESPECT"], ["keyword", "RETURN"], ["keyword", "RETURNING"], ["keyword", "REVOKE"], ["keyword", "RIGHT"], ["keyword", "ROLE"], ["keyword", "ROLLBACK"], + ["keyword", "ROW"], + ["keyword", "ROWS"], ["keyword", "SATISFIES"], + ["keyword", "SAVEPOINT"], ["keyword", "SCHEMA"], + ["keyword", "SCOPE"], ["keyword", "SELECT"], ["keyword", "SELF"], ["keyword", "SEMI"], @@ -279,10 +343,13 @@ XOR ["keyword", "STATISTICS"], ["keyword", "STRING"], ["keyword", "SYSTEM"], + ["keyword", "TIES"], ["keyword", "TO"], + ["keyword", "TRAN"], ["keyword", "TRANSACTION"], ["keyword", "TRIGGER"], ["keyword", "TRUNCATE"], + ["keyword", "UNBOUNDED"], ["keyword", "UNDER"], ["keyword", "UNION"], ["keyword", "UNIQUE"], @@ -301,6 +368,7 @@ XOR ["keyword", "VIEW"], ["keyword", "WHERE"], ["keyword", "WHILE"], + ["keyword", "WINDOW"], ["keyword", "WITH"], ["keyword", "WORK"], ["keyword", "XOR"] @@ -308,4 +376,4 @@ XOR ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/naniscript/command_feature.test b/tests/languages/naniscript/command_feature.test new file mode 100644 index 0000000000..3f05790892 --- /dev/null +++ b/tests/languages/naniscript/command_feature.test @@ -0,0 +1,207 @@ +@ +@ cmdWithWhiteSpaceBefore +@cmdWithTrailingSemicolon: +@paramlessCmd + @cmdWithNoParamsAndWhitespaceBefore + @cmdWithNoParamsAndTabBefore + @cmdWithNoParamsAndTabAndSpacesBefore + @cmdWithNoParamsWrappedInWhitespaces +@cmdWithNoParamWithTrailingSpace +@cmdWithNoParamWithMultipleTrailingSpaces +@cmdWithNoParamWithTrailingTab +@cmdWithNoParamWithTrailingTabAndSpaces +@cmdWithPositiveIntParam 1 +@cmdWithNegativeIntParam -1 +@cmdWithPositiveFloatParamAndNoFraction 1. +@cmdWithPositiveFloatParamAndFraction 1.10 +@cmdWithPositiveHegativeFloatParamAndNoFraction -1. +@cmdWithPositiveHegativeFloatParamAndFraction -1.10 +@cmdWithBoolParamAndPositive true +@cmdWithBoolParamAndNegative false +@cmdWithStringParam hello$co\:mma"d" +@cmdWithQuotedStringNamelessParameter "hello grizzly" +@cmdWithQuotedStringNamelessParameterWithEscapedQuotesInTheValue "hello \"grizzly\"" +@set choice="moe" +@command hello.grizzly +@command one,two,three +@command 1,2,3 +@command true,false,true +@command hi:grizzly +@command hi:1 +@command hi:true +@command 1 in:forest danger:true +@char 1 pos:0.25,-0.75 look:right + +---------------------------------------------------- + +[ + "@\r\n@ cmdWithWhiteSpaceBefore\r\n@cmdWithTrailingSemicolon:\r\n", + ["command", [ + ["command-name", "@paramlessCmd"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamsAndWhitespaceBefore"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamsAndTabBefore"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamsAndTabAndSpacesBefore"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamsWrappedInWhitespaces"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamWithTrailingSpace"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamWithMultipleTrailingSpaces"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamWithTrailingTab"] + ]], + ["command", [ + ["command-name", "@cmdWithNoParamWithTrailingTabAndSpaces"] + ]], + ["command", [ + ["command-name", "@cmdWithPositiveIntParam"], + ["command-params", [ + ["command-param-value", "1"] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithNegativeIntParam"], + ["command-params", [ + ["command-param-value", "-1"] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithPositiveFloatParamAndNoFraction"], + ["command-params", [ + ["command-param-value", "1."] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithPositiveFloatParamAndFraction"], + ["command-params", [ + ["command-param-value", "1.10"] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithPositiveHegativeFloatParamAndNoFraction"], + ["command-params", [ + ["command-param-value", "-1."] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithPositiveHegativeFloatParamAndFraction"], + ["command-params", [ + ["command-param-value", "-1.10"] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithBoolParamAndPositive"], + ["command-params", [ + ["command-param-value", "true"] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithBoolParamAndNegative"], + ["command-params", [ + ["command-param-value", "false"] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithStringParam"], + ["command-params", [ + ["command-param-value", "hello$co\\:mma\"d\""] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithQuotedStringNamelessParameter"], + ["command-params", [ + ["quoted-string", "\"hello grizzly\""] + ]] + ]], + ["command", [ + ["command-name", "@cmdWithQuotedStringNamelessParameterWithEscapedQuotesInTheValue"], + ["command-params", [ + ["quoted-string", "\"hello \\\"grizzly\\\"\""] + ]] + ]], + ["command", [ + ["command-name", "@set"], + ["command-params", [ + ["command-param-value", "choice=\"moe\""] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-value", "hello.grizzly"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-value", "one,two,three"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-value", "1,2,3"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-value", "true,false,true"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-id", "hi:"], + ["command-param-value", "grizzly"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-id", "hi:"], + ["command-param-value", "1"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-id", "hi:"], + ["command-param-value", "true"] + ]] + ]], + ["command", [ + ["command-name", "@command"], + ["command-params", [ + ["command-param-value", "1"], + ["command-param-id", "in:"], + ["command-param-value", "forest"], + ["command-param-id", "danger:"], + ["command-param-value", "true"] + ]] + ]], + ["command", [ + ["command-name", "@char"], + ["command-params", [ + ["command-param-value", "1"], + ["command-param-id", "pos:"], + ["command-param-value", "0.25,-0.75"], + ["command-param-id", "look:"], + ["command-param-value", "right"] + ]] + ]] +] + +---------------------------------------------------- + +Command tests. diff --git a/tests/languages/naniscript/comment_feature.test b/tests/languages/naniscript/comment_feature.test new file mode 100644 index 0000000000..bf03cd8451 --- /dev/null +++ b/tests/languages/naniscript/comment_feature.test @@ -0,0 +1,17 @@ +; +; comment +\:; invalid comment + +---------------------------------------------------- + +[ + ["comment", ";"], + ["comment", "; comment"], + ["generic-text", [ + "\\:; invalid comment" + ]] +] + +---------------------------------------------------- + +Comment tests. diff --git a/tests/languages/naniscript/define_feature.test b/tests/languages/naniscript/define_feature.test new file mode 100644 index 0000000000..6b9272aa53 --- /dev/null +++ b/tests/languages/naniscript/define_feature.test @@ -0,0 +1,17 @@ +> +>DefineKey define _ + 3h f[29 j] value * + +---------------------------------------------------- + +[ + ">\r\n", + ["define", [ + ">", + ["key", "DefineKey"], + ["value", "define _ + 3h f[29 j] value *"] + ]] +] + +---------------------------------------------------- + +Define tests. diff --git a/tests/languages/naniscript/expression_feature.test b/tests/languages/naniscript/expression_feature.test new file mode 100644 index 0000000000..140f921ce1 --- /dev/null +++ b/tests/languages/naniscript/expression_feature.test @@ -0,0 +1,91 @@ +{} +{ Abs(a, d) + 12 - 1 / -230.0 + "Lol ipsum" } +Expressions inside a generic text line: Loreim ipsu,{ Abs(a, d) + 12 - 1 / -230.0 + "Lol ipsum" } doler sit amen {¯\_(ツ)_/¯}. +@ExpressionInsteadOfNamelessParameterValue {x > 0} +@ExpressionBlendedWithNamelessParameterValue sdf{x > 0}df +@ExpressionsInsideNamedParameterValueWrappedInQuotes text:"{a} < {b}" +@ExpressionsBlendedWithNamedParameterValue param:32r2f,df{x > 0},d.{Abs(0) + 12.24 > 0}ff +@ExpressionsInsteadOfNamelessParameterAndQuotedParameter {remark} if:remark=="Saying \\"Stop { "the" } car\\" was a mistake." + +---------------------------------------------------- + +[ + ["generic-text", [ + ["expression", "{}"] + ]], + ["generic-text", [ + ["expression", "{ Abs(a, d) + 12 - 1 / -230.0 + \"Lol ipsum\" }"] + ]], + ["generic-text", [ + "Expressions inside a generic text line: Loreim ipsu,", + ["expression", "{ Abs(a, d) + 12 - 1 / -230.0 + \"Lol ipsum\" }"], + " doler sit amen ", + ["expression", "{¯\\_(ツ)_/¯}"], + "." + ]], + ["command", [ + ["command-name", "@ExpressionInsteadOfNamelessParameterValue"], + ["expression", "{x > 0}"] + ]], + ["command", [ + ["command-name", "@ExpressionBlendedWithNamelessParameterValue"], + ["command-params", [ + ["command-param-value", "sdf"] + ]], + ["expression", "{x > 0}"], + ["command-params", [ + ["command-param-value", "df"] + ]] + ]], + ["command", [ + ["command-name", "@ExpressionsInsideNamedParameterValueWrappedInQuotes"], + ["command-params", [ + ["command-param-id", "text:"], + ["command-param-value", "\""] + ]], + ["expression", "{a}"], + ["command-params", [ + ["command-param-value", "<"] + ]], + ["expression", "{b}"], + ["command-params", [ + ["command-param-value", "\""] + ]] + ]], + ["command", [ + ["command-name", "@ExpressionsBlendedWithNamedParameterValue"], + ["command-params", [ + ["command-param-id", "param:"], + ["command-param-value", "32r2f,df"] + ]], + ["expression", "{x > 0}"], + ["command-params", [ + ["command-param-value", ",d."] + ]], + ["expression", "{Abs(0) + 12.24 > 0}"], + ["command-params", [ + ["command-param-value", "ff"] + ]] + ]], + ["command", [ + ["command-name", "@ExpressionsInsteadOfNamelessParameterAndQuotedParameter"], + ["expression", "{remark}"], + ["command-params", [ + ["command-param-id", "if:"], + ["command-param-value", "remark=="], + ["quoted-string", "\"Saying \\\\\""], + ["command-param-value", "Stop"] + ]], + ["expression", "{ \"the\" }"], + ["command-params", [ + ["command-param-value", "car\\\\\""], + ["command-param-value", "was"], + ["command-param-value", "a"], + ["command-param-value", "mistake.\""] + ]] + ]] +] + +---------------------------------------------------- + +Expressions tests. diff --git a/tests/languages/naniscript/label_feature.test b/tests/languages/naniscript/label_feature.test new file mode 100644 index 0000000000..6a0606ec7e --- /dev/null +++ b/tests/languages/naniscript/label_feature.test @@ -0,0 +1,24 @@ +# +# Section1 +#Section2 +# Section4 +# SectionWithMultipleTabsBefore +## Section3 +# Section with multiple words + # Section with + # Section with tab + +---------------------------------------------------- + +[ + "#\r\n", + ["label", "# Section1"], + ["label", "#Section2"], + ["label", "# Section4"], + ["label", "#\t\t\tSectionWithMultipleTabsBefore"], + "\r\n## Section3\r\n# Section with multiple words\r\n\t# Section with\r\n\t# Section with tab" +] + +---------------------------------------------------- + +Label tests. diff --git a/tests/languages/naniscript/mixed_content_feature.test b/tests/languages/naniscript/mixed_content_feature.test new file mode 100644 index 0000000000..628a5d981d --- /dev/null +++ b/tests/languages/naniscript/mixed_content_feature.test @@ -0,0 +1,93 @@ +Generic text with inlined commands[i] example[command 1 danger:true] more text here [act danger:false true:false] + +@action1ForTwoLinesWithCommands +@action2ForTwoLinesWithCommands + +@commandAndGenericTextOnNewLine +Massa ut elementum. + +@commandWithParameterAndGenericTextOnNewLine WideParam +Integer + +Escaped braces inside generic text\{abu\}nt @ >ip#s;um< @ \[sdff j9dj\] + +UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf [ +"Integer: a = {a} malesuada a + b = {a + b}", Random(a, b) = {Random(a, b)}, Random("foo", "bar", "foobar") = {Random("foo", "bar", "foobar")},} +# +> +@ + +---------------------------------------------------- + +[ + ["generic-text", [ + "Generic text with inlined commands", + ["inline-command", [ + ["start-stop-char", "["], + ["command-param-name", "i"], + ["start-stop-char", "]"] + ]], + " example", + ["inline-command", [ + ["start-stop-char", "["], + ["command-param-name", "command"], + ["command-params", [ + ["command-param-value", "1"], + ["command-param-id", "danger:"], + ["command-param-value", "true"] + ]], + ["start-stop-char", "]"] + ]], + " more text here ", + ["inline-command", [ + ["start-stop-char", "["], + ["command-param-name", "act"], + ["command-params", [ + ["command-param-id", "danger:"], + ["command-param-value", "false"], + ["command-param-id", "true:"], + ["command-param-value", "false"] + ]], + ["start-stop-char", "]"] + ]] + ]], + + ["command", [ + ["command-name", "@action1ForTwoLinesWithCommands"] + ]], + ["command", [ + ["command-name", "@action2ForTwoLinesWithCommands"] + ]], + + ["command", [ + ["command-name", "@commandAndGenericTextOnNewLine"] + ]], + ["generic-text", ["Massa ut elementum."]], + + ["command", [ + ["command-name", "@commandWithParameterAndGenericTextOnNewLine"], + ["command-params", [ + ["command-param-value", "WideParam"] + ]] + ]], + ["generic-text", ["Integer"]], + + ["generic-text", [ + "Escaped braces inside generic text", + ["escaped-char", "\\{"], + "abu", + ["escaped-char", "\\}"], + "nt @ >ip#s;um< @ ", + ["escaped-char", "\\["], + "sdff j9dj", + ["escaped-char", "\\]"] + ]], + + ["bad-line", "UnclosedExpression{ab{cndum dui dolor tincidu{nt [s[fa]sdf ["], + ["bad-line", "\"Integer: a = {a} malesuada a + b = {a + b}\", Random(a, b) = {Random(a, b)}, Random(\"foo\", \"bar\", \"foobar\") = {Random(\"foo\", \"bar\", \"foobar\")},}"], + "\r\n#\r\n>\r\n@" +] + +---------------------------------------------------- + +Mixed tests of Generic Text, Commands, Inline Commands. diff --git a/tests/languages/nevod/comment_feature.test b/tests/languages/nevod/comment_feature.test new file mode 100644 index 0000000000..95e8ccf8bd --- /dev/null +++ b/tests/languages/nevod/comment_feature.test @@ -0,0 +1,20 @@ +/* Comment */ +/* Multi-line +comment */ +/**/ +// +// Single-line comment + +---------------------------------------------------- + +[ + ["comment", "/* Comment */"], + ["comment", "/* Multi-line\r\ncomment */"], + ["comment", "/**/"], + ["comment", "//"], + ["comment", "// Single-line comment"] +] + +---------------------------------------------------- + +Checks for comments. \ No newline at end of file diff --git a/tests/languages/nevod/full_feature.test b/tests/languages/nevod/full_feature.test new file mode 100644 index 0000000000..ba0dbbf099 --- /dev/null +++ b/tests/languages/nevod/full_feature.test @@ -0,0 +1,280 @@ +@namespace Basic +{ + @search @pattern Url(Domain, Path, Query, Anchor) = + Method + Domain:Url.Domain + ?Port + ?Path:Url.Path + + ?Query:Url.Query + ?Anchor:Url.Anchor + @where { + Method = {'http', 'https' , 'ftp', 'mailto', 'file', 'data', + 'irc'} + '://'; + Domain = Word + [1+ '.' + Word + [0+ {Word, '_', '-'}]]; + Port = ':' + Num; + Path = ?'/' + [0+ {Word, '/', '_', '+', '-', '%', '.'}]; + + Query = '?' + ?(Param + [0+ '&' + Param]) + @where + { + Param = Identifier + '=' + Identifier + @where + { + Identifier = {Alpha, AlphaNum, '_'} + [0+ {Word, '_'}]; + }; + }; + + Anchor(Value) = '#' + Value:{Word}; + }; +} + +---------------------------------------------------- + +[ + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "Url"], + ["fields", [ + ["punctuation", "("], + ["field-name", "Domain"], + ["punctuation", ","], + ["field-name", "Path"], + ["punctuation", ","], + ["field-name", "Query"], + ["punctuation", ","], + ["field-name", "Anchor"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + + ["name", "Method"], + ["operator", "+"], + ["field-capture", [ + ["field-name", "Domain"], + ["colon", ":"] + ]], + ["name", "Url.Domain"], + ["operator", "+"], + ["operator", "?"], + ["name", "Port"], + ["operator", "+"], + ["operator", "?"], + ["field-capture", [ + ["field-name", "Path"], + ["colon", ":"] + ]], + ["name", "Url.Path"], + ["operator", "+"], + + ["operator", "?"], + ["field-capture", [ + ["field-name", "Query"], + ["colon", ":"] + ]], + ["name", "Url.Query"], + ["operator", "+"], + ["operator", "?"], + ["field-capture", [ + ["field-name", "Anchor"], + ["colon", ":"] + ]], + ["name", "Url.Anchor"], + + ["keyword", "@where"], + ["operator", "{"], + + ["pattern", [ + ["pattern-name", "Method"] + ]], + ["operator", "="], + ["operator", "{"], + ["string", ["'http'"]], + ["punctuation", ","], + ["string", ["'https'"]], + ["punctuation", ","], + ["string", ["'ftp'"]], + ["punctuation", ","], + ["string", ["'mailto'"]], + ["punctuation", ","], + ["string", ["'file'"]], + ["punctuation", ","], + ["string", ["'data'"]], + ["punctuation", ","], + + ["string", ["'irc'"]], + ["operator", "}"], + ["operator", "+"], + ["string", ["'://'"]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Domain"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "1+"], + ["string", ["'.'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ","], + ["string", ["'_'"]], + ["punctuation", ","], + ["string", ["'-'"]], + ["operator", "}"], + ["operator", "]"], + ["operator", "]"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Port"] + ]], + ["operator", "="], + ["string", ["':'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Num"] + ]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Path"] + ]], + ["operator", "="], + ["operator", "?"], + ["string", ["'/'"]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ","], + ["string", ["'/'"]], + ["punctuation", ","], + ["string", ["'_'"]], + ["punctuation", ","], + ["string", ["'+'"]], + ["punctuation", ","], + ["string", ["'-'"]], + ["punctuation", ","], + ["string", ["'%'"]], + ["punctuation", ","], + ["string", ["'.'"]], + ["operator", "}"], + ["operator", "]"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Query"] + ]], + ["operator", "="], + ["string", ["'?'"]], + ["operator", "+"], + ["operator", "?"], + ["punctuation", "("], + ["name", "Param"], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["string", ["'&'"]], + ["operator", "+"], + ["name", "Param"], + ["operator", "]"], + ["punctuation", ")"], + + ["keyword", "@where"], + + ["operator", "{"], + + ["pattern", [ + ["pattern-name", "Param"] + ]], + ["operator", "="], + ["name", "Identifier"], + ["operator", "+"], + ["string", ["'='"]], + ["operator", "+"], + ["name", "Identifier"], + + ["keyword", "@where"], + + ["operator", "{"], + + ["pattern", [ + ["pattern-name", "Identifier"] + ]], + ["operator", "="], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ","], + ["standard-pattern", [ + ["standard-pattern-name", "AlphaNum"] + ]], + ["punctuation", ","], + ["string", ["'_'"]], + ["operator", "}"], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ","], + ["string", ["'_'"]], + ["operator", "}"], + ["operator", "]"], + ["punctuation", ";"], + + ["operator", "}"], + ["punctuation", ";"], + + ["operator", "}"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Anchor"], + ["fields", [ + ["punctuation", "("], + ["field-name", "Value"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["string", ["'#'"]], + ["operator", "+"], + ["field-capture", [ + ["field-name", "Value"], + ["colon", ":"] + ]], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "}"], + ["punctuation", ";"], + + ["operator", "}"], + ["punctuation", ";"], + + ["operator", "}"] +] diff --git a/tests/languages/nevod/keyword_feature.test b/tests/languages/nevod/keyword_feature.test new file mode 100644 index 0000000000..0c241d95e2 --- /dev/null +++ b/tests/languages/nevod/keyword_feature.test @@ -0,0 +1,15 @@ +@require @namespace @pattern @search +@inside @outside @having +@where + +---------------------------------------------------- + +[ + ["keyword", "@require"], ["keyword", "@namespace"], ["keyword", "@pattern"], ["keyword", "@search"], + ["keyword", "@inside"], ["keyword", "@outside"], ["keyword", "@having"], + ["keyword", "@where"] +] + +---------------------------------------------------- + +Checks for all keywords. \ No newline at end of file diff --git a/tests/languages/nevod/operator_feature.test b/tests/languages/nevod/operator_feature.test new file mode 100644 index 0000000000..62fb61b1ae --- /dev/null +++ b/tests/languages/nevod/operator_feature.test @@ -0,0 +1,25 @@ +( , ) ; ++ _ +.. ... +[ 0-5 ] +& +~ +? +{} + +---------------------------------------------------- + +[ + ["punctuation", "("], ["punctuation", ","], ["punctuation", ")"], ["punctuation", ";"], + ["operator", "+"], ["operator", "_"], + ["operator", ".."], ["operator", "..."], + ["operator", "["], ["quantifier", "0-5"], ["operator", "]"], + ["operator", "&"], + ["operator", "~"], + ["operator", "?"], + ["operator", "{"], ["operator", "}"] +] + +---------------------------------------------------- + +Checks for operators. \ No newline at end of file diff --git a/tests/languages/nevod/package_feature.test b/tests/languages/nevod/package_feature.test new file mode 100644 index 0000000000..bc6b83b379 --- /dev/null +++ b/tests/languages/nevod/package_feature.test @@ -0,0 +1,79 @@ +@namespace Basic +{ + @search @pattern GUID = Word(8) + [3 '-' + Word(4)] + '-' + Word(12); +} + +@require "GUID.np"; + +@namespace Basic +{ + @search @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +---------------------------------------------------- + +[ + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"], + ["punctuation", "("], + ["quantifier", "8"], + ["punctuation", ")"] + ]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "3"], + ["string", ["'-'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"], + ["punctuation", "("], + ["quantifier", "4"], + ["punctuation", ")"] + ]], + ["operator", "]"], + ["operator", "+"], + ["string", ["'-'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"], + ["punctuation", "("], + ["quantifier", "12"], + ["punctuation", ")"] + ]], + ["punctuation", ";"], + + ["operator", "}"], + + ["keyword", "@require"], ["string", ["\"GUID.np\""]], ["punctuation", ";"], + + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"] +] diff --git a/tests/languages/nevod/pattern_feature.test b/tests/languages/nevod/pattern_feature.test new file mode 100644 index 0000000000..91d3924dc5 --- /dev/null +++ b/tests/languages/nevod/pattern_feature.test @@ -0,0 +1,282 @@ +P = "text"; +P = Alpha; +P2 = P1; P1 = Word; +P = A + B; +P = {A, B}; +P = [1+ A]; + +#P = "text"; + +@pattern P = Alpha; +@search @pattern P = Alpha; +@pattern P = W @where { @pattern W = Word; }; +@pattern #P = W + S @where { @pattern #W = Word; @pattern S = Space; }; + +#P(X, Y) = X: A ... Y: B; +#P(X) = A .. X .. B; +#P1(X, Y) = P2(X: Q, Y: S); +#P(X) = X: Word ... X; +#P(X, Y) = {X: Punct + X, Y: Symbol + Y}; + +---------------------------------------------------- + +[ + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["string", ["\"text\""]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P2"] + ]], + ["operator", "="], + ["name", "P1"], + ["punctuation", ";"], + ["pattern", [ + ["pattern-name", "P1"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["name", "A"], + ["operator", "+"], + ["name", "B"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["operator", "{"], + ["name", "A"], + ["punctuation", ","], + ["name", "B"], + ["operator", "}"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["operator", "["], + ["quantifier", "1+"], + ["name", "A"], + ["operator", "]"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"] + ]], + ["operator", "="], + ["string", ["\"text\""]], + ["punctuation", ";"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ";"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ";"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["name", "W"], + ["keyword", "@where"], + ["operator", "{"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "W"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ";"], + ["operator", "}"], + ["punctuation", ";"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "#P"] + ]], + ["operator", "="], + ["name", "W"], + ["operator", "+"], + ["name", "S"], + ["keyword", "@where"], + ["operator", "{"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "#W"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ";"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "S"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Space"] + ]], + ["punctuation", ";"], + ["operator", "}"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ","], + ["field-name", "Y"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"] + ]], + ["name", "A"], + ["operator", "..."], + ["field-capture", [ + ["field-name", "Y"], + ["colon", ":"] + ]], + ["name", "B"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["name", "A"], + ["operator", ".."], + ["name", "X"], + ["operator", ".."], + ["name", "B"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P1"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ","], + ["field-name", "Y"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["name", "P2"], + ["punctuation", "("], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"], + ["field-name", "Q"], + ", ", + ["field-name", "Y"], + ["colon", ":"], + ["field-name", "S"] + ]], + ["punctuation", ")"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "..."], + ["name", "X"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ","], + ["field-name", "Y"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["operator", "{"], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Punct"] + ]], + ["operator", "+"], + ["name", "X"], + ["punctuation", ","], + ["field-capture", [ + ["field-name", "Y"], + ["colon", ":"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Symbol"] + ]], + ["operator", "+"], + ["name", "Y"], + ["operator", "}"], + ["punctuation", ";"] +] diff --git a/tests/languages/nevod/search_feature.test b/tests/languages/nevod/search_feature.test new file mode 100644 index 0000000000..c3dcf45207 --- /dev/null +++ b/tests/languages/nevod/search_feature.test @@ -0,0 +1,95 @@ +@namespace Basic +{ + @search @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +@search Basic.GUID; +@search Basic.GUID-in-Braces; + +@namespace Basic +{ + @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +@require "GUID.np"; + +@search Basic.*; + +@namespace Basic +{ + @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +---------------------------------------------------- + +[ + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"], + + ["keyword", "@search"], + ["search", "Basic.GUID"], + ["punctuation", ";"], + + ["keyword", "@search"], + ["search", "Basic.GUID-in-Braces"], + ["punctuation", ";"], + + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"], + + ["keyword", "@require"], ["string", ["\"GUID.np\""]], ["punctuation", ";"], + + ["keyword", "@search"], ["search", "Basic.*"], ["punctuation", ";"], + + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"] +] diff --git a/tests/languages/nevod/string_feature.test b/tests/languages/nevod/string_feature.test new file mode 100644 index 0000000000..568f7db33b --- /dev/null +++ b/tests/languages/nevod/string_feature.test @@ -0,0 +1,27 @@ +"text in double quotes" +"" +'text in single quotes' +'case-sensitive text'! +'text ''Nevod'' in quotes' +"text ""Nevod"" in double quotes" +'text prefix'* +'case-sensitive text prefix'!* +'' + +---------------------------------------------------- + +[ + ["string", ["\"text in double quotes\""]], + ["string", ["\"\""]], + ["string", ["'text in single quotes'"]], + ["string", ["'case-sensitive text'", ["string-attrs", "!"]]], + ["string", ["'text ''Nevod'' in quotes'"]], + ["string", ["\"text \"\"Nevod\"\" in double quotes\""]], + ["string", ["'text prefix'", ["string-attrs", "*"]]], + ["string", ["'case-sensitive text prefix'", ["string-attrs", "!*"]]], + ["string", ["''"]] +] + +---------------------------------------------------- + +Checks for various text strings. \ No newline at end of file diff --git a/tests/languages/nginx/boolean_feature.test b/tests/languages/nginx/boolean_feature.test new file mode 100644 index 0000000000..1488a11c09 --- /dev/null +++ b/tests/languages/nginx/boolean_feature.test @@ -0,0 +1,25 @@ +ssi on; +sendfile off; +tcp_nopush on; + +---------------------------------------------------- + +[ + ["directive", [ + ["keyword", "ssi"], + ["boolean", "on"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "sendfile"], + ["boolean", "off"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "tcp_nopush"], + ["boolean", "on"] + ]], + ["punctuation", ";"] +] diff --git a/tests/languages/nginx/comment_feature.test b/tests/languages/nginx/comment_feature.test index 09493ab581..d49cb8086d 100644 --- a/tests/languages/nginx/comment_feature.test +++ b/tests/languages/nginx/comment_feature.test @@ -1,13 +1,153 @@ # # Foobar +http {# This must be recognized as a comment +} + +events # A comment +{ + worker_connections 512; +} + +# A comment + +http# This is not a comment. There is no space +{ + server {# A comment + listen 80;# A comment + + location = "/example1" # This is a comment. There is a space + {# This is a comment after "{". No spaces required + return 200 "Hello, world!";# This is a comment after ";". No spaces required + }# This is a comment after "}". No spaces required + + location = /example2 # This is a comment. There is a space + {} + + location = "/example3"# This is not a comment. There is no space + {} + + location = /example4# This is not a comment. There is no space + {} + }# A comment +} + +location = "/example"# This is NOT a comment. There is no space +{} + +location = /example# This is NOT a comment. There is no space +{} + ---------------------------------------------------- [ ["comment", "#"], - ["comment", "# Foobar"] + ["comment", "# Foobar"], + + ["directive", [ + ["keyword", "http"] + ]], + ["punctuation", "{"], + ["comment", "# This must be recognized as a comment"], + + ["punctuation", "}"], + + ["directive", [ + ["keyword", "events"], + ["comment", "# A comment"] + ]], + + ["punctuation", "{"], + + ["directive", [ + ["keyword", "worker_connections"], + ["number", "512"] + ]], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["comment", "# A comment"], + + ["directive", [ + ["keyword", "http#"], + " This is not a comment. There is no space" + ]], + + ["punctuation", "{"], + + ["directive", [ + ["keyword", "server"] + ]], + ["punctuation", "{"], + ["comment", "# A comment"], + + ["directive", [ + ["keyword", "listen"], + ["number", "80"] + ]], + ["punctuation", ";"], + ["comment", "# A comment"], + + ["directive", [ + ["keyword", "location"], + " = ", + ["string", ["\"/example1\""]], + ["comment", "# This is a comment. There is a space"] + ]], + + ["punctuation", "{"], + ["comment", "# This is a comment after \"{\". No spaces required"], + + ["directive", [ + ["keyword", "return"], + ["number", "200"], + ["string", ["\"Hello, world!\""]] + ]], + ["punctuation", ";"], + ["comment", "# This is a comment after \";\". No spaces required"], + + ["punctuation", "}"], + ["comment", "# This is a comment after \"}\". No spaces required"], + + ["directive", [ + ["keyword", "location"], + " = /example2 ", + ["comment", "# This is a comment. There is a space"] + ]], + ["punctuation", "{"], ["punctuation", "}"], + + ["directive", [ + ["keyword", "location"], + " = ", + ["string", ["\"/example3\""]], + "# This is not a comment. There is no space" + ]], + ["punctuation", "{"], ["punctuation", "}"], + + ["directive", [ + ["keyword", "location"], + " = /example4# This is not a comment. There is no space" + ]], + ["punctuation", "{"], ["punctuation", "}"], + ["punctuation", "}"], ["comment", "# A comment"], + ["punctuation", "}"], + + ["directive", [ + ["keyword", "location"], + " = ", + ["string", ["\"/example\""]], + "# This is NOT a comment. There is no space" + ]], + ["punctuation", "{"], ["punctuation", "}"], + + ["directive", [ + ["keyword", "location"], + " = /example# This is NOT a comment. There is no space" + ]], + ["punctuation", "{"], ["punctuation", "}"] ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for comments. diff --git a/tests/languages/nginx/directive_feature.test b/tests/languages/nginx/directive_feature.test new file mode 100644 index 0000000000..ee7e4a6f5e --- /dev/null +++ b/tests/languages/nginx/directive_feature.test @@ -0,0 +1,186 @@ +name parameter1; +name "parameter1"; +name parameter1 parameter2; +name parameter1 "parameter2"; +name "parameter1" parameter2; +name para\;meter1; +name "para;meter1"; +name "para\;meter1"; +internal; +internal ; + +# A multiline parameter +name "para + +meter1"; + +name { + name parameter1 'parameter2' \; par#ameter3; + name parameter1 \" 'he"llo' par#ameter2; + name parameter1; name parameter1; + name parameter1 \{ 'hello'; + name { + internal; + name parameter1 parameter2; + } +} + +name "#foo"; name; #bar +name " #foo"; #bar +name ';oh no' parameter; + +---------------------------------------------------- + +[ + ["directive", [ + ["keyword", "name"], + " parameter1" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\"parameter1\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " parameter1 parameter2" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " parameter1 ", + ["string", ["\"parameter2\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\"parameter1\""]], + " parameter2" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " para\\;meter1" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\"para;meter1\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\"para\\;meter1\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "internal"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "internal"] + ]], + ["punctuation", ";"], + + ["comment", "# A multiline parameter"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\"para\r\n\r\nmeter1\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"] + ]], + ["punctuation", "{"], + + ["directive", [ + ["keyword", "name"], + " parameter1 ", + ["string", ["'parameter2'"]], + " \\; par#ameter3" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " parameter1 \\\" ", + ["string", ["'he\"llo'"]], + " par#ameter2" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " parameter1" + ]], + ["punctuation", ";"], + ["directive", [ + ["keyword", "name"], + " parameter1" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " parameter1 \\{ ", + ["string", ["'hello'"]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"] + ]], + ["punctuation", "{"], + + ["directive", [ + ["keyword", "internal"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "name"], + " parameter1 parameter2" + ]], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\"#foo\""]] + ]], + ["punctuation", ";"], + ["directive", [ + ["keyword", "name"] + ]], + ["punctuation", ";"], + ["comment", "#bar"], + + ["directive", [ + ["keyword", "name"], + ["string", ["\" #foo\""]] + ]], + ["punctuation", ";"], + ["comment", "#bar"], + + ["directive", [ + ["keyword", "name"], + ["string", ["';oh no'"]], + " parameter" + ]], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/nginx/keyword_feature.test b/tests/languages/nginx/keyword_feature.test deleted file mode 100644 index bd34c52b34..0000000000 --- a/tests/languages/nginx/keyword_feature.test +++ /dev/null @@ -1,719 +0,0 @@ -CONTENT_ -DOCUMENT_ -GATEWAY_ -HTTP_ -HTTPS -if_not_empty -PATH_ -QUERY_ -REDIRECT_ -REMOTE_ -REQUEST_ -SCGI -SCRIPT_ -SERVER_ -http -server -events -location -include -accept_mutex -accept_mutex_delay -access_log -add_after_body -add_before_body -add_header -addition_types -aio -alias -allow -ancient_browser -ancient_browser_value -auth -auth_basic -auth_basic_user_file -auth_http -auth_http_header -auth_http_timeout -autoindex -autoindex_exact_size -autoindex_localtime -break -charset -charset_map -charset_types -chunked_transfer_encoding -client_body_buffer_size -client_body_in_file_only -client_body_in_single_buffer -client_body_temp_path -client_body_timeout -client_header_buffer_size -client_header_timeout -client_max_body_size -connection_pool_size -create_full_put_path -daemon -dav_access -dav_methods -debug_connection -debug_points -default_type -deny -devpoll_changes -devpoll_events -directio -directio_alignment -disable_symlinks -empty_gif -env -epoll_events -error_log -error_page -expires -fastcgi_buffer_size -fastcgi_buffers -fastcgi_busy_buffers_size -fastcgi_cache -fastcgi_cache_bypass -fastcgi_cache_key -fastcgi_cache_lock -fastcgi_cache_lock_timeout -fastcgi_cache_methods -fastcgi_cache_min_uses -fastcgi_cache_path -fastcgi_cache_purge -fastcgi_cache_use_stale -fastcgi_cache_valid -fastcgi_connect_timeout -fastcgi_hide_header -fastcgi_ignore_client_abort -fastcgi_ignore_headers -fastcgi_index -fastcgi_intercept_errors -fastcgi_keep_conn -fastcgi_max_temp_file_size -fastcgi_next_upstream -fastcgi_no_cache -fastcgi_param -fastcgi_pass -fastcgi_pass_header -fastcgi_read_timeout -fastcgi_redirect_errors -fastcgi_send_timeout -fastcgi_split_path_info -fastcgi_store -fastcgi_store_access -fastcgi_temp_file_write_size -fastcgi_temp_path -flv -geo -geoip_city -geoip_country -google_perftools_profiles -gzip -gzip_buffers -gzip_comp_level -gzip_disable -gzip_http_version -gzip_min_length -gzip_proxied -gzip_static -gzip_types -gzip_vary -if -if_modified_since -ignore_invalid_headers -image_filter -image_filter_buffer -image_filter_jpeg_quality -image_filter_sharpen -image_filter_transparency -imap_capabilities -imap_client_buffer -include -index -internal -ip_hash -keepalive -keepalive_disable -keepalive_requests -keepalive_timeout -kqueue_changes -kqueue_events -large_client_header_buffers -limit_conn -limit_conn_log_level -limit_conn_zone -limit_except -limit_rate -limit_rate_after -limit_req -limit_req_log_level -limit_req_zone -limit_zone -lingering_close -lingering_time -lingering_timeout -listen -location -lock_file -log_format -log_format_combined -log_not_found -log_subrequest -map -map_hash_bucket_size -map_hash_max_size -master_process -max_ranges -memcached_buffer_size -memcached_connect_timeout -memcached_next_upstream -memcached_pass -memcached_read_timeout -memcached_send_timeout -merge_slashes -min_delete_depth -modern_browser -modern_browser_value -more_set_headers -mp4 -mp4_buffer_size -mp4_max_buffer_size -msie_padding -msie_refresh -multi_accept -open_file_cache -open_file_cache_errors -open_file_cache_min_uses -open_file_cache_valid -open_log_file_cache -optimize_server_names -override_charset -pcre_jit -perl -perl_modules -perl_require -perl_set -pid -pop3_auth -pop3_capabilities -port_in_redirect -post_action -postpone_output -protocol -proxy -proxy_buffer -proxy_buffer_size -proxy_buffering -proxy_buffers -proxy_busy_buffers_size -proxy_cache -proxy_cache_bypass -proxy_cache_key -proxy_cache_lock -proxy_cache_lock_timeout -proxy_cache_methods -proxy_cache_min_uses -proxy_cache_path -proxy_cache_use_stale -proxy_cache_valid -proxy_connect_timeout -proxy_cookie_domain -proxy_cookie_path -proxy_headers_hash_bucket_size -proxy_headers_hash_max_size -proxy_hide_header -proxy_http_version -proxy_ignore_client_abort -proxy_ignore_headers -proxy_intercept_errors -proxy_max_temp_file_size -proxy_method -proxy_next_upstream -proxy_no_cache -proxy_pass -proxy_pass_error_message -proxy_pass_header -proxy_pass_request_body -proxy_pass_request_headers -proxy_read_timeout -proxy_redirect -proxy_redirect_errors -proxy_send_lowat -proxy_send_timeout -proxy_set_body -proxy_set_header -proxy_ssl_session_reuse -proxy_store -proxy_store_access -proxy_temp_file_write_size -proxy_temp_path -proxy_timeout -proxy_upstream_fail_timeout -proxy_upstream_max_fails -random_index -read_ahead -real_ip_header -recursive_error_pages -request_pool_size -reset_timedout_connection -resolver -resolver_timeout -return -rewrite -root -rtsig_overflow_events -rtsig_overflow_test -rtsig_overflow_threshold -rtsig_signo -satisfy -satisfy_any -secure_link_secret -send_lowat -send_timeout -sendfile -sendfile_max_chunk -server -server_name -server_name_in_redirect -server_names_hash_bucket_size -server_names_hash_max_size -server_tokens -set -set_real_ip_from -smtp_auth -smtp_capabilities -so_keepalive -source_charset -split_clients -ssi -ssi_silent_errors -ssi_types -ssi_value_length -ssl -ssl_certificate -ssl_certificate_key -ssl_ciphers -ssl_client_certificate -ssl_crl -ssl_dhparam -ssl_early_data -ssl_ecdh_curve -ssl_engine -ssl_prefer_server_ciphers -ssl_protocols -ssl_session_cache -ssl_session_tickets -ssl_session_timeout -ssl_stapling -ssl_stapling_verify -ssl_trusted_certificate -ssl_verify_client -ssl_verify_depth -starttls -stub_status -sub_filter -sub_filter_once -sub_filter_types -tcp_nodelay -tcp_nopush -timeout -timer_resolution -try_files -types -types_hash_bucket_size -types_hash_max_size -underscores_in_headers -uninitialized_variable_warn -upstream -use -user -userid -userid_domain -userid_expires -userid_name -userid_p3p -userid_path -userid_service -valid_referers -variables_hash_bucket_size -variables_hash_max_size -worker_connections -worker_cpu_affinity -worker_priority -worker_processes -worker_rlimit_core -worker_rlimit_nofile -worker_rlimit_sigpending -working_directory -xclient -xml_entities -xslt_entities -xslt_stylesheet -xslt_types - ----------------------------------------------------- - -[ - ["keyword", "CONTENT_"], - ["keyword", "DOCUMENT_"], - ["keyword", "GATEWAY_"], - ["keyword", "HTTP_"], - ["keyword", "HTTPS"], - ["keyword", "if_not_empty"], - ["keyword", "PATH_"], - ["keyword", "QUERY_"], - ["keyword", "REDIRECT_"], - ["keyword", "REMOTE_"], - ["keyword", "REQUEST_"], - ["keyword", "SCGI"], - ["keyword", "SCRIPT_"], - ["keyword", "SERVER_"], - ["keyword", "http"], - ["keyword", "server"], - ["keyword", "events"], - ["keyword", "location"], - ["keyword", "include"], - ["keyword", "accept_mutex"], - ["keyword", "accept_mutex_delay"], - ["keyword", "access_log"], - ["keyword", "add_after_body"], - ["keyword", "add_before_body"], - ["keyword", "add_header"], - ["keyword", "addition_types"], - ["keyword", "aio"], - ["keyword", "alias"], - ["keyword", "allow"], - ["keyword", "ancient_browser"], - ["keyword", "ancient_browser_value"], - ["keyword", "auth"], - ["keyword", "auth_basic"], - ["keyword", "auth_basic_user_file"], - ["keyword", "auth_http"], - ["keyword", "auth_http_header"], - ["keyword", "auth_http_timeout"], - ["keyword", "autoindex"], - ["keyword", "autoindex_exact_size"], - ["keyword", "autoindex_localtime"], - ["keyword", "break"], - ["keyword", "charset"], - ["keyword", "charset_map"], - ["keyword", "charset_types"], - ["keyword", "chunked_transfer_encoding"], - ["keyword", "client_body_buffer_size"], - ["keyword", "client_body_in_file_only"], - ["keyword", "client_body_in_single_buffer"], - ["keyword", "client_body_temp_path"], - ["keyword", "client_body_timeout"], - ["keyword", "client_header_buffer_size"], - ["keyword", "client_header_timeout"], - ["keyword", "client_max_body_size"], - ["keyword", "connection_pool_size"], - ["keyword", "create_full_put_path"], - ["keyword", "daemon"], - ["keyword", "dav_access"], - ["keyword", "dav_methods"], - ["keyword", "debug_connection"], - ["keyword", "debug_points"], - ["keyword", "default_type"], - ["keyword", "deny"], - ["keyword", "devpoll_changes"], - ["keyword", "devpoll_events"], - ["keyword", "directio"], - ["keyword", "directio_alignment"], - ["keyword", "disable_symlinks"], - ["keyword", "empty_gif"], - ["keyword", "env"], - ["keyword", "epoll_events"], - ["keyword", "error_log"], - ["keyword", "error_page"], - ["keyword", "expires"], - ["keyword", "fastcgi_buffer_size"], - ["keyword", "fastcgi_buffers"], - ["keyword", "fastcgi_busy_buffers_size"], - ["keyword", "fastcgi_cache"], - ["keyword", "fastcgi_cache_bypass"], - ["keyword", "fastcgi_cache_key"], - ["keyword", "fastcgi_cache_lock"], - ["keyword", "fastcgi_cache_lock_timeout"], - ["keyword", "fastcgi_cache_methods"], - ["keyword", "fastcgi_cache_min_uses"], - ["keyword", "fastcgi_cache_path"], - ["keyword", "fastcgi_cache_purge"], - ["keyword", "fastcgi_cache_use_stale"], - ["keyword", "fastcgi_cache_valid"], - ["keyword", "fastcgi_connect_timeout"], - ["keyword", "fastcgi_hide_header"], - ["keyword", "fastcgi_ignore_client_abort"], - ["keyword", "fastcgi_ignore_headers"], - ["keyword", "fastcgi_index"], - ["keyword", "fastcgi_intercept_errors"], - ["keyword", "fastcgi_keep_conn"], - ["keyword", "fastcgi_max_temp_file_size"], - ["keyword", "fastcgi_next_upstream"], - ["keyword", "fastcgi_no_cache"], - ["keyword", "fastcgi_param"], - ["keyword", "fastcgi_pass"], - ["keyword", "fastcgi_pass_header"], - ["keyword", "fastcgi_read_timeout"], - ["keyword", "fastcgi_redirect_errors"], - ["keyword", "fastcgi_send_timeout"], - ["keyword", "fastcgi_split_path_info"], - ["keyword", "fastcgi_store"], - ["keyword", "fastcgi_store_access"], - ["keyword", "fastcgi_temp_file_write_size"], - ["keyword", "fastcgi_temp_path"], - ["keyword", "flv"], - ["keyword", "geo"], - ["keyword", "geoip_city"], - ["keyword", "geoip_country"], - ["keyword", "google_perftools_profiles"], - ["keyword", "gzip"], - ["keyword", "gzip_buffers"], - ["keyword", "gzip_comp_level"], - ["keyword", "gzip_disable"], - ["keyword", "gzip_http_version"], - ["keyword", "gzip_min_length"], - ["keyword", "gzip_proxied"], - ["keyword", "gzip_static"], - ["keyword", "gzip_types"], - ["keyword", "gzip_vary"], - ["keyword", "if"], - ["keyword", "if_modified_since"], - ["keyword", "ignore_invalid_headers"], - ["keyword", "image_filter"], - ["keyword", "image_filter_buffer"], - ["keyword", "image_filter_jpeg_quality"], - ["keyword", "image_filter_sharpen"], - ["keyword", "image_filter_transparency"], - ["keyword", "imap_capabilities"], - ["keyword", "imap_client_buffer"], - ["keyword", "include"], - ["keyword", "index"], - ["keyword", "internal"], - ["keyword", "ip_hash"], - ["keyword", "keepalive"], - ["keyword", "keepalive_disable"], - ["keyword", "keepalive_requests"], - ["keyword", "keepalive_timeout"], - ["keyword", "kqueue_changes"], - ["keyword", "kqueue_events"], - ["keyword", "large_client_header_buffers"], - ["keyword", "limit_conn"], - ["keyword", "limit_conn_log_level"], - ["keyword", "limit_conn_zone"], - ["keyword", "limit_except"], - ["keyword", "limit_rate"], - ["keyword", "limit_rate_after"], - ["keyword", "limit_req"], - ["keyword", "limit_req_log_level"], - ["keyword", "limit_req_zone"], - ["keyword", "limit_zone"], - ["keyword", "lingering_close"], - ["keyword", "lingering_time"], - ["keyword", "lingering_timeout"], - ["keyword", "listen"], - ["keyword", "location"], - ["keyword", "lock_file"], - ["keyword", "log_format"], - ["keyword", "log_format_combined"], - ["keyword", "log_not_found"], - ["keyword", "log_subrequest"], - ["keyword", "map"], - ["keyword", "map_hash_bucket_size"], - ["keyword", "map_hash_max_size"], - ["keyword", "master_process"], - ["keyword", "max_ranges"], - ["keyword", "memcached_buffer_size"], - ["keyword", "memcached_connect_timeout"], - ["keyword", "memcached_next_upstream"], - ["keyword", "memcached_pass"], - ["keyword", "memcached_read_timeout"], - ["keyword", "memcached_send_timeout"], - ["keyword", "merge_slashes"], - ["keyword", "min_delete_depth"], - ["keyword", "modern_browser"], - ["keyword", "modern_browser_value"], - ["keyword", "more_set_headers"], - ["keyword", "mp4"], - ["keyword", "mp4_buffer_size"], - ["keyword", "mp4_max_buffer_size"], - ["keyword", "msie_padding"], - ["keyword", "msie_refresh"], - ["keyword", "multi_accept"], - ["keyword", "open_file_cache"], - ["keyword", "open_file_cache_errors"], - ["keyword", "open_file_cache_min_uses"], - ["keyword", "open_file_cache_valid"], - ["keyword", "open_log_file_cache"], - ["keyword", "optimize_server_names"], - ["keyword", "override_charset"], - ["keyword", "pcre_jit"], - ["keyword", "perl"], - ["keyword", "perl_modules"], - ["keyword", "perl_require"], - ["keyword", "perl_set"], - ["keyword", "pid"], - ["keyword", "pop3_auth"], - ["keyword", "pop3_capabilities"], - ["keyword", "port_in_redirect"], - ["keyword", "post_action"], - ["keyword", "postpone_output"], - ["keyword", "protocol"], - ["keyword", "proxy"], - ["keyword", "proxy_buffer"], - ["keyword", "proxy_buffer_size"], - ["keyword", "proxy_buffering"], - ["keyword", "proxy_buffers"], - ["keyword", "proxy_busy_buffers_size"], - ["keyword", "proxy_cache"], - ["keyword", "proxy_cache_bypass"], - ["keyword", "proxy_cache_key"], - ["keyword", "proxy_cache_lock"], - ["keyword", "proxy_cache_lock_timeout"], - ["keyword", "proxy_cache_methods"], - ["keyword", "proxy_cache_min_uses"], - ["keyword", "proxy_cache_path"], - ["keyword", "proxy_cache_use_stale"], - ["keyword", "proxy_cache_valid"], - ["keyword", "proxy_connect_timeout"], - ["keyword", "proxy_cookie_domain"], - ["keyword", "proxy_cookie_path"], - ["keyword", "proxy_headers_hash_bucket_size"], - ["keyword", "proxy_headers_hash_max_size"], - ["keyword", "proxy_hide_header"], - ["keyword", "proxy_http_version"], - ["keyword", "proxy_ignore_client_abort"], - ["keyword", "proxy_ignore_headers"], - ["keyword", "proxy_intercept_errors"], - ["keyword", "proxy_max_temp_file_size"], - ["keyword", "proxy_method"], - ["keyword", "proxy_next_upstream"], - ["keyword", "proxy_no_cache"], - ["keyword", "proxy_pass"], - ["keyword", "proxy_pass_error_message"], - ["keyword", "proxy_pass_header"], - ["keyword", "proxy_pass_request_body"], - ["keyword", "proxy_pass_request_headers"], - ["keyword", "proxy_read_timeout"], - ["keyword", "proxy_redirect"], - ["keyword", "proxy_redirect_errors"], - ["keyword", "proxy_send_lowat"], - ["keyword", "proxy_send_timeout"], - ["keyword", "proxy_set_body"], - ["keyword", "proxy_set_header"], - ["keyword", "proxy_ssl_session_reuse"], - ["keyword", "proxy_store"], - ["keyword", "proxy_store_access"], - ["keyword", "proxy_temp_file_write_size"], - ["keyword", "proxy_temp_path"], - ["keyword", "proxy_timeout"], - ["keyword", "proxy_upstream_fail_timeout"], - ["keyword", "proxy_upstream_max_fails"], - ["keyword", "random_index"], - ["keyword", "read_ahead"], - ["keyword", "real_ip_header"], - ["keyword", "recursive_error_pages"], - ["keyword", "request_pool_size"], - ["keyword", "reset_timedout_connection"], - ["keyword", "resolver"], - ["keyword", "resolver_timeout"], - ["keyword", "return"], - ["keyword", "rewrite"], - ["keyword", "root"], - ["keyword", "rtsig_overflow_events"], - ["keyword", "rtsig_overflow_test"], - ["keyword", "rtsig_overflow_threshold"], - ["keyword", "rtsig_signo"], - ["keyword", "satisfy"], - ["keyword", "satisfy_any"], - ["keyword", "secure_link_secret"], - ["keyword", "send_lowat"], - ["keyword", "send_timeout"], - ["keyword", "sendfile"], - ["keyword", "sendfile_max_chunk"], - ["keyword", "server"], - ["keyword", "server_name"], - ["keyword", "server_name_in_redirect"], - ["keyword", "server_names_hash_bucket_size"], - ["keyword", "server_names_hash_max_size"], - ["keyword", "server_tokens"], - ["keyword", "set"], - ["keyword", "set_real_ip_from"], - ["keyword", "smtp_auth"], - ["keyword", "smtp_capabilities"], - ["keyword", "so_keepalive"], - ["keyword", "source_charset"], - ["keyword", "split_clients"], - ["keyword", "ssi"], - ["keyword", "ssi_silent_errors"], - ["keyword", "ssi_types"], - ["keyword", "ssi_value_length"], - ["keyword", "ssl"], - ["keyword", "ssl_certificate"], - ["keyword", "ssl_certificate_key"], - ["keyword", "ssl_ciphers"], - ["keyword", "ssl_client_certificate"], - ["keyword", "ssl_crl"], - ["keyword", "ssl_dhparam"], - ["keyword", "ssl_early_data"], - ["keyword", "ssl_ecdh_curve"], - ["keyword", "ssl_engine"], - ["keyword", "ssl_prefer_server_ciphers"], - ["keyword", "ssl_protocols"], - ["keyword", "ssl_session_cache"], - ["keyword", "ssl_session_tickets"], - ["keyword", "ssl_session_timeout"], - ["keyword", "ssl_stapling"], - ["keyword", "ssl_stapling_verify"], - ["keyword", "ssl_trusted_certificate"], - ["keyword", "ssl_verify_client"], - ["keyword", "ssl_verify_depth"], - ["keyword", "starttls"], - ["keyword", "stub_status"], - ["keyword", "sub_filter"], - ["keyword", "sub_filter_once"], - ["keyword", "sub_filter_types"], - ["keyword", "tcp_nodelay"], - ["keyword", "tcp_nopush"], - ["keyword", "timeout"], - ["keyword", "timer_resolution"], - ["keyword", "try_files"], - ["keyword", "types"], - ["keyword", "types_hash_bucket_size"], - ["keyword", "types_hash_max_size"], - ["keyword", "underscores_in_headers"], - ["keyword", "uninitialized_variable_warn"], - ["keyword", "upstream"], - ["keyword", "use"], - ["keyword", "user"], - ["keyword", "userid"], - ["keyword", "userid_domain"], - ["keyword", "userid_expires"], - ["keyword", "userid_name"], - ["keyword", "userid_p3p"], - ["keyword", "userid_path"], - ["keyword", "userid_service"], - ["keyword", "valid_referers"], - ["keyword", "variables_hash_bucket_size"], - ["keyword", "variables_hash_max_size"], - ["keyword", "worker_connections"], - ["keyword", "worker_cpu_affinity"], - ["keyword", "worker_priority"], - ["keyword", "worker_processes"], - ["keyword", "worker_rlimit_core"], - ["keyword", "worker_rlimit_nofile"], - ["keyword", "worker_rlimit_sigpending"], - ["keyword", "working_directory"], - ["keyword", "xclient"], - ["keyword", "xml_entities"], - ["keyword", "xslt_entities"], - ["keyword", "xslt_stylesheet"], - ["keyword", "xslt_types"] -] - ----------------------------------------------------- - -Checks for keywords. diff --git a/tests/languages/nginx/number_feature.test b/tests/languages/nginx/number_feature.test new file mode 100644 index 0000000000..1ff90d9bdc --- /dev/null +++ b/tests/languages/nginx/number_feature.test @@ -0,0 +1,78 @@ +worker_connections 4096; +expires 30d; + +client_max_body_size 10m; +client_body_buffer_size 128k; +proxy_connect_timeout 90; +proxy_send_timeout 90; +proxy_read_timeout 90; +proxy_buffers 32 4k; + +keepalive_timeout 75 20; +return 404; + +---------------------------------------------------- + +[ + ["directive", [ + ["keyword", "worker_connections"], + ["number", "4096"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "expires"], + ["number", "30d"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "client_max_body_size"], + ["number", "10m"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "client_body_buffer_size"], + ["number", "128k"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "proxy_connect_timeout"], + ["number", "90"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "proxy_send_timeout"], + ["number", "90"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "proxy_read_timeout"], + ["number", "90"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "proxy_buffers"], + ["number", "32"], + ["number", "4k"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "keepalive_timeout"], + ["number", "75"], + ["number", "20"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "return"], + ["number", "404"] + ]], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/nginx/string_feature.test b/tests/languages/nginx/string_feature.test new file mode 100644 index 0000000000..c53a87cb98 --- /dev/null +++ b/tests/languages/nginx/string_feature.test @@ -0,0 +1,116 @@ +foo ""; +foo ''; +foo "foo +bar"; +foo 'foo +bar'; + +foo " \" \' \\ \r \n \t"; +foo ' \" \' \\ \r \n \t'; + +foo "$foo"; +foo "${foo}bar"; +foo "$arg_;"; + +# not escaped +foo "\$foo"; + +---------------------------------------------------- + +[ + ["directive", [ + ["keyword", "foo"], + ["string", ["\"\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", ["''"]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", ["\"foo\r\nbar\""]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", ["'foo\r\nbar'"]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", [ + "\" ", + ["escape", "\\\""], + ["escape", "\\'"], + ["escape", "\\\\"], + ["escape", "\\r"], + ["escape", "\\n"], + ["escape", "\\t"], + "\"" + ]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", [ + "' ", + ["escape", "\\\""], + ["escape", "\\'"], + ["escape", "\\\\"], + ["escape", "\\r"], + ["escape", "\\n"], + ["escape", "\\t"], + "'" + ]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", [ + "\"", + ["variable", "$foo"], + "\"" + ]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", [ + "\"", + ["variable", "${foo}"], + "bar\"" + ]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], + ["string", [ + "\"", + ["variable", "$arg_;"], + "\"" + ]] + ]], + ["punctuation", ";"], + + ["comment", "# not escaped"], + + ["directive", [ + ["keyword", "foo"], + ["string", [ + "\"\\", + ["variable", "$foo"], + "\"" + ]] + ]], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/nginx/variable_feature.test b/tests/languages/nginx/variable_feature.test index 29959b95ba..41ead416ba 100644 --- a/tests/languages/nginx/variable_feature.test +++ b/tests/languages/nginx/variable_feature.test @@ -1,13 +1,151 @@ -$foobar -$foo_bar +foo $host; +foo $geoip_city_country_code3 +set $0 foo; +set $_ foo; +set $arg_? foo; + +# real example + +log_format main '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $bytes_sent ' + '"$http_referer" "$http_user_agent" ' + '"$gzip_ratio"'; + +location / { + ssi on; + set $inc $request_uri; + if (!-f $request_filename) { + rewrite ^ /index.html last; + } + if (!-f $document_root$inc.html) { + return 404; + } +} ---------------------------------------------------- [ - ["variable", "$foobar"], - ["variable", "$foo_bar"] + ["directive", [ + ["keyword", "foo"], + ["variable", "$host"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "foo"], ["variable", "$geoip_city_country_code3"], + "\r\nset ", ["variable", "$0"], " foo" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "set"], + ["variable", "$_"], + " foo" + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "set"], + ["variable", "$arg_?"], + " foo" + ]], + ["punctuation", ";"], + + ["comment", "# real example"], + + ["directive", [ + ["keyword", "log_format"], + " main ", + ["string", [ + "'", + ["variable", "$remote_addr"], + " - ", + ["variable", "$remote_user"], + " [", + ["variable", "$time_local]"], + " '" + ]], + + ["string", [ + "'\"", + ["variable", "$request"], + "\" ", + ["variable", "$status"], + ["variable", "$bytes_sent"], + " '" + ]], + + ["string", [ + "'\"", + ["variable", "$http_referer"], + "\" \"", + ["variable", "$http_user_agent"], + "\" '" + ]], + + ["string", [ + "'\"", + ["variable", "$gzip_ratio"], + "\"'" + ]] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "location"], + " /" + ]], + ["punctuation", "{"], + + ["directive", [ + ["keyword", "ssi"], + ["boolean", "on"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "set"], + ["variable", "$inc"], + ["variable", "$request_uri"] + ]], + ["punctuation", ";"], + + ["directive", [ + ["keyword", "if"], + " (!-f ", + ["variable", "$request_filename"], + ")" + ]], + ["punctuation", "{"], + + ["directive", [ + ["keyword", "rewrite"], + " ^ /index.html last" + ]], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["directive", [ + ["keyword", "if"], + " (!-f ", + ["variable", "$document_root"], + ["variable", "$inc"], + ".html)" + ]], + ["punctuation", "{"], + + ["directive", [ + ["keyword", "return"], + ["number", "404"] + ]], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"] ] ---------------------------------------------------- -Checks for variables. \ No newline at end of file +Checks for variables. diff --git a/tests/languages/nim/char_feature.test b/tests/languages/nim/char_feature.test new file mode 100644 index 0000000000..c2ec9c8ef8 --- /dev/null +++ b/tests/languages/nim/char_feature.test @@ -0,0 +1,9 @@ +'\'' +'\xFC' + +---------------------------------------------------- + +[ + ["char", "'\\''"], + ["char", "'\\xFC'"] +] diff --git a/tests/languages/nim/function_feature.test b/tests/languages/nim/function_feature.test index 899ad50f30..5c8449a5b7 100644 --- a/tests/languages/nim/function_feature.test +++ b/tests/languages/nim/function_feature.test @@ -6,12 +6,22 @@ takeV[T]( ---------------------------------------------------- [ - ["function", ["fo\\x9ao"]], ["punctuation", "("], - ["function", ["class", ["operator", "*"]]], ["punctuation", "("], - ["function", ["takeV[T]"]], ["punctuation", "("], - ["function", ["`$`"]], ["punctuation", "("] + ["function", ["fo\\x9ao"]], + ["punctuation", "("], + + ["function", [ + "class", + ["operator", "*"] + ]], + ["punctuation", "("], + + ["function", ["takeV[T]"]], + ["punctuation", "("], + + ["function", ["`$`"]], + ["punctuation", "("] ] ---------------------------------------------------- -Checks for functions. \ No newline at end of file +Checks for functions. diff --git a/tests/languages/nim/identifier_feature.test b/tests/languages/nim/identifier_feature.test new file mode 100644 index 0000000000..d547eb882e --- /dev/null +++ b/tests/languages/nim/identifier_feature.test @@ -0,0 +1,14 @@ +var `var` = 42 + +---------------------------------------------------- + +[ + ["keyword", "var"], + ["identifier", [ + ["punctuation", "`"], + "var", + ["punctuation", "`"] + ]], + ["operator", "="], + ["number", "42"] +] diff --git a/tests/languages/nim/string_feature.test b/tests/languages/nim/string_feature.test index cd41819d1d..f93191ef05 100644 --- a/tests/languages/nim/string_feature.test +++ b/tests/languages/nim/string_feature.test @@ -15,24 +15,24 @@ fo\x8Fo"Foobar" bar"""Foo bar""" -'\'' -'\xFC' - ---------------------------------------------------- [ ["string", "\"\""], ["string", "\"Fo\\\"obar\""], + ["string", "\"\"\"\"\"\""], ["string", "\"\"\"Fo\"o\r\nbar\"\"\""], + ["string", "R\"Raw \"\"string\""], + ["string", "r\"Raw\r\n\"\"string\""], + ["string", "fo\\x8Fo\"Foobar\""], - ["string", "bar\"\"\"Foo\r\nbar\"\"\""], - ["string", "'\\''"], - ["string", "'\\xFC'"] + + ["string", "bar\"\"\"Foo\r\nbar\"\"\""] ] ---------------------------------------------------- -Checks for strings and character literals. \ No newline at end of file +Checks for strings and character literals. diff --git a/tests/languages/nsis/constant_feature.test b/tests/languages/nsis/constant_feature.test index c3a41a7bec..6e560b5f3f 100644 --- a/tests/languages/nsis/constant_feature.test +++ b/tests/languages/nsis/constant_feature.test @@ -1,21 +1,25 @@ $(myLicenseData) $(^Name) +$(!Name) ${LANG_ENGLISH} ${AtLeastWin8.1} ${nsArray_Copy} ${xml::CreateNode} ${^EXAMPLE} +${!defineifexist} ---------------------------------------------------- [ ["constant", "$(myLicenseData)"], ["constant", "$(^Name)"], + ["constant", "$(!Name)"], ["constant", "${LANG_ENGLISH}"], ["constant", "${AtLeastWin8.1}"], ["constant", "${nsArray_Copy}"], ["constant", "${xml::CreateNode}"], - ["constant", "${^EXAMPLE}"] + ["constant", "${^EXAMPLE}"], + ["constant", "${!defineifexist}"] ] ---------------------------------------------------- diff --git a/tests/languages/nsis/variable_feature.test b/tests/languages/nsis/variable_feature.test index ba2ced201b..e048dd85c5 100644 --- a/tests/languages/nsis/variable_feature.test +++ b/tests/languages/nsis/variable_feature.test @@ -1,11 +1,13 @@ $INTERNET_CACHE $LANGUAGE +$mui.Button.Next ---------------------------------------------------- [ ["variable", "$INTERNET_CACHE"], - ["variable", "$LANGUAGE"] + ["variable", "$LANGUAGE"], + ["variable", "$mui.Button.Next"] ] ---------------------------------------------------- diff --git a/tests/languages/objectivec/char_feature.test b/tests/languages/objectivec/char_feature.test new file mode 100644 index 0000000000..a97fc67d96 --- /dev/null +++ b/tests/languages/objectivec/char_feature.test @@ -0,0 +1,15 @@ +'a' +'\n' +'\000' +'\x00' +'\u0000' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\n'"], + ["char", "'\\000'"], + ["char", "'\\x00'"], + ["char", "'\\u0000'"] +] diff --git a/tests/languages/objectivec/string_feature.test b/tests/languages/objectivec/string_feature.test index d6c7b30da0..86953aecfb 100644 --- a/tests/languages/objectivec/string_feature.test +++ b/tests/languages/objectivec/string_feature.test @@ -3,11 +3,6 @@ "foo\ bar" -'' -'fo\'o' -'foo\ -bar' - @"" @"fo\"o" @"foo\ @@ -20,10 +15,6 @@ bar" ["string", "\"fo\\\"o\""], ["string", "\"foo\\\r\nbar\""], - ["string", "''"], - ["string", "'fo\\'o'"], - ["string", "'foo\\\r\nbar'"], - ["string", "@\"\""], ["string", "@\"fo\\\"o\""], ["string", "@\"foo\\\r\nbar\""] @@ -31,4 +22,4 @@ bar" ---------------------------------------------------- -Checks for strings. \ No newline at end of file +Checks for strings. diff --git a/tests/languages/ocaml/char_feature.test b/tests/languages/ocaml/char_feature.test new file mode 100644 index 0000000000..57dbbd9dd0 --- /dev/null +++ b/tests/languages/ocaml/char_feature.test @@ -0,0 +1,15 @@ +'a' +'\n' +'\'' +'\xA9' +'\169' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\n'"], + ["char", "'\\''"], + ["char", "'\\xA9'"], + ["char", "'\\169'"] +] diff --git a/tests/languages/ocaml/number_feature.test b/tests/languages/ocaml/number_feature.test index 6ade2114e8..5975858019 100644 --- a/tests/languages/ocaml/number_feature.test +++ b/tests/languages/ocaml/number_feature.test @@ -5,9 +5,13 @@ 0b1010_1111 42_000 3.14_15_9 +3.141_592_653_589_793_12 +1e-5 3.2e8 6.1E-7 +2.22044604925031308e-16 0.4e+12_415 +0x1p-52 ---------------------------------------------------- @@ -19,11 +23,15 @@ ["number", "0b1010_1111"], ["number", "42_000"], ["number", "3.14_15_9"], + ["number", "3.141_592_653_589_793_12"], + ["number", "1e-5"], ["number", "3.2e8"], ["number", "6.1E-7"], - ["number", "0.4e+12_415"] + ["number", "2.22044604925031308e-16"], + ["number", "0.4e+12_415"], + ["number", "0x1p-52"] ] ---------------------------------------------------- -Checks for numbers. \ No newline at end of file +Checks for numbers. diff --git a/tests/languages/ocaml/operator_feature.test b/tests/languages/ocaml/operator_feature.test index 50047fe8dc..47ea03e15c 100644 --- a/tests/languages/ocaml/operator_feature.test +++ b/tests/languages/ocaml/operator_feature.test @@ -2,11 +2,12 @@ and asr land lor lsl lsr lxor mod or -:= +:= :> = < > @ -^ | & ~ +^ | & ~ .~ + - * / $ % ! ? +.. ~=~ @@ -18,14 +19,34 @@ $ % ! ? ["operator", "lxor"], ["operator", "mod"], ["operator", "or"], ["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", "~=~"] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/ocaml/punctuation_feature.test b/tests/languages/ocaml/punctuation_feature.test new file mode 100644 index 0000000000..8c607e03ff --- /dev/null +++ b/tests/languages/ocaml/punctuation_feature.test @@ -0,0 +1,41 @@ +( ) { } [ ] +. , : ; +_ +:: ;; + +[< [> [| {< +>] >} |] + +# + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", ";"], + + ["punctuation", "_"], + + ["punctuation", "::"], + ["punctuation", ";;"], + + ["operator-like-punctuation", "[<"], + ["operator-like-punctuation", "[>"], + ["operator-like-punctuation", "[|"], + ["operator-like-punctuation", "{<"], + + ["operator-like-punctuation", ">]"], + ["operator-like-punctuation", ">}"], + ["operator-like-punctuation", "|]"], + + ["punctuation", "#"] +] diff --git a/tests/languages/ocaml/string_feature.test b/tests/languages/ocaml/string_feature.test index b7eabd4dda..bfaef714f4 100644 --- a/tests/languages/ocaml/string_feature.test +++ b/tests/languages/ocaml/string_feature.test @@ -1,25 +1,31 @@ "" "Fo\"obar" -'\'' -'\123' -'\xf4' -`\`` -`\123` -`\xf4` +"Call me Ishmael. Some years ago — never mind how long \ +precisely — having little or no money in my purse, and \ +nothing particular to interest me on shore, I thought I\ +\ would sail about a little and see the watery part of t\ +he world." + +{|This is a quoted string, here, neither \ nor " are special characters|} +{|"Hello, World!"|} +{|"\\"|} +{delimiter|the end of this|}quoted string is here|delimiter} +{ext|hello {|world|}|ext} ---------------------------------------------------- [ ["string", "\"\""], ["string", "\"Fo\\\"obar\""], - ["string", "'\\''"], - ["string", "'\\123'"], - ["string", "'\\xf4'"], - ["string", "`\\``"], - ["string", "`\\123`"], - ["string", "`\\xf4`"] + ["string", "\"Call me Ishmael. Some years ago — never mind how long \\\r\nprecisely — having little or no money in my purse, and \\\r\nnothing particular to interest me on shore, I thought I\\\r\n\\ would sail about a little and see the watery part of t\\\r\nhe world.\""], + + ["string", "{|This is a quoted string, here, neither \\ nor \" are special characters|}"], + ["string", "{|\"Hello, World!\"|}"], + ["string", "{|\"\\\\\"|}"], + ["string", "{delimiter|the end of this|}quoted string is here|delimiter}"], + ["string", "{ext|hello {|world|}|ext}"] ] ---------------------------------------------------- -Checks for strings. \ No newline at end of file +Checks for strings. diff --git a/tests/languages/ocaml/type_variable_feature.test b/tests/languages/ocaml/type-variable_feature.test similarity index 56% rename from tests/languages/ocaml/type_variable_feature.test rename to tests/languages/ocaml/type-variable_feature.test index 7f680e47fe..9c89b8acd4 100644 --- a/tests/languages/ocaml/type_variable_feature.test +++ b/tests/languages/ocaml/type-variable_feature.test @@ -4,10 +4,10 @@ ---------------------------------------------------- [ - ["type_variable", "'Foo"], - ["type_variable", "'bar_42"] + ["type-variable", "'Foo"], + ["type-variable", "'bar_42"] ] ---------------------------------------------------- -Checks for type variables. \ No newline at end of file +Checks for type variables. diff --git a/tests/languages/opencl/builtin-type_feature.test b/tests/languages/opencl/builtin-type_feature.test new file mode 100644 index 0000000000..e99ada8dd2 --- /dev/null +++ b/tests/languages/opencl/builtin-type_feature.test @@ -0,0 +1,71 @@ +_cl_command_queue +_cl_context +_cl_device_id +_cl_event +_cl_kernel +_cl_mem +_cl_platform_id +_cl_program +_cl_sampler +cl_image_format +cl_mem_fence_flags +clk_event_t +event_t +image1d_array_t +image1d_buffer_t +image1d_t +image2d_array_depth_t +image2d_array_msaa_depth_t +image2d_array_msaa_t +image2d_array_t +image2d_depth_t +image2d_msaa_depth_t +image2d_msaa_t +image2d_t +image3d_t +intptr_t +ndrange_t +ptrdiff_t +queue_t +reserve_id_t +sampler_t +size_t +uintptr_t + +---------------------------------------------------- + +[ + ["builtin-type", "_cl_command_queue"], + ["builtin-type", "_cl_context"], + ["builtin-type", "_cl_device_id"], + ["builtin-type", "_cl_event"], + ["builtin-type", "_cl_kernel"], + ["builtin-type", "_cl_mem"], + ["builtin-type", "_cl_platform_id"], + ["builtin-type", "_cl_program"], + ["builtin-type", "_cl_sampler"], + ["builtin-type", "cl_image_format"], + ["builtin-type", "cl_mem_fence_flags"], + ["builtin-type", "clk_event_t"], + ["builtin-type", "event_t"], + ["builtin-type", "image1d_array_t"], + ["builtin-type", "image1d_buffer_t"], + ["builtin-type", "image1d_t"], + ["builtin-type", "image2d_array_depth_t"], + ["builtin-type", "image2d_array_msaa_depth_t"], + ["builtin-type", "image2d_array_msaa_t"], + ["builtin-type", "image2d_array_t"], + ["builtin-type", "image2d_depth_t"], + ["builtin-type", "image2d_msaa_depth_t"], + ["builtin-type", "image2d_msaa_t"], + ["builtin-type", "image2d_t"], + ["builtin-type", "image3d_t"], + ["builtin-type", "intptr_t"], + ["builtin-type", "ndrange_t"], + ["builtin-type", "ptrdiff_t"], + ["builtin-type", "queue_t"], + ["builtin-type", "reserve_id_t"], + ["builtin-type", "sampler_t"], + ["builtin-type", "size_t"], + ["builtin-type", "uintptr_t"] +] \ No newline at end of file diff --git a/tests/languages/opencl/keyword_feature.test b/tests/languages/opencl/keyword_feature.test index b171c054e5..ffc873d55f 100644 --- a/tests/languages/opencl/keyword_feature.test +++ b/tests/languages/opencl/keyword_feature.test @@ -7,15 +7,6 @@ __private __read_only __read_write __write_only -_cl_command_queue -_cl_context -_cl_device_id -_cl_event -_cl_kernel -_cl_mem -_cl_platform_id -_cl_program -_cl_sampler auto bool bool16 @@ -31,9 +22,6 @@ char2 char3 char4 char8 -cl_image_format -cl_mem_fence_flags -clk_event_t complex const constant @@ -72,7 +60,6 @@ double8x4 double8x8 else enum; -event_t extern float float16 @@ -114,18 +101,6 @@ half3 half4 half8 if -image1d_array_t -image1d_buffer_t -image1d_t -image2d_array_depth_t -image2d_array_msaa_depth_t -image2d_array_msaa_t -image2d_array_t -image2d_depth_t -image2d_msaa_depth_t -image2d_msaa_t -image2d_t -image3d_t imaginary int int16 @@ -133,7 +108,6 @@ int2 int3 int4 int8 -intptr_t kernel local long @@ -142,31 +116,25 @@ long2 long3 long4 long8 -ndrange_t packed pipe private -ptrdiff_t quad quad16 quad2 quad3 quad4 quad8 -queue_t read_only read_write register -reserve_id_t restrict -sampler_t short short16 short2 short3 short4 short8 -size_t static struct; switch @@ -183,7 +151,6 @@ uint2 uint3 uint4 uint8 -uintptr_t ulong ulong16 ulong2 @@ -216,15 +183,6 @@ write_only ["keyword", "__read_only"], ["keyword", "__read_write"], ["keyword", "__write_only"], - ["keyword", "_cl_command_queue"], - ["keyword", "_cl_context"], - ["keyword", "_cl_device_id"], - ["keyword", "_cl_event"], - ["keyword", "_cl_kernel"], - ["keyword", "_cl_mem"], - ["keyword", "_cl_platform_id"], - ["keyword", "_cl_program"], - ["keyword", "_cl_sampler"], ["keyword", "auto"], ["keyword", "bool"], ["keyword", "bool16"], @@ -240,9 +198,6 @@ write_only ["keyword", "char3"], ["keyword", "char4"], ["keyword", "char8"], - ["keyword", "cl_image_format"], - ["keyword", "cl_mem_fence_flags"], - ["keyword", "clk_event_t"], ["keyword", "complex"], ["keyword", "const"], ["keyword", "constant"], @@ -280,8 +235,8 @@ write_only ["keyword", "double8x4"], ["keyword", "double8x8"], ["keyword", "else"], - ["keyword", "enum"], ["punctuation", ";"], - ["keyword", "event_t"], + ["keyword", "enum"], + ["punctuation", ";"], ["keyword", "extern"], ["keyword", "float"], ["keyword", "float16"], @@ -323,18 +278,6 @@ write_only ["keyword", "half4"], ["keyword", "half8"], ["keyword", "if"], - ["keyword", "image1d_array_t"], - ["keyword", "image1d_buffer_t"], - ["keyword", "image1d_t"], - ["keyword", "image2d_array_depth_t"], - ["keyword", "image2d_array_msaa_depth_t"], - ["keyword", "image2d_array_msaa_t"], - ["keyword", "image2d_array_t"], - ["keyword", "image2d_depth_t"], - ["keyword", "image2d_msaa_depth_t"], - ["keyword", "image2d_msaa_t"], - ["keyword", "image2d_t"], - ["keyword", "image3d_t"], ["keyword", "imaginary"], ["keyword", "int"], ["keyword", "int16"], @@ -342,7 +285,6 @@ write_only ["keyword", "int3"], ["keyword", "int4"], ["keyword", "int8"], - ["keyword", "intptr_t"], ["keyword", "kernel"], ["keyword", "local"], ["keyword", "long"], @@ -351,33 +293,28 @@ write_only ["keyword", "long3"], ["keyword", "long4"], ["keyword", "long8"], - ["keyword", "ndrange_t"], ["keyword", "packed"], ["keyword", "pipe"], ["keyword", "private"], - ["keyword", "ptrdiff_t"], ["keyword", "quad"], ["keyword", "quad16"], ["keyword", "quad2"], ["keyword", "quad3"], ["keyword", "quad4"], ["keyword", "quad8"], - ["keyword", "queue_t"], ["keyword", "read_only"], ["keyword", "read_write"], ["keyword", "register"], - ["keyword", "reserve_id_t"], ["keyword", "restrict"], - ["keyword", "sampler_t"], ["keyword", "short"], ["keyword", "short16"], ["keyword", "short2"], ["keyword", "short3"], ["keyword", "short4"], ["keyword", "short8"], - ["keyword", "size_t"], ["keyword", "static"], - ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "struct"], + ["punctuation", ";"], ["keyword", "switch"], ["keyword", "typedef"], ["keyword", "uchar"], @@ -392,7 +329,6 @@ write_only ["keyword", "uint3"], ["keyword", "uint4"], ["keyword", "uint8"], - ["keyword", "uintptr_t"], ["keyword", "ulong"], ["keyword", "ulong16"], ["keyword", "ulong2"], @@ -416,4 +352,4 @@ write_only ---------------------------------------------------- -Checks for all keywords in OpenCL kernel code. +Checks for all keywords in OpenCL kernel code. \ No newline at end of file diff --git a/tests/languages/openqasm/class-name_feature.test b/tests/languages/openqasm/class-name_feature.test new file mode 100644 index 0000000000..31c8e52658 --- /dev/null +++ b/tests/languages/openqasm/class-name_feature.test @@ -0,0 +1,29 @@ +angle +bit +bool +creg +fixed +float +int +length +qreg +qubit +stretch +uint + +---------------------------------------------------- + +[ + ["class-name", "angle"], + ["class-name", "bit"], + ["class-name", "bool"], + ["class-name", "creg"], + ["class-name", "fixed"], + ["class-name", "float"], + ["class-name", "int"], + ["class-name", "length"], + ["class-name", "qreg"], + ["class-name", "qubit"], + ["class-name", "stretch"], + ["class-name", "uint"] +] \ No newline at end of file diff --git a/tests/languages/openqasm/comment_feature.test b/tests/languages/openqasm/comment_feature.test new file mode 100644 index 0000000000..230aa91052 --- /dev/null +++ b/tests/languages/openqasm/comment_feature.test @@ -0,0 +1,13 @@ +/* + comment + */ + +// comment + +---------------------------------------------------- + +[ + ["comment", "/*\r\n comment\r\n */"], + + ["comment", "// comment"] +] \ No newline at end of file diff --git a/tests/languages/openqasm/constant_feature.test b/tests/languages/openqasm/constant_feature.test new file mode 100644 index 0000000000..35e178f685 --- /dev/null +++ b/tests/languages/openqasm/constant_feature.test @@ -0,0 +1,9 @@ +pi tau euler +π τ ℇ + +---------------------------------------------------- + +[ + ["constant", "pi"], ["constant", "tau"], ["constant", "euler"], + ["constant", "π"], " τ ", ["constant", "ℇ"] +] \ No newline at end of file diff --git a/tests/languages/openqasm/function_feature.test b/tests/languages/openqasm/function_feature.test new file mode 100644 index 0000000000..cf018998fc --- /dev/null +++ b/tests/languages/openqasm/function_feature.test @@ -0,0 +1,23 @@ +sin( +cos( +tan( +exp( +ln( +sqrt( +rotl( +rotr( +popcount( + +---------------------------------------------------- + +[ + ["function", "sin"], ["punctuation", "("], + ["function", "cos"], ["punctuation", "("], + ["function", "tan"], ["punctuation", "("], + ["function", "exp"], ["punctuation", "("], + ["function", "ln"], ["punctuation", "("], + ["function", "sqrt"], ["punctuation", "("], + ["function", "rotl"], ["punctuation", "("], + ["function", "rotr"], ["punctuation", "("], + ["function", "popcount"], ["punctuation", "("] +] diff --git a/tests/languages/openqasm/keyword_feature.test b/tests/languages/openqasm/keyword_feature.test new file mode 100644 index 0000000000..97fe741d45 --- /dev/null +++ b/tests/languages/openqasm/keyword_feature.test @@ -0,0 +1,79 @@ +barrier +boxas +boxto +break +const +continue +ctrl +def +defcal +defcalgrammar +delay +else +end +for +gate +gphase +if +in +include +inv +kernel +lengthof +let +measure +pow +reset +return +rotary +stretchinf +while + +OPENQASM + +CX +U + +#pragma + +---------------------------------------------------- + +[ + ["keyword", "barrier"], + ["keyword", "boxas"], + ["keyword", "boxto"], + ["keyword", "break"], + ["keyword", "const"], + ["keyword", "continue"], + ["keyword", "ctrl"], + ["keyword", "def"], + ["keyword", "defcal"], + ["keyword", "defcalgrammar"], + ["keyword", "delay"], + ["keyword", "else"], + ["keyword", "end"], + ["keyword", "for"], + ["keyword", "gate"], + ["keyword", "gphase"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "include"], + ["keyword", "inv"], + ["keyword", "kernel"], + ["keyword", "lengthof"], + ["keyword", "let"], + ["keyword", "measure"], + ["keyword", "pow"], + ["keyword", "reset"], + ["keyword", "return"], + ["keyword", "rotary"], + ["keyword", "stretchinf"], + ["keyword", "while"], + + ["keyword", "OPENQASM"], + + ["keyword", "CX"], + ["keyword", "U"], + + ["keyword", "#pragma"] +] \ No newline at end of file diff --git a/tests/languages/openqasm/number_feature.test b/tests/languages/openqasm/number_feature.test new file mode 100644 index 0000000000..1be0c7bc58 --- /dev/null +++ b/tests/languages/openqasm/number_feature.test @@ -0,0 +1,23 @@ +1234 +1e2 +.5 + +1000ms +1000dt + +// not a number +$0 + +---------------------------------------------------- + +[ + ["number", "1234"], + ["number", "1e2"], + ["number", ".5"], + + ["number", "1000ms"], + ["number", "1000dt"], + + ["comment", "// not a number"], + "\r\n$0" +] \ No newline at end of file diff --git a/tests/languages/openqasm/operator_feature.test b/tests/languages/openqasm/operator_feature.test new file mode 100644 index 0000000000..7839505f0c --- /dev/null +++ b/tests/languages/openqasm/operator_feature.test @@ -0,0 +1,56 @@ +> < >= <= == != + +& | ~ ^ << >> +&= |= ~= ^= <<= >>= + +! && || + += -> @ + ++ - * / % ++= -= *= /= %= +++ -- + +---------------------------------------------------- + +[ + ["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", "--"] +] \ No newline at end of file diff --git a/tests/languages/openqasm/punctuation_feature.test b/tests/languages/openqasm/punctuation_feature.test new file mode 100644 index 0000000000..462695fdef --- /dev/null +++ b/tests/languages/openqasm/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) { } [ ] +; , : . + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", ";"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", "."] +] diff --git a/tests/languages/openqasm/string_feature.test b/tests/languages/openqasm/string_feature.test new file mode 100644 index 0000000000..78eae93ac7 --- /dev/null +++ b/tests/languages/openqasm/string_feature.test @@ -0,0 +1,9 @@ +"foo" +'bar' + +---------------------------------------------------- + +[ + ["string", "\"foo\""], + ["string", "'bar'"] +] \ No newline at end of file diff --git a/tests/languages/oz/attr-name_feature.test b/tests/languages/oz/attr-name_feature.test index 46dc2221e2..80af8b7d0b 100644 --- a/tests/languages/oz/attr-name_feature.test +++ b/tests/languages/oz/attr-name_feature.test @@ -1,14 +1,25 @@ menubutton(text:'Test' underline:0) +% negative example +val:=Value + ---------------------------------------------------- [ - ["function", "menubutton"], ["punctuation", "("], - ["attr-name", "text"], ["punctuation", ":"], ["atom", "'Test'"], - ["attr-name", "underline"], ["punctuation", ":"], ["number", "0"], - ["punctuation", ")"] + ["function", "menubutton"], + ["punctuation", "("], + ["attr-name", "text"], + ["punctuation", ":"], + ["atom", "'Test'"], + ["attr-name", "underline"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", ")"], + + ["comment", "% negative example"], + "\r\nval", ["operator", ":="], "Value" ] ---------------------------------------------------- -Checks for parameter names. \ No newline at end of file +Checks for parameter names. diff --git a/tests/languages/oz/variable_feature.test b/tests/languages/oz/variable_feature.test index 51274d6637..86b9108de7 100644 --- a/tests/languages/oz/variable_feature.test +++ b/tests/languages/oz/variable_feature.test @@ -1,15 +1,7 @@ -A -Foobar -Foo42 - ----------------------------------------------------- - -[ - ["variable", "A"], - ["variable", "Foobar"], - ["variable", "Foo42"] -] - ----------------------------------------------------- - -Checks for variables. \ No newline at end of file +`foo` + +---------------------------------------------------- + +[ + ["variable", "`foo`"] +] diff --git a/tests/languages/pascal/asm_feature.test b/tests/languages/pascal/asm_feature.test new file mode 100644 index 0000000000..450518702d --- /dev/null +++ b/tests/languages/pascal/asm_feature.test @@ -0,0 +1,344 @@ +program asmDemo(input, output, stderr); + +// The $asmMode directive informs the compiler +// which syntax is used in asm-blocks. +// Alternatives are 'att' (AT&T syntax) and 'direct'. +{$asmMode intel} + +var + n, m: longint; +begin + n := 42; + m := -7; + writeLn('n = ', n, '; m = ', m); + + // instead of declaring another temporary variable + // and writing "tmp := n; n := m; m := tmp;": + asm + mov eax, n // eax := n + // xchg can only operate at most on one memory address + xchg eax, m // swaps values in eax and at m + mov n, eax // n := eax (holding the former m value) + // an array of strings after the asm-block closing 'end' + // tells the compiler which registers have changed + // (you don't wanna mess with the compiler's notion + // which registers mean what) + end ['eax']; + + writeLn('n = ', n, '; m = ', m); +end. + +program sign(input, output, stderr); + +type + signumCodomain = -1..1; + +{ returns the sign of an integer } +function signum({$ifNDef CPUx86_64} const {$endIf} x: longint): signumCodomain; +{$ifDef CPUx86_64} // ============= optimized implementation +assembler; +{$asmMode intel} +asm + xor rax, rax // ensure result is not wrong + // due to any residue + + test x, x // x ≟ 0 + setnz al // al ≔ ¬ZF + + sar x, 63 // propagate sign-bit through reg. + cmovs rax, x // if SF then rax ≔ −1 +end; +{$else} // ========================== default implementation +begin + // This is what math.sign virtually does. + // The compiled code requires _two_ cmp instructions, though. + if x > 0 then + begin + signum := 1; + end + else if x < 0 then + begin + signum := -1; + end + else + begin + signum := 0; + end; +end; +{$endIf} + +// M A I N ================================================= +var + x: longint; +begin + readLn(x); + writeLn(signum(x)); +end. + +---------------------------------------------------- + +[ + ["keyword", "program"], + " asmDemo", + ["punctuation", "("], + "input", + ["punctuation", ","], + " output", + ["punctuation", ","], + " stderr", + ["punctuation", ")"], + ["punctuation", ";"], + + ["comment", "// The $asmMode directive informs the compiler"], + ["comment", "// which syntax is used in asm-blocks."], + ["comment", "// Alternatives are 'att' (AT&T syntax) and 'direct'."], + ["directive", "{$asmMode intel}"], + + ["keyword", "var"], + + "\r\n\tn", + ["punctuation", ","], + " m", + ["punctuation", ":"], + " longint", + ["punctuation", ";"], + + ["keyword", "begin"], + + "\r\n\tn ", + ["operator", ":="], + ["number", "42"], + ["punctuation", ";"], + + "\r\n\tm ", + ["operator", ":="], + ["operator", "-"], + ["number", "7"], + ["punctuation", ";"], + + "\r\n\twriteLn", + ["punctuation", "("], + ["string", "'n = '"], + ["punctuation", ","], + " n", + ["punctuation", ","], + ["string", "'; m = '"], + ["punctuation", ","], + " m", + ["punctuation", ")"], + ["punctuation", ";"], + + ["comment", "// instead of declaring another temporary variable"], + + ["comment", "// and writing \"tmp := n; n := m; m := tmp;\":"], + + ["keyword", "asm"], + ["asm", [ + "\r\n\t\tmov eax", + ["punctuation", ","], + " n ", + ["comment", "// eax := n"], + + ["comment", "// xchg can only operate at most on one memory address"], + + "\r\n\t\txchg eax", + ["punctuation", ","], + " m ", + ["comment", "// swaps values in eax and at m"], + + "\r\n\t\tmov n", + ["punctuation", ","], + " eax ", + ["comment", "// n := eax (holding the former m value)"], + + ["comment", "// an array of strings after the asm-block closing 'end'"], + + ["comment", "// tells the compiler which registers have changed"], + + ["comment", "// (you don't wanna mess with the compiler's notion"], + + ["comment", "// which registers mean what)"] + ]], + ["keyword", "end"], + ["punctuation", "["], + ["string", "'eax'"], + ["punctuation", "]"], + ["punctuation", ";"], + + "\r\n\r\n\twriteLn", + ["punctuation", "("], + ["string", "'n = '"], + ["punctuation", ","], + " n", + ["punctuation", ","], + ["string", "'; m = '"], + ["punctuation", ","], + " m", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end"], + ["punctuation", "."], + + ["keyword", "program"], + " sign", + ["punctuation", "("], + "input", + ["punctuation", ","], + " output", + ["punctuation", ","], + " stderr", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "type"], + + "\r\n\tsignumCodomain ", + ["operator", "="], + ["operator", "-"], + ["number", "1"], + ["operator", ".."], + ["number", "1"], + ["punctuation", ";"], + + ["comment", "{ returns the sign of an integer }"], + + ["keyword", "function"], + " signum", + ["punctuation", "("], + ["directive", "{$ifNDef CPUx86_64}"], + ["keyword", "const"], + ["directive", "{$endIf}"], + " x", + ["punctuation", ":"], + " longint", + ["punctuation", ")"], + ["punctuation", ":"], + " signumCodomain", + ["punctuation", ";"], + + ["directive", "{$ifDef CPUx86_64}"], + ["comment", "// ============= optimized implementation"], + + ["keyword", "assembler"], + ["punctuation", ";"], + + ["directive", "{$asmMode intel}"], + + ["keyword", "asm"], + ["asm", [ + "\r\n\txor rax", + ["punctuation", ","], + " rax ", + ["comment", "// ensure result is not wrong"], + + ["comment", "// due to any residue"], + + "\r\n\r\n\ttest x", + ["punctuation", ","], + " x ", + ["comment", "// x ≟ 0"], + + "\r\n\tsetnz al ", + ["comment", "// al ≔ ¬ZF"], + + "\r\n\r\n\tsar x", + ["punctuation", ","], + ["number", "63"], + ["comment", "// propagate sign-bit through reg."], + + "\r\n\tcmovs rax", + ["punctuation", ","], + " x ", + ["comment", "// if SF then rax ≔ −1"] + ]], + ["keyword", "end"], + ["punctuation", ";"], + + ["directive", "{$else}"], + ["comment", "// ========================== default implementation"], + + ["keyword", "begin"], + + ["comment", "// This is what math.sign virtually does."], + + ["comment", "// The compiled code requires _two_ cmp instructions, though."], + + ["keyword", "if"], + " x ", + ["operator", ">"], + ["number", "0"], + ["keyword", "then"], + + ["keyword", "begin"], + + "\r\n\t\tsignum ", + ["operator", ":="], + ["number", "1"], + ["punctuation", ";"], + + ["keyword", "end"], + + ["keyword", "else"], + ["keyword", "if"], + " x ", + ["operator", "<"], + ["number", "0"], + ["keyword", "then"], + + ["keyword", "begin"], + + "\r\n\t\tsignum ", + ["operator", ":="], + ["operator", "-"], + ["number", "1"], + ["punctuation", ";"], + + ["keyword", "end"], + + ["keyword", "else"], + + ["keyword", "begin"], + + "\r\n\t\tsignum ", + ["operator", ":="], + ["number", "0"], + ["punctuation", ";"], + + ["keyword", "end"], + ["punctuation", ";"], + + ["keyword", "end"], + ["punctuation", ";"], + + ["directive", "{$endIf}"], + + ["comment", "// M A I N ================================================="], + + ["keyword", "var"], + + "\r\n\tx", + ["punctuation", ":"], + " longint", + ["punctuation", ";"], + + ["keyword", "begin"], + + "\r\n\treadLn", + ["punctuation", "("], + "x", + ["punctuation", ")"], + ["punctuation", ";"], + + "\r\n\twriteLn", + ["punctuation", "("], + "signum", + ["punctuation", "("], + "x", + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end"], + ["punctuation", "."] +] diff --git a/tests/languages/pascal/directive_feature.test b/tests/languages/pascal/directive_feature.test new file mode 100644 index 0000000000..68b85d228a --- /dev/null +++ b/tests/languages/pascal/directive_feature.test @@ -0,0 +1,12 @@ +{$ASSERTIONS} +{$asmMode intel} +{$ifDef CPUx86_64} // ============= optimized implementation + +---------------------------------------------------- + +[ + ["directive", "{$ASSERTIONS}"], + ["directive", "{$asmMode intel}"], + ["directive", "{$ifDef CPUx86_64}"], + ["comment", "// ============= optimized implementation"] +] diff --git a/tests/languages/pascaligo/class-name_feature.test b/tests/languages/pascaligo/class-name_feature.test new file mode 100644 index 0000000000..8b5ee2b52b --- /dev/null +++ b/tests/languages/pascaligo/class-name_feature.test @@ -0,0 +1,42 @@ +type storage is int + +function add (const store : storage; const delta : int) : storage is store + delta + +---------------------------------------------------- + +[ + ["keyword", "type"], + ["class-name", [ + "storage" + ]], + ["keyword", "is"], + ["class-name", [ + ["builtin", "int"] + ]], + + ["keyword", "function"], + ["function", "add"], + ["punctuation", "("], + ["keyword", "const"], + " store ", + ["punctuation", ":"], + ["class-name", [ + "storage" + ]], + ["punctuation", ";"], + ["keyword", "const"], + " delta ", + ["punctuation", ":"], + ["class-name", [ + ["builtin", "int"] + ]], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", [ + "storage" + ]], + ["keyword", "is"], + " store ", + ["operator", "+"], + " delta" +] diff --git a/tests/languages/peoplecode/class-name_feature.test b/tests/languages/peoplecode/class-name_feature.test new file mode 100644 index 0000000000..51091f7f09 --- /dev/null +++ b/tests/languages/peoplecode/class-name_feature.test @@ -0,0 +1,264 @@ +class FactorialClass + method factorial(&I as number) returns number; +end-class; + +class Fruit + property number FruitCount; +end-class; + +class Banana extends Fruit + property number BananaCount; +end-class; + +local Banana &MyBanana = Create Banana(); +local Fruit &MyFruit = &MyBanana; /* okay, Banana is a subtype of Fruit */ +local number &Num = &MyBanana.BananaCount; + +/* generic building class */ +class BuildingAsset + method Acquire(); + method DisasterPrep(); +end-class; + +method Acquire + %This.DisasterPrep(); +end-method;method DisasterPrep + PrepareForFire(); +end-method; + +/* building in Vancouver */ +class VancouverBuilding extends BuildingAssetmethod DisasterPrep(); +end-class; + +method DisasterPrep + PrepareForEarthquake();%Super.DisasterPrep(); /* call superclass method */ +end-method; + +/* building in Edmonton */ +class EdmontonBuilding extends BuildingAssetmethod DisasterPrep(); +end-class; + +method DisasterPrep + PrepareForFreezing();%Super.DisasterPrep(); /* call superclass method */ +end-method; + +local BuildingAsset &Building = Create VancouverBuilding(); + +&Building.Acquire(); /* calls PrepareForEarthquake then PrepareForFire */ + +&Building = Create EdmontonBuilding(); + +&Building.Acquire(); /* calls PrepareForFreezing then PrepareForFire */ + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", ["FactorialClass"]], + + ["keyword", "method"], + ["function-definition", "factorial"], + ["punctuation", "("], + "&I ", + ["keyword", "as"], + ["class-name", ["number"]], + ["punctuation", ")"], + ["keyword", "returns"], + ["class-name", ["number"]], + ["punctuation", ";"], + + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "class"], + ["class-name", ["Fruit"]], + + ["keyword", "property"], + ["class-name", ["number"]], + " FruitCount", + ["punctuation", ";"], + + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "class"], + ["class-name", ["Banana"]], + ["keyword", "extends"], + ["class-name", ["Fruit"]], + + ["keyword", "property"], + ["class-name", ["number"]], + " BananaCount", + ["punctuation", ";"], + + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "local"], + ["class-name", ["Banana"]], + " &MyBanana ", + ["operator", "="], + ["keyword", "Create"], + ["class-name", ["Banana"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "local"], + ["class-name", ["Fruit"]], + " &MyFruit ", + ["operator", "="], + " &MyBanana", + ["punctuation", ";"], + ["comment", "/* okay, Banana is a subtype of Fruit */"], + + ["keyword", "local"], + ["class-name", ["number"]], + " &Num ", + ["operator", "="], + " &MyBanana", + ["punctuation", "."], + "BananaCount", + ["punctuation", ";"], + + ["comment", "/* generic building class */"], + + ["keyword", "class"], + ["class-name", ["BuildingAsset"]], + + ["keyword", "method"], + ["function-definition", "Acquire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "Acquire"], + + ["variable", "%This"], + ["punctuation", "."], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end-method"], + ["punctuation", ";"], + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + + ["function", "PrepareForFire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end-method"], + ["punctuation", ";"], + + ["comment", "/* building in Vancouver */"], + + ["keyword", "class"], + ["class-name", ["VancouverBuilding"]], + ["keyword", "extends"], + ["class-name", ["BuildingAssetmethod"]], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + + ["function", "PrepareForEarthquake"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["variable", "%Super"], + ["punctuation", "."], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* call superclass method */"], + + ["keyword", "end-method"], + ["punctuation", ";"], + + ["comment", "/* building in Edmonton */"], + + ["keyword", "class"], + ["class-name", ["EdmontonBuilding"]], + ["keyword", "extends"], + ["class-name", ["BuildingAssetmethod"]], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + + ["function", "PrepareForFreezing"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["variable", "%Super"], + ["punctuation", "."], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* call superclass method */"], + + ["keyword", "end-method"], + ["punctuation", ";"], + + ["keyword", "local"], + ["class-name", ["BuildingAsset"]], + " &Building ", + ["operator", "="], + ["keyword", "Create"], + ["class-name", ["VancouverBuilding"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + "\r\n\r\n&Building", + ["punctuation", "."], + ["function", "Acquire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* calls PrepareForEarthquake then PrepareForFire */"], + + "\r\n\r\n&Building ", + ["operator", "="], + ["keyword", "Create"], + ["class-name", ["EdmontonBuilding"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + "\r\n\r\n&Building", + ["punctuation", "."], + ["function", "Acquire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* calls PrepareForFreezing then PrepareForFire */"] +] diff --git a/tests/languages/peoplecode/comment_feature.test b/tests/languages/peoplecode/comment_feature.test index dc59206041..135cb0d1a2 100644 --- a/tests/languages/peoplecode/comment_feature.test +++ b/tests/languages/peoplecode/comment_feature.test @@ -23,12 +23,16 @@ comment ---------------------------------------------------- [ - ["comment", "/*\ncomment\n*/"], + ["comment", "/*\r\ncomment\r\n*/"], + ["comment", "REM comment;"], - ["comment", "REM comment\nstatement;"], - ["comment", "<*\ncomment\n*>"], - ["comment", "<*\n<*\ncomment\n*>\n*>"], - ["comment", "/+\ncomment\n+/"] + ["comment", "REM comment\r\nstatement;"], + + ["comment", "<*\r\ncomment\r\n*>"], + + ["comment", "<*\r\n<*\r\ncomment\r\n*>\r\n*>"], + + ["comment", "/+\r\ncomment\r\n+/"] ] ---------------------------------------------------- diff --git a/tests/languages/peoplecode/function_feature.test b/tests/languages/peoplecode/function_feature.test new file mode 100644 index 0000000000..f3edb215f4 --- /dev/null +++ b/tests/languages/peoplecode/function_feature.test @@ -0,0 +1,9 @@ +GetCurrEffRow() + +---------------------------------------------------- + +[ + ["function", "GetCurrEffRow"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/perl/function_feature.test b/tests/languages/perl/function_feature.test index 552d2f3309..43aad2a8b5 100644 --- a/tests/languages/perl/function_feature.test +++ b/tests/languages/perl/function_feature.test @@ -4,10 +4,10 @@ sub Foo_Bar42 ---------------------------------------------------- [ - ["function", [["keyword", "sub"], " foo"]], - ["function", [["keyword", "sub"], " Foo_Bar42"]] + ["keyword", "sub"], ["function", "foo"], + ["keyword", "sub"], ["function", "Foo_Bar42"] ] ---------------------------------------------------- -Checks for functions. \ No newline at end of file +Checks for functions. diff --git a/tests/languages/perl/regex_feature.test b/tests/languages/perl/regex_feature.test index 2fb50e4917..357182891e 100644 --- a/tests/languages/perl/regex_feature.test +++ b/tests/languages/perl/regex_feature.test @@ -64,6 +64,12 @@ s +tr()<>c +y{foo\a] +s(foo +baz) + // /foo/gsx /foo\/bar/n @@ -119,6 +125,10 @@ baz> ["regex", "ya>"], ["regex", "s"], + ["regex", "tr()<>c"], + ["regex", "y{foo\\a]"], + ["regex", "s(foo\r\nbaz)"], + ["regex", "//"], ["regex", "/foo/gsx"], ["regex", "/foo\\/bar/n"] @@ -126,4 +136,4 @@ baz> ---------------------------------------------------- -Checks for regex and regex quote-like operators. \ No newline at end of file +Checks for regex and regex quote-like operators. diff --git a/tests/languages/perl/vstring_feature.test b/tests/languages/perl/v-string_feature.test similarity index 62% rename from tests/languages/perl/vstring_feature.test rename to tests/languages/perl/v-string_feature.test index 0af7c1ced9..5997adf036 100644 --- a/tests/languages/perl/vstring_feature.test +++ b/tests/languages/perl/v-string_feature.test @@ -1,13 +1,13 @@ -v1.2 -1.2.3 - ----------------------------------------------------- - -[ - ["vstring", "v1.2"], - ["vstring", "1.2.3"] -] - ----------------------------------------------------- - -Checks for vstrings. \ No newline at end of file +v1.2 +1.2.3 + +---------------------------------------------------- + +[ + ["v-string", "v1.2"], + ["v-string", "1.2.3"] +] + +---------------------------------------------------- + +Checks for v-strings. diff --git a/tests/languages/perl/variable_feature.test b/tests/languages/perl/variable_feature.test index aad023c485..4425d59785 100644 --- a/tests/languages/perl/variable_feature.test +++ b/tests/languages/perl/variable_feature.test @@ -3,6 +3,8 @@ $#foo ${^POSTMATCH} +${...} + $^V @1 @@ -26,6 +28,11 @@ $foo::'bar ["variable", "${^POSTMATCH}"], + ["variable", "$"], + ["punctuation", "{"], + ["operator", "..."], + ["punctuation", "}"], + ["variable", "$^V"], ["variable", "@1"], @@ -44,4 +51,4 @@ $foo::'bar ---------------------------------------------------- -Checks for variables. \ No newline at end of file +Checks for variables. diff --git a/tests/languages/php!+css-extras/issue2008.test b/tests/languages/php!+css-extras/issue2008.test index 4710e4ae46..34c084f5ff 100644 --- a/tests/languages/php!+css-extras/issue2008.test +++ b/tests/languages/php!+css-extras/issue2008.test @@ -1,44 +1,43 @@ - - ----------------------------------------------------- - -[ - ["tag", [ - ["tag", [ - ["punctuation", "<"], - "img" - ]], - ["style-attr", [ - ["attr-name", [ - ["attr-name", [ - "style" - ]] - ]], - ["punctuation", "=\""], - ["attr-value", [ - ["property", "width"], - ["punctuation", ":"], - ["php", [ - ["delimiter", ""] - ]], - "%" - ]], - ["punctuation", "\""] - ]], - ["punctuation", "/>"] - ]] -] - ----------------------------------------------------- - -Checks for #2008 where a part of markup templating's placeholder was tokenized as `number` by CSS Extras. + + +---------------------------------------------------- + +[ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "img" + ]], + ["special-attr", [ + ["attr-name", "style"], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["value", [ + ["property", "width"], + ["punctuation", ":"], + ["php", [ + ["delimiter", ""] + ]], + "%" + ]], + ["punctuation", "\""] + ]] + ]], + ["punctuation", "/>"] + ]] +] + +---------------------------------------------------- + +Checks for #2008 where a part of markup templating's placeholder was tokenized as `number` by CSS Extras. diff --git a/tests/languages/php!+php-extras/scope_feature.test b/tests/languages/php!+php-extras/scope_feature.test index bd961681b5..313a5549df 100644 --- a/tests/languages/php!+php-extras/scope_feature.test +++ b/tests/languages/php!+php-extras/scope_feature.test @@ -9,19 +9,27 @@ parent::baz() ["keyword", "static"], ["punctuation", "::"] ]], - ["function", "foo"], ["punctuation", "("], ["punctuation", ")"], + ["function", ["foo"]], + ["punctuation", "("], + ["punctuation", ")"], + ["scope", [ ["keyword", "self"], ["punctuation", "::"] ]], - ["function", "bar"], ["punctuation", "("], ["punctuation", ")"], + ["function", ["bar"]], + ["punctuation", "("], + ["punctuation", ")"], + ["scope", [ ["keyword", "parent"], ["punctuation", "::"] ]], - ["function", "baz"], ["punctuation", "("], ["punctuation", ")"] + ["function", ["baz"]], + ["punctuation", "("], + ["punctuation", ")"] ] ---------------------------------------------------- -Checks for scopes. \ No newline at end of file +Checks for scopes. diff --git a/tests/languages/php/argument-name_feature.test b/tests/languages/php/argument-name_feature.test new file mode 100644 index 0000000000..5d61d2f8c6 --- /dev/null +++ b/tests/languages/php/argument-name_feature.test @@ -0,0 +1,27 @@ +foo( + a: 'bar', + qux: 'baz' +); + +---------------------------------------------------- + +[ + ["function", ["foo"]], + ["punctuation", "("], + + ["argument-name", "a"], + ["punctuation", ":"], + ["string", "'bar'"], + ["punctuation", ","], + + ["argument-name", "qux"], + ["punctuation", ":"], + ["string", "'baz'"], + + ["punctuation", ")"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for named arguments. diff --git a/tests/languages/php/array_feature.test b/tests/languages/php/array_feature.test new file mode 100644 index 0000000000..5769920baf --- /dev/null +++ b/tests/languages/php/array_feature.test @@ -0,0 +1,136 @@ +$a = [ + 1 => [0, 1], + 2 => [2, 3], + 3 => [ + [0, 1], + [2, 3] + ] +]; + +$b = array( + Array(1, 2) +); + +$c = [...$a, ...$b, [5, 6]]; + +$d = [0, 1] + [2]; + +[$e] = [2, 3]; + +$f[] = 3; + +$g['key'] = 3; + +---------------------------------------------------- + +[ + ["variable", "$a"], + ["operator", "="], + ["punctuation", "["], + ["number", "1"], + ["operator", "=>"], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", "]"], + ["punctuation", ","], + ["number", "2"], + ["operator", "=>"], + ["punctuation", "["], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", "]"], + ["punctuation", ","], + ["number", "3"], + ["operator", "=>"], + ["punctuation", "["], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", "]"], + ["punctuation", ","], + ["punctuation", "["], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", "]"], + ["punctuation", "]"], + ["punctuation", "]"], + ["punctuation", ";"], + + ["variable", "$b"], + ["operator", "="], + ["keyword", "array"], + ["punctuation", "("], + ["keyword", "Array"], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["variable", "$c"], + ["operator", "="], + ["punctuation", "["], + ["operator", "..."], + ["variable", "$a"], + ["punctuation", ","], + ["operator", "..."], + ["variable", "$b"], + ["punctuation", ","], + ["punctuation", "["], + ["number", "5"], + ["punctuation", ","], + ["number", "6"], + ["punctuation", "]"], + ["punctuation", "]"], + ["punctuation", ";"], + + ["variable", "$d"], + ["operator", "="], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", "]"], + ["operator", "+"], + ["punctuation", "["], + ["number", "2"], + ["punctuation", "]"], + ["punctuation", ";"], + + ["punctuation", "["], + ["variable", "$e"], + ["punctuation", "]"], + ["operator", "="], + ["punctuation", "["], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", "]"], + ["punctuation", ";"], + + ["variable", "$f"], + ["punctuation", "["], + ["punctuation", "]"], + ["operator", "="], + ["number", "3"], + ["punctuation", ";"], + + ["variable", "$g"], + ["punctuation", "["], + ["string", "'key'"], + ["punctuation", "]"], + ["operator", "="], + ["number", "3"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for arrays. \ No newline at end of file diff --git a/tests/languages/php/attribute_feature.test b/tests/languages/php/attribute_feature.test new file mode 100644 index 0000000000..a7c2956ae7 --- /dev/null +++ b/tests/languages/php/attribute_feature.test @@ -0,0 +1,383 @@ +// #[Foo] + +#[] + +#[ + // something ] + Foo, + /* something + else #[] */ + Bar + # shell comments aren't confusing at all in here +] + +#[Foo([0, 1])] + +#[ + Foo( + [ + 1 => [0, 1], + 2 => [2, 3], + 3 => [ + [0, 1], + [2, 3] + ] + ] + ) +] + +#[Foo] +#[Foo\Bar\Baz] +#[Route(Http::POST, '/products/create', 1)] +#[ + Http\Route(Http::POST, '/products/create', 1), + Foo\Bar\Baz, + AttributeFoo('value') +] + +#[A1(1), A1(2), A2(3)] +class Foo { + public function foo(#[A1(5)] $a, #[A1(6)] $b) { } +} + +$object = new #[A1(7)] class () {}; + +function foo( + #[Attribute] $param1, + $param2 +) {} + +$f1 = #[ExampleAttribute] function () {}; + +$ref = new \ReflectionFunction(#[A1] #[A2] function () { }); + +#[DeprecationReason('reason: ')] +function main() {} + +---------------------------------------------------- + +[ + ["comment", "// #[Foo]"], + + "\r\n\r\n#", ["punctuation", "["], ["punctuation", "]"], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["comment", "// something ]"], + ["attribute-class-name", "Foo"], ["punctuation", ","], + ["comment", "/* something\r\n\telse #[] */"], + ["attribute-class-name", "Bar"], + ["comment", "# shell comments aren't confusing at all in here"] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "Foo"], + ["punctuation", "("], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", "]"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "Foo"], + ["punctuation", "("], + + ["punctuation", "["], + + ["number", "1"], + ["operator", "=>"], + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", "]"], + ["punctuation", ","], + + ["number", "2"], + ["operator", "=>"], + ["punctuation", "["], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", "]"], + ["punctuation", ","], + + ["number", "3"], + ["operator", "=>"], + ["punctuation", "["], + + ["punctuation", "["], + ["number", "0"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", "]"], + ["punctuation", ","], + + ["punctuation", "["], + ["number", "2"], + ["punctuation", ","], + ["number", "3"], + ["punctuation", "]"], + + ["punctuation", "]"], + + ["punctuation", "]"], + + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "Foo"] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", [ + "Foo", + ["punctuation", "\\"], + "Bar", + ["punctuation", "\\"], + "Baz" + ]] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "Route"], + ["punctuation", "("], + ["attribute-class-name", "Http"], + ["operator", "::"], + ["constant", "POST"], + ["punctuation", ","], + ["string", "'/products/create'"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", [ + "Http", + ["punctuation", "\\"], + "Route" + ]], + ["punctuation", "("], + ["attribute-class-name", "Http"], + ["operator", "::"], + ["constant", "POST"], + ["punctuation", ","], + ["string", "'/products/create'"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", ","], + + ["attribute-class-name", [ + "Foo", + ["punctuation", "\\"], + "Bar", + ["punctuation", "\\"], + "Baz" + ]], + ["punctuation", ","], + + ["attribute-class-name", "AttributeFoo"], + ["punctuation", "("], + ["string", "'value'"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "A1"], + ["punctuation", "("], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", ","], + ["attribute-class-name", "A1"], + ["punctuation", "("], + ["number", "2"], + ["punctuation", ")"], + ["punctuation", ","], + ["attribute-class-name", "A2"], + ["punctuation", "("], + ["number", "3"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["keyword", "class"], + ["class-name-definition", "Foo"], + ["punctuation", "{"], + + ["keyword", "public"], + ["keyword", "function"], + ["function-definition", "foo"], + ["punctuation", "("], + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "A1"], + ["punctuation", "("], + ["number", "5"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + ["variable", "$a"], + ["punctuation", ","], + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "A1"], + ["punctuation", "("], + ["number", "6"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + ["variable", "$b"], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "}"], + + ["variable", "$object"], + ["operator", "="], + ["keyword", "new"], + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "A1"], + ["punctuation", "("], + ["number", "7"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + ["keyword", "class"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "function"], + ["function-definition", "foo"], + ["punctuation", "("], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "Attribute"] + ]], + ["delimiter", "]"] + ]], + ["variable", "$param1"], + ["punctuation", ","], + + ["variable", "$param2"], + + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["variable", "$f1"], + ["operator", "="], + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "ExampleAttribute"] + ]], + ["delimiter", "]"] + ]], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["variable", "$ref"], + ["operator", "="], + ["keyword", "new"], + ["class-name", [ + ["punctuation", "\\"], + "ReflectionFunction" + ]], + ["punctuation", "("], + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "A1"] + ]], + ["delimiter", "]"] + ]], + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "A2"] + ]], + ["delimiter", "]"] + ]], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["attribute", [ + ["delimiter", "#["], + ["attribute-content", [ + ["attribute-class-name", "DeprecationReason"], + ["punctuation", "("], + ["string", "'reason: '"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["keyword", "function"], + ["function-definition", "main"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for attributes. diff --git a/tests/languages/php/boolean_feature.test b/tests/languages/php/boolean_feature.test index 55c24bc993..66e0d21a7c 100644 --- a/tests/languages/php/boolean_feature.test +++ b/tests/languages/php/boolean_feature.test @@ -1,17 +1,17 @@ -FALSE -false -TRUE -true - ----------------------------------------------------- - -[ - ["boolean", "FALSE"], - ["boolean", "false"], - ["boolean", "TRUE"], - ["boolean", "true"] -] - ----------------------------------------------------- - +FALSE +false +TRUE +true + +---------------------------------------------------- + +[ + ["constant", "FALSE"], + ["constant", "false"], + ["constant", "TRUE"], + ["constant", "true"] +] + +---------------------------------------------------- + Checks for booleans. \ No newline at end of file diff --git a/tests/languages/php/class-name_feature.test b/tests/languages/php/class-name_feature.test new file mode 100644 index 0000000000..bf5319919a --- /dev/null +++ b/tests/languages/php/class-name_feature.test @@ -0,0 +1,235 @@ +public Foo $a; + +Foo::bar(); + +\Foo::bar(); + +\Package\Foo::bar(); + +function f(Foo $variable): Foo {} + +function f(\Foo $variable): \Foo {} + +function f(\Package\Foo $variable): \Package\Foo {} + +function f($variable): ?Foo {} + +function f(Foo|Bar $variable): Foo|Bar {} + +function f(Foo|false $variable): Foo|Bar {} +function f(Foo|null $variable): Foo|Bar {} + +function f(\Package\Foo|\Package\Bar $variable): \Package\Foo|\Package\Bar {} + +class Foo extends Bar implements Baz {} + +class Foo extends \Package\Bar implements App\Baz {} + +---------------------------------------------------- + +[ + ["keyword", "public"], + ["class-name", "Foo"], + ["variable", "$a"], + ["punctuation", ";"], + + ["class-name", "Foo"], + ["operator", "::"], + ["function", ["bar"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", [ + ["punctuation", "\\"], + "Foo" + ]], + ["operator", "::"], + ["function", ["bar"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Foo" + ]], + ["operator", "::"], + ["function", ["bar"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", "Foo"], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", "Foo"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", [ + ["punctuation", "\\"], + "Foo" + ]], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "\\"], + "Foo" + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Foo" + ]], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Foo" + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["operator", "?"], + ["class-name", "Foo"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", "Foo"], + ["operator", "|"], + ["class-name", "Bar"], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", "Foo"], + ["operator", "|"], + ["class-name", "Bar"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", "Foo"], + ["operator", "|"], + ["keyword", "false"], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", "Foo"], + ["operator", "|"], + ["class-name", "Bar"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", "Foo"], + ["operator", "|"], + ["keyword", "null"], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", "Foo"], + ["operator", "|"], + ["class-name", "Bar"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Foo" + ]], + ["operator", "|"], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Bar" + ]], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Foo" + ]], + ["operator", "|"], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Bar" + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name-definition", "Foo"], + ["keyword", "extends"], + ["class-name", "Bar"], + ["keyword", "implements"], + ["class-name", "Baz"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name-definition", "Foo"], + ["keyword", "extends"], + ["class-name", [ + ["punctuation", "\\"], + "Package", + ["punctuation", "\\"], + "Bar" + ]], + ["keyword", "implements"], + ["class-name", [ + "App", + ["punctuation", "\\"], + "Baz" + ]], + ["punctuation", "{"], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for class names. diff --git a/tests/languages/php/comment_feature.test b/tests/languages/php/comment_feature.test index 0db0474557..fcbd3567b0 100644 --- a/tests/languages/php/comment_feature.test +++ b/tests/languages/php/comment_feature.test @@ -1,18 +1,24 @@ // // foobar -/**/ /* foo bar */ /* */ +/**/ +/** doc comment */ +# +# foobar ---------------------------------------------------- [ ["comment", "//"], ["comment", "// foobar"], - ["comment", "/**/"], ["comment", "/* foo\r\nbar */"], - ["comment", "/* */"] + ["comment", "/* */"], + ["comment", "/**/"], + ["comment", "/** doc comment */"], + ["comment", "#"], + ["comment", "# foobar"] ] ---------------------------------------------------- diff --git a/tests/languages/php/constant_feature.test b/tests/languages/php/constant_feature.test index 32ecaf0197..9cde9cb3cf 100644 --- a/tests/languages/php/constant_feature.test +++ b/tests/languages/php/constant_feature.test @@ -5,6 +5,22 @@ AZ PRISM FOOBAR_42 +class Foo{ + const BAR = 1; + const baz = 2; +} + +Foo::BAR; +Foo::baz; + + +switch ($i) { + case NULL: + break; + case X: + break; +} + ---------------------------------------------------- [ @@ -13,7 +29,43 @@ FOOBAR_42 ["constant", "X"], ["constant", "AZ"], ["constant", "PRISM"], - ["constant", "FOOBAR_42"] + ["constant", "FOOBAR_42"], + + ["keyword", "class"], + ["class-name-definition", "Foo"], + ["punctuation", "{"], + ["keyword", "const"], + ["constant", "BAR"], + ["operator", "="], + ["number", "1"], + ["punctuation", ";"], + ["keyword", "const"], + ["constant", "baz"], + ["operator", "="], + ["number", "2"], + ["punctuation", ";"], + ["punctuation", "}"], + + ["class-name", "Foo"], ["operator", "::"], ["constant", "BAR"], ["punctuation", ";"], + ["class-name", "Foo"], ["operator", "::"], ["constant", "baz"], ["punctuation", ";"], + + ["keyword", "switch"], + ["punctuation", "("], + ["variable", "$i"], + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "case"], + ["constant", "NULL"], + ["punctuation", ":"], + ["keyword", "break"], + ["punctuation", ";"], + ["keyword", "case"], + ["constant", "X"], + ["punctuation", ":"], + ["keyword", "break"], + ["punctuation", ";"], + ["punctuation", "}"] + ] ---------------------------------------------------- diff --git a/tests/languages/php/delimiter_feature.test b/tests/languages/php/delimiter_feature.test index f7bd684679..506214ded5 100644 --- a/tests/languages/php/delimiter_feature.test +++ b/tests/languages/php/delimiter_feature.test @@ -2,6 +2,12 @@ +')] +function main() {} +// php is not ended yet +?> + ---------------------------------------------------- [ @@ -16,6 +22,32 @@ ["php", [ ["delimiter", ""] + ]], + + ["php", [ + ["delimiter", "'"], + ["punctuation", ")"] + ]], + ["delimiter", "]"] + ]], + + ["keyword", "function"], + ["function-definition", "main"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["comment", "// php is not ended yet"], + ["delimiter", "?>"] ]] ] diff --git a/tests/languages/php/enum_feature.test b/tests/languages/php/enum_feature.test new file mode 100644 index 0000000000..4d84e32f03 --- /dev/null +++ b/tests/languages/php/enum_feature.test @@ -0,0 +1,52 @@ +enum Foo implements Bar {} + +enum Suit { + case Hearts; + case Diamonds = 'D'; +} + +$val = Suit::Diamonds; + +Suit::Spades->name; + +---------------------------------------------------- + +[ + ["keyword", "enum"], + ["class-name-definition", "Foo"], + ["keyword", "implements"], + ["class-name", "Bar"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "enum"], + ["class-name-definition", "Suit"], + ["punctuation", "{"], + ["keyword", "case"], + ["constant", "Hearts"], + ["punctuation", ";"], + ["keyword", "case"], + ["constant", "Diamonds"], + ["operator", "="], + ["string", "'D'"], + ["punctuation", ";"], + ["punctuation", "}"], + + ["variable", "$val"], + ["operator", "="], + ["class-name", "Suit"], + ["operator", "::"], + ["constant", "Diamonds"], + ["punctuation", ";"], + + ["class-name", "Suit"], + ["operator", "::"], + ["constant", "Spades"], + ["operator", "->"], + ["property", "name"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for enums. diff --git a/tests/languages/php/function_feature.test b/tests/languages/php/function_feature.test new file mode 100644 index 0000000000..290a76afb6 --- /dev/null +++ b/tests/languages/php/function_feature.test @@ -0,0 +1,170 @@ +class A { + function __call() {} +} + +$a = new A(); +$a->if(); // it's allowed to call a magic method with keyword since forever in PHP + +class A { + function if() {} // error before 7.0, allowed now +} + +$variable->foreach(); // this "foreach" is a method +$variable->method(); // this is also a method +$var->match() + +foreach ($list as $value) { // this "foreach" is a keyword +} + +Test::foreach(); // this is "foreach" static method +Test::method(); // this is "method" static method + +// The only exception: class +$variable->class(); // this "class" should be interpreted as "keyword" +Test::class; // This "class" should still be a keyword + +mb_string(); // call to a global function +\mb_string(); // namespace \ is global +\a\b\c\mb_string(); // function in \a\b\c namespace + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name-definition", "A"], + ["punctuation", "{"], + + ["keyword", "function"], + ["function-definition", "__call"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "}"], + + ["variable", "$a"], + ["operator", "="], + ["keyword", "new"], + ["class-name", "A"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["variable", "$a"], + ["operator", "->"], + ["function", ["if"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// it's allowed to call a magic method with keyword since forever in PHP"], + + ["keyword", "class"], + ["class-name-definition", "A"], + ["punctuation", "{"], + + ["keyword", "function"], + ["function-definition", "if"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["comment", "// error before 7.0, allowed now"], + + ["punctuation", "}"], + + ["variable", "$variable"], + ["operator", "->"], + ["function", ["foreach"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// this \"foreach\" is a method"], + + ["variable", "$variable"], + ["operator", "->"], + ["function", ["method"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// this is also a method"], + + ["variable", "$var"], + ["operator", "->"], + ["function", ["match"]], + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "foreach"], + ["punctuation", "("], + ["variable", "$list"], + ["keyword", "as"], + ["variable", "$value"], + ["punctuation", ")"], + ["punctuation", "{"], + ["comment", "// this \"foreach\" is a keyword"], + + ["punctuation", "}"], + + ["class-name", "Test"], + ["operator", "::"], + ["function", ["foreach"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// this is \"foreach\" static method"], + + ["class-name", "Test"], + ["operator", "::"], + ["function", ["method"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// this is \"method\" static method"], + + ["comment", "// The only exception: class"], + + ["variable", "$variable"], + ["operator", "->"], + ["keyword", "class"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// this \"class\" should be interpreted as \"keyword\""], + + ["class-name", "Test"], + ["operator", "::"], + ["keyword", "class"], + ["punctuation", ";"], + ["comment", "// This \"class\" should still be a keyword"], + + ["function", ["mb_string"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// call to a global function"], + + ["function", [ + ["punctuation", "\\"], + "mb_string" + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// namespace \\ is global"], + + ["function", [ + ["punctuation", "\\"], + "a", + ["punctuation", "\\"], + "b", + ["punctuation", "\\"], + "c", + ["punctuation", "\\"], + "mb_string" + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "// function in \\a\\b\\c namespace"] +] diff --git a/tests/languages/php/issue2156.test b/tests/languages/php/issue2156.test index 4223d81829..f71e8458d1 100644 --- a/tests/languages/php/issue2156.test +++ b/tests/languages/php/issue2156.test @@ -117,7 +117,7 @@ ---------------------------------------------------- [ - ["prolog", "\",\"\",str_replace(\"'\",\"\",str_replace(\"[\",\"\",str_replace(\"]\",\"\",$_POST['txtCode'])))));\n\t}\n\tif (isset($_SESSION['CAPTCHA_RndText'])) {\n\t$CAPTCHA_RandomText = $_SESSION['CAPTCHA_RndText'];\n\t}\n\n\t// Eingabefelder abfragen\n\t$_SESSION['company'] = $_POST['company'];\n\t$_SESSION['name'] = $_POST['name'];\n\t$_SESSION['address'] = $_POST['address'];\n\t$_SESSION['zip_code'] = $_POST['zip_code'];\n\t$_SESSION['city'] = $_POST['city'];\n\t$_SESSION['county'] = $_POST['county'];\n\t$_SESSION['country'] = $_POST['country'];\n\t$_SESSION['phone'] = $_POST['phone'];\n\t$_SESSION['fax'] = $_POST['fax'];\n\t$_SESSION['email'] = $_POST['email'];\n\t$_SESSION['nachricht'] = $_POST['nachricht'];\n\n\t$email_i = $_SESSION['email'];\n\n\t// Email Funktion\n\tfunction pruefe_mail($email_i) {\n\t\t if(strstr($email_i, \"@\")) {\n\t\t\t$email_i = explode (\"@\", $email_i);\n\t\t\tif(strstr($email_i[1], \".\")) $ok = TRUE;\n\t\t }\n\t\t return $ok;\n\t\t}\n\n\t// Eingaben prüfen\n\t$fehler = \"\";\n\tif(!pruefe_mail($email_i) && !empty($email_i)) {\n\t\t\t$fehler .= \"
  • email
  • \";\n\t\t\t}\n\t\t\tif ($_SESSION['name'] == \"\"){\n\t\t\t$fehler .= \"
  • name
  • \";\n\t\t\t}\n\t\t\tif ($_SESSION['city'] == \"\"){\n\t\t\t$fehler .= \"
  • city
  • \";\n\t\t\t}\n\t\t\tif ($_SESSION['country'] == \"\"){\n\t\t\t$fehler .= \"
  • country
  • \";\n\t\t\t}\n\t\t\tif ($_SESSION['phone'] == \"\"){\n\t\t\t$fehler .= \"
  • phone
  • \";\n\t\t\t}\n\t\t\tif ($_SESSION['email'] == \"\"){\n\t\t\t$fehler .= \"
  • email
  • \";\n\t\t\t}\n\t\t\tif ($_SESSION['message'] == \"\"){\n\t\t\t$fehler .= \"
  • message
  • \";\n\t\t\t}\n\t\t\tif ($CAPTCHA_EnteredText == $CAPTCHA_RandomText and isset($_POST['txtCode']) == true and isset($_SESSION['CAPTCHA_RndText'])){\n\t\t\t$captcha = true;\n\t\t\t} else {\n\t\t\t$fehler .= \"
  • code
  • \";\n\t\t\t}\n\techo '
    ';\n\tif ($fehler == \"\"){\n\t// Email zumsammensetzen\n\t$email = \"From: \" . $_SESSION['email'];\n\n\n\t$nachrichtfertig =\n\t\"Company: \" . $_SESSION['company'] \"n\\\"\n\t\"Name: \" $_SESSION['name'] \"n\\\"\n\t\"Address: \" $_SESSION['address'] \"n\\\"\n\t\"ZIP Code: \" $_SESSION['zip_code'] \"n\\\"\n\t\"City: \" $_SESSION['city'] \"n\\\"\n\t\"County: \" $_SESSION['county'] \"n\\\"\n\t\"Country: \" $_SESSION['country'] \"n\\\"\n\t\"Phone: \" $_SESSION['phone'] \"n\\\"\n\t\"Fax: \" $_SESSION['fax'] \"n\\\"\n\t\"eMail: \" $_SESSION['email'] \"n\\n\\\"\n\t\"Message: \" $_SESSION['message'];\n\n\n\t$versand = mail($empfaenger, $betreff, $nachrichtfertig, $email);\n\t\t\tif ($versand) {\n\t\t\techo '

    Thank you very much!

    \n\t\t\t\t

    The message were send successfully

    ';\n\n\t\t\t// Sessionvariablen löschen\n\t\t\tunset($_SESSION['company']);\n\t\t\tunset($_SESSION['name']);\n\t\t\tunset($_SESSION['address']);\n\t\t\tunset($_SESSION['zip_code']);\n\t\t\tunset($_SESSION['city']);\n\t\t\tunset($_SESSION['county']);\n\t\t\tunset($_SESSION['country']);\n\t\t\tunset($_SESSION['phone']);\n\t\t\tunset($_SESSION['fax']);\n\t\t\tunset($_SESSION['email']);\n\t\t\tunset($_SESSION['nachricht']);\n\t\t\t}\n\n\t} else {\n\techo '

    Error

    ';\n\techo '

    Please fill in all the $fehler field. back

    ';\n\t}\n\techo '
    ';\n\n\t// Session unset\n\tunset($_SESSION['CAPTCHA_RndText']);\n\n?>"] + ["prolog", "\",\"\",str_replace(\"'\",\"\",str_replace(\"[\",\"\",str_replace(\"]\",\"\",$_POST['txtCode'])))));\r\n\t}\r\n\tif (isset($_SESSION['CAPTCHA_RndText'])) {\r\n\t$CAPTCHA_RandomText = $_SESSION['CAPTCHA_RndText'];\r\n\t}\r\n\r\n\t// Eingabefelder abfragen\r\n\t$_SESSION['company'] = $_POST['company'];\r\n\t$_SESSION['name'] = $_POST['name'];\r\n\t$_SESSION['address'] = $_POST['address'];\r\n\t$_SESSION['zip_code'] = $_POST['zip_code'];\r\n\t$_SESSION['city'] = $_POST['city'];\r\n\t$_SESSION['county'] = $_POST['county'];\r\n\t$_SESSION['country'] = $_POST['country'];\r\n\t$_SESSION['phone'] = $_POST['phone'];\r\n\t$_SESSION['fax'] = $_POST['fax'];\r\n\t$_SESSION['email'] = $_POST['email'];\r\n\t$_SESSION['nachricht'] = $_POST['nachricht'];\r\n\r\n\t$email_i = $_SESSION['email'];\r\n\r\n\t// Email Funktion\r\n\tfunction pruefe_mail($email_i) {\r\n\t\t if(strstr($email_i, \"@\")) {\r\n\t\t\t$email_i = explode (\"@\", $email_i);\r\n\t\t\tif(strstr($email_i[1], \".\")) $ok = TRUE;\r\n\t\t }\r\n\t\t return $ok;\r\n\t\t}\r\n\r\n\t// Eingaben prüfen\r\n\t$fehler = \"\";\r\n\tif(!pruefe_mail($email_i) && !empty($email_i)) {\r\n\t\t\t$fehler .= \"
  • email
  • \";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['name'] == \"\"){\r\n\t\t\t$fehler .= \"
  • name
  • \";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['city'] == \"\"){\r\n\t\t\t$fehler .= \"
  • city
  • \";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['country'] == \"\"){\r\n\t\t\t$fehler .= \"
  • country
  • \";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['phone'] == \"\"){\r\n\t\t\t$fehler .= \"
  • phone
  • \";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['email'] == \"\"){\r\n\t\t\t$fehler .= \"
  • email
  • \";\r\n\t\t\t}\r\n\t\t\tif ($_SESSION['message'] == \"\"){\r\n\t\t\t$fehler .= \"
  • message
  • \";\r\n\t\t\t}\r\n\t\t\tif ($CAPTCHA_EnteredText == $CAPTCHA_RandomText and isset($_POST['txtCode']) == true and isset($_SESSION['CAPTCHA_RndText'])){\r\n\t\t\t$captcha = true;\r\n\t\t\t} else {\r\n\t\t\t$fehler .= \"
  • code
  • \";\r\n\t\t\t}\r\n\techo '
    ';\r\n\tif ($fehler == \"\"){\r\n\t// Email zumsammensetzen\r\n\t$email = \"From: \" . $_SESSION['email'];\r\n\r\n\r\n\t$nachrichtfertig =\r\n\t\"Company: \" . $_SESSION['company'] \"n\\\"\r\n\t\"Name: \" $_SESSION['name'] \"n\\\"\r\n\t\"Address: \" $_SESSION['address'] \"n\\\"\r\n\t\"ZIP Code: \" $_SESSION['zip_code'] \"n\\\"\r\n\t\"City: \" $_SESSION['city'] \"n\\\"\r\n\t\"County: \" $_SESSION['county'] \"n\\\"\r\n\t\"Country: \" $_SESSION['country'] \"n\\\"\r\n\t\"Phone: \" $_SESSION['phone'] \"n\\\"\r\n\t\"Fax: \" $_SESSION['fax'] \"n\\\"\r\n\t\"eMail: \" $_SESSION['email'] \"n\\n\\\"\r\n\t\"Message: \" $_SESSION['message'];\r\n\r\n\r\n\t$versand = mail($empfaenger, $betreff, $nachrichtfertig, $email);\r\n\t\t\tif ($versand) {\r\n\t\t\techo '

    Thank you very much!

    \r\n\t\t\t\t

    The message were send successfully

    ';\r\n\r\n\t\t\t// Sessionvariablen löschen\r\n\t\t\tunset($_SESSION['company']);\r\n\t\t\tunset($_SESSION['name']);\r\n\t\t\tunset($_SESSION['address']);\r\n\t\t\tunset($_SESSION['zip_code']);\r\n\t\t\tunset($_SESSION['city']);\r\n\t\t\tunset($_SESSION['county']);\r\n\t\t\tunset($_SESSION['country']);\r\n\t\t\tunset($_SESSION['phone']);\r\n\t\t\tunset($_SESSION['fax']);\r\n\t\t\tunset($_SESSION['email']);\r\n\t\t\tunset($_SESSION['nachricht']);\r\n\t\t\t}\r\n\r\n\t} else {\r\n\techo '

    Error

    ';\r\n\techo '

    Please fill in all the $fehler field. back

    ';\r\n\t}\r\n\techo '
    ';\r\n\r\n\t// Session unset\r\n\tunset($_SESSION['CAPTCHA_RndText']);\r\n\r\n?>"] ] ---------------------------------------------------- diff --git a/tests/languages/php/issue2614.test b/tests/languages/php/issue2614.test new file mode 100644 index 0000000000..56f4875c10 --- /dev/null +++ b/tests/languages/php/issue2614.test @@ -0,0 +1,21 @@ +class First {} +class Second {} + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name-definition", "First"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name-definition", "Second"], + ["punctuation", "{"], + ["punctuation", "}"] +] + + +---------------------------------------------------- + +Checks for issue #2614. \ No newline at end of file diff --git a/tests/languages/php/keyword_feature.test b/tests/languages/php/keyword_feature.test index d40a24456e..b7febd3576 100644 --- a/tests/languages/php/keyword_feature.test +++ b/tests/languages/php/keyword_feature.test @@ -1,7 +1,7 @@ __halt_compiler abstract and -array +array() as break callable @@ -30,6 +30,7 @@ exit extends; final finally +fn for foreach function @@ -45,9 +46,11 @@ interface; isset list namespace; +match new; or parent +parent::; print private protected @@ -55,7 +58,11 @@ public require require_once return +self +new self +self::; static +static::; switch throw trait; @@ -66,6 +73,7 @@ var while xor yield +yield from ---------------------------------------------------- @@ -73,7 +81,7 @@ yield ["keyword", "__halt_compiler"], ["keyword", "abstract"], ["keyword", "and"], - ["keyword", "array"], + ["keyword", "array"], ["punctuation", "("], ["punctuation", ")"], ["keyword", "as"], ["keyword", "break"], ["keyword", "callable"], @@ -102,6 +110,7 @@ yield ["keyword", "extends"], ["punctuation", ";"], ["keyword", "final"], ["keyword", "finally"], + ["keyword", "fn"], ["keyword", "for"], ["keyword", "foreach"], ["keyword", "function"], @@ -117,9 +126,11 @@ yield ["keyword", "isset"], ["keyword", "list"], ["keyword", "namespace"], ["punctuation", ";"], + ["keyword", "match"], ["keyword", "new"], ["punctuation", ";"], ["keyword", "or"], ["keyword", "parent"], + ["keyword", "parent"], ["operator", "::"], ["punctuation", ";"], ["keyword", "print"], ["keyword", "private"], ["keyword", "protected"], @@ -127,19 +138,24 @@ yield ["keyword", "require"], ["keyword", "require_once"], ["keyword", "return"], + ["keyword", "self"], + ["keyword", "new"], ["keyword", "self"], + ["keyword", "self"], ["operator", "::"], ["punctuation", ";"], ["keyword", "static"], + ["keyword", "static"], ["operator", "::"], ["punctuation", ";"], ["keyword", "switch"], ["keyword", "throw"], - ["keyword", "trait"], ["punctuation", ";"], + ["keyword", "trait"], ["punctuation", ";"], ["keyword", "try"], ["keyword", "unset"], ["keyword", "use"], ["punctuation", ";"], ["keyword", "var"], ["keyword", "while"], ["keyword", "xor"], - ["keyword", "yield"] + ["keyword", "yield"], + ["keyword", "yield"], ["keyword", "from"] ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/php/number_feature.test b/tests/languages/php/number_feature.test new file mode 100644 index 0000000000..8333572ae8 --- /dev/null +++ b/tests/languages/php/number_feature.test @@ -0,0 +1,41 @@ +664.6 +107_925_284.88_4 +1e7 +1.2e3 +1E-7 +0b10100111001 +0x539 +0x1A +0123 +0o123 +0O123 +0b1111_0000_111 +0o1111_0000_123 +0O1111_0000_123 +01111_0000_123 +0xAAAA_FFF_0123 + +---------------------------------------------------- + +[ + ["number", "664.6"], + ["number", "107_925_284.88_4"], + ["number", "1e7"], + ["number", "1.2e3"], + ["number", "1E-7"], + ["number", "0b10100111001"], + ["number", "0x539"], + ["number", "0x1A"], + ["number", "0123"], + ["number", "0o123"], + ["number", "0O123"], + ["number", "0b1111_0000_111"], + ["number", "0o1111_0000_123"], + ["number", "0O1111_0000_123"], + ["number", "01111_0000_123"], + ["number", "0xAAAA_FFF_0123"] +] + +---------------------------------------------------- + +Checks for numbers. diff --git a/tests/languages/php/operators_feature.test b/tests/languages/php/operators_feature.test new file mode 100644 index 0000000000..58bb1f5af2 --- /dev/null +++ b/tests/languages/php/operators_feature.test @@ -0,0 +1,97 @@ +=> +<=> +?? +??= +-> +?-> +:: +... +/ +/= +^ +^= +| +|| +|= +% +%= +* +*= +** +**= +& +&& +&= +< +<= +> +>= +. +.= ++ +++ ++= +- +-- +>> +<< +-= +? +~ +== +!= +=== +!== + +---------------------------------------------------- + +[ + ["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", "==="], + ["operator", "!=="] +] + +---------------------------------------------------- + +Checks for operators. \ No newline at end of file diff --git a/tests/languages/php/package_feature.test b/tests/languages/php/package_feature.test index e1d3e5f25c..297f3a022e 100644 --- a/tests/languages/php/package_feature.test +++ b/tests/languages/php/package_feature.test @@ -1,11 +1,16 @@ +namespace App namespace \foo namespace \foo\bar\baz use \foo use \foo\bar\baz +use function \foo +use function \foo\bar\baz ---------------------------------------------------- [ + ["keyword", "namespace"], + ["package", ["App"]], ["keyword", "namespace"], ["package", [["punctuation", "\\"], "foo"]], ["keyword", "namespace"], @@ -17,6 +22,16 @@ use \foo\bar\baz ["keyword", "use"], ["package", [["punctuation", "\\"], "foo"]], ["keyword", "use"], + ["package", [ + ["punctuation", "\\"], "foo", + ["punctuation", "\\"], "bar", + ["punctuation", "\\"], "baz" + ]], + ["keyword", "use"], + ["keyword", "function"], + ["package", [["punctuation", "\\"], "foo"]], + ["keyword", "use"], + ["keyword", "function"], ["package", [ ["punctuation", "\\"], "foo", ["punctuation", "\\"], "bar", diff --git a/tests/languages/php/property_feature.test b/tests/languages/php/property_feature.test index f7790197a5..031529cb95 100644 --- a/tests/languages/php/property_feature.test +++ b/tests/languages/php/property_feature.test @@ -1,17 +1,19 @@ -$variable->property -$foo->bar->baz +$variable->property; +$foo->bar->baz; ---------------------------------------------------- [ ["variable", "$variable"], - ["operator", "-"], ["operator", ">"], + ["operator", "->"], ["property", "property"], + ["punctuation", ";"], ["variable", "$foo"], - ["operator", "-"], ["operator", ">"], + ["operator", "->"], ["property", "bar"], - ["operator", "-"], ["operator", ">"], - ["property", "baz"] + ["operator", "->"], + ["property", "baz"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/clojure/operator_and_punctuation.test b/tests/languages/php/punctuation_feature.test similarity index 51% rename from tests/languages/clojure/operator_and_punctuation.test rename to tests/languages/php/punctuation_feature.test index e90acb631d..5bedfca843 100644 --- a/tests/languages/clojure/operator_and_punctuation.test +++ b/tests/languages/php/punctuation_feature.test @@ -1,20 +1,27 @@ -(::example [x y] (:kebab-case x y)) - ----------------------------------------------------- - -[ - ["punctuation", "("], - ["operator", "::example"], - ["punctuation", "["], - "x y", - ["punctuation", "]"], - ["punctuation", "("], - ["operator", ":kebab-case"], - " x y", - ["punctuation", ")"], - ["punctuation", ")"] -] - ----------------------------------------------------- - -Checks for operators and punctuation. \ No newline at end of file +{ +} +[ +] +( +) +, +: +; + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for punctuation. \ No newline at end of file diff --git a/tests/languages/php/string-interpolation_feature.test b/tests/languages/php/string-interpolation_feature.test index b0d57f894c..d870eb496d 100644 --- a/tests/languages/php/string-interpolation_feature.test +++ b/tests/languages/php/string-interpolation_feature.test @@ -14,127 +14,243 @@ FOO; {${$name}}, but not {\${\$name}} FOO_BAR; +$value = "$this->property->property"; +$value = "$foo[0][1]"; + ---------------------------------------------------- [ - ["double-quoted-string", [ + ["string", [ "\"This ", - ["interpolation", [["variable", "$variable"]]], + ["interpolation", [ + ["variable", "$variable"] + ]], " is interpolated\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"", - ["interpolation", [["variable", "$foo"], ["punctuation", "["], ["number", "2"], ["punctuation", "]"]]], + ["interpolation", [ + ["variable", "$foo"], + ["punctuation", "["], + ["number", "2"], + ["punctuation", "]"] + ]], ", ", - ["interpolation", [["variable", "$bar"], ["punctuation", "["], ["operator", "-"], ["number", "4"], ["punctuation", "]"]]], + ["interpolation", [ + ["variable", "$bar"], + ["punctuation", "["], + ["operator", "-"], + ["number", "4"], + ["punctuation", "]"] + ]], ", ", - ["interpolation", [["variable", "$foo"], ["punctuation", "["], ["variable", "$bar"], ["punctuation", "]"]]], + ["interpolation", [ + ["variable", "$foo"], + ["punctuation", "["], + ["variable", "$bar"], + ["punctuation", "]"] + ]], "\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"", - ["interpolation", [["variable", "$foo"], ["operator", "-"], ["operator", ">"], ["property", "bar"]]], + ["interpolation", [ + ["variable", "$foo"], + ["operator", "->"], + ["property", "bar"] + ]], "\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"More ", - ["interpolation", [["punctuation", "{"], ["variable", "$interpolation"], ["punctuation", "}"]]], + ["interpolation", [ + ["punctuation", "{"], + ["variable", "$interpolation"], + ["punctuation", "}"] + ]], "\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"", ["interpolation", [ ["punctuation", "{"], - ["variable", "$arr"], ["punctuation", "["], ["single-quoted-string", "'key'"], ["punctuation", "]"], + ["variable", "$arr"], + ["punctuation", "["], + ["string", "'key'"], + ["punctuation", "]"], ["punctuation", "}"] ]], ", ", ["interpolation", [ ["punctuation", "{"], ["variable", "$arr"], - ["punctuation", "["], ["single-quoted-string", "'foo'"], ["punctuation", "]"], - ["punctuation", "["], ["number", "3"], ["punctuation", "]"], + ["punctuation", "["], + ["string", "'foo'"], + ["punctuation", "]"], + ["punctuation", "["], + ["number", "3"], + ["punctuation", "]"], ["punctuation", "}"] ]], "\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"", ["interpolation", [ - ["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], + ["punctuation", "{"], + ["variable", "$"], + ["punctuation", "{"], ["variable", "$name"], - ["punctuation", "}"], ["punctuation", "}"] + ["punctuation", "}"], + ["punctuation", "}"] ]], ", but not {\\${\\$name}}\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"the return value of getName(): ", ["interpolation", [ - ["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], - ["function", "getName"], ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "}"], ["punctuation", "}"] + ["punctuation", "{"], + ["variable", "$"], + ["punctuation", "{"], + ["function", ["getName"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", "}"] ]], "\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"the return value of \\$object->getName(): ", ["interpolation", [ - ["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], - ["variable", "$object"], ["operator", "-"], ["operator", ">"], ["function", "getName"], ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "}"], ["punctuation", "}"] + ["punctuation", "{"], + ["variable", "$"], + ["punctuation", "{"], + ["variable", "$object"], + ["operator", "->"], + ["function", ["getName"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", "}"] ]], "\"" ]], - ["double-quoted-string", [ + + ["string", [ "\"", ["interpolation", [ ["punctuation", "{"], - ["variable", "$foo"], ["operator", "-"], ["operator", ">"], ["variable", "$bar"], + ["variable", "$foo"], + ["operator", "->"], + ["variable", "$bar"], ["punctuation", "}"] ]], ", ", ["interpolation", [ ["punctuation", "{"], - ["variable", "$foo"], ["operator", "-"], ["operator", ">"], ["punctuation", "{"], - ["variable", "$baz"], ["punctuation", "["], ["number", "1"], ["punctuation", "]"], + ["variable", "$foo"], + ["operator", "->"], + ["punctuation", "{"], + ["variable", "$baz"], + ["punctuation", "["], + ["number", "1"], + ["punctuation", "]"], ["punctuation", "}"], ["punctuation", "}"] ]], "\"" ]], - ["heredoc-string", [ + + ["string", [ ["delimiter", [ - ["punctuation", "<<<"], "FOO" + ["punctuation", "<<<"], + "FOO" ]], + "\r\nHeredoc strings ", ["interpolation", [ - ["variable", "$also"], ["operator", "-"], ["operator", ">"], ["property", "support"] + ["variable", "$also"], + ["operator", "->"], + ["property", "support"] ]], ["interpolation", [ - ["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], - ["variable", "$string"], ["operator", "-"], ["operator", ">"], ["function", "interpolation"], ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "}"], ["punctuation", "}"] + ["punctuation", "{"], + ["variable", "$"], + ["punctuation", "{"], + ["variable", "$string"], + ["operator", "->"], + ["function", ["interpolation"]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "}"], + ["punctuation", "}"] ]], + ["delimiter", [ - "FOO", ["punctuation", ";"] + "FOO", + ["punctuation", ";"] ]] ]], - ["heredoc-string", [ + + ["string", [ ["delimiter", [ - ["punctuation", "<<<\""], "FOO_BAR", ["punctuation", "\""] + ["punctuation", "<<<\""], + "FOO_BAR", + ["punctuation", "\""] ]], + ["interpolation", [ - ["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], + ["punctuation", "{"], + ["variable", "$"], + ["punctuation", "{"], ["variable", "$name"], - ["punctuation", "}"], ["punctuation", "}"] + ["punctuation", "}"], + ["punctuation", "}"] ]], ", but not {\\${\\$name}}\r\n", + ["delimiter", [ - "FOO_BAR", ["punctuation", ";"] + "FOO_BAR", + ["punctuation", ";"] ]] - ]] + ]], + + ["variable", "$value"], + ["operator", "="], + ["string", [ + "\"", + ["interpolation", [ + ["variable", "$this"], + ["operator", "->"], + ["property", "property"] + ]], + "->property\"" + ]], + ["punctuation", ";"], + + ["variable", "$value"], + ["operator", "="], + ["string", [ + "\"", + ["interpolation", [ + ["variable", "$foo"], + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"] + ]], + "[1]\"" + ]], + ["punctuation", ";"] ] ---------------------------------------------------- -Checks for interpolation inside strings. \ No newline at end of file +Checks for interpolation inside strings. diff --git a/tests/languages/php/string_feature.test b/tests/languages/php/string_feature.test index cac7a947cc..5e5942af9e 100644 --- a/tests/languages/php/string_feature.test +++ b/tests/languages/php/string_feature.test @@ -14,11 +14,13 @@ NOWDOC; string" 'multi-line string' +`multi-line +shell exec string` ---------------------------------------------------- [ - ["heredoc-string", [ + ["string", [ ["delimiter", [ ["punctuation", "<<<"], "FOO_BAR" ]], @@ -27,7 +29,7 @@ string' "FOO_BAR", ["punctuation", ";"] ]] ]], - ["heredoc-string", [ + ["string", [ ["delimiter", [ ["punctuation", "<<<\""], "FOO", ["punctuation", "\""] ]], @@ -36,7 +38,7 @@ string' "FOO", ["punctuation", ";"] ]] ]], - ["nowdoc-string", [ + ["string", [ ["delimiter", [ ["punctuation", "<<<'"], "NOWDOC", ["punctuation", "'"] ]], @@ -45,10 +47,11 @@ string' "NOWDOC", ["punctuation", ";"] ]] ]], - ["double-quoted-string", ["\"https://example.com\""]], - ["double-quoted-string", ["\" /* not a comment */ \""]], - ["double-quoted-string", ["\"multi-line\r\nstring\""]], - ["single-quoted-string", "'multi-line\r\nstring'"] + ["string", ["\"https://example.com\""]], + ["string", ["\" /* not a comment */ \""]], + ["string", ["\"multi-line\r\nstring\""]], + ["string", "'multi-line\r\nstring'"], + ["string", "`multi-line\r\nshell exec string`"] ] ---------------------------------------------------- diff --git a/tests/languages/php/type_feature.test b/tests/languages/php/type_feature.test new file mode 100644 index 0000000000..eab7dc1ad3 --- /dev/null +++ b/tests/languages/php/type_feature.test @@ -0,0 +1,236 @@ +public bool $a; +public int $a; +public float $a; +public string $a; +public object $a; +public array $a; +public mixed $a; +public int|null $a; +public int|false $a; +public false | int $a; + +(int) $a; +(string) $a; +(object) $a; +(array) $a; +(boolean) $a; +(integer) $a; + +function f(): int {} +function f() :string {} +function f() : object {} +function f(): ?array {} +function f(): self {} +function f(): static {} +function f(): int|null {} +function f(): int|false {} + +function foo(int $a, string $b, ? object $c, ?array $d, self $e, static $f, int|null $g) {} + +---------------------------------------------------- + +[ + ["keyword", "public"], + ["keyword", "bool"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "int"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "float"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "string"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "object"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "array"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "mixed"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "int"], + ["operator", "|"], + ["keyword", "null"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "int"], + ["operator", "|"], + ["keyword", "false"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "public"], + ["keyword", "false"], + ["operator", "|"], + ["keyword", "int"], + ["variable", "$a"], + ["punctuation", ";"], + + ["punctuation", "("], + ["keyword", "int"], + ["punctuation", ")"], + ["variable", "$a"], + ["punctuation", ";"], + + ["punctuation", "("], + ["keyword", "string"], + ["punctuation", ")"], + ["variable", "$a"], + ["punctuation", ";"], + + ["punctuation", "("], + ["keyword", "object"], + ["punctuation", ")"], + ["variable", "$a"], + ["punctuation", ";"], + + ["punctuation", "("], + ["keyword", "array"], + ["punctuation", ")"], + ["variable", "$a"], + ["punctuation", ";"], + + ["punctuation", "("], + ["keyword", "boolean"], + ["punctuation", ")"], + ["variable", "$a"], + ["punctuation", ";"], + + ["punctuation", "("], + ["keyword", "integer"], + ["punctuation", ")"], + ["variable", "$a"], + ["punctuation", ";"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "int"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "string"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "object"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["operator", "?"], + ["keyword", "array"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "self"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "static"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "int"], + ["operator", "|"], + ["keyword", "null"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "f"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "int"], + ["operator", "|"], + ["keyword", "false"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["function-definition", "foo"], + ["punctuation", "("], + ["keyword", "int"], + ["variable", "$a"], + ["punctuation", ","], + ["keyword", "string"], + ["variable", "$b"], + ["punctuation", ","], + ["operator", "?"], + ["keyword", "object"], + ["variable", "$c"], + ["punctuation", ","], + ["operator", "?"], + ["keyword", "array"], + ["variable", "$d"], + ["punctuation", ","], + ["keyword", "self"], + ["variable", "$e"], + ["punctuation", ","], + ["keyword", "static"], + ["variable", "$f"], + ["punctuation", ","], + ["keyword", "int"], + ["operator", "|"], + ["keyword", "null"], + ["variable", "$g"], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for types. diff --git a/tests/languages/phpdoc/class-name_feature.test b/tests/languages/phpdoc/class-name_feature.test index b55784be3a..b0a5880687 100644 --- a/tests/languages/phpdoc/class-name_feature.test +++ b/tests/languages/phpdoc/class-name_feature.test @@ -5,10 +5,30 @@ * @throws \foo\MyException if something bad happens */ +/** + * @param callback $parameter + * @param resource $parameter + * @param boolean $parameter + * @param integer $parameter + * @param double $parameter + * @param object $parameter + * @param string $parameter + * @param array $parameter + * @param false $parameter + * @param float $parameter + * @param mixed $parameter + * @param bool $parameter + * @param null $parameter + * @param self $parameter + * @param true $parameter + * @param void $parameter + * @param int $parameter + */ + ---------------------------------------------------- [ - "/**\n * ", + "/**\r\n * ", ["keyword", "@param"], ["class-name", [ ["keyword", "string"], @@ -16,12 +36,13 @@ ["keyword", "null"] ]], ["parameter", "$parameter"], - " a parameter\n * ", + " a parameter\r\n * ", ["keyword", "@return"], ["class-name", [ ["keyword", "self"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@var"], ["class-name", [ "MyClass", @@ -29,7 +50,8 @@ ["keyword", "int"], ["punctuation", "]"] ]], - "\n * ", + + "\r\n * ", ["keyword", "@throws"], ["class-name", [ ["punctuation", "\\"], @@ -37,7 +59,126 @@ ["punctuation", "\\"], "MyException" ]], - " if something bad happens\n */" + " if something bad happens\r\n */\r\n\r\n/**\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "callback"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "resource"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "boolean"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "integer"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "double"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "object"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "string"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "array"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "false"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "float"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "mixed"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "bool"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "null"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "self"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "true"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "void"] + ]], + ["parameter", "$parameter"], + + "\r\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "int"] + ]], + ["parameter", "$parameter"], + + "\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/phpdoc/keyword_feature.test b/tests/languages/phpdoc/keyword_feature.test index 2681efd1e2..482b99f4bb 100644 --- a/tests/languages/phpdoc/keyword_feature.test +++ b/tests/languages/phpdoc/keyword_feature.test @@ -33,65 +33,36 @@ ---------------------------------------------------- [ - "/**\n * ", - ["keyword", "@api"], - "\n * ", - ["keyword", "@author"], - "\n * ", - ["keyword", "@category"], - "\n * ", - ["keyword", "@copyright"], - "\n * ", - ["keyword", "@deprecated"], - "\n * ", - ["keyword", "@example"], - "\n * ", - ["keyword", "@filesource"], - "\n * ", - ["keyword", "@global"], - "\n * ", - ["keyword", "@ignore"], - "\n * ", - ["keyword", "@internal"], - "\n * ", - ["keyword", "@license"], - "\n * ", - ["keyword", "@link"], - "\n * ", - ["keyword", "@method"], - "\n * ", - ["keyword", "@package"], - "\n * ", - ["keyword", "@param"], - "\n * ", - ["keyword", "@property"], - "\n * ", - ["keyword", "@property-read"], - "\n * ", - ["keyword", "@property-write"], - "\n * ", - ["keyword", "@return"], - "\n * ", - ["keyword", "@see"], - "\n * ", - ["keyword", "@since"], - "\n * ", - ["keyword", "@source"], - "\n * ", - ["keyword", "@subpackage"], - "\n * ", - ["keyword", "@throws"], - "\n * ", - ["keyword", "@todo"], - "\n * ", - ["keyword", "@uses"], - "\n * ", - ["keyword", "@used-by"], - "\n * ", - ["keyword", "@var"], - "\n * ", - ["keyword", "@version"], - "\n */" + "/**\r\n * ", ["keyword", "@api"], + "\r\n * ", ["keyword", "@author"], + "\r\n * ", ["keyword", "@category"], + "\r\n * ", ["keyword", "@copyright"], + "\r\n * ", ["keyword", "@deprecated"], + "\r\n * ", ["keyword", "@example"], + "\r\n * ", ["keyword", "@filesource"], + "\r\n * ", ["keyword", "@global"], + "\r\n * ", ["keyword", "@ignore"], + "\r\n * ", ["keyword", "@internal"], + "\r\n * ", ["keyword", "@license"], + "\r\n * ", ["keyword", "@link"], + "\r\n * ", ["keyword", "@method"], + "\r\n * ", ["keyword", "@package"], + "\r\n * ", ["keyword", "@param"], + "\r\n * ", ["keyword", "@property"], + "\r\n * ", ["keyword", "@property-read"], + "\r\n * ", ["keyword", "@property-write"], + "\r\n * ", ["keyword", "@return"], + "\r\n * ", ["keyword", "@see"], + "\r\n * ", ["keyword", "@since"], + "\r\n * ", ["keyword", "@source"], + "\r\n * ", ["keyword", "@subpackage"], + "\r\n * ", ["keyword", "@throws"], + "\r\n * ", ["keyword", "@todo"], + "\r\n * ", ["keyword", "@uses"], + "\r\n * ", ["keyword", "@used-by"], + "\r\n * ", ["keyword", "@var"], + "\r\n * ", ["keyword", "@version"], + "\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/phpdoc/parameter_feature.test b/tests/languages/phpdoc/parameter_feature.test index 68aa3e2ce3..7b98a74ab1 100644 --- a/tests/languages/phpdoc/parameter_feature.test +++ b/tests/languages/phpdoc/parameter_feature.test @@ -6,16 +6,16 @@ ---------------------------------------------------- [ - "/**\n * ", + "/**\r\n * ", ["keyword", "@param"], ["class-name", [ ["keyword", "string"] ]], ["parameter", "$parameter"], - " a parameter\n * ", + " a parameter\r\n * ", ["keyword", "@param"], ["parameter", "$arg2"], - " a second parameter\n */" + " a second parameter\r\n */" ] ---------------------------------------------------- diff --git a/tests/languages/plsql/keyword_feature.test b/tests/languages/plsql/keyword_feature.test index e000f7273b..db916e7485 100644 --- a/tests/languages/plsql/keyword_feature.test +++ b/tests/languages/plsql/keyword_feature.test @@ -1,94 +1,181 @@ -ACCESS +A +ACCESSIBLE +ADD AGENT AGGREGATE +ALL +ALTER +AND +ANY ARRAY -ARROW +AS +ASC AT ATTRIBUTE -AUDIT AUTHID +AVG +BEGIN +BETWEEN BFILE_BASE +BINARY BLOB_BASE BLOCK BODY BOTH BOUND +BULK +BY BYTE +C +CALL CALLING +CASCADE +CASE +CHAR CHAR_BASE +CHARACTER +CHARSET CHARSETFORM CHARSETID +CHECK CLOB_BASE -COLAUTH -COLLECT +CLONE +CLOSE CLUSTER CLUSTERS +COLAUTH +COLLECT +COLUMNS +COMMENT +COMMIT +COMMITTED COMPILED COMPRESS +CONNECT CONSTANT CONSTRUCTOR CONTEXT +CONTINUE +CONVERT +COUNT CRASH +CREATE +CREDENTIAL +CURRENT +CURSOR CUSTOMDATUM DANGLING +DATA +DATE DATE_BASE +DAY +DECLARE +DEFAULT DEFINE +DELETE +DESC DETERMINISTIC +DIRECTORY +DISTINCT +DOUBLE +DROP DURATION ELEMENT +ELSE +ELSIF EMPTY +END +ESCAPE +EXCEPT EXCEPTION EXCEPTIONS EXCLUSIVE +EXECUTE +EXISTS +EXIT EXTERNAL +FETCH FINAL +FIRST +FIXED +FLOAT +FOR FORALL -FORM -FOUND +FORCE +FROM +FUNCTION GENERAL +GOTO +GRANT +GROUP +HASH +HAVING HEAP HIDDEN +HOUR IDENTIFIED +IF IMMEDIATE +IMMUTABLE +IN INCLUDING -INCREMENT -INDICATOR +INDEX INDEXES +INDICATOR INDICES INFINITE -INITIAL -ISOPEN +INSERT INSTANTIABLE +INT INTERFACE +INTERSECT +INTERVAL +INTO INVALIDATE +IS +ISOLATION JAVA +LANGUAGE LARGE LEADING LENGTH +LEVEL LIBRARY +LIKE LIKE2 LIKE4 LIKEC +LIMIT LIMITED +LOCAL +LOCK LONG LOOP MAP -MAXEXTENTS +MAX MAXLEN MEMBER +MERGE +MIN MINUS -MLSLABEL +MINUTE +MOD +MODE +MODIFY +MONTH MULTISET +MUTABLE NAME NAN +NATIONAL NATIVE +NCHAR NEW -NOAUDIT NOCOMPRESS NOCOPY -NOTFOUND +NOT NOWAIT -NUMBER +NULL NUMBER_BASE OBJECT OCICOLL @@ -104,62 +191,90 @@ OCIREFCURSOR OCIROWID OCISTRING OCITYPE -OFFLINE -ONLINE +OF +OLD +ON ONLY OPAQUE +OPEN OPERATOR +OPTION +OR ORACLE ORADATA +ORDER ORGANIZATION ORLANY ORLVARY OTHERS +OUT OVERLAPS OVERRIDING PACKAGE PARALLEL_ENABLE PARAMETER PARAMETERS +PARENT +PARTITION PASCAL -PCTFREE +PERSISTABLE PIPE PIPELINED +PLUGGABLE +POLYMORPHIC PRAGMA +PRECISION PRIOR PRIVATE +PROCEDURE +PUBLIC RAISE RANGE RAW +READ RECORD REF REFERENCE +RELIES_ON REM REMAINDER -RESULT +RENAME RESOURCE +RESULT +RESULT_CACHE +RETURN RETURNING REVERSE -ROWID -ROWNUM -ROWTYPE +REVOKE +ROLLBACK +ROW SAMPLE +SAVE +SAVEPOINT SB1 SB2 SB4 +SECOND SEGMENT +SELECT SELF SEPARATE SEQUENCE +SERIALIZABLE +SET +SHARE SHORT SIZE SIZE_T +SOME SPARSE +SQL SQLCODE SQLDATA SQLNAME SQLSTATE STANDARD +START STATIC STDDEV STORED @@ -170,132 +285,238 @@ SUBMULTISET SUBPARTITION SUBSTITUTABLE SUBTYPE -SUCCESSFUL +SUM SYNONYM -SYSDATE TABAUTH +TABLE TDO THE +THEN +TIME +TIMESTAMP TIMEZONE_ABBR TIMEZONE_HOUR TIMEZONE_MINUTE TIMEZONE_REGION +TO TRAILING -TRANSAC +TRANSACTION TRANSACTIONAL TRUSTED +TYPE UB1 UB2 UB4 -UID UNDER +UNION +UNIQUE +UNPLUG +UNSIGNED UNTRUSTED -VALIDATE +UPDATE +USE +USING VALIST -VARCHAR2 +VALUE +VALUES VARIABLE VARIANCE VARRAY +VARYING +VIEW VIEWS VOID -WHENEVER +WHEN +WHERE +WHILE +WITH +WORK WRAPPED +WRITE +YEAR ZONE ---------------------------------------------------- [ - ["keyword", "ACCESS"], + ["keyword", "A"], + ["keyword", "ACCESSIBLE"], + ["keyword", "ADD"], ["keyword", "AGENT"], ["keyword", "AGGREGATE"], + ["keyword", "ALL"], + ["keyword", "ALTER"], + ["keyword", "AND"], + ["keyword", "ANY"], ["keyword", "ARRAY"], - ["keyword", "ARROW"], + ["keyword", "AS"], + ["keyword", "ASC"], ["keyword", "AT"], ["keyword", "ATTRIBUTE"], - ["keyword", "AUDIT"], ["keyword", "AUTHID"], + ["keyword", "AVG"], + ["keyword", "BEGIN"], + ["keyword", "BETWEEN"], ["keyword", "BFILE_BASE"], + ["keyword", "BINARY"], ["keyword", "BLOB_BASE"], ["keyword", "BLOCK"], ["keyword", "BODY"], ["keyword", "BOTH"], ["keyword", "BOUND"], + ["keyword", "BULK"], + ["keyword", "BY"], ["keyword", "BYTE"], + ["keyword", "C"], + ["keyword", "CALL"], ["keyword", "CALLING"], + ["keyword", "CASCADE"], + ["keyword", "CASE"], + ["keyword", "CHAR"], ["keyword", "CHAR_BASE"], + ["keyword", "CHARACTER"], + ["keyword", "CHARSET"], ["keyword", "CHARSETFORM"], ["keyword", "CHARSETID"], + ["keyword", "CHECK"], ["keyword", "CLOB_BASE"], - ["keyword", "COLAUTH"], - ["keyword", "COLLECT"], + ["keyword", "CLONE"], + ["keyword", "CLOSE"], ["keyword", "CLUSTER"], ["keyword", "CLUSTERS"], + ["keyword", "COLAUTH"], + ["keyword", "COLLECT"], + ["keyword", "COLUMNS"], + ["keyword", "COMMENT"], + ["keyword", "COMMIT"], + ["keyword", "COMMITTED"], ["keyword", "COMPILED"], ["keyword", "COMPRESS"], + ["keyword", "CONNECT"], ["keyword", "CONSTANT"], ["keyword", "CONSTRUCTOR"], ["keyword", "CONTEXT"], + ["keyword", "CONTINUE"], + ["keyword", "CONVERT"], + ["keyword", "COUNT"], ["keyword", "CRASH"], + ["keyword", "CREATE"], + ["keyword", "CREDENTIAL"], + ["keyword", "CURRENT"], + ["keyword", "CURSOR"], ["keyword", "CUSTOMDATUM"], ["keyword", "DANGLING"], + ["keyword", "DATA"], + ["keyword", "DATE"], ["keyword", "DATE_BASE"], + ["keyword", "DAY"], + ["keyword", "DECLARE"], + ["keyword", "DEFAULT"], ["keyword", "DEFINE"], + ["keyword", "DELETE"], + ["keyword", "DESC"], ["keyword", "DETERMINISTIC"], + ["keyword", "DIRECTORY"], + ["keyword", "DISTINCT"], + ["keyword", "DOUBLE"], + ["keyword", "DROP"], ["keyword", "DURATION"], ["keyword", "ELEMENT"], + ["keyword", "ELSE"], + ["keyword", "ELSIF"], ["keyword", "EMPTY"], + ["keyword", "END"], + ["keyword", "ESCAPE"], + ["keyword", "EXCEPT"], ["keyword", "EXCEPTION"], ["keyword", "EXCEPTIONS"], ["keyword", "EXCLUSIVE"], + ["keyword", "EXECUTE"], + ["keyword", "EXISTS"], + ["keyword", "EXIT"], ["keyword", "EXTERNAL"], + ["keyword", "FETCH"], ["keyword", "FINAL"], + ["keyword", "FIRST"], + ["keyword", "FIXED"], + ["keyword", "FLOAT"], + ["keyword", "FOR"], ["keyword", "FORALL"], - ["keyword", "FORM"], - ["keyword", "FOUND"], + ["keyword", "FORCE"], + ["keyword", "FROM"], + ["keyword", "FUNCTION"], ["keyword", "GENERAL"], + ["keyword", "GOTO"], + ["keyword", "GRANT"], + ["keyword", "GROUP"], + ["keyword", "HASH"], + ["keyword", "HAVING"], ["keyword", "HEAP"], ["keyword", "HIDDEN"], + ["keyword", "HOUR"], ["keyword", "IDENTIFIED"], + ["keyword", "IF"], ["keyword", "IMMEDIATE"], + ["keyword", "IMMUTABLE"], + ["keyword", "IN"], ["keyword", "INCLUDING"], - ["keyword", "INCREMENT"], - ["keyword", "INDICATOR"], + ["keyword", "INDEX"], ["keyword", "INDEXES"], + ["keyword", "INDICATOR"], ["keyword", "INDICES"], ["keyword", "INFINITE"], - ["keyword", "INITIAL"], - ["keyword", "ISOPEN"], + ["keyword", "INSERT"], ["keyword", "INSTANTIABLE"], + ["keyword", "INT"], ["keyword", "INTERFACE"], + ["keyword", "INTERSECT"], + ["keyword", "INTERVAL"], + ["keyword", "INTO"], ["keyword", "INVALIDATE"], + ["keyword", "IS"], + ["keyword", "ISOLATION"], ["keyword", "JAVA"], + ["keyword", "LANGUAGE"], ["keyword", "LARGE"], ["keyword", "LEADING"], ["keyword", "LENGTH"], + ["keyword", "LEVEL"], ["keyword", "LIBRARY"], + ["keyword", "LIKE"], ["keyword", "LIKE2"], ["keyword", "LIKE4"], ["keyword", "LIKEC"], + ["keyword", "LIMIT"], ["keyword", "LIMITED"], + ["keyword", "LOCAL"], + ["keyword", "LOCK"], ["keyword", "LONG"], ["keyword", "LOOP"], ["keyword", "MAP"], - ["keyword", "MAXEXTENTS"], + ["keyword", "MAX"], ["keyword", "MAXLEN"], ["keyword", "MEMBER"], + ["keyword", "MERGE"], + ["keyword", "MIN"], ["keyword", "MINUS"], - ["keyword", "MLSLABEL"], + ["keyword", "MINUTE"], + ["keyword", "MOD"], + ["keyword", "MODE"], + ["keyword", "MODIFY"], + ["keyword", "MONTH"], ["keyword", "MULTISET"], + ["keyword", "MUTABLE"], ["keyword", "NAME"], ["keyword", "NAN"], + ["keyword", "NATIONAL"], ["keyword", "NATIVE"], + ["keyword", "NCHAR"], ["keyword", "NEW"], - ["keyword", "NOAUDIT"], ["keyword", "NOCOMPRESS"], ["keyword", "NOCOPY"], - ["keyword", "NOTFOUND"], + ["keyword", "NOT"], ["keyword", "NOWAIT"], - ["keyword", "NUMBER"], + ["keyword", "NULL"], ["keyword", "NUMBER_BASE"], ["keyword", "OBJECT"], ["keyword", "OCICOLL"], @@ -311,62 +532,90 @@ ZONE ["keyword", "OCIROWID"], ["keyword", "OCISTRING"], ["keyword", "OCITYPE"], - ["keyword", "OFFLINE"], - ["keyword", "ONLINE"], + ["keyword", "OF"], + ["keyword", "OLD"], + ["keyword", "ON"], ["keyword", "ONLY"], ["keyword", "OPAQUE"], + ["keyword", "OPEN"], ["keyword", "OPERATOR"], + ["keyword", "OPTION"], + ["keyword", "OR"], ["keyword", "ORACLE"], ["keyword", "ORADATA"], + ["keyword", "ORDER"], ["keyword", "ORGANIZATION"], ["keyword", "ORLANY"], ["keyword", "ORLVARY"], ["keyword", "OTHERS"], + ["keyword", "OUT"], ["keyword", "OVERLAPS"], ["keyword", "OVERRIDING"], ["keyword", "PACKAGE"], ["keyword", "PARALLEL_ENABLE"], ["keyword", "PARAMETER"], ["keyword", "PARAMETERS"], + ["keyword", "PARENT"], + ["keyword", "PARTITION"], ["keyword", "PASCAL"], - ["keyword", "PCTFREE"], + ["keyword", "PERSISTABLE"], ["keyword", "PIPE"], ["keyword", "PIPELINED"], + ["keyword", "PLUGGABLE"], + ["keyword", "POLYMORPHIC"], ["keyword", "PRAGMA"], + ["keyword", "PRECISION"], ["keyword", "PRIOR"], ["keyword", "PRIVATE"], + ["keyword", "PROCEDURE"], + ["keyword", "PUBLIC"], ["keyword", "RAISE"], ["keyword", "RANGE"], ["keyword", "RAW"], + ["keyword", "READ"], ["keyword", "RECORD"], ["keyword", "REF"], ["keyword", "REFERENCE"], + ["keyword", "RELIES_ON"], ["keyword", "REM"], ["keyword", "REMAINDER"], - ["keyword", "RESULT"], + ["keyword", "RENAME"], ["keyword", "RESOURCE"], + ["keyword", "RESULT"], + ["keyword", "RESULT_CACHE"], + ["keyword", "RETURN"], ["keyword", "RETURNING"], ["keyword", "REVERSE"], - ["keyword", "ROWID"], - ["keyword", "ROWNUM"], - ["keyword", "ROWTYPE"], + ["keyword", "REVOKE"], + ["keyword", "ROLLBACK"], + ["keyword", "ROW"], ["keyword", "SAMPLE"], + ["keyword", "SAVE"], + ["keyword", "SAVEPOINT"], ["keyword", "SB1"], ["keyword", "SB2"], ["keyword", "SB4"], + ["keyword", "SECOND"], ["keyword", "SEGMENT"], + ["keyword", "SELECT"], ["keyword", "SELF"], ["keyword", "SEPARATE"], ["keyword", "SEQUENCE"], + ["keyword", "SERIALIZABLE"], + ["keyword", "SET"], + ["keyword", "SHARE"], ["keyword", "SHORT"], ["keyword", "SIZE"], ["keyword", "SIZE_T"], + ["keyword", "SOME"], ["keyword", "SPARSE"], + ["keyword", "SQL"], ["keyword", "SQLCODE"], ["keyword", "SQLDATA"], ["keyword", "SQLNAME"], ["keyword", "SQLSTATE"], ["keyword", "STANDARD"], + ["keyword", "START"], ["keyword", "STATIC"], ["keyword", "STDDEV"], ["keyword", "STORED"], @@ -377,39 +626,54 @@ ZONE ["keyword", "SUBPARTITION"], ["keyword", "SUBSTITUTABLE"], ["keyword", "SUBTYPE"], - ["keyword", "SUCCESSFUL"], + ["keyword", "SUM"], ["keyword", "SYNONYM"], - ["keyword", "SYSDATE"], ["keyword", "TABAUTH"], + ["keyword", "TABLE"], ["keyword", "TDO"], ["keyword", "THE"], + ["keyword", "THEN"], + ["keyword", "TIME"], + ["keyword", "TIMESTAMP"], ["keyword", "TIMEZONE_ABBR"], ["keyword", "TIMEZONE_HOUR"], ["keyword", "TIMEZONE_MINUTE"], ["keyword", "TIMEZONE_REGION"], + ["keyword", "TO"], ["keyword", "TRAILING"], - ["keyword", "TRANSAC"], + ["keyword", "TRANSACTION"], ["keyword", "TRANSACTIONAL"], ["keyword", "TRUSTED"], + ["keyword", "TYPE"], ["keyword", "UB1"], ["keyword", "UB2"], ["keyword", "UB4"], - ["keyword", "UID"], ["keyword", "UNDER"], + ["keyword", "UNION"], + ["keyword", "UNIQUE"], + ["keyword", "UNPLUG"], + ["keyword", "UNSIGNED"], ["keyword", "UNTRUSTED"], - ["keyword", "VALIDATE"], + ["keyword", "UPDATE"], + ["keyword", "USE"], + ["keyword", "USING"], ["keyword", "VALIST"], - ["keyword", "VARCHAR2"], + ["keyword", "VALUE"], + ["keyword", "VALUES"], ["keyword", "VARIABLE"], ["keyword", "VARIANCE"], ["keyword", "VARRAY"], + ["keyword", "VARYING"], + ["keyword", "VIEW"], ["keyword", "VIEWS"], ["keyword", "VOID"], - ["keyword", "WHENEVER"], + ["keyword", "WHEN"], + ["keyword", "WHERE"], + ["keyword", "WHILE"], + ["keyword", "WITH"], + ["keyword", "WORK"], ["keyword", "WRAPPED"], + ["keyword", "WRITE"], + ["keyword", "YEAR"], ["keyword", "ZONE"] ] - ----------------------------------------------------- - -Checks for all keywords. \ No newline at end of file diff --git a/tests/languages/plsql/label_feature.test b/tests/languages/plsql/label_feature.test new file mode 100644 index 0000000000..478b3cb1c2 --- /dev/null +++ b/tests/languages/plsql/label_feature.test @@ -0,0 +1,7 @@ +<< foo >> + +---------------------------------------------------- + +[ + ["label", "<< foo >>"] +] diff --git a/tests/languages/plsql/operator_feature.test b/tests/languages/plsql/operator_feature.test index 1422bca469..3935118d32 100644 --- a/tests/languages/plsql/operator_feature.test +++ b/tests/languages/plsql/operator_feature.test @@ -1,11 +1,42 @@ -:= ++ - * / ** +:= : +=> +% +|| +.. + += != <> ~= ^= < > <= >= +@ ---------------------------------------------------- [ - ["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. \ No newline at end of file +Checks for all operators. diff --git a/tests/languages/powerquery/string_feature.test b/tests/languages/powerquery/string_feature.test index dc1606f8eb..9834f86147 100644 --- a/tests/languages/powerquery/string_feature.test +++ b/tests/languages/powerquery/string_feature.test @@ -2,14 +2,18 @@ "foo" "foo""bar" +#!"Hello world#(cr,lf)" + ---------------------------------------------------- [ ["string", "\"\""], ["string", "\"foo\""], - ["string", "\"foo\"\"bar\""] + ["string", "\"foo\"\"bar\""], + + ["string", "#!\"Hello world#(cr,lf)\""] ] ---------------------------------------------------- -Checks for strings. \ No newline at end of file +Checks for strings. diff --git a/tests/languages/prolog/variable_feature.test b/tests/languages/prolog/variable_feature.test deleted file mode 100644 index 555c2efa79..0000000000 --- a/tests/languages/prolog/variable_feature.test +++ /dev/null @@ -1,15 +0,0 @@ -Foobar -Foo_bar_42 -_foo - ----------------------------------------------------- - -[ - ["variable", "Foobar"], - ["variable", "Foo_bar_42"], - ["variable", "_foo"] -] - ----------------------------------------------------- - -Checks for variables. \ No newline at end of file diff --git a/tests/languages/promql/aggregate_selection.test b/tests/languages/promql/aggregate_selection.test new file mode 100644 index 0000000000..8e4ea3f05c --- /dev/null +++ b/tests/languages/promql/aggregate_selection.test @@ -0,0 +1,30 @@ +sum by (job) ( + rate(http_requests_total[5m]) +) + +---------------------------------------------------- + +[ + ["keyword", "sum"], + ["keyword", "by"], + ["vector-match", [ + ["punctuation", "("], + ["label-key", "job"], + ["punctuation", ")"] + ]], + ["punctuation", "("], + ["function", "rate"], + ["punctuation", "("], + "http_requests_total", + ["context-range", [ + ["punctuation", "["], + ["range-duration", "5m"], + ["punctuation", "]"] + ]], + ["punctuation", ")"], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks aggregate query. diff --git a/tests/languages/promql/comment_feature.test b/tests/languages/promql/comment_feature.test new file mode 100644 index 0000000000..fdd069abcc --- /dev/null +++ b/tests/languages/promql/comment_feature.test @@ -0,0 +1,11 @@ +# These examples are taken from ... + +---------------------------------------------------- + +[ + ["comment", "# These examples are taken from ..."] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/promql/keyword_feature.test b/tests/languages/promql/keyword_feature.test new file mode 100644 index 0000000000..f579e7f1e3 --- /dev/null +++ b/tests/languages/promql/keyword_feature.test @@ -0,0 +1,43 @@ +sum +min +max +avg +group +stddev +stdvar +count +count_values +bottomk +topk +quantile +on +ignoring +group_right +group_left +by +without +offset + +---------------------------------------------------- + +[ + ["keyword", "sum"], + ["keyword", "min"], + ["keyword", "max"], + ["keyword", "avg"], + ["keyword", "group"], + ["keyword", "stddev"], + ["keyword", "stdvar"], + ["keyword", "count"], + ["keyword", "count_values"], + ["keyword", "bottomk"], + ["keyword", "topk"], + ["keyword", "quantile"], + ["keyword", "on"], + ["keyword", "ignoring"], + ["keyword", "group_right"], + ["keyword", "group_left"], + ["keyword", "by"], + ["keyword", "without"], + ["keyword", "offset"] +] diff --git a/tests/languages/promql/number_feature.test b/tests/languages/promql/number_feature.test new file mode 100644 index 0000000000..39af1314ed --- /dev/null +++ b/tests/languages/promql/number_feature.test @@ -0,0 +1,17 @@ +23 +-2.43 +3.4e-9 +0x8f +-Inf +NaN + +---------------------------------------------------- + +[ + ["number", "23"], + ["number", "-2.43"], + ["number", "3.4e-9"], + ["number", "0x8f"], + ["number", "-Inf"], + ["number", "NaN"] +] diff --git a/tests/languages/promql/operator_feature.test b/tests/languages/promql/operator_feature.test new file mode 100644 index 0000000000..f3b638fc67 --- /dev/null +++ b/tests/languages/promql/operator_feature.test @@ -0,0 +1,25 @@ +^ * / % + - +== != <= < >= > + +and unless or + +---------------------------------------------------- + +[ + ["operator", "^"], + ["operator", "*"], + ["operator", "/"], + ["operator", "%"], + ["operator", "+"], + ["operator", "-"], + ["operator", "=="], + ["operator", "!="], + ["operator", "<="], + ["operator", "<"], + ["operator", ">="], + ["operator", ">"], + + ["operator", "and"], + ["operator", "unless"], + ["operator", "or"] +] diff --git a/tests/languages/promql/subquery_selection.test b/tests/languages/promql/subquery_selection.test new file mode 100644 index 0000000000..f8340b19c8 --- /dev/null +++ b/tests/languages/promql/subquery_selection.test @@ -0,0 +1,38 @@ +max_over_time(deriv(rate(distance_covered_total[5s])[30s:5s])[10m:]) + +---------------------------------------------------- + +[ + ["function", "max_over_time"], + ["punctuation", "("], + ["function", "deriv"], + ["punctuation", "("], + ["function", "rate"], + ["punctuation", "("], + "distance_covered_total", + ["context-range", [ + ["punctuation", "["], + ["range-duration", "5s"], + ["punctuation", "]"] + ]], + ["punctuation", ")"], + ["context-range", [ + ["punctuation", "["], + ["range-duration", "30s"], + ["punctuation", ":"], + ["range-duration", "5s"], + ["punctuation", "]"] + ]], + ["punctuation", ")"], + ["context-range", [ + ["punctuation", "["], + ["range-duration", "10m"], + ["punctuation", ":"], + ["punctuation", "]"] + ]], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks subquery. diff --git a/tests/languages/promql/time_series_selection.test b/tests/languages/promql/time_series_selection.test new file mode 100644 index 0000000000..a933e53da8 --- /dev/null +++ b/tests/languages/promql/time_series_selection.test @@ -0,0 +1,46 @@ +http_requests_total{job="apiserver", handler="/api/comments"}[5m] + +http_requests_total offset 5m + +http_requests_total{job=~".*server"} + +---------------------------------------------------- + +[ + "http_requests_total", + ["context-labels", [ + ["punctuation", "{"], + ["label-key", "job"], + ["punctuation", "="], + ["label-value", "\"apiserver\""], + ["punctuation", ","], + ["label-key", "handler"], + ["punctuation", "="], + ["label-value", "\"/api/comments\""], + ["punctuation", "}"] + ]], + ["context-range", [ + ["punctuation", "["], + ["range-duration", "5m"], + ["punctuation", "]"] + ]], + + "\r\n\r\nhttp_requests_total ", + ["keyword", "offset"], + ["context-range", [ + ["range-duration", "5m"] + ]], + + "\r\n\r\nhttp_requests_total", + ["context-labels", [ + ["punctuation", "{"], + ["label-key", "job"], + ["punctuation", "=~"], + ["label-value", "\".*server\""], + ["punctuation", "}"] + ]] +] + +---------------------------------------------------- + +Checks simple time series queries. diff --git a/tests/languages/psl/boolean_feature.test b/tests/languages/psl/boolean_feature.test new file mode 100644 index 0000000000..26f69ae960 --- /dev/null +++ b/tests/languages/psl/boolean_feature.test @@ -0,0 +1,35 @@ +FALSE +False +false + +TRUE +True +true + +NO +No +no + +YES +Yes +yes + +---------------------------------------------------- + +[ + ["boolean", "FALSE"], + ["boolean", "False"], + ["boolean", "false"], + + ["boolean", "TRUE"], + ["boolean", "True"], + ["boolean", "true"], + + ["boolean", "NO"], + ["boolean", "No"], + ["boolean", "no"], + + ["boolean", "YES"], + ["boolean", "Yes"], + ["boolean", "yes"] +] diff --git a/tests/languages/psl/builtin_feature.test b/tests/languages/psl/builtin_feature.test new file mode 100644 index 0000000000..40259ea2bf --- /dev/null +++ b/tests/languages/psl/builtin_feature.test @@ -0,0 +1,369 @@ +acos +add_diary +annotate +annotate_get +asctime +asin +atan +atexit +ascii_to_ebcdic +batch_set +blackout +cat +ceil +chan_exists +change_state +close +code_cvt +cond_signal +cond_wait +console_type +convert_base +convert_date +convert_locale_date +cos +cosh +create +destroy_lock +dump_hist +date +destroy +difference +dget_text +dcget_text +ebcdic_to_ascii +encrypt +event_archive +event_catalog_get +event_check +event_query +event_range_manage +event_range_query +event_report +event_schedule +event_trigger +event_trigger2 +execute +exists +exp +fabs +floor +fmod +full_discovery +file +fopen +ftell +fseek +grep +get_vars +getenv +get +get_chan_info +get_ranges +get_text +gethostinfo +getpid +getpname +history_get_retention +history +index +int +is_var +intersection +isnumber +internal +in_transition +join +kill +length +lines +lock +lock_info +log +loge +log10 +matchline +msg_check +msg_get_format +msg_get_severity +msg_printf +msg_sprintf +ntharg +num_consoles +nthargf +nthline +nthlinef +num_bytes +print +proc_exists +process +popen +printf +pconfig +poplines +pow +PslExecute +PslFunctionCall +PslFunctionExists +PslSetOptions +random +read +readln +refresh_parameters +remote_check +remote_close +remote_event_query +remote_event_trigger +remote_file_send +remote_open +remove +replace +rindex +sec_check_priv +sec_store_get +sec_store_set +set_alarm_ranges +set_locale +share +sin +sinh +sleep +sopen +sqrt +srandom +subset +set +substr +system +sprintf +sort +subset +snmp_agent_config +_snmp_debug +snmp_agent_stop +snmp_agent_start +snmp_h_set +snmp_h_get_next +snmp_h_get +snmp_set +snmp_walk +snmp_get_next +snmp_get +snmp_config +snmp_close +snmp_open +snmp_trap_receive +snmp_trap_ignore +snmp_trap_listen +snmp_trap_send +snmp_trap_raise_std_trap +snmp_trap_register_im +splitline +strcasecmp +str_repeat +trim +tail +tan +tanh +time +tmpnam +tolower +toupper +trace_psl_process +text_domain +unlock +unique +union +unset +va_arg +va_start +write + +---------------------------------------------------- + +[ + ["builtin", "acos"], + ["builtin", "add_diary"], + ["builtin", "annotate"], + ["builtin", "annotate_get"], + ["builtin", "asctime"], + ["builtin", "asin"], + ["builtin", "atan"], + ["builtin", "atexit"], + ["builtin", "ascii_to_ebcdic"], + ["builtin", "batch_set"], + ["builtin", "blackout"], + ["builtin", "cat"], + ["builtin", "ceil"], + ["builtin", "chan_exists"], + ["builtin", "change_state"], + ["builtin", "close"], + ["builtin", "code_cvt"], + ["builtin", "cond_signal"], + ["builtin", "cond_wait"], + ["builtin", "console_type"], + ["builtin", "convert_base"], + ["builtin", "convert_date"], + ["builtin", "convert_locale_date"], + ["builtin", "cos"], + ["builtin", "cosh"], + ["builtin", "create"], + ["builtin", "destroy_lock"], + ["builtin", "dump_hist"], + ["builtin", "date"], + ["builtin", "destroy"], + ["builtin", "difference"], + ["builtin", "dget_text"], + ["builtin", "dcget_text"], + ["builtin", "ebcdic_to_ascii"], + ["builtin", "encrypt"], + ["builtin", "event_archive"], + ["builtin", "event_catalog_get"], + ["builtin", "event_check"], + ["builtin", "event_query"], + ["builtin", "event_range_manage"], + ["builtin", "event_range_query"], + ["builtin", "event_report"], + ["builtin", "event_schedule"], + ["builtin", "event_trigger"], + ["builtin", "event_trigger2"], + ["builtin", "execute"], + ["builtin", "exists"], + ["builtin", "exp"], + ["builtin", "fabs"], + ["builtin", "floor"], + ["builtin", "fmod"], + ["builtin", "full_discovery"], + ["builtin", "file"], + ["builtin", "fopen"], + ["builtin", "ftell"], + ["builtin", "fseek"], + ["builtin", "grep"], + ["builtin", "get_vars"], + ["builtin", "getenv"], + ["builtin", "get"], + ["builtin", "get_chan_info"], + ["builtin", "get_ranges"], + ["builtin", "get_text"], + ["builtin", "gethostinfo"], + ["builtin", "getpid"], + ["builtin", "getpname"], + ["builtin", "history_get_retention"], + ["builtin", "history"], + ["builtin", "index"], + ["builtin", "int"], + ["builtin", "is_var"], + ["builtin", "intersection"], + ["builtin", "isnumber"], + ["builtin", "internal"], + ["builtin", "in_transition"], + ["builtin", "join"], + ["builtin", "kill"], + ["builtin", "length"], + ["builtin", "lines"], + ["builtin", "lock"], + ["builtin", "lock_info"], + ["builtin", "log"], + ["builtin", "loge"], + ["builtin", "log10"], + ["builtin", "matchline"], + ["builtin", "msg_check"], + ["builtin", "msg_get_format"], + ["builtin", "msg_get_severity"], + ["builtin", "msg_printf"], + ["builtin", "msg_sprintf"], + ["builtin", "ntharg"], + ["builtin", "num_consoles"], + ["builtin", "nthargf"], + ["builtin", "nthline"], + ["builtin", "nthlinef"], + ["builtin", "num_bytes"], + ["builtin", "print"], + ["builtin", "proc_exists"], + ["builtin", "process"], + ["builtin", "popen"], + ["builtin", "printf"], + ["builtin", "pconfig"], + ["builtin", "poplines"], + ["builtin", "pow"], + ["builtin", "PslExecute"], + ["builtin", "PslFunctionCall"], + ["builtin", "PslFunctionExists"], + ["builtin", "PslSetOptions"], + ["builtin", "random"], + ["builtin", "read"], + ["builtin", "readln"], + ["builtin", "refresh_parameters"], + ["builtin", "remote_check"], + ["builtin", "remote_close"], + ["builtin", "remote_event_query"], + ["builtin", "remote_event_trigger"], + ["builtin", "remote_file_send"], + ["builtin", "remote_open"], + ["builtin", "remove"], + ["builtin", "replace"], + ["builtin", "rindex"], + ["builtin", "sec_check_priv"], + ["builtin", "sec_store_get"], + ["builtin", "sec_store_set"], + ["builtin", "set_alarm_ranges"], + ["builtin", "set_locale"], + ["builtin", "share"], + ["builtin", "sin"], + ["builtin", "sinh"], + ["builtin", "sleep"], + ["builtin", "sopen"], + ["builtin", "sqrt"], + ["builtin", "srandom"], + ["builtin", "subset"], + ["builtin", "set"], + ["builtin", "substr"], + ["builtin", "system"], + ["builtin", "sprintf"], + ["builtin", "sort"], + ["builtin", "subset"], + ["builtin", "snmp_agent_config"], + ["builtin", "_snmp_debug"], + ["builtin", "snmp_agent_stop"], + ["builtin", "snmp_agent_start"], + ["builtin", "snmp_h_set"], + ["builtin", "snmp_h_get_next"], + ["builtin", "snmp_h_get"], + ["builtin", "snmp_set"], + ["builtin", "snmp_walk"], + ["builtin", "snmp_get_next"], + ["builtin", "snmp_get"], + ["builtin", "snmp_config"], + ["builtin", "snmp_close"], + ["builtin", "snmp_open"], + ["builtin", "snmp_trap_receive"], + ["builtin", "snmp_trap_ignore"], + ["builtin", "snmp_trap_listen"], + ["builtin", "snmp_trap_send"], + ["builtin", "snmp_trap_raise_std_trap"], + ["builtin", "snmp_trap_register_im"], + ["builtin", "splitline"], + ["builtin", "strcasecmp"], + ["builtin", "str_repeat"], + ["builtin", "trim"], + ["builtin", "tail"], + ["builtin", "tan"], + ["builtin", "tanh"], + ["builtin", "time"], + ["builtin", "tmpnam"], + ["builtin", "tolower"], + ["builtin", "toupper"], + ["builtin", "trace_psl_process"], + ["builtin", "text_domain"], + ["builtin", "unlock"], + ["builtin", "unique"], + ["builtin", "union"], + ["builtin", "unset"], + ["builtin", "va_arg"], + ["builtin", "va_start"], + ["builtin", "write"] +] + +---------------------------------------------------- + +Test for PSL built-in functions \ No newline at end of file diff --git a/tests/languages/psl/comment_feature.test b/tests/languages/psl/comment_feature.test new file mode 100644 index 0000000000..71f9686a3a --- /dev/null +++ b/tests/languages/psl/comment_feature.test @@ -0,0 +1,23 @@ +# Comment +# This is not a "string" +# This is not a <<>=2 +1^=2 +1*=2 +1/=2 +1%=2 +1|=2 +1&=2 +1||2 +1&&2 +1|2 +1^2 +1&2 +1!=2 +1==2 +1=~2 +1!~2 +1<2 +1<=2 +1>2 +1>=2 +1<<2 +1>>2 +1+2 +1*2 +1/2 +1%2 +"a"."b" +1-2 +!1 +1++2 +1--2 +1?2:3 + +---------------------------------------------------- + +[ + ["number", "1"], + ["operator", "="], + ["number", "2"], + + ["number", "1"], + ["operator", "+="], + ["number", "2"], + + ["number", "1"], + ["operator", "-="], + ["number", "2"], + + ["number", "1"], + ["operator", "<<="], + ["number", "2"], + + ["number", "1"], + ["operator", ">>="], + ["number", "2"], + + ["number", "1"], + ["operator", "^="], + ["number", "2"], + + ["number", "1"], + ["operator", "*="], + ["number", "2"], + + ["number", "1"], + ["operator", "/="], + ["number", "2"], + + ["number", "1"], + ["operator", "%="], + ["number", "2"], + + ["number", "1"], + ["operator", "|="], + ["number", "2"], + + ["number", "1"], + ["operator", "&="], + ["number", "2"], + + ["number", "1"], + ["operator", "||"], + ["number", "2"], + + ["number", "1"], + ["operator", "&&"], + ["number", "2"], + + ["number", "1"], + ["operator", "|"], + ["number", "2"], + + ["number", "1"], + ["operator", "^"], + ["number", "2"], + + ["number", "1"], + ["operator", "&"], + ["number", "2"], + + ["number", "1"], + ["operator", "!="], + ["number", "2"], + + ["number", "1"], + ["operator", "=="], + ["number", "2"], + + ["number", "1"], + ["operator", "=~"], + ["number", "2"], + + ["number", "1"], + ["operator", "!~"], + ["number", "2"], + + ["number", "1"], + ["operator", "<"], + ["number", "2"], + + ["number", "1"], + ["operator", "<="], + ["number", "2"], + + ["number", "1"], + ["operator", ">"], + ["number", "2"], + + ["number", "1"], + ["operator", ">="], + ["number", "2"], + + ["number", "1"], + ["operator", "<<"], + ["number", "2"], + + ["number", "1"], + ["operator", ">>"], + ["number", "2"], + + ["number", "1"], + ["operator", "+"], + ["number", "2"], + + ["number", "1"], + ["operator", "*"], + ["number", "2"], + + ["number", "1"], + ["operator", "/"], + ["number", "2"], + + ["number", "1"], + ["operator", "%"], + ["number", "2"], + + ["string", ["\"a\""]], + ["operator", "."], + ["string", ["\"b\""]], + + ["number", "1"], + ["operator", "-"], + ["number", "2"], + + ["operator", "!"], + ["number", "1"], + + ["number", "1"], + ["operator", "++"], + ["number", "2"], + + ["number", "1"], + ["operator", "--"], + ["number", "2"], + + ["number", "1"], + ["operator", "?"], + ["number", "2"], + ["operator", ":"], + ["number", "3"] +] + +---------------------------------------------------- + +Test for oper1tors \ No newline at end of file diff --git a/tests/languages/psl/overall_feature.test b/tests/languages/psl/overall_feature.test new file mode 100644 index 0000000000..554152eed2 --- /dev/null +++ b/tests/languages/psl/overall_feature.test @@ -0,0 +1,60 @@ +function test(limit) { + for (i = 0 ; i < limit ; i++) { + s = s + i; # s has not been initialized! + } + print(s."\n"); +} + +---------------------------------------------------- + +[ + ["keyword", "function"], + ["function", "test"], + ["punctuation", "("], + "limit", + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "for"], + ["punctuation", "("], + "i ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + " i ", + ["operator", "<"], + " limit ", + ["punctuation", ";"], + " i", + ["operator", "++"], + ["punctuation", ")"], + ["punctuation", "{"], + + "\r\n\t\ts ", + ["operator", "="], + " s ", + ["operator", "+"], + " i", + ["punctuation", ";"], + ["comment", "# s has not been initialized!"], + + ["punctuation", "}"], + + ["builtin", "print"], + ["punctuation", "("], + "s", + ["operator", "."], + ["string", [ + "\"", + ["symbol", "\\n"], + "\"" + ]], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] +] + +---------------------------------------------------- + +General test for the most common PSL statements, all mixed together \ No newline at end of file diff --git a/tests/languages/psl/string_feature.test b/tests/languages/psl/string_feature.test new file mode 100644 index 0000000000..bf53d41fbc --- /dev/null +++ b/tests/languages/psl/string_feature.test @@ -0,0 +1,32 @@ +"abc" +"a \"bc\"" +"a\nbc" +"a\invalid" +"foo # not a comment" +"multi +line string" + +---------------------------------------------------- + +[ + ["string", ["\"abc\""]], + ["string", [ + "\"a ", + ["symbol", "\\\""], + "bc", + ["symbol", "\\\""], + "\"" + ]], + ["string", [ + "\"a", + ["symbol", "\\n"], + "bc\"" + ]], + ["string", ["\"a\\invalid\""]], + ["string", ["\"foo # not a comment\""]], + ["string", ["\"multi\r\nline string\""]] +] + +---------------------------------------------------- + +Test for strings \ No newline at end of file diff --git a/tests/languages/psl/variable_feature.test b/tests/languages/psl/variable_feature.test new file mode 100644 index 0000000000..6982ddfd48 --- /dev/null +++ b/tests/languages/psl/variable_feature.test @@ -0,0 +1,15 @@ +errno +exit_status +PslDebug + +---------------------------------------------------- + +[ + ["variable", "errno"], + ["variable", "exit_status"], + ["variable", "PslDebug"] +] + +---------------------------------------------------- + +Test for variables \ No newline at end of file diff --git a/tests/languages/pug/filter_feature.test b/tests/languages/pug/filter_feature.test new file mode 100644 index 0000000000..f055e20016 --- /dev/null +++ b/tests/languages/pug/filter_feature.test @@ -0,0 +1,11 @@ +:language + code + +---------------------------------------------------- + +[ + ["filter", [ + ["filter-name", ":language"], + ["text", "code"] + ]] +] diff --git a/tests/languages/pug/tag_feature.test b/tests/languages/pug/tag_feature.test index 9f07b5fa9b..97e3618e71 100644 --- a/tests/languages/pug/tag_feature.test +++ b/tests/languages/pug/tag_feature.test @@ -29,7 +29,7 @@ a: span ["function", "attributes"], ["punctuation", "("], ["punctuation", "{"], - ["string", "'data-foo'"], + ["string-property", "'data-foo'"], ["operator", ":"], ["string", "'bar'"], ["punctuation", "}"], @@ -43,11 +43,15 @@ a: span ["punctuation", "("], ["attr-name", "data-bar"], ["punctuation", "="], - ["attr-value", [["string", "\"foo\""]]], + ["attr-value", [ + ["string", "\"foo\""] + ]], ["punctuation", ","], ["attr-name", "type"], ["punctuation", "="], - ["attr-value", [["string", "'checkbox'"]]], + ["attr-value", [ + ["string", "'checkbox'"] + ]], ["punctuation", ","], ["attr-name", "checked"], ["punctuation", ")"] @@ -62,11 +66,11 @@ a: span ["punctuation", "="], ["attr-value", [ ["punctuation", "{"], - "color", + ["literal-property", "color"], ["operator", ":"], ["string", "'red'"], ["punctuation", ","], - " background", + ["literal-property", "background"], ["operator", ":"], ["string", "'green'"], ["punctuation", "}"] @@ -81,30 +85,45 @@ a: span ["punctuation", "("], ["attr-name", "unescaped"], ["punctuation", "!="], - ["attr-value", [["string", "\"\""]]], + ["attr-value", [ + ["string", "\"\""] + ]], ["punctuation", ")"] ]] ]], ["tag", [ "a", - ["attr-class", ".button"]]], - ["tag", [["attr-class", ".content"]]], + ["attr-class", ".button"] + ]], + ["tag", [ + ["attr-class", ".content"] + ]], + ["tag", [ "a", - ["attr-id", "#main-link"]]], - ["tag", [["attr-id", "#content"]]], + ["attr-id", "#main-link"] + ]], + ["tag", [ + ["attr-id", "#content"] + ]], + ["tag", [ "div", ["attr-id", "#test-id"], ["attr-class", ".test-class1"], - ["attr-class", ".test-class2"]]], + ["attr-class", ".test-class2"] + ]], ["tag", [ ["attr-class", ".test-class1"], ["attr-id", "#test-id"], - ["attr-class", ".test-class2"]]], + ["attr-class", ".test-class2"] + ]], - ["tag", ["a", ["punctuation", ":"]]], + ["tag", [ + "a", + ["punctuation", ":"] + ]], ["tag", ["span"]] ] diff --git a/tests/languages/pure/punctuation_feature.test b/tests/languages/pure/punctuation_feature.test new file mode 100644 index 0000000000..dfad5774e3 --- /dev/null +++ b/tests/languages/pure/punctuation_feature.test @@ -0,0 +1,13 @@ +( ) { } [ ] ; + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"] +] diff --git a/tests/languages/purebasic/asm_feature.test b/tests/languages/purebasic/asm_feature.test new file mode 100644 index 0000000000..a2646f509a --- /dev/null +++ b/tests/languages/purebasic/asm_feature.test @@ -0,0 +1,375 @@ +Procedure.i XorTwoBlocks2(*buffer1, *buffer2, length) + ; move all the required data to source reg, destination reg and counter reg + !mov esi, [p.p_buffer1] ; read 32-bit integer from p.p_buffer1 and move to esi + !mov edi, [p.p_buffer2] ; read 32-bit integer from p.p_buffer2 and move to edi + !mov ecx, [p.v_length] ; read 32-bit integer from p.v_length and move to ecx + + !@@: ; anonymous label, can be reached by @b (back) or @f (forward) + !mov al, byte [edi + ecx - 1] ; read byte from destination + !xor byte [esi + ecx - 1], al ; xor source with destination (i.e. xor bytes from both blocks) + !dec ecx ; decrease counter + !jne @b ; jumb back to first anonymous label behind + ProcedureReturn 0 +EndProcedure + +!jne label1 +!jmp @b +!EXTERN printf +!DEFAULT rel + +; source: http://www.jose.it-berater.org/smfforum/index.php?topic=5091.0 +Procedure PopCount64(x.q) + !mov rax, [p.v_x] + !mov rdx, rax + !shr rdx, 1 + !and rdx, [popcount64_v55] + !sub rax, rdx + ;x = (x & $3333333333333333) + ((x >> 2) & $3333333333333333) + !mov rdx, rax ;x + !and rax, [popcount64_v33] + !shr rdx, 2 + !and rdx, [popcount64_v33] + !add rax, rdx + ;x = (x + (x >> 4)) & $0f0f0f0f0f0f0f0f0f0f + !mov rdx, rax + !shr rdx, 4 + !add rax, rdx + !and rax, [popcount64_v0f] + ;x * $0101010101010101 >> 56 + !imul rax, [popcount64_v01] + !shr rax, 56 + ProcedureReturn + !popcount64_v01: dq 0x0101010101010101 + !popcount64_v0f: dq 0x0f0f0f0f0f0f0f0f + !popcount64_v33: dq 0x3333333333333333 + !popcount64_v55: dq 0x5555555555555555 +EndProcedure + +---------------------------------------------------- + +[ + ["keyword", "Procedure"], + ["punctuation", "."], + "i ", + ["function", "XorTwoBlocks2"], + ["punctuation", "("], + ["operator", "*buffer1"], + ["punctuation", ","], + ["operator", "*buffer2"], + ["punctuation", ","], + " length", + ["punctuation", ")"], + + ["comment", "; move all the required data to source reg, destination reg and counter reg"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "esi"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "p_buffer1", + ["operator", "]"] + ]], + ["comment", "; read 32-bit integer from p.p_buffer1 and move to esi"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "edi"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "p_buffer2", + ["operator", "]"] + ]], + ["comment", "; read 32-bit integer from p.p_buffer2 and move to edi"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "ecx"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "v_length", + ["operator", "]"] + ]], + ["comment", "; read 32-bit integer from p.v_length and move to ecx"], + + ["asm", [ + ["operator", "!"], + ["label", "@@"], + ["operator", ":"] + ]], + ["comment", "; anonymous label, can be reached by @b (back) or @f (forward)"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "al"], + ["operator", ","], + " byte ", + ["operator", "["], + ["register", "edi"], + ["operator", "+"], + ["register", "ecx"], + ["operator", "-"], + ["number", "1"], + ["operator", "]"] + ]], + ["comment", "; read byte from destination"], + + ["asm", [ + ["operator", "!"], + ["function", "xor"], + " byte ", + ["operator", "["], + ["register", "esi"], + ["operator", "+"], + ["register", "ecx"], + ["operator", "-"], + ["number", "1"], + ["operator", "]"], + ["operator", ","], + ["register", "al"] + ]], + ["comment", "; xor source with destination (i.e. xor bytes from both blocks)"], + + ["asm", [ + ["operator", "!"], + ["function", "dec"], + ["register", "ecx"] + ]], + ["comment", "; decrease counter"], + + ["asm", [ + ["operator", "!"], + ["function", "jne"], + ["label-reference-anonymous", "@b"] + ]], + ["comment", "; jumb back to first anonymous label behind"], + + ["keyword", "ProcedureReturn"], + ["number", "0"], + + ["keyword", "EndProcedure"], + + ["asm", [ + ["operator", "!"], + ["function", "jne"], + ["label-reference-addressed", "label1"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "jmp"], + ["label-reference-anonymous", "@b"] + ]], + ["asm", [ + ["operator", "!"], + ["keyword", "EXTERN printf"] + ]], + ["asm", [ + ["operator", "!"], + ["keyword", "DEFAULT rel"] + ]], + + ["comment", "; source: http://www.jose.it-berater.org/smfforum/index.php?topic=5091.0"], + + ["keyword", "Procedure"], + ["function", "PopCount64"], + ["punctuation", "("], + "x", + ["punctuation", "."], + "q", + ["punctuation", ")"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "v_x", + ["operator", "]"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rdx"], + ["operator", ","], + ["register", "rax"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rdx"], + ["operator", ","], + ["number", "1"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rdx"], + ["operator", ","], + ["operator", "["], + "popcount64_v55", + ["operator", "]"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "sub"], + ["register", "rax"], + ["operator", ","], + ["register", "rdx"] + ]], + + ["comment", ";x = (x & $3333333333333333) + ((x >> 2) & $3333333333333333)"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rdx"], + ["operator", ","], + ["register", "rax"] + ]], + ["comment", ";x"], + + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "popcount64_v33", + ["operator", "]"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rdx"], + ["operator", ","], + ["number", "2"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rdx"], + ["operator", ","], + ["operator", "["], + "popcount64_v33", + ["operator", "]"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "add"], + ["register", "rax"], + ["operator", ","], + ["register", "rdx"] + ]], + + ["comment", ";x = (x + (x >> 4)) & $0f0f0f0f0f0f0f0f0f0f"], + + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rdx"], + ["operator", ","], + ["register", "rax"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rdx"], + ["operator", ","], + ["number", "4"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "add"], + ["register", "rax"], + ["operator", ","], + ["register", "rdx"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "popcount64_v0f", + ["operator", "]"] + ]], + + ["comment", ";x * $0101010101010101 >> 56"], + + ["asm", [ + ["operator", "!"], + ["function", "imul"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "popcount64_v01", + ["operator", "]"] + ]], + + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rax"], + ["operator", ","], + ["number", "56"] + ]], + + ["keyword", "ProcedureReturn"], + + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v01"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x0101010101010101"] + ]], + + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v0f"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x0f0f0f0f0f0f0f0f"] + ]], + + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v33"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x3333333333333333"] + ]], + + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v55"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x5555555555555555"] + ]], + + ["keyword", "EndProcedure"] +] diff --git a/tests/languages/purebasic/function_feature.test b/tests/languages/purebasic/function_feature.test index a2d62b58e7..896990e8e7 100644 --- a/tests/languages/purebasic/function_feature.test +++ b/tests/languages/purebasic/function_feature.test @@ -1,211 +1,9 @@ -DECLARECDLL -DECLAREDLL -COMPILERSELECT -COMPILERCASE -COMPILERDEFAULT -COMPILERENDSELECT -COMPILERERROR -ENABLEEXPLICIT -DISABLEEXPLICIT -NOT -AND -OR -XOR -CALLDEBUGGER -DEBUGLEVEL -ENABLEDEBUGGER -DISABLEDEBUGGER -RESTORE -READ -INCLUDEPATH -INCLUDEBINARY -THREADED -RUNTIME -WITH -ENDWITH -STRUCTUREUNION -ENDSTRUCTUREUNION -ALIGN -NEWLIST -NEWMAP -INTERFACE -ENDINTERFACE -EXTENDS -ENUMERATION -ENDENUMERATION -SWAP -FOREACH -CONTINUE -FAKERETURN -GOTO -GOSUB -RETURN -BREAK -MODULE -ENDMODULE -DECLAREMODULE -ENDDECLAREMODULE -DECLARE -DECLAREC -PROTOTYPE -PROTOTYPEC -ENABLEASM -DISABLEASM -DIM -REDIM -DATA -DATASECTION -ENDDATASECTION -TO -PROCEDURERETURN -DEBUG -DEFAULT -CASE -SELECT -ENDSELECT -AS -IMPORT -ENDIMPORT -IMPORTC -COMPILERIF -COMPILERELSE -COMPILERENDIF -COMPILERELSEIF -END -STRUCTURE -ENDSTRUCTURE -WHILE -WEND -FOR -NEXT -STEP -IF -ELSE -ELSEIF -ENDIF -REPEAT -UNTIL -PROCEDURE -PROCEDUREDLL -PROCEDUREC -PROCEDURECDLL -ENDPROCEDURE -PROTECTED -SHARED -STATIC -GLOBAL -DEFINE -INCLUDEFILE -XINCLUDEFILE -MACRO -ENDMACRO - ----------------------------------------------------- - -[ - ["keyword", "DECLARECDLL"], - ["keyword", "DECLAREDLL"], - ["keyword", "COMPILERSELECT"], - ["keyword", "COMPILERCASE"], - ["keyword", "COMPILERDEFAULT"], - ["keyword", "COMPILERENDSELECT"], - ["keyword", "COMPILERERROR"], - ["keyword", "ENABLEEXPLICIT"], - ["keyword", "DISABLEEXPLICIT"], - ["keyword", "NOT"], - ["keyword", "AND"], - ["keyword", "OR"], - ["keyword", "XOR"], - ["keyword", "CALLDEBUGGER"], - ["keyword", "DEBUGLEVEL"], - ["keyword", "ENABLEDEBUGGER"], - ["keyword", "DISABLEDEBUGGER"], - ["keyword", "RESTORE"], - ["keyword", "READ"], - ["keyword", "INCLUDEPATH"], - ["keyword", "INCLUDEBINARY"], - ["keyword", "THREADED"], - ["keyword", "RUNTIME"], - ["keyword", "WITH"], - ["keyword", "ENDWITH"], - ["keyword", "STRUCTUREUNION"], - ["keyword", "ENDSTRUCTUREUNION"], - ["keyword", "ALIGN"], - ["keyword", "NEWLIST"], - ["keyword", "NEWMAP"], - ["keyword", "INTERFACE"], - ["keyword", "ENDINTERFACE"], - ["keyword", "EXTENDS"], - ["keyword", "ENUMERATION"], - ["keyword", "ENDENUMERATION"], - ["keyword", "SWAP"], - ["keyword", "FOREACH"], - ["keyword", "CONTINUE"], - ["keyword", "FAKERETURN"], - ["keyword", "GOTO"], - ["keyword", "GOSUB"], - ["keyword", "RETURN"], - ["keyword", "BREAK"], - ["keyword", "MODULE"], - ["keyword", "ENDMODULE"], - ["keyword", "DECLAREMODULE"], - ["keyword", "ENDDECLAREMODULE"], - ["keyword", "DECLARE"], - ["keyword", "DECLAREC"], - ["keyword", "PROTOTYPE"], - ["keyword", "PROTOTYPEC"], - ["keyword", "ENABLEASM"], - ["keyword", "DISABLEASM"], - ["keyword", "DIM"], - ["keyword", "REDIM"], - ["keyword", "DATA"], - ["keyword", "DATASECTION"], - ["keyword", "ENDDATASECTION"], - ["keyword", "TO"], - ["keyword", "PROCEDURERETURN"], - ["keyword", "DEBUG"], - ["keyword", "DEFAULT"], - ["keyword", "CASE"], - ["keyword", "SELECT"], - ["keyword", "ENDSELECT"], - ["keyword", "AS"], - ["keyword", "IMPORT"], - ["keyword", "ENDIMPORT"], - ["keyword", "IMPORTC"], - ["keyword", "COMPILERIF"], - ["keyword", "COMPILERELSE"], - ["keyword", "COMPILERENDIF"], - ["keyword", "COMPILERELSEIF"], - ["keyword", "END"], - ["keyword", "STRUCTURE"], - ["keyword", "ENDSTRUCTURE"], - ["keyword", "WHILE"], - ["keyword", "WEND"], - ["keyword", "FOR"], - ["keyword", "NEXT"], - ["keyword", "STEP"], - ["keyword", "IF"], - ["keyword", "ELSE"], - ["keyword", "ELSEIF"], - ["keyword", "ENDIF"], - ["keyword", "REPEAT"], - ["keyword", "UNTIL"], - ["keyword", "PROCEDURE"], - ["keyword", "PROCEDUREDLL"], - ["keyword", "PROCEDUREC"], - ["keyword", "PROCEDURECDLL"], - ["keyword", "ENDPROCEDURE"], - ["keyword", "PROTECTED"], - ["keyword", "SHARED"], - ["keyword", "STATIC"], - ["keyword", "GLOBAL"], - ["keyword", "DEFINE"], - ["keyword", "INCLUDEFILE"], - ["keyword", "XINCLUDEFILE"], - ["keyword", "MACRO"], - ["keyword", "ENDMACRO"] -] - ----------------------------------------------------- - -Checks for keywords. \ No newline at end of file +foo() + +---------------------------------------------------- + +[ + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/purebasic/keyword_feature.test b/tests/languages/purebasic/keyword_feature.test new file mode 100644 index 0000000000..c0aa789b0f --- /dev/null +++ b/tests/languages/purebasic/keyword_feature.test @@ -0,0 +1,213 @@ +DECLARECDLL +DECLAREDLL +COMPILERSELECT +COMPILERCASE +COMPILERDEFAULT +COMPILERENDSELECT +COMPILERERROR +ENABLEEXPLICIT +DISABLEEXPLICIT +NOT +AND +OR +XOR +CALLDEBUGGER +DEBUGLEVEL +ENABLEDEBUGGER +DISABLEDEBUGGER +RESTORE +READ +INCLUDEPATH +INCLUDEBINARY +THREADED +RUNTIME +WITH +ENDWITH +STRUCTUREUNION +ENDSTRUCTUREUNION +ALIGN +NEWLIST +NEWMAP +INTERFACE +ENDINTERFACE +EXTENDS +ENUMERATION +ENDENUMERATION +SWAP +FOREACH +CONTINUE +FAKERETURN +GOTO +GOSUB +RETURN +BREAK +MODULE +ENDMODULE +DECLAREMODULE +ENDDECLAREMODULE +DECLARE +DECLAREC +PROTOTYPE +PROTOTYPEC +ENABLEASM +DISABLEASM +DIM +REDIM +DATA +DATASECTION +ENDDATASECTION +TO +PROCEDURERETURN +DEBUG +DEFAULT +CASE +SELECT +ENDSELECT +AS +IMPORT +ENDIMPORT +IMPORTC +COMPILERIF +COMPILERELSE +COMPILERENDIF +COMPILERELSEIF +END +STRUCTURE +ENDSTRUCTURE +WHILE +WEND +FOR +NEXT +STEP +IF +ELSE +ELSEIF +ENDIF +REPEAT +UNTIL +PROCEDURE +PROCEDUREDLL +PROCEDUREC +PROCEDURECDLL +ENDPROCEDURE +PROTECTED +SHARED +STATIC +GLOBAL +DEFINE +INCLUDEFILE +XINCLUDEFILE +MACRO +ENDMACRO +FOREVER + +---------------------------------------------------- + +[ + ["keyword", "DECLARECDLL"], + ["keyword", "DECLAREDLL"], + ["keyword", "COMPILERSELECT"], + ["keyword", "COMPILERCASE"], + ["keyword", "COMPILERDEFAULT"], + ["keyword", "COMPILERENDSELECT"], + ["keyword", "COMPILERERROR"], + ["keyword", "ENABLEEXPLICIT"], + ["keyword", "DISABLEEXPLICIT"], + ["keyword", "NOT"], + ["keyword", "AND"], + ["keyword", "OR"], + ["keyword", "XOR"], + ["keyword", "CALLDEBUGGER"], + ["keyword", "DEBUGLEVEL"], + ["keyword", "ENABLEDEBUGGER"], + ["keyword", "DISABLEDEBUGGER"], + ["keyword", "RESTORE"], + ["keyword", "READ"], + ["keyword", "INCLUDEPATH"], + ["keyword", "INCLUDEBINARY"], + ["keyword", "THREADED"], + ["keyword", "RUNTIME"], + ["keyword", "WITH"], + ["keyword", "ENDWITH"], + ["keyword", "STRUCTUREUNION"], + ["keyword", "ENDSTRUCTUREUNION"], + ["keyword", "ALIGN"], + ["keyword", "NEWLIST"], + ["keyword", "NEWMAP"], + ["keyword", "INTERFACE"], + ["keyword", "ENDINTERFACE"], + ["keyword", "EXTENDS"], + ["keyword", "ENUMERATION"], + ["keyword", "ENDENUMERATION"], + ["keyword", "SWAP"], + ["keyword", "FOREACH"], + ["keyword", "CONTINUE"], + ["keyword", "FAKERETURN"], + ["keyword", "GOTO"], + ["keyword", "GOSUB"], + ["keyword", "RETURN"], + ["keyword", "BREAK"], + ["keyword", "MODULE"], + ["keyword", "ENDMODULE"], + ["keyword", "DECLAREMODULE"], + ["keyword", "ENDDECLAREMODULE"], + ["keyword", "DECLARE"], + ["keyword", "DECLAREC"], + ["keyword", "PROTOTYPE"], + ["keyword", "PROTOTYPEC"], + ["keyword", "ENABLEASM"], + ["keyword", "DISABLEASM"], + ["keyword", "DIM"], + ["keyword", "REDIM"], + ["keyword", "DATA"], + ["keyword", "DATASECTION"], + ["keyword", "ENDDATASECTION"], + ["keyword", "TO"], + ["keyword", "PROCEDURERETURN"], + ["keyword", "DEBUG"], + ["keyword", "DEFAULT"], + ["keyword", "CASE"], + ["keyword", "SELECT"], + ["keyword", "ENDSELECT"], + ["keyword", "AS"], + ["keyword", "IMPORT"], + ["keyword", "ENDIMPORT"], + ["keyword", "IMPORTC"], + ["keyword", "COMPILERIF"], + ["keyword", "COMPILERELSE"], + ["keyword", "COMPILERENDIF"], + ["keyword", "COMPILERELSEIF"], + ["keyword", "END"], + ["keyword", "STRUCTURE"], + ["keyword", "ENDSTRUCTURE"], + ["keyword", "WHILE"], + ["keyword", "WEND"], + ["keyword", "FOR"], + ["keyword", "NEXT"], + ["keyword", "STEP"], + ["keyword", "IF"], + ["keyword", "ELSE"], + ["keyword", "ELSEIF"], + ["keyword", "ENDIF"], + ["keyword", "REPEAT"], + ["keyword", "UNTIL"], + ["keyword", "PROCEDURE"], + ["keyword", "PROCEDUREDLL"], + ["keyword", "PROCEDUREC"], + ["keyword", "PROCEDURECDLL"], + ["keyword", "ENDPROCEDURE"], + ["keyword", "PROTECTED"], + ["keyword", "SHARED"], + ["keyword", "STATIC"], + ["keyword", "GLOBAL"], + ["keyword", "DEFINE"], + ["keyword", "INCLUDEFILE"], + ["keyword", "XINCLUDEFILE"], + ["keyword", "MACRO"], + ["keyword", "ENDMACRO"], + ["keyword", "FOREVER"] +] + +---------------------------------------------------- + +Checks for keywords. \ No newline at end of file diff --git a/tests/languages/purebasic/tag_feature.test b/tests/languages/purebasic/tag_feature.test new file mode 100644 index 0000000000..263c407987 --- /dev/null +++ b/tests/languages/purebasic/tag_feature.test @@ -0,0 +1,9 @@ +#foo +#NULL$ + +---------------------------------------------------- + +[ + ["tag", "#foo"], + ["tag", "#NULL$"] +] diff --git a/tests/languages/purescript/builtin_feature.test b/tests/languages/purescript/builtin_feature.test new file mode 100644 index 0000000000..3444ae66e7 --- /dev/null +++ b/tests/languages/purescript/builtin_feature.test @@ -0,0 +1,109 @@ +when +unless +liftA1 +apply +bind +discard +join +ifM +identity +whenM +unlessM +liftM1 +ap +compose +otherwise +top +bottom +recip +eq +notEq +degree +div +mod +lcm +gcd +flip +const +map +void +flap +conj +disj +not +mempty +compare +min +max +comparing +clamp +between +sub +negate +append +add +zero +mul +one +show +unit +absurd + +---------------------------------------------------- + +[ + ["builtin", "when"], + ["builtin", "unless"], + ["builtin", "liftA1"], + ["builtin", "apply"], + ["builtin", "bind"], + ["builtin", "discard"], + ["builtin", "join"], + ["builtin", "ifM"], + ["builtin", "identity"], + ["builtin", "whenM"], + ["builtin", "unlessM"], + ["builtin", "liftM1"], + ["builtin", "ap"], + ["builtin", "compose"], + ["builtin", "otherwise"], + ["builtin", "top"], + ["builtin", "bottom"], + ["builtin", "recip"], + ["builtin", "eq"], + ["builtin", "notEq"], + ["builtin", "degree"], + ["builtin", "div"], + ["builtin", "mod"], + ["builtin", "lcm"], + ["builtin", "gcd"], + ["builtin", "flip"], + ["builtin", "const"], + ["builtin", "map"], + ["builtin", "void"], + ["builtin", "flap"], + ["builtin", "conj"], + ["builtin", "disj"], + ["builtin", "not"], + ["builtin", "mempty"], + ["builtin", "compare"], + ["builtin", "min"], + ["builtin", "max"], + ["builtin", "comparing"], + ["builtin", "clamp"], + ["builtin", "between"], + ["builtin", "sub"], + ["builtin", "negate"], + ["builtin", "append"], + ["builtin", "add"], + ["builtin", "zero"], + ["builtin", "mul"], + ["builtin", "one"], + ["builtin", "show"], + ["builtin", "unit"], + ["builtin", "absurd"] +] + +---------------------------------------------------- + +Checks for all builtin. diff --git a/tests/languages/purescript/char_feature.test b/tests/languages/purescript/char_feature.test new file mode 100644 index 0000000000..e4dedc444a --- /dev/null +++ b/tests/languages/purescript/char_feature.test @@ -0,0 +1,17 @@ +'a' +'\n' +'\23' +'\xFE' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\n'"], + ["char", "'\\23'"], + ["char", "'\\xFE'"] +] + +---------------------------------------------------- + +Checks for chars. \ No newline at end of file diff --git a/tests/languages/purescript/comment_feature.test b/tests/languages/purescript/comment_feature.test new file mode 100644 index 0000000000..d8c8cdda20 --- /dev/null +++ b/tests/languages/purescript/comment_feature.test @@ -0,0 +1,14 @@ +-- foo +{- foo +bar -} + +---------------------------------------------------- + +[ + ["comment", "-- foo"], + ["comment", "{- foo\r\nbar -}"] +] + +---------------------------------------------------- + +Checks for single-line and multi-line comments. \ No newline at end of file diff --git a/tests/languages/purescript/constant_feature.test b/tests/languages/purescript/constant_feature.test new file mode 100644 index 0000000000..39ea0c114e --- /dev/null +++ b/tests/languages/purescript/constant_feature.test @@ -0,0 +1,23 @@ +Foo +Foo.Bar +Baz.Foobar_42 + +---------------------------------------------------- + +[ + ["constant", ["Foo"]], + ["constant", [ + "Foo", + ["punctuation", "."], + "Bar" + ]], + ["constant", [ + "Baz", + ["punctuation", "."], + "Foobar_42" + ]] +] + +---------------------------------------------------- + +Checks for constants. diff --git a/tests/languages/purescript/hvariable_feature.test b/tests/languages/purescript/hvariable_feature.test new file mode 100644 index 0000000000..048ac84ec9 --- /dev/null +++ b/tests/languages/purescript/hvariable_feature.test @@ -0,0 +1,23 @@ +foo +Foo.bar +Baz.foobar_42 + +---------------------------------------------------- + +[ + ["hvariable", ["foo"]], + ["hvariable", [ + "Foo", + ["punctuation", "."], + "bar" + ]], + ["hvariable", [ + "Baz", + ["punctuation", "."], + "foobar_42" + ]] +] + +---------------------------------------------------- + +Checks for hvariables. diff --git a/tests/languages/purescript/import_statement_feature.test b/tests/languages/purescript/import_statement_feature.test new file mode 100644 index 0000000000..b7e3f0a729 --- /dev/null +++ b/tests/languages/purescript/import_statement_feature.test @@ -0,0 +1,48 @@ +import Foo +import Foo_42.Bar as Foobar +import Foo.Bar as Foo.Baz hiding +import Foo.Bar (test) + +---------------------------------------------------- + +[ + ["import-statement", [ + ["keyword", "import"], + " Foo" + ]], + + ["import-statement", [ + ["keyword", "import"], + " Foo_42", + ["punctuation", "."], + "Bar ", + ["keyword", "as"], + " Foobar" + ]], + + ["import-statement", [ + ["keyword", "import"], + " Foo", + ["punctuation", "."], + "Bar ", + ["keyword", "as"], + " Foo", + ["punctuation", "."], + "Baz ", + ["keyword", "hiding"] + ]], + + ["import-statement", [ + ["keyword", "import"], + " Foo", + ["punctuation", "."], + "Bar" + ]], + ["punctuation", "("], + ["hvariable", ["test"]], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for import statement. diff --git a/tests/languages/purescript/issue3006.test b/tests/languages/purescript/issue3006.test new file mode 100644 index 0000000000..bf8dfbe384 --- /dev/null +++ b/tests/languages/purescript/issue3006.test @@ -0,0 +1,161 @@ +readBooleanOrIntAsBoolean ∷ Foreign → Foreign.F Boolean +readBooleanOrIntAsBoolean value = + Foreign.readBoolean value + <|> (toBool =<< Foreign.readInt value) + where + toBool ∷ Int → Foreign.F Boolean + toBool = case _ of + 0 → pure false + 1 → pure true + int → Foreign.fail (Foreign.ForeignError ("Invalid integer: " <> show int)) + +isSuccessResponse ∷ ∀ a. AX.Response a → Boolean +isSuccessResponse { status } = status >= (StatusCode 200) && status < (StatusCode 400) + +infix 4 eq as ≡ + +isMempty ∷ ∀ m. Monoid m → Boolean +isMempty = _ ≡ mempty + +---------------------------------------------------- + +[ + ["hvariable", ["readBooleanOrIntAsBoolean"]], + ["operator", "∷"], + ["constant", ["Foreign"]], + ["operator", "→"], + ["constant", [ + "Foreign", + ["punctuation", "."], + "F" + ]], + ["constant", ["Boolean"]], + + ["hvariable", ["readBooleanOrIntAsBoolean"]], + ["hvariable", ["value"]], + ["operator", "="], + + ["hvariable", [ + "Foreign", + ["punctuation", "."], + "readBoolean" + ]], + ["hvariable", ["value"]], + + ["operator", "<|>"], + ["punctuation", "("], + ["hvariable", ["toBool"]], + ["operator", "=<<"], + ["hvariable", [ + "Foreign", + ["punctuation", "."], + "readInt" + ]], + ["hvariable", ["value"]], + ["punctuation", ")"], + + ["keyword", "where"], + + ["hvariable", ["toBool"]], + ["operator", "∷"], + ["constant", ["Int"]], + ["operator", "→"], + ["constant", [ + "Foreign", + ["punctuation", "."], + "F" + ]], + ["constant", ["Boolean"]], + + ["hvariable", ["toBool"]], + ["operator", "="], + ["keyword", "case"], + ["hvariable", ["_"]], + ["keyword", "of"], + + ["number", "0"], + ["operator", "→"], + ["hvariable", ["pure"]], + ["hvariable", ["false"]], + + ["number", "1"], + ["operator", "→"], + ["hvariable", ["pure"]], + ["hvariable", ["true"]], + + ["hvariable", ["int"]], + ["operator", "→"], + ["hvariable", [ + "Foreign", + ["punctuation", "."], + "fail" + ]], + ["punctuation", "("], + ["constant", [ + "Foreign", + ["punctuation", "."], + "ForeignError" + ]], + ["punctuation", "("], + ["string", "\"Invalid integer: \""], + ["operator", "<>"], + ["builtin", "show"], + ["hvariable", ["int"]], + ["punctuation", ")"], + ["punctuation", ")"], + + ["hvariable", ["isSuccessResponse"]], + ["operator", "∷"], + ["keyword", "∀"], + ["hvariable", ["a"]], + ["punctuation", "."], + ["constant", [ + "AX", + ["punctuation", "."], + "Response" + ]], + ["hvariable", ["a"]], + ["operator", "→"], + ["constant", ["Boolean"]], + + ["hvariable", ["isSuccessResponse"]], + ["punctuation", "{"], + ["hvariable", ["status"]], + ["punctuation", "}"], + ["operator", "="], + ["hvariable", ["status"]], + ["operator", ">="], + ["punctuation", "("], + ["constant", ["StatusCode"]], + ["number", "200"], + ["punctuation", ")"], + ["operator", "&&"], + ["hvariable", ["status"]], + ["operator", "<"], + ["punctuation", "("], + ["constant", ["StatusCode"]], + ["number", "400"], + ["punctuation", ")"], + + ["hvariable", ["infix"]], + ["number", "4"], + ["builtin", "eq"], + ["hvariable", ["as"]], + ["operator", "≡"], + + ["hvariable", ["isMempty"]], + ["operator", "∷"], + ["keyword", "∀"], + ["hvariable", ["m"]], + ["punctuation", "."], + ["constant", ["Monoid"]], + ["hvariable", ["m"]], + ["operator", "→"], + ["constant", ["Boolean"]], + + ["hvariable", ["isMempty"]], + ["operator", "="], + ["hvariable", ["_"]], + ["operator", "≡"], + ["builtin", "mempty"] +] diff --git a/tests/languages/purescript/keyword_feature.test b/tests/languages/purescript/keyword_feature.test new file mode 100644 index 0000000000..d440a53166 --- /dev/null +++ b/tests/languages/purescript/keyword_feature.test @@ -0,0 +1,53 @@ +ado +case +class +data +derive +do +else +forall +if +in +infixl +infixr +instance +let +module +newtype +of +primitive +then +type +where +∀ + +---------------------------------------------------- + +[ + ["keyword", "ado"], + ["keyword", "case"], + ["keyword", "class"], + ["keyword", "data"], + ["keyword", "derive"], + ["keyword", "do"], + ["keyword", "else"], + ["keyword", "forall"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "infixl"], + ["keyword", "infixr"], + ["keyword", "instance"], + ["keyword", "let"], + ["keyword", "module"], + ["keyword", "newtype"], + ["keyword", "of"], + ["keyword", "primitive"], + ["keyword", "then"], + ["keyword", "type"], + ["keyword", "where"], + ["keyword", "∀"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/purescript/number_feature.test b/tests/languages/purescript/number_feature.test new file mode 100644 index 0000000000..f45a0f2869 --- /dev/null +++ b/tests/languages/purescript/number_feature.test @@ -0,0 +1,23 @@ +42 +3.14159 +2E3 +1.2e-4 +0.9e+1 +0o47 +0xBadFace + +---------------------------------------------------- + +[ + ["number", "42"], + ["number", "3.14159"], + ["number", "2E3"], + ["number", "1.2e-4"], + ["number", "0.9e+1"], + ["number", "0o47"], + ["number", "0xBadFace"] +] + +---------------------------------------------------- + +Checks for decimal, octal and hexadecimal numbers. \ No newline at end of file diff --git a/tests/languages/purescript/operator_feature.test b/tests/languages/purescript/operator_feature.test new file mode 100644 index 0000000000..9789ee881e --- /dev/null +++ b/tests/languages/purescript/operator_feature.test @@ -0,0 +1,100 @@ +.. +reverse <<< sort +`foo` +`Foo.bar` ++ - * / +^ ^^ ** +&& || +< <= == /= +>= > \ | +++ : !! +\\ <- -> += :: => +>> >>= >@> +~ ! @ + +∷ +→ ← +⇒ ⇐ +∘ + +∘ × ÷ ≡ ≠ ⫽ ⩓ ⩔ ∧ ∨ ↝ ⨁ ⊹ + +---------------------------------------------------- + +[ + ["operator", ".."], + + ["hvariable", ["reverse"]], + ["operator", "<<<"], + ["hvariable", ["sort"]], + + ["operator", "`foo`"], + + ["operator", "`Foo.bar`"], + + ["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", "≠"], + ["operator", "⫽"], + ["operator", "⩓"], + ["operator", "⩔"], + ["operator", "∧"], + ["operator", "∨"], + ["operator", "↝"], + ["operator", "⨁"], + ["operator", "⊹"] +] + +---------------------------------------------------- + +Checks for operators. diff --git a/tests/languages/purescript/string_feature.test b/tests/languages/purescript/string_feature.test new file mode 100644 index 0000000000..a327a0568b --- /dev/null +++ b/tests/languages/purescript/string_feature.test @@ -0,0 +1,19 @@ +"" +"fo\"o" +"foo \ + \ bar" +"foo -- comment lookalike \ + \ bar" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"fo\\\"o\""], + ["string", "\"foo \\\r\n \\ bar\""], + ["string", "\"foo -- comment lookalike \\\r\n \\ bar\""] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/python/keyword_feature.test b/tests/languages/python/keyword_feature.test index 56685da88e..faf1dc04aa 100644 --- a/tests/languages/python/keyword_feature.test +++ b/tests/languages/python/keyword_feature.test @@ -9,6 +9,7 @@ pass print raise return try while with yield nonlocal and not or +match case _: ---------------------------------------------------- @@ -23,9 +24,10 @@ and not or ["keyword", "pass"], ["keyword", "print"], ["keyword", "raise"], ["keyword", "return"], ["keyword", "try"], ["keyword", "while"], ["keyword", "with"], ["keyword", "yield"], ["keyword", "nonlocal"], - ["keyword", "and"], ["keyword", "not"], ["keyword", "or"] + ["keyword", "and"], ["keyword", "not"], ["keyword", "or"], + ["keyword", "match"], ["keyword", "case"], ["keyword", "_"], ["punctuation", ":"] ] ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/python/number_feature.test b/tests/languages/python/number_feature.test index 6d55b14cc8..c40bdb6103 100644 --- a/tests/languages/python/number_feature.test +++ b/tests/languages/python/number_feature.test @@ -3,10 +3,19 @@ 0xBadFace 42 3.14159 +10. 2.1E10 0.3e-7 4.8e+1 42j +0b_0001 +0b0_001 +0o_754 +0o7_540 +0x_BadFace +0xBad_Face +4_200 +4_200j ---------------------------------------------------- @@ -16,12 +25,21 @@ ["number", "0xBadFace"], ["number", "42"], ["number", "3.14159"], + ["number", "10."], ["number", "2.1E10"], ["number", "0.3e-7"], ["number", "4.8e+1"], - ["number", "42j"] + ["number", "42j"], + ["number", "0b_0001"], + ["number", "0b0_001"], + ["number", "0o_754"], + ["number", "0o7_540"], + ["number", "0x_BadFace"], + ["number", "0xBad_Face"], + ["number", "4_200"], + ["number", "4_200j"] ] ---------------------------------------------------- -Checks for hexadecimal, octal, binary and decimal numbers. \ No newline at end of file +Checks for hexadecimal, octal, binary and decimal numbers. diff --git a/tests/languages/python/operator_feature.test b/tests/languages/python/operator_feature.test index 6785336627..dd6f20dfbf 100644 --- a/tests/languages/python/operator_feature.test +++ b/tests/languages/python/operator_feature.test @@ -7,6 +7,7 @@ > >= >> = == != +:= & | ^ ~ ---------------------------------------------------- @@ -21,9 +22,10 @@ ["operator", ">"], ["operator", ">="], ["operator", ">>"], ["operator", "="], ["operator", "=="], ["operator", "!="], + ["operator", ":="], ["operator", "&"], ["operator", "|"], ["operator", "^"], ["operator", "~"] ] ---------------------------------------------------- -Checks for all operators. \ No newline at end of file +Checks for all operators. diff --git a/tests/languages/q/comment_feature.test b/tests/languages/q/comment_feature.test index c78bb33618..fac469913c 100644 --- a/tests/languages/q/comment_feature.test +++ b/tests/languages/q/comment_feature.test @@ -6,6 +6,8 @@ Foo bar "baz" \ +`john / an atom of type symbol + \ Foo Bar "baz" @@ -15,10 +17,14 @@ Bar "baz" [ ["comment", "#!/usr/bin/env q"], ["comment", "/ Foobar \"baz\""], + ["comment", "/\r\nFoo\r\nbar \"baz\"\r\n\\"], + + ["symbol", "`john"], ["comment", "/ an atom of type symbol"], + ["comment", "\\\r\nFoo\r\nBar \"baz\""] ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for comments. diff --git a/tests/languages/q/punctuation_feature.test b/tests/languages/q/punctuation_feature.test new file mode 100644 index 0000000000..ca50be4266 --- /dev/null +++ b/tests/languages/q/punctuation_feature.test @@ -0,0 +1,17 @@ +( ) { } [ ] ; + +sp.s + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"], + + "\r\n\r\nsp", ["punctuation", "."], "s" +] diff --git a/tests/languages/qml/import_feature.test b/tests/languages/qml/import_feature.test index e0703f26c1..8b45d97e8a 100644 --- a/tests/languages/qml/import_feature.test +++ b/tests/languages/qml/import_feature.test @@ -7,13 +7,13 @@ import "componentCreation.js" as MyScript [ ["keyword", "import"], - " QtQuick 2.9\n", + " QtQuick 2.9\r\n", ["keyword", "import"], - " QtQml.Models 2.2\n", + " QtQml.Models 2.2\r\n", ["keyword", "import"], - " Person 1.0\n", + " Person 1.0\r\n", ["keyword", "import"], ["string", "\"componentCreation.js\""], diff --git a/tests/languages/qsharp/comments_feature.test b/tests/languages/qsharp/comments_feature.test new file mode 100644 index 0000000000..f9933ee4af --- /dev/null +++ b/tests/languages/qsharp/comments_feature.test @@ -0,0 +1,23 @@ +// The following using block creates a fresh qubit and initializes it +// in the |0> state. + +use qubit = Qubit(); + +---------------------------------------------------- + +[ + ["comment", "// The following using block creates a fresh qubit and initializes it"], + ["comment", "// in the |0> state."], + ["keyword", "use"], + " qubit ", + ["operator", "="], + ["keyword", "Qubit"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] +] + + +---------------------------------------------------- + +Checks for comments diff --git a/tests/languages/qsharp/if_with_function_feature.test b/tests/languages/qsharp/if_with_function_feature.test new file mode 100644 index 0000000000..b14475452e --- /dev/null +++ b/tests/languages/qsharp/if_with_function_feature.test @@ -0,0 +1,24 @@ +if result == One { + X(qubit); +} + +---------------------------------------------------- + +[ + ["keyword", "if"], + " result ", + ["operator", "=="], + ["keyword", "One"], + ["punctuation", "{"], + ["function", "X"], + ["punctuation", "("], + "qubit", + ["punctuation", ")"], + ["punctuation", ";"], + ["punctuation", "}"] +] + + +---------------------------------------------------- + +Checks for if, equality and function diff --git a/tests/languages/qsharp/keyword_feature.test b/tests/languages/qsharp/keyword_feature.test new file mode 100644 index 0000000000..ec67ccfcd2 --- /dev/null +++ b/tests/languages/qsharp/keyword_feature.test @@ -0,0 +1,129 @@ +// type +Adj +BigInt +Bool +Ctl +Double +false +Int +One +Pauli +PauliI +PauliX +PauliY +PauliZ +Qubit +Range +Result +String +true +Unit +Zero + +// other +Adjoint +adjoint +apply +as +auto +body +borrow +borrowing +Controlled +controlled +distribute +elif +else +fail +fixup +for +function +if +in +internal +intrinsic +invert +is +let +mutable +namespace +new +newtype +open +operation +repeat +return +self +set +until +use +using +while +within + +---------------------------------------------------- + +[ + ["comment", "// type"], + ["keyword", "Adj"], + ["keyword", "BigInt"], + ["keyword", "Bool"], + ["keyword", "Ctl"], + ["keyword", "Double"], + ["keyword", "false"], + ["keyword", "Int"], + ["keyword", "One"], + ["keyword", "Pauli"], + ["keyword", "PauliI"], + ["keyword", "PauliX"], + ["keyword", "PauliY"], + ["keyword", "PauliZ"], + ["keyword", "Qubit"], + ["keyword", "Range"], + ["keyword", "Result"], + ["keyword", "String"], + ["keyword", "true"], + ["keyword", "Unit"], + ["keyword", "Zero"], + + ["comment", "// other"], + ["keyword", "Adjoint"], + ["keyword", "adjoint"], + ["keyword", "apply"], + ["keyword", "as"], + ["keyword", "auto"], + ["keyword", "body"], + ["keyword", "borrow"], + ["keyword", "borrowing"], + ["keyword", "Controlled"], + ["keyword", "controlled"], + ["keyword", "distribute"], + ["keyword", "elif"], + ["keyword", "else"], + ["keyword", "fail"], + ["keyword", "fixup"], + ["keyword", "for"], + ["keyword", "function"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "internal"], + ["keyword", "intrinsic"], + ["keyword", "invert"], + ["keyword", "is"], + ["keyword", "let"], + ["keyword", "mutable"], + ["keyword", "namespace"], + ["keyword", "new"], + ["keyword", "newtype"], + ["keyword", "open"], + ["keyword", "operation"], + ["keyword", "repeat"], + ["keyword", "return"], + ["keyword", "self"], + ["keyword", "set"], + ["keyword", "until"], + ["keyword", "use"], + ["keyword", "using"], + ["keyword", "while"], + ["keyword", "within"] +] diff --git a/tests/languages/qsharp/namespace_feature.test b/tests/languages/qsharp/namespace_feature.test new file mode 100644 index 0000000000..eb66389776 --- /dev/null +++ b/tests/languages/qsharp/namespace_feature.test @@ -0,0 +1,30 @@ +namespace Quantum.App1 { + open Microsoft.Quantum.Canon; +} + +---------------------------------------------------- + +[ + ["keyword", "namespace"], + ["class-name", [ + "Quantum", + ["punctuation", "."], + "App1" + ]], + ["punctuation", "{"], + ["keyword", "open"], + ["class-name", [ + "Microsoft", + ["punctuation", "."], + "Quantum", + ["punctuation", "."], + "Canon" + ]], + ["punctuation", ";"], + ["punctuation", "}"] +] + + +---------------------------------------------------- + +Checks for namespace declaration and import diff --git a/tests/languages/qsharp/operators_feature.test b/tests/languages/qsharp/operators_feature.test new file mode 100644 index 0000000000..c73affac14 --- /dev/null +++ b/tests/languages/qsharp/operators_feature.test @@ -0,0 +1,32 @@ +and or not +and= or= +<- <= -> => +* / + - = ^ ! % +*= /= += -= == ^= != %= +>>> >>>= <<< <<<= +^^^ ^^^= +||| |||= +&&& &&&= +w/ w/= +~~~ + +---------------------------------------------------- + +[ + ["operator", "and"], ["operator", "or"], ["operator", "not"], + ["operator", "and="], ["operator", "or="], + ["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", "w/"], ["operator", "w/="], + ["operator", "~~~"] +] + + +---------------------------------------------------- + +Checks for opertors diff --git a/tests/languages/qsharp/string_feature.test b/tests/languages/qsharp/string_feature.test new file mode 100644 index 0000000000..146080fd29 --- /dev/null +++ b/tests/languages/qsharp/string_feature.test @@ -0,0 +1,39 @@ +"" +"foo" +"foo\"\n" + +$"" +$"foo" +$"\"" +$"foo{1+1}baz" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"foo\\\"\\n\""], + + ["interpolation-string", [ + ["string", "$\"\""] + ]], + ["interpolation-string", [ + ["string", "$\"foo\""] + ]], + ["interpolation-string", [ + ["string", "$\"\\\"\""] + ]], + ["interpolation-string", [ + ["string", "$\"foo"], + ["interpolation", [ + ["punctuation", "{"], + ["expression", [ + ["number", "1"], + ["operator", "+"], + ["number", "1"] + ]], + ["punctuation", "}"] + ]], + ["string", "baz\""] + ]] +] diff --git a/tests/languages/qsharp/variable_assignment_numbers_feature.test b/tests/languages/qsharp/variable_assignment_numbers_feature.test new file mode 100644 index 0000000000..5308b9a87a --- /dev/null +++ b/tests/languages/qsharp/variable_assignment_numbers_feature.test @@ -0,0 +1,30 @@ +let var1 = 3; +mutable var2 = 5L; +set var2 = var2 + 1.5; + +---------------------------------------------------- + +[ + ["keyword", "let"], + " var1 ", + ["operator", "="], + ["number", "3"], + ["punctuation", ";"], + ["keyword", "mutable"], + " var2 ", + ["operator", "="], + ["number", "5L"], + ["punctuation", ";"], + ["keyword", "set"], + " var2 ", + ["operator", "="], + " var2 ", + ["operator", "+"], + ["number", "1.5"], + ["punctuation", ";"] +] + + +---------------------------------------------------- + +Checks for variable assignment and numbers diff --git a/tests/languages/r/punctuation_feature.test b/tests/languages/r/punctuation_feature.test new file mode 100644 index 0000000000..4a7c5ff4c3 --- /dev/null +++ b/tests/languages/r/punctuation_feature.test @@ -0,0 +1,14 @@ +( ) { } [ ] , ; + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","], + ["punctuation", ";"] +] diff --git a/tests/languages/racket/char_feature.test b/tests/languages/racket/char_feature.test new file mode 100644 index 0000000000..1e92a056a5 --- /dev/null +++ b/tests/languages/racket/char_feature.test @@ -0,0 +1,41 @@ +#\a ; lowercase letter +#\A ; uppercase letter +#\( ; left parenthesis +#\space ; the space character +#\newline ; the newline character + +#\c-a ; Control-a +#\meta-b ; Meta-b +#\c-s-m-h-a ; Control-Meta-Super-Hyper-A + +#\; #\' #\" + +#\u0041 +#\x10FFFF +#\λ +#\) + +---------------------------------------------------- + +[ + ["char", "#\\a"], ["comment", "; lowercase letter"], + ["char", "#\\A"], ["comment", "; uppercase letter"], + ["char", "#\\("], ["comment", "; left parenthesis"], + ["char", "#\\space"], ["comment", "; the space character"], + ["char", "#\\newline"], ["comment", "; the newline character"], + + ["char", "#\\c-a"], ["comment", "; Control-a"], + ["char", "#\\meta-b"], ["comment", "; Meta-b"], + ["char", "#\\c-s-m-h-a"], ["comment", "; Control-Meta-Super-Hyper-A"], + + ["char", "#\\;"], ["char", "#\\'"], ["char", "#\\\""], + + ["char", "#\\u0041"], + ["char", "#\\x10FFFF"], + ["char", "#\\λ"], + ["char", "#\\)"] +] + +---------------------------------------------------- + +Checks for character literals. diff --git a/tests/languages/racket/character_feature.test b/tests/languages/racket/character_feature.test deleted file mode 100644 index f95cb705bf..0000000000 --- a/tests/languages/racket/character_feature.test +++ /dev/null @@ -1,51 +0,0 @@ -#\a ; lowercase letter -#\A ; uppercase letter -#\( ; left parenthesis -#\space ; the space character -#\newline ; the newline character - -#\c-a ; Control-a -#\meta-b ; Meta-b -#\c-s-m-h-a ; Control-Meta-Super-Hyper-A - -#\; #\' #\" - -#\u0041 -#\x10FFFF -#\λ -#\) - ----------------------------------------------------- - -[ - ["character", "#\\a"], - ["comment", "; lowercase letter"], - ["character", "#\\A"], - ["comment", "; uppercase letter"], - ["character", "#\\("], - ["comment", "; left parenthesis"], - ["character", "#\\space"], - ["comment", "; the space character"], - ["character", "#\\newline"], - ["comment", "; the newline character"], - - ["character", "#\\c-a"], - ["comment", "; Control-a"], - ["character", "#\\meta-b"], - ["comment", "; Meta-b"], - ["character", "#\\c-s-m-h-a"], - ["comment", "; Control-Meta-Super-Hyper-A"], - - ["character", "#\\;"], - ["character", "#\\'"], - ["character", "#\\\""], - - ["character", "#\\u0041"], - ["character", "#\\x10FFFF"], - ["character", "#\\λ"], - ["character", "#\\)"] -] - ----------------------------------------------------- - -Checks for character literals. diff --git a/tests/languages/racket/function_feature.test b/tests/languages/racket/function_feature.test index 4911b747fb..9dd606246a 100644 --- a/tests/languages/racket/function_feature.test +++ b/tests/languages/racket/function_feature.test @@ -1,20 +1,16 @@ (fl= 1 2) (flmin 2 3) -(exact? 2) (inexact->exact 3) (!fact) (** 10) -(exact? (** (defined foo) [fl= 1 2] [flmin 2 3] -[exact? 2] [inexact->exact 3] [!fact] [** 10] -[exact? [** [defined foo] @@ -23,21 +19,17 @@ [ ["punctuation", "("], ["function", "fl="], ["number", "1"], ["number", "2"], ["punctuation", ")"], ["punctuation", "("], ["function", "flmin"], ["number", "2"], ["number", "3"], ["punctuation", ")"], - ["punctuation", "("], ["function", "exact?"], ["number", "2"], ["punctuation", ")"], ["punctuation", "("], ["function", "inexact->exact"], ["number", "3"], ["punctuation", ")"], ["punctuation", "("], ["function", "!fact"], ["punctuation", ")"], ["punctuation", "("], ["function", "**"], ["number", "10"], ["punctuation", ")"], - ["punctuation", "("], ["function", "exact?"], ["punctuation", "("], ["function", "**"], ["punctuation", "("], ["function", "defined"], " foo", ["punctuation", ")"], ["punctuation", "["], ["function", "fl="], ["number", "1"], ["number", "2"], ["punctuation", "]"], ["punctuation", "["], ["function", "flmin"], ["number", "2"], ["number", "3"], ["punctuation", "]"], - ["punctuation", "["], ["function", "exact?"], ["number", "2"], ["punctuation", "]"], ["punctuation", "["], ["function", "inexact->exact"], ["number", "3"], ["punctuation", "]"], ["punctuation", "["], ["function", "!fact"], ["punctuation", "]"], ["punctuation", "["], ["function", "**"], ["number", "10"], ["punctuation", "]"], - ["punctuation", "["], ["function", "exact?"], ["punctuation", "["], ["function", "**"], ["punctuation", "["], ["function", "defined"], " foo", ["punctuation", "]"] ] diff --git a/tests/languages/racket/identifier_feature.test b/tests/languages/racket/identifier_feature.test new file mode 100644 index 0000000000..e57533ce55 --- /dev/null +++ b/tests/languages/racket/identifier_feature.test @@ -0,0 +1,7 @@ +|\x9;\x9;| + +---------------------------------------------------- + +[ + ["identifier", "|\\x9;\\x9;|"] +] diff --git a/tests/languages/racket/number_feature.test b/tests/languages/racket/number_feature.test index 9a517e1a02..01b699fbca 100644 --- a/tests/languages/racket/number_feature.test +++ b/tests/languages/racket/number_feature.test @@ -1,15 +1,21 @@ +123 + (foo 42 +42 -42) (foo 1e3 +1e3 -1e3) (foo 1e+3 1e-3 3.14159 3.14159e-1) (foo 8/3) (foo 3+4i 2.5+0.0i 2.5+0.0i -2.5e4+0.0e4i 3+0i -2e-5i) -(list 10i +10i -10i 10.10i 10+10i 10.10+10.10i 10-10i 10e+10i 10+10e+10i) +(list +10i -10i 10+10i 10.10+10.10i 10-10i 10+10e+10i) (list #d123 #e#d123e-4 #d#i12 #i-1.234i) (list #xBAD #b1110011 #o777) (list #i#x10 #i#x10+10i #b10+10i) +10+i +10+.1i +10+1.i + ; not a number but a symbol (define 1+2 10) @@ -19,6 +25,8 @@ ---------------------------------------------------- [ + ["number", "123"], + ["punctuation", "("], ["function", "foo"], ["number", "42"], @@ -58,14 +66,11 @@ ["punctuation", "("], ["builtin", "list"], - ["number", "10i"], ["number", "+10i"], ["number", "-10i"], - ["number", "10.10i"], ["number", "10+10i"], ["number", "10.10+10.10i"], ["number", "10-10i"], - ["number", "10e+10i"], ["number", "10+10e+10i"], ["punctuation", ")"], @@ -91,8 +96,16 @@ ["number", "#b10+10i"], ["punctuation", ")"], + ["number", "10+i"], + ["number", "10+.1i"], + ["number", "10+1.i"], + ["comment", "; not a number but a symbol"], - ["punctuation", "("], ["keyword", "define"], " 1+2 ", ["number", "10"], ["punctuation", ")"], + ["punctuation", "("], + ["keyword", "define"], + " 1+2 ", + ["number", "10"], + ["punctuation", ")"], ["punctuation", "["], ["function", "foo"], diff --git a/tests/languages/reason/char_feature.test b/tests/languages/reason/char_feature.test new file mode 100644 index 0000000000..244b0765b4 --- /dev/null +++ b/tests/languages/reason/char_feature.test @@ -0,0 +1,19 @@ +'a' +'\'' +'\\' +'\xff' +'\o214' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\''"], + ["char", "'\\\\'"], + ["char", "'\\xff'"], + ["char", "'\\o214'"] +] + +---------------------------------------------------- + +Checks for characters. diff --git a/tests/languages/reason/character_feature.test b/tests/languages/reason/character_feature.test deleted file mode 100644 index 8b9de3ecdc..0000000000 --- a/tests/languages/reason/character_feature.test +++ /dev/null @@ -1,19 +0,0 @@ -'a' -'\'' -'\\' -'\xff' -'\o214' - ----------------------------------------------------- - -[ - ["character", "'a'"], - ["character", "'\\''"], - ["character", "'\\\\'"], - ["character", "'\\xff'"], - ["character", "'\\o214'"] -] - ----------------------------------------------------- - -Checks for characters. \ No newline at end of file diff --git a/tests/languages/regex/char-class_feature.test b/tests/languages/regex/char-class_feature.test new file mode 100644 index 0000000000..1c278a5279 --- /dev/null +++ b/tests/languages/regex/char-class_feature.test @@ -0,0 +1,48 @@ +[] +[^] +[foo] +[\]\b] +[.^$\1] +[\d\D\p{L}] + +---------------------------------------------------- + +[ + ["char-class", [ + ["char-class-punctuation", "["], + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + ["char-class-negation", "^"], + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + "foo", + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + ["special-escape", "\\]"], + ["escape", "\\b"], + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + ".^$", + ["escape", "\\1"], + ["char-class-punctuation", "]"] + ]], + ["char-class", [ + ["char-class-punctuation", "["], + ["char-set", "\\d"], + ["char-set", "\\D"], + ["char-set", "\\p{L}"], + ["char-class-punctuation", "]"] + ]] +] + +---------------------------------------------------- + +Checks for character sets. diff --git a/tests/languages/regex/char-set_feature.test b/tests/languages/regex/char-set_feature.test new file mode 100644 index 0000000000..6ea56ddcda --- /dev/null +++ b/tests/languages/regex/char-set_feature.test @@ -0,0 +1,21 @@ +. +\w \W +\s \S +\d \D +\p{ASCII} +\P{ASCII} + +---------------------------------------------------- + +[ + ["char-set", "."], + ["char-set", "\\w"], ["char-set", "\\W"], + ["char-set", "\\s"], ["char-set", "\\S"], + ["char-set", "\\d"], ["char-set", "\\D"], + ["char-set", "\\p{ASCII}"], + ["char-set", "\\P{ASCII}"] +] + +---------------------------------------------------- + +Checks for character classes. diff --git a/tests/languages/regex/charclass_feature.test b/tests/languages/regex/charclass_feature.test deleted file mode 100644 index 4a045fa75c..0000000000 --- a/tests/languages/regex/charclass_feature.test +++ /dev/null @@ -1,25 +0,0 @@ -. -\w \W -\s \S -\d \D -\p{ASCII} -\P{ASCII} - ----------------------------------------------------- - -[ - ["charclass", "."], - ["charclass", "\\w"], - ["charclass", "\\W"], - ["charclass", "\\s"], - ["charclass", "\\S"], - ["charclass", "\\d"], - ["charclass", "\\D"], - - ["charclass", "\\p{ASCII}"], - ["charclass", "\\P{ASCII}"] -] - ----------------------------------------------------- - -Checks for character classes. diff --git a/tests/languages/regex/charset_feature.test b/tests/languages/regex/charset_feature.test deleted file mode 100644 index 317216e2de..0000000000 --- a/tests/languages/regex/charset_feature.test +++ /dev/null @@ -1,44 +0,0 @@ -[] -[^] -[foo] -[\]\b] -[.^$\1] - ----------------------------------------------------- - -[ - ["charset", [ - ["charset-punctuation", "["], - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - ["charset-negation", "^"], - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - "foo", - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - ["special-escape", "\\]"], - ["escape", "\\b"], - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - ".^$", - ["escape", "\\1"], - ["charset-punctuation", "]"] - ]] -] - ----------------------------------------------------- - -Checks for character sets. diff --git a/tests/languages/regex/range_feature.test b/tests/languages/regex/range_feature.test index 6de46ddbe8..fc1fb68067 100644 --- a/tests/languages/regex/range_feature.test +++ b/tests/languages/regex/range_feature.test @@ -5,8 +5,8 @@ ---------------------------------------------------- [ - ["charset", [ - ["charset-punctuation", "["], + ["char-class", [ + ["char-class-punctuation", "["], ["range", [ "a", ["range-punctuation", "-"], @@ -22,11 +22,10 @@ ["range-punctuation", "-"], "9" ]], - ["charset-punctuation", "]"] + ["char-class-punctuation", "]"] ]], - - ["charset", [ - ["charset-punctuation", "["], + ["char-class", [ + ["char-class-punctuation", "["], ["range", [ ["escape", "\\xa1"], ["range-punctuation", "-"], @@ -37,14 +36,13 @@ ["range-punctuation", "-"], ["escape", "\\u{256}"] ]], - ["charset-punctuation", "]"] + ["char-class-punctuation", "]"] ]], - - ["charset", [ - ["charset-punctuation", "["], - ["charset-negation", "^"], + ["char-class", [ + ["char-class-punctuation", "["], + ["char-class-negation", "^"], "-aaa-", - ["charset-punctuation", "]"] + ["char-class-punctuation", "]"] ]] ] diff --git a/tests/languages/rego/boolean_feature.test b/tests/languages/rego/boolean_feature.test new file mode 100644 index 0000000000..f1ddac690c --- /dev/null +++ b/tests/languages/rego/boolean_feature.test @@ -0,0 +1,13 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] + +---------------------------------------------------- + +Checks for booleans. diff --git a/tests/languages/php/shell-comment_feature.test b/tests/languages/rego/comment_feature.test similarity index 55% rename from tests/languages/php/shell-comment_feature.test rename to tests/languages/rego/comment_feature.test index a1f077c8c7..054d6023d1 100644 --- a/tests/languages/php/shell-comment_feature.test +++ b/tests/languages/rego/comment_feature.test @@ -4,10 +4,10 @@ ---------------------------------------------------- [ - ["shell-comment", "#"], - ["shell-comment", "# foobar"] + ["comment", "#"], + ["comment", "# foobar"] ] ---------------------------------------------------- -Checks for shell-like comments. \ No newline at end of file +Checks for comments. \ No newline at end of file diff --git a/tests/languages/rego/function_feature.test b/tests/languages/rego/function_feature.test new file mode 100644 index 0000000000..96a66aacb8 --- /dev/null +++ b/tests/languages/rego/function_feature.test @@ -0,0 +1,173 @@ +object.remove({"a": {"b": {"c": 2}}, "x": 123}, {"a": 1}) == {"x": 123} + +output := is_set(x) +output := intersection(set[set]) +output := regex.match(pattern, value) +output := glob.match("*.github.com", [], "api.github.com") +output := bits.rsh(x, s) +output := io.jwt.verify_ps384(string, certificate) + +io.jwt.encode_sign({ + "typ": "JWT", + "alg": "HS256"}, + {}, { + "kty": "oct", + "k": "AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow" +}) + +---------------------------------------------------- + +[ + ["function", [ + ["namespace", "object"], + ["punctuation", "."], + "remove" + ]], + ["punctuation", "("], + ["punctuation", "{"], + ["property", "\"a\""], + ["operator", ":"], + ["punctuation", "{"], + ["property", "\"b\""], + ["operator", ":"], + ["punctuation", "{"], + ["property", "\"c\""], + ["operator", ":"], + ["number", "2"], + ["punctuation", "}"], + ["punctuation", "}"], + ["punctuation", ","], + ["property", "\"x\""], + ["operator", ":"], + ["number", "123"], + ["punctuation", "}"], + ["punctuation", ","], + ["punctuation", "{"], + ["property", "\"a\""], + ["operator", ":"], + ["number", "1"], + ["punctuation", "}"], + ["punctuation", ")"], + ["operator", "=="], + ["punctuation", "{"], + ["property", "\"x\""], + ["operator", ":"], + ["number", "123"], + ["punctuation", "}"], + + "\r\n\r\noutput ", + ["operator", ":="], + ["function", ["is_set"]], + ["punctuation", "("], + "x", + ["punctuation", ")"], + + "\r\noutput ", + ["operator", ":="], + ["function", ["intersection"]], + ["punctuation", "("], + "set", + ["punctuation", "["], + "set", + ["punctuation", "]"], + ["punctuation", ")"], + + "\r\noutput ", + ["operator", ":="], + ["function", [ + ["namespace", "regex"], + ["punctuation", "."], + "match" + ]], + ["punctuation", "("], + "pattern", + ["punctuation", ","], + " value", + ["punctuation", ")"], + + "\r\noutput ", + ["operator", ":="], + ["function", [ + ["namespace", "glob"], + ["punctuation", "."], + "match" + ]], + ["punctuation", "("], + ["string", "\"*.github.com\""], + ["punctuation", ","], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","], + ["string", "\"api.github.com\""], + ["punctuation", ")"], + + "\r\noutput ", + ["operator", ":="], + ["function", [ + ["namespace", "bits"], + ["punctuation", "."], + "rsh" + ]], + ["punctuation", "("], + "x", + ["punctuation", ","], + " s", + ["punctuation", ")"], + + "\r\noutput ", + ["operator", ":="], + ["function", [ + ["namespace", "io"], + ["punctuation", "."], + ["namespace", "jwt"], + ["punctuation", "."], + "verify_ps384" + ]], + ["punctuation", "("], + "string", + ["punctuation", ","], + " certificate", + ["punctuation", ")"], + + ["function", [ + ["namespace", "io"], + ["punctuation", "."], + ["namespace", "jwt"], + ["punctuation", "."], + "encode_sign" + ]], + ["punctuation", "("], + ["punctuation", "{"], + + ["property", "\"typ\""], + ["operator", ":"], + ["string", "\"JWT\""], + ["punctuation", ","], + + ["property", "\"alg\""], + ["operator", ":"], + ["string", "\"HS256\""], + ["punctuation", "}"], + ["punctuation", ","], + + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["punctuation", "{"], + + ["property", "\"kty\""], + ["operator", ":"], + ["string", "\"oct\""], + ["punctuation", ","], + + ["property", "\"k\""], + ["operator", ":"], + ["string", "\"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow\""], + + ["punctuation", "}"], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for all functions. diff --git a/tests/languages/rego/keyword_feature.test b/tests/languages/rego/keyword_feature.test new file mode 100644 index 0000000000..5a8e3faac6 --- /dev/null +++ b/tests/languages/rego/keyword_feature.test @@ -0,0 +1,31 @@ +as +default +else +import +package +not +null +some +with + +set() + +---------------------------------------------------- + +[ + ["keyword", "as"], + ["keyword", "default"], + ["keyword", "else"], + ["keyword", "import"], + ["keyword", "package"], + ["keyword", "not"], + ["keyword", "null"], + ["keyword", "some"], + ["keyword", "with"], + + ["keyword", "set"], ["punctuation", "("], ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/rego/number_feature.test b/tests/languages/rego/number_feature.test new file mode 100644 index 0000000000..1643b010d4 --- /dev/null +++ b/tests/languages/rego/number_feature.test @@ -0,0 +1,23 @@ +0 +123 +3.14159 +5.0e8 +0.2E+2 +47e-5 +-1.23 +-2.34E33 +-4.34E-33 + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"], + ["number", "3.14159"], + ["number", "5.0e8"], + ["number", "0.2E+2"], + ["number", "47e-5"], + ["number", "-1.23"], + ["number", "-2.34E33"], + ["number", "-4.34E-33"] +] diff --git a/tests/languages/rego/operator_feature.test b/tests/languages/rego/operator_feature.test new file mode 100644 index 0000000000..4cd86375cd --- /dev/null +++ b/tests/languages/rego/operator_feature.test @@ -0,0 +1,35 @@ +:= = : +== != < <= > >= ++ - / * % +& | +_ + +---------------------------------------------------- + +[ + ["operator", ":="], + ["operator", "="], + ["operator", ":"], + + ["operator", "=="], + ["operator", "!="], + ["operator", "<"], + ["operator", "<="], + ["operator", ">"], + ["operator", ">="], + + ["operator", "+"], + ["operator", "-"], + ["operator", "/"], + ["operator", "*"], + ["operator", "%"], + + ["operator", "&"], + ["operator", "|"], + + ["operator", "_"] +] + +---------------------------------------------------- + +Checks for operators. diff --git a/tests/languages/rego/property_feature.test b/tests/languages/rego/property_feature.test new file mode 100644 index 0000000000..b9a1ffdb94 --- /dev/null +++ b/tests/languages/rego/property_feature.test @@ -0,0 +1,208 @@ +instances[instance] { + server := sites[_].servers[_] + instance := {"address": server.hostname, "name": server.name} +} { + container := containers[_] + instance := {"address": container.ipaddress, "name": container.name} +} + +apps := [ + { + "name": "web", + "servers": ["web-0", "web-1", "web-1000", "web-1001", "web-dev"] + }, + { + "name": "mysql", + "servers": ["db-0", "db-1000"] + }, + { + "name": "mongodb", + "servers": ["db-dev"] + } +] + +not allow with input as {"user": "charlie", "method": "GET"} with data.roles as {"dev": ["bob"]} + +allow with input as {"user": "charlie", "method": "GET"} with data.roles as {"dev": ["charlie"]} + +---------------------------------------------------- + +[ + "instances", + ["punctuation", "["], + "instance", + ["punctuation", "]"], + ["punctuation", "{"], + + "\r\n server ", + ["operator", ":="], + " sites", + ["punctuation", "["], + ["operator", "_"], + ["punctuation", "]"], + ["punctuation", "."], + "servers", + ["punctuation", "["], + ["operator", "_"], + ["punctuation", "]"], + + "\r\n instance ", + ["operator", ":="], + ["punctuation", "{"], + ["property", "\"address\""], + ["operator", ":"], + " server", + ["punctuation", "."], + "hostname", + ["punctuation", ","], + ["property", "\"name\""], + ["operator", ":"], + " server", + ["punctuation", "."], + "name", + ["punctuation", "}"], + + ["punctuation", "}"], + ["punctuation", "{"], + + "\r\n container ", + ["operator", ":="], + " containers", + ["punctuation", "["], + ["operator", "_"], + ["punctuation", "]"], + + "\r\n instance ", + ["operator", ":="], + ["punctuation", "{"], + ["property", "\"address\""], + ["operator", ":"], + " container", + ["punctuation", "."], + "ipaddress", + ["punctuation", ","], + ["property", "\"name\""], + ["operator", ":"], + " container", + ["punctuation", "."], + "name", + ["punctuation", "}"], + + ["punctuation", "}"], + + "\r\n\r\napps ", + ["operator", ":="], + ["punctuation", "["], + + ["punctuation", "{"], + + ["property", "\"name\""], + ["operator", ":"], + ["string", "\"web\""], + ["punctuation", ","], + + ["property", "\"servers\""], + ["operator", ":"], + ["punctuation", "["], + ["string", "\"web-0\""], + ["punctuation", ","], + ["string", "\"web-1\""], + ["punctuation", ","], + ["string", "\"web-1000\""], + ["punctuation", ","], + ["string", "\"web-1001\""], + ["punctuation", ","], + ["string", "\"web-dev\""], + ["punctuation", "]"], + + ["punctuation", "}"], + ["punctuation", ","], + + ["punctuation", "{"], + + ["property", "\"name\""], + ["operator", ":"], + ["string", "\"mysql\""], + ["punctuation", ","], + + ["property", "\"servers\""], + ["operator", ":"], + ["punctuation", "["], + ["string", "\"db-0\""], + ["punctuation", ","], + ["string", "\"db-1000\""], + ["punctuation", "]"], + + ["punctuation", "}"], + ["punctuation", ","], + + ["punctuation", "{"], + + ["property", "\"name\""], + ["operator", ":"], + ["string", "\"mongodb\""], + ["punctuation", ","], + + ["property", "\"servers\""], + ["operator", ":"], + ["punctuation", "["], + ["string", "\"db-dev\""], + ["punctuation", "]"], + + ["punctuation", "}"], + + ["punctuation", "]"], + + ["keyword", "not"], + " allow ", + ["keyword", "with"], + " input ", + ["keyword", "as"], + ["punctuation", "{"], + ["property", "\"user\""], + ["operator", ":"], + ["string", "\"charlie\""], + ["punctuation", ","], + ["property", "\"method\""], + ["operator", ":"], + ["string", "\"GET\""], + ["punctuation", "}"], + ["keyword", "with"], + " data", + ["punctuation", "."], + "roles ", + ["keyword", "as"], + ["punctuation", "{"], + ["property", "\"dev\""], + ["operator", ":"], + ["punctuation", "["], + ["string", "\"bob\""], + ["punctuation", "]"], + ["punctuation", "}"], + + "\r\n\r\nallow ", + ["keyword", "with"], + " input ", + ["keyword", "as"], + ["punctuation", "{"], + ["property", "\"user\""], + ["operator", ":"], + ["string", "\"charlie\""], + ["punctuation", ","], + ["property", "\"method\""], + ["operator", ":"], + ["string", "\"GET\""], + ["punctuation", "}"], + ["keyword", "with"], + " data", + ["punctuation", "."], + "roles ", + ["keyword", "as"], + ["punctuation", "{"], + ["property", "\"dev\""], + ["operator", ":"], + ["punctuation", "["], + ["string", "\"charlie\""], + ["punctuation", "]"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/rego/punctuation_feature.test b/tests/languages/rego/punctuation_feature.test new file mode 100644 index 0000000000..f2b4f4ccf2 --- /dev/null +++ b/tests/languages/rego/punctuation_feature.test @@ -0,0 +1,17 @@ +, ; . +( ) [ ] { } + +---------------------------------------------------- + +[ + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/rego/string_feature.test b/tests/languages/rego/string_feature.test new file mode 100644 index 0000000000..4773a0a36d --- /dev/null +++ b/tests/languages/rego/string_feature.test @@ -0,0 +1,43 @@ +"" +"foo\"bar" +`raw-string` + +jwks = `{ + "keys": [{ + "kty":"EC", + "crv":"P-256", + "x":"z8J91ghFy5o6f2xZ4g8LsLH7u2wEpT2ntj8loahnlsE", + "y":"7bdeXLH61KrGWRdh7ilnbcGQACxykaPKfmBccTHIOUo" + }] +}` + +cert = `-----BEGIN CERTIFICATE----- +MIIBcDCCARagAwIBAgIJAMZmuGSIfvgzMAoGCCqGSM49BAMCMBMxETAPBgNVBAMM +CHdoYXRldmVyMB4XDTE4MDgxMDE0Mjg1NFoXDTE4MDkwOTE0Mjg1NFowEzERMA8G +A1UEAwwId2hhdGV2ZXIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATPwn3WCEXL +mjp/bFniDwuwsfu7bASlPae2PyWhqGeWwe23Xlyx+tSqxlkXYe4pZ23BkAAscpGj +yn5gXHExyDlKo1MwUTAdBgNVHQ4EFgQUElRjSoVgKjUqY5AXz2o74cLzzS8wHwYD +VR0jBBgwFoAUElRjSoVgKjUqY5AXz2o74cLzzS8wDwYDVR0TAQH/BAUwAwEB/zAK +BggqhkjOPQQDAgNIADBFAiEA4yQ/88ZrUX68c6kOe9G11u8NUaUzd8pLOtkKhniN +OHoCIHmNX37JOqTcTzGn2u9+c8NlnvZ0uDvsd1BmKPaUmjmm +-----END CERTIFICATE-----` + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\\\"bar\""], + ["string", "`raw-string`"], + + "\r\n\r\njwks ", + ["operator", "="], + ["string", "`{\r\n \"keys\": [{\r\n \"kty\":\"EC\",\r\n \"crv\":\"P-256\",\r\n \"x\":\"z8J91ghFy5o6f2xZ4g8LsLH7u2wEpT2ntj8loahnlsE\",\r\n \"y\":\"7bdeXLH61KrGWRdh7ilnbcGQACxykaPKfmBccTHIOUo\"\r\n }]\r\n}`"], + + "\r\n\r\ncert ", + ["operator", "="], + ["string", "`-----BEGIN CERTIFICATE-----\r\nMIIBcDCCARagAwIBAgIJAMZmuGSIfvgzMAoGCCqGSM49BAMCMBMxETAPBgNVBAMM\r\nCHdoYXRldmVyMB4XDTE4MDgxMDE0Mjg1NFoXDTE4MDkwOTE0Mjg1NFowEzERMA8G\r\nA1UEAwwId2hhdGV2ZXIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATPwn3WCEXL\r\nmjp/bFniDwuwsfu7bASlPae2PyWhqGeWwe23Xlyx+tSqxlkXYe4pZ23BkAAscpGj\r\nyn5gXHExyDlKo1MwUTAdBgNVHQ4EFgQUElRjSoVgKjUqY5AXz2o74cLzzS8wHwYD\r\nVR0jBBgwFoAUElRjSoVgKjUqY5AXz2o74cLzzS8wDwYDVR0TAQH/BAUwAwEB/zAK\r\nBggqhkjOPQQDAgNIADBFAiEA4yQ/88ZrUX68c6kOe9G11u8NUaUzd8pLOtkKhniN\r\nOHoCIHmNX37JOqTcTzGn2u9+c8NlnvZ0uDvsd1BmKPaUmjmm\r\n-----END CERTIFICATE-----`"] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/renpy/boolean_feature.test b/tests/languages/renpy/boolean_feature.test new file mode 100644 index 0000000000..30c2be15d9 --- /dev/null +++ b/tests/languages/renpy/boolean_feature.test @@ -0,0 +1,9 @@ +true false +True False + +---------------------------------------------------- + +[ + ["boolean", "true"], ["boolean", "false"], + ["boolean", "True"], ["boolean", "False"] +] diff --git a/tests/languages/renpy/comment_feature.test b/tests/languages/renpy/comment_feature.test new file mode 100644 index 0000000000..7883a734b3 --- /dev/null +++ b/tests/languages/renpy/comment_feature.test @@ -0,0 +1,7 @@ +# comment + +---------------------------------------------------- + +[ + ["comment", "# comment"] +] diff --git a/tests/languages/renpy/function_feature.test b/tests/languages/renpy/function_feature.test new file mode 100644 index 0000000000..3ec94de787 --- /dev/null +++ b/tests/languages/renpy/function_feature.test @@ -0,0 +1,43 @@ +renpy.register_bmfont("bmfont", 22, filename="bmfont.fnt") + +# Resize the background of the text window if it's too small. +init python: + style.window.background = Frame("frame.png", 10, 10) + +---------------------------------------------------- + +[ + ["keyword", "renpy"], + ["punctuation", "."], + ["function", "register_bmfont"], + ["punctuation", "("], + ["string", "\"bmfont\""], + ["punctuation", ","], + ["number", "22"], + ["punctuation", ","], + " filename", + ["operator", "="], + ["string", "\"bmfont.fnt\""], + ["punctuation", ")"], + + ["comment", "# Resize the background of the text window if it's too small."], + + ["keyword", "init"], + ["keyword", "python"], + ["punctuation", ":"], + + ["keyword", "style"], + ["punctuation", "."], + ["tag", "window"], + ["punctuation", "."], + ["property", "background"], + ["operator", "="], + ["function", "Frame"], + ["punctuation", "("], + ["string", "\"frame.png\""], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ")"] +] diff --git a/tests/languages/renpy/keyword_feature.test b/tests/languages/renpy/keyword_feature.test new file mode 100644 index 0000000000..410cacf4ca --- /dev/null +++ b/tests/languages/renpy/keyword_feature.test @@ -0,0 +1,239 @@ +; None +; add +; adjustment +; alignaround +; allow +; angle +; animation +; around +; as +; assert +; behind +; box_layout +; break +; build +; cache +; call +; center +; changed +; child_size +; choice +; circles +; class +; clear +; clicked +; clipping +; clockwise +; config +; contains +; continue +; corner1 +; corner2 +; counterclockwise +; def +; default +; define +; del +; delay +; disabled +; disabled_text +; dissolve +; elif +; else +; event +; except +; exclude +; exec +; expression +; fade +; finally +; for +; from +; function +; global +; gm_root +; has +; hide +; id +; if +; import +; in +; init +; is +; jump +; knot +; lambda +; left +; less_rounded +; mm_root +; movie +; music +; null +; on +; onlayer +; pass +; pause +; persistent +; play +; print +; python +; queue +; raise +; random +; renpy +; repeat +; return +; right +; rounded_window +; scene +; scope +; set +; show +; slow +; slow_abortable +; slow_done +; sound +; stop +; store +; style +; style_group +; substitute +; suffix +; theme +; transform +; transform_anchor +; transpose +; try +; ui +; unhovered +; updater +; use +; voice +; while +; widget +; widget_hover +; widget_selected +; widget_text +; yield + +---------------------------------------------------- + +[ + ["punctuation", ";"], ["keyword", "None"], + ["punctuation", ";"], ["keyword", "add"], + ["punctuation", ";"], ["keyword", "adjustment"], + ["punctuation", ";"], ["keyword", "alignaround"], + ["punctuation", ";"], ["keyword", "allow"], + ["punctuation", ";"], ["keyword", "angle"], + ["punctuation", ";"], ["keyword", "animation"], + ["punctuation", ";"], ["keyword", "around"], + ["punctuation", ";"], ["keyword", "as"], + ["punctuation", ";"], ["keyword", "assert"], + ["punctuation", ";"], ["keyword", "behind"], + ["punctuation", ";"], ["keyword", "box_layout"], + ["punctuation", ";"], ["keyword", "break"], + ["punctuation", ";"], ["keyword", "build"], + ["punctuation", ";"], ["keyword", "cache"], + ["punctuation", ";"], ["keyword", "call"], + ["punctuation", ";"], ["keyword", "center"], + ["punctuation", ";"], ["keyword", "changed"], + ["punctuation", ";"], ["keyword", "child_size"], + ["punctuation", ";"], ["keyword", "choice"], + ["punctuation", ";"], ["keyword", "circles"], + ["punctuation", ";"], ["keyword", "class"], + ["punctuation", ";"], ["keyword", "clear"], + ["punctuation", ";"], ["keyword", "clicked"], + ["punctuation", ";"], ["keyword", "clipping"], + ["punctuation", ";"], ["keyword", "clockwise"], + ["punctuation", ";"], ["keyword", "config"], + ["punctuation", ";"], ["keyword", "contains"], + ["punctuation", ";"], ["keyword", "continue"], + ["punctuation", ";"], ["keyword", "corner1"], + ["punctuation", ";"], ["keyword", "corner2"], + ["punctuation", ";"], ["keyword", "counterclockwise"], + ["punctuation", ";"], ["keyword", "def"], + ["punctuation", ";"], ["keyword", "default"], + ["punctuation", ";"], ["keyword", "define"], + ["punctuation", ";"], ["keyword", "del"], + ["punctuation", ";"], ["keyword", "delay"], + ["punctuation", ";"], ["keyword", "disabled"], + ["punctuation", ";"], ["keyword", "disabled_text"], + ["punctuation", ";"], ["keyword", "dissolve"], + ["punctuation", ";"], ["keyword", "elif"], + ["punctuation", ";"], ["keyword", "else"], + ["punctuation", ";"], ["keyword", "event"], + ["punctuation", ";"], ["keyword", "except"], + ["punctuation", ";"], ["keyword", "exclude"], + ["punctuation", ";"], ["keyword", "exec"], + ["punctuation", ";"], ["keyword", "expression"], + ["punctuation", ";"], ["keyword", "fade"], + ["punctuation", ";"], ["keyword", "finally"], + ["punctuation", ";"], ["keyword", "for"], + ["punctuation", ";"], ["keyword", "from"], + ["punctuation", ";"], ["keyword", "function"], + ["punctuation", ";"], ["keyword", "global"], + ["punctuation", ";"], ["keyword", "gm_root"], + ["punctuation", ";"], ["keyword", "has"], + ["punctuation", ";"], ["keyword", "hide"], + ["punctuation", ";"], ["keyword", "id"], + ["punctuation", ";"], ["keyword", "if"], + ["punctuation", ";"], ["keyword", "import"], + ["punctuation", ";"], ["keyword", "in"], + ["punctuation", ";"], ["keyword", "init"], + ["punctuation", ";"], ["keyword", "is"], + ["punctuation", ";"], ["keyword", "jump"], + ["punctuation", ";"], ["keyword", "knot"], + ["punctuation", ";"], ["keyword", "lambda"], + ["punctuation", ";"], ["keyword", "left"], + ["punctuation", ";"], ["keyword", "less_rounded"], + ["punctuation", ";"], ["keyword", "mm_root"], + ["punctuation", ";"], ["keyword", "movie"], + ["punctuation", ";"], ["keyword", "music"], + ["punctuation", ";"], ["keyword", "null"], + ["punctuation", ";"], ["keyword", "on"], + ["punctuation", ";"], ["keyword", "onlayer"], + ["punctuation", ";"], ["keyword", "pass"], + ["punctuation", ";"], ["keyword", "pause"], + ["punctuation", ";"], ["keyword", "persistent"], + ["punctuation", ";"], ["keyword", "play"], + ["punctuation", ";"], ["keyword", "print"], + ["punctuation", ";"], ["keyword", "python"], + ["punctuation", ";"], ["keyword", "queue"], + ["punctuation", ";"], ["keyword", "raise"], + ["punctuation", ";"], ["keyword", "random"], + ["punctuation", ";"], ["keyword", "renpy"], + ["punctuation", ";"], ["keyword", "repeat"], + ["punctuation", ";"], ["keyword", "return"], + ["punctuation", ";"], ["keyword", "right"], + ["punctuation", ";"], ["keyword", "rounded_window"], + ["punctuation", ";"], ["keyword", "scene"], + ["punctuation", ";"], ["keyword", "scope"], + ["punctuation", ";"], ["keyword", "set"], + ["punctuation", ";"], ["keyword", "show"], + ["punctuation", ";"], ["keyword", "slow"], + ["punctuation", ";"], ["keyword", "slow_abortable"], + ["punctuation", ";"], ["keyword", "slow_done"], + ["punctuation", ";"], ["keyword", "sound"], + ["punctuation", ";"], ["keyword", "stop"], + ["punctuation", ";"], ["keyword", "store"], + ["punctuation", ";"], ["keyword", "style"], + ["punctuation", ";"], ["keyword", "style_group"], + ["punctuation", ";"], ["keyword", "substitute"], + ["punctuation", ";"], ["keyword", "suffix"], + ["punctuation", ";"], ["keyword", "theme"], + ["punctuation", ";"], ["keyword", "transform"], + ["punctuation", ";"], ["keyword", "transform_anchor"], + ["punctuation", ";"], ["keyword", "transpose"], + ["punctuation", ";"], ["keyword", "try"], + ["punctuation", ";"], ["keyword", "ui"], + ["punctuation", ";"], ["keyword", "unhovered"], + ["punctuation", ";"], ["keyword", "updater"], + ["punctuation", ";"], ["keyword", "use"], + ["punctuation", ";"], ["keyword", "voice"], + ["punctuation", ";"], ["keyword", "while"], + ["punctuation", ";"], ["keyword", "widget"], + ["punctuation", ";"], ["keyword", "widget_hover"], + ["punctuation", ";"], ["keyword", "widget_selected"], + ["punctuation", ";"], ["keyword", "widget_text"], + ["punctuation", ";"], ["keyword", "yield"] +] diff --git a/tests/languages/renpy/property_feature.test b/tests/languages/renpy/property_feature.test new file mode 100644 index 0000000000..0eab089fbd --- /dev/null +++ b/tests/languages/renpy/property_feature.test @@ -0,0 +1,469 @@ +insensitive +idle +hover +selected_idle +selected_hover +background +position +alt +xpos +ypos +pos +xanchor +yanchor +anchor +xalign +yalign +align +xcenter +ycenter +xofsset +yoffset +ymaximum +maximum +xmaximum +xminimum +yminimum +minimum +xsize +ysizexysize +xfill +yfill +area +antialias +black_color +bold +caret +color +first_indent +font +size +italic +justify +kerning +language +layout +line_leading +line_overlap_split +line_spacing +min_width +newline_indent +outlines +rest_indent +ruby_style +slow_cps +slow_cps_multiplier +strikethrough +text_align +underline +hyperlink_functions +vertical +hinting +foreground +left_margin +xmargin +top_margin +bottom_margin +ymargin +left_padding +right_padding +xpadding +top_padding +bottom_padding +ypadding +size_group +child +hover_sound +activate_sound +mouse +focus_mask +keyboard_focus +bar_vertical +bar_invert +bar_resizing +left_gutter +right_gutter +top_gutter +bottom_gutter +left_bar +right_bar +top_bar +bottom_bar +thumb +thumb_shadow +thumb_offset +unscrollable +spacing +first_spacing +box_reverse +box_wrap +order_reverse +fit_first +ysize +thumbnail_width +thumbnail_height +help +text_ypos +text_xpos +idle_color +hover_color +selected_idle_color +selected_hover_color +insensitive_color +alpha +insensitive_background +hover_background +zorder +value +width +xadjustment +xanchoraround +xaround +xinitial +xoffset +xzoom +yadjustment +yanchoraround +yaround +yinitial +yzoom +zoom +ground +height +text_style +text_y_fudge +selected_insensitive +has_sound +has_music +has_voice +focus +hovered +image_style +length +minwidth +mousewheel +offset +prefix +radius +range +right_margin +rotate +rotate_pad +developer +screen_width +screen_height +window_title +name +version +windows_icon +default_fullscreen +default_text_cps +default_afm_time +main_menu_music +sample_sound +enter_sound +exit_sound +save_directory +enter_transition +exit_transition +intra_transition +main_game_transition +game_main_transition +end_splash_transition +end_game_transition +after_load_transition +window_show_transition +window_hide_transition +adv_nvl_transition +nvl_adv_transition +enter_yesno_transition +exit_yesno_transition +enter_replay_transition +exit_replay_transition +say_attribute_transition +directory_name +executable_name +include_update +window_icon +modal +google_play_key +google_play_salt +drag_name +drag_handle +draggable +dragged +droppable +dropped +narrator_menu +action +default_afm_enable +version_name +version_tuple +inside +fadeout +fadein +layers +layer_clipping +linear +scrollbars +side_xpos +side_ypos +side_spacing +edgescroll +drag_joined +drag_raise +drop_shadow +drop_shadow_color +subpixel +easein +easeout +time +crop +auto +update +get_installed_packages +can_update +UpdateVersion +Update +overlay_functions +translations +window_left_padding +show_side_image +show_two_window + +---------------------------------------------------- + +[ + ["property", "insensitive"], + ["property", "idle"], + ["property", "hover"], + ["property", "selected_idle"], + ["property", "selected_hover"], + ["property", "background"], + ["property", "position"], + ["property", "alt"], + ["property", "xpos"], + ["property", "ypos"], + ["property", "pos"], + ["property", "xanchor"], + ["property", "yanchor"], + ["property", "anchor"], + ["property", "xalign"], + ["property", "yalign"], + ["property", "align"], + ["property", "xcenter"], + ["property", "ycenter"], + ["property", "xofsset"], + ["property", "yoffset"], + ["property", "ymaximum"], + ["property", "maximum"], + ["property", "xmaximum"], + ["property", "xminimum"], + ["property", "yminimum"], + ["property", "minimum"], + ["property", "xsize"], + ["property", "ysizexysize"], + ["property", "xfill"], + ["property", "yfill"], + ["property", "area"], + ["property", "antialias"], + ["property", "black_color"], + ["property", "bold"], + ["property", "caret"], + ["property", "color"], + ["property", "first_indent"], + ["property", "font"], + ["property", "size"], + ["property", "italic"], + ["property", "justify"], + ["property", "kerning"], + ["property", "language"], + ["property", "layout"], + ["property", "line_leading"], + ["property", "line_overlap_split"], + ["property", "line_spacing"], + ["property", "min_width"], + ["property", "newline_indent"], + ["property", "outlines"], + ["property", "rest_indent"], + ["property", "ruby_style"], + ["property", "slow_cps"], + ["property", "slow_cps_multiplier"], + ["property", "strikethrough"], + ["property", "text_align"], + ["property", "underline"], + ["property", "hyperlink_functions"], + ["property", "vertical"], + ["property", "hinting"], + ["property", "foreground"], + ["property", "left_margin"], + ["property", "xmargin"], + ["property", "top_margin"], + ["property", "bottom_margin"], + ["property", "ymargin"], + ["property", "left_padding"], + ["property", "right_padding"], + ["property", "xpadding"], + ["property", "top_padding"], + ["property", "bottom_padding"], + ["property", "ypadding"], + ["property", "size_group"], + ["property", "child"], + ["property", "hover_sound"], + ["property", "activate_sound"], + ["property", "mouse"], + ["property", "focus_mask"], + ["property", "keyboard_focus"], + ["property", "bar_vertical"], + ["property", "bar_invert"], + ["property", "bar_resizing"], + ["property", "left_gutter"], + ["property", "right_gutter"], + ["property", "top_gutter"], + ["property", "bottom_gutter"], + ["property", "left_bar"], + ["property", "right_bar"], + ["property", "top_bar"], + ["property", "bottom_bar"], + ["property", "thumb"], + ["property", "thumb_shadow"], + ["property", "thumb_offset"], + ["property", "unscrollable"], + ["property", "spacing"], + ["property", "first_spacing"], + ["property", "box_reverse"], + ["property", "box_wrap"], + ["property", "order_reverse"], + ["property", "fit_first"], + ["property", "ysize"], + ["property", "thumbnail_width"], + ["property", "thumbnail_height"], + ["property", "help"], + ["property", "text_ypos"], + ["property", "text_xpos"], + ["property", "idle_color"], + ["property", "hover_color"], + ["property", "selected_idle_color"], + ["property", "selected_hover_color"], + ["property", "insensitive_color"], + ["property", "alpha"], + ["property", "insensitive_background"], + ["property", "hover_background"], + ["property", "zorder"], + ["property", "value"], + ["property", "width"], + ["property", "xadjustment"], + ["property", "xanchoraround"], + ["property", "xaround"], + ["property", "xinitial"], + ["property", "xoffset"], + ["property", "xzoom"], + ["property", "yadjustment"], + ["property", "yanchoraround"], + ["property", "yaround"], + ["property", "yinitial"], + ["property", "yzoom"], + ["property", "zoom"], + ["property", "ground"], + ["property", "height"], + ["property", "text_style"], + ["property", "text_y_fudge"], + ["property", "selected_insensitive"], + ["property", "has_sound"], + ["property", "has_music"], + ["property", "has_voice"], + ["property", "focus"], + ["property", "hovered"], + ["property", "image_style"], + ["property", "length"], + ["property", "minwidth"], + ["property", "mousewheel"], + ["property", "offset"], + ["property", "prefix"], + ["property", "radius"], + ["property", "range"], + ["property", "right_margin"], + ["property", "rotate"], + ["property", "rotate_pad"], + ["property", "developer"], + ["property", "screen_width"], + ["property", "screen_height"], + ["property", "window_title"], + ["property", "name"], + ["property", "version"], + ["property", "windows_icon"], + ["property", "default_fullscreen"], + ["property", "default_text_cps"], + ["property", "default_afm_time"], + ["property", "main_menu_music"], + ["property", "sample_sound"], + ["property", "enter_sound"], + ["property", "exit_sound"], + ["property", "save_directory"], + ["property", "enter_transition"], + ["property", "exit_transition"], + ["property", "intra_transition"], + ["property", "main_game_transition"], + ["property", "game_main_transition"], + ["property", "end_splash_transition"], + ["property", "end_game_transition"], + ["property", "after_load_transition"], + ["property", "window_show_transition"], + ["property", "window_hide_transition"], + ["property", "adv_nvl_transition"], + ["property", "nvl_adv_transition"], + ["property", "enter_yesno_transition"], + ["property", "exit_yesno_transition"], + ["property", "enter_replay_transition"], + ["property", "exit_replay_transition"], + ["property", "say_attribute_transition"], + ["property", "directory_name"], + ["property", "executable_name"], + ["property", "include_update"], + ["property", "window_icon"], + ["property", "modal"], + ["property", "google_play_key"], + ["property", "google_play_salt"], + ["property", "drag_name"], + ["property", "drag_handle"], + ["property", "draggable"], + ["property", "dragged"], + ["property", "droppable"], + ["property", "dropped"], + ["property", "narrator_menu"], + ["property", "action"], + ["property", "default_afm_enable"], + ["property", "version_name"], + ["property", "version_tuple"], + ["property", "inside"], + ["property", "fadeout"], + ["property", "fadein"], + ["property", "layers"], + ["property", "layer_clipping"], + ["property", "linear"], + ["property", "scrollbars"], + ["property", "side_xpos"], + ["property", "side_ypos"], + ["property", "side_spacing"], + ["property", "edgescroll"], + ["property", "drag_joined"], + ["property", "drag_raise"], + ["property", "drop_shadow"], + ["property", "drop_shadow_color"], + ["property", "subpixel"], + ["property", "easein"], + ["property", "easeout"], + ["property", "time"], + ["property", "crop"], + ["property", "auto"], + ["property", "update"], + ["property", "get_installed_packages"], + ["property", "can_update"], + ["property", "UpdateVersion"], + ["property", "Update"], + ["property", "overlay_functions"], + ["property", "translations"], + ["property", "window_left_padding"], + ["property", "show_side_image"], + ["property", "show_two_window"] +] diff --git a/tests/languages/renpy/string_feature.test b/tests/languages/renpy/string_feature.test new file mode 100644 index 0000000000..426f944043 --- /dev/null +++ b/tests/languages/renpy/string_feature.test @@ -0,0 +1,29 @@ +"# This isn't a comment, since it's part of a string." + +"Since this line contains a string, it continues + even when the line ends." + +$ a = [ "Because of parenthesis, this line also", + "spans more than one line." ] + +'Strings can\'t contain their delimiter, unless you escape it.' + +---------------------------------------------------- + +[ + ["string", "\"# This isn't a comment, since it's part of a string.\""], + + ["string", "\"Since this line contains a string, it continues\r\n even when the line ends.\""], + + ["tag", "$"], + " a ", + ["operator", "="], + ["punctuation", "["], + ["string", "\"Because of parenthesis, this line also\""], + ["punctuation", ","], + + ["string", "\"spans more than one line.\""], + ["punctuation", "]"], + + ["string", "'Strings can\\'t contain their delimiter, unless you escape it.'"] +] diff --git a/tests/languages/renpy/tag_feature.test b/tests/languages/renpy/tag_feature.test new file mode 100644 index 0000000000..1bc9484d88 --- /dev/null +++ b/tests/languages/renpy/tag_feature.test @@ -0,0 +1,75 @@ +label +image +menu +hbox +vbox +frame +text +imagemap +imagebutton +bar +vbar +screen +textbutton +buttoscreenn +fixed +grid +input +key +mousearea +side +timer +viewport +window +hotspot +hotbar +self +button +drag +draggroup +tag +mm_menu_frame +nvl +block + +$ + +---------------------------------------------------- + +[ + ["tag", "label"], + ["tag", "image"], + ["tag", "menu"], + ["tag", "hbox"], + ["tag", "vbox"], + ["tag", "frame"], + ["tag", "text"], + ["tag", "imagemap"], + ["tag", "imagebutton"], + ["tag", "bar"], + ["tag", "vbar"], + ["tag", "screen"], + ["tag", "textbutton"], + ["tag", "buttoscreenn"], + ["tag", "fixed"], + ["tag", "grid"], + ["tag", "input"], + ["tag", "key"], + ["tag", "mousearea"], + ["tag", "side"], + ["tag", "timer"], + ["tag", "viewport"], + ["tag", "window"], + ["tag", "hotspot"], + ["tag", "hotbar"], + ["tag", "self"], + ["tag", "button"], + ["tag", "drag"], + ["tag", "draggroup"], + ["tag", "tag"], + ["tag", "mm_menu_frame"], + ["tag", "nvl"], + ["tag", "block"], + + ["tag", "$"] +] diff --git a/tests/languages/rest/issue2940.test b/tests/languages/rest/issue2940.test new file mode 100644 index 0000000000..409d98002b --- /dev/null +++ b/tests/languages/rest/issue2940.test @@ -0,0 +1,33 @@ +`ALTER ROLE `_ or ``ALTER_ROLE`` + +`ALTER ROLE `_ +or ``ALTER_ROLE`` + +---------------------------------------------------- + +[ + ["link", [ + ["punctuation", "`"], + "ALTER ROLE ", + ["punctuation", "`_"] + ]], + " or ", + ["inline", [ + ["punctuation", "``"], + ["inline-literal", "ALTER_ROLE"], + ["punctuation", "``"] + ]], + + ["link", [ + ["punctuation", "`"], + "ALTER ROLE ", + ["punctuation", "`_"] + ]], + + "\r\nor ", + ["inline", [ + ["punctuation", "``"], + ["inline-literal", "ALTER_ROLE"], + ["punctuation", "``"] + ]] +] diff --git a/tests/languages/rip/character_feature.test b/tests/languages/rip/char_feature.test similarity index 54% rename from tests/languages/rip/character_feature.test rename to tests/languages/rip/char_feature.test index 919e738f13..83c145882e 100644 --- a/tests/languages/rip/character_feature.test +++ b/tests/languages/rip/char_feature.test @@ -1,14 +1,15 @@ -`a -`b -`Z ----------------------------------------------------- - -[ - ["character", "`a"], - ["character", "`b"], - ["character", "`Z"] -] - ----------------------------------------------------- - -Checks for characters. \ No newline at end of file +`a +`b +`Z + +---------------------------------------------------- + +[ + ["char", "`a"], + ["char", "`b"], + ["char", "`Z"] +] + +---------------------------------------------------- + +Checks for characters. diff --git a/tests/languages/rip/punctuation_feature.test b/tests/languages/rip/punctuation_feature.test new file mode 100644 index 0000000000..2ef1910a00 --- /dev/null +++ b/tests/languages/rip/punctuation_feature.test @@ -0,0 +1,28 @@ +.. ... + +` , . : ; = / \ +( ) < > [ ] { } + +---------------------------------------------------- + +[ + ["punctuation", ".."], ["punctuation", "..."], + + ["punctuation", "`"], + ["punctuation", ","], + ["punctuation", "."], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", "="], + ["punctuation", "/"], + ["punctuation", "\\"], + + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "<"], + ["punctuation", ">"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/ruby+haml/ruby_inclusion.test b/tests/languages/ruby+haml/ruby_inclusion.test new file mode 100644 index 0000000000..79d02505e7 --- /dev/null +++ b/tests/languages/ruby+haml/ruby_inclusion.test @@ -0,0 +1,56 @@ +:ruby + def circumference + Math::PI * radius ** 2 + end + +~ + :ruby + def circumference + Math::PI * radius ** 2 + end + +---------------------------------------------------- + +[ + ["filter-ruby", [ + ["filter-name", ":ruby"], + ["text", [ + ["keyword", "def"], + ["method-definition", [ + ["function", "circumference"] + ]], + + "\r\n\t\tMath", + ["double-colon", "::"], + ["constant", "PI"], + ["operator", "*"], + " radius ", + ["operator", "**"], + ["number", "2"], + + ["keyword", "end"] + ]] + ]], + + ["punctuation", "~"], + + ["filter-ruby", [ + ["filter-name", ":ruby"], + ["text", [ + ["keyword", "def"], + ["method-definition", [ + ["function", "circumference"] + ]], + + "\r\n\t\t\tMath", + ["double-colon", "::"], + ["constant", "PI"], + ["operator", "*"], + " radius ", + ["operator", "**"], + ["number", "2"], + + ["keyword", "end"] + ]] + ]] +] diff --git a/tests/languages/ruby/class-name_feature.test b/tests/languages/ruby/class-name_feature.test new file mode 100644 index 0000000000..8386b00992 --- /dev/null +++ b/tests/languages/ruby/class-name_feature.test @@ -0,0 +1,73 @@ +class Customer + @@no_of_customers = 0 +end + +cust1 = Customer. new +cust2 = Customer. new + +class Accounts + def reading_charge + end + def Accounts.return_date + end +end + +class Salad + def self.buy_olive_oil + end +end + +---------------------------------------------------- + +[ + ["keyword", "class"], ["class-name", ["Customer"]], + ["variable", "@@no_of_customers"], ["operator", "="], ["number", "0"], + ["keyword", "end"], + + "\r\n\r\ncust1 ", + ["operator", "="], + ["class-name", ["Customer"]], + ["punctuation", "."], + ["keyword", "new"], + + "\r\ncust2 ", + ["operator", "="], + ["class-name", ["Customer"]], + ["punctuation", "."], + ["keyword", "new"], + + ["keyword", "class"], + ["class-name", ["Accounts"]], + + ["keyword", "def"], + ["method-definition", [ + ["function", "reading_charge"] + ]], + + ["keyword", "end"], + + ["keyword", "def"], + ["method-definition", [ + ["class-name", "Accounts"], + ["punctuation", "."], + ["function", "return_date"] + ]], + + ["keyword", "end"], + + ["keyword", "end"], + + ["keyword", "class"], + ["class-name", ["Salad"]], + + ["keyword", "def"], + ["method-definition", [ + ["keyword", "self"], + ["punctuation", "."], + ["function", "buy_olive_oil"] + ]], + + ["keyword", "end"], + + ["keyword", "end"] +] diff --git a/tests/languages/ruby/command_feature.test b/tests/languages/ruby/command_feature.test new file mode 100644 index 0000000000..b65f8e87e3 --- /dev/null +++ b/tests/languages/ruby/command_feature.test @@ -0,0 +1,105 @@ +`echo foo` +`echo #{user_input}` +`grep hosts /private/etc/* 2>&1` + +%x[ ls ] +%x{ ls } +%x + +%x!foo #{ 42 }! +%x(foo #{ 42 }) +%x{foo #{ 42 }} +%x[foo #{ 42 }] +%x + +---------------------------------------------------- + +[ + ["command-literal", [ + ["command", "`echo foo`"] + ]], + ["command-literal", [ + ["command", "`echo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", ["user_input"]], + ["delimiter", "}"] + ]], + ["command", "`"] + ]], + ["command-literal", [ + ["command", "`grep hosts /private/etc/* 2>&1`"] + ]], + + ["command-literal", [ + ["command", "%x[ ls ]"] + ]], + ["command-literal", [ + ["command", "%x{ ls }"] + ]], + ["command-literal", [ + ["command", "%x"] + ]], + + ["command-literal", [ + ["command", "%x!foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["command", "!"] + ]], + ["command-literal", [ + ["command", "%x(foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["command", ")"] + ]], + ["command-literal", [ + ["command", "%x{foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["command", "}"] + ]], + ["command-literal", [ + ["command", "%x[foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["command", "]"] + ]], + ["command-literal", [ + ["command", "%x"] + ]] +] diff --git a/tests/languages/ruby/constant_feature.test b/tests/languages/ruby/constant_feature.test index 220cf7463c..bb21cd3125 100644 --- a/tests/languages/ruby/constant_feature.test +++ b/tests/languages/ruby/constant_feature.test @@ -1,4 +1,3 @@ -Foobar FOO_BAR_42 F FOO @@ -8,7 +7,6 @@ BAZ! ---------------------------------------------------- [ - ["constant", "Foobar"], ["constant", "FOO_BAR_42"], ["constant", "F"], ["constant", "FOO"], @@ -18,4 +16,4 @@ BAZ! ---------------------------------------------------- -Checks for constants. \ No newline at end of file +Checks for constants. diff --git a/tests/languages/ruby/issue1336.test b/tests/languages/ruby/issue1336.test index 431bdf2ee6..51e864f210 100644 --- a/tests/languages/ruby/issue1336.test +++ b/tests/languages/ruby/issue1336.test @@ -5,11 +5,9 @@ Foo::Bar [ ["symbol", ":Foo"], - ["constant", "Foo"], - ["punctuation", ":"], ["punctuation", ":"], - ["constant", "Bar"] + "\r\nFoo", ["double-colon", "::"], "Bar" ] ---------------------------------------------------- -Ensures module syntax is not confused with symbols. See #1336 \ No newline at end of file +Ensures module syntax is not confused with symbols. See #1336 diff --git a/tests/languages/ruby/keyword_feature.test b/tests/languages/ruby/keyword_feature.test index 5d367dc284..db00719ad0 100644 --- a/tests/languages/ruby/keyword_feature.test +++ b/tests/languages/ruby/keyword_feature.test @@ -20,7 +20,7 @@ for if in include -module +module; new; next nil @@ -72,7 +72,7 @@ yield ["keyword", "if"], ["keyword", "in"], ["keyword", "include"], - ["keyword", "module"], + ["keyword", "module"], ["punctuation", ";"], ["keyword", "new"], ["punctuation", ";"], ["keyword", "next"], ["keyword", "nil"], diff --git a/tests/languages/ruby/method_definition_feature.test b/tests/languages/ruby/method_definition_feature.test index 087ce8bc21..8325663176 100644 --- a/tests/languages/ruby/method_definition_feature.test +++ b/tests/languages/ruby/method_definition_feature.test @@ -20,61 +20,73 @@ end ---------------------------------------------------- [ - ["keyword", "class"], - ["class-name", ["Circle"]], - ["keyword", "def"], - ["method-definition", [ - ["keyword", "self"], - ["punctuation", "."], - ["function", "of_diameter"] - ]], - ["punctuation", "("], - "diameter", - ["punctuation", ")"], - ["keyword", "new"], - " diameter ", - ["operator", "/"], - ["number", "2"], - ["keyword", "end"], - ["keyword", "def"], - ["method-definition", [ - ["function", "initialize"] - ]], - ["punctuation", "("], - "radius", - ["punctuation", ")"], - ["variable", "@radius"], - ["operator", "="], - " radius\n ", - ["keyword", "end"], - ["keyword", "def"], - ["method-definition", [ - ["function", "circumference"] - ]], - ["constant", "Math"], - ["punctuation", ":"], - ["punctuation", ":"], - ["constant", "PI"], - ["operator", "*"], - " radius ", - ["operator", "*"], - ["operator", "*"], - ["number", "2"], - ["keyword", "end"], - ["comment", "# Seattle style"], - ["keyword", "def"], - ["method-definition", [ - ["function", "grow_by"] - ]], - " factor", - ["punctuation", ":"], - ["variable", "@radius"], - ["operator", "="], - ["variable", "@radius"], - ["operator", "*"], - " factor\n ", - ["keyword", "end"], - ["keyword", "end"] + ["keyword", "class"], + ["class-name", ["Circle"]], + + ["keyword", "def"], + ["method-definition", [ + ["keyword", "self"], + ["punctuation", "."], + ["function", "of_diameter"] + ]], + ["punctuation", "("], + "diameter", + ["punctuation", ")"], + + ["keyword", "new"], + " diameter ", + ["operator", "/"], + ["number", "2"], + + ["keyword", "end"], + + ["keyword", "def"], + ["method-definition", [ + ["function", "initialize"] + ]], + ["punctuation", "("], + "radius", + ["punctuation", ")"], + + ["variable", "@radius"], + ["operator", "="], + " radius\r\n ", + + ["keyword", "end"], + + ["keyword", "def"], + ["method-definition", [ + ["function", "circumference"] + ]], + + "\r\n Math", + ["double-colon", "::"], + ["constant", "PI"], + ["operator", "*"], + " radius ", + ["operator", "**"], + ["number", "2"], + + ["keyword", "end"], + + ["comment", "# Seattle style"], + + ["keyword", "def"], + ["method-definition", [ + ["function", "grow_by"] + ]], + " factor", + ["operator", ":"], + + ["variable", "@radius"], + ["operator", "="], + ["variable", "@radius"], + ["operator", "*"], + " factor\r\n ", + + ["keyword", "end"], + + ["keyword", "end"] ] ---------------------------------------------------- diff --git a/tests/languages/ruby/operator_feature.test b/tests/languages/ruby/operator_feature.test new file mode 100644 index 0000000000..c2172901dc --- /dev/null +++ b/tests/languages/ruby/operator_feature.test @@ -0,0 +1,80 @@ ++ - * / % ** ++= -= *= /= %= **= + +== != < > <= >= <=> === +!~ =~ += +& | ^ ~ << >> +&= |= ^= <<= >>= +&& || ! +&&= ||= + +=> + +&. + +? : +.. ... + +and or not + +---------------------------------------------------- + +[ + ["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", ":"], + ["operator", ".."], ["operator", "..."], + + ["keyword", "and"], ["keyword", "or"], ["keyword", "not"] +] diff --git a/tests/languages/ruby/punctuation_feature.test b/tests/languages/ruby/punctuation_feature.test new file mode 100644 index 0000000000..fc24af160c --- /dev/null +++ b/tests/languages/ruby/punctuation_feature.test @@ -0,0 +1,20 @@ +( ) { } [ ] +. , ; +:: + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ";"], + + ["double-colon", "::"] +] diff --git a/tests/languages/ruby/regex_feature.test b/tests/languages/ruby/regex_feature.test index 0dee02d34d..4cb9198fa3 100644 --- a/tests/languages/ruby/regex_feature.test +++ b/tests/languages/ruby/regex_feature.test @@ -1,45 +1,176 @@ /[foo]\/bar/gim /[bar]/, /./i; +/foo#{bar}/; +/ab+c/ix %r!foo?bar#{39+3}! %r(foo?bar#{39+3}) %r{foo?bar#{39+3}} %r[foo?bar#{39+3}] %r +/foo/ # comment +/foo#{bar}/ # comment + +# flags +/abc/e +/abc/g +/abc/i +/abc/m +/abc/n +/abc/o +/abc/s +/abc/u +/abc/x + ---------------------------------------------------- [ - ["regex", "/[foo]\\/bar/gim"], - ["regex", "/[bar]/"], ["punctuation", ","], - ["regex", "/./i"], ["punctuation", ";"], - ["regex", ["%r!foo?bar", ["interpolation", [ - ["delimiter", "#{"], - ["number", "39"], ["operator", "+"], ["number", "3"], - ["delimiter", "}"] - ]], "!"]], - ["regex", ["%r(foo?bar", ["interpolation", [ - ["delimiter", "#{"], - ["number", "39"], ["operator", "+"], ["number", "3"], - ["delimiter", "}"] - ]], ")"]], - ["regex", ["%r{foo?bar", ["interpolation", [ - ["delimiter", "#{"], - ["number", "39"], ["operator", "+"], ["number", "3"], - ["delimiter", "}"] - ]], "}"]], - ["regex", ["%r[foo?bar", ["interpolation", [ - ["delimiter", "#{"], - ["number", "39"], ["operator", "+"], ["number", "3"], - ["delimiter", "}"] - ]], "]"]], - ["regex", ["%r"]] + ["regex-literal", [ + ["regex", "/[foo]\\/bar/gim"] + ]], + + ["regex-literal", [ + ["regex", "/[bar]/"] + ]], + ["punctuation", ","], + + ["regex-literal", [ + ["regex", "/./i"] + ]], + ["punctuation", ";"], + + ["regex-literal", [ + ["regex", "/foo"], + ["interpolation", [ + ["delimiter", "#{"], + ["content", ["bar"]], + ["delimiter", "}"] + ]], + ["regex", "/"] + ]], + ["punctuation", ";"], + + ["regex-literal", [ + ["regex", "/ab+c/ix"] + ]], + + ["regex-literal", [ + ["regex", "%r!foo?bar"], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "39"], + ["operator", "+"], + ["number", "3"] + ]], + ["delimiter", "}"] + ]], + ["regex", "!"] + ]], + + ["regex-literal", [ + ["regex", "%r(foo?bar"], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "39"], + ["operator", "+"], + ["number", "3"] + ]], + ["delimiter", "}"] + ]], + ["regex", ")"] + ]], + + ["regex-literal", [ + ["regex", "%r{foo?bar"], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "39"], + ["operator", "+"], + ["number", "3"] + ]], + ["delimiter", "}"] + ]], + ["regex", "}"] + ]], + + ["regex-literal", [ + ["regex", "%r[foo?bar"], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "39"], + ["operator", "+"], + ["number", "3"] + ]], + ["delimiter", "}"] + ]], + ["regex", "]"] + ]], + + ["regex-literal", [ + ["regex", "%r"] + ]], + + ["regex-literal", [ + ["regex", "/foo/"] + ]], + ["comment", "# comment"], + + ["regex-literal", [ + ["regex", "/foo"], + ["interpolation", [ + ["delimiter", "#{"], + ["content", ["bar"]], + ["delimiter", "}"] + ]], + ["regex", "/"] + ]], + ["comment", "# comment"], + + ["comment", "# flags"], + ["regex-literal", [ + ["regex", "/abc/e"] + ]], + ["regex-literal", [ + ["regex", "/abc/g"] + ]], + ["regex-literal", [ + ["regex", "/abc/i"] + ]], + ["regex-literal", [ + ["regex", "/abc/m"] + ]], + ["regex-literal", [ + ["regex", "/abc/n"] + ]], + ["regex-literal", [ + ["regex", "/abc/o"] + ]], + ["regex-literal", [ + ["regex", "/abc/s"] + ]], + ["regex-literal", [ + ["regex", "/abc/u"] + ]], + ["regex-literal", [ + ["regex", "/abc/x"] + ]] ] ---------------------------------------------------- -Checks for regex. \ No newline at end of file +Checks for regex. diff --git a/tests/languages/ruby/string_feature.test b/tests/languages/ruby/string_feature.test index 2703abee39..c3f9f08dcc 100644 --- a/tests/languages/ruby/string_feature.test +++ b/tests/languages/ruby/string_feature.test @@ -9,6 +9,7 @@ bar" "foo #bar" "foo #{ 42 } bar" +"\#{a + b}" %!foo #{ 42 }! %(foo #{ 42 }) @@ -30,258 +31,376 @@ bar" %W{foo #{ 42 }} %W[foo #{ 42 }] %W -%x!foo #{ 42 }! -%x(foo #{ 42 }) -%x{foo #{ 42 }} -%x[foo #{ 42 }] -%x + +<" - ]], - ["string", [ - "%Q!foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "!" - ]], - ["string", [ - "%Q(foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - ")" - ]], - ["string", [ - "%Q{foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "}" - ]], - ["string", [ - "%Q[foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "]" - ]], - ["string", [ - "%Q" - ]], - ["string", [ - "%I!foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "!" - ]], - ["string", [ - "%I(foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - ")" - ]], - ["string", [ - "%I{foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "}" - ]], - ["string", [ - "%I[foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "]" - ]], - ["string", [ - "%I" - ]], - ["string", [ - "%W!foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "!" - ]], - ["string", [ - "%W(foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - ")" - ]], - ["string", [ - "%W{foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "}" - ]], - ["string", [ - "%W[foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "]" - ]], - ["string", [ - "%W" - ]], - ["string", [ - "%x!foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "!" - ]], - ["string", [ - "%x(foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - ")" - ]], - ["string", [ - "%x{foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "}" - ]], - ["string", [ - "%x[foo ", - ["interpolation", [ - ["delimiter", "#{"], - ["number", "42"], - ["delimiter", "}"] - ]], - "]" - ]], - ["string", [ - "%x" - ]] + ["string-literal", [ + ["string", "''"] + ]], + ["string-literal", [ + ["string", "\"\""] + ]], + ["string-literal", [ + ["string", "'foo'"] + ]], + ["string-literal", [ + ["string", "\"foo\""] + ]], + ["string-literal", [ + ["string", "'foo\\\r\nbar'"] + ]], + ["string-literal", [ + ["string", "\"foo\\\r\nbar\""] + ]], + + ["string-literal", [ + ["string", "\"foo #bar\""] + ]], + ["string-literal", [ + ["string", "\"foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", " bar\""] + ]], + ["string-literal", [ + ["string", "\"\\#{a + b}\""] + ]], + + ["string-literal", [ + ["string", "%!foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "!"] + ]], + ["string-literal", [ + ["string", "%(foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", ")"] + ]], + ["string-literal", [ + ["string", "%{foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "}"] + ]], + ["string-literal", [ + ["string", "%[foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "]"] + ]], + ["string-literal", [ + ["string", "%"] + ]], + ["string-literal", [ + ["string", "%Q!foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "!"] + ]], + ["string-literal", [ + ["string", "%Q(foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", ")"] + ]], + ["string-literal", [ + ["string", "%Q{foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "}"] + ]], + ["string-literal", [ + ["string", "%Q[foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "]"] + ]], + ["string-literal", [ + ["string", "%Q"] + ]], + ["string-literal", [ + ["string", "%I!foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "!"] + ]], + ["string-literal", [ + ["string", "%I(foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", ")"] + ]], + ["string-literal", [ + ["string", "%I{foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "}"] + ]], + ["string-literal", [ + ["string", "%I[foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "]"] + ]], + ["string-literal", [ + ["string", "%I"] + ]], + ["string-literal", [ + ["string", "%W!foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "!"] + ]], + ["string-literal", [ + ["string", "%W(foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", ")"] + ]], + ["string-literal", [ + ["string", "%W{foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "}"] + ]], + ["string-literal", [ + ["string", "%W[foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", "]"] + ]], + ["string-literal", [ + ["string", "%W"] + ]], + + ["string-literal", [ + ["delimiter", [ + ["punctuation", "<<"], + ["symbol", "STRING"] + ]], + ["string", "\r\n foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", " bar\r\n"], + ["delimiter", [ + ["symbol", "STRING"] + ]] + ]], + ["string-literal", [ + ["delimiter", [ + ["punctuation", "<<-"], + ["symbol", "STRING"] + ]], + ["string", "\r\n foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", " bar\r\n "], + ["delimiter", [ + ["symbol", "STRING"] + ]] + ]], + ["string-literal", [ + ["delimiter", [ + ["punctuation", "<<~"], + ["symbol", "STRING"] + ]], + ["string", "\r\n foo "], + ["interpolation", [ + ["delimiter", "#{"], + ["content", [ + ["number", "42"] + ]], + ["delimiter", "}"] + ]], + ["string", " bar\r\n "], + ["delimiter", [ + ["symbol", "STRING"] + ]] + ]], + ["string-literal", [ + ["delimiter", [ + ["punctuation", "<<'"], + ["symbol", "STRING"], + ["punctuation", "'"] + ]], + ["string", "\r\n foo #{42} bar\r\n"], + ["delimiter", [ + ["symbol", "STRING"] + ]] + ]], + ["string-literal", [ + ["delimiter", [ + ["punctuation", "<<-'"], + ["symbol", "STRING"], + ["punctuation", "'"] + ]], + ["string", "\r\n foo #{42} bar\r\n "], + ["delimiter", [ + ["symbol", "STRING"] + ]] + ]], + ["string-literal", [ + ["delimiter", [ + ["punctuation", "<<~'"], + ["symbol", "STRING"], + ["punctuation", "'"] + ]], + ["string", "\r\n foo #{42} bar\r\n "], + ["delimiter", [ + ["symbol", "STRING"] + ]] + ]] ] ---------------------------------------------------- -Checks for strings and string interpolation. \ No newline at end of file +Checks for strings and string interpolation. diff --git a/tests/languages/ruby/symbol_feature.test b/tests/languages/ruby/symbol_feature.test index 6a51758056..c60db306d4 100644 --- a/tests/languages/ruby/symbol_feature.test +++ b/tests/languages/ruby/symbol_feature.test @@ -2,6 +2,19 @@ :foo :BAR? :Baz_42! +:あ +:"name" +:"\u{c4 d6 dc}" +:question? +:exclamation! +:$; + +:foo.object_id + +# in hashes + +{ :one => "eins", :two => "zwei", :three => "drei" } +{ one: "eins", two: "zwei", three: "drei" } ---------------------------------------------------- @@ -9,9 +22,59 @@ ["symbol", ":_"], ["symbol", ":foo"], ["symbol", ":BAR?"], - ["symbol", ":Baz_42!"] + ["symbol", ":Baz_42!"], + ["symbol", ":あ"], + ["symbol", ":\"name\""], + ["symbol", ":\"\\u{c4 d6 dc}\""], + ["symbol", ":question?"], + ["symbol", ":exclamation!"], + ["symbol", ":$;"], + + ["symbol", ":foo"], ["punctuation", "."], "object_id\r\n\r\n", + + ["comment", "# in hashes"], + + ["punctuation", "{"], + ["symbol", ":one"], + ["operator", "=>"], + ["string-literal", [ + ["string", "\"eins\""] + ]], + ["punctuation", ","], + ["symbol", ":two"], + ["operator", "=>"], + ["string-literal", [ + ["string", "\"zwei\""] + ]], + ["punctuation", ","], + ["symbol", ":three"], + ["operator", "=>"], + ["string-literal", [ + ["string", "\"drei\""] + ]], + ["punctuation", "}"], + + ["punctuation", "{"], + ["symbol", "one"], + ["operator", ":"], + ["string-literal", [ + ["string", "\"eins\""] + ]], + ["punctuation", ","], + ["symbol", "two"], + ["operator", ":"], + ["string-literal", [ + ["string", "\"zwei\""] + ]], + ["punctuation", ","], + ["symbol", "three"], + ["operator", ":"], + ["string-literal", [ + ["string", "\"drei\""] + ]], + ["punctuation", "}"] ] ---------------------------------------------------- -Checks for symbols. \ No newline at end of file +Checks for symbols. diff --git a/tests/languages/rust/char_feature.test b/tests/languages/rust/char_feature.test index 9a1948411a..a0fb47d595 100644 --- a/tests/languages/rust/char_feature.test +++ b/tests/languages/rust/char_feature.test @@ -1,13 +1,21 @@ 'a' 'स' +'\'' +'\n' +'\u{00e9}' +'\x41' ---------------------------------------------------- [ ["char", "'a'"], - ["char", "'स'"] + ["char", "'स'"], + ["char", "'\\''"], + ["char", "'\\n'"], + ["char", "'\\u{00e9}'"], + ["char", "'\\x41'"] ] ---------------------------------------------------- -Checks for chars. \ No newline at end of file +Checks for chars. diff --git a/tests/languages/rust/class-name_feature.test b/tests/languages/rust/class-name_feature.test index 442a8a2557..8571bd884b 100644 --- a/tests/languages/rust/class-name_feature.test +++ b/tests/languages/rust/class-name_feature.test @@ -16,6 +16,12 @@ enum Foo { } } +pub trait Summary { + fn summarize(&self) -> String; +} + +type Point = (u8, u8); + ---------------------------------------------------- [ @@ -29,6 +35,7 @@ enum Foo { ["punctuation", ":"], ["class-name", "CStr"], ["punctuation", ";"], + ["keyword", "let"], " foo", ["punctuation", ":"], @@ -36,6 +43,7 @@ enum Foo { ["lifetime-annotation", "'a"], ["class-name", "CStr"], ["punctuation", ";"], + ["keyword", "let"], " foo", ["punctuation", ":"], @@ -47,6 +55,7 @@ enum Foo { ["class-name", "Bar"], ["operator", ">"], ["punctuation", ";"], + ["class-name", "Option"], ["punctuation", "::"], ["class-name", "Some"], @@ -54,18 +63,23 @@ enum Foo { "foo", ["punctuation", ")"], ["punctuation", ";"], + ["class-name", "Option"], ["punctuation", "::"], ["class-name", "None"], ["punctuation", ";"], ["comment", "// we can differentiate between enum variants and class names"], + ["comment", "// so let's make the bug a feature!"], + ["keyword", "enum"], ["type-definition", "Foo"], ["punctuation", "{"], + ["class-name", "Const"], ["punctuation", ","], + ["class-name", "Tuple"], ["punctuation", "("], ["keyword", "i8"], @@ -73,13 +87,44 @@ enum Foo { ["keyword", "i8"], ["punctuation", ")"], ["punctuation", ","], + ["class-name", "Struct"], ["punctuation", "{"], - "\n\t\tfoo", + + "\r\n\t\tfoo", ["punctuation", ":"], ["keyword", "u8"], + + ["punctuation", "}"], + ["punctuation", "}"], - ["punctuation", "}"] + + ["keyword", "pub"], + ["keyword", "trait"], + ["type-definition", "Summary"], + ["punctuation", "{"], + + ["keyword", "fn"], + ["function-definition", "summarize"], + ["punctuation", "("], + ["operator", "&"], + ["keyword", "self"], + ["punctuation", ")"], + ["punctuation", "->"], + ["class-name", "String"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "type"], + ["type-definition", "Point"], + ["operator", "="], + ["punctuation", "("], + ["keyword", "u8"], + ["punctuation", ","], + ["keyword", "u8"], + ["punctuation", ")"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/rust/keyword_feature.test b/tests/languages/rust/keyword_feature.test index a55ca38deb..0f4563366d 100644 --- a/tests/languages/rust/keyword_feature.test +++ b/tests/languages/rust/keyword_feature.test @@ -1,107 +1,107 @@ -abstract -as -async -await -become -box -break -const -continue +abstract; +as; +async; +await; +become; +box; +break; +const; +continue; crate; -do -dyn -else +do; +dyn; +else; enum; -extern -final +extern; +final; fn; -for -if -impl -in -let -loop -macro -match +for; +if; +impl; +in; +let; +loop; +macro; +match; mod; -move -mut -override -priv -pub -ref -return -self -Self -static +move; +mut; +override; +priv; +pub; +ref; +return; +self; +Self; +static; struct; -super -trait -try -type -typeof +super; +trait; +try; +type; +typeof; union; -unsafe -unsized -use -virtual -where -while -yield +unsafe; +unsized; +use; +virtual; +where; +while; +yield; ---------------------------------------------------- [ - ["keyword", "abstract"], - ["keyword", "as"], - ["keyword", "async"], - ["keyword", "await"], - ["keyword", "become"], - ["keyword", "box"], - ["keyword", "break"], - ["keyword", "const"], - ["keyword", "continue"], + ["keyword", "abstract"], ["punctuation", ";"], + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "async"], ["punctuation", ";"], + ["keyword", "await"], ["punctuation", ";"], + ["keyword", "become"], ["punctuation", ";"], + ["keyword", "box"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "const"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], ["keyword", "crate"], ["punctuation", ";"], - ["keyword", "do"], - ["keyword", "dyn"], - ["keyword", "else"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "dyn"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], ["keyword", "enum"], ["punctuation", ";"], - ["keyword", "extern"], - ["keyword", "final"], + ["keyword", "extern"], ["punctuation", ";"], + ["keyword", "final"], ["punctuation", ";"], ["keyword", "fn"], ["punctuation", ";"], - ["keyword", "for"], - ["keyword", "if"], - ["keyword", "impl"], - ["keyword", "in"], - ["keyword", "let"], - ["keyword", "loop"], - ["keyword", "macro"], - ["keyword", "match"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "impl"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "let"], ["punctuation", ";"], + ["keyword", "loop"], ["punctuation", ";"], + ["keyword", "macro"], ["punctuation", ";"], + ["keyword", "match"], ["punctuation", ";"], ["keyword", "mod"], ["punctuation", ";"], - ["keyword", "move"], - ["keyword", "mut"], - ["keyword", "override"], - ["keyword", "priv"], - ["keyword", "pub"], - ["keyword", "ref"], - ["keyword", "return"], - ["keyword", "self"], - ["keyword", "Self"], - ["keyword", "static"], + ["keyword", "move"], ["punctuation", ";"], + ["keyword", "mut"], ["punctuation", ";"], + ["keyword", "override"], ["punctuation", ";"], + ["keyword", "priv"], ["punctuation", ";"], + ["keyword", "pub"], ["punctuation", ";"], + ["keyword", "ref"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "self"], ["punctuation", ";"], + ["keyword", "Self"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], ["keyword", "struct"], ["punctuation", ";"], - ["keyword", "super"], - ["keyword", "trait"], - ["keyword", "try"], - ["keyword", "type"], - ["keyword", "typeof"], + ["keyword", "super"], ["punctuation", ";"], + ["keyword", "trait"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "type"], ["punctuation", ";"], + ["keyword", "typeof"], ["punctuation", ";"], ["keyword", "union"], ["punctuation", ";"], - ["keyword", "unsafe"], - ["keyword", "unsized"], - ["keyword", "use"], - ["keyword", "virtual"], - ["keyword", "where"], - ["keyword", "while"], - ["keyword", "yield"] + ["keyword", "unsafe"], ["punctuation", ";"], + ["keyword", "unsized"], ["punctuation", ";"], + ["keyword", "use"], ["punctuation", ";"], + ["keyword", "virtual"], ["punctuation", ";"], + ["keyword", "where"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["keyword", "yield"], ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/rust/namespace_feature.test b/tests/languages/rust/namespace_feature.test index f858e07bbd..3ccfa1ad52 100644 --- a/tests/languages/rust/namespace_feature.test +++ b/tests/languages/rust/namespace_feature.test @@ -19,6 +19,9 @@ pub static ALLOCATOR: alloc::Tracing = alloc::Tracing::new(); unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} +use crate::cool::function as root_function; +self::cool::function(); + ---------------------------------------------------- [ @@ -28,12 +31,14 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["punctuation", "::"] ]], ["punctuation", "{"], + ["namespace", [ "fs", ["punctuation", "::"] ]], ["class-name", "File"], ["punctuation", ","], + ["namespace", [ "io", ["punctuation", "::"] @@ -44,14 +49,17 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["class-name", "BufReader"], ["punctuation", "}"], ["punctuation", ","], + ["namespace", [ "path", ["punctuation", "::"] ]], ["class-name", "PathBuf"], ["punctuation", ","], + ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "use"], ["punctuation", "::"], ["namespace", [ @@ -66,6 +74,7 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["class-name", "Visitor"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "use"], ["namespace", [ "std", @@ -81,10 +90,12 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["class-name", "Ordering"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "pub"], ["keyword", "mod"], ["module-declaration", "sample"], ["punctuation", ";"], + ["keyword", "extern"], ["keyword", "crate"], ["module-declaration", "test"], @@ -121,6 +132,7 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["operator", "&"], "line", ["punctuation", ")"], + ["keyword", "self"], ["punctuation", "."], ["function", "read_records"], @@ -178,7 +190,30 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["keyword", "mut"], ["keyword", "u8"], ["punctuation", "{"], - ["punctuation", "}"] + ["punctuation", "}"], + + ["keyword", "use"], + ["keyword", "crate"], + ["module-declaration", [ + ["punctuation", "::"], + "cool", + ["punctuation", "::"] + ]], + "function ", + ["keyword", "as"], + " root_function", + ["punctuation", ";"], + + ["keyword", "self"], + ["module-declaration", [ + ["punctuation", "::"], + "cool", + ["punctuation", "::"] + ]], + ["function", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/sas/number_feature.test b/tests/languages/sas/number_feature.test index 317a3212cc..add7c32f96 100644 --- a/tests/languages/sas/number_feature.test +++ b/tests/languages/sas/number_feature.test @@ -7,6 +7,9 @@ BadFacex 0c1x 0b0ax +"3132,3334"x +'3132,3334'x + ---------------------------------------------------- [ @@ -17,7 +20,10 @@ BadFacex ["number", "1.4E+2"], "\r\nBadFacex\r\n", ["number", "0c1x"], - ["number", "0b0ax"] + ["number", "0b0ax"], + + ["numeric-constant", "\"3132,3334\"x"], + ["numeric-constant", "'3132,3334'x"] ] ---------------------------------------------------- diff --git a/tests/languages/sass/variable-line_feature.test b/tests/languages/sass/variable-line_feature.test index a7f62ffcfb..445c85ca5a 100644 --- a/tests/languages/sass/variable-line_feature.test +++ b/tests/languages/sass/variable-line_feature.test @@ -1,5 +1,6 @@ $width: 5em $foo: $bar + $baz +$foo: $bar - $baz $bar: #{$baz} ---------------------------------------------------- @@ -17,6 +18,13 @@ $bar: #{$baz} ["operator", "+"], ["variable", "$baz"] ]], + ["variable-line", [ + ["variable", "$foo"], + ["punctuation", ":"], + ["variable", "$bar"], + ["operator", "-"], + ["variable", "$baz"] + ]], ["variable-line", [ ["variable", "$bar"], ["punctuation", ":"], @@ -26,4 +34,4 @@ $bar: #{$baz} ---------------------------------------------------- -Checks for variable declarations. \ No newline at end of file +Checks for variable declarations. diff --git a/tests/languages/scala/char_feature.test b/tests/languages/scala/char_feature.test new file mode 100644 index 0000000000..b409bcfdaa --- /dev/null +++ b/tests/languages/scala/char_feature.test @@ -0,0 +1,13 @@ +'a' +'\u0041' +'\n' +'\t' + +---------------------------------------------------- + +[ + ["char", "'a'"], + ["char", "'\\u0041'"], + ["char", "'\\n'"], + ["char", "'\\t'"] +] diff --git a/tests/languages/scala/string_feature.test b/tests/languages/scala/string_feature.test index 502625d593..7dad0c20cb 100644 --- a/tests/languages/scala/string_feature.test +++ b/tests/languages/scala/string_feature.test @@ -1,8 +1,3 @@ -'a' -'\u0041' -'\n' -'\t' - "" "fo\"obar" @@ -11,24 +6,85 @@ bar""" """fo"o // comment bar""" +"""{"name":"James"}""" "foo /* comment */ bar" -'foo // bar' + +s"Hello, $name" +s"1 + 1 = ${1 + 1}" +s"New offers starting at $$14.99" +f"$name%s is $height%2.2f meters tall" +json"{ name: $name, id: $id }" ---------------------------------------------------- [ - ["string", "'a'"], - ["string", "'\\u0041'"], - ["string", "'\\n'"], - ["string", "'\\t'"], ["string", "\"\""], ["string", "\"fo\\\"obar\""], + ["triple-quoted-string", "\"\"\"fo\"o\r\nbar\"\"\""], ["triple-quoted-string", "\"\"\"fo\"o\r\n// comment\r\nbar\"\"\""], + ["triple-quoted-string", "\"\"\"{\"name\":\"James\"}\"\"\""], ["string", "\"foo /* comment */ bar\""], - ["string", "'foo // bar'"] + + ["string-interpolation", [ + ["id", "s"], + ["string", "\"Hello, "], + ["interpolation", [ + ["punctuation", "$"], + ["expression", ["name"]] + ]], + ["string", "\""] + ]], + ["string-interpolation", [ + ["id", "s"], + ["string", "\"1 + 1 = "], + ["interpolation", [ + ["punctuation", "${"], + ["expression", [ + ["number", "1"], + ["operator", "+"], + ["number", "1"] + ]], + ["punctuation", "}"] + ]], + ["string", "\""] + ]], + ["string-interpolation", [ + ["id", "s"], + ["string", "\"New offers starting at "], + ["escape", "$$"], + ["string", "14.99\""] + ]], + ["string-interpolation", [ + ["id", "f"], + ["string", "\""], + ["interpolation", [ + ["punctuation", "$"], + ["expression", ["name"]] + ]], + ["string", "%s is "], + ["interpolation", [ + ["punctuation", "$"], + ["expression", ["height"]] + ]], + ["string", "%2.2f meters tall\""] + ]], + ["string-interpolation", [ + ["id", "json"], + ["string", "\"{ name: "], + ["interpolation", [ + ["punctuation", "$"], + ["expression", ["name"]] + ]], + ["string", ", id: "], + ["interpolation", [ + ["punctuation", "$"], + ["expression", ["id"]] + ]], + ["string", " }\""] + ]] ] ---------------------------------------------------- -Checks for characters and strings. +Checks for strings. diff --git a/tests/languages/scheme/boolean_feature.test b/tests/languages/scheme/boolean_feature.test index af218655a4..53753fc7a1 100644 --- a/tests/languages/scheme/boolean_feature.test +++ b/tests/languages/scheme/boolean_feature.test @@ -1,17 +1,15 @@ #t #f - -; not a boolean #true +#false ---------------------------------------------------- [ ["boolean", "#t"], ["boolean", "#f"], - - ["comment", "; not a boolean"], - "\r\n#true" + ["boolean", "#true"], + ["boolean", "#false"] ] ---------------------------------------------------- diff --git a/tests/languages/scheme/builtin_feature.test b/tests/languages/scheme/builtin_feature.test index ab03c8e209..72bda723e1 100644 --- a/tests/languages/scheme/builtin_feature.test +++ b/tests/languages/scheme/builtin_feature.test @@ -1,51 +1,405 @@ -(cons) -(car) -(cdr) -(null?) -(pair?) -(boolean?) -(eof-object?) -(char?) -(procedure?) -(number?) -(port?) -(string?) -(vector?) -(symbol?) -(bytevector?) -(list) -(call-with-current-continuation) -(call/cc) -(append) -(abs) -(apply) -(eval) +(abs +(and +(append +(apply +(assoc +(assq +(assv +(binary-port? +(boolean=? +(boolean? +(bytevector +(bytevector-append +(bytevector-copy +(bytevector-copy! +(bytevector-length +(bytevector-u8-ref +(bytevector-u8-set! +(bytevector? +(caar +(cadr +(call-with-current-continuation +(call-with-port +(call-with-values +(call/cc +(car +(cdar +(cddr +(cdr +(ceiling +(char->integer +(char-ready? +(char<=? +(char=? +(char>? +(char? +(close-input-port +(close-output-port +(close-port +(complex? +(cons +(current-error-port +(current-input-port +(current-output-port +(denominator +(dynamic-wind +(eof-object +(eof-object? +(eq? +(equal? +(eqv? +(error +(error-object-irritants +(error-object-message +(error-object? +(eval +(even? +(exact +(exact-integer-sqrt +(exact-integer? +(exact? +(expt +(features +(file-error? +(floor +(floor-quotient +(floor-remainder +(floor/ +(flush-output-port +(for-each +(gcd +(get-output-bytevector +(get-output-string +(inexact +(inexact? +(input-port-open? +(input-port? +(integer->char +(integer? +(lcm +(length +(list +(list->string +(list->vector +(list-copy +(list-ref +(list-set! +(list-tail +(list? +(make-bytevector +(make-list +(make-parameter +(make-string +(make-vector +(map +(max +(member +(memq +(memv +(min +(modulo +(negative? +(newline +(not +(null? +(number->string +(number? +(numerator +(odd? +(open-input-bytevector +(open-input-string +(open-output-bytevector +(open-output-string +(or +(output-port-open? +(output-port? +(pair? +(peek-char +(peek-u8 +(port? +(positive? +(procedure? +(quotient +(raise +(raise-continuable +(rational? +(rationalize +(read-bytevector +(read-bytevector! +(read-char +(read-error? +(read-line +(read-string +(read-u8 +(real? +(remainder +(reverse +(round +(set-car! +(set-cdr! +(square +(string +(string->list +(string->number +(string->symbol +(string->utf8 +(string->vector +(string-append +(string-copy +(string-copy! +(string-fill! +(string-for-each +(string-length +(string-map +(string-ref +(string-set! +(string<=? +(string=? +(string>? +(string? +(substring +(symbol->string +(symbol=? +(symbol? +(syntax-error +(textual-port? +(truncate +(truncate-quotient +(truncate-remainder +(truncate/ +(u8-ready? +(utf8->string +(values +(vector +(vector->list +(vector->string +(vector-append +(vector-copy +(vector-copy! +(vector-fill! +(vector-for-each +(vector-length +(vector-map +(vector-ref +(vector-set! +(vector? +(with-exception-handler +(write-bytevector +(write-char +(write-string +(write-u8 +(zero? + +; with brackets +[map +[max ---------------------------------------------------- [ - ["punctuation", "("], ["builtin", "cons"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "car"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "cdr"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "null?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "pair?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "boolean?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "eof-object?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "char?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "procedure?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "number?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "port?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "string?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "vector?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "symbol?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "bytevector?"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "list"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "call-with-current-continuation"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "call/cc"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "append"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "abs"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "apply"], ["punctuation", ")"], - ["punctuation", "("], ["builtin", "eval"], ["punctuation", ")"] + ["punctuation", "("], ["builtin", "abs"], + ["punctuation", "("], ["builtin", "and"], + ["punctuation", "("], ["builtin", "append"], + ["punctuation", "("], ["builtin", "apply"], + ["punctuation", "("], ["builtin", "assoc"], + ["punctuation", "("], ["builtin", "assq"], + ["punctuation", "("], ["builtin", "assv"], + ["punctuation", "("], ["builtin", "binary-port?"], + ["punctuation", "("], ["builtin", "boolean=?"], + ["punctuation", "("], ["builtin", "boolean?"], + ["punctuation", "("], ["builtin", "bytevector"], + ["punctuation", "("], ["builtin", "bytevector-append"], + ["punctuation", "("], ["builtin", "bytevector-copy"], + ["punctuation", "("], ["builtin", "bytevector-copy!"], + ["punctuation", "("], ["builtin", "bytevector-length"], + ["punctuation", "("], ["builtin", "bytevector-u8-ref"], + ["punctuation", "("], ["builtin", "bytevector-u8-set!"], + ["punctuation", "("], ["builtin", "bytevector?"], + ["punctuation", "("], ["builtin", "caar"], + ["punctuation", "("], ["builtin", "cadr"], + ["punctuation", "("], ["builtin", "call-with-current-continuation"], + ["punctuation", "("], ["builtin", "call-with-port"], + ["punctuation", "("], ["builtin", "call-with-values"], + ["punctuation", "("], ["builtin", "call/cc"], + ["punctuation", "("], ["builtin", "car"], + ["punctuation", "("], ["builtin", "cdar"], + ["punctuation", "("], ["builtin", "cddr"], + ["punctuation", "("], ["builtin", "cdr"], + ["punctuation", "("], ["builtin", "ceiling"], + ["punctuation", "("], ["builtin", "char->integer"], + ["punctuation", "("], ["builtin", "char-ready?"], + ["punctuation", "("], ["builtin", "char<=?"], + ["punctuation", "("], ["builtin", "char=?"], + ["punctuation", "("], ["builtin", "char>?"], + ["punctuation", "("], ["builtin", "char?"], + ["punctuation", "("], ["builtin", "close-input-port"], + ["punctuation", "("], ["builtin", "close-output-port"], + ["punctuation", "("], ["builtin", "close-port"], + ["punctuation", "("], ["builtin", "complex?"], + ["punctuation", "("], ["builtin", "cons"], + ["punctuation", "("], ["builtin", "current-error-port"], + ["punctuation", "("], ["builtin", "current-input-port"], + ["punctuation", "("], ["builtin", "current-output-port"], + ["punctuation", "("], ["builtin", "denominator"], + ["punctuation", "("], ["builtin", "dynamic-wind"], + ["punctuation", "("], ["builtin", "eof-object"], + ["punctuation", "("], ["builtin", "eof-object?"], + ["punctuation", "("], ["builtin", "eq?"], + ["punctuation", "("], ["builtin", "equal?"], + ["punctuation", "("], ["builtin", "eqv?"], + ["punctuation", "("], ["builtin", "error"], + ["punctuation", "("], ["builtin", "error-object-irritants"], + ["punctuation", "("], ["builtin", "error-object-message"], + ["punctuation", "("], ["builtin", "error-object?"], + ["punctuation", "("], ["builtin", "eval"], + ["punctuation", "("], ["builtin", "even?"], + ["punctuation", "("], ["builtin", "exact"], + ["punctuation", "("], ["builtin", "exact-integer-sqrt"], + ["punctuation", "("], ["builtin", "exact-integer?"], + ["punctuation", "("], ["builtin", "exact?"], + ["punctuation", "("], ["builtin", "expt"], + ["punctuation", "("], ["builtin", "features"], + ["punctuation", "("], ["builtin", "file-error?"], + ["punctuation", "("], ["builtin", "floor"], + ["punctuation", "("], ["builtin", "floor-quotient"], + ["punctuation", "("], ["builtin", "floor-remainder"], + ["punctuation", "("], ["builtin", "floor/"], + ["punctuation", "("], ["builtin", "flush-output-port"], + ["punctuation", "("], ["builtin", "for-each"], + ["punctuation", "("], ["builtin", "gcd"], + ["punctuation", "("], ["builtin", "get-output-bytevector"], + ["punctuation", "("], ["builtin", "get-output-string"], + ["punctuation", "("], ["builtin", "inexact"], + ["punctuation", "("], ["builtin", "inexact?"], + ["punctuation", "("], ["builtin", "input-port-open?"], + ["punctuation", "("], ["builtin", "input-port?"], + ["punctuation", "("], ["builtin", "integer->char"], + ["punctuation", "("], ["builtin", "integer?"], + ["punctuation", "("], ["builtin", "lcm"], + ["punctuation", "("], ["builtin", "length"], + ["punctuation", "("], ["builtin", "list"], + ["punctuation", "("], ["builtin", "list->string"], + ["punctuation", "("], ["builtin", "list->vector"], + ["punctuation", "("], ["builtin", "list-copy"], + ["punctuation", "("], ["builtin", "list-ref"], + ["punctuation", "("], ["builtin", "list-set!"], + ["punctuation", "("], ["builtin", "list-tail"], + ["punctuation", "("], ["builtin", "list?"], + ["punctuation", "("], ["builtin", "make-bytevector"], + ["punctuation", "("], ["builtin", "make-list"], + ["punctuation", "("], ["builtin", "make-parameter"], + ["punctuation", "("], ["builtin", "make-string"], + ["punctuation", "("], ["builtin", "make-vector"], + ["punctuation", "("], ["builtin", "map"], + ["punctuation", "("], ["builtin", "max"], + ["punctuation", "("], ["builtin", "member"], + ["punctuation", "("], ["builtin", "memq"], + ["punctuation", "("], ["builtin", "memv"], + ["punctuation", "("], ["builtin", "min"], + ["punctuation", "("], ["builtin", "modulo"], + ["punctuation", "("], ["builtin", "negative?"], + ["punctuation", "("], ["builtin", "newline"], + ["punctuation", "("], ["builtin", "not"], + ["punctuation", "("], ["builtin", "null?"], + ["punctuation", "("], ["builtin", "number->string"], + ["punctuation", "("], ["builtin", "number?"], + ["punctuation", "("], ["builtin", "numerator"], + ["punctuation", "("], ["builtin", "odd?"], + ["punctuation", "("], ["builtin", "open-input-bytevector"], + ["punctuation", "("], ["builtin", "open-input-string"], + ["punctuation", "("], ["builtin", "open-output-bytevector"], + ["punctuation", "("], ["builtin", "open-output-string"], + ["punctuation", "("], ["builtin", "or"], + ["punctuation", "("], ["builtin", "output-port-open?"], + ["punctuation", "("], ["builtin", "output-port?"], + ["punctuation", "("], ["builtin", "pair?"], + ["punctuation", "("], ["builtin", "peek-char"], + ["punctuation", "("], ["builtin", "peek-u8"], + ["punctuation", "("], ["builtin", "port?"], + ["punctuation", "("], ["builtin", "positive?"], + ["punctuation", "("], ["builtin", "procedure?"], + ["punctuation", "("], ["builtin", "quotient"], + ["punctuation", "("], ["builtin", "raise"], + ["punctuation", "("], ["builtin", "raise-continuable"], + ["punctuation", "("], ["builtin", "rational?"], + ["punctuation", "("], ["builtin", "rationalize"], + ["punctuation", "("], ["builtin", "read-bytevector"], + ["punctuation", "("], ["builtin", "read-bytevector!"], + ["punctuation", "("], ["builtin", "read-char"], + ["punctuation", "("], ["builtin", "read-error?"], + ["punctuation", "("], ["builtin", "read-line"], + ["punctuation", "("], ["builtin", "read-string"], + ["punctuation", "("], ["builtin", "read-u8"], + ["punctuation", "("], ["builtin", "real?"], + ["punctuation", "("], ["builtin", "remainder"], + ["punctuation", "("], ["builtin", "reverse"], + ["punctuation", "("], ["builtin", "round"], + ["punctuation", "("], ["builtin", "set-car!"], + ["punctuation", "("], ["builtin", "set-cdr!"], + ["punctuation", "("], ["builtin", "square"], + ["punctuation", "("], ["builtin", "string"], + ["punctuation", "("], ["builtin", "string->list"], + ["punctuation", "("], ["builtin", "string->number"], + ["punctuation", "("], ["builtin", "string->symbol"], + ["punctuation", "("], ["builtin", "string->utf8"], + ["punctuation", "("], ["builtin", "string->vector"], + ["punctuation", "("], ["builtin", "string-append"], + ["punctuation", "("], ["builtin", "string-copy"], + ["punctuation", "("], ["builtin", "string-copy!"], + ["punctuation", "("], ["builtin", "string-fill!"], + ["punctuation", "("], ["builtin", "string-for-each"], + ["punctuation", "("], ["builtin", "string-length"], + ["punctuation", "("], ["builtin", "string-map"], + ["punctuation", "("], ["builtin", "string-ref"], + ["punctuation", "("], ["builtin", "string-set!"], + ["punctuation", "("], ["builtin", "string<=?"], + ["punctuation", "("], ["builtin", "string=?"], + ["punctuation", "("], ["builtin", "string>?"], + ["punctuation", "("], ["builtin", "string?"], + ["punctuation", "("], ["builtin", "substring"], + ["punctuation", "("], ["builtin", "symbol->string"], + ["punctuation", "("], ["builtin", "symbol=?"], + ["punctuation", "("], ["builtin", "symbol?"], + ["punctuation", "("], ["builtin", "syntax-error"], + ["punctuation", "("], ["builtin", "textual-port?"], + ["punctuation", "("], ["builtin", "truncate"], + ["punctuation", "("], ["builtin", "truncate-quotient"], + ["punctuation", "("], ["builtin", "truncate-remainder"], + ["punctuation", "("], ["builtin", "truncate/"], + ["punctuation", "("], ["builtin", "u8-ready?"], + ["punctuation", "("], ["builtin", "utf8->string"], + ["punctuation", "("], ["builtin", "values"], + ["punctuation", "("], ["builtin", "vector"], + ["punctuation", "("], ["builtin", "vector->list"], + ["punctuation", "("], ["builtin", "vector->string"], + ["punctuation", "("], ["builtin", "vector-append"], + ["punctuation", "("], ["builtin", "vector-copy"], + ["punctuation", "("], ["builtin", "vector-copy!"], + ["punctuation", "("], ["builtin", "vector-fill!"], + ["punctuation", "("], ["builtin", "vector-for-each"], + ["punctuation", "("], ["builtin", "vector-length"], + ["punctuation", "("], ["builtin", "vector-map"], + ["punctuation", "("], ["builtin", "vector-ref"], + ["punctuation", "("], ["builtin", "vector-set!"], + ["punctuation", "("], ["builtin", "vector?"], + ["punctuation", "("], ["builtin", "with-exception-handler"], + ["punctuation", "("], ["builtin", "write-bytevector"], + ["punctuation", "("], ["builtin", "write-char"], + ["punctuation", "("], ["builtin", "write-string"], + ["punctuation", "("], ["builtin", "write-u8"], + ["punctuation", "("], ["builtin", "zero?"], + + ["comment", "; with brackets"], + ["punctuation", "["], ["builtin", "map"], + ["punctuation", "["], ["builtin", "max"] ] ---------------------------------------------------- diff --git a/tests/languages/scheme/char_feature.test b/tests/languages/scheme/char_feature.test new file mode 100644 index 0000000000..799cf5662c --- /dev/null +++ b/tests/languages/scheme/char_feature.test @@ -0,0 +1,43 @@ +#\a ; lowercase letter +#\A ; uppercase letter +#\( ; left parenthesis +#\space ; the space character +#\newline ; the newline character + +#\c-a ; Control-a +#\meta-b ; Meta-b +#\c-s-m-h-a ; Control-Meta-Super-Hyper-A + +#\; #\' #\" + +#\u0041 +#\x10FFFF +#\λ +#\) +#\💩 + +---------------------------------------------------- + +[ + ["char", "#\\a"], ["comment", "; lowercase letter"], + ["char", "#\\A"], ["comment", "; uppercase letter"], + ["char", "#\\("], ["comment", "; left parenthesis"], + ["char", "#\\space"], ["comment", "; the space character"], + ["char", "#\\newline"], ["comment", "; the newline character"], + + ["char", "#\\c-a"], ["comment", "; Control-a"], + ["char", "#\\meta-b"], ["comment", "; Meta-b"], + ["char", "#\\c-s-m-h-a"], ["comment", "; Control-Meta-Super-Hyper-A"], + + ["char", "#\\;"], ["char", "#\\'"], ["char", "#\\\""], + + ["char", "#\\u0041"], + ["char", "#\\x10FFFF"], + ["char", "#\\λ"], + ["char", "#\\)"], + ["char", "#\\💩"] +] + +---------------------------------------------------- + +Checks for character literals. diff --git a/tests/languages/scheme/character_feature.test b/tests/languages/scheme/character_feature.test deleted file mode 100644 index f95cb705bf..0000000000 --- a/tests/languages/scheme/character_feature.test +++ /dev/null @@ -1,51 +0,0 @@ -#\a ; lowercase letter -#\A ; uppercase letter -#\( ; left parenthesis -#\space ; the space character -#\newline ; the newline character - -#\c-a ; Control-a -#\meta-b ; Meta-b -#\c-s-m-h-a ; Control-Meta-Super-Hyper-A - -#\; #\' #\" - -#\u0041 -#\x10FFFF -#\λ -#\) - ----------------------------------------------------- - -[ - ["character", "#\\a"], - ["comment", "; lowercase letter"], - ["character", "#\\A"], - ["comment", "; uppercase letter"], - ["character", "#\\("], - ["comment", "; left parenthesis"], - ["character", "#\\space"], - ["comment", "; the space character"], - ["character", "#\\newline"], - ["comment", "; the newline character"], - - ["character", "#\\c-a"], - ["comment", "; Control-a"], - ["character", "#\\meta-b"], - ["comment", "; Meta-b"], - ["character", "#\\c-s-m-h-a"], - ["comment", "; Control-Meta-Super-Hyper-A"], - - ["character", "#\\;"], - ["character", "#\\'"], - ["character", "#\\\""], - - ["character", "#\\u0041"], - ["character", "#\\x10FFFF"], - ["character", "#\\λ"], - ["character", "#\\)"] -] - ----------------------------------------------------- - -Checks for character literals. diff --git a/tests/languages/scheme/comment_feature.test b/tests/languages/scheme/comment_feature.test index 85faefe78b..90ae5e8f5d 100644 --- a/tests/languages/scheme/comment_feature.test +++ b/tests/languages/scheme/comment_feature.test @@ -1,13 +1,30 @@ ; ; foobar +#;(foo bar) +#; (foo) +#;[foo bar] +#; [foo] + +#| + comment + #| nested comment |# +|# + ---------------------------------------------------- [ ["comment", ";"], - ["comment", "; foobar"] + ["comment", "; foobar"], + + ["comment", "#;(foo bar)"], + ["comment", "#; (foo)"], + ["comment", "#;[foo bar]"], + ["comment", "#; [foo]"], + + ["comment", "#|\r\n comment\r\n #| nested comment |#\r\n|#"] ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for comments. diff --git a/tests/languages/scheme/function_feature.test b/tests/languages/scheme/function_feature.test index 699ca063f4..cd470914ae 100644 --- a/tests/languages/scheme/function_feature.test +++ b/tests/languages/scheme/function_feature.test @@ -1,25 +1,101 @@ (fl= 1 2) (flmin 2 3) -(exact? 2) (inexact->exact 3) (!fact) (** 10) -(exact? (** (defined foo) +(|some name| foo) + +[fl= 1 2] +[flmin 2 3] +[inexact->exact 3] +[!fact] +[** 10] +[** +[defined foo] +[|some name| foo] ---------------------------------------------------- [ - ["punctuation", "("], ["function", "fl="], ["number", "1"], ["number", "2"], ["punctuation", ")"], - ["punctuation", "("], ["function", "flmin"], ["number", "2"], ["number", "3"], ["punctuation", ")"], - ["punctuation", "("], ["function", "exact?"], ["number", "2"], ["punctuation", ")"], - ["punctuation", "("], ["function", "inexact->exact"], ["number", "3"], ["punctuation", ")"], - ["punctuation", "("], ["function", "!fact"], ["punctuation", ")"], - ["punctuation", "("], ["function", "**"], ["number", "10"], ["punctuation", ")"], - ["punctuation", "("], ["function", "exact?"], - ["punctuation", "("], ["function", "**"], - ["punctuation", "("], ["function", "defined"], " foo", ["punctuation", ")"] + ["punctuation", "("], + ["function", "fl="], + ["number", "1"], + ["number", "2"], + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "flmin"], + ["number", "2"], + ["number", "3"], + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "inexact->exact"], + ["number", "3"], + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "!fact"], + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "**"], + ["number", "10"], + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "**"], + + ["punctuation", "("], + ["function", "defined"], + " foo", + ["punctuation", ")"], + + ["punctuation", "("], + ["function", "|some name|"], + " foo", + ["punctuation", ")"], + + ["punctuation", "["], + ["function", "fl="], + ["number", "1"], + ["number", "2"], + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "flmin"], + ["number", "2"], + ["number", "3"], + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "inexact->exact"], + ["number", "3"], + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "!fact"], + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "**"], + ["number", "10"], + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "**"], + + ["punctuation", "["], + ["function", "defined"], + " foo", + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "|some name|"], + " foo", + ["punctuation", "]"] ] ---------------------------------------------------- diff --git a/tests/languages/scheme/identifier_feature.test b/tests/languages/scheme/identifier_feature.test new file mode 100644 index 0000000000..0ac5d36a62 --- /dev/null +++ b/tests/languages/scheme/identifier_feature.test @@ -0,0 +1,7 @@ +|\x9;\x9;| + +---------------------------------------------------- + +[ + ["identifier", "|\\x9;\\x9;|"] +] \ No newline at end of file diff --git a/tests/languages/scheme/issue2609.test b/tests/languages/scheme/issue2609.test new file mode 100644 index 0000000000..88baf594e4 --- /dev/null +++ b/tests/languages/scheme/issue2609.test @@ -0,0 +1,30 @@ +'(foo bar baz) +`(foo bar baz) +#(foo bar baz) +'#(foo bar baz) + +---------------------------------------------------- + +[ + ["punctuation", "'"], + ["punctuation", "("], + "foo bar baz", + ["punctuation", ")"], + "\r\n`", + ["punctuation", "("], + "foo bar baz", + ["punctuation", ")"], + "\r\n#", + ["punctuation", "("], + "foo bar baz", + ["punctuation", ")"], + ["punctuation", "'"], + "#", + ["punctuation", "("], + "foo bar baz", + ["punctuation", ")"] +] + +---------------------------------------------------- + +None of the "foo"s are functions, so they shouldn't be highlighted as such. See #2609 for more details. \ No newline at end of file diff --git a/tests/languages/scheme/issue2811.test b/tests/languages/scheme/issue2811.test new file mode 100644 index 0000000000..16211fd696 --- /dev/null +++ b/tests/languages/scheme/issue2811.test @@ -0,0 +1,27 @@ +(let ([x 10] + [y 20]) + (+ x y)) + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["keyword", "let"], + ["punctuation", "("], + ["punctuation", "["], + ["function", "x"], + ["number", "10"], + ["punctuation", "]"], + + ["punctuation", "["], + ["function", "y"], + ["number", "20"], + ["punctuation", "]"], + ["punctuation", ")"], + + ["punctuation", "("], + ["operator", "+"], + " x y", + ["punctuation", ")"], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/scheme/keyword_feature.test b/tests/languages/scheme/keyword_feature.test index 53085d543d..25ffc29917 100644 --- a/tests/languages/scheme/keyword_feature.test +++ b/tests/languages/scheme/keyword_feature.test @@ -1,65 +1,256 @@ -(define) +(begin) +(case) +(case-lambda) +(cond) +(cond-expand) (define-library) (define-macro) +(define-record-type) (define-syntax) (define-values) +(define) (defmacro) -(case-lambda) +(delay-force) +(delay) +(do) +(else) +(export) +(except) +(guard) +(if) +(import) +(include) +(include-ci) +(include-library-declarations) (lambda) -(let) -(let*) -(letrec) +(let-syntax) (let-values) +(let) (let*-values) +(let*) +(letrec-syntax) (letrec-values) -(else) -(if) -(cond) -(begin) -(delay) -(delay-force) +(letrec) +(letrec*) +(only) (parameterize) -(guard) -(set!) +(prefix) (quasi-quote) +(quasiquote) (quote) -(syntax-rules) +(rename) +(set!) (syntax-case) -(letrec-syntax) -(let-syntax) +(syntax-rules) +(unless) +(unquote) +(unquote-splicing) +(when) + +; with brackets + +[if] +[when] ---------------------------------------------------- [ - ["punctuation", "("], ["keyword", "define"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "define-library"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "define-macro"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "define-syntax"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "define-values"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "defmacro"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "case-lambda"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "lambda"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "let"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "let*"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "letrec"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "let-values"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "let*-values"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "letrec-values"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "else"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "if"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "cond"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "begin"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "delay"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "delay-force"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "parameterize"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "guard"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "set!"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "quasi-quote"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "quote"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "syntax-rules"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "syntax-case"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "letrec-syntax"], ["punctuation", ")"], - ["punctuation", "("], ["keyword", "let-syntax"], ["punctuation", ")"] + ["punctuation", "("], + ["keyword", "begin"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "case"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "case-lambda"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "cond"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "cond-expand"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "define-library"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "define-macro"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "define-record-type"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "define-syntax"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "define-values"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "define"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "defmacro"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "delay-force"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "delay"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "do"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "else"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "export"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "except"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "guard"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "if"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "import"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "include"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "include-ci"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "include-library-declarations"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "lambda"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "let-syntax"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "let-values"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "let"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "let*-values"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "let*"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "letrec-syntax"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "letrec-values"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "letrec"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "letrec*"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "only"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "parameterize"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "prefix"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "quasi-quote"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "quasiquote"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "quote"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "rename"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "set!"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "syntax-case"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "syntax-rules"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "unless"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "unquote"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "unquote-splicing"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "when"], + ["punctuation", ")"], + + ["comment", "; with brackets"], + + ["punctuation", "["], ["keyword", "if"], ["punctuation", "]"], + ["punctuation", "["], ["keyword", "when"], ["punctuation", "]"] ] ---------------------------------------------------- diff --git a/tests/languages/scheme/lambda_parameter_feature.test b/tests/languages/scheme/lambda_parameter_feature.test index a076879750..2e56e03af1 100644 --- a/tests/languages/scheme/lambda_parameter_feature.test +++ b/tests/languages/scheme/lambda_parameter_feature.test @@ -1,6 +1,11 @@ (lambda x x) + +(lambda |some name| |some name|) + (lambda (x) x) + (lambda (foo bar) (concat foo bar)) +(lambda [foo bar] (concat foo bar)) ---------------------------------------------------- @@ -10,6 +15,13 @@ ["lambda-parameter", "x"], " x", ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "lambda"], + ["lambda-parameter", "|some name|"], + ["identifier", "|some name|"], + ["punctuation", ")"], + ["punctuation", "("], ["keyword", "lambda"], ["punctuation", "("], @@ -17,6 +29,7 @@ ["punctuation", ")"], " x", ["punctuation", ")"], + ["punctuation", "("], ["keyword", "lambda"], ["punctuation", "("], @@ -26,6 +39,17 @@ ["function", "concat"], " foo bar", ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "("], + ["keyword", "lambda"], + ["punctuation", "["], + ["lambda-parameter", "foo bar"], + ["punctuation", "]"], + ["punctuation", "("], + ["function", "concat"], + " foo bar", + ["punctuation", ")"], ["punctuation", ")"] ] diff --git a/tests/languages/scheme/number_feature.test b/tests/languages/scheme/number_feature.test index 2b51f1b464..9735d9b160 100644 --- a/tests/languages/scheme/number_feature.test +++ b/tests/languages/scheme/number_feature.test @@ -5,16 +5,36 @@ (foo 1e+3 1e-3 3.14159 3.14159e-1) (foo 8/3) (foo 3+4i 2.5+0.0i 2.5+0.0i -2.5e4+0.0e4i 3+0i -2e-5i) -(list 10i +10i -10i 10.10i 10+10i 10.10+10.10i 10-10i 10e+10i 10+10e+10i) +(list +10i -10i 10+10i 10.10+10.10i 10-10i 10+10e+10i) (list #d123 #e#d123e-4 #d#i12 #i-1.234i) (list #xBAD #b1110011 #o777) (list #i#x10 #i#x10+10i #b10+10i) +[list 123] + +10+i +10+.1i +10+1.i + +10.0E2 +10.0D2 +10.0L2 +10.0S2 +10.0F2 + +10.0e2 +10.0d2 +10.0l2 +10.0s2 +10.0f2 + ; not a number but a symbol (define 1+2 10) +(list 10.0P2 10.0g2 10.0w2) + ---------------------------------------------------- [ @@ -59,14 +79,11 @@ ["punctuation", "("], ["builtin", "list"], - ["number", "10i"], ["number", "+10i"], ["number", "-10i"], - ["number", "10.10i"], ["number", "10+10i"], ["number", "10.10+10.10i"], ["number", "10-10i"], - ["number", "10e+10i"], ["number", "10+10e+10i"], ["punctuation", ")"], @@ -92,8 +109,37 @@ ["number", "#b10+10i"], ["punctuation", ")"], + ["punctuation", "["], ["builtin", "list"], ["number", "123"], ["punctuation", "]"], + + ["number", "10+i"], + ["number", "10+.1i"], + ["number", "10+1.i"], + + ["number", "10.0E2"], + ["number", "10.0D2"], + ["number", "10.0L2"], + ["number", "10.0S2"], + ["number", "10.0F2"], + + ["number", "10.0e2"], + ["number", "10.0d2"], + ["number", "10.0l2"], + ["number", "10.0s2"], + ["number", "10.0f2"], + ["comment", "; not a number but a symbol"], - ["punctuation", "("], ["keyword", "define"], " 1+2 ", ["number", "10"], ["punctuation", ")"] + + ["punctuation", "("], + ["keyword", "define"], + " 1+2 ", + ["number", "10"], + ["punctuation", ")"], + + ["punctuation", "("], + ["builtin", "list"], + " 10.0P2 10.0g2 10.0w2", + ["punctuation", ")"] + ] ---------------------------------------------------- diff --git a/tests/languages/scheme/operator_feature.test b/tests/languages/scheme/operator_feature.test index 5904c1a3ed..245f0a2ac4 100644 --- a/tests/languages/scheme/operator_feature.test +++ b/tests/languages/scheme/operator_feature.test @@ -10,6 +10,10 @@ (= (=> +; with brackets +[= +[=> + ---------------------------------------------------- [ @@ -23,9 +27,13 @@ ["punctuation", "("], ["operator", ">"], ["punctuation", "("], ["operator", ">="], ["punctuation", "("], ["operator", "="], - ["punctuation", "("], ["operator", "=>"] + ["punctuation", "("], ["operator", "=>"], + + ["comment", "; with brackets"], + ["punctuation", "["], ["operator", "="], + ["punctuation", "["], ["operator", "=>"] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/scss+haml/scss_inclusion.test b/tests/languages/scss+haml/scss_inclusion.test index b2c545c45c..ab69f07839 100644 --- a/tests/languages/scss+haml/scss_inclusion.test +++ b/tests/languages/scss+haml/scss_inclusion.test @@ -14,27 +14,37 @@ [ ["filter-scss", [ ["filter-name", ":scss"], - ["selector", ["#main "]], - ["punctuation", "{"], - ["property", ["width"]], - ["punctuation", ":"], - ["variable", "$width"], - ["punctuation", ";"], - ["punctuation", "}"] + ["text", [ + ["selector", ["#main "]], + ["punctuation", "{"], + + ["property", ["width"]], + ["punctuation", ":"], + ["variable", "$width"], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] ]], + ["punctuation", "~"], + ["filter-scss", [ ["filter-name", ":scss"], - ["selector", ["#main "]], - ["punctuation", "{"], - ["property", ["width"]], - ["punctuation", ":"], - ["variable", "$width"], - ["punctuation", ";"], - ["punctuation", "}"] + ["text", [ + ["selector", ["#main "]], + ["punctuation", "{"], + + ["property", ["width"]], + ["punctuation", ":"], + ["variable", "$width"], + ["punctuation", ";"], + + ["punctuation", "}"] + ]] ]] ] ---------------------------------------------------- -Checks for CSS filter in Haml. The tilde serves only as a separator. \ No newline at end of file +Checks for CSS filter in Haml. The tilde serves only as a separator. diff --git a/tests/languages/scss+pug/scss_inclusion.test b/tests/languages/scss+pug/scss_inclusion.test index 035147844b..194355d36a 100644 --- a/tests/languages/scss+pug/scss_inclusion.test +++ b/tests/languages/scss+pug/scss_inclusion.test @@ -6,12 +6,14 @@ [ ["filter-sass", [ ["filter-name", ":sass"], - ["keyword", "@extend"], - " .foo", - ["punctuation", ";"] + ["text", [ + ["keyword", "@extend"], + " .foo", + ["punctuation", ";"] + ]] ]] ] ---------------------------------------------------- -Checks for sass filter (Scss) in Jade. \ No newline at end of file +Checks for sass filter (Scss) in pug. diff --git a/tests/languages/scss/keyword_feature.test b/tests/languages/scss/keyword_feature.test index 90ca11d519..be6eadd81e 100644 --- a/tests/languages/scss/keyword_feature.test +++ b/tests/languages/scss/keyword_feature.test @@ -1,6 +1,6 @@ @if @else if @else @for @each @while -@import @extend +@import @extend @use @forward @debug @warn @mixin @include @function @return @content @@ -12,7 +12,7 @@ [ ["keyword", "@if"], ["keyword", "@else if"], ["keyword", "@else"], ["keyword", "@for"], ["keyword", "@each"], ["keyword", "@while"], - ["keyword", "@import"], ["keyword", "@extend"], + ["keyword", "@import"], ["keyword", "@extend"], ["keyword", "@use"], ["keyword", "@forward"], ["keyword", "@debug"], ["keyword", "@warn"], ["keyword", "@mixin"], ["keyword", "@include"], ["keyword", "@function"], ["keyword", "@return"], ["keyword", "@content"], diff --git a/tests/languages/scss/module-modifier_feature.test b/tests/languages/scss/module-modifier_feature.test new file mode 100644 index 0000000000..1aa8615380 --- /dev/null +++ b/tests/languages/scss/module-modifier_feature.test @@ -0,0 +1,17 @@ +@use "foo" as bar; +@use "foo" with ($color: blue); +@forward "foo" show bar; +@forward "foo" hide baz; + +---------------------------------------------------- + +[ + ["keyword", "@use"], ["string", "\"foo\""], ["module-modifier", "as"], " bar", ["punctuation", ";"], + ["keyword", "@use"], ["string", "\"foo\""], ["module-modifier", "with"], ["punctuation", "("], ["property", [["variable", "$color"]]], ["punctuation", ":"], " blue", ["punctuation", ")"], ["punctuation", ";"], + ["keyword", "@forward"], ["string", "\"foo\""], ["module-modifier", "show"], " bar", ["punctuation", ";"], + ["keyword", "@forward"], ["string", "\"foo\""], ["module-modifier", "hide"], " baz", ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for Sass module modifiers diff --git a/tests/languages/shell-session/command_string_feature.test b/tests/languages/shell-session/command_string_feature.test index 4833cb4de1..930d0b62ca 100644 --- a/tests/languages/shell-session/command_string_feature.test +++ b/tests/languages/shell-session/command_string_feature.test @@ -1,5 +1,6 @@ $ echo 'Foo > Bar' + $ echo "Foo > Bar" @@ -15,6 +16,14 @@ STRING_END $ echo \'a # ' +$ cat << "EOF" > /etc/ipsec.secrets +: RSA vpn-server-a.key +# : RSA vpn-server-b.key +EOF + +$ LC_ALL=C tr -cd 'a-zA-Z0-9_-;:!?.@\\*/#%$' < /dev/random | head -c 8 +y_#!$U48 + ---------------------------------------------------- [ @@ -22,9 +31,7 @@ $ echo \'a # ' ["shell-symbol", "$"], ["bash", [ ["builtin", "echo"], - ["string", [ - "'Foo\r\n> Bar'" - ]] + ["string", "'Foo\r\n> Bar'"] ]] ]], @@ -32,9 +39,7 @@ $ echo \'a # ' ["shell-symbol", "$"], ["bash", [ ["builtin", "echo"], - ["string", [ - "\"Foo\r\n> Bar\"" - ]] + ["string", ["\"Foo\r\n> Bar\""]] ]] ]], @@ -42,12 +47,8 @@ $ echo \'a # ' ["shell-symbol", "$"], ["bash", [ ["builtin", "echo"], - ["operator", [ - "<<-" - ]], - ["string", [ - "STRING_END\r\nfoo\r\nbar\r\nSTRING_END" - ]] + ["operator", ["<<-"]], + ["string", ["STRING_END\r\nfoo\r\nbar\r\nSTRING_END"]] ]] ]], @@ -55,10 +56,8 @@ $ echo \'a # ' ["shell-symbol", "$"], ["bash", [ ["builtin", "echo"], - ["operator", [ - "<<-" - ]], - ["string", "\"STRING_END\"\r\nfoo\r\nbar\r\nSTRING_END"] + ["operator", ["<<-"]], + ["string", ["\"STRING_END\"\r\nfoo\r\nbar\r\nSTRING_END"]] ]] ]], @@ -68,10 +67,47 @@ $ echo \'a # ' ["builtin", "echo"], ["punctuation", "\\"], "'a ", - ["comment", "# "] + ["comment", "# '"] + ]] + ]], + + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["function", "cat"], + ["operator", ["<<"]], + ["string", [ + "\"EOF\"", + ["bash", [ + ["operator", [">"]], + " /etc/ipsec.secrets" + ]], + + "\r\n: RSA vpn-server-a.key\r\n# : RSA vpn-server-b.key\r\nEOF" + ]] + ]] + ]], + + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["assign-left", [ + ["environment", "LC_ALL"] + ]], + ["operator", ["="]], + "C ", + ["function", "tr"], + " -cd ", + ["string", "'a-zA-Z0-9_-;:!?.@\\\\*/#%$'"], + ["operator", ["<"]], + " /dev/random ", + ["operator", ["|"]], + ["function", "head"], + " -c ", + ["number", "8"] ]] ]], - ["output", "'"] + ["output", "y_#!$U48"] ] ---------------------------------------------------- diff --git a/tests/languages/shell-session/info_feature.test b/tests/languages/shell-session/info_feature.test index 446c8b3910..f8cf93d500 100644 --- a/tests/languages/shell-session/info_feature.test +++ b/tests/languages/shell-session/info_feature.test @@ -4,30 +4,30 @@ foo@bar:~$ sudo -i root@bar:~# echo "hello!" hello! -foo@bar$ exit +foo@bar$ zsh +foo@bar% exit ---------------------------------------------------- [ - ["info", [ - ["user", "foo@bar"], - ["punctuation", ":"], - ["path", "/var/local"] - ]], ["command", [ + ["info", [ + ["user", "foo@bar"], + ["punctuation", ":"], + ["path", "/var/local"] + ]], ["shell-symbol", "$"], ["bash", [ ["builtin", "cd"], " ~" ]] ]], - - ["info", [ - ["user", "foo@bar"], - ["punctuation", ":"], - ["path", "~"] - ]], ["command", [ + ["info", [ + ["user", "foo@bar"], + ["punctuation", ":"], + ["path", "~"] + ]], ["shell-symbol", "$"], ["bash", [ ["function", "sudo"], @@ -35,13 +35,12 @@ foo@bar$ exit ]] ]], ["output", "[sudo] password for foo:\r\n"], - - ["info", [ - ["user", "root@bar"], - ["punctuation", ":"], - ["path", "~"] - ]], ["command", [ + ["info", [ + ["user", "root@bar"], + ["punctuation", ":"], + ["path", "~"] + ]], ["shell-symbol", "#"], ["bash", [ ["builtin", "echo"], @@ -51,12 +50,20 @@ foo@bar$ exit ]] ]], ["output", "hello!\r\n\r\n"], - - ["info", [ - ["user", "foo@bar"] - ]], ["command", [ + ["info", [ + ["user", "foo@bar"] + ]], ["shell-symbol", "$"], + ["bash", [ + ["function", "zsh"] + ]] + ]], + ["command", [ + ["info", [ + ["user", "foo@bar"] + ]], + ["shell-symbol", "%"], ["bash", [ ["builtin", "exit"] ]] @@ -65,4 +72,4 @@ foo@bar$ exit ---------------------------------------------------- -Checks for the info bash outputs. +Checks for the info bash outputs. \ No newline at end of file diff --git a/tests/languages/shell-session/issue2644.test b/tests/languages/shell-session/issue2644.test new file mode 100644 index 0000000000..a066583735 --- /dev/null +++ b/tests/languages/shell-session/issue2644.test @@ -0,0 +1,55 @@ +$ export BORG_PASSCOMMAND="security find-generic-password -a $USER -s borg-passphrase -w" +$ export BORG_RSH="ssh -i ~/.ssh/borg" +$ borg init --encryption=keyfile-blake2 "borg@1.2.3.4:backup" + +By default repositories initialized with this version will produce security +errors if written to with an older version (up to and including Borg 1.0.8). + +If you want to use these older versions, you can disable the check by running: +borg upgrade --disable-tam ssh://borg@1.2.3.4/./backup + +See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications. + +IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo! +Use "borg key export" to export the key, optionally in printable format. +Write down the passphrase. Store both at safe place(s). + +--- + +---------------------------------------------------- + +[ + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["builtin", "export"], + ["assign-left", ["BORG_PASSCOMMAND"]], + ["operator", ["="]], + ["string", [ + "\"security find-generic-password -a ", + ["environment", "$USER"], + " -s borg-passphrase -w\"" + ]] + ]] + ]], + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["builtin", "export"], + ["assign-left", ["BORG_RSH"]], + ["operator", ["="]], + ["string", ["\"ssh -i ~/.ssh/borg\""]] + ]] + ]], + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + "borg init --encryption", + ["operator", ["="]], + "keyfile-blake2 ", + ["string", ["\"borg@1.2.3.4:backup\""]] + ]] + ]], + + ["output", "By default repositories initialized with this version will produce security\r\nerrors if written to with an older version (up to and including Borg 1.0.8).\r\n\r\nIf you want to use these older versions, you can disable the check by running:\r\nborg upgrade --disable-tam ssh://borg@1.2.3.4/./backup\r\n\r\nSee https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.\r\n\r\nIMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!\r\nUse \"borg key export\" to export the key, optionally in printable format.\r\nWrite down the passphrase. Store both at safe place(s).\r\n\r\n---"] +] diff --git a/tests/languages/shell-session/issue2685.test b/tests/languages/shell-session/issue2685.test new file mode 100644 index 0000000000..1601e39a32 --- /dev/null +++ b/tests/languages/shell-session/issue2685.test @@ -0,0 +1,29 @@ +/home/user$ echo "Hello World" +Hello World +/home/user$ exit + +---------------------------------------------------- + +[ + ["command", [ + ["info", [ + ["path", "/home/user"] + ]], + ["shell-symbol", "$"], + ["bash", [ + ["builtin", "echo"], + ["string", ["\"Hello World\""]] + ]] + ]], + + ["output", "Hello World\r\n"], + ["command", [ + ["info", [ + ["path", "/home/user"] + ]], + ["shell-symbol", "$"], + ["bash", [ + ["builtin", "exit"] + ]] + ]] +] diff --git a/tests/languages/shell-session/issue2871.test b/tests/languages/shell-session/issue2871.test new file mode 100644 index 0000000000..3446a14d09 --- /dev/null +++ b/tests/languages/shell-session/issue2871.test @@ -0,0 +1,29 @@ +fyu@home $ sudo ls -l ~/.config 's' && \ + echo 'hello' +drwxr-xr-x - franklinyu 26 Sep 2020 asciinema +drwxr-xr-x - franklinyu 26 Jan 2020 'bash' +hello + +---------------------------------------------------- + +[ + ["command", [ + ["info", [ + ["user", "fyu@home "] + ]], + ["shell-symbol", "$"], + ["bash", [ + ["function", "sudo"], + ["function", "ls"], + " -l ~/.config ", + ["string", "'s'"], + ["operator", ["&&"]], + ["punctuation", "\\"], + + ["builtin", "echo"], + ["string", "'hello'"] + ]] + ]], + + ["output", "drwxr-xr-x - franklinyu 26 Sep 2020 asciinema\r\ndrwxr-xr-x - franklinyu 26 Jan 2020 'bash'\r\nhello"] +] diff --git a/tests/languages/shell-session/issue3047_1.test b/tests/languages/shell-session/issue3047_1.test new file mode 100644 index 0000000000..ca9eec6be4 --- /dev/null +++ b/tests/languages/shell-session/issue3047_1.test @@ -0,0 +1,96 @@ +$ diskutil list +/dev/disk0 (internal, physical): + #: TYPE NAME SIZE IDENTIFIER + 0: GUID_partition_scheme *500.3 GB disk0 + 1: EFI EFI 209.7 MB disk0s1 + 2: Apple_APFS Container disk1 500.1 GB disk0s2 + +/dev/disk1 (synthesized): + #: TYPE NAME SIZE IDENTIFIER + 0: APFS Container Scheme - +500.1 GB disk1 + Physical Store disk0s2 + 1: APFS Volume Macintosh HD - Data 340.9 GB disk1s1 + 2: APFS Volume Preboot 85.9 MB disk1s2 + 3: APFS Volume Recovery 529.0 MB disk1s3 + 4: APFS Volume VM 3.2 GB disk1s4 + 5: APFS Volume Macintosh HD 11.3 GB disk1s5 + +/dev/disk2 (internal, physical): + #: TYPE NAME SIZE IDENTIFIER + 0: FDisk_partition_scheme *15.9 GB disk2 + 1: Windows_FAT_32 boot 268.4 MB disk2s1 + 2: Linux 15.7 GB disk2s2 + +$ sudo diskutil unmount /dev/diskn +disk2 was already unmounted or it has a partitioning scheme so use "diskutil unmountDisk" instead + +$ sudo diskutil unmountDisk /dev/diskn (if previous step fails) +Unmount of all volumes on disk2 was successful + +$ sudo dd bs=1m if=$HOME/Downloads/tails-amd64-4.18.img of=/dev/rdiskn +1131+0 records in +1131+0 records out +1185939456 bytes transferred in 44.708618 secs (26525970 bytes/sec) + +$ sudo diskutil unmountDisk /dev/diskn +Unmount of all volumes on disk2 was successful + +---------------------------------------------------- + +[ + ["command", [ + ["shell-symbol", "$"], + ["bash", ["diskutil list"]] + ]], + + ["output", "/dev/disk0 (internal, physical):\r\n #: TYPE NAME SIZE IDENTIFIER\r\n 0: GUID_partition_scheme *500.3 GB disk0\r\n 1: EFI EFI 209.7 MB disk0s1\r\n 2: Apple_APFS Container disk1 500.1 GB disk0s2\r\n\r\n/dev/disk1 (synthesized):\r\n #: TYPE NAME SIZE IDENTIFIER\r\n 0: APFS Container Scheme - +500.1 GB disk1\r\n Physical Store disk0s2\r\n 1: APFS Volume Macintosh HD - Data 340.9 GB disk1s1\r\n 2: APFS Volume Preboot 85.9 MB disk1s2\r\n 3: APFS Volume Recovery 529.0 MB disk1s3\r\n 4: APFS Volume VM 3.2 GB disk1s4\r\n 5: APFS Volume Macintosh HD 11.3 GB disk1s5\r\n\r\n/dev/disk2 (internal, physical):\r\n #: TYPE NAME SIZE IDENTIFIER\r\n 0: FDisk_partition_scheme *15.9 GB disk2\r\n 1: Windows_FAT_32 boot 268.4 MB disk2s1\r\n 2: Linux 15.7 GB disk2s2\r\n\r\n"], + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["function", "sudo"], + " diskutil unmount /dev/diskn" + ]] + ]], + + ["output", "disk2 was already unmounted or it has a partitioning scheme so use \"diskutil unmountDisk\" instead\r\n\r\n"], + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["function", "sudo"], + " diskutil unmountDisk /dev/diskn ", + ["punctuation", "("], + "if previous step fails", + ["punctuation", ")"] + ]] + ]], + + ["output", "Unmount of all volumes on disk2 was successful\r\n\r\n"], + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["function", "sudo"], + ["function", "dd"], + ["assign-left", ["bs"]], + ["operator", ["="]], + "1m ", + ["assign-left", ["if"]], + ["operator", ["="]], + ["environment", "$HOME"], + "/Downloads/tails-amd64-4.18.img ", + ["assign-left", ["of"]], + ["operator", ["="]], + "/dev/rdiskn" + ]] + ]], + + ["output", "1131+0 records in\r\n1131+0 records out\r\n1185939456 bytes transferred in 44.708618 secs (26525970 bytes/sec)\r\n\r\n"], + ["command", [ + ["shell-symbol", "$"], + ["bash", [ + ["function", "sudo"], + " diskutil unmountDisk /dev/diskn" + ]] + ]], + + ["output", "Unmount of all volumes on disk2 was successful"] +] diff --git a/tests/languages/shell-session/issue3047_2.test b/tests/languages/shell-session/issue3047_2.test new file mode 100644 index 0000000000..40e03e67d9 --- /dev/null +++ b/tests/languages/shell-session/issue3047_2.test @@ -0,0 +1,43 @@ +$ gpg --card-status +Reader ...........: Yubico YubiKey CCID +Application ID ...: D******************************* +Application type .: OpenPGP +Version ..........: 0.0 +Manufacturer .....: Yubico +Serial number ....: 1******* +Name of cardholder: John Doe +Language prefs ...: en +Salutation .......: +URL of public key : [not set] +Login data .......: john@example.net +Signature PIN ....: not forced +Key attributes ...: ed25519 cv25519 ed25519 +Max. PIN lengths .: 127 127 127 +PIN retry counter : 3 0 3 +Signature counter : 0 +KDF setting ......: off +UIF setting ......: Sign=on Decrypt=on Auth=on +Signature key ....: ACE1 3F15 90C1 A8C9 D942 51E3 02ED C61B 6543 509B + created ....: 2021-07-21 18:44:34 +Encryption key....: 0524 00F4 8E1D 085A F3E1 61EC D463 4E0D 6E2D D8BF + created ....: 2021-07-21 18:44:52 +Authentication key: A27B 582F 1F62 03BA 549B 3D44 1E7B 69B2 38FF A21B + created ....: 2021-07-21 18:45:13 +General key info..: sub ed25519/0x02EDC61B6543509B 2021-07-21 John Doe +sec# ed25519/0xC2709D13BAB4763C created: 2021-07-21 expires: never +ssb> ed25519/0x02EDC61B6543509B created: 2021-07-21 expires: 2022-07-21 + card-no: 0006 1******* +ssb> cv25519/0xD4634E0D6E2DD8BF created: 2021-07-21 expires: 2022-07-21 + card-no: 0006 1******* +ssb> ed25519/0x1E7B69B238FFA21B created: 2021-07-21 expires: 2022-07-21 + card-no: 0006 1******* + +---------------------------------------------------- + +[ + ["command", [ + ["shell-symbol", "$"], + ["bash", ["gpg --card-status"]] + ]], + ["output", "Reader ...........: Yubico YubiKey CCID\r\nApplication ID ...: D*******************************\r\nApplication type .: OpenPGP\r\nVersion ..........: 0.0\r\nManufacturer .....: Yubico\r\nSerial number ....: 1*******\r\nName of cardholder: John Doe\r\nLanguage prefs ...: en\r\nSalutation .......:\r\nURL of public key : [not set]\r\nLogin data .......: john@example.net\r\nSignature PIN ....: not forced\r\nKey attributes ...: ed25519 cv25519 ed25519\r\nMax. PIN lengths .: 127 127 127\r\nPIN retry counter : 3 0 3\r\nSignature counter : 0\r\nKDF setting ......: off\r\nUIF setting ......: Sign=on Decrypt=on Auth=on\r\nSignature key ....: ACE1 3F15 90C1 A8C9 D942 51E3 02ED C61B 6543 509B\r\n created ....: 2021-07-21 18:44:34\r\nEncryption key....: 0524 00F4 8E1D 085A F3E1 61EC D463 4E0D 6E2D D8BF\r\n created ....: 2021-07-21 18:44:52\r\nAuthentication key: A27B 582F 1F62 03BA 549B 3D44 1E7B 69B2 38FF A21B\r\n created ....: 2021-07-21 18:45:13\r\nGeneral key info..: sub ed25519/0x02EDC61B6543509B 2021-07-21 John Doe \r\nsec# ed25519/0xC2709D13BAB4763C created: 2021-07-21 expires: never\r\nssb> ed25519/0x02EDC61B6543509B created: 2021-07-21 expires: 2022-07-21\r\n card-no: 0006 1*******\r\nssb> cv25519/0xD4634E0D6E2DD8BF created: 2021-07-21 expires: 2022-07-21\r\n card-no: 0006 1*******\r\nssb> ed25519/0x1E7B69B238FFA21B created: 2021-07-21 expires: 2022-07-21\r\n card-no: 0006 1*******"] +] diff --git a/tests/languages/smali/builtin_feature.test b/tests/languages/smali/builtin_feature.test new file mode 100644 index 0000000000..46eba70331 --- /dev/null +++ b/tests/languages/smali/builtin_feature.test @@ -0,0 +1,73 @@ +new-array v0, v0, [I + +.method static constructor ()V + +.field mWifiOnUid:I + +.field public static mWifiRunning:Z = false +.field public static final PI:D = 3.141592653589793 + +.field static final LOG_TAG:Ljava/lang/String; = "CDMA" + +---------------------------------------------------- + +[ + "new-array ", + ["register", "v0"], + ["punctuation", ","], + ["register", "v0"], + ["punctuation", ","], + ["operator", "["], + ["builtin", "I"], + + ["keyword", ".method"], + ["keyword", "static"], + ["keyword", "constructor"], + ["function", ""], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "V"], + + ["keyword", ".field"], + ["field", "mWifiOnUid"], + ["punctuation", ":"], + ["builtin", "I"], + + ["keyword", ".field"], + ["keyword", "public"], + ["keyword", "static"], + ["field", "mWifiRunning"], + ["punctuation", ":"], + ["builtin", "Z"], + ["operator", "="], + ["boolean", "false"], + + ["keyword", ".field"], + ["keyword", "public"], + ["keyword", "static"], + ["keyword", "final"], + ["field", "PI"], + ["punctuation", ":"], + ["builtin", "D"], + ["operator", "="], + ["number", "3.141592653589793"], + + ["keyword", ".field"], + ["keyword", "static"], + ["keyword", "final"], + ["field", "LOG_TAG"], + ["punctuation", ":"], + ["class-name", [ + ["builtin", "L"], + ["namespace", [ + "java", + ["punctuation", "/"], + "lang", + ["punctuation", "/"] + ]], + ["class-name", "String"] + ]], + ["punctuation", ";"], + ["operator", "="], + ["string", "\"CDMA\""] +] diff --git a/tests/languages/smali/label_feature.test b/tests/languages/smali/label_feature.test new file mode 100644 index 0000000000..6a45b9bfdb --- /dev/null +++ b/tests/languages/smali/label_feature.test @@ -0,0 +1,13 @@ +.line 989 +:cond_2b + +goto :goto_1f + +---------------------------------------------------- + +[ + ["keyword", ".line"], ["number", "989"], + ["punctuation", ":"], ["label", "cond_2b"], + + "\r\n\r\ngoto ", ["punctuation", ":"], ["label", "goto_1f"] +] diff --git a/tests/languages/smali/register_feature.test b/tests/languages/smali/register_feature.test new file mode 100644 index 0000000000..33eaa86a51 --- /dev/null +++ b/tests/languages/smali/register_feature.test @@ -0,0 +1,28 @@ +move v1, p1 + +move v2, p2 + +move-object v4, p3 + +move v5, p4 + +---------------------------------------------------- + +[ + "move ", ["register", "v1"], ["punctuation", ","], ["register", "p1"], + + "\r\n\r\nmove ", + ["register", "v2"], + ["punctuation", ","], + ["register", "p2"], + + "\r\n\r\nmove-object ", + ["register", "v4"], + ["punctuation", ","], + ["register", "p3"], + + "\r\n\r\nmove ", + ["register", "v5"], + ["punctuation", ","], + ["register", "p4"] +] diff --git a/tests/languages/smalltalk/boolean_feature.test b/tests/languages/smalltalk/boolean_feature.test new file mode 100644 index 0000000000..e002f72d44 --- /dev/null +++ b/tests/languages/smalltalk/boolean_feature.test @@ -0,0 +1,8 @@ +true false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] diff --git a/tests/languages/smalltalk/char_feature.test b/tests/languages/smalltalk/char_feature.test new file mode 100644 index 0000000000..6c3bd04b7d --- /dev/null +++ b/tests/languages/smalltalk/char_feature.test @@ -0,0 +1,17 @@ +$a +$4 +$. +$^ + +---------------------------------------------------- + +[ + ["char", "$a"], + ["char", "$4"], + ["char", "$."], + ["char", "$^"] +] + +---------------------------------------------------- + +Checks for characters. diff --git a/tests/languages/smalltalk/character_feature.test b/tests/languages/smalltalk/character_feature.test deleted file mode 100644 index 096cf713b4..0000000000 --- a/tests/languages/smalltalk/character_feature.test +++ /dev/null @@ -1,17 +0,0 @@ -$a -$4 -$. -$^ - ----------------------------------------------------- - -[ - ["character", "$a"], - ["character", "$4"], - ["character", "$."], - ["character", "$^"] -] - ----------------------------------------------------- - -Checks for characters. \ No newline at end of file diff --git a/tests/languages/smalltalk/keyword_feature.test b/tests/languages/smalltalk/keyword_feature.test index 253c192226..85e80a94ee 100644 --- a/tests/languages/smalltalk/keyword_feature.test +++ b/tests/languages/smalltalk/keyword_feature.test @@ -1,13 +1,13 @@ -nil true false +nil self super new ---------------------------------------------------- [ - ["keyword", "nil"], ["keyword", "true"], ["keyword", "false"], + ["keyword", "nil"], ["keyword", "self"], ["keyword", "super"], ["keyword", "new"] ] ---------------------------------------------------- -Checks for keywords. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/smalltalk/string_character_feature.test b/tests/languages/smalltalk/string_char_feature.test similarity index 85% rename from tests/languages/smalltalk/string_character_feature.test rename to tests/languages/smalltalk/string_char_feature.test index 83e057c464..4750cd2e1f 100644 --- a/tests/languages/smalltalk/string_character_feature.test +++ b/tests/languages/smalltalk/string_char_feature.test @@ -1,13 +1,13 @@ -$' -'foobar' - ----------------------------------------------------- - -[ - ["character", "$'"], - ["string", "'foobar'"] -] - ----------------------------------------------------- - -Checks a single-quote-character doesn't confuse string parsing. +$' +'foobar' + +---------------------------------------------------- + +[ + ["char", "$'"], + ["string", "'foobar'"] +] + +---------------------------------------------------- + +Checks a single-quote-character doesn't confuse string parsing. diff --git a/tests/languages/smarty!+php/inclusion.test b/tests/languages/smarty!+php/inclusion.test new file mode 100644 index 0000000000..8f1b5e8d3c --- /dev/null +++ b/tests/languages/smarty!+php/inclusion.test @@ -0,0 +1,121 @@ +{php} + // including a php script directly from the template. + include('/path/to/display_weather.php'); +{/php} + +{* this template includes a {php} block that assign's the variable $varX *} +{php} + global $foo, $bar; + if($foo == $bar){ + echo 'This will be sent to browser'; + } + // assign a variable to Smarty + $this->assign('varX','Toffee'); +{/php} +{* output the variable *} +{$varX} is my fav ice cream :-) + +---------------------------------------------------- + +[ + ["smarty", [ + ["embedded-php", [ + ["smarty", [ + ["delimiter", "{"], + ["keyword", "php"], + ["delimiter", "}"] + ]], + ["php", [ + ["comment", "// including a php script directly from the template."], + + ["keyword", "include"], + ["punctuation", "("], + ["string", "'/path/to/display_weather.php'"], + ["punctuation", ")"], + ["punctuation", ";"] + ]], + ["smarty", [ + ["delimiter", "{/"], + ["keyword", "php"], + ["delimiter", "}"] + ]] + ]] + ]], + + ["smarty", [ + ["comment", "{* this template includes a {php} block that assign's the variable $varX *}"] + ]], + + ["smarty", [ + ["embedded-php", [ + ["smarty", [ + ["delimiter", "{"], + ["keyword", "php"], + ["delimiter", "}"] + ]], + ["php", [ + ["keyword", "global"], + ["variable", "$foo"], + ["punctuation", ","], + ["variable", "$bar"], + ["punctuation", ";"], + + ["keyword", "if"], + ["punctuation", "("], + ["variable", "$foo"], + ["operator", "=="], + ["variable", "$bar"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "echo"], + ["string", "'This will be sent to browser'"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["comment", "// assign a variable to Smarty"], + + ["variable", "$this"], + ["operator", "->"], + ["function", ["assign"]], + ["punctuation", "("], + ["string", "'varX'"], + ["punctuation", ","], + ["string", "'Toffee'"], + ["punctuation", ")"], + ["punctuation", ";"] + ]], + ["smarty", [ + ["delimiter", "{/"], + ["keyword", "php"], + ["delimiter", "}"] + ]] + ]] + ]], + + ["smarty", [ + ["comment", "{* output the variable *}"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "strong" + ]], + ["punctuation", ">"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$varX"], + ["delimiter", "}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + " is my fav ice cream :-)" +] diff --git a/tests/languages/smarty/attr-name_feature.test b/tests/languages/smarty/attr-name_feature.test index 11697a5b4d..354dce89d7 100644 --- a/tests/languages/smarty/attr-name_feature.test +++ b/tests/languages/smarty/attr-name_feature.test @@ -6,26 +6,20 @@ [ ["smarty", [ ["delimiter", "{"], - ["function", "assign"], - ["attr-name", [ - "var", - ["operator", "="], - ["variable", "foo"] - ]], - ["attr-name", [ - "value", - ["operator", "="] - ]], - ["string", "\"bar\""], + ["keyword", "assign"], + ["attr-name", "var"], + ["operator", "="], + ["variable", "foo"], + ["attr-name", "value"], + ["operator", "="], + ["string", ["\"bar\""]], ["delimiter", "}"] ]], ["smarty", [ ["delimiter", "{"], - ["function", "foo"], - ["attr-name", [ - "bar ", - ["operator", "="] - ]], + ["keyword", "foo"], + ["attr-name", "bar"], + ["operator", "="], ["number", "40"], ["delimiter", "}"] ]] @@ -33,4 +27,4 @@ ---------------------------------------------------- -Checks for attributes. \ No newline at end of file +Checks for attributes. diff --git a/tests/languages/smarty/booelan_feature.test b/tests/languages/smarty/booelan_feature.test new file mode 100644 index 0000000000..12b777689d --- /dev/null +++ b/tests/languages/smarty/booelan_feature.test @@ -0,0 +1,51 @@ +{if false} +{if off} +{if on} +{if no} +{if true} +{if yes} + +---------------------------------------------------- + +[ + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["boolean", "false"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["boolean", "off"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["boolean", "on"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["boolean", "no"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["boolean", "true"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["boolean", "yes"], + ["delimiter", "}"] + ]] +] + +---------------------------------------------------- + +Checks for keywords. diff --git a/tests/languages/smarty/comment_feature.test b/tests/languages/smarty/comment_feature.test index 616ed1fc9d..9106d4efc9 100644 --- a/tests/languages/smarty/comment_feature.test +++ b/tests/languages/smarty/comment_feature.test @@ -2,13 +2,29 @@ {* foo bar *} +{* you cannot nest comments *} +{* {* foo *} *} + ---------------------------------------------------- [ - ["smarty", [["comment", "{**}"]]], - ["smarty", [["comment", "{* foo\r\nbar *}"]]] + ["smarty", [ + ["comment", "{**}"] + ]], + ["smarty", [ + ["comment", "{* foo\r\nbar *}"] + ]], + + ["smarty", [ + ["comment", "{* you cannot nest comments *}"] + ]], + + ["smarty", [ + ["comment", "{* {* foo *}"] + ]], + " *}" ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for comments. diff --git a/tests/languages/smarty/function_feature.test b/tests/languages/smarty/function_feature.test index e138bb9493..51e0df99de 100644 --- a/tests/languages/smarty/function_feature.test +++ b/tests/languages/smarty/function_feature.test @@ -8,7 +8,7 @@ [ ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["function", "count"], ["punctuation", "("], ["variable", "$foo"], @@ -30,12 +30,12 @@ ["delimiter", "}"] ]], ["smarty", [ - ["delimiter", "{"], - ["function", "/if"], + ["delimiter", "{/"], + ["keyword", "if"], ["delimiter", "}"] ]] ] ---------------------------------------------------- -Checks for tags, filters and functions. \ No newline at end of file +Checks for tags, filters and functions. diff --git a/tests/languages/smarty/keyword_feature.test b/tests/languages/smarty/keyword_feature.test index 0f714f2fa4..8d5de3ebb4 100644 --- a/tests/languages/smarty/keyword_feature.test +++ b/tests/languages/smarty/keyword_feature.test @@ -1,51 +1,35 @@ -{if false} -{if off} -{if on} -{if no} -{if true} -{if yes} - ----------------------------------------------------- - -[ - ["smarty", [ - ["delimiter", "{"], - ["function", "if"], - ["keyword", "false"], - ["delimiter", "}"] - ]], - ["smarty", [ - ["delimiter", "{"], - ["function", "if"], - ["keyword", "off"], - ["delimiter", "}"] - ]], - ["smarty", [ - ["delimiter", "{"], - ["function", "if"], - ["keyword", "on"], - ["delimiter", "}"] - ]], - ["smarty", [ - ["delimiter", "{"], - ["function", "if"], - ["keyword", "no"], - ["delimiter", "}"] - ]], - ["smarty", [ - ["delimiter", "{"], - ["function", "if"], - ["keyword", "true"], - ["delimiter", "}"] - ]], - ["smarty", [ - ["delimiter", "{"], - ["function", "if"], - ["keyword", "yes"], - ["delimiter", "}"] - ]] -] - ----------------------------------------------------- - -Checks for keywords. \ No newline at end of file +{if count($foo)} +{/if} + +{* PHP function *} +{time()} + +---------------------------------------------------- + +[ + ["smarty", [ + ["delimiter", "{"], + ["keyword", "if"], + ["function", "count"], + ["punctuation", "("], + ["variable", "$foo"], + ["punctuation", ")"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{/"], + ["keyword", "if"], + ["delimiter", "}"] + ]], + + ["smarty", [ + ["comment", "{* PHP function *}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["function", "time"], + ["punctuation", "("], + ["punctuation", ")"], + ["delimiter", "}"] + ]] +] diff --git a/tests/languages/smarty/operator_feature.test b/tests/languages/smarty/operator_feature.test index c296fa3f1a..725a01446f 100644 --- a/tests/languages/smarty/operator_feature.test +++ b/tests/languages/smarty/operator_feature.test @@ -17,7 +17,7 @@ [ ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$a"], ["operator", "+"], ["variable", "$b"], @@ -29,7 +29,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$e"], ["operator", "*"], ["variable", "$f"], @@ -43,7 +43,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$j"], ["operator", "<"], ["variable", "$k"], @@ -63,7 +63,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["operator", "!"], ["variable", "$r"], ["operator", "!="], @@ -76,7 +76,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$v"], ["operator", "is not even by"], ["number", "3"], @@ -87,7 +87,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$w"], ["operator", "is div by"], ["number", "2"], @@ -99,7 +99,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$x"], ["operator", "is not odd"], ["operator", "or"], @@ -110,7 +110,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$y"], ["operator", "ne"], ["variable", "$z"], @@ -122,7 +122,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$c"], ["operator", "gt"], ["variable", "$d"], @@ -134,7 +134,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["variable", "$g"], ["operator", "gte"], ["variable", "$h"], @@ -154,7 +154,7 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "if"], + ["keyword", "if"], ["operator", "not"], ["variable", "$o"], ["operator", "and"], @@ -165,12 +165,10 @@ ]], ["smarty", [ ["delimiter", "{"], - ["function", "foo"], - ["attr-name", [ - "bar", - ["operator", "="], - ["variable", "baz"] - ]], + ["keyword", "foo"], + ["attr-name", "bar"], + ["operator", "="], + ["variable", "baz"], ["delimiter", "}"] ]], ["smarty", [ @@ -184,4 +182,4 @@ ---------------------------------------------------- -Checks for all operators. \ No newline at end of file +Checks for all operators. diff --git a/tests/languages/smarty/php_feature.test b/tests/languages/smarty/php_feature.test new file mode 100644 index 0000000000..e529763bdb --- /dev/null +++ b/tests/languages/smarty/php_feature.test @@ -0,0 +1,81 @@ +{php} + // including a php script directly from the template. + include('/path/to/display_weather.php'); +{/php} + +{* this template includes a {php} block that assign's the variable $varX *} +{php} + global $foo, $bar; + if($foo == $bar){ + echo 'This will be sent to browser'; + } + // assign a variable to Smarty + $this->assign('varX','Toffee'); +{/php} +{* output the variable *} +{$varX} is my fav ice cream :-) + +---------------------------------------------------- + +[ + ["smarty", [ + ["embedded-php", [ + ["smarty", [ + ["delimiter", "{"], + ["keyword", "php"], + ["delimiter", "}"] + ]], + ["php", "\r\n // including a php script directly from the template.\r\n include('/path/to/display_weather.php');\r\n"], + ["smarty", [ + ["delimiter", "{/"], + ["keyword", "php"], + ["delimiter", "}"] + ]] + ]] + ]], + + ["smarty", [ + ["comment", "{* this template includes a {php} block that assign's the variable $varX *}"] + ]], + + ["smarty", [ + ["embedded-php", [ + ["smarty", [ + ["delimiter", "{"], + ["keyword", "php"], + ["delimiter", "}"] + ]], + ["php", "\r\n global $foo, $bar;\r\n if($foo == $bar){\r\n echo 'This will be sent to browser';\r\n }\r\n // assign a variable to Smarty\r\n $this->assign('varX','Toffee');\r\n"], + ["smarty", [ + ["delimiter", "{/"], + ["keyword", "php"], + ["delimiter", "}"] + ]] + ]] + ]], + + ["smarty", [ + ["comment", "{* output the variable *}"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "strong" + ]], + ["punctuation", ">"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$varX"], + ["delimiter", "}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + " is my fav ice cream :-)" +] diff --git a/tests/languages/smarty/punctuation_feature.test b/tests/languages/smarty/punctuation_feature.test new file mode 100644 index 0000000000..ca485e887f --- /dev/null +++ b/tests/languages/smarty/punctuation_feature.test @@ -0,0 +1,33 @@ +{foo + +( ) [ ] { } +. : , +` +-> + +} + +---------------------------------------------------- + +[ + ["smarty", [ + ["delimiter", "{"], ["keyword", "foo"], + + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "."], + ["punctuation", ":"], + ["punctuation", ","], + + ["punctuation", "`"], + + ["punctuation", "->"], + + ["delimiter", "}"] + ]] +] diff --git a/tests/languages/smarty/string_feature.test b/tests/languages/smarty/string_feature.test index 31f6e79576..d39e92aad2 100644 --- a/tests/languages/smarty/string_feature.test +++ b/tests/languages/smarty/string_feature.test @@ -2,18 +2,45 @@ {"fo\"obar"} {''} {'fo\'obar'} +{$foo="this is message {counter}"} + +{func var="test $foo test"} // sees $foo +{func var="test $foo_bar test"} // sees $foo_bar +{func var="test `$foo[0]` test"} // sees $foo[0] +{func var="test `$foo[bar]` test"} // sees $foo[bar] +{func var="test $foo.bar test"} // sees $foo (not $foo.bar) +{func var="test `$foo.bar` test"} // sees $foo.bar +{func var="test `$foo.bar` test"|escape} // modifiers outside quotes! +{func var="test {$foo|escape} test"} // modifiers inside quotes! +{func var="test {time()} test"} // PHP function result +{func var="test {counter} test"} // plugin result + +{* will replace $tpl_name with value *} +{include file="subdir/$tpl_name.tpl"} + +{* does NOT replace $tpl_name *} +{include file='subdir/$tpl_name.tpl'} // vars require double quotes! + +{* must have backticks as it contains a dot "." *} +{cycle values="one,two,`$smarty.config.myval`"} + +{* must have backticks as it contains a dot "." *} +{include file="`$module.contact`.tpl"} + +{* can use variable with dot syntax *} +{include file="`$module.$view`.tpl"} ---------------------------------------------------- [ ["smarty", [ ["delimiter", "{"], - ["string", "\"\""], + ["string", ["\"\""]], ["delimiter", "}"] ]], ["smarty", [ ["delimiter", "{"], - ["string", "\"fo\\\"obar\""], + ["string", ["\"fo\\\"obar\""]], ["delimiter", "}"] ]], ["smarty", [ @@ -25,9 +52,324 @@ ["delimiter", "{"], ["string", "'fo\\'obar'"], ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["operator", "="], + ["string", [ + "\"this is message ", + ["interpolation", [ + ["interpolation-punctuation", "{"], + ["expression", ["counter"]], + ["interpolation-punctuation", "}"] + ]], + "\"" + ]], + ["delimiter", "}"] + ]], + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["variable", "$foo"], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // sees $foo\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["variable", "$foo_bar"], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // sees $foo_bar\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$foo"], + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"] + ]], + ["interpolation-punctuation", "`"] + ]], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // sees $foo[0]\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$foo"], + ["punctuation", "["], + ["variable", "bar"], + ["punctuation", "]"] + ]], + ["interpolation-punctuation", "`"] + ]], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // sees $foo[bar]\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["variable", "$foo"], + ".bar test\"" + ]], + ["delimiter", "}"] + ]], + " // sees $foo (not $foo.bar)\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$foo"], + ["punctuation", "."], + ["variable", "bar"] + ]], + ["interpolation-punctuation", "`"] + ]], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // sees $foo.bar\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$foo"], + ["punctuation", "."], + ["variable", "bar"] + ]], + ["interpolation-punctuation", "`"] + ]], + " test\"" + ]], + ["operator", "|"], + ["function", "escape"], + ["delimiter", "}"] + ]], + " // modifiers outside quotes!\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "{"], + ["expression", [ + ["variable", "$foo"], + ["operator", "|"], + ["function", "escape"] + ]], + ["interpolation-punctuation", "}"] + ]], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // modifiers inside quotes!\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "{"], + ["expression", [ + ["function", "time"], + ["punctuation", "("], + ["punctuation", ")"] + ]], + ["interpolation-punctuation", "}"] + ]], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // PHP function result\r\n", + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "func"], + ["attr-name", "var"], + ["operator", "="], + ["string", [ + "\"test ", + ["interpolation", [ + ["interpolation-punctuation", "{"], + ["expression", ["counter"]], + ["interpolation-punctuation", "}"] + ]], + " test\"" + ]], + ["delimiter", "}"] + ]], + " // plugin result\r\n\r\n", + + ["smarty", [ + ["comment", "{* will replace $tpl_name with value *}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "include"], + ["attr-name", "file"], + ["operator", "="], + ["string", [ + "\"subdir/", + ["variable", "$tpl_name"], + ".tpl\"" + ]], + ["delimiter", "}"] + ]], + + ["smarty", [ + ["comment", "{* does NOT replace $tpl_name *}"] + ]], + + ["smarty", [ + ["delimiter", "{"], + ["keyword", "include"], + ["attr-name", "file"], + ["operator", "="], + ["string", "'subdir/$tpl_name.tpl'"], + ["delimiter", "}"] + ]], + " // vars require double quotes!\r\n\r\n", + + ["smarty", [ + ["comment", "{* must have backticks as it contains a dot \".\" *}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "cycle"], + ["attr-name", "values"], + ["operator", "="], + ["string", [ + "\"one,two,", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$smarty"], + ["punctuation", "."], + ["variable", "config"], + ["punctuation", "."], + ["variable", "myval"] + ]], + ["interpolation-punctuation", "`"] + ]], + "\"" + ]], + ["delimiter", "}"] + ]], + + ["smarty", [ + ["comment", "{* must have backticks as it contains a dot \".\" *}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "include"], + ["attr-name", "file"], + ["operator", "="], + ["string", [ + "\"", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$module"], + ["punctuation", "."], + ["variable", "contact"] + ]], + ["interpolation-punctuation", "`"] + ]], + ".tpl\"" + ]], + ["delimiter", "}"] + ]], + + ["smarty", [ + ["comment", "{* can use variable with dot syntax *}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["keyword", "include"], + ["attr-name", "file"], + ["operator", "="], + ["string", [ + "\"", + ["interpolation", [ + ["interpolation-punctuation", "`"], + ["expression", [ + ["variable", "$module"], + ["punctuation", "."], + ["variable", "$view"] + ]], + ["interpolation-punctuation", "`"] + ]], + ".tpl\"" + ]], + ["delimiter", "}"] ]] ] ---------------------------------------------------- -Checks for strings. \ No newline at end of file +Checks for strings. diff --git a/tests/languages/smarty/variable_feature.test b/tests/languages/smarty/variable_feature.test index c2db9b4683..c30eeaec5f 100644 --- a/tests/languages/smarty/variable_feature.test +++ b/tests/languages/smarty/variable_feature.test @@ -4,6 +4,12 @@ {$foo.bar.baz} {$foo->bar->baz} {$foo[row]} +{$foo[$x+$x]} +{$foo.a.$b.c} +{$foo.a.{$b+4}.c} +{$foo.a.{$b.c}} +{$foo={counter}+3} +{$foo->bar($baz,2,$bar)} ---------------------------------------------------- @@ -48,9 +54,83 @@ ["variable", "row"], ["punctuation", "]"], ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["punctuation", "["], + ["variable", "$x"], + ["operator", "+"], + ["variable", "$x"], + ["punctuation", "]"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["punctuation", "."], + ["variable", "a"], + ["punctuation", "."], + ["variable", "$b"], + ["punctuation", "."], + ["variable", "c"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["punctuation", "."], + ["variable", "a"], + ["punctuation", "."], + ["punctuation", "{"], + ["variable", "$b"], + ["operator", "+"], + ["number", "4"], + ["punctuation", "}"], + ["punctuation", "."], + ["variable", "c"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["punctuation", "."], + ["variable", "a"], + ["punctuation", "."], + ["punctuation", "{"], + ["variable", "$b"], + ["punctuation", "."], + ["variable", "c"], + ["punctuation", "}"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["operator", "="], + ["punctuation", "{"], + "counter", + ["punctuation", "}"], + ["operator", "+"], + ["number", "3"], + ["delimiter", "}"] + ]], + ["smarty", [ + ["delimiter", "{"], + ["variable", "$foo"], + ["punctuation", "->"], + ["function", "bar"], + ["punctuation", "("], + ["variable", "$baz"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ","], + ["variable", "$bar"], + ["punctuation", ")"], + ["delimiter", "}"] ]] ] ---------------------------------------------------- -Checks for variables. \ No newline at end of file +Checks for variables. diff --git a/tests/languages/sml/boolean_feature.test b/tests/languages/sml/boolean_feature.test new file mode 100644 index 0000000000..dedba45b56 --- /dev/null +++ b/tests/languages/sml/boolean_feature.test @@ -0,0 +1,9 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] \ No newline at end of file diff --git a/tests/languages/sml/classname_feature.test b/tests/languages/sml/classname_feature.test new file mode 100644 index 0000000000..e65d5946c4 --- /dev/null +++ b/tests/languages/sml/classname_feature.test @@ -0,0 +1,215 @@ +val FOO: (string list) * 'a * 'a -> (svalue,'a) token +val FOO: (string) * 'a * 'a -> (svalue,'a) token +val FOO: (int) * 'a * 'a -> (svalue,'a) token +val FOO: (string list) * 'a * 'a -> (svalue,'a) token +val FOO: 'a * 'a -> (svalue,'a) token + +datatype spec_ast = SPEC of {head : string list, + decls : decl_ast list, + rules : rule_ast list, + tail : string list} + +type out_state = { +tout : real, +dtout : real, +dtime : real, +strm : TextIO.outstream +} +val outState = ref (NONE : out_state option) + +val systemLines: string -> string list +val systemCleanLines: string -> string list +val systemStanzas: string -> string list list + +---------------------------------------------------- + +[ + ["keyword", "val"], + " FOO", + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "("], + "string list", + ["punctuation", ")"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "->"], + ["punctuation", "("], + "svalue", + ["punctuation", ","], + ["variable", "'a"], + ["punctuation", ")"], + " token" + ]], + + ["keyword", "val"], + " FOO", + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "("], + "string", + ["punctuation", ")"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "->"], + ["punctuation", "("], + "svalue", + ["punctuation", ","], + ["variable", "'a"], + ["punctuation", ")"], + " token" + ]], + + ["keyword", "val"], + " FOO", + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "("], + "int", + ["punctuation", ")"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "->"], + ["punctuation", "("], + "svalue", + ["punctuation", ","], + ["variable", "'a"], + ["punctuation", ")"], + " token" + ]], + + ["keyword", "val"], + " FOO", + ["punctuation", ":"], + ["class-name", [ + ["punctuation", "("], + "string list", + ["punctuation", ")"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "->"], + ["punctuation", "("], + "svalue", + ["punctuation", ","], + ["variable", "'a"], + ["punctuation", ")"], + " token" + ]], + + ["keyword", "val"], + " FOO", + ["punctuation", ":"], + ["class-name", [ + ["variable", "'a"], + ["operator", "*"], + ["variable", "'a"], + ["operator", "->"], + ["punctuation", "("], + "svalue", + ["punctuation", ","], + ["variable", "'a"], + ["punctuation", ")"], + " token" + ]], + + ["keyword", "datatype"], + ["class-name", "spec_ast"], + ["operator", "="], + " SPEC ", + ["keyword", "of"], + ["punctuation", "{"], + "head ", + ["punctuation", ":"], + ["class-name", ["string list"]], + ["punctuation", ","], + + "\r\n decls ", + ["punctuation", ":"], + ["class-name", ["decl_ast list"]], + ["punctuation", ","], + + "\r\n rules ", + ["punctuation", ":"], + ["class-name", ["rule_ast list"]], + ["punctuation", ","], + + "\r\n tail ", + ["punctuation", ":"], + ["class-name", ["string list"]], + ["punctuation", "}"], + + ["keyword", "type"], + ["class-name", "out_state"], + ["operator", "="], + ["punctuation", "{"], + + "\r\ntout ", + ["punctuation", ":"], + ["class-name", ["real"]], + ["punctuation", ","], + + "\r\ndtout ", + ["punctuation", ":"], + ["class-name", ["real"]], + ["punctuation", ","], + + "\r\ndtime ", + ["punctuation", ":"], + ["class-name", ["real"]], + ["punctuation", ","], + + "\r\nstrm ", + ["punctuation", ":"], + ["class-name", [ + "TextIO", + ["punctuation", "."], + "outstream" + ]], + + ["punctuation", "}"], + + ["keyword", "val"], + " outState ", + ["operator", "="], + " ref ", + ["punctuation", "("], + "NONE ", + ["punctuation", ":"], + ["class-name", ["out_state option"]], + ["punctuation", ")"], + + ["keyword", "val"], + " systemLines", + ["punctuation", ":"], + ["class-name", [ + "string ", + ["operator", "->"], + " string list" + ]], + + ["keyword", "val"], + " systemCleanLines", + ["punctuation", ":"], + ["class-name", [ + "string ", + ["operator", "->"], + " string list" + ]], + + ["keyword", "val"], + " systemStanzas", + ["punctuation", ":"], + ["class-name", [ + "string ", + ["operator", "->"], + " string list list" + ]] +] diff --git a/tests/languages/sml/comment_feature.test b/tests/languages/sml/comment_feature.test new file mode 100644 index 0000000000..7639788352 --- /dev/null +++ b/tests/languages/sml/comment_feature.test @@ -0,0 +1,11 @@ +(* comment *) +(* + (* nested comment *) +*) + +---------------------------------------------------- + +[ + ["comment", "(* comment *)"], + ["comment", "(*\r\n (* nested comment *)\r\n*)"] +] diff --git a/tests/languages/sml/function_feature.test b/tests/languages/sml/function_feature.test new file mode 100644 index 0000000000..cabce725ba --- /dev/null +++ b/tests/languages/sml/function_feature.test @@ -0,0 +1,13 @@ +fun foo x = x * 2 + +---------------------------------------------------- + +[ + ["keyword", "fun"], + ["function", "foo"], + " x ", + ["operator", "="], + " x ", + ["operator", "*"], + ["number", "2"] +] \ No newline at end of file diff --git a/tests/languages/sml/keyword_feature.test b/tests/languages/sml/keyword_feature.test new file mode 100644 index 0000000000..f19f8c32c4 --- /dev/null +++ b/tests/languages/sml/keyword_feature.test @@ -0,0 +1,94 @@ +abstype +and +andalso +as +case +datatype; +do +else +end +eqtype +exception; +fn +fun; +functor; +handle +if +in +include +infix +infixr +let +local +nonfix +of +op +open +orelse +raise +rec +sharing +sig +signature; +struct +structure; +then +type; +val +where +while +with +withtype + +---------------------------------------------------- + +[ + ["keyword", "abstype"], + ["keyword", "and"], + ["keyword", "andalso"], + ["keyword", "as"], + ["keyword", "case"], + ["keyword", "datatype"], + ["punctuation", ";"], + ["keyword", "do"], + ["keyword", "else"], + ["keyword", "end"], + ["keyword", "eqtype"], + ["keyword", "exception"], + ["punctuation", ";"], + ["keyword", "fn"], + ["keyword", "fun"], + ["punctuation", ";"], + ["keyword", "functor"], + ["punctuation", ";"], + ["keyword", "handle"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "include"], + ["keyword", "infix"], + ["keyword", "infixr"], + ["keyword", "let"], + ["keyword", "local"], + ["keyword", "nonfix"], + ["keyword", "of"], + ["keyword", "op"], + ["keyword", "open"], + ["keyword", "orelse"], + ["keyword", "raise"], + ["keyword", "rec"], + ["keyword", "sharing"], + ["keyword", "sig"], + ["keyword", "signature"], + ["punctuation", ";"], + ["keyword", "struct"], + ["keyword", "structure"], + ["punctuation", ";"], + ["keyword", "then"], + ["keyword", "type"], + ["punctuation", ";"], + ["keyword", "val"], + ["keyword", "where"], + ["keyword", "while"], + ["keyword", "with"], + ["keyword", "withtype"] +] \ No newline at end of file diff --git a/tests/languages/sml/number_feature.test b/tests/languages/sml/number_feature.test new file mode 100644 index 0000000000..f6f105d2c8 --- /dev/null +++ b/tests/languages/sml/number_feature.test @@ -0,0 +1,21 @@ +123 +~123 +123.456 +~123.456 +123e~3 + +0xFF +~0xFF + +---------------------------------------------------- + +[ + ["number", "123"], + ["number", "~123"], + ["number", "123.456"], + ["number", "~123.456"], + ["number", "123e~3"], + + ["number", "0xFF"], + ["number", "~0xFF"] +] \ No newline at end of file diff --git a/tests/languages/sml/operator_feature.test b/tests/languages/sml/operator_feature.test new file mode 100644 index 0000000000..0805fa1874 --- /dev/null +++ b/tests/languages/sml/operator_feature.test @@ -0,0 +1,33 @@ +... +:: :> := += <> < <= > >= +=> -> +! + - * / ^ # | @ ~ + +---------------------------------------------------- + +[ + ["operator", "..."], + ["operator", "::"], + ["operator", ":>"], + ["operator", ":="], + ["operator", "="], + ["operator", "<"], + ["operator", ">"], + ["operator", "<"], + ["operator", "<="], + ["operator", ">"], + ["operator", ">="], + ["operator", "=>"], + ["operator", "->"], + ["operator", "!"], + ["operator", "+"], + ["operator", "-"], + ["operator", "*"], + ["operator", "/"], + ["operator", "^"], + ["operator", "#"], + ["operator", "|"], + ["operator", "@"], + ["operator", "~"] +] \ No newline at end of file diff --git a/tests/languages/sml/string_feature.test b/tests/languages/sml/string_feature.test new file mode 100644 index 0000000000..95f80cbc3a --- /dev/null +++ b/tests/languages/sml/string_feature.test @@ -0,0 +1,14 @@ +"" +"foo" +"\tfoo +bar" +#"f" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"\\tfoo\r\nbar\""], + ["string", "#\"f\""] +] \ No newline at end of file diff --git a/tests/languages/sml/word_feature.test b/tests/languages/sml/word_feature.test new file mode 100644 index 0000000000..80c82d8473 --- /dev/null +++ b/tests/languages/sml/word_feature.test @@ -0,0 +1,7 @@ +0w123 + +---------------------------------------------------- + +[ + ["word", "0w123"] +] \ No newline at end of file diff --git a/tests/languages/solidity/comment_feature.test b/tests/languages/solidity/comment_feature.test index 8e7678a791..f7e8995e4d 100644 --- a/tests/languages/solidity/comment_feature.test +++ b/tests/languages/solidity/comment_feature.test @@ -7,7 +7,7 @@ bar [ ["comment", "// foo"], - ["comment", "/*\nbar\n*/"] + ["comment", "/*\r\nbar\r\n*/"] ] ---------------------------------------------------- diff --git a/tests/languages/solidity/string_feature.test b/tests/languages/solidity/string_feature.test index 040cf10563..3512b8892f 100644 --- a/tests/languages/solidity/string_feature.test +++ b/tests/languages/solidity/string_feature.test @@ -9,7 +9,8 @@ def" [ ["string", "\"foo\\\"\\'\""], ["string", "'bar\\'\\\"'"], - ["string", "\"\\n\\\"\\'\\\\abc\\\ndef\""] + + ["string", "\"\\n\\\"\\'\\\\abc\\\r\ndef\""] ] ---------------------------------------------------- diff --git a/tests/languages/sparql/keyword_feature.test b/tests/languages/sparql/keyword_feature.test index a4a2c48ed0..3449171fa5 100644 --- a/tests/languages/sparql/keyword_feature.test +++ b/tests/languages/sparql/keyword_feature.test @@ -102,6 +102,10 @@ UCASE( URI( YEAR( +GRAPH +BASE +PREFIX + ---------------------------------------------------- [ @@ -153,118 +157,66 @@ YEAR( ["keyword", "UUID"], ["keyword", "VALUES"], ["keyword", "WHERE"], - ["keyword", "ABS"], - ["punctuation", "("], - ["keyword", "AVG"], - ["punctuation", "("], - ["keyword", "BIND"], - ["punctuation", "("], - ["keyword", "BOUND"], - ["punctuation", "("], - ["keyword", "CEIL"], - ["punctuation", "("], - ["keyword", "COALESCE"], - ["punctuation", "("], - ["keyword", "CONCAT"], - ["punctuation", "("], - ["keyword", "CONTAINS"], - ["punctuation", "("], - ["keyword", "COUNT"], - ["punctuation", "("], - ["keyword", "DATATYPE"], - ["punctuation", "("], - ["keyword", "DAY"], - ["punctuation", "("], - ["keyword", "ENCODE_FOR_URI"], - ["punctuation", "("], - ["keyword", "FLOOR"], - ["punctuation", "("], - ["keyword", "GROUP_CONCAT"], - ["punctuation", "("], - ["keyword", "HOURS"], - ["punctuation", "("], - ["keyword", "IF"], - ["punctuation", "("], - ["keyword", "IRI"], - ["punctuation", "("], - ["keyword", "isBLANK"], - ["punctuation", "("], - ["keyword", "isIRI"], - ["punctuation", "("], - ["keyword", "isLITERAL"], - ["punctuation", "("], - ["keyword", "isNUMERIC"], - ["punctuation", "("], - ["keyword", "isURI"], - ["punctuation", "("], - ["keyword", "LANG"], - ["punctuation", "("], - ["keyword", "LANGMATCHES"], - ["punctuation", "("], - ["keyword", "LCASE"], - ["punctuation", "("], - ["keyword", "MAX"], - ["punctuation", "("], - ["keyword", "MD5"], - ["punctuation", "("], - ["keyword", "MIN"], - ["punctuation", "("], - ["keyword", "MINUTES"], - ["punctuation", "("], - ["keyword", "MONTH"], - ["punctuation", "("], - ["keyword", "ROUND"], - ["punctuation", "("], - ["keyword", "REGEX"], - ["punctuation", "("], - ["keyword", "REPLACE"], - ["punctuation", "("], - ["keyword", "sameTerm"], - ["punctuation", "("], - ["keyword", "SAMPLE"], - ["punctuation", "("], - ["keyword", "SECONDS"], - ["punctuation", "("], - ["keyword", "SHA1"], - ["punctuation", "("], - ["keyword", "SHA256"], - ["punctuation", "("], - ["keyword", "SHA384"], - ["punctuation", "("], - ["keyword", "SHA512"], - ["punctuation", "("], - ["keyword", "STR"], - ["punctuation", "("], - ["keyword", "STRAFTER"], - ["punctuation", "("], - ["keyword", "STRBEFORE"], - ["punctuation", "("], - ["keyword", "STRDT"], - ["punctuation", "("], - ["keyword", "STRENDS"], - ["punctuation", "("], - ["keyword", "STRLANG"], - ["punctuation", "("], - ["keyword", "STRLEN"], - ["punctuation", "("], - ["keyword", "STRSTARTS"], - ["punctuation", "("], - ["keyword", "SUBSTR"], - ["punctuation", "("], - ["keyword", "SUM"], - ["punctuation", "("], - ["keyword", "TIMEZONE"], - ["punctuation", "("], - ["keyword", "TZ"], - ["punctuation", "("], - ["keyword", "UCASE"], - ["punctuation", "("], - ["keyword", "URI"], - ["punctuation", "("], - ["keyword", "YEAR"], - ["punctuation", "("] -] + ["keyword", "ABS"], ["punctuation", "("], + ["keyword", "AVG"], ["punctuation", "("], + ["keyword", "BIND"], ["punctuation", "("], + ["keyword", "BOUND"], ["punctuation", "("], + ["keyword", "CEIL"], ["punctuation", "("], + ["keyword", "COALESCE"], ["punctuation", "("], + ["keyword", "CONCAT"], ["punctuation", "("], + ["keyword", "CONTAINS"], ["punctuation", "("], + ["keyword", "COUNT"], ["punctuation", "("], + ["keyword", "DATATYPE"], ["punctuation", "("], + ["keyword", "DAY"], ["punctuation", "("], + ["keyword", "ENCODE_FOR_URI"], ["punctuation", "("], + ["keyword", "FLOOR"], ["punctuation", "("], + ["keyword", "GROUP_CONCAT"], ["punctuation", "("], + ["keyword", "HOURS"], ["punctuation", "("], + ["keyword", "IF"], ["punctuation", "("], + ["keyword", "IRI"], ["punctuation", "("], + ["keyword", "isBLANK"], ["punctuation", "("], + ["keyword", "isIRI"], ["punctuation", "("], + ["keyword", "isLITERAL"], ["punctuation", "("], + ["keyword", "isNUMERIC"], ["punctuation", "("], + ["keyword", "isURI"], ["punctuation", "("], + ["keyword", "LANG"], ["punctuation", "("], + ["keyword", "LANGMATCHES"], ["punctuation", "("], + ["keyword", "LCASE"], ["punctuation", "("], + ["keyword", "MAX"], ["punctuation", "("], + ["keyword", "MD5"], ["punctuation", "("], + ["keyword", "MIN"], ["punctuation", "("], + ["keyword", "MINUTES"], ["punctuation", "("], + ["keyword", "MONTH"], ["punctuation", "("], + ["keyword", "ROUND"], ["punctuation", "("], + ["keyword", "REGEX"], ["punctuation", "("], + ["keyword", "REPLACE"], ["punctuation", "("], + ["keyword", "sameTerm"], ["punctuation", "("], + ["keyword", "SAMPLE"], ["punctuation", "("], + ["keyword", "SECONDS"], ["punctuation", "("], + ["keyword", "SHA1"], ["punctuation", "("], + ["keyword", "SHA256"], ["punctuation", "("], + ["keyword", "SHA384"], ["punctuation", "("], + ["keyword", "SHA512"], ["punctuation", "("], + ["keyword", "STR"], ["punctuation", "("], + ["keyword", "STRAFTER"], ["punctuation", "("], + ["keyword", "STRBEFORE"], ["punctuation", "("], + ["keyword", "STRDT"], ["punctuation", "("], + ["keyword", "STRENDS"], ["punctuation", "("], + ["keyword", "STRLANG"], ["punctuation", "("], + ["keyword", "STRLEN"], ["punctuation", "("], + ["keyword", "STRSTARTS"], ["punctuation", "("], + ["keyword", "SUBSTR"], ["punctuation", "("], + ["keyword", "SUM"], ["punctuation", "("], + ["keyword", "TIMEZONE"], ["punctuation", "("], + ["keyword", "TZ"], ["punctuation", "("], + ["keyword", "UCASE"], ["punctuation", "("], + ["keyword", "URI"], ["punctuation", "("], + ["keyword", "YEAR"], ["punctuation", "("], + ["keyword", "GRAPH"], + ["keyword", "BASE"], + ["keyword", "PREFIX"] +] ---------------------------------------------------- diff --git a/tests/languages/splunk-spl/boolean_feature.test b/tests/languages/splunk-spl/boolean_feature.test new file mode 100644 index 0000000000..22b8d3878a --- /dev/null +++ b/tests/languages/splunk-spl/boolean_feature.test @@ -0,0 +1,9 @@ +T F +true false + +---------------------------------------------------- + +[ + ["boolean", "T"], ["boolean", "F"], + ["boolean", "true"], ["boolean", "false"] +] diff --git a/tests/languages/splunk-spl/property_feature.test b/tests/languages/splunk-spl/property_feature.test new file mode 100644 index 0000000000..abf1af31da --- /dev/null +++ b/tests/languages/splunk-spl/property_feature.test @@ -0,0 +1,9 @@ +host="mailsecure_log" + +---------------------------------------------------- + +[ + ["property", "host"], + ["operator", "="], + ["string", "\"mailsecure_log\""] +] diff --git a/tests/languages/splunk-spl/punctuation_feature.test b/tests/languages/splunk-spl/punctuation_feature.test new file mode 100644 index 0000000000..553ff08f01 --- /dev/null +++ b/tests/languages/splunk-spl/punctuation_feature.test @@ -0,0 +1,11 @@ +( ) [ ] , + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","] +] diff --git a/tests/languages/sqf/function_feature.test b/tests/languages/sqf/function_feature.test new file mode 100644 index 0000000000..8e45bb8fc7 --- /dev/null +++ b/tests/languages/sqf/function_feature.test @@ -0,0 +1,4397 @@ +abs +accTime +acos +action +actionIDs +actionKeys +actionKeysImages +actionKeysNames +actionKeysNamesArray +actionName +actionParams +activateAddons +activatedAddons +activateKey +add3DENConnection +add3DENEventHandler +add3DENLayer +addAction +addBackpack +addBackpackCargo +addBackpackCargoGlobal +addBackpackGlobal +addCamShake +addCuratorAddons +addCuratorCameraArea +addCuratorEditableObjects +addCuratorEditingArea +addCuratorPoints +addEditorObject +addEventHandler +addForce +addForceGeneratorRTD +addGoggles +addGroupIcon +addHandgunItem +addHeadgear +addItem +addItemCargo +addItemCargoGlobal +addItemPool +addItemToBackpack +addItemToUniform +addItemToVest +addLiveStats +addMagazine +addMagazineAmmoCargo +addMagazineCargo +addMagazineCargoGlobal +addMagazineGlobal +addMagazinePool +addMagazines +addMagazineTurret +addMenu +addMenuItem +addMissionEventHandler +addMPEventHandler +addMusicEventHandler +addOwnedMine +addPlayerScores +addPrimaryWeaponItem +addPublicVariableEventHandler +addRating +addResources +addScore +addScoreSide +addSecondaryWeaponItem +addSwitchableUnit +addTeamMember +addToRemainsCollector +addTorque +addUniform +addVehicle +addVest +addWaypoint +addWeapon +addWeaponCargo +addWeaponCargoGlobal +addWeaponGlobal +addWeaponItem +addWeaponPool +addWeaponTurret +admin +agent +agents +AGLToASL +aimedAtTarget +aimPos +airDensityCurveRTD +airDensityRTD +airplaneThrottle +airportSide +AISFinishHeal +alive +all3DENEntities +allAirports +allControls +allCurators +allCutLayers +allDead +allDeadMen +allDisplays +allGroups +allMapMarkers +allMines +allMissionObjects +allow3DMode +allowCrewInImmobile +allowCuratorLogicIgnoreAreas +allowDamage +allowDammage +allowFileOperations +allowFleeing +allowGetIn +allowSprint +allPlayers +allSimpleObjects +allSites +allTurrets +allUnits +allUnitsUAV +allVariables +ammo +ammoOnPylon +animate +animateBay +animateDoor +animatePylon +animateSource +animationNames +animationPhase +animationSourcePhase +animationState +append +apply +armoryPoints +arrayIntersect +asin +ASLToAGL +ASLToATL +assert +assignAsCargo +assignAsCargoIndex +assignAsCommander +assignAsDriver +assignAsGunner +assignAsTurret +assignCurator +assignedCargo +assignedCommander +assignedDriver +assignedGunner +assignedItems +assignedTarget +assignedTeam +assignedVehicle +assignedVehicleRole +assignItem +assignTeam +assignToAirport +atan +atan2 +atg +ATLToASL +attachedObject +attachedObjects +attachedTo +attachObject +attachTo +attackEnabled +backpack +backpackCargo +backpackContainer +backpackItems +backpackMagazines +backpackSpaceFor +behaviour +benchmark +binocular +blufor +boundingBox +boundingBoxReal +boundingCenter +briefingName +buildingExit +buildingPos +buldozer_EnableRoadDiag +buldozer_IsEnabledRoadDiag +buldozer_LoadNewRoads +buldozer_reloadOperMap +buttonAction +buttonSetAction +cadetMode +callExtension +camCommand +camCommit +camCommitPrepared +camCommitted +camConstuctionSetParams +camCreate +camDestroy +cameraEffect +cameraEffectEnableHUD +cameraInterest +cameraOn +cameraView +campaignConfigFile +camPreload +camPreloaded +camPrepareBank +camPrepareDir +camPrepareDive +camPrepareFocus +camPrepareFov +camPrepareFovRange +camPreparePos +camPrepareRelPos +camPrepareTarget +camSetBank +camSetDir +camSetDive +camSetFocus +camSetFov +camSetFovRange +camSetPos +camSetRelPos +camSetTarget +camTarget +camUseNVG +canAdd +canAddItemToBackpack +canAddItemToUniform +canAddItemToVest +cancelSimpleTaskDestination +canFire +canMove +canSlingLoad +canStand +canSuspend +canTriggerDynamicSimulation +canUnloadInCombat +canVehicleCargo +captive +captiveNum +cbChecked +cbSetChecked +ceil +channelEnabled +cheatsEnabled +checkAIFeature +checkVisibility +civilian +className +clear3DENAttribute +clear3DENInventory +clearAllItemsFromBackpack +clearBackpackCargo +clearBackpackCargoGlobal +clearForcesRTD +clearGroupIcons +clearItemCargo +clearItemCargoGlobal +clearItemPool +clearMagazineCargo +clearMagazineCargoGlobal +clearMagazinePool +clearOverlay +clearRadio +clearVehicleInit +clearWeaponCargo +clearWeaponCargoGlobal +clearWeaponPool +clientOwner +closeDialog +closeDisplay +closeOverlay +collapseObjectTree +collect3DENHistory +collectiveRTD +combatMode +commandArtilleryFire +commandChat +commander +commandFire +commandFollow +commandFSM +commandGetOut +commandingMenu +commandMove +commandRadio +commandStop +commandSuppressiveFire +commandTarget +commandWatch +comment +commitOverlay +compile +compileFinal +completedFSM +composeText +configClasses +configFile +configHierarchy +configName +configNull +configProperties +configSourceAddonList +configSourceMod +configSourceModList +confirmSensorTarget +connectTerminalToUAV +controlNull +controlsGroupCtrl +copyFromClipboard +copyToClipboard +copyWaypoints +cos +count +countEnemy +countFriendly +countSide +countType +countUnknown +create3DENComposition +create3DENEntity +createAgent +createCenter +createDialog +createDiaryLink +createDiaryRecord +createDiarySubject +createDisplay +createGearDialog +createGroup +createGuardedPoint +createLocation +createMarker +createMarkerLocal +createMenu +createMine +createMissionDisplay +createMPCampaignDisplay +createSimpleObject +createSimpleTask +createSite +createSoundSource +createTask +createTeam +createTrigger +createUnit +createVehicle +createVehicleCrew +createVehicleLocal +crew +ctAddHeader +ctAddRow +ctClear +ctCurSel +ctData +ctFindHeaderRows +ctFindRowHeader +ctHeaderControls +ctHeaderCount +ctRemoveHeaders +ctRemoveRows +ctrlActivate +ctrlAddEventHandler +ctrlAngle +ctrlAutoScrollDelay +ctrlAutoScrollRewind +ctrlAutoScrollSpeed +ctrlChecked +ctrlClassName +ctrlCommit +ctrlCommitted +ctrlCreate +ctrlDelete +ctrlEnable +ctrlEnabled +ctrlFade +ctrlHTMLLoaded +ctrlIDC +ctrlIDD +ctrlMapAnimAdd +ctrlMapAnimClear +ctrlMapAnimCommit +ctrlMapAnimDone +ctrlMapCursor +ctrlMapMouseOver +ctrlMapScale +ctrlMapScreenToWorld +ctrlMapWorldToScreen +ctrlModel +ctrlModelDirAndUp +ctrlModelScale +ctrlParent +ctrlParentControlsGroup +ctrlPosition +ctrlRemoveAllEventHandlers +ctrlRemoveEventHandler +ctrlScale +ctrlSetActiveColor +ctrlSetAngle +ctrlSetAutoScrollDelay +ctrlSetAutoScrollRewind +ctrlSetAutoScrollSpeed +ctrlSetBackgroundColor +ctrlSetChecked +ctrlSetDisabledColor +ctrlSetEventHandler +ctrlSetFade +ctrlSetFocus +ctrlSetFont +ctrlSetFontH1 +ctrlSetFontH1B +ctrlSetFontH2 +ctrlSetFontH2B +ctrlSetFontH3 +ctrlSetFontH3B +ctrlSetFontH4 +ctrlSetFontH4B +ctrlSetFontH5 +ctrlSetFontH5B +ctrlSetFontH6 +ctrlSetFontH6B +ctrlSetFontHeight +ctrlSetFontHeightH1 +ctrlSetFontHeightH2 +ctrlSetFontHeightH3 +ctrlSetFontHeightH4 +ctrlSetFontHeightH5 +ctrlSetFontHeightH6 +ctrlSetFontHeightSecondary +ctrlSetFontP +ctrlSetFontPB +ctrlSetFontSecondary +ctrlSetForegroundColor +ctrlSetModel +ctrlSetModelDirAndUp +ctrlSetModelScale +ctrlSetPixelPrecision +ctrlSetPosition +ctrlSetScale +ctrlSetStructuredText +ctrlSetText +ctrlSetTextColor +ctrlSetTextColorSecondary +ctrlSetTextSecondary +ctrlSetTooltip +ctrlSetTooltipColorBox +ctrlSetTooltipColorShade +ctrlSetTooltipColorText +ctrlShow +ctrlShown +ctrlText +ctrlTextHeight +ctrlTextSecondary +ctrlTextWidth +ctrlType +ctrlVisible +ctRowControls +ctRowCount +ctSetCurSel +ctSetData +ctSetHeaderTemplate +ctSetRowTemplate +ctSetValue +ctValue +curatorAddons +curatorCamera +curatorCameraArea +curatorCameraAreaCeiling +curatorCoef +curatorEditableObjects +curatorEditingArea +curatorEditingAreaType +curatorMouseOver +curatorPoints +curatorRegisteredObjects +curatorSelected +curatorWaypointCost +current3DENOperation +currentChannel +currentCommand +currentMagazine +currentMagazineDetail +currentMagazineDetailTurret +currentMagazineTurret +currentMuzzle +currentNamespace +currentTask +currentTasks +currentThrowable +currentVisionMode +currentWaypoint +currentWeapon +currentWeaponMode +currentWeaponTurret +currentZeroing +cursorObject +cursorTarget +customChat +customRadio +cutFadeOut +cutObj +cutRsc +cutText +damage +date +dateToNumber +daytime +deActivateKey +debriefingText +debugFSM +debugLog +deg +delete3DENEntities +deleteAt +deleteCenter +deleteCollection +deleteEditorObject +deleteGroup +deleteGroupWhenEmpty +deleteIdentity +deleteLocation +deleteMarker +deleteMarkerLocal +deleteRange +deleteResources +deleteSite +deleteStatus +deleteTeam +deleteVehicle +deleteVehicleCrew +deleteWaypoint +detach +detectedMines +diag_activeMissionFSMs +diag_activeScripts +diag_activeSQFScripts +diag_activeSQSScripts +diag_captureFrame +diag_captureFrameToFile +diag_captureSlowFrame +diag_codePerformance +diag_drawMode +diag_dynamicSimulationEnd +diag_enable +diag_enabled +diag_fps +diag_fpsMin +diag_frameNo +diag_lightNewLoad +diag_list +diag_log +diag_logSlowFrame +diag_mergeConfigFile +diag_recordTurretLimits +diag_setLightNew +diag_tickTime +diag_toggle +dialog +diarySubjectExists +didJIP +didJIPOwner +difficulty +difficultyEnabled +difficultyEnabledRTD +difficultyOption +direction +directSay +disableAI +disableCollisionWith +disableConversation +disableDebriefingStats +disableMapIndicators +disableNVGEquipment +disableRemoteSensors +disableSerialization +disableTIEquipment +disableUAVConnectability +disableUserInput +displayAddEventHandler +displayCtrl +displayNull +displayParent +displayRemoveAllEventHandlers +displayRemoveEventHandler +displaySetEventHandler +dissolveTeam +distance +distance2D +distanceSqr +distributionRegion +do3DENAction +doArtilleryFire +doFire +doFollow +doFSM +doGetOut +doMove +doorPhase +doStop +doSuppressiveFire +doTarget +doWatch +drawArrow +drawEllipse +drawIcon +drawIcon3D +drawLine +drawLine3D +drawLink +drawLocation +drawPolygon +drawRectangle +drawTriangle +driver +drop +dynamicSimulationDistance +dynamicSimulationDistanceCoef +dynamicSimulationEnabled +dynamicSimulationSystemEnabled +east +edit3DENMissionAttributes +editObject +editorSetEventHandler +effectiveCommander +emptyPositions +enableAI +enableAIFeature +enableAimPrecision +enableAttack +enableAudioFeature +enableAutoStartUpRTD +enableAutoTrimRTD +enableCamShake +enableCaustics +enableChannel +enableCollisionWith +enableCopilot +enableDebriefingStats +enableDiagLegend +enableDynamicSimulation +enableDynamicSimulationSystem +enableEndDialog +enableEngineArtillery +enableEnvironment +enableFatigue +enableGunLights +enableInfoPanelComponent +enableIRLasers +enableMimics +enablePersonTurret +enableRadio +enableReload +enableRopeAttach +enableSatNormalOnDetail +enableSaving +enableSentences +enableSimulation +enableSimulationGlobal +enableStamina +enableStressDamage +enableTeamSwitch +enableTraffic +enableUAVConnectability +enableUAVWaypoints +enableVehicleCargo +enableVehicleSensor +enableWeaponDisassembly +endl +endLoadingScreen +endMission +engineOn +enginesIsOnRTD +enginesPowerRTD +enginesRpmRTD +enginesTorqueRTD +entities +environmentEnabled +estimatedEndServerTime +estimatedTimeLeft +evalObjectArgument +everyBackpack +everyContainer +exec +execEditorScript +exp +expectedDestination +exportJIPMessages +eyeDirection +eyePos +face +faction +fadeMusic +fadeRadio +fadeSound +fadeSpeech +failMission +fillWeaponsFromPool +find +findCover +findDisplay +findEditorObject +findEmptyPosition +findEmptyPositionReady +findIf +findNearestEnemy +finishMissionInit +finite +fire +fireAtTarget +firstBackpack +flag +flagAnimationPhase +flagOwner +flagSide +flagTexture +fleeing +floor +flyInHeight +flyInHeightASL +fog +fogForecast +fogParams +forceAddUniform +forceAtPositionRTD +forcedMap +forceEnd +forceFlagTexture +forceFollowRoad +forceGeneratorRTD +forceMap +forceRespawn +forceSpeed +forceWalk +forceWeaponFire +forceWeatherChange +forgetTarget +format +formation +formationDirection +formationLeader +formationMembers +formationPosition +formationTask +formatText +formLeader +freeLook +fromEditor +fuel +fullCrew +gearIDCAmmoCount +gearSlotAmmoCount +gearSlotData +get3DENActionState +get3DENAttribute +get3DENCamera +get3DENConnections +get3DENEntity +get3DENEntityID +get3DENGrid +get3DENIconsVisible +get3DENLayerEntities +get3DENLinesVisible +get3DENMissionAttribute +get3DENMouseOver +get3DENSelected +getAimingCoef +getAllEnvSoundControllers +getAllHitPointsDamage +getAllOwnedMines +getAllSoundControllers +getAmmoCargo +getAnimAimPrecision +getAnimSpeedCoef +getArray +getArtilleryAmmo +getArtilleryComputerSettings +getArtilleryETA +getAssignedCuratorLogic +getAssignedCuratorUnit +getBackpackCargo +getBleedingRemaining +getBurningValue +getCameraViewDirection +getCargoIndex +getCenterOfMass +getClientState +getClientStateNumber +getCompatiblePylonMagazines +getConnectedUAV +getContainerMaxLoad +getCursorObjectParams +getCustomAimCoef +getDammage +getDescription +getDir +getDirVisual +getDLCAssetsUsage +getDLCAssetsUsageByName +getDLCs +getDLCUsageTime +getEditorCamera +getEditorMode +getEditorObjectScope +getElevationOffset +getEngineTargetRpmRTD +getEnvSoundController +getFatigue +getFieldManualStartPage +getForcedFlagTexture +getFriend +getFSMVariable +getFuelCargo +getGroupIcon +getGroupIconParams +getGroupIcons +getHideFrom +getHit +getHitIndex +getHitPointDamage +getItemCargo +getMagazineCargo +getMarkerColor +getMarkerPos +getMarkerSize +getMarkerType +getMass +getMissionConfig +getMissionConfigValue +getMissionDLCs +getMissionLayerEntities +getMissionLayers +getModelInfo +getMousePosition +getMusicPlayedTime +getNumber +getObjectArgument +getObjectChildren +getObjectDLC +getObjectMaterials +getObjectProxy +getObjectTextures +getObjectType +getObjectViewDistance +getOxygenRemaining +getPersonUsedDLCs +getPilotCameraDirection +getPilotCameraPosition +getPilotCameraRotation +getPilotCameraTarget +getPlateNumber +getPlayerChannel +getPlayerScores +getPlayerUID +getPlayerUIDOld +getPos +getPosASL +getPosASLVisual +getPosASLW +getPosATL +getPosATLVisual +getPosVisual +getPosWorld +getPylonMagazines +getRelDir +getRelPos +getRemoteSensorsDisabled +getRepairCargo +getResolution +getRotorBrakeRTD +getShadowDistance +getShotParents +getSlingLoad +getSoundController +getSoundControllerResult +getSpeed +getStamina +getStatValue +getSuppression +getTerrainGrid +getTerrainHeightASL +getText +getTotalDLCUsageTime +getTrimOffsetRTD +getUnitLoadout +getUnitTrait +getUserMFDText +getUserMFDValue +getVariable +getVehicleCargo +getWeaponCargo +getWeaponSway +getWingsOrientationRTD +getWingsPositionRTD +getWPPos +glanceAt +globalChat +globalRadio +goggles +group +groupChat +groupFromNetId +groupIconSelectable +groupIconsVisible +groupId +groupOwner +groupRadio +groupSelectedUnits +groupSelectUnit +grpNull +gunner +gusts +halt +handgunItems +handgunMagazine +handgunWeapon +handsHit +hasInterface +hasPilotCamera +hasWeapon +hcAllGroups +hcGroupParams +hcLeader +hcRemoveAllGroups +hcRemoveGroup +hcSelected +hcSelectGroup +hcSetGroup +hcShowBar +hcShownBar +headgear +hideBody +hideObject +hideObjectGlobal +hideSelection +hint +hintC +hintCadet +hintSilent +hmd +hostMission +htmlLoad +HUDMovementLevels +humidity +image +importAllGroups +importance +in +inArea +inAreaArray +incapacitatedState +independent +inflame +inflamed +infoPanel +infoPanelComponentEnabled +infoPanelComponents +infoPanels +inGameUISetEventHandler +inheritsFrom +initAmbientLife +inPolygon +inputAction +inRangeOfArtillery +insertEditorObject +intersect +is3DEN +is3DENMultiplayer +isAbleToBreathe +isAgent +isAimPrecisionEnabled +isArray +isAutoHoverOn +isAutonomous +isAutoStartUpEnabledRTD +isAutotest +isAutoTrimOnRTD +isBleeding +isBurning +isClass +isCollisionLightOn +isCopilotEnabled +isDamageAllowed +isDedicated +isDLCAvailable +isEngineOn +isEqualTo +isEqualType +isEqualTypeAll +isEqualTypeAny +isEqualTypeArray +isEqualTypeParams +isFilePatchingEnabled +isFlashlightOn +isFlatEmpty +isForcedWalk +isFormationLeader +isGroupDeletedWhenEmpty +isHidden +isInRemainsCollector +isInstructorFigureEnabled +isIRLaserOn +isKeyActive +isKindOf +isLaserOn +isLightOn +isLocalized +isManualFire +isMarkedForCollection +isMultiplayer +isMultiplayerSolo +isNil +isNull +isNumber +isObjectHidden +isObjectRTD +isOnRoad +isPipEnabled +isPlayer +isRealTime +isRemoteExecuted +isRemoteExecutedJIP +isServer +isShowing3DIcons +isSimpleObject +isSprintAllowed +isStaminaEnabled +isSteamMission +isStreamFriendlyUIEnabled +isStressDamageEnabled +isText +isTouchingGround +isTurnedOut +isTutHintsEnabled +isUAVConnectable +isUAVConnected +isUIContext +isUniformAllowed +isVehicleCargo +isVehicleRadarOn +isVehicleSensorEnabled +isWalking +isWeaponDeployed +isWeaponRested +itemCargo +items +itemsWithMagazines +join +joinAs +joinAsSilent +joinSilent +joinString +kbAddDatabase +kbAddDatabaseTargets +kbAddTopic +kbHasTopic +kbReact +kbRemoveTopic +kbTell +kbWasSaid +keyImage +keyName +knowsAbout +land +landAt +landResult +language +laserTarget +lbAdd +lbClear +lbColor +lbColorRight +lbCurSel +lbData +lbDelete +lbIsSelected +lbPicture +lbPictureRight +lbSelection +lbSetColor +lbSetColorRight +lbSetCurSel +lbSetData +lbSetPicture +lbSetPictureColor +lbSetPictureColorDisabled +lbSetPictureColorSelected +lbSetPictureRight +lbSetPictureRightColor +lbSetPictureRightColorDisabled +lbSetPictureRightColorSelected +lbSetSelectColor +lbSetSelectColorRight +lbSetSelected +lbSetText +lbSetTextRight +lbSetTooltip +lbSetValue +lbSize +lbSort +lbSortByValue +lbText +lbTextRight +lbValue +leader +leaderboardDeInit +leaderboardGetRows +leaderboardInit +leaderboardRequestRowsFriends +leaderboardRequestRowsGlobal +leaderboardRequestRowsGlobalAroundUser +leaderboardsRequestUploadScore +leaderboardsRequestUploadScoreKeepBest +leaderboardState +leaveVehicle +libraryCredits +libraryDisclaimers +lifeState +lightAttachObject +lightDetachObject +lightIsOn +lightnings +limitSpeed +linearConversion +lineBreak +lineIntersects +lineIntersectsObjs +lineIntersectsSurfaces +lineIntersectsWith +linkItem +list +listObjects +listRemoteTargets +listVehicleSensors +ln +lnbAddArray +lnbAddColumn +lnbAddRow +lnbClear +lnbColor +lnbColorRight +lnbCurSelRow +lnbData +lnbDeleteColumn +lnbDeleteRow +lnbGetColumnsPosition +lnbPicture +lnbPictureRight +lnbSetColor +lnbSetColorRight +lnbSetColumnsPos +lnbSetCurSelRow +lnbSetData +lnbSetPicture +lnbSetPictureColor +lnbSetPictureColorRight +lnbSetPictureColorSelected +lnbSetPictureColorSelectedRight +lnbSetPictureRight +lnbSetText +lnbSetTextRight +lnbSetValue +lnbSize +lnbSort +lnbSortByValue +lnbText +lnbTextRight +lnbValue +load +loadAbs +loadBackpack +loadFile +loadGame +loadIdentity +loadMagazine +loadOverlay +loadStatus +loadUniform +loadVest +local +localize +locationNull +locationPosition +lock +lockCameraTo +lockCargo +lockDriver +locked +lockedCargo +lockedDriver +lockedTurret +lockIdentity +lockTurret +lockWP +log +logEntities +logNetwork +logNetworkTerminate +lookAt +lookAtPos +magazineCargo +magazines +magazinesAllTurrets +magazinesAmmo +magazinesAmmoCargo +magazinesAmmoFull +magazinesDetail +magazinesDetailBackpack +magazinesDetailUniform +magazinesDetailVest +magazinesTurret +magazineTurretAmmo +mapAnimAdd +mapAnimClear +mapAnimCommit +mapAnimDone +mapCenterOnCamera +mapGridPosition +markAsFinishedOnSteam +markerAlpha +markerBrush +markerColor +markerDir +markerPos +markerShape +markerSize +markerText +markerType +max +members +menuAction +menuAdd +menuChecked +menuClear +menuCollapse +menuData +menuDelete +menuEnable +menuEnabled +menuExpand +menuHover +menuPicture +menuSetAction +menuSetCheck +menuSetData +menuSetPicture +menuSetValue +menuShortcut +menuShortcutText +menuSize +menuSort +menuText +menuURL +menuValue +min +mineActive +mineDetectedBy +missionConfigFile +missionDifficulty +missionName +missionNamespace +missionStart +missionVersion +modelToWorld +modelToWorldVisual +modelToWorldVisualWorld +modelToWorldWorld +modParams +moonIntensity +moonPhase +morale +move +move3DENCamera +moveInAny +moveInCargo +moveInCommander +moveInDriver +moveInGunner +moveInTurret +moveObjectToEnd +moveOut +moveTime +moveTo +moveToCompleted +moveToFailed +musicVolume +name +nameSound +nearEntities +nearestBuilding +nearestLocation +nearestLocations +nearestLocationWithDubbing +nearestObject +nearestObjects +nearestTerrainObjects +nearObjects +nearObjectsReady +nearRoads +nearSupplies +nearTargets +needReload +netId +netObjNull +newOverlay +nextMenuItemIndex +nextWeatherChange +nMenuItems +numberOfEnginesRTD +numberToDate +objectCurators +objectFromNetId +objectParent +objNull +objStatus +onBriefingGear +onBriefingGroup +onBriefingNotes +onBriefingPlan +onBriefingTeamSwitch +onCommandModeChanged +onDoubleClick +onEachFrame +onGroupIconClick +onGroupIconOverEnter +onGroupIconOverLeave +onHCGroupSelectionChanged +onMapSingleClick +onPlayerConnected +onPlayerDisconnected +onPreloadFinished +onPreloadStarted +onShowNewObject +onTeamSwitch +openCuratorInterface +openDLCPage +openDSInterface +openMap +openSteamApp +openYoutubeVideo +opfor +orderGetIn +overcast +overcastForecast +owner +param +params +parseNumber +parseSimpleArray +parseText +parsingNamespace +particlesQuality +pi +pickWeaponPool +pitch +pixelGrid +pixelGridBase +pixelGridNoUIScale +pixelH +pixelW +playableSlotsNumber +playableUnits +playAction +playActionNow +player +playerRespawnTime +playerSide +playersNumber +playGesture +playMission +playMove +playMoveNow +playMusic +playScriptedMission +playSound +playSound3D +position +positionCameraToWorld +posScreenToWorld +posWorldToScreen +ppEffectAdjust +ppEffectCommit +ppEffectCommitted +ppEffectCreate +ppEffectDestroy +ppEffectEnable +ppEffectEnabled +ppEffectForceInNVG +precision +preloadCamera +preloadObject +preloadSound +preloadTitleObj +preloadTitleRsc +primaryWeapon +primaryWeaponItems +primaryWeaponMagazine +priority +processDiaryLink +processInitCommands +productVersion +profileName +profileNamespace +profileNameSteam +progressLoadingScreen +progressPosition +progressSetPosition +publicVariable +publicVariableClient +publicVariableServer +pushBack +pushBackUnique +putWeaponPool +queryItemsPool +queryMagazinePool +queryWeaponPool +rad +radioChannelAdd +radioChannelCreate +radioChannelRemove +radioChannelSetCallSign +radioChannelSetLabel +radioVolume +rain +rainbow +random +rank +rankId +rating +rectangular +registeredTasks +registerTask +reload +reloadEnabled +remoteControl +remoteExec +remoteExecCall +remoteExecutedOwner +remove3DENConnection +remove3DENEventHandler +remove3DENLayer +removeAction +removeAll3DENEventHandlers +removeAllActions +removeAllAssignedItems +removeAllContainers +removeAllCuratorAddons +removeAllCuratorCameraAreas +removeAllCuratorEditingAreas +removeAllEventHandlers +removeAllHandgunItems +removeAllItems +removeAllItemsWithMagazines +removeAllMissionEventHandlers +removeAllMPEventHandlers +removeAllMusicEventHandlers +removeAllOwnedMines +removeAllPrimaryWeaponItems +removeAllWeapons +removeBackpack +removeBackpackGlobal +removeCuratorAddons +removeCuratorCameraArea +removeCuratorEditableObjects +removeCuratorEditingArea +removeDrawIcon +removeDrawLinks +removeEventHandler +removeFromRemainsCollector +removeGoggles +removeGroupIcon +removeHandgunItem +removeHeadgear +removeItem +removeItemFromBackpack +removeItemFromUniform +removeItemFromVest +removeItems +removeMagazine +removeMagazineGlobal +removeMagazines +removeMagazinesTurret +removeMagazineTurret +removeMenuItem +removeMissionEventHandler +removeMPEventHandler +removeMusicEventHandler +removeOwnedMine +removePrimaryWeaponItem +removeSecondaryWeaponItem +removeSimpleTask +removeSwitchableUnit +removeTeamMember +removeUniform +removeVest +removeWeapon +removeWeaponAttachmentCargo +removeWeaponCargo +removeWeaponGlobal +removeWeaponTurret +reportRemoteTarget +requiredVersion +resetCamShake +resetSubgroupDirection +resistance +resize +resources +respawnVehicle +restartEditorCamera +reveal +revealMine +reverse +reversedMouseY +roadAt +roadsConnectedTo +roleDescription +ropeAttachedObjects +ropeAttachedTo +ropeAttachEnabled +ropeAttachTo +ropeCreate +ropeCut +ropeDestroy +ropeDetach +ropeEndPosition +ropeLength +ropes +ropeUnwind +ropeUnwound +rotorsForcesRTD +rotorsRpmRTD +round +runInitScript +safeZoneH +safeZoneW +safeZoneWAbs +safeZoneX +safeZoneXAbs +safeZoneY +save3DENInventory +saveGame +saveIdentity +saveJoysticks +saveOverlay +saveProfileNamespace +saveStatus +saveVar +savingEnabled +say +say2D +say3D +score +scoreSide +screenshot +screenToWorld +scriptDone +scriptName +scriptNull +scudState +secondaryWeapon +secondaryWeaponItems +secondaryWeaponMagazine +select +selectBestPlaces +selectDiarySubject +selectedEditorObjects +selectEditorObject +selectionNames +selectionPosition +selectLeader +selectMax +selectMin +selectNoPlayer +selectPlayer +selectRandom +selectRandomWeighted +selectWeapon +selectWeaponTurret +sendAUMessage +sendSimpleCommand +sendTask +sendTaskResult +sendUDPMessage +serverCommand +serverCommandAvailable +serverCommandExecutable +serverName +serverTime +set +set3DENAttribute +set3DENAttributes +set3DENGrid +set3DENIconsVisible +set3DENLayer +set3DENLinesVisible +set3DENLogicType +set3DENMissionAttribute +set3DENMissionAttributes +set3DENModelsVisible +set3DENObjectType +set3DENSelected +setAccTime +setActualCollectiveRTD +setAirplaneThrottle +setAirportSide +setAmmo +setAmmoCargo +setAmmoOnPylon +setAnimSpeedCoef +setAperture +setApertureNew +setArmoryPoints +setAttributes +setAutonomous +setBehaviour +setBleedingRemaining +setBrakesRTD +setCameraInterest +setCamShakeDefParams +setCamShakeParams +setCamUseTI +setCaptive +setCenterOfMass +setCollisionLight +setCombatMode +setCompassOscillation +setConvoySeparation +setCuratorCameraAreaCeiling +setCuratorCoef +setCuratorEditingAreaType +setCuratorWaypointCost +setCurrentChannel +setCurrentTask +setCurrentWaypoint +setCustomAimCoef +setCustomWeightRTD +setDamage +setDammage +setDate +setDebriefingText +setDefaultCamera +setDestination +setDetailMapBlendPars +setDir +setDirection +setDrawIcon +setDriveOnPath +setDropInterval +setDynamicSimulationDistance +setDynamicSimulationDistanceCoef +setEditorMode +setEditorObjectScope +setEffectCondition +setEngineRpmRTD +setFace +setFaceAnimation +setFatigue +setFeatureType +setFlagAnimationPhase +setFlagOwner +setFlagSide +setFlagTexture +setFog +setForceGeneratorRTD +setFormation +setFormationTask +setFormDir +setFriend +setFromEditor +setFSMVariable +setFuel +setFuelCargo +setGroupIcon +setGroupIconParams +setGroupIconsSelectable +setGroupIconsVisible +setGroupId +setGroupIdGlobal +setGroupOwner +setGusts +setHideBehind +setHit +setHitIndex +setHitPointDamage +setHorizonParallaxCoef +setHUDMovementLevels +setIdentity +setImportance +setInfoPanel +setLeader +setLightAmbient +setLightAttenuation +setLightBrightness +setLightColor +setLightDayLight +setLightFlareMaxDistance +setLightFlareSize +setLightIntensity +setLightnings +setLightUseFlare +setLocalWindParams +setMagazineTurretAmmo +setMarkerAlpha +setMarkerAlphaLocal +setMarkerBrush +setMarkerBrushLocal +setMarkerColor +setMarkerColorLocal +setMarkerDir +setMarkerDirLocal +setMarkerPos +setMarkerPosLocal +setMarkerShape +setMarkerShapeLocal +setMarkerSize +setMarkerSizeLocal +setMarkerText +setMarkerTextLocal +setMarkerType +setMarkerTypeLocal +setMass +setMimic +setMousePosition +setMusicEffect +setMusicEventHandler +setName +setNameSound +setObjectArguments +setObjectMaterial +setObjectMaterialGlobal +setObjectProxy +setObjectTexture +setObjectTextureGlobal +setObjectViewDistance +setOvercast +setOwner +setOxygenRemaining +setParticleCircle +setParticleClass +setParticleFire +setParticleParams +setParticleRandom +setPilotCameraDirection +setPilotCameraRotation +setPilotCameraTarget +setPilotLight +setPiPEffect +setPitch +setPlateNumber +setPlayable +setPlayerRespawnTime +setPos +setPosASL +setPosASL2 +setPosASLW +setPosATL +setPosition +setPosWorld +setPylonLoadOut +setPylonsPriority +setRadioMsg +setRain +setRainbow +setRandomLip +setRank +setRectangular +setRepairCargo +setRotorBrakeRTD +setShadowDistance +setShotParents +setSide +setSimpleTaskAlwaysVisible +setSimpleTaskCustomData +setSimpleTaskDescription +setSimpleTaskDestination +setSimpleTaskTarget +setSimpleTaskType +setSimulWeatherLayers +setSize +setSkill +setSlingLoad +setSoundEffect +setSpeaker +setSpeech +setSpeedMode +setStamina +setStaminaScheme +setStatValue +setSuppression +setSystemOfUnits +setTargetAge +setTaskMarkerOffset +setTaskResult +setTaskState +setTerrainGrid +setText +setTimeMultiplier +setTitleEffect +setToneMapping +setToneMappingParams +setTrafficDensity +setTrafficDistance +setTrafficGap +setTrafficSpeed +setTriggerActivation +setTriggerArea +setTriggerStatements +setTriggerText +setTriggerTimeout +setTriggerType +setType +setUnconscious +setUnitAbility +setUnitLoadout +setUnitPos +setUnitPosWeak +setUnitRank +setUnitRecoilCoefficient +setUnitTrait +setUnloadInCombat +setUserActionText +setUserMFDText +setUserMFDValue +setVariable +setVectorDir +setVectorDirAndUp +setVectorUp +setVehicleAmmo +setVehicleAmmoDef +setVehicleArmor +setVehicleCargo +setVehicleId +setVehicleInit +setVehicleLock +setVehiclePosition +setVehicleRadar +setVehicleReceiveRemoteTargets +setVehicleReportOwnPosition +setVehicleReportRemoteTargets +setVehicleTIPars +setVehicleVarName +setVelocity +setVelocityModelSpace +setVelocityTransformation +setViewDistance +setVisibleIfTreeCollapsed +setWantedRpmRTD +setWaves +setWaypointBehaviour +setWaypointCombatMode +setWaypointCompletionRadius +setWaypointDescription +setWaypointForceBehaviour +setWaypointFormation +setWaypointHousePosition +setWaypointLoiterRadius +setWaypointLoiterType +setWaypointName +setWaypointPosition +setWaypointScript +setWaypointSpeed +setWaypointStatements +setWaypointTimeout +setWaypointType +setWaypointVisible +setWeaponReloadingTime +setWind +setWindDir +setWindForce +setWindStr +setWingForceScaleRTD +setWPPos +show3DIcons +showChat +showCinemaBorder +showCommandingMenu +showCompass +showCuratorCompass +showGPS +showHUD +showLegend +showMap +shownArtilleryComputer +shownChat +shownCompass +shownCuratorCompass +showNewEditorObject +shownGPS +shownHUD +shownMap +shownPad +shownRadio +shownScoretable +shownUAVFeed +shownWarrant +shownWatch +showPad +showRadio +showScoretable +showSubtitles +showUAVFeed +showWarrant +showWatch +showWaypoint +showWaypoints +side +sideAmbientLife +sideChat +sideEmpty +sideEnemy +sideFriendly +sideLogic +sideRadio +sideUnknown +simpleTasks +simulationEnabled +simulCloudDensity +simulCloudOcclusion +simulInClouds +simulWeatherSync +sin +size +sizeOf +skill +skillFinal +skipTime +sleep +sliderPosition +sliderRange +sliderSetPosition +sliderSetRange +sliderSetSpeed +sliderSpeed +slingLoadAssistantShown +soldierMagazines +someAmmo +sort +soundVolume +speaker +speed +speedMode +splitString +sqrt +squadParams +stance +startLoadingScreen +stop +stopEngineRTD +stopped +str +sunOrMoon +supportInfo +suppressFor +surfaceIsWater +surfaceNormal +surfaceType +swimInDepth +switchableUnits +switchAction +switchCamera +switchGesture +switchLight +switchMove +synchronizedObjects +synchronizedTriggers +synchronizedWaypoints +synchronizeObjectsAdd +synchronizeObjectsRemove +synchronizeTrigger +synchronizeWaypoint +systemChat +systemOfUnits +tan +targetKnowledge +targets +targetsAggregate +targetsQuery +taskAlwaysVisible +taskChildren +taskCompleted +taskCustomData +taskDescription +taskDestination +taskHint +taskMarkerOffset +taskNull +taskParent +taskResult +taskState +taskType +teamMember +teamMemberNull +teamName +teams +teamSwitch +teamSwitchEnabled +teamType +terminate +terrainIntersect +terrainIntersectASL +terrainIntersectAtASL +text +textLog +textLogFormat +tg +time +timeMultiplier +titleCut +titleFadeOut +titleObj +titleRsc +titleText +toArray +toFixed +toLower +toString +toUpper +triggerActivated +triggerActivation +triggerArea +triggerAttachedVehicle +triggerAttachObject +triggerAttachVehicle +triggerDynamicSimulation +triggerStatements +triggerText +triggerTimeout +triggerTimeoutCurrent +triggerType +turretLocal +turretOwner +turretUnit +tvAdd +tvClear +tvCollapse +tvCollapseAll +tvCount +tvCurSel +tvData +tvDelete +tvExpand +tvExpandAll +tvPicture +tvPictureRight +tvSetColor +tvSetCurSel +tvSetData +tvSetPicture +tvSetPictureColor +tvSetPictureColorDisabled +tvSetPictureColorSelected +tvSetPictureRight +tvSetPictureRightColor +tvSetPictureRightColorDisabled +tvSetPictureRightColorSelected +tvSetSelectColor +tvSetText +tvSetTooltip +tvSetValue +tvSort +tvSortByValue +tvText +tvTooltip +tvValue +type +typeName +typeOf +UAVControl +uiNamespace +uiSleep +unassignCurator +unassignItem +unassignTeam +unassignVehicle +underwater +uniform +uniformContainer +uniformItems +uniformMagazines +unitAddons +unitAimPosition +unitAimPositionVisual +unitBackpack +unitIsUAV +unitPos +unitReady +unitRecoilCoefficient +units +unitsBelowHeight +unlinkItem +unlockAchievement +unregisterTask +updateDrawIcon +updateMenuItem +updateObjectTree +useAIOperMapObstructionTest +useAISteeringComponent +useAudioTimeForMoves +userInputDisabled +vectorAdd +vectorCos +vectorCrossProduct +vectorDiff +vectorDir +vectorDirVisual +vectorDistance +vectorDistanceSqr +vectorDotProduct +vectorFromTo +vectorMagnitude +vectorMagnitudeSqr +vectorModelToWorld +vectorModelToWorldVisual +vectorMultiply +vectorNormalized +vectorUp +vectorUpVisual +vectorWorldToModel +vectorWorldToModelVisual +vehicle +vehicleCargoEnabled +vehicleChat +vehicleRadio +vehicleReceiveRemoteTargets +vehicleReportOwnPosition +vehicleReportRemoteTargets +vehicles +vehicleVarName +velocity +velocityModelSpace +verifySignature +vest +vestContainer +vestItems +vestMagazines +viewDistance +visibleCompass +visibleGPS +visibleMap +visiblePosition +visiblePositionASL +visibleScoretable +visibleWatch +waitUntil +waves +waypointAttachedObject +waypointAttachedVehicle +waypointAttachObject +waypointAttachVehicle +waypointBehaviour +waypointCombatMode +waypointCompletionRadius +waypointDescription +waypointForceBehaviour +waypointFormation +waypointHousePosition +waypointLoiterRadius +waypointLoiterType +waypointName +waypointPosition +waypoints +waypointScript +waypointsEnabledUAV +waypointShow +waypointSpeed +waypointStatements +waypointTimeout +waypointTimeoutCurrent +waypointType +waypointVisible +weaponAccessories +weaponAccessoriesCargo +weaponCargo +weaponDirection +weaponInertia +weaponLowered +weapons +weaponsItems +weaponsItemsCargo +weaponState +weaponsTurret +weightRTD +west +WFSideText +wind +windDir +windRTD +windStr +wingsForcesRTD +worldName +worldSize +worldToModel +worldToModelVisual +worldToScreen + +---------------------------------------------------- + +[ + ["function", "abs"], + ["function", "accTime"], + ["function", "acos"], + ["function", "action"], + ["function", "actionIDs"], + ["function", "actionKeys"], + ["function", "actionKeysImages"], + ["function", "actionKeysNames"], + ["function", "actionKeysNamesArray"], + ["function", "actionName"], + ["function", "actionParams"], + ["function", "activateAddons"], + ["function", "activatedAddons"], + ["function", "activateKey"], + ["function", "add3DENConnection"], + ["function", "add3DENEventHandler"], + ["function", "add3DENLayer"], + ["function", "addAction"], + ["function", "addBackpack"], + ["function", "addBackpackCargo"], + ["function", "addBackpackCargoGlobal"], + ["function", "addBackpackGlobal"], + ["function", "addCamShake"], + ["function", "addCuratorAddons"], + ["function", "addCuratorCameraArea"], + ["function", "addCuratorEditableObjects"], + ["function", "addCuratorEditingArea"], + ["function", "addCuratorPoints"], + ["function", "addEditorObject"], + ["function", "addEventHandler"], + ["function", "addForce"], + ["function", "addForceGeneratorRTD"], + ["function", "addGoggles"], + ["function", "addGroupIcon"], + ["function", "addHandgunItem"], + ["function", "addHeadgear"], + ["function", "addItem"], + ["function", "addItemCargo"], + ["function", "addItemCargoGlobal"], + ["function", "addItemPool"], + ["function", "addItemToBackpack"], + ["function", "addItemToUniform"], + ["function", "addItemToVest"], + ["function", "addLiveStats"], + ["function", "addMagazine"], + ["function", "addMagazineAmmoCargo"], + ["function", "addMagazineCargo"], + ["function", "addMagazineCargoGlobal"], + ["function", "addMagazineGlobal"], + ["function", "addMagazinePool"], + ["function", "addMagazines"], + ["function", "addMagazineTurret"], + ["function", "addMenu"], + ["function", "addMenuItem"], + ["function", "addMissionEventHandler"], + ["function", "addMPEventHandler"], + ["function", "addMusicEventHandler"], + ["function", "addOwnedMine"], + ["function", "addPlayerScores"], + ["function", "addPrimaryWeaponItem"], + ["function", "addPublicVariableEventHandler"], + ["function", "addRating"], + ["function", "addResources"], + ["function", "addScore"], + ["function", "addScoreSide"], + ["function", "addSecondaryWeaponItem"], + ["function", "addSwitchableUnit"], + ["function", "addTeamMember"], + ["function", "addToRemainsCollector"], + ["function", "addTorque"], + ["function", "addUniform"], + ["function", "addVehicle"], + ["function", "addVest"], + ["function", "addWaypoint"], + ["function", "addWeapon"], + ["function", "addWeaponCargo"], + ["function", "addWeaponCargoGlobal"], + ["function", "addWeaponGlobal"], + ["function", "addWeaponItem"], + ["function", "addWeaponPool"], + ["function", "addWeaponTurret"], + ["function", "admin"], + ["function", "agent"], + ["function", "agents"], + ["function", "AGLToASL"], + ["function", "aimedAtTarget"], + ["function", "aimPos"], + ["function", "airDensityCurveRTD"], + ["function", "airDensityRTD"], + ["function", "airplaneThrottle"], + ["function", "airportSide"], + ["function", "AISFinishHeal"], + ["function", "alive"], + ["function", "all3DENEntities"], + ["function", "allAirports"], + ["function", "allControls"], + ["function", "allCurators"], + ["function", "allCutLayers"], + ["function", "allDead"], + ["function", "allDeadMen"], + ["function", "allDisplays"], + ["function", "allGroups"], + ["function", "allMapMarkers"], + ["function", "allMines"], + ["function", "allMissionObjects"], + ["function", "allow3DMode"], + ["function", "allowCrewInImmobile"], + ["function", "allowCuratorLogicIgnoreAreas"], + ["function", "allowDamage"], + ["function", "allowDammage"], + ["function", "allowFileOperations"], + ["function", "allowFleeing"], + ["function", "allowGetIn"], + ["function", "allowSprint"], + ["function", "allPlayers"], + ["function", "allSimpleObjects"], + ["function", "allSites"], + ["function", "allTurrets"], + ["function", "allUnits"], + ["function", "allUnitsUAV"], + ["function", "allVariables"], + ["function", "ammo"], + ["function", "ammoOnPylon"], + ["function", "animate"], + ["function", "animateBay"], + ["function", "animateDoor"], + ["function", "animatePylon"], + ["function", "animateSource"], + ["function", "animationNames"], + ["function", "animationPhase"], + ["function", "animationSourcePhase"], + ["function", "animationState"], + ["function", "append"], + ["function", "apply"], + ["function", "armoryPoints"], + ["function", "arrayIntersect"], + ["function", "asin"], + ["function", "ASLToAGL"], + ["function", "ASLToATL"], + ["function", "assert"], + ["function", "assignAsCargo"], + ["function", "assignAsCargoIndex"], + ["function", "assignAsCommander"], + ["function", "assignAsDriver"], + ["function", "assignAsGunner"], + ["function", "assignAsTurret"], + ["function", "assignCurator"], + ["function", "assignedCargo"], + ["function", "assignedCommander"], + ["function", "assignedDriver"], + ["function", "assignedGunner"], + ["function", "assignedItems"], + ["function", "assignedTarget"], + ["function", "assignedTeam"], + ["function", "assignedVehicle"], + ["function", "assignedVehicleRole"], + ["function", "assignItem"], + ["function", "assignTeam"], + ["function", "assignToAirport"], + ["function", "atan"], + ["function", "atan2"], + ["function", "atg"], + ["function", "ATLToASL"], + ["function", "attachedObject"], + ["function", "attachedObjects"], + ["function", "attachedTo"], + ["function", "attachObject"], + ["function", "attachTo"], + ["function", "attackEnabled"], + ["function", "backpack"], + ["function", "backpackCargo"], + ["function", "backpackContainer"], + ["function", "backpackItems"], + ["function", "backpackMagazines"], + ["function", "backpackSpaceFor"], + ["function", "behaviour"], + ["function", "benchmark"], + ["function", "binocular"], + ["function", "blufor"], + ["function", "boundingBox"], + ["function", "boundingBoxReal"], + ["function", "boundingCenter"], + ["function", "briefingName"], + ["function", "buildingExit"], + ["function", "buildingPos"], + ["function", "buldozer_EnableRoadDiag"], + ["function", "buldozer_IsEnabledRoadDiag"], + ["function", "buldozer_LoadNewRoads"], + ["function", "buldozer_reloadOperMap"], + ["function", "buttonAction"], + ["function", "buttonSetAction"], + ["function", "cadetMode"], + ["function", "callExtension"], + ["function", "camCommand"], + ["function", "camCommit"], + ["function", "camCommitPrepared"], + ["function", "camCommitted"], + ["function", "camConstuctionSetParams"], + ["function", "camCreate"], + ["function", "camDestroy"], + ["function", "cameraEffect"], + ["function", "cameraEffectEnableHUD"], + ["function", "cameraInterest"], + ["function", "cameraOn"], + ["function", "cameraView"], + ["function", "campaignConfigFile"], + ["function", "camPreload"], + ["function", "camPreloaded"], + ["function", "camPrepareBank"], + ["function", "camPrepareDir"], + ["function", "camPrepareDive"], + ["function", "camPrepareFocus"], + ["function", "camPrepareFov"], + ["function", "camPrepareFovRange"], + ["function", "camPreparePos"], + ["function", "camPrepareRelPos"], + ["function", "camPrepareTarget"], + ["function", "camSetBank"], + ["function", "camSetDir"], + ["function", "camSetDive"], + ["function", "camSetFocus"], + ["function", "camSetFov"], + ["function", "camSetFovRange"], + ["function", "camSetPos"], + ["function", "camSetRelPos"], + ["function", "camSetTarget"], + ["function", "camTarget"], + ["function", "camUseNVG"], + ["function", "canAdd"], + ["function", "canAddItemToBackpack"], + ["function", "canAddItemToUniform"], + ["function", "canAddItemToVest"], + ["function", "cancelSimpleTaskDestination"], + ["function", "canFire"], + ["function", "canMove"], + ["function", "canSlingLoad"], + ["function", "canStand"], + ["function", "canSuspend"], + ["function", "canTriggerDynamicSimulation"], + ["function", "canUnloadInCombat"], + ["function", "canVehicleCargo"], + ["function", "captive"], + ["function", "captiveNum"], + ["function", "cbChecked"], + ["function", "cbSetChecked"], + ["function", "ceil"], + ["function", "channelEnabled"], + ["function", "cheatsEnabled"], + ["function", "checkAIFeature"], + ["function", "checkVisibility"], + ["function", "civilian"], + ["function", "className"], + ["function", "clear3DENAttribute"], + ["function", "clear3DENInventory"], + ["function", "clearAllItemsFromBackpack"], + ["function", "clearBackpackCargo"], + ["function", "clearBackpackCargoGlobal"], + ["function", "clearForcesRTD"], + ["function", "clearGroupIcons"], + ["function", "clearItemCargo"], + ["function", "clearItemCargoGlobal"], + ["function", "clearItemPool"], + ["function", "clearMagazineCargo"], + ["function", "clearMagazineCargoGlobal"], + ["function", "clearMagazinePool"], + ["function", "clearOverlay"], + ["function", "clearRadio"], + ["function", "clearVehicleInit"], + ["function", "clearWeaponCargo"], + ["function", "clearWeaponCargoGlobal"], + ["function", "clearWeaponPool"], + ["function", "clientOwner"], + ["function", "closeDialog"], + ["function", "closeDisplay"], + ["function", "closeOverlay"], + ["function", "collapseObjectTree"], + ["function", "collect3DENHistory"], + ["function", "collectiveRTD"], + ["function", "combatMode"], + ["function", "commandArtilleryFire"], + ["function", "commandChat"], + ["function", "commander"], + ["function", "commandFire"], + ["function", "commandFollow"], + ["function", "commandFSM"], + ["function", "commandGetOut"], + ["function", "commandingMenu"], + ["function", "commandMove"], + ["function", "commandRadio"], + ["function", "commandStop"], + ["function", "commandSuppressiveFire"], + ["function", "commandTarget"], + ["function", "commandWatch"], + ["function", "comment"], + ["function", "commitOverlay"], + ["function", "compile"], + ["function", "compileFinal"], + ["function", "completedFSM"], + ["function", "composeText"], + ["function", "configClasses"], + ["function", "configFile"], + ["function", "configHierarchy"], + ["function", "configName"], + ["function", "configNull"], + ["function", "configProperties"], + ["function", "configSourceAddonList"], + ["function", "configSourceMod"], + ["function", "configSourceModList"], + ["function", "confirmSensorTarget"], + ["function", "connectTerminalToUAV"], + ["function", "controlNull"], + ["function", "controlsGroupCtrl"], + ["function", "copyFromClipboard"], + ["function", "copyToClipboard"], + ["function", "copyWaypoints"], + ["function", "cos"], + ["function", "count"], + ["function", "countEnemy"], + ["function", "countFriendly"], + ["function", "countSide"], + ["function", "countType"], + ["function", "countUnknown"], + ["function", "create3DENComposition"], + ["function", "create3DENEntity"], + ["function", "createAgent"], + ["function", "createCenter"], + ["function", "createDialog"], + ["function", "createDiaryLink"], + ["function", "createDiaryRecord"], + ["function", "createDiarySubject"], + ["function", "createDisplay"], + ["function", "createGearDialog"], + ["function", "createGroup"], + ["function", "createGuardedPoint"], + ["function", "createLocation"], + ["function", "createMarker"], + ["function", "createMarkerLocal"], + ["function", "createMenu"], + ["function", "createMine"], + ["function", "createMissionDisplay"], + ["function", "createMPCampaignDisplay"], + ["function", "createSimpleObject"], + ["function", "createSimpleTask"], + ["function", "createSite"], + ["function", "createSoundSource"], + ["function", "createTask"], + ["function", "createTeam"], + ["function", "createTrigger"], + ["function", "createUnit"], + ["function", "createVehicle"], + ["function", "createVehicleCrew"], + ["function", "createVehicleLocal"], + ["function", "crew"], + ["function", "ctAddHeader"], + ["function", "ctAddRow"], + ["function", "ctClear"], + ["function", "ctCurSel"], + ["function", "ctData"], + ["function", "ctFindHeaderRows"], + ["function", "ctFindRowHeader"], + ["function", "ctHeaderControls"], + ["function", "ctHeaderCount"], + ["function", "ctRemoveHeaders"], + ["function", "ctRemoveRows"], + ["function", "ctrlActivate"], + ["function", "ctrlAddEventHandler"], + ["function", "ctrlAngle"], + ["function", "ctrlAutoScrollDelay"], + ["function", "ctrlAutoScrollRewind"], + ["function", "ctrlAutoScrollSpeed"], + ["function", "ctrlChecked"], + ["function", "ctrlClassName"], + ["function", "ctrlCommit"], + ["function", "ctrlCommitted"], + ["function", "ctrlCreate"], + ["function", "ctrlDelete"], + ["function", "ctrlEnable"], + ["function", "ctrlEnabled"], + ["function", "ctrlFade"], + ["function", "ctrlHTMLLoaded"], + ["function", "ctrlIDC"], + ["function", "ctrlIDD"], + ["function", "ctrlMapAnimAdd"], + ["function", "ctrlMapAnimClear"], + ["function", "ctrlMapAnimCommit"], + ["function", "ctrlMapAnimDone"], + ["function", "ctrlMapCursor"], + ["function", "ctrlMapMouseOver"], + ["function", "ctrlMapScale"], + ["function", "ctrlMapScreenToWorld"], + ["function", "ctrlMapWorldToScreen"], + ["function", "ctrlModel"], + ["function", "ctrlModelDirAndUp"], + ["function", "ctrlModelScale"], + ["function", "ctrlParent"], + ["function", "ctrlParentControlsGroup"], + ["function", "ctrlPosition"], + ["function", "ctrlRemoveAllEventHandlers"], + ["function", "ctrlRemoveEventHandler"], + ["function", "ctrlScale"], + ["function", "ctrlSetActiveColor"], + ["function", "ctrlSetAngle"], + ["function", "ctrlSetAutoScrollDelay"], + ["function", "ctrlSetAutoScrollRewind"], + ["function", "ctrlSetAutoScrollSpeed"], + ["function", "ctrlSetBackgroundColor"], + ["function", "ctrlSetChecked"], + ["function", "ctrlSetDisabledColor"], + ["function", "ctrlSetEventHandler"], + ["function", "ctrlSetFade"], + ["function", "ctrlSetFocus"], + ["function", "ctrlSetFont"], + ["function", "ctrlSetFontH1"], + ["function", "ctrlSetFontH1B"], + ["function", "ctrlSetFontH2"], + ["function", "ctrlSetFontH2B"], + ["function", "ctrlSetFontH3"], + ["function", "ctrlSetFontH3B"], + ["function", "ctrlSetFontH4"], + ["function", "ctrlSetFontH4B"], + ["function", "ctrlSetFontH5"], + ["function", "ctrlSetFontH5B"], + ["function", "ctrlSetFontH6"], + ["function", "ctrlSetFontH6B"], + ["function", "ctrlSetFontHeight"], + ["function", "ctrlSetFontHeightH1"], + ["function", "ctrlSetFontHeightH2"], + ["function", "ctrlSetFontHeightH3"], + ["function", "ctrlSetFontHeightH4"], + ["function", "ctrlSetFontHeightH5"], + ["function", "ctrlSetFontHeightH6"], + ["function", "ctrlSetFontHeightSecondary"], + ["function", "ctrlSetFontP"], + ["function", "ctrlSetFontPB"], + ["function", "ctrlSetFontSecondary"], + ["function", "ctrlSetForegroundColor"], + ["function", "ctrlSetModel"], + ["function", "ctrlSetModelDirAndUp"], + ["function", "ctrlSetModelScale"], + ["function", "ctrlSetPixelPrecision"], + ["function", "ctrlSetPosition"], + ["function", "ctrlSetScale"], + ["function", "ctrlSetStructuredText"], + ["function", "ctrlSetText"], + ["function", "ctrlSetTextColor"], + ["function", "ctrlSetTextColorSecondary"], + ["function", "ctrlSetTextSecondary"], + ["function", "ctrlSetTooltip"], + ["function", "ctrlSetTooltipColorBox"], + ["function", "ctrlSetTooltipColorShade"], + ["function", "ctrlSetTooltipColorText"], + ["function", "ctrlShow"], + ["function", "ctrlShown"], + ["function", "ctrlText"], + ["function", "ctrlTextHeight"], + ["function", "ctrlTextSecondary"], + ["function", "ctrlTextWidth"], + ["function", "ctrlType"], + ["function", "ctrlVisible"], + ["function", "ctRowControls"], + ["function", "ctRowCount"], + ["function", "ctSetCurSel"], + ["function", "ctSetData"], + ["function", "ctSetHeaderTemplate"], + ["function", "ctSetRowTemplate"], + ["function", "ctSetValue"], + ["function", "ctValue"], + ["function", "curatorAddons"], + ["function", "curatorCamera"], + ["function", "curatorCameraArea"], + ["function", "curatorCameraAreaCeiling"], + ["function", "curatorCoef"], + ["function", "curatorEditableObjects"], + ["function", "curatorEditingArea"], + ["function", "curatorEditingAreaType"], + ["function", "curatorMouseOver"], + ["function", "curatorPoints"], + ["function", "curatorRegisteredObjects"], + ["function", "curatorSelected"], + ["function", "curatorWaypointCost"], + ["function", "current3DENOperation"], + ["function", "currentChannel"], + ["function", "currentCommand"], + ["function", "currentMagazine"], + ["function", "currentMagazineDetail"], + ["function", "currentMagazineDetailTurret"], + ["function", "currentMagazineTurret"], + ["function", "currentMuzzle"], + ["function", "currentNamespace"], + ["function", "currentTask"], + ["function", "currentTasks"], + ["function", "currentThrowable"], + ["function", "currentVisionMode"], + ["function", "currentWaypoint"], + ["function", "currentWeapon"], + ["function", "currentWeaponMode"], + ["function", "currentWeaponTurret"], + ["function", "currentZeroing"], + ["function", "cursorObject"], + ["function", "cursorTarget"], + ["function", "customChat"], + ["function", "customRadio"], + ["function", "cutFadeOut"], + ["function", "cutObj"], + ["function", "cutRsc"], + ["function", "cutText"], + ["function", "damage"], + ["function", "date"], + ["function", "dateToNumber"], + ["function", "daytime"], + ["function", "deActivateKey"], + ["function", "debriefingText"], + ["function", "debugFSM"], + ["function", "debugLog"], + ["function", "deg"], + ["function", "delete3DENEntities"], + ["function", "deleteAt"], + ["function", "deleteCenter"], + ["function", "deleteCollection"], + ["function", "deleteEditorObject"], + ["function", "deleteGroup"], + ["function", "deleteGroupWhenEmpty"], + ["function", "deleteIdentity"], + ["function", "deleteLocation"], + ["function", "deleteMarker"], + ["function", "deleteMarkerLocal"], + ["function", "deleteRange"], + ["function", "deleteResources"], + ["function", "deleteSite"], + ["function", "deleteStatus"], + ["function", "deleteTeam"], + ["function", "deleteVehicle"], + ["function", "deleteVehicleCrew"], + ["function", "deleteWaypoint"], + ["function", "detach"], + ["function", "detectedMines"], + ["function", "diag_activeMissionFSMs"], + ["function", "diag_activeScripts"], + ["function", "diag_activeSQFScripts"], + ["function", "diag_activeSQSScripts"], + ["function", "diag_captureFrame"], + ["function", "diag_captureFrameToFile"], + ["function", "diag_captureSlowFrame"], + ["function", "diag_codePerformance"], + ["function", "diag_drawMode"], + ["function", "diag_dynamicSimulationEnd"], + ["function", "diag_enable"], + ["function", "diag_enabled"], + ["function", "diag_fps"], + ["function", "diag_fpsMin"], + ["function", "diag_frameNo"], + ["function", "diag_lightNewLoad"], + ["function", "diag_list"], + ["function", "diag_log"], + ["function", "diag_logSlowFrame"], + ["function", "diag_mergeConfigFile"], + ["function", "diag_recordTurretLimits"], + ["function", "diag_setLightNew"], + ["function", "diag_tickTime"], + ["function", "diag_toggle"], + ["function", "dialog"], + ["function", "diarySubjectExists"], + ["function", "didJIP"], + ["function", "didJIPOwner"], + ["function", "difficulty"], + ["function", "difficultyEnabled"], + ["function", "difficultyEnabledRTD"], + ["function", "difficultyOption"], + ["function", "direction"], + ["function", "directSay"], + ["function", "disableAI"], + ["function", "disableCollisionWith"], + ["function", "disableConversation"], + ["function", "disableDebriefingStats"], + ["function", "disableMapIndicators"], + ["function", "disableNVGEquipment"], + ["function", "disableRemoteSensors"], + ["function", "disableSerialization"], + ["function", "disableTIEquipment"], + ["function", "disableUAVConnectability"], + ["function", "disableUserInput"], + ["function", "displayAddEventHandler"], + ["function", "displayCtrl"], + ["function", "displayNull"], + ["function", "displayParent"], + ["function", "displayRemoveAllEventHandlers"], + ["function", "displayRemoveEventHandler"], + ["function", "displaySetEventHandler"], + ["function", "dissolveTeam"], + ["function", "distance"], + ["function", "distance2D"], + ["function", "distanceSqr"], + ["function", "distributionRegion"], + ["function", "do3DENAction"], + ["function", "doArtilleryFire"], + ["function", "doFire"], + ["function", "doFollow"], + ["function", "doFSM"], + ["function", "doGetOut"], + ["function", "doMove"], + ["function", "doorPhase"], + ["function", "doStop"], + ["function", "doSuppressiveFire"], + ["function", "doTarget"], + ["function", "doWatch"], + ["function", "drawArrow"], + ["function", "drawEllipse"], + ["function", "drawIcon"], + ["function", "drawIcon3D"], + ["function", "drawLine"], + ["function", "drawLine3D"], + ["function", "drawLink"], + ["function", "drawLocation"], + ["function", "drawPolygon"], + ["function", "drawRectangle"], + ["function", "drawTriangle"], + ["function", "driver"], + ["function", "drop"], + ["function", "dynamicSimulationDistance"], + ["function", "dynamicSimulationDistanceCoef"], + ["function", "dynamicSimulationEnabled"], + ["function", "dynamicSimulationSystemEnabled"], + ["function", "east"], + ["function", "edit3DENMissionAttributes"], + ["function", "editObject"], + ["function", "editorSetEventHandler"], + ["function", "effectiveCommander"], + ["function", "emptyPositions"], + ["function", "enableAI"], + ["function", "enableAIFeature"], + ["function", "enableAimPrecision"], + ["function", "enableAttack"], + ["function", "enableAudioFeature"], + ["function", "enableAutoStartUpRTD"], + ["function", "enableAutoTrimRTD"], + ["function", "enableCamShake"], + ["function", "enableCaustics"], + ["function", "enableChannel"], + ["function", "enableCollisionWith"], + ["function", "enableCopilot"], + ["function", "enableDebriefingStats"], + ["function", "enableDiagLegend"], + ["function", "enableDynamicSimulation"], + ["function", "enableDynamicSimulationSystem"], + ["function", "enableEndDialog"], + ["function", "enableEngineArtillery"], + ["function", "enableEnvironment"], + ["function", "enableFatigue"], + ["function", "enableGunLights"], + ["function", "enableInfoPanelComponent"], + ["function", "enableIRLasers"], + ["function", "enableMimics"], + ["function", "enablePersonTurret"], + ["function", "enableRadio"], + ["function", "enableReload"], + ["function", "enableRopeAttach"], + ["function", "enableSatNormalOnDetail"], + ["function", "enableSaving"], + ["function", "enableSentences"], + ["function", "enableSimulation"], + ["function", "enableSimulationGlobal"], + ["function", "enableStamina"], + ["function", "enableStressDamage"], + ["function", "enableTeamSwitch"], + ["function", "enableTraffic"], + ["function", "enableUAVConnectability"], + ["function", "enableUAVWaypoints"], + ["function", "enableVehicleCargo"], + ["function", "enableVehicleSensor"], + ["function", "enableWeaponDisassembly"], + ["function", "endl"], + ["function", "endLoadingScreen"], + ["function", "endMission"], + ["function", "engineOn"], + ["function", "enginesIsOnRTD"], + ["function", "enginesPowerRTD"], + ["function", "enginesRpmRTD"], + ["function", "enginesTorqueRTD"], + ["function", "entities"], + ["function", "environmentEnabled"], + ["function", "estimatedEndServerTime"], + ["function", "estimatedTimeLeft"], + ["function", "evalObjectArgument"], + ["function", "everyBackpack"], + ["function", "everyContainer"], + ["function", "exec"], + ["function", "execEditorScript"], + ["function", "exp"], + ["function", "expectedDestination"], + ["function", "exportJIPMessages"], + ["function", "eyeDirection"], + ["function", "eyePos"], + ["function", "face"], + ["function", "faction"], + ["function", "fadeMusic"], + ["function", "fadeRadio"], + ["function", "fadeSound"], + ["function", "fadeSpeech"], + ["function", "failMission"], + ["function", "fillWeaponsFromPool"], + ["function", "find"], + ["function", "findCover"], + ["function", "findDisplay"], + ["function", "findEditorObject"], + ["function", "findEmptyPosition"], + ["function", "findEmptyPositionReady"], + ["function", "findIf"], + ["function", "findNearestEnemy"], + ["function", "finishMissionInit"], + ["function", "finite"], + ["function", "fire"], + ["function", "fireAtTarget"], + ["function", "firstBackpack"], + ["function", "flag"], + ["function", "flagAnimationPhase"], + ["function", "flagOwner"], + ["function", "flagSide"], + ["function", "flagTexture"], + ["function", "fleeing"], + ["function", "floor"], + ["function", "flyInHeight"], + ["function", "flyInHeightASL"], + ["function", "fog"], + ["function", "fogForecast"], + ["function", "fogParams"], + ["function", "forceAddUniform"], + ["function", "forceAtPositionRTD"], + ["function", "forcedMap"], + ["function", "forceEnd"], + ["function", "forceFlagTexture"], + ["function", "forceFollowRoad"], + ["function", "forceGeneratorRTD"], + ["function", "forceMap"], + ["function", "forceRespawn"], + ["function", "forceSpeed"], + ["function", "forceWalk"], + ["function", "forceWeaponFire"], + ["function", "forceWeatherChange"], + ["function", "forgetTarget"], + ["function", "format"], + ["function", "formation"], + ["function", "formationDirection"], + ["function", "formationLeader"], + ["function", "formationMembers"], + ["function", "formationPosition"], + ["function", "formationTask"], + ["function", "formatText"], + ["function", "formLeader"], + ["function", "freeLook"], + ["function", "fromEditor"], + ["function", "fuel"], + ["function", "fullCrew"], + ["function", "gearIDCAmmoCount"], + ["function", "gearSlotAmmoCount"], + ["function", "gearSlotData"], + ["function", "get3DENActionState"], + ["function", "get3DENAttribute"], + ["function", "get3DENCamera"], + ["function", "get3DENConnections"], + ["function", "get3DENEntity"], + ["function", "get3DENEntityID"], + ["function", "get3DENGrid"], + ["function", "get3DENIconsVisible"], + ["function", "get3DENLayerEntities"], + ["function", "get3DENLinesVisible"], + ["function", "get3DENMissionAttribute"], + ["function", "get3DENMouseOver"], + ["function", "get3DENSelected"], + ["function", "getAimingCoef"], + ["function", "getAllEnvSoundControllers"], + ["function", "getAllHitPointsDamage"], + ["function", "getAllOwnedMines"], + ["function", "getAllSoundControllers"], + ["function", "getAmmoCargo"], + ["function", "getAnimAimPrecision"], + ["function", "getAnimSpeedCoef"], + ["function", "getArray"], + ["function", "getArtilleryAmmo"], + ["function", "getArtilleryComputerSettings"], + ["function", "getArtilleryETA"], + ["function", "getAssignedCuratorLogic"], + ["function", "getAssignedCuratorUnit"], + ["function", "getBackpackCargo"], + ["function", "getBleedingRemaining"], + ["function", "getBurningValue"], + ["function", "getCameraViewDirection"], + ["function", "getCargoIndex"], + ["function", "getCenterOfMass"], + ["function", "getClientState"], + ["function", "getClientStateNumber"], + ["function", "getCompatiblePylonMagazines"], + ["function", "getConnectedUAV"], + ["function", "getContainerMaxLoad"], + ["function", "getCursorObjectParams"], + ["function", "getCustomAimCoef"], + ["function", "getDammage"], + ["function", "getDescription"], + ["function", "getDir"], + ["function", "getDirVisual"], + ["function", "getDLCAssetsUsage"], + ["function", "getDLCAssetsUsageByName"], + ["function", "getDLCs"], + ["function", "getDLCUsageTime"], + ["function", "getEditorCamera"], + ["function", "getEditorMode"], + ["function", "getEditorObjectScope"], + ["function", "getElevationOffset"], + ["function", "getEngineTargetRpmRTD"], + ["function", "getEnvSoundController"], + ["function", "getFatigue"], + ["function", "getFieldManualStartPage"], + ["function", "getForcedFlagTexture"], + ["function", "getFriend"], + ["function", "getFSMVariable"], + ["function", "getFuelCargo"], + ["function", "getGroupIcon"], + ["function", "getGroupIconParams"], + ["function", "getGroupIcons"], + ["function", "getHideFrom"], + ["function", "getHit"], + ["function", "getHitIndex"], + ["function", "getHitPointDamage"], + ["function", "getItemCargo"], + ["function", "getMagazineCargo"], + ["function", "getMarkerColor"], + ["function", "getMarkerPos"], + ["function", "getMarkerSize"], + ["function", "getMarkerType"], + ["function", "getMass"], + ["function", "getMissionConfig"], + ["function", "getMissionConfigValue"], + ["function", "getMissionDLCs"], + ["function", "getMissionLayerEntities"], + ["function", "getMissionLayers"], + ["function", "getModelInfo"], + ["function", "getMousePosition"], + ["function", "getMusicPlayedTime"], + ["function", "getNumber"], + ["function", "getObjectArgument"], + ["function", "getObjectChildren"], + ["function", "getObjectDLC"], + ["function", "getObjectMaterials"], + ["function", "getObjectProxy"], + ["function", "getObjectTextures"], + ["function", "getObjectType"], + ["function", "getObjectViewDistance"], + ["function", "getOxygenRemaining"], + ["function", "getPersonUsedDLCs"], + ["function", "getPilotCameraDirection"], + ["function", "getPilotCameraPosition"], + ["function", "getPilotCameraRotation"], + ["function", "getPilotCameraTarget"], + ["function", "getPlateNumber"], + ["function", "getPlayerChannel"], + ["function", "getPlayerScores"], + ["function", "getPlayerUID"], + ["function", "getPlayerUIDOld"], + ["function", "getPos"], + ["function", "getPosASL"], + ["function", "getPosASLVisual"], + ["function", "getPosASLW"], + ["function", "getPosATL"], + ["function", "getPosATLVisual"], + ["function", "getPosVisual"], + ["function", "getPosWorld"], + ["function", "getPylonMagazines"], + ["function", "getRelDir"], + ["function", "getRelPos"], + ["function", "getRemoteSensorsDisabled"], + ["function", "getRepairCargo"], + ["function", "getResolution"], + ["function", "getRotorBrakeRTD"], + ["function", "getShadowDistance"], + ["function", "getShotParents"], + ["function", "getSlingLoad"], + ["function", "getSoundController"], + ["function", "getSoundControllerResult"], + ["function", "getSpeed"], + ["function", "getStamina"], + ["function", "getStatValue"], + ["function", "getSuppression"], + ["function", "getTerrainGrid"], + ["function", "getTerrainHeightASL"], + ["function", "getText"], + ["function", "getTotalDLCUsageTime"], + ["function", "getTrimOffsetRTD"], + ["function", "getUnitLoadout"], + ["function", "getUnitTrait"], + ["function", "getUserMFDText"], + ["function", "getUserMFDValue"], + ["function", "getVariable"], + ["function", "getVehicleCargo"], + ["function", "getWeaponCargo"], + ["function", "getWeaponSway"], + ["function", "getWingsOrientationRTD"], + ["function", "getWingsPositionRTD"], + ["function", "getWPPos"], + ["function", "glanceAt"], + ["function", "globalChat"], + ["function", "globalRadio"], + ["function", "goggles"], + ["function", "group"], + ["function", "groupChat"], + ["function", "groupFromNetId"], + ["function", "groupIconSelectable"], + ["function", "groupIconsVisible"], + ["function", "groupId"], + ["function", "groupOwner"], + ["function", "groupRadio"], + ["function", "groupSelectedUnits"], + ["function", "groupSelectUnit"], + ["function", "grpNull"], + ["function", "gunner"], + ["function", "gusts"], + ["function", "halt"], + ["function", "handgunItems"], + ["function", "handgunMagazine"], + ["function", "handgunWeapon"], + ["function", "handsHit"], + ["function", "hasInterface"], + ["function", "hasPilotCamera"], + ["function", "hasWeapon"], + ["function", "hcAllGroups"], + ["function", "hcGroupParams"], + ["function", "hcLeader"], + ["function", "hcRemoveAllGroups"], + ["function", "hcRemoveGroup"], + ["function", "hcSelected"], + ["function", "hcSelectGroup"], + ["function", "hcSetGroup"], + ["function", "hcShowBar"], + ["function", "hcShownBar"], + ["function", "headgear"], + ["function", "hideBody"], + ["function", "hideObject"], + ["function", "hideObjectGlobal"], + ["function", "hideSelection"], + ["function", "hint"], + ["function", "hintC"], + ["function", "hintCadet"], + ["function", "hintSilent"], + ["function", "hmd"], + ["function", "hostMission"], + ["function", "htmlLoad"], + ["function", "HUDMovementLevels"], + ["function", "humidity"], + ["function", "image"], + ["function", "importAllGroups"], + ["function", "importance"], + ["function", "in"], + ["function", "inArea"], + ["function", "inAreaArray"], + ["function", "incapacitatedState"], + ["function", "independent"], + ["function", "inflame"], + ["function", "inflamed"], + ["function", "infoPanel"], + ["function", "infoPanelComponentEnabled"], + ["function", "infoPanelComponents"], + ["function", "infoPanels"], + ["function", "inGameUISetEventHandler"], + ["function", "inheritsFrom"], + ["function", "initAmbientLife"], + ["function", "inPolygon"], + ["function", "inputAction"], + ["function", "inRangeOfArtillery"], + ["function", "insertEditorObject"], + ["function", "intersect"], + ["function", "is3DEN"], + ["function", "is3DENMultiplayer"], + ["function", "isAbleToBreathe"], + ["function", "isAgent"], + ["function", "isAimPrecisionEnabled"], + ["function", "isArray"], + ["function", "isAutoHoverOn"], + ["function", "isAutonomous"], + ["function", "isAutoStartUpEnabledRTD"], + ["function", "isAutotest"], + ["function", "isAutoTrimOnRTD"], + ["function", "isBleeding"], + ["function", "isBurning"], + ["function", "isClass"], + ["function", "isCollisionLightOn"], + ["function", "isCopilotEnabled"], + ["function", "isDamageAllowed"], + ["function", "isDedicated"], + ["function", "isDLCAvailable"], + ["function", "isEngineOn"], + ["function", "isEqualTo"], + ["function", "isEqualType"], + ["function", "isEqualTypeAll"], + ["function", "isEqualTypeAny"], + ["function", "isEqualTypeArray"], + ["function", "isEqualTypeParams"], + ["function", "isFilePatchingEnabled"], + ["function", "isFlashlightOn"], + ["function", "isFlatEmpty"], + ["function", "isForcedWalk"], + ["function", "isFormationLeader"], + ["function", "isGroupDeletedWhenEmpty"], + ["function", "isHidden"], + ["function", "isInRemainsCollector"], + ["function", "isInstructorFigureEnabled"], + ["function", "isIRLaserOn"], + ["function", "isKeyActive"], + ["function", "isKindOf"], + ["function", "isLaserOn"], + ["function", "isLightOn"], + ["function", "isLocalized"], + ["function", "isManualFire"], + ["function", "isMarkedForCollection"], + ["function", "isMultiplayer"], + ["function", "isMultiplayerSolo"], + ["function", "isNil"], + ["function", "isNull"], + ["function", "isNumber"], + ["function", "isObjectHidden"], + ["function", "isObjectRTD"], + ["function", "isOnRoad"], + ["function", "isPipEnabled"], + ["function", "isPlayer"], + ["function", "isRealTime"], + ["function", "isRemoteExecuted"], + ["function", "isRemoteExecutedJIP"], + ["function", "isServer"], + ["function", "isShowing3DIcons"], + ["function", "isSimpleObject"], + ["function", "isSprintAllowed"], + ["function", "isStaminaEnabled"], + ["function", "isSteamMission"], + ["function", "isStreamFriendlyUIEnabled"], + ["function", "isStressDamageEnabled"], + ["function", "isText"], + ["function", "isTouchingGround"], + ["function", "isTurnedOut"], + ["function", "isTutHintsEnabled"], + ["function", "isUAVConnectable"], + ["function", "isUAVConnected"], + ["function", "isUIContext"], + ["function", "isUniformAllowed"], + ["function", "isVehicleCargo"], + ["function", "isVehicleRadarOn"], + ["function", "isVehicleSensorEnabled"], + ["function", "isWalking"], + ["function", "isWeaponDeployed"], + ["function", "isWeaponRested"], + ["function", "itemCargo"], + ["function", "items"], + ["function", "itemsWithMagazines"], + ["function", "join"], + ["function", "joinAs"], + ["function", "joinAsSilent"], + ["function", "joinSilent"], + ["function", "joinString"], + ["function", "kbAddDatabase"], + ["function", "kbAddDatabaseTargets"], + ["function", "kbAddTopic"], + ["function", "kbHasTopic"], + ["function", "kbReact"], + ["function", "kbRemoveTopic"], + ["function", "kbTell"], + ["function", "kbWasSaid"], + ["function", "keyImage"], + ["function", "keyName"], + ["function", "knowsAbout"], + ["function", "land"], + ["function", "landAt"], + ["function", "landResult"], + ["function", "language"], + ["function", "laserTarget"], + ["function", "lbAdd"], + ["function", "lbClear"], + ["function", "lbColor"], + ["function", "lbColorRight"], + ["function", "lbCurSel"], + ["function", "lbData"], + ["function", "lbDelete"], + ["function", "lbIsSelected"], + ["function", "lbPicture"], + ["function", "lbPictureRight"], + ["function", "lbSelection"], + ["function", "lbSetColor"], + ["function", "lbSetColorRight"], + ["function", "lbSetCurSel"], + ["function", "lbSetData"], + ["function", "lbSetPicture"], + ["function", "lbSetPictureColor"], + ["function", "lbSetPictureColorDisabled"], + ["function", "lbSetPictureColorSelected"], + ["function", "lbSetPictureRight"], + ["function", "lbSetPictureRightColor"], + ["function", "lbSetPictureRightColorDisabled"], + ["function", "lbSetPictureRightColorSelected"], + ["function", "lbSetSelectColor"], + ["function", "lbSetSelectColorRight"], + ["function", "lbSetSelected"], + ["function", "lbSetText"], + ["function", "lbSetTextRight"], + ["function", "lbSetTooltip"], + ["function", "lbSetValue"], + ["function", "lbSize"], + ["function", "lbSort"], + ["function", "lbSortByValue"], + ["function", "lbText"], + ["function", "lbTextRight"], + ["function", "lbValue"], + ["function", "leader"], + ["function", "leaderboardDeInit"], + ["function", "leaderboardGetRows"], + ["function", "leaderboardInit"], + ["function", "leaderboardRequestRowsFriends"], + ["function", "leaderboardRequestRowsGlobal"], + ["function", "leaderboardRequestRowsGlobalAroundUser"], + ["function", "leaderboardsRequestUploadScore"], + ["function", "leaderboardsRequestUploadScoreKeepBest"], + ["function", "leaderboardState"], + ["function", "leaveVehicle"], + ["function", "libraryCredits"], + ["function", "libraryDisclaimers"], + ["function", "lifeState"], + ["function", "lightAttachObject"], + ["function", "lightDetachObject"], + ["function", "lightIsOn"], + ["function", "lightnings"], + ["function", "limitSpeed"], + ["function", "linearConversion"], + ["function", "lineBreak"], + ["function", "lineIntersects"], + ["function", "lineIntersectsObjs"], + ["function", "lineIntersectsSurfaces"], + ["function", "lineIntersectsWith"], + ["function", "linkItem"], + ["function", "list"], + ["function", "listObjects"], + ["function", "listRemoteTargets"], + ["function", "listVehicleSensors"], + ["function", "ln"], + ["function", "lnbAddArray"], + ["function", "lnbAddColumn"], + ["function", "lnbAddRow"], + ["function", "lnbClear"], + ["function", "lnbColor"], + ["function", "lnbColorRight"], + ["function", "lnbCurSelRow"], + ["function", "lnbData"], + ["function", "lnbDeleteColumn"], + ["function", "lnbDeleteRow"], + ["function", "lnbGetColumnsPosition"], + ["function", "lnbPicture"], + ["function", "lnbPictureRight"], + ["function", "lnbSetColor"], + ["function", "lnbSetColorRight"], + ["function", "lnbSetColumnsPos"], + ["function", "lnbSetCurSelRow"], + ["function", "lnbSetData"], + ["function", "lnbSetPicture"], + ["function", "lnbSetPictureColor"], + ["function", "lnbSetPictureColorRight"], + ["function", "lnbSetPictureColorSelected"], + ["function", "lnbSetPictureColorSelectedRight"], + ["function", "lnbSetPictureRight"], + ["function", "lnbSetText"], + ["function", "lnbSetTextRight"], + ["function", "lnbSetValue"], + ["function", "lnbSize"], + ["function", "lnbSort"], + ["function", "lnbSortByValue"], + ["function", "lnbText"], + ["function", "lnbTextRight"], + ["function", "lnbValue"], + ["function", "load"], + ["function", "loadAbs"], + ["function", "loadBackpack"], + ["function", "loadFile"], + ["function", "loadGame"], + ["function", "loadIdentity"], + ["function", "loadMagazine"], + ["function", "loadOverlay"], + ["function", "loadStatus"], + ["function", "loadUniform"], + ["function", "loadVest"], + ["function", "local"], + ["function", "localize"], + ["function", "locationNull"], + ["function", "locationPosition"], + ["function", "lock"], + ["function", "lockCameraTo"], + ["function", "lockCargo"], + ["function", "lockDriver"], + ["function", "locked"], + ["function", "lockedCargo"], + ["function", "lockedDriver"], + ["function", "lockedTurret"], + ["function", "lockIdentity"], + ["function", "lockTurret"], + ["function", "lockWP"], + ["function", "log"], + ["function", "logEntities"], + ["function", "logNetwork"], + ["function", "logNetworkTerminate"], + ["function", "lookAt"], + ["function", "lookAtPos"], + ["function", "magazineCargo"], + ["function", "magazines"], + ["function", "magazinesAllTurrets"], + ["function", "magazinesAmmo"], + ["function", "magazinesAmmoCargo"], + ["function", "magazinesAmmoFull"], + ["function", "magazinesDetail"], + ["function", "magazinesDetailBackpack"], + ["function", "magazinesDetailUniform"], + ["function", "magazinesDetailVest"], + ["function", "magazinesTurret"], + ["function", "magazineTurretAmmo"], + ["function", "mapAnimAdd"], + ["function", "mapAnimClear"], + ["function", "mapAnimCommit"], + ["function", "mapAnimDone"], + ["function", "mapCenterOnCamera"], + ["function", "mapGridPosition"], + ["function", "markAsFinishedOnSteam"], + ["function", "markerAlpha"], + ["function", "markerBrush"], + ["function", "markerColor"], + ["function", "markerDir"], + ["function", "markerPos"], + ["function", "markerShape"], + ["function", "markerSize"], + ["function", "markerText"], + ["function", "markerType"], + ["function", "max"], + ["function", "members"], + ["function", "menuAction"], + ["function", "menuAdd"], + ["function", "menuChecked"], + ["function", "menuClear"], + ["function", "menuCollapse"], + ["function", "menuData"], + ["function", "menuDelete"], + ["function", "menuEnable"], + ["function", "menuEnabled"], + ["function", "menuExpand"], + ["function", "menuHover"], + ["function", "menuPicture"], + ["function", "menuSetAction"], + ["function", "menuSetCheck"], + ["function", "menuSetData"], + ["function", "menuSetPicture"], + ["function", "menuSetValue"], + ["function", "menuShortcut"], + ["function", "menuShortcutText"], + ["function", "menuSize"], + ["function", "menuSort"], + ["function", "menuText"], + ["function", "menuURL"], + ["function", "menuValue"], + ["function", "min"], + ["function", "mineActive"], + ["function", "mineDetectedBy"], + ["function", "missionConfigFile"], + ["function", "missionDifficulty"], + ["function", "missionName"], + ["function", "missionNamespace"], + ["function", "missionStart"], + ["function", "missionVersion"], + ["function", "modelToWorld"], + ["function", "modelToWorldVisual"], + ["function", "modelToWorldVisualWorld"], + ["function", "modelToWorldWorld"], + ["function", "modParams"], + ["function", "moonIntensity"], + ["function", "moonPhase"], + ["function", "morale"], + ["function", "move"], + ["function", "move3DENCamera"], + ["function", "moveInAny"], + ["function", "moveInCargo"], + ["function", "moveInCommander"], + ["function", "moveInDriver"], + ["function", "moveInGunner"], + ["function", "moveInTurret"], + ["function", "moveObjectToEnd"], + ["function", "moveOut"], + ["function", "moveTime"], + ["function", "moveTo"], + ["function", "moveToCompleted"], + ["function", "moveToFailed"], + ["function", "musicVolume"], + ["function", "name"], + ["function", "nameSound"], + ["function", "nearEntities"], + ["function", "nearestBuilding"], + ["function", "nearestLocation"], + ["function", "nearestLocations"], + ["function", "nearestLocationWithDubbing"], + ["function", "nearestObject"], + ["function", "nearestObjects"], + ["function", "nearestTerrainObjects"], + ["function", "nearObjects"], + ["function", "nearObjectsReady"], + ["function", "nearRoads"], + ["function", "nearSupplies"], + ["function", "nearTargets"], + ["function", "needReload"], + ["function", "netId"], + ["function", "netObjNull"], + ["function", "newOverlay"], + ["function", "nextMenuItemIndex"], + ["function", "nextWeatherChange"], + ["function", "nMenuItems"], + ["function", "numberOfEnginesRTD"], + ["function", "numberToDate"], + ["function", "objectCurators"], + ["function", "objectFromNetId"], + ["function", "objectParent"], + ["function", "objNull"], + ["function", "objStatus"], + ["function", "onBriefingGear"], + ["function", "onBriefingGroup"], + ["function", "onBriefingNotes"], + ["function", "onBriefingPlan"], + ["function", "onBriefingTeamSwitch"], + ["function", "onCommandModeChanged"], + ["function", "onDoubleClick"], + ["function", "onEachFrame"], + ["function", "onGroupIconClick"], + ["function", "onGroupIconOverEnter"], + ["function", "onGroupIconOverLeave"], + ["function", "onHCGroupSelectionChanged"], + ["function", "onMapSingleClick"], + ["function", "onPlayerConnected"], + ["function", "onPlayerDisconnected"], + ["function", "onPreloadFinished"], + ["function", "onPreloadStarted"], + ["function", "onShowNewObject"], + ["function", "onTeamSwitch"], + ["function", "openCuratorInterface"], + ["function", "openDLCPage"], + ["function", "openDSInterface"], + ["function", "openMap"], + ["function", "openSteamApp"], + ["function", "openYoutubeVideo"], + ["function", "opfor"], + ["function", "orderGetIn"], + ["function", "overcast"], + ["function", "overcastForecast"], + ["function", "owner"], + ["function", "param"], + ["function", "params"], + ["function", "parseNumber"], + ["function", "parseSimpleArray"], + ["function", "parseText"], + ["function", "parsingNamespace"], + ["function", "particlesQuality"], + ["function", "pi"], + ["function", "pickWeaponPool"], + ["function", "pitch"], + ["function", "pixelGrid"], + ["function", "pixelGridBase"], + ["function", "pixelGridNoUIScale"], + ["function", "pixelH"], + ["function", "pixelW"], + ["function", "playableSlotsNumber"], + ["function", "playableUnits"], + ["function", "playAction"], + ["function", "playActionNow"], + ["function", "player"], + ["function", "playerRespawnTime"], + ["function", "playerSide"], + ["function", "playersNumber"], + ["function", "playGesture"], + ["function", "playMission"], + ["function", "playMove"], + ["function", "playMoveNow"], + ["function", "playMusic"], + ["function", "playScriptedMission"], + ["function", "playSound"], + ["function", "playSound3D"], + ["function", "position"], + ["function", "positionCameraToWorld"], + ["function", "posScreenToWorld"], + ["function", "posWorldToScreen"], + ["function", "ppEffectAdjust"], + ["function", "ppEffectCommit"], + ["function", "ppEffectCommitted"], + ["function", "ppEffectCreate"], + ["function", "ppEffectDestroy"], + ["function", "ppEffectEnable"], + ["function", "ppEffectEnabled"], + ["function", "ppEffectForceInNVG"], + ["function", "precision"], + ["function", "preloadCamera"], + ["function", "preloadObject"], + ["function", "preloadSound"], + ["function", "preloadTitleObj"], + ["function", "preloadTitleRsc"], + ["function", "primaryWeapon"], + ["function", "primaryWeaponItems"], + ["function", "primaryWeaponMagazine"], + ["function", "priority"], + ["function", "processDiaryLink"], + ["function", "processInitCommands"], + ["function", "productVersion"], + ["function", "profileName"], + ["function", "profileNamespace"], + ["function", "profileNameSteam"], + ["function", "progressLoadingScreen"], + ["function", "progressPosition"], + ["function", "progressSetPosition"], + ["function", "publicVariable"], + ["function", "publicVariableClient"], + ["function", "publicVariableServer"], + ["function", "pushBack"], + ["function", "pushBackUnique"], + ["function", "putWeaponPool"], + ["function", "queryItemsPool"], + ["function", "queryMagazinePool"], + ["function", "queryWeaponPool"], + ["function", "rad"], + ["function", "radioChannelAdd"], + ["function", "radioChannelCreate"], + ["function", "radioChannelRemove"], + ["function", "radioChannelSetCallSign"], + ["function", "radioChannelSetLabel"], + ["function", "radioVolume"], + ["function", "rain"], + ["function", "rainbow"], + ["function", "random"], + ["function", "rank"], + ["function", "rankId"], + ["function", "rating"], + ["function", "rectangular"], + ["function", "registeredTasks"], + ["function", "registerTask"], + ["function", "reload"], + ["function", "reloadEnabled"], + ["function", "remoteControl"], + ["function", "remoteExec"], + ["function", "remoteExecCall"], + ["function", "remoteExecutedOwner"], + ["function", "remove3DENConnection"], + ["function", "remove3DENEventHandler"], + ["function", "remove3DENLayer"], + ["function", "removeAction"], + ["function", "removeAll3DENEventHandlers"], + ["function", "removeAllActions"], + ["function", "removeAllAssignedItems"], + ["function", "removeAllContainers"], + ["function", "removeAllCuratorAddons"], + ["function", "removeAllCuratorCameraAreas"], + ["function", "removeAllCuratorEditingAreas"], + ["function", "removeAllEventHandlers"], + ["function", "removeAllHandgunItems"], + ["function", "removeAllItems"], + ["function", "removeAllItemsWithMagazines"], + ["function", "removeAllMissionEventHandlers"], + ["function", "removeAllMPEventHandlers"], + ["function", "removeAllMusicEventHandlers"], + ["function", "removeAllOwnedMines"], + ["function", "removeAllPrimaryWeaponItems"], + ["function", "removeAllWeapons"], + ["function", "removeBackpack"], + ["function", "removeBackpackGlobal"], + ["function", "removeCuratorAddons"], + ["function", "removeCuratorCameraArea"], + ["function", "removeCuratorEditableObjects"], + ["function", "removeCuratorEditingArea"], + ["function", "removeDrawIcon"], + ["function", "removeDrawLinks"], + ["function", "removeEventHandler"], + ["function", "removeFromRemainsCollector"], + ["function", "removeGoggles"], + ["function", "removeGroupIcon"], + ["function", "removeHandgunItem"], + ["function", "removeHeadgear"], + ["function", "removeItem"], + ["function", "removeItemFromBackpack"], + ["function", "removeItemFromUniform"], + ["function", "removeItemFromVest"], + ["function", "removeItems"], + ["function", "removeMagazine"], + ["function", "removeMagazineGlobal"], + ["function", "removeMagazines"], + ["function", "removeMagazinesTurret"], + ["function", "removeMagazineTurret"], + ["function", "removeMenuItem"], + ["function", "removeMissionEventHandler"], + ["function", "removeMPEventHandler"], + ["function", "removeMusicEventHandler"], + ["function", "removeOwnedMine"], + ["function", "removePrimaryWeaponItem"], + ["function", "removeSecondaryWeaponItem"], + ["function", "removeSimpleTask"], + ["function", "removeSwitchableUnit"], + ["function", "removeTeamMember"], + ["function", "removeUniform"], + ["function", "removeVest"], + ["function", "removeWeapon"], + ["function", "removeWeaponAttachmentCargo"], + ["function", "removeWeaponCargo"], + ["function", "removeWeaponGlobal"], + ["function", "removeWeaponTurret"], + ["function", "reportRemoteTarget"], + ["function", "requiredVersion"], + ["function", "resetCamShake"], + ["function", "resetSubgroupDirection"], + ["function", "resistance"], + ["function", "resize"], + ["function", "resources"], + ["function", "respawnVehicle"], + ["function", "restartEditorCamera"], + ["function", "reveal"], + ["function", "revealMine"], + ["function", "reverse"], + ["function", "reversedMouseY"], + ["function", "roadAt"], + ["function", "roadsConnectedTo"], + ["function", "roleDescription"], + ["function", "ropeAttachedObjects"], + ["function", "ropeAttachedTo"], + ["function", "ropeAttachEnabled"], + ["function", "ropeAttachTo"], + ["function", "ropeCreate"], + ["function", "ropeCut"], + ["function", "ropeDestroy"], + ["function", "ropeDetach"], + ["function", "ropeEndPosition"], + ["function", "ropeLength"], + ["function", "ropes"], + ["function", "ropeUnwind"], + ["function", "ropeUnwound"], + ["function", "rotorsForcesRTD"], + ["function", "rotorsRpmRTD"], + ["function", "round"], + ["function", "runInitScript"], + ["function", "safeZoneH"], + ["function", "safeZoneW"], + ["function", "safeZoneWAbs"], + ["function", "safeZoneX"], + ["function", "safeZoneXAbs"], + ["function", "safeZoneY"], + ["function", "save3DENInventory"], + ["function", "saveGame"], + ["function", "saveIdentity"], + ["function", "saveJoysticks"], + ["function", "saveOverlay"], + ["function", "saveProfileNamespace"], + ["function", "saveStatus"], + ["function", "saveVar"], + ["function", "savingEnabled"], + ["function", "say"], + ["function", "say2D"], + ["function", "say3D"], + ["function", "score"], + ["function", "scoreSide"], + ["function", "screenshot"], + ["function", "screenToWorld"], + ["function", "scriptDone"], + ["function", "scriptName"], + ["function", "scriptNull"], + ["function", "scudState"], + ["function", "secondaryWeapon"], + ["function", "secondaryWeaponItems"], + ["function", "secondaryWeaponMagazine"], + ["function", "select"], + ["function", "selectBestPlaces"], + ["function", "selectDiarySubject"], + ["function", "selectedEditorObjects"], + ["function", "selectEditorObject"], + ["function", "selectionNames"], + ["function", "selectionPosition"], + ["function", "selectLeader"], + ["function", "selectMax"], + ["function", "selectMin"], + ["function", "selectNoPlayer"], + ["function", "selectPlayer"], + ["function", "selectRandom"], + ["function", "selectRandomWeighted"], + ["function", "selectWeapon"], + ["function", "selectWeaponTurret"], + ["function", "sendAUMessage"], + ["function", "sendSimpleCommand"], + ["function", "sendTask"], + ["function", "sendTaskResult"], + ["function", "sendUDPMessage"], + ["function", "serverCommand"], + ["function", "serverCommandAvailable"], + ["function", "serverCommandExecutable"], + ["function", "serverName"], + ["function", "serverTime"], + ["function", "set"], + ["function", "set3DENAttribute"], + ["function", "set3DENAttributes"], + ["function", "set3DENGrid"], + ["function", "set3DENIconsVisible"], + ["function", "set3DENLayer"], + ["function", "set3DENLinesVisible"], + ["function", "set3DENLogicType"], + ["function", "set3DENMissionAttribute"], + ["function", "set3DENMissionAttributes"], + ["function", "set3DENModelsVisible"], + ["function", "set3DENObjectType"], + ["function", "set3DENSelected"], + ["function", "setAccTime"], + ["function", "setActualCollectiveRTD"], + ["function", "setAirplaneThrottle"], + ["function", "setAirportSide"], + ["function", "setAmmo"], + ["function", "setAmmoCargo"], + ["function", "setAmmoOnPylon"], + ["function", "setAnimSpeedCoef"], + ["function", "setAperture"], + ["function", "setApertureNew"], + ["function", "setArmoryPoints"], + ["function", "setAttributes"], + ["function", "setAutonomous"], + ["function", "setBehaviour"], + ["function", "setBleedingRemaining"], + ["function", "setBrakesRTD"], + ["function", "setCameraInterest"], + ["function", "setCamShakeDefParams"], + ["function", "setCamShakeParams"], + ["function", "setCamUseTI"], + ["function", "setCaptive"], + ["function", "setCenterOfMass"], + ["function", "setCollisionLight"], + ["function", "setCombatMode"], + ["function", "setCompassOscillation"], + ["function", "setConvoySeparation"], + ["function", "setCuratorCameraAreaCeiling"], + ["function", "setCuratorCoef"], + ["function", "setCuratorEditingAreaType"], + ["function", "setCuratorWaypointCost"], + ["function", "setCurrentChannel"], + ["function", "setCurrentTask"], + ["function", "setCurrentWaypoint"], + ["function", "setCustomAimCoef"], + ["function", "setCustomWeightRTD"], + ["function", "setDamage"], + ["function", "setDammage"], + ["function", "setDate"], + ["function", "setDebriefingText"], + ["function", "setDefaultCamera"], + ["function", "setDestination"], + ["function", "setDetailMapBlendPars"], + ["function", "setDir"], + ["function", "setDirection"], + ["function", "setDrawIcon"], + ["function", "setDriveOnPath"], + ["function", "setDropInterval"], + ["function", "setDynamicSimulationDistance"], + ["function", "setDynamicSimulationDistanceCoef"], + ["function", "setEditorMode"], + ["function", "setEditorObjectScope"], + ["function", "setEffectCondition"], + ["function", "setEngineRpmRTD"], + ["function", "setFace"], + ["function", "setFaceAnimation"], + ["function", "setFatigue"], + ["function", "setFeatureType"], + ["function", "setFlagAnimationPhase"], + ["function", "setFlagOwner"], + ["function", "setFlagSide"], + ["function", "setFlagTexture"], + ["function", "setFog"], + ["function", "setForceGeneratorRTD"], + ["function", "setFormation"], + ["function", "setFormationTask"], + ["function", "setFormDir"], + ["function", "setFriend"], + ["function", "setFromEditor"], + ["function", "setFSMVariable"], + ["function", "setFuel"], + ["function", "setFuelCargo"], + ["function", "setGroupIcon"], + ["function", "setGroupIconParams"], + ["function", "setGroupIconsSelectable"], + ["function", "setGroupIconsVisible"], + ["function", "setGroupId"], + ["function", "setGroupIdGlobal"], + ["function", "setGroupOwner"], + ["function", "setGusts"], + ["function", "setHideBehind"], + ["function", "setHit"], + ["function", "setHitIndex"], + ["function", "setHitPointDamage"], + ["function", "setHorizonParallaxCoef"], + ["function", "setHUDMovementLevels"], + ["function", "setIdentity"], + ["function", "setImportance"], + ["function", "setInfoPanel"], + ["function", "setLeader"], + ["function", "setLightAmbient"], + ["function", "setLightAttenuation"], + ["function", "setLightBrightness"], + ["function", "setLightColor"], + ["function", "setLightDayLight"], + ["function", "setLightFlareMaxDistance"], + ["function", "setLightFlareSize"], + ["function", "setLightIntensity"], + ["function", "setLightnings"], + ["function", "setLightUseFlare"], + ["function", "setLocalWindParams"], + ["function", "setMagazineTurretAmmo"], + ["function", "setMarkerAlpha"], + ["function", "setMarkerAlphaLocal"], + ["function", "setMarkerBrush"], + ["function", "setMarkerBrushLocal"], + ["function", "setMarkerColor"], + ["function", "setMarkerColorLocal"], + ["function", "setMarkerDir"], + ["function", "setMarkerDirLocal"], + ["function", "setMarkerPos"], + ["function", "setMarkerPosLocal"], + ["function", "setMarkerShape"], + ["function", "setMarkerShapeLocal"], + ["function", "setMarkerSize"], + ["function", "setMarkerSizeLocal"], + ["function", "setMarkerText"], + ["function", "setMarkerTextLocal"], + ["function", "setMarkerType"], + ["function", "setMarkerTypeLocal"], + ["function", "setMass"], + ["function", "setMimic"], + ["function", "setMousePosition"], + ["function", "setMusicEffect"], + ["function", "setMusicEventHandler"], + ["function", "setName"], + ["function", "setNameSound"], + ["function", "setObjectArguments"], + ["function", "setObjectMaterial"], + ["function", "setObjectMaterialGlobal"], + ["function", "setObjectProxy"], + ["function", "setObjectTexture"], + ["function", "setObjectTextureGlobal"], + ["function", "setObjectViewDistance"], + ["function", "setOvercast"], + ["function", "setOwner"], + ["function", "setOxygenRemaining"], + ["function", "setParticleCircle"], + ["function", "setParticleClass"], + ["function", "setParticleFire"], + ["function", "setParticleParams"], + ["function", "setParticleRandom"], + ["function", "setPilotCameraDirection"], + ["function", "setPilotCameraRotation"], + ["function", "setPilotCameraTarget"], + ["function", "setPilotLight"], + ["function", "setPiPEffect"], + ["function", "setPitch"], + ["function", "setPlateNumber"], + ["function", "setPlayable"], + ["function", "setPlayerRespawnTime"], + ["function", "setPos"], + ["function", "setPosASL"], + ["function", "setPosASL2"], + ["function", "setPosASLW"], + ["function", "setPosATL"], + ["function", "setPosition"], + ["function", "setPosWorld"], + ["function", "setPylonLoadOut"], + ["function", "setPylonsPriority"], + ["function", "setRadioMsg"], + ["function", "setRain"], + ["function", "setRainbow"], + ["function", "setRandomLip"], + ["function", "setRank"], + ["function", "setRectangular"], + ["function", "setRepairCargo"], + ["function", "setRotorBrakeRTD"], + ["function", "setShadowDistance"], + ["function", "setShotParents"], + ["function", "setSide"], + ["function", "setSimpleTaskAlwaysVisible"], + ["function", "setSimpleTaskCustomData"], + ["function", "setSimpleTaskDescription"], + ["function", "setSimpleTaskDestination"], + ["function", "setSimpleTaskTarget"], + ["function", "setSimpleTaskType"], + ["function", "setSimulWeatherLayers"], + ["function", "setSize"], + ["function", "setSkill"], + ["function", "setSlingLoad"], + ["function", "setSoundEffect"], + ["function", "setSpeaker"], + ["function", "setSpeech"], + ["function", "setSpeedMode"], + ["function", "setStamina"], + ["function", "setStaminaScheme"], + ["function", "setStatValue"], + ["function", "setSuppression"], + ["function", "setSystemOfUnits"], + ["function", "setTargetAge"], + ["function", "setTaskMarkerOffset"], + ["function", "setTaskResult"], + ["function", "setTaskState"], + ["function", "setTerrainGrid"], + ["function", "setText"], + ["function", "setTimeMultiplier"], + ["function", "setTitleEffect"], + ["function", "setToneMapping"], + ["function", "setToneMappingParams"], + ["function", "setTrafficDensity"], + ["function", "setTrafficDistance"], + ["function", "setTrafficGap"], + ["function", "setTrafficSpeed"], + ["function", "setTriggerActivation"], + ["function", "setTriggerArea"], + ["function", "setTriggerStatements"], + ["function", "setTriggerText"], + ["function", "setTriggerTimeout"], + ["function", "setTriggerType"], + ["function", "setType"], + ["function", "setUnconscious"], + ["function", "setUnitAbility"], + ["function", "setUnitLoadout"], + ["function", "setUnitPos"], + ["function", "setUnitPosWeak"], + ["function", "setUnitRank"], + ["function", "setUnitRecoilCoefficient"], + ["function", "setUnitTrait"], + ["function", "setUnloadInCombat"], + ["function", "setUserActionText"], + ["function", "setUserMFDText"], + ["function", "setUserMFDValue"], + ["function", "setVariable"], + ["function", "setVectorDir"], + ["function", "setVectorDirAndUp"], + ["function", "setVectorUp"], + ["function", "setVehicleAmmo"], + ["function", "setVehicleAmmoDef"], + ["function", "setVehicleArmor"], + ["function", "setVehicleCargo"], + ["function", "setVehicleId"], + ["function", "setVehicleInit"], + ["function", "setVehicleLock"], + ["function", "setVehiclePosition"], + ["function", "setVehicleRadar"], + ["function", "setVehicleReceiveRemoteTargets"], + ["function", "setVehicleReportOwnPosition"], + ["function", "setVehicleReportRemoteTargets"], + ["function", "setVehicleTIPars"], + ["function", "setVehicleVarName"], + ["function", "setVelocity"], + ["function", "setVelocityModelSpace"], + ["function", "setVelocityTransformation"], + ["function", "setViewDistance"], + ["function", "setVisibleIfTreeCollapsed"], + ["function", "setWantedRpmRTD"], + ["function", "setWaves"], + ["function", "setWaypointBehaviour"], + ["function", "setWaypointCombatMode"], + ["function", "setWaypointCompletionRadius"], + ["function", "setWaypointDescription"], + ["function", "setWaypointForceBehaviour"], + ["function", "setWaypointFormation"], + ["function", "setWaypointHousePosition"], + ["function", "setWaypointLoiterRadius"], + ["function", "setWaypointLoiterType"], + ["function", "setWaypointName"], + ["function", "setWaypointPosition"], + ["function", "setWaypointScript"], + ["function", "setWaypointSpeed"], + ["function", "setWaypointStatements"], + ["function", "setWaypointTimeout"], + ["function", "setWaypointType"], + ["function", "setWaypointVisible"], + ["function", "setWeaponReloadingTime"], + ["function", "setWind"], + ["function", "setWindDir"], + ["function", "setWindForce"], + ["function", "setWindStr"], + ["function", "setWingForceScaleRTD"], + ["function", "setWPPos"], + ["function", "show3DIcons"], + ["function", "showChat"], + ["function", "showCinemaBorder"], + ["function", "showCommandingMenu"], + ["function", "showCompass"], + ["function", "showCuratorCompass"], + ["function", "showGPS"], + ["function", "showHUD"], + ["function", "showLegend"], + ["function", "showMap"], + ["function", "shownArtilleryComputer"], + ["function", "shownChat"], + ["function", "shownCompass"], + ["function", "shownCuratorCompass"], + ["function", "showNewEditorObject"], + ["function", "shownGPS"], + ["function", "shownHUD"], + ["function", "shownMap"], + ["function", "shownPad"], + ["function", "shownRadio"], + ["function", "shownScoretable"], + ["function", "shownUAVFeed"], + ["function", "shownWarrant"], + ["function", "shownWatch"], + ["function", "showPad"], + ["function", "showRadio"], + ["function", "showScoretable"], + ["function", "showSubtitles"], + ["function", "showUAVFeed"], + ["function", "showWarrant"], + ["function", "showWatch"], + ["function", "showWaypoint"], + ["function", "showWaypoints"], + ["function", "side"], + ["function", "sideAmbientLife"], + ["function", "sideChat"], + ["function", "sideEmpty"], + ["function", "sideEnemy"], + ["function", "sideFriendly"], + ["function", "sideLogic"], + ["function", "sideRadio"], + ["function", "sideUnknown"], + ["function", "simpleTasks"], + ["function", "simulationEnabled"], + ["function", "simulCloudDensity"], + ["function", "simulCloudOcclusion"], + ["function", "simulInClouds"], + ["function", "simulWeatherSync"], + ["function", "sin"], + ["function", "size"], + ["function", "sizeOf"], + ["function", "skill"], + ["function", "skillFinal"], + ["function", "skipTime"], + ["function", "sleep"], + ["function", "sliderPosition"], + ["function", "sliderRange"], + ["function", "sliderSetPosition"], + ["function", "sliderSetRange"], + ["function", "sliderSetSpeed"], + ["function", "sliderSpeed"], + ["function", "slingLoadAssistantShown"], + ["function", "soldierMagazines"], + ["function", "someAmmo"], + ["function", "sort"], + ["function", "soundVolume"], + ["function", "speaker"], + ["function", "speed"], + ["function", "speedMode"], + ["function", "splitString"], + ["function", "sqrt"], + ["function", "squadParams"], + ["function", "stance"], + ["function", "startLoadingScreen"], + ["function", "stop"], + ["function", "stopEngineRTD"], + ["function", "stopped"], + ["function", "str"], + ["function", "sunOrMoon"], + ["function", "supportInfo"], + ["function", "suppressFor"], + ["function", "surfaceIsWater"], + ["function", "surfaceNormal"], + ["function", "surfaceType"], + ["function", "swimInDepth"], + ["function", "switchableUnits"], + ["function", "switchAction"], + ["function", "switchCamera"], + ["function", "switchGesture"], + ["function", "switchLight"], + ["function", "switchMove"], + ["function", "synchronizedObjects"], + ["function", "synchronizedTriggers"], + ["function", "synchronizedWaypoints"], + ["function", "synchronizeObjectsAdd"], + ["function", "synchronizeObjectsRemove"], + ["function", "synchronizeTrigger"], + ["function", "synchronizeWaypoint"], + ["function", "systemChat"], + ["function", "systemOfUnits"], + ["function", "tan"], + ["function", "targetKnowledge"], + ["function", "targets"], + ["function", "targetsAggregate"], + ["function", "targetsQuery"], + ["function", "taskAlwaysVisible"], + ["function", "taskChildren"], + ["function", "taskCompleted"], + ["function", "taskCustomData"], + ["function", "taskDescription"], + ["function", "taskDestination"], + ["function", "taskHint"], + ["function", "taskMarkerOffset"], + ["function", "taskNull"], + ["function", "taskParent"], + ["function", "taskResult"], + ["function", "taskState"], + ["function", "taskType"], + ["function", "teamMember"], + ["function", "teamMemberNull"], + ["function", "teamName"], + ["function", "teams"], + ["function", "teamSwitch"], + ["function", "teamSwitchEnabled"], + ["function", "teamType"], + ["function", "terminate"], + ["function", "terrainIntersect"], + ["function", "terrainIntersectASL"], + ["function", "terrainIntersectAtASL"], + ["function", "text"], + ["function", "textLog"], + ["function", "textLogFormat"], + ["function", "tg"], + ["function", "time"], + ["function", "timeMultiplier"], + ["function", "titleCut"], + ["function", "titleFadeOut"], + ["function", "titleObj"], + ["function", "titleRsc"], + ["function", "titleText"], + ["function", "toArray"], + ["function", "toFixed"], + ["function", "toLower"], + ["function", "toString"], + ["function", "toUpper"], + ["function", "triggerActivated"], + ["function", "triggerActivation"], + ["function", "triggerArea"], + ["function", "triggerAttachedVehicle"], + ["function", "triggerAttachObject"], + ["function", "triggerAttachVehicle"], + ["function", "triggerDynamicSimulation"], + ["function", "triggerStatements"], + ["function", "triggerText"], + ["function", "triggerTimeout"], + ["function", "triggerTimeoutCurrent"], + ["function", "triggerType"], + ["function", "turretLocal"], + ["function", "turretOwner"], + ["function", "turretUnit"], + ["function", "tvAdd"], + ["function", "tvClear"], + ["function", "tvCollapse"], + ["function", "tvCollapseAll"], + ["function", "tvCount"], + ["function", "tvCurSel"], + ["function", "tvData"], + ["function", "tvDelete"], + ["function", "tvExpand"], + ["function", "tvExpandAll"], + ["function", "tvPicture"], + ["function", "tvPictureRight"], + ["function", "tvSetColor"], + ["function", "tvSetCurSel"], + ["function", "tvSetData"], + ["function", "tvSetPicture"], + ["function", "tvSetPictureColor"], + ["function", "tvSetPictureColorDisabled"], + ["function", "tvSetPictureColorSelected"], + ["function", "tvSetPictureRight"], + ["function", "tvSetPictureRightColor"], + ["function", "tvSetPictureRightColorDisabled"], + ["function", "tvSetPictureRightColorSelected"], + ["function", "tvSetSelectColor"], + ["function", "tvSetText"], + ["function", "tvSetTooltip"], + ["function", "tvSetValue"], + ["function", "tvSort"], + ["function", "tvSortByValue"], + ["function", "tvText"], + ["function", "tvTooltip"], + ["function", "tvValue"], + ["function", "type"], + ["function", "typeName"], + ["function", "typeOf"], + ["function", "UAVControl"], + ["function", "uiNamespace"], + ["function", "uiSleep"], + ["function", "unassignCurator"], + ["function", "unassignItem"], + ["function", "unassignTeam"], + ["function", "unassignVehicle"], + ["function", "underwater"], + ["function", "uniform"], + ["function", "uniformContainer"], + ["function", "uniformItems"], + ["function", "uniformMagazines"], + ["function", "unitAddons"], + ["function", "unitAimPosition"], + ["function", "unitAimPositionVisual"], + ["function", "unitBackpack"], + ["function", "unitIsUAV"], + ["function", "unitPos"], + ["function", "unitReady"], + ["function", "unitRecoilCoefficient"], + ["function", "units"], + ["function", "unitsBelowHeight"], + ["function", "unlinkItem"], + ["function", "unlockAchievement"], + ["function", "unregisterTask"], + ["function", "updateDrawIcon"], + ["function", "updateMenuItem"], + ["function", "updateObjectTree"], + ["function", "useAIOperMapObstructionTest"], + ["function", "useAISteeringComponent"], + ["function", "useAudioTimeForMoves"], + ["function", "userInputDisabled"], + ["function", "vectorAdd"], + ["function", "vectorCos"], + ["function", "vectorCrossProduct"], + ["function", "vectorDiff"], + ["function", "vectorDir"], + ["function", "vectorDirVisual"], + ["function", "vectorDistance"], + ["function", "vectorDistanceSqr"], + ["function", "vectorDotProduct"], + ["function", "vectorFromTo"], + ["function", "vectorMagnitude"], + ["function", "vectorMagnitudeSqr"], + ["function", "vectorModelToWorld"], + ["function", "vectorModelToWorldVisual"], + ["function", "vectorMultiply"], + ["function", "vectorNormalized"], + ["function", "vectorUp"], + ["function", "vectorUpVisual"], + ["function", "vectorWorldToModel"], + ["function", "vectorWorldToModelVisual"], + ["function", "vehicle"], + ["function", "vehicleCargoEnabled"], + ["function", "vehicleChat"], + ["function", "vehicleRadio"], + ["function", "vehicleReceiveRemoteTargets"], + ["function", "vehicleReportOwnPosition"], + ["function", "vehicleReportRemoteTargets"], + ["function", "vehicles"], + ["function", "vehicleVarName"], + ["function", "velocity"], + ["function", "velocityModelSpace"], + ["function", "verifySignature"], + ["function", "vest"], + ["function", "vestContainer"], + ["function", "vestItems"], + ["function", "vestMagazines"], + ["function", "viewDistance"], + ["function", "visibleCompass"], + ["function", "visibleGPS"], + ["function", "visibleMap"], + ["function", "visiblePosition"], + ["function", "visiblePositionASL"], + ["function", "visibleScoretable"], + ["function", "visibleWatch"], + ["function", "waitUntil"], + ["function", "waves"], + ["function", "waypointAttachedObject"], + ["function", "waypointAttachedVehicle"], + ["function", "waypointAttachObject"], + ["function", "waypointAttachVehicle"], + ["function", "waypointBehaviour"], + ["function", "waypointCombatMode"], + ["function", "waypointCompletionRadius"], + ["function", "waypointDescription"], + ["function", "waypointForceBehaviour"], + ["function", "waypointFormation"], + ["function", "waypointHousePosition"], + ["function", "waypointLoiterRadius"], + ["function", "waypointLoiterType"], + ["function", "waypointName"], + ["function", "waypointPosition"], + ["function", "waypoints"], + ["function", "waypointScript"], + ["function", "waypointsEnabledUAV"], + ["function", "waypointShow"], + ["function", "waypointSpeed"], + ["function", "waypointStatements"], + ["function", "waypointTimeout"], + ["function", "waypointTimeoutCurrent"], + ["function", "waypointType"], + ["function", "waypointVisible"], + ["function", "weaponAccessories"], + ["function", "weaponAccessoriesCargo"], + ["function", "weaponCargo"], + ["function", "weaponDirection"], + ["function", "weaponInertia"], + ["function", "weaponLowered"], + ["function", "weapons"], + ["function", "weaponsItems"], + ["function", "weaponsItemsCargo"], + ["function", "weaponState"], + ["function", "weaponsTurret"], + ["function", "weightRTD"], + ["function", "west"], + ["function", "WFSideText"], + ["function", "wind"], + ["function", "windDir"], + ["function", "windRTD"], + ["function", "windStr"], + ["function", "wingsForcesRTD"], + ["function", "worldName"], + ["function", "worldSize"], + ["function", "worldToModel"], + ["function", "worldToModelVisual"], + ["function", "worldToScreen"] +] diff --git a/tests/languages/sql+sas/sql_inclusion.test b/tests/languages/sql+sas/sql_inclusion.test index 4b4bd553c1..4aca904d09 100644 --- a/tests/languages/sql+sas/sql_inclusion.test +++ b/tests/languages/sql+sas/sql_inclusion.test @@ -38,193 +38,234 @@ proc sql; select * form proclib.jobs(pw=red); title +proc sql; + connect to oracle as ora2 (user=user-id password=password); + select * from connection to ora2 (select lname, fname, state from staff); + disconnect from ora2; +quit; + ---------------------------------------------------- [ ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "select"], - ["operator", "*"], - ["keyword", "from"], - " proclib", - ["punctuation", "."], - "paylist", - ["punctuation", ";"] - ] - ] - ] - ], + ["proc-sql", [ + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + + ["keyword", "from"], + " proclib", + ["punctuation", "."], + "paylist", + ["punctuation", ";"] + ]] + ]], ["step", "proc print"], ["punctuation", ";"], + ["step", "proc sql"], - ["proc-args", - [ - ["arg", "outobs"], - ["operator", "="], - ["number", "10"], - ["punctuation", ";"] - ] - ], - ["proc-sql", - [ - ["global-statements", "title"], - ["string", "'Proclib.Payroll'"], - ["punctuation", ";"], - ["sql", - [ - ["keyword", "select"], - ["operator", "*"], - ["keyword", "from"], - " proclib", - ["punctuation", "."], - "payroll", - ["punctuation", ";"] - ] - ], - ["global-statements", "title"], + ["proc-args", [ + ["arg", "outobs"], + ["operator", "="], + ["number", "10"], + ["punctuation", ";"] + ]], + ["proc-sql", [ + ["global-statements", "title"], + ["string", "'Proclib.Payroll'"], + ["punctuation", ";"], + + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + ["keyword", "from"], + " proclib", + ["punctuation", "."], + "payroll", ["punctuation", ";"] - ] - ], + ]], + + ["global-statements", "title"], + ["punctuation", ";"] + ]], ["step", "quit"], ["punctuation", ";"], + ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "select"], - " BookingDate", - ["punctuation", ","], - "\r\n\tReleaseDate", - ["punctuation", ","], - "\r\n\tReleaseCode\r\n\t", - ["keyword", "from"], - " SASclass", - ["punctuation", "."], - "Bookings", - ["punctuation", ";"] - ] - ] - ] - ], + ["proc-sql", [ + ["sql", [ + ["keyword", "select"], + " BookingDate", + ["punctuation", ","], + + "\r\n\tReleaseDate", + ["punctuation", ","], + + "\r\n\tReleaseCode\r\n\t", + + ["keyword", "from"], + " SASclass", + ["punctuation", "."], + "Bookings", + ["punctuation", ";"] + ]] + ]], ["step", "quit"], ["punctuation", ";"], + ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "select"], - " BookingDate", - ["punctuation", ","], - "\r\n\tReleaseDate", - ["punctuation", ","], - "\r\n\tReleaseCode\r\n\t", - ["keyword", "from"], - " SASclass", - ["punctuation", "."], - "Bookings", - ["punctuation", ";"] - ] - ] - ] - ], + ["proc-sql", [ + ["sql", [ + ["keyword", "select"], + " BookingDate", + ["punctuation", ","], + + "\r\n\tReleaseDate", + ["punctuation", ","], + + "\r\n\tReleaseCode\r\n\t", + + ["keyword", "from"], + " SASclass", + ["punctuation", "."], + "Bookings", + ["punctuation", ";"] + ]] + ]], ["step", "quit"], ["punctuation", ";"], + ["keyword", "libname"], " proclib ", ["string", "'SAS-library'"], ["punctuation", ";"], + + ["step", "proc sql"], + ["punctuation", ";"], + ["proc-sql", [ + ["sql", [ + ["keyword", "create"], + ["keyword", "view"], + " proclib", + ["punctuation", "."], + "jobs", + ["punctuation", "("], + "pw", + ["operator", "-"], + "red", + ["punctuation", ")"], + ["keyword", "as"], + + ["keyword", "select"], + " Jobcode", + ["punctuation", ","], + + ["function", "count"], + ["punctuation", "("], + "jobcode", + ["punctuation", ")"], + ["keyword", "as"], + " number label", + ["operator", "="], + ["string", "'Number'"], + ["punctuation", ","], + + ["function", "avg"], + ["punctuation", "("], + ["keyword", "int"], + ["punctuation", "("], + "today", + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "-"], + "birth", + ["operator", "/"], + ["number", "365.25"], + ["punctuation", ")"], + ["punctuation", ")"], + ["keyword", "as"], + " avgage\r\n\t\t\tformat", + ["operator", "="], + ["number", "2."], + " label", + ["operator", "="], + ["string", "'Average Salary'"], + + ["keyword", "from"], + " Payroll\r\n\t", + + ["keyword", "group"], + ["keyword", "by"], + " Jobcode\r\n\t", + + ["keyword", "having"], + " avage ge ", + ["number", "30"], + ["punctuation", ";"] + ]], + + ["global-statements", "title1"], + ["string", "'Current Summary Information for Each Job category'"], + ["punctuation", ";"], + + ["global-statements", "title2"], + ["string", "'Average Age Greater Than or Equal to 30'"], + ["punctuation", ";"], + + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + " form proclib", + ["punctuation", "."], + "jobs", + ["punctuation", "("], + "pw", + ["operator", "="], + "red", + ["punctuation", ")"], + ["punctuation", ";"] + ]], + + ["global-statements", "title"] + ]], ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "create"], - ["keyword", "view"], - " proclib", - ["punctuation", "."], - "jobs", - ["punctuation", "("], - "pw", - ["operator", "-"], - "red", - ["punctuation", ")"], - ["keyword", "as"], - ["keyword", "select"], - " Jobcode", - ["punctuation", ","], - ["function", "count"], - ["punctuation", "("], - "jobcode", - ["punctuation", ")"], - ["keyword", "as"], - " number label", - ["operator", "="], - ["string", "'Number'"], - ["punctuation", ","], - ["function", "avg"], - ["punctuation", "("], - ["keyword", "int"], - ["punctuation", "("], - "today", - ["punctuation", "("], - ["punctuation", ")"], - ["operator", "-"], - "birth", - ["operator", "/"], - ["number", "365.25"], - ["punctuation", ")"], - ["punctuation", ")"], - ["keyword", "as"], - " avgage\r\n\t\t\tformat", - ["operator", "="], - ["number", "2."], - " label", - ["operator", "="], - ["string", "'Average Salary'"], - ["keyword", "from"], - " Payroll\r\n\t", - ["keyword", "group"], - ["keyword", "by"], - " Jobcode\r\n\t", - ["keyword", "having"], - " avage ge ", - ["number", "30"], - ["punctuation", ";"] - ] - ], - ["global-statements", "title1"], - ["string", "'Current Summary Information for Each Job category'"], - ["punctuation", ";"], - ["global-statements", "title2"], - ["string", "'Average Age Greater Than or Equal to 30'"], - ["punctuation", ";"], - ["sql", - [ - ["keyword", "select"], - ["operator", "*"], - " form proclib", - ["punctuation", "."], - "jobs", - ["punctuation", "("], - "pw", - ["operator", "="], - "red", - ["punctuation", ")"], - ["punctuation", ";"] - ] - ], - ["global-statements", "title"] - ] - ] + ["proc-sql", [ + "\r\n\tconnect to oracle as ora2 ", + ["punctuation", "("], + "user=user-id password=password", + ["punctuation", ")"], + ["punctuation", ";"], + + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + ["keyword", "from"], + " connection ", + ["keyword", "to"], + " ora2 ", + ["punctuation", "("], + ["keyword", "select"], + " lname", + ["punctuation", ","], + " fname", + ["punctuation", ","], + " state ", + ["keyword", "from"], + " staff", + ["punctuation", ")"], + ["punctuation", ";"] + ]], + + ["sql-statements", "disconnect from"], + " ora2", + ["punctuation", ";"] + ]], + ["step", "quit"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/sql/identifier_feature.test b/tests/languages/sql/identifier_feature.test new file mode 100644 index 0000000000..c79145772b --- /dev/null +++ b/tests/languages/sql/identifier_feature.test @@ -0,0 +1,41 @@ +`5Customers` +`tableName~` +` SELECT ` +foo.`GROUP` +`a``b` + +---------------------------------------------------- + +[ + ["identifier", [ + ["punctuation", "`"], + "5Customers", + ["punctuation", "`"] + ]], + + ["identifier", [ + ["punctuation", "`"], + "tableName~", + ["punctuation", "`"] + ]], + + ["identifier", [ + ["punctuation", "`"], + " SELECT ", + ["punctuation", "`"] + ]], + + "\r\nfoo", + ["punctuation", "."], + ["identifier", [ + ["punctuation", "`"], + "GROUP", + ["punctuation", "`"] + ]], + + ["identifier", [ + ["punctuation", "`"], + "a``b", + ["punctuation", "`"] + ]] +] diff --git a/tests/languages/sql/issue3140.test b/tests/languages/sql/issue3140.test new file mode 100644 index 0000000000..0f969c7a67 --- /dev/null +++ b/tests/languages/sql/issue3140.test @@ -0,0 +1,72 @@ +select + `t`.`col1`, `t`.`col2`, `t`.`col3`, `t`.`col4` +from + `test_table` as `t` + +---------------------------------------------------- + +[ + ["keyword", "select"], + + ["identifier", [ + ["punctuation", "`"], + "t", + ["punctuation", "`"] + ]], + ["punctuation", "."], + ["identifier", [ + ["punctuation", "`"], + "col1", + ["punctuation", "`"] + ]], + ["punctuation", ","], + ["identifier", [ + ["punctuation", "`"], + "t", + ["punctuation", "`"] + ]], + ["punctuation", "."], + ["identifier", [ + ["punctuation", "`"], + "col2", + ["punctuation", "`"] + ]], + ["punctuation", ","], + ["identifier", [ + ["punctuation", "`"], + "t", + ["punctuation", "`"] + ]], + ["punctuation", "."], + ["identifier", [ + ["punctuation", "`"], + "col3", + ["punctuation", "`"] + ]], + ["punctuation", ","], + ["identifier", [ + ["punctuation", "`"], + "t", + ["punctuation", "`"] + ]], + ["punctuation", "."], + ["identifier", [ + ["punctuation", "`"], + "col4", + ["punctuation", "`"] + ]], + + ["keyword", "from"], + + ["identifier", [ + ["punctuation", "`"], + "test_table", + ["punctuation", "`"] + ]], + ["keyword", "as"], + ["identifier", [ + ["punctuation", "`"], + "t", + ["punctuation", "`"] + ]] +] diff --git a/tests/languages/sql/operator_feature.test b/tests/languages/sql/operator_feature.test index ec5be04a3c..45510115a4 100644 --- a/tests/languages/sql/operator_feature.test +++ b/tests/languages/sql/operator_feature.test @@ -9,6 +9,7 @@ AND BETWEEN IN +ILIKE LIKE NOT OR @@ -33,6 +34,7 @@ XOR ["operator", "AND"], ["operator", "BETWEEN"], ["operator", "IN"], + ["operator", "ILIKE"], ["operator", "LIKE"], ["operator", "NOT"], ["operator", "OR"], diff --git a/tests/languages/squirrel/attribute_feature.test b/tests/languages/squirrel/attribute_feature.test new file mode 100644 index 0000000000..5d4c4dda39 --- /dev/null +++ b/tests/languages/squirrel/attribute_feature.test @@ -0,0 +1,93 @@ +class Foo { + //attributes of PrintTesty + function PrintTesty() + { + foreach(i,val in testy) + { + ::print("idx = "+i+" = "+val+" \n"); + } + } + //attributes of testy + testy = null; +} + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", ["Foo"]], + ["attribute-punctuation", ""], + ["punctuation", "{"], + + ["attribute-punctuation", ""], + ["comment", "//attributes of PrintTesty"], + + ["keyword", "function"], + ["function", "PrintTesty"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", "{"], + + ["keyword", "foreach"], + ["punctuation", "("], + "i", + ["punctuation", ","], + "val ", + ["keyword", "in"], + " testy", + ["punctuation", ")"], + + ["punctuation", "{"], + + ["operator", "::"], + ["function", "print"], + ["punctuation", "("], + ["string", "\"idx = \""], + ["operator", "+"], + "i", + ["operator", "+"], + ["string", "\" = \""], + ["operator", "+"], + "val", + ["operator", "+"], + ["string", "\" \\n\""], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["attribute-punctuation", ""], + ["comment", "//attributes of testy"], + + "\r\n testy ", + ["operator", "="], + ["keyword", "null"], + ["punctuation", ";"], + + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/boolean_feature.test b/tests/languages/squirrel/boolean_feature.test new file mode 100644 index 0000000000..ad3882b9ef --- /dev/null +++ b/tests/languages/squirrel/boolean_feature.test @@ -0,0 +1,9 @@ +false +true + +---------------------------------------------------- + +[ + ["boolean", "false"], + ["boolean", "true"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/char_feature.test b/tests/languages/squirrel/char_feature.test new file mode 100644 index 0000000000..2c05d2796e --- /dev/null +++ b/tests/languages/squirrel/char_feature.test @@ -0,0 +1,11 @@ +'w' +'\'' +'\x41' '\u0041' '\U00000041' + +---------------------------------------------------- + +[ + ["char", "'w'"], + ["char", "'\\''"], + ["char", "'\\x41'"], ["char", "'\\u0041'"], ["char", "'\\U00000041'"] +] diff --git a/tests/languages/squirrel/class-name_feature.test b/tests/languages/squirrel/class-name_feature.test new file mode 100644 index 0000000000..091dd06760 --- /dev/null +++ b/tests/languages/squirrel/class-name_feature.test @@ -0,0 +1,45 @@ +class Foo {} +class FakeNamespace.Utils.SuperClass {} +class SuperFoo extends Foo {} +log(b instanceof Kid); +enum Stuff {} + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", ["Foo"]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", [ + "FakeNamespace", + ["punctuation", "."], + "Utils", + ["punctuation", "."], + "SuperClass" + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", ["SuperFoo"]], + ["keyword", "extends"], + ["class-name", ["Foo"]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["function", "log"], + ["punctuation", "("], + "b ", + ["keyword", "instanceof"], + ["class-name", ["Kid"]], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "enum"], + ["class-name", ["Stuff"]], + ["punctuation", "{"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/comment_feature.test b/tests/languages/squirrel/comment_feature.test new file mode 100644 index 0000000000..e782b73f87 --- /dev/null +++ b/tests/languages/squirrel/comment_feature.test @@ -0,0 +1,15 @@ +/* +this is +a multiline comment. +this lines will be ignored by the compiler +*/ +//this is a single line comment. this line will be ignored by the compiler +# this is also a single line comment. + +---------------------------------------------------- + +[ + ["comment", "/*\r\nthis is\r\na multiline comment.\r\nthis lines will be ignored by the compiler\r\n*/"], + ["comment", "//this is a single line comment. this line will be ignored by the compiler"], + ["comment", "# this is also a single line comment."] +] \ No newline at end of file diff --git a/tests/languages/squirrel/function_feature.test b/tests/languages/squirrel/function_feature.test new file mode 100644 index 0000000000..df6c22882e --- /dev/null +++ b/tests/languages/squirrel/function_feature.test @@ -0,0 +1,44 @@ +function abc(a,b,c) {} +function(a,b,c) {} +local myexp = @(a,b) a + b; + +---------------------------------------------------- + +[ + ["keyword", "function"], + ["function", "abc"], + ["punctuation", "("], + "a", + ["punctuation", ","], + "b", + ["punctuation", ","], + "c", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "function"], + ["punctuation", "("], + "a", + ["punctuation", ","], + "b", + ["punctuation", ","], + "c", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "local"], + " myexp ", + ["operator", "="], + ["lambda", "@"], + ["punctuation", "("], + "a", + ["punctuation", ","], + "b", + ["punctuation", ")"], + " a ", + ["operator", "+"], + " b", + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/keyword_feature.test b/tests/languages/squirrel/keyword_feature.test new file mode 100644 index 0000000000..e68623e9ea --- /dev/null +++ b/tests/languages/squirrel/keyword_feature.test @@ -0,0 +1,75 @@ +base; +break; +case; +catch; +class; +clone; +const; +constructor; +continue; +default; +delete; +else; +enum; +extends; +for; +foreach; +function; +if; +in; +instanceof; +local; +null; +resume; +return; +static; +switch; +this; +throw; +try; +typeof; +while; +yield; + +__LINE__ +__FILE__ + +---------------------------------------------------- + +[ + ["keyword", "base"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "case"], ["punctuation", ";"], + ["keyword", "catch"], ["punctuation", ";"], + ["keyword", "class"], ["punctuation", ";"], + ["keyword", "clone"], ["punctuation", ";"], + ["keyword", "const"], ["punctuation", ";"], + ["keyword", "constructor"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "default"], ["punctuation", ";"], + ["keyword", "delete"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "extends"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "foreach"], ["punctuation", ";"], + ["keyword", "function"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "instanceof"], ["punctuation", ";"], + ["keyword", "local"], ["punctuation", ";"], + ["keyword", "null"], ["punctuation", ";"], + ["keyword", "resume"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "switch"], ["punctuation", ";"], + ["keyword", "this"], ["punctuation", ";"], + ["keyword", "throw"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "typeof"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["keyword", "yield"], ["punctuation", ";"], + + ["keyword", "__LINE__"], + ["keyword", "__FILE__"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/number_feature.test b/tests/languages/squirrel/number_feature.test new file mode 100644 index 0000000000..7faa2ad06e --- /dev/null +++ b/tests/languages/squirrel/number_feature.test @@ -0,0 +1,21 @@ +0 +34 +0xFF00A120 +0753 +1.52 +0.234 +1.e2 +1.e-2 + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "34"], + ["number", "0xFF00A120"], + ["number", "0753"], + ["number", "1.52"], + ["number", "0.234"], + ["number", "1.e2"], + ["number", "1.e-2"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/operator_feature.test b/tests/languages/squirrel/operator_feature.test new file mode 100644 index 0000000000..98efe19e9a --- /dev/null +++ b/tests/languages/squirrel/operator_feature.test @@ -0,0 +1,46 @@ +! != || == && >= <= > <=> + ++ - / * % ++= -= /= *= %= +++ -- + +<- = +& ^ | ~ +>> << >>> + +: :: + +---------------------------------------------------- + +[ + ["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", "::"] +] \ No newline at end of file diff --git a/tests/languages/squirrel/punctuation_feature.test b/tests/languages/squirrel/punctuation_feature.test new file mode 100644 index 0000000000..6d0eb671c7 --- /dev/null +++ b/tests/languages/squirrel/punctuation_feature.test @@ -0,0 +1,17 @@ +{ } [ ] ( ) +, ; . + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."] +] \ No newline at end of file diff --git a/tests/languages/squirrel/string_feature.test b/tests/languages/squirrel/string_feature.test new file mode 100644 index 0000000000..0df8c4438b --- /dev/null +++ b/tests/languages/squirrel/string_feature.test @@ -0,0 +1,29 @@ +"" +"I'm a string" +"I'm a wonderful string\n" + +@"" +@"I'm a verbatim string" +@" I'm a +multiline verbatim string +" + +@" + this is a multiline string + it will ""embed"" all the new line + characters +" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"I'm a string\""], + ["string", "\"I'm a wonderful string\\n\""], + + ["string", "@\"\""], + ["string", "@\"I'm a verbatim string\""], + ["string", "@\" I'm a\r\nmultiline verbatim string\r\n\""], + + ["string", "@\"\r\n this is a multiline string\r\n it will \"\"embed\"\" all the new line\r\n characters\r\n\""] +] diff --git a/tests/languages/stan/comment_feature.test b/tests/languages/stan/comment_feature.test new file mode 100644 index 0000000000..5f7066e197 --- /dev/null +++ b/tests/languages/stan/comment_feature.test @@ -0,0 +1,17 @@ +# comment +// comment +/* +comment +*/ + +---------------------------------------------------- + +[ + ["comment", "# comment"], + ["comment", "// comment"], + ["comment", "/*\r\ncomment\r\n*/"] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/stan/constraint_feature.test b/tests/languages/stan/constraint_feature.test new file mode 100644 index 0000000000..7d75b436a3 --- /dev/null +++ b/tests/languages/stan/constraint_feature.test @@ -0,0 +1,176 @@ +real b; + +real theta; + +int T; + +matrix[3, 4] B; + +row_vector[10] u; + +row_vector[3] u; + +real phi; + +real x; + +---------------------------------------------------- + +[ + ["keyword", "real"], + ["constraint", [ + ["punctuation", "<"], + ["property", "lower"], + ["operator", "="], + ["expression", [ + "a" + ]], + ["punctuation", ">"] + ]], + " b", + ["punctuation", ";"], + + ["keyword", "real"], + ["constraint", [ + ["punctuation", "<"], + ["property", "lower"], + ["operator", "="], + ["expression", [ + "a" + ]], + ["punctuation", ","], + ["property", "upper"], + ["operator", "="], + ["expression", [ + "b" + ]], + ["punctuation", ">"] + ]], + " theta", + ["punctuation", ";"], + + ["keyword", "int"], + ["constraint", [ + ["punctuation", "<"], + ["property", "lower"], + ["operator", "="], + ["expression", [ + ["number", "1"] + ]], + ["punctuation", ">"] + ]], + " T", + ["punctuation", ";"], + + ["keyword", "matrix"], + ["constraint", [ + ["punctuation", "<"], + ["property", "multiplier"], + ["operator", "="], + ["expression", [ + ["number", "5"] + ]], + ["punctuation", ">"] + ]], + ["punctuation", "["], + ["number", "3"], + ["punctuation", ","], + ["number", "4"], + ["punctuation", "]"], + " B", + ["punctuation", ";"], + + ["keyword", "row_vector"], + ["constraint", [ + ["punctuation", "<"], + ["property", "lower"], + ["operator", "="], + ["expression", [ + ["operator", "-"], + ["number", "1"] + ]], + ["punctuation", ","], + ["property", "upper"], + ["operator", "="], + ["expression", [ + ["number", "1"] + ]], + ["punctuation", ">"] + ]], + ["punctuation", "["], + ["number", "10"], + ["punctuation", "]"], + " u", + ["punctuation", ";"], + + ["keyword", "row_vector"], + ["constraint", [ + ["punctuation", "<"], + ["property", "offset"], + ["operator", "="], + ["expression", [ + ["operator", "-"], + ["number", "42"] + ]], + ["punctuation", ","], + ["property", "multiplier"], + ["operator", "="], + ["expression", [ + ["number", "3"] + ]], + ["punctuation", ">"] + ]], + ["punctuation", "["], + ["number", "3"], + ["punctuation", "]"], + " u", + ["punctuation", ";"], + + ["keyword", "real"], + ["constraint", [ + ["punctuation", "<"], + ["property", "lower"], + ["operator", "="], + ["expression", [ + ["function", "min"], + ["punctuation", "("], + "y", + ["punctuation", ")"] + ]], + ["punctuation", ","], + ["property", "upper"], + ["operator", "="], + ["expression", [ + ["function", "max"], + ["punctuation", "("], + "y", + ["punctuation", ")"] + ]], + ["punctuation", ">"] + ]], + " phi", + ["punctuation", ";"], + + ["keyword", "real"], + ["constraint", [ + ["punctuation", "<"], + ["property", "offset"], + ["operator", "="], + ["expression", [ + "mu" + ]], + ["punctuation", ","], + ["property", "multiplier"], + ["operator", "="], + ["expression", [ + "sigma" + ]], + ["punctuation", ">"] + ]], + " x", + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for type constraints. diff --git a/tests/languages/stan/directive_feature.test b/tests/languages/stan/directive_feature.test new file mode 100644 index 0000000000..0ee5391069 --- /dev/null +++ b/tests/languages/stan/directive_feature.test @@ -0,0 +1,14 @@ +#include my-std-normal.stan // definition of standard normal + #include my-std-normal.stan + +---------------------------------------------------- + +[ + ["directive", "#include my-std-normal.stan "], + ["comment", "// definition of standard normal"], + ["directive", "#include my-std-normal.stan"] +] + +---------------------------------------------------- + +Checks for include directives. diff --git a/tests/languages/stan/function-arg_feature.test b/tests/languages/stan/function-arg_feature.test new file mode 100644 index 0000000000..5ddf974c69 --- /dev/null +++ b/tests/languages/stan/function-arg_feature.test @@ -0,0 +1,21 @@ +y = algebra_solver(system, y_guess, theta, x_r, x_i); + +---------------------------------------------------- + +[ + "y ", + ["operator", "="], + ["keyword", "algebra_solver"], + ["punctuation", "("], + ["function-arg", "system"], + ["punctuation", ","], + " y_guess", + ["punctuation", ","], + " theta", + ["punctuation", ","], + " x_r", + ["punctuation", ","], + " x_i", + ["punctuation", ")"], + ["punctuation", ";"] +] diff --git a/tests/languages/stan/keyword_feature.test b/tests/languages/stan/keyword_feature.test new file mode 100644 index 0000000000..139941870e --- /dev/null +++ b/tests/languages/stan/keyword_feature.test @@ -0,0 +1,117 @@ +array +break +cholesky_factor_corr +cholesky_factor_cov +complex +continue +corr_matrix +cov_matrix +data +else +for +functions +generated +if +in +increment_log_prob +int +matrix +model +ordered +parameters +positive_ordered +print +quantities +real +reject +return +row_vector +simplex +target +transformed +unit_vector +vector +void +while + +algebra_solver +algebra_solver_newton +integrate_1d +integrate_ode +integrate_ode_bdf +integrate_ode_rk45 +map_rect +ode_adams +ode_adams_tol +ode_adjoint_tol_ctl +ode_bdf +ode_bdf_tol +ode_ckrk +ode_ckrk_tol +ode_rk45 +ode_rk45_tol +reduce_sum +reduce_sum_static + +---------------------------------------------------- + +[ + ["keyword", "array"], + ["keyword", "break"], + ["keyword", "cholesky_factor_corr"], + ["keyword", "cholesky_factor_cov"], + ["keyword", "complex"], + ["keyword", "continue"], + ["keyword", "corr_matrix"], + ["keyword", "cov_matrix"], + ["keyword", "data"], + ["keyword", "else"], + ["keyword", "for"], + ["keyword", "functions"], + ["keyword", "generated"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "increment_log_prob"], + ["keyword", "int"], + ["keyword", "matrix"], + ["keyword", "model"], + ["keyword", "ordered"], + ["keyword", "parameters"], + ["keyword", "positive_ordered"], + ["keyword", "print"], + ["keyword", "quantities"], + ["keyword", "real"], + ["keyword", "reject"], + ["keyword", "return"], + ["keyword", "row_vector"], + ["keyword", "simplex"], + ["keyword", "target"], + ["keyword", "transformed"], + ["keyword", "unit_vector"], + ["keyword", "vector"], + ["keyword", "void"], + ["keyword", "while"], + + ["keyword", "algebra_solver"], + ["keyword", "algebra_solver_newton"], + ["keyword", "integrate_1d"], + ["keyword", "integrate_ode"], + ["keyword", "integrate_ode_bdf"], + ["keyword", "integrate_ode_rk45"], + ["keyword", "map_rect"], + ["keyword", "ode_adams"], + ["keyword", "ode_adams_tol"], + ["keyword", "ode_adjoint_tol_ctl"], + ["keyword", "ode_bdf"], + ["keyword", "ode_bdf_tol"], + ["keyword", "ode_ckrk"], + ["keyword", "ode_ckrk_tol"], + ["keyword", "ode_rk45"], + ["keyword", "ode_rk45_tol"], + ["keyword", "reduce_sum"], + ["keyword", "reduce_sum_static"] +] + +---------------------------------------------------- + +Checks for keywords. diff --git a/tests/languages/stan/number_feature.test b/tests/languages/stan/number_feature.test new file mode 100644 index 0000000000..4741a872a1 --- /dev/null +++ b/tests/languages/stan/number_feature.test @@ -0,0 +1,41 @@ +0 +1 +24567898765 +24_56_78_98_765 + +0.0 +1.0 +3.14 +2.7e3 +2E-5 +1.23e+3 +3.14i +40e-3i +1e10i +0i +1_2.3_4e5_6i + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "1"], + ["number", "24567898765"], + ["number", "24_56_78_98_765"], + + ["number", "0.0"], + ["number", "1.0"], + ["number", "3.14"], + ["number", "2.7e3"], + ["number", "2E-5"], + ["number", "1.23e+3"], + ["number", "3.14i"], + ["number", "40e-3i"], + ["number", "1e10i"], + ["number", "0i"], + ["number", "1_2.3_4e5_6i"] +] + +---------------------------------------------------- + +Checks for numbers. diff --git a/tests/languages/stan/operator_feature.test b/tests/languages/stan/operator_feature.test new file mode 100644 index 0000000000..15e30e0ae2 --- /dev/null +++ b/tests/languages/stan/operator_feature.test @@ -0,0 +1,52 @@ ++ - * / ++= -= *= /= + +== != < <= > >= +! || && + +<- = +.* .*= ./ ./= + +| ' ^ % ~ ? : + +---------------------------------------------------- + +[ + ["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 operators. diff --git a/tests/languages/stan/program-block_feature.html.test b/tests/languages/stan/program-block_feature.html.test new file mode 100644 index 0000000000..1de0f530af --- /dev/null +++ b/tests/languages/stan/program-block_feature.html.test @@ -0,0 +1,76 @@ +functions { + // ... function declarations and definitions ... +} +data { + // ... declarations ... +} +transformed data { + // ... declarations ... statements ... +} +parameters { + // ... declarations ... +} +transformed parameters { + // ... declarations ... statements ... +} +model { + // ... declarations ... statements ... +} +generated quantities { + // ... declarations ... statements ... +} + +// data-only quantifiers +real foo(data real x) { + return x^2; +} + +---------------------------------------------------- + +functions +{ +// ... function declarations and definitions ... +} +data +{ +// ... declarations ... +} +transformed +data +{ +// ... declarations ... statements ... +} +parameters +{ +// ... declarations ... +} +transformed +parameters +{ +// ... declarations ... statements ... +} +model +{ +// ... declarations ... statements ... +} +generated +quantities +{ +// ... declarations ... statements ... +} + +// data-only quantifiers +real +foo +( +data +real +x +) +{ +return +x +^ +2 +; +} diff --git a/tests/languages/stan/punctuation_feature.test b/tests/languages/stan/punctuation_feature.test new file mode 100644 index 0000000000..a5c3d4db58 --- /dev/null +++ b/tests/languages/stan/punctuation_feature.test @@ -0,0 +1,19 @@ +( ) [ ] { } +, ; + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ","], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for punctuation. diff --git a/tests/languages/stan/string_feature.test b/tests/languages/stan/string_feature.test new file mode 100644 index 0000000000..f483002bcf --- /dev/null +++ b/tests/languages/stan/string_feature.test @@ -0,0 +1,40 @@ +"" +"foo bar" + +print("log density before =", target()); +print("u[", n, "] = ", u[n]); + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo bar\""], + + ["keyword", "print"], + ["punctuation", "("], + ["string", "\"log density before =\""], + ["punctuation", ","], + ["keyword", "target"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "print"], + ["punctuation", "("], + ["string", "\"u[\""], + ["punctuation", ","], + " n", + ["punctuation", ","], + ["string", "\"] = \""], + ["punctuation", ","], + " u", + ["punctuation", "["], + "n", + ["punctuation", "]"], + ["punctuation", ")"], + ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/stylus+pug/stylus_inclusion.test b/tests/languages/stylus+pug/stylus_inclusion.test index d154ab2e75..b00906d4b4 100644 --- a/tests/languages/stylus+pug/stylus_inclusion.test +++ b/tests/languages/stylus+pug/stylus_inclusion.test @@ -6,15 +6,17 @@ [ ["filter-stylus", [ ["filter-name", ":stylus"], - ["variable-declaration", [ - ["variable", "font-size"], - ["operator", "="], - ["number", "14"], - ["unit", "px"] + ["text", [ + ["variable-declaration", [ + ["variable", "font-size"], + ["operator", "="], + ["number", "14"], + ["unit", "px"] + ]] ]] ]] ] ---------------------------------------------------- -Checks for stylus filter in Jade. \ No newline at end of file +Checks for stylus filter in pug. diff --git a/tests/languages/swift/atrule_feature.test b/tests/languages/swift/atrule_feature.test deleted file mode 100644 index ae307f5561..0000000000 --- a/tests/languages/swift/atrule_feature.test +++ /dev/null @@ -1,33 +0,0 @@ -@IBOutlet -@IBDesignable -@IBAction -@IBInspectable -@class_protocol -@exported -@noreturn -@NSCopying -@NSManaged -@objc -@UIApplicationMain -@auto_closure - ----------------------------------------------------- - -[ - ["atrule", "@IBOutlet"], - ["atrule", "@IBDesignable"], - ["atrule", "@IBAction"], - ["atrule", "@IBInspectable"], - ["atrule", "@class_protocol"], - ["atrule", "@exported"], - ["atrule", "@noreturn"], - ["atrule", "@NSCopying"], - ["atrule", "@NSManaged"], - ["atrule", "@objc"], - ["atrule", "@UIApplicationMain"], - ["atrule", "@auto_closure"] -] - ----------------------------------------------------- - -Checks for at-rules. \ No newline at end of file diff --git a/tests/languages/swift/attribute_feature.test b/tests/languages/swift/attribute_feature.test new file mode 100644 index 0000000000..ac67e2be46 --- /dev/null +++ b/tests/languages/swift/attribute_feature.test @@ -0,0 +1,39 @@ +@IBOutlet +@IBDesignable +@IBAction +@IBInspectable +@class_protocol +@exported +@globalActor +@MainActor +@noreturn +@NSCopying +@NSManaged +@objc +@propertyWrapper +@UIApplicationMain +@auto_closure + +@SomeCustomName + +---------------------------------------------------- + +[ + ["attribute", "@IBOutlet"], + ["attribute", "@IBDesignable"], + ["attribute", "@IBAction"], + ["attribute", "@IBInspectable"], + ["attribute", "@class_protocol"], + ["attribute", "@exported"], + ["attribute", "@globalActor"], + ["attribute", "@MainActor"], + ["attribute", "@noreturn"], + ["attribute", "@NSCopying"], + ["attribute", "@NSManaged"], + ["attribute", "@objc"], + ["attribute", "@propertyWrapper"], + ["attribute", "@UIApplicationMain"], + ["attribute", "@auto_closure"], + + ["attribute", "@SomeCustomName"] +] diff --git a/tests/languages/swift/builtin_feature.test b/tests/languages/swift/builtin_feature.test deleted file mode 100644 index 9bc07e5e73..0000000000 --- a/tests/languages/swift/builtin_feature.test +++ /dev/null @@ -1,53 +0,0 @@ -Foo -Bar - -abs advance alignof alignofValue -assert contains count countElements -debugPrint debugPrintln distance -dropFirst dropLast dump enumerate -equal filter find first getVaList -indices isEmpty join last -lexicographicalCompare map max -maxElement min minElement numericCast -overlaps partition print -println reduce reflect reverse -sizeof sizeofValue sort sorted -split startsWith stride strideof -strideofValue suffix swap toDebugString -toString transcode underestimateCount -unsafeBitCast withExtendedLifetime -withUnsafeMutablePointer -withUnsafeMutablePointers -withUnsafePointer withUnsafePointers -withVaList - ----------------------------------------------------- - -[ - ["builtin", "Foo"], - ["builtin", "Bar"], - - ["builtin", "abs"], ["builtin", "advance"], ["builtin", "alignof"], ["builtin", "alignofValue"], - ["builtin", "assert"], ["builtin", "contains"], ["builtin", "count"], ["builtin", "countElements"], - ["builtin", "debugPrint"], ["builtin", "debugPrintln"], ["builtin", "distance"], - ["builtin", "dropFirst"], ["builtin", "dropLast"], ["builtin", "dump"], ["builtin", "enumerate"], - ["builtin", "equal"], ["builtin", "filter"], ["builtin", "find"], ["builtin", "first"], ["builtin", "getVaList"], - ["builtin", "indices"], ["builtin", "isEmpty"], ["builtin", "join"], ["builtin", "last"], - ["builtin", "lexicographicalCompare"], ["builtin", "map"], ["builtin", "max"], - ["builtin", "maxElement"], ["builtin", "min"], ["builtin", "minElement"], ["builtin", "numericCast"], - ["builtin", "overlaps"], ["builtin", "partition"], ["builtin", "print"], - ["builtin", "println"], ["builtin", "reduce"], ["builtin", "reflect"], ["builtin", "reverse"], - ["builtin", "sizeof"], ["builtin", "sizeofValue"], ["builtin", "sort"], ["builtin", "sorted"], - ["builtin", "split"], ["builtin", "startsWith"], ["builtin", "stride"], ["builtin", "strideof"], - ["builtin", "strideofValue"], ["builtin", "suffix"], ["builtin", "swap"], ["builtin", "toDebugString"], - ["builtin", "toString"], ["builtin", "transcode"], ["builtin", "underestimateCount"], - ["builtin", "unsafeBitCast"], ["builtin", "withExtendedLifetime"], - ["builtin", "withUnsafeMutablePointer"], - ["builtin", "withUnsafeMutablePointers"], - ["builtin", "withUnsafePointer"], ["builtin", "withUnsafePointers"], - ["builtin", "withVaList"] -] - ----------------------------------------------------- - -Checks for builtins. \ No newline at end of file diff --git a/tests/languages/swift/class-name_feature.test b/tests/languages/swift/class-name_feature.test new file mode 100644 index 0000000000..82ae664c0a --- /dev/null +++ b/tests/languages/swift/class-name_feature.test @@ -0,0 +1,41 @@ +struct SomeStructure {} +enum SomeEnumeration {} +class SomeClass: SomeSuperclass { + class var overrideableComputedTypeProperty: Int { + return 107 + } +} + +---------------------------------------------------- + +[ + ["keyword", "struct"], + ["class-name", "SomeStructure"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "enum"], + ["class-name", "SomeEnumeration"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", "SomeClass"], + ["punctuation", ":"], + ["class-name", "SomeSuperclass"], + ["punctuation", "{"], + + ["keyword", "class"], + ["keyword", "var"], + " overrideableComputedTypeProperty", + ["punctuation", ":"], + ["class-name", "Int"], + ["punctuation", "{"], + + ["keyword", "return"], + ["number", "107"], + + ["punctuation", "}"], + + ["punctuation", "}"] +] diff --git a/tests/languages/swift/comment_feature.test b/tests/languages/swift/comment_feature.test new file mode 100644 index 0000000000..7ab00b7c53 --- /dev/null +++ b/tests/languages/swift/comment_feature.test @@ -0,0 +1,23 @@ +// foo +/**/ +/* foo */ +/* + foo +*/ + +/* +/* + foo +*/ +*/ + +---------------------------------------------------- + +[ + ["comment", "// foo"], + ["comment", "/**/"], + ["comment", "/* foo */"], + ["comment", "/*\r\n foo\r\n*/"], + + ["comment", "/*\r\n/*\r\n foo\r\n*/\r\n*/"] +] diff --git a/tests/languages/swift/constant_feature.test b/tests/languages/swift/constant_feature.test index cd72339744..952da7e0f1 100644 --- a/tests/languages/swift/constant_feature.test +++ b/tests/languages/swift/constant_feature.test @@ -7,7 +7,7 @@ kFoo_bar ---------------------------------------------------- [ - ["constant", "nil"], + ["nil", "nil"], ["constant", "AB"], ["constant", "FOO_BAR"], ["constant", "kAb"], @@ -16,4 +16,4 @@ kFoo_bar ---------------------------------------------------- -Checks for constants. \ No newline at end of file +Checks for constants. diff --git a/tests/languages/swift/directive_feature.test b/tests/languages/swift/directive_feature.test new file mode 100644 index 0000000000..c95ae949a3 --- /dev/null +++ b/tests/languages/swift/directive_feature.test @@ -0,0 +1,138 @@ +#if os(tvOS) +#if !DEBUG && ENABLE_INTERNAL_TOOLS +#if SWIFTUI_PROFILE +#if compiler(>=5) +#if compiler(>=5) && swift(<5) + +#elseif compiler(>=5) +#else +#endif + +#sourceLocation(file: "foo", line: 42) +#sourceLocation() + +#error("error message") +#warning("warning message") + +#available(iOS 13, *) + +#selector(SomeClass.doSomething(_:)) + +#keyPath(SomeClass.someProperty) + +---------------------------------------------------- + +[ + ["directive", [ + ["directive-name", "#if"], + " os", + ["punctuation", "("], + "tvOS", + ["punctuation", ")"] + ]], + ["directive", [ + ["directive-name", "#if"], + ["operator", "!"], + "DEBUG ", + ["operator", "&&"], + " ENABLE_INTERNAL_TOOLS" + ]], + ["directive", [ + ["directive-name", "#if"], + " SWIFTUI_PROFILE" + ]], + ["directive", [ + ["directive-name", "#if"], + " compiler", + ["punctuation", "("], + ["operator", ">="], + ["number", "5"], + ["punctuation", ")"] + ]], + ["directive", [ + ["directive-name", "#if"], + " compiler", + ["punctuation", "("], + ["operator", ">="], + ["number", "5"], + ["punctuation", ")"], + ["operator", "&&"], + " swift", + ["punctuation", "("], + ["operator", "<"], + ["number", "5"], + ["punctuation", ")"] + ]], + + ["directive", [ + ["directive-name", "#elseif"], + " compiler", + ["punctuation", "("], + ["operator", ">="], + ["number", "5"], + ["punctuation", ")"] + ]], + ["directive", [ + ["directive-name", "#else"] + ]], + ["directive", [ + ["directive-name", "#endif"] + ]], + + ["other-directive", "#sourceLocation"], + ["punctuation", "("], + "file", + ["punctuation", ":"], + ["string-literal", [ + ["string", "\"foo\""] + ]], + ["punctuation", ","], + " line", + ["punctuation", ":"], + ["number", "42"], + ["punctuation", ")"], + + ["other-directive", "#sourceLocation"], + ["punctuation", "("], + ["punctuation", ")"], + + ["other-directive", "#error"], + ["punctuation", "("], + ["string-literal", [ + ["string", "\"error message\""] + ]], + ["punctuation", ")"], + + ["other-directive", "#warning"], + ["punctuation", "("], + ["string-literal", [ + ["string", "\"warning message\""] + ]], + ["punctuation", ")"], + + ["other-directive", "#available"], + ["punctuation", "("], + "iOS ", + ["number", "13"], + ["punctuation", ","], + ["operator", "*"], + ["punctuation", ")"], + + ["other-directive", "#selector"], + ["punctuation", "("], + ["class-name", "SomeClass"], + ["punctuation", "."], + ["function", "doSomething"], + ["punctuation", "("], + ["omit", "_"], + ["punctuation", ":"], + ["punctuation", ")"], + ["punctuation", ")"], + + ["other-directive", "#keyPath"], + ["punctuation", "("], + ["class-name", "SomeClass"], + ["punctuation", "."], + "someProperty", + ["punctuation", ")"] +] diff --git a/tests/languages/swift/function_feature.test b/tests/languages/swift/function_feature.test new file mode 100644 index 0000000000..3084f70d62 --- /dev/null +++ b/tests/languages/swift/function_feature.test @@ -0,0 +1,105 @@ +func greetAgain(person: String) -> String { + return "Hello again, " + person + "!" +} +print(greetAgain(person: "Anna")) +func someFunction(someT: T, someU: U) { + // function body goes here +} + + +// none of the below are functions +subscript(index: Int) -> Int { + get {} + set(newValue) {} +} + +---------------------------------------------------- + +[ + ["keyword", "func"], + ["function-definition", "greetAgain"], + ["punctuation", "("], + "person", + ["punctuation", ":"], + ["class-name", "String"], + ["punctuation", ")"], + ["operator", "->"], + ["class-name", "String"], + ["punctuation", "{"], + + ["keyword", "return"], + ["string-literal", [ + ["string", "\"Hello again, \""] + ]], + ["operator", "+"], + " person ", + ["operator", "+"], + ["string-literal", [ + ["string", "\"!\""] + ]], + + ["punctuation", "}"], + + ["function", "print"], + ["punctuation", "("], + ["function", "greetAgain"], + ["punctuation", "("], + "person", + ["punctuation", ":"], + ["string-literal", [ + ["string", "\"Anna\""] + ]], + ["punctuation", ")"], + ["punctuation", ")"], + + ["keyword", "func"], + ["function-definition", "someFunction"], + ["operator", "<"], + ["class-name", "T"], + ["punctuation", ":"], + ["class-name", "SomeClass"], + ["punctuation", ","], + ["class-name", "U"], + ["punctuation", ":"], + ["class-name", "SomeProtocol"], + ["operator", ">"], + ["punctuation", "("], + "someT", + ["punctuation", ":"], + ["class-name", "T"], + ["punctuation", ","], + " someU", + ["punctuation", ":"], + ["class-name", "U"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["comment", "// function body goes here"], + + ["punctuation", "}"], + + ["comment", "// none of the below are functions"], + + ["keyword", "subscript"], + ["punctuation", "("], + "index", + ["punctuation", ":"], + ["class-name", "Int"], + ["punctuation", ")"], + ["operator", "->"], + ["class-name", "Int"], + ["punctuation", "{"], + + ["keyword", "get"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "set"], + ["punctuation", "("], + "newValue", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "}"] +] diff --git a/tests/languages/swift/keyword_feature.test b/tests/languages/swift/keyword_feature.test index 75fb886640..19a1132cac 100644 --- a/tests/languages/swift/keyword_feature.test +++ b/tests/languages/swift/keyword_feature.test @@ -1,10 +1,19 @@ +Any +Protocol +Self +Type +actor as +assignment +associatedtype associativity -break +async +await +break; case catch class; -continue +continue; convenience default defer @@ -12,36 +21,41 @@ deinit didSet do dynamic -dynamicType else enum extension fallthrough +fileprivate final for -func +func; get guard +higherThan if import in +indirect infix init inout internal is +isolated lazy left let +lowerThan mutating -new; none +nonisolated nonmutating +open operator optional override postfix -precedence +precedencegroup prefix private protocol @@ -53,8 +67,8 @@ return right safe self -Self set +some static struct subscript @@ -63,7 +77,6 @@ switch throw throws try -Type typealias unowned unsafe @@ -72,21 +85,26 @@ weak where while willSet -__COLUMN__ -__FILE__ -__FUNCTION__ -__LINE__ ---------------------------------------------------- [ + ["keyword", "Any"], + ["keyword", "Protocol"], + ["keyword", "Self"], + ["keyword", "Type"], + ["keyword", "actor"], ["keyword", "as"], + ["keyword", "assignment"], + ["keyword", "associatedtype"], ["keyword", "associativity"], - ["keyword", "break"], + ["keyword", "async"], + ["keyword", "await"], + ["keyword", "break"], ["punctuation", ";"], ["keyword", "case"], ["keyword", "catch"], ["keyword", "class"], ["punctuation", ";"], - ["keyword", "continue"], + ["keyword", "continue"], ["punctuation", ";"], ["keyword", "convenience"], ["keyword", "default"], ["keyword", "defer"], @@ -94,36 +112,41 @@ __LINE__ ["keyword", "didSet"], ["keyword", "do"], ["keyword", "dynamic"], - ["keyword", "dynamicType"], ["keyword", "else"], ["keyword", "enum"], ["keyword", "extension"], ["keyword", "fallthrough"], + ["keyword", "fileprivate"], ["keyword", "final"], ["keyword", "for"], - ["keyword", "func"], + ["keyword", "func"], ["punctuation", ";"], ["keyword", "get"], ["keyword", "guard"], + ["keyword", "higherThan"], ["keyword", "if"], ["keyword", "import"], ["keyword", "in"], + ["keyword", "indirect"], ["keyword", "infix"], ["keyword", "init"], ["keyword", "inout"], ["keyword", "internal"], ["keyword", "is"], + ["keyword", "isolated"], ["keyword", "lazy"], ["keyword", "left"], ["keyword", "let"], + ["keyword", "lowerThan"], ["keyword", "mutating"], - ["keyword", "new"], ["punctuation", ";"], ["keyword", "none"], + ["keyword", "nonisolated"], ["keyword", "nonmutating"], + ["keyword", "open"], ["keyword", "operator"], ["keyword", "optional"], ["keyword", "override"], ["keyword", "postfix"], - ["keyword", "precedence"], + ["keyword", "precedencegroup"], ["keyword", "prefix"], ["keyword", "private"], ["keyword", "protocol"], @@ -135,8 +158,8 @@ __LINE__ ["keyword", "right"], ["keyword", "safe"], ["keyword", "self"], - ["keyword", "Self"], ["keyword", "set"], + ["keyword", "some"], ["keyword", "static"], ["keyword", "struct"], ["keyword", "subscript"], @@ -145,7 +168,6 @@ __LINE__ ["keyword", "throw"], ["keyword", "throws"], ["keyword", "try"], - ["keyword", "Type"], ["keyword", "typealias"], ["keyword", "unowned"], ["keyword", "unsafe"], @@ -153,11 +175,7 @@ __LINE__ ["keyword", "weak"], ["keyword", "where"], ["keyword", "while"], - ["keyword", "willSet"], - ["keyword", "__COLUMN__"], - ["keyword", "__FILE__"], - ["keyword", "__FUNCTION__"], - ["keyword", "__LINE__"] + ["keyword", "willSet"] ] ---------------------------------------------------- diff --git a/tests/languages/swift/label_feature.test b/tests/languages/swift/label_feature.test new file mode 100644 index 0000000000..22b23a94f5 --- /dev/null +++ b/tests/languages/swift/label_feature.test @@ -0,0 +1,24 @@ +gameLoop: while square != finalSquare { + break gameLoop + continue gameLoop +} + +---------------------------------------------------- + +[ + ["label", "gameLoop"], + ["punctuation", ":"], + ["keyword", "while"], + " square ", + ["operator", "!="], + " finalSquare ", + ["punctuation", "{"], + + ["keyword", "break"], + ["label", " gameLoop"], + + ["keyword", "continue"], + ["label", " gameLoop"], + + ["punctuation", "}"] +] diff --git a/tests/languages/swift/literal_feature.test b/tests/languages/swift/literal_feature.test new file mode 100644 index 0000000000..6d1b499f35 --- /dev/null +++ b/tests/languages/swift/literal_feature.test @@ -0,0 +1,60 @@ +#file +#fileID +#filePath +#line +#column +#function +#dsohandle + +#colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) +#fileLiteral(resourceName: "foo") +#imageLiteral(resourceName: "foo") + +---------------------------------------------------- + +[ + ["literal", "#file"], + ["literal", "#fileID"], + ["literal", "#filePath"], + ["literal", "#line"], + ["literal", "#column"], + ["literal", "#function"], + ["literal", "#dsohandle"], + + ["literal", "#colorLiteral"], + ["punctuation", "("], + "red", + ["punctuation", ":"], + ["number", "1.0"], + ["punctuation", ","], + " green", + ["punctuation", ":"], + ["number", "1.0"], + ["punctuation", ","], + " blue", + ["punctuation", ":"], + ["number", "1.0"], + ["punctuation", ","], + " alpha", + ["punctuation", ":"], + ["number", "1.0"], + ["punctuation", ")"], + + ["literal", "#fileLiteral"], + ["punctuation", "("], + "resourceName", + ["punctuation", ":"], + ["string-literal", [ + ["string", "\"foo\""] + ]], + ["punctuation", ")"], + + ["literal", "#imageLiteral"], + ["punctuation", "("], + "resourceName", + ["punctuation", ":"], + ["string-literal", [ + ["string", "\"foo\""] + ]], + ["punctuation", ")"] +] diff --git a/tests/languages/swift/omit_feature.test b/tests/languages/swift/omit_feature.test new file mode 100644 index 0000000000..2aee1a8765 --- /dev/null +++ b/tests/languages/swift/omit_feature.test @@ -0,0 +1,7 @@ +_ + +---------------------------------------------------- + +[ + ["omit", "_"] +] diff --git a/tests/languages/swift/operator_feature.test b/tests/languages/swift/operator_feature.test new file mode 100644 index 0000000000..35adb25e8a --- /dev/null +++ b/tests/languages/swift/operator_feature.test @@ -0,0 +1,115 @@ ++ - * / % ++= -= *= /= %= + +~ & | ^ << >> +~= &= |= ^= <<= >>= + +&+ &- &* &<< &>> +&+= &-= &*= &<<= &>>= + += +== != === !== <= >= < > +! && || + +..< ... + +-> + +?? + +// custom operators ++++ +prefix func +++ (vector: inout Vector2D) -> Vector2D {} + +// dot operators (SIMD) +.!= .== .< .> .<= .>= + +---------------------------------------------------- + +[ + ["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", "&&"], + ["operator", "||"], + + ["operator", "..<"], ["operator", "..."], + + ["operator", "->"], + + ["operator", "??"], + + ["comment", "// custom operators"], + + ["operator", "+++"], + + ["keyword", "prefix"], + ["keyword", "func"], + ["operator", "+++"], + ["punctuation", "("], + "vector", + ["punctuation", ":"], + ["keyword", "inout"], + ["class-name", "Vector2D"], + ["punctuation", ")"], + ["operator", "->"], + ["class-name", "Vector2D"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["comment", "// dot operators (SIMD)"], + + ["operator", ".!="], + ["operator", ".=="], + ["operator", ".<"], + ["operator", ".>"], + ["operator", ".<="], + ["operator", ".>="] +] diff --git a/tests/languages/swift/punctuation_feature.test b/tests/languages/swift/punctuation_feature.test new file mode 100644 index 0000000000..475e789718 --- /dev/null +++ b/tests/languages/swift/punctuation_feature.test @@ -0,0 +1,21 @@ +{ } [ ] ( ) +; , . : +\ + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", ";"], + ["punctuation", ","], + ["punctuation", "."], + ["punctuation", ":"], + + ["punctuation", "\\"] +] diff --git a/tests/languages/swift/short-argument_feature.test b/tests/languages/swift/short-argument_feature.test new file mode 100644 index 0000000000..79d5289518 --- /dev/null +++ b/tests/languages/swift/short-argument_feature.test @@ -0,0 +1,20 @@ +reversedNames = names.sorted(by: { $0 > $1 } ) + +---------------------------------------------------- + +[ + "reversedNames ", + ["operator", "="], + " names", + ["punctuation", "."], + ["function", "sorted"], + ["punctuation", "("], + "by", + ["punctuation", ":"], + ["punctuation", "{"], + ["short-argument", "$0"], + ["operator", ">"], + ["short-argument", "$1"], + ["punctuation", "}"], + ["punctuation", ")"] +] diff --git a/tests/languages/swift/string_feature.test b/tests/languages/swift/string_feature.test index a55d2e6593..ac6bc6be58 100644 --- a/tests/languages/swift/string_feature.test +++ b/tests/languages/swift/string_feature.test @@ -2,46 +2,133 @@ "fo\"o" "foo\ bar" -"foo \(42)" -"foo \(f("bar"))" -"foo /* comment */ bar" -'foo // bar' + +"foo /* not a comment */ bar" "foo\ -/* comment */\ +/* not a comment */\ bar" +let softWrappedQuotation = """ +The White Rabbit put on his spectacles. "Where shall I begin, \ +please your Majesty?" he asked. + +"Begin at the beginning," the King said gravely, "and go on \ +till you come to the end; then stop." +""" + +let threeMoreDoubleQuotationMarks = #""" +Here are three more double quotes: """ +"""# +#"Write an interpolated string in Swift using \(multiplier)."# + + +"foo \(42)" +"foo \(f("bar"))" +"\(multiplier) times 2.5 is \(Double(multiplier) * 2.5)" +#"6 times 7 is \#(6 * 7)."# + ---------------------------------------------------- [ - ["string", ["\"\""]], - ["string", ["\"fo\\\"o\""]], - ["string", ["\"foo\\\r\nbar\""]], - ["string", [ - "\"foo ", + ["string-literal", [ + ["string", "\"\""] + ]], + ["string-literal", [ + ["string", "\"fo\\\"o\""] + ]], + ["string-literal", [ + ["string", "\"foo"], + ["punctuation", "\\"], + ["string", "\r\nbar\""] + ]], + + ["string-literal", [ + ["string", "\"foo /* not a comment */ bar\""] + ]], + ["string-literal", [ + ["string", "\"foo"], + ["punctuation", "\\"], + ["string", "\r\n/* not a comment */"], + ["punctuation", "\\"], + ["string", "\r\nbar\""] + ]], + + ["keyword", "let"], + " softWrappedQuotation ", + ["operator", "="], + ["string-literal", [ + ["string", "\"\"\"\r\nThe White Rabbit put on his spectacles. \"Where shall I begin, "], + ["punctuation", "\\"], + ["string", "\r\nplease your Majesty?\" he asked.\r\n\r\n\"Begin at the beginning,\" the King said gravely, \"and go on "], + ["punctuation", "\\"], + ["string", "\r\ntill you come to the end; then stop.\"\r\n\"\"\""] + ]], + + ["keyword", "let"], + " threeMoreDoubleQuotationMarks ", + ["operator", "="], + ["string-literal", [ + ["string", "#\"\"\"\r\nHere are three more double quotes: \"\"\"\r\n\"\"\"#"] + ]], + + ["string-literal", [ + ["string", "#\"Write an interpolated string in Swift using \\(multiplier).\"#"] + ]], + + ["string-literal", [ + ["string", "\"foo "], + ["interpolation-punctuation", "\\("], ["interpolation", [ - ["delimiter", "\\("], - ["number", "42"], - ["delimiter", ")"] + ["number", "42"] ]], - "\"" + ["interpolation-punctuation", ")"], + ["string", "\""] ]], - ["string", [ - "\"foo ", + ["string-literal", [ + ["string", "\"foo "], + ["interpolation-punctuation", "\\("], ["interpolation", [ - ["delimiter", "\\("], ["function", "f"], ["punctuation", "("], - ["string", ["\"bar\""]], + ["string-literal", [ + ["string", "\"bar\""] + ]], + ["punctuation", ")"] + ]], + ["interpolation-punctuation", ")"], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\""], + ["interpolation-punctuation", "\\("], + ["interpolation", ["multiplier"]], + ["interpolation-punctuation", ")"], + ["string", " times 2.5 is "], + ["interpolation-punctuation", "\\("], + ["interpolation", [ + ["class-name", "Double"], + ["punctuation", "("], + "multiplier", ["punctuation", ")"], - ["delimiter", ")"] + ["operator", "*"], + ["number", "2.5"] ]], - "\"" + ["interpolation-punctuation", ")"], + ["string", "\""] ]], - ["string", ["\"foo /* comment */ bar\""]], - ["string", ["'foo // bar'"]], - ["string", ["\"foo\\\r\n/* comment */\\\r\nbar\""]] + ["string-literal", [ + ["string", "#\"6 times 7 is "], + ["interpolation-punctuation", "\\#("], + ["interpolation", [ + ["number", "6"], + ["operator", "*"], + ["number", "7"] + ]], + ["interpolation-punctuation", ")"], + ["string", ".\"#"] + ]] ] ---------------------------------------------------- -Checks for strings and string interpolation. \ No newline at end of file +Checks for strings and string interpolation. diff --git a/tests/languages/systemd/boolean_feature.test b/tests/languages/systemd/boolean_feature.test new file mode 100644 index 0000000000..743dd8e1f1 --- /dev/null +++ b/tests/languages/systemd/boolean_feature.test @@ -0,0 +1,46 @@ +foo=on +foo=true +foo=yes +foo=off +foo=false +foo=no + +---------------------------------------------------- + +[ + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["boolean", "on"] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["boolean", "true"] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["boolean", "yes"] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["boolean", "off"] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["boolean", "false"] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["boolean", "no"] + ]] +] diff --git a/tests/languages/systemd/comment_feature.test b/tests/languages/systemd/comment_feature.test new file mode 100644 index 0000000000..d564a17ae1 --- /dev/null +++ b/tests/languages/systemd/comment_feature.test @@ -0,0 +1,9 @@ +# comment +; comment + +---------------------------------------------------- + +[ + ["comment", "# comment"], + ["comment", "; comment"] +] diff --git a/tests/languages/systemd/key_feature.test b/tests/languages/systemd/key_feature.test new file mode 100644 index 0000000000..92d95c27fc --- /dev/null +++ b/tests/languages/systemd/key_feature.test @@ -0,0 +1,9 @@ +foo= +foo = + +---------------------------------------------------- + +[ + ["key", "foo"], ["punctuation", "="], + ["key", "foo"], ["punctuation", "="] +] diff --git a/tests/languages/systemd/section_feature.test b/tests/languages/systemd/section_feature.test new file mode 100644 index 0000000000..9c6a00b59b --- /dev/null +++ b/tests/languages/systemd/section_feature.test @@ -0,0 +1,11 @@ +[Section Foo] + +---------------------------------------------------- + +[ + ["section", [ + ["punctuation", "["], + ["section-name", "Section Foo"], + ["punctuation", "]"] + ]] +] diff --git a/tests/languages/systemd/value_feature.test b/tests/languages/systemd/value_feature.test new file mode 100644 index 0000000000..aa9bac655c --- /dev/null +++ b/tests/languages/systemd/value_feature.test @@ -0,0 +1,49 @@ +foo= value 2 + +foo="something" "some thing" "…" +foo= "something" "some thing" "…" +foo=value 2 \ + value 2 continued + +foo=value 3\ +# this line is ignored +; this line is ignored too + value 3 continued + +---------------------------------------------------- + +[ + ["key", "foo"], ["punctuation", "="], ["value", ["value 2"]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["quoted", "\"something\""], + ["quoted", "\"some thing\""], + ["quoted", "\"…\""] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + ["quoted", "\"something\""], + ["quoted", "\"some thing\""], + ["quoted", "\"…\""] + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + "value 2 ", ["punctuation", "\\"], + "\r\n value 2 continued" + ]], + + ["key", "foo"], + ["punctuation", "="], + ["value", [ + "value 3", ["punctuation", "\\"], + ["comment", "# this line is ignored"], + ["comment", "; this line is ignored too"], + "\r\n value 3 continued" + ]] +] diff --git a/tests/languages/t4-cs/block_class-feature_feature.test b/tests/languages/t4-cs/block_class-feature_feature.test index 2bb03b5ad3..4d8d7c51cd 100644 --- a/tests/languages/t4-cs/block_class-feature_feature.test +++ b/tests/languages/t4-cs/block_class-feature_feature.test @@ -6,7 +6,7 @@ public class Bar {} ---------------------------------------------------- [ - "Foo\n", + "Foo\r\n", ["block", [ ["class-feature", [ ["delimiter", "<#+"], diff --git a/tests/languages/t4-cs/block_expression_feature.test b/tests/languages/t4-cs/block_expression_feature.test index d1c241d820..af38163ff1 100644 --- a/tests/languages/t4-cs/block_expression_feature.test +++ b/tests/languages/t4-cs/block_expression_feature.test @@ -18,12 +18,12 @@ var b = new int[] { <#= ["delimiter", "#>"] ]] ]], - ";\nvar b = new int[] { ", + ";\r\nvar b = new int[] { ", ["block", [ ["expression", [ ["delimiter", "<#="], ["content", [ - "\n\tString", + "\r\n\tString", ["punctuation", "."], ["function", "Join"], ["punctuation", "("], diff --git a/tests/languages/t4-cs/block_standard_feature.test b/tests/languages/t4-cs/block_standard_feature.test index 1dc9bd8713..4e65de5783 100644 --- a/tests/languages/t4-cs/block_standard_feature.test +++ b/tests/languages/t4-cs/block_standard_feature.test @@ -33,7 +33,9 @@ The number <#= i #> is even. " i", ["operator", "++"], ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "if"], ["punctuation", "("], "i ", @@ -42,23 +44,22 @@ The number <#= i #> is even. ["operator", "=="], ["number", "0"], ["punctuation", ")"], + ["punctuation", "{"] ]], ["delimiter", "#>"] ]] ]], - "\nThe number ", + "\r\nThe number ", ["block", [ ["expression", [ ["delimiter", "<#="], - ["content", [ - " i " - ]], + ["content", [" i "]], ["delimiter", "#>"] ]] ]], - " is even.\n", + " is even.\r\n", ["block", [ ["standard", [ diff --git a/tests/languages/t4-vb/block_feature.test b/tests/languages/t4-vb/block_feature.test index 8222b79880..48a138f4ac 100644 --- a/tests/languages/t4-vb/block_feature.test +++ b/tests/languages/t4-vb/block_feature.test @@ -53,11 +53,8 @@ The number <#= i #> is even. ["class-feature", [ ["delimiter", "<#+"], ["content", [ - ["keyword", "Public"], - ["keyword", "Class"], - " Bar\n", - ["keyword", "End"], - ["keyword", "Class"] + ["keyword", "Public"], ["keyword", "Class"], " Bar\r\n", + ["keyword", "End"], ["keyword", "Class"] ]], ["delimiter", "#>"] ]] @@ -75,6 +72,7 @@ The number <#= i #> is even. ["number", "0"], ["keyword", "To"], ["number", "9"], + ["keyword", "If"], " i ", ["keyword", "Mod"], @@ -87,26 +85,22 @@ The number <#= i #> is even. ]] ]], - "\nThe number ", + "\r\nThe number ", ["block", [ ["expression", [ ["delimiter", "<#="], - ["content", [ - " i " - ]], + ["content", [" i "]], ["delimiter", "#>"] ]] ]], - " is even.\n", + " is even.\r\n", ["block", [ ["standard", [ ["delimiter", "<#"], ["content", [ - ["keyword", "End"], - ["keyword", "If"], - ["keyword", "Next"], - " i\n" + ["keyword", "End"], ["keyword", "If"], + ["keyword", "Next"], " i\r\n" ]], ["delimiter", "#>"] ]] diff --git a/tests/languages/tap/subtest_feature.test b/tests/languages/tap/subtest_feature.test new file mode 100644 index 0000000000..14b1339a48 --- /dev/null +++ b/tests/languages/tap/subtest_feature.test @@ -0,0 +1,7 @@ +# Subtest + +---------------------------------------------------- + +[ + ["subtest", "# Subtest"] +] diff --git a/tests/languages/tap/yamlish_feature.test b/tests/languages/tap/yamlish_feature.test index be4a19e3d8..727e783936 100644 --- a/tests/languages/tap/yamlish_feature.test +++ b/tests/languages/tap/yamlish_feature.test @@ -15,32 +15,43 @@ ok [ ["pass", "ok"], + ["yamlish", [ ["punctuation", "---"], + ["key", "message"], ["punctuation", ":"], ["string", "\"Failed with error 'hostname peebles.example.com not found'\""], + ["key", "severity"], ["punctuation", ":"], - " fail\n ", + " fail\r\n ", + ["key", "data"], ["punctuation", ":"], + ["key", "got"], ["punctuation", ":"], + ["key", "hostname"], ["punctuation", ":"], ["string", "'peebles.example.com'"], + ["key", "address"], ["punctuation", ":"], ["null", "~"], + ["key", "expected"], ["punctuation", ":"], + ["key", "hostname"], ["punctuation", ":"], ["string", "'peebles.example.com'"], + ["key", "address"], ["punctuation", ":"], ["string", "'85.193.201.85'"], + ["punctuation", "..."] ]] ] diff --git a/tests/languages/tcl/punctuation_feature.test b/tests/languages/tcl/punctuation_feature.test new file mode 100644 index 0000000000..62fc1d096a --- /dev/null +++ b/tests/languages/tcl/punctuation_feature.test @@ -0,0 +1,12 @@ +{ } ( ) [ ] + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"] +] diff --git a/tests/languages/textile+haml/textile_inclusion.test b/tests/languages/textile+haml/textile_inclusion.test new file mode 100644 index 0000000000..2bdd989b44 --- /dev/null +++ b/tests/languages/textile+haml/textile_inclusion.test @@ -0,0 +1,50 @@ +:textile +
    + +~ + :textile +
    + +---------------------------------------------------- + +[ + ["filter-textile", [ + ["filter-name", ":textile"], + ["text", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]] + ]], + ["punctuation", "~"], + ["filter-textile", [ + ["filter-name", ":textile"], + ["text", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]] + ]] +] diff --git a/tests/languages/textile/tag_feature.test b/tests/languages/textile/tag_feature.test new file mode 100644 index 0000000000..18aadbe19d --- /dev/null +++ b/tests/languages/textile/tag_feature.test @@ -0,0 +1,20 @@ +
    + +---------------------------------------------------- + +[ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "details" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] +] diff --git a/tests/languages/toml/string_feature.test b/tests/languages/toml/string_feature.test index fa87009b61..debfc79c5d 100644 --- a/tests/languages/toml/string_feature.test +++ b/tests/languages/toml/string_feature.test @@ -20,8 +20,8 @@ ["string", "''"], ["string", "'#'"], ["string", "'\"abc\"'"], - ["string", "\"\"\"\n\tabc\n\t\"\"\""], - ["string", "'''\n\tabc\n\t'''"] + ["string", "\"\"\"\r\n\tabc\r\n\t\"\"\""], + ["string", "'''\r\n\tabc\r\n\t'''"] ] ---------------------------------------------------- diff --git a/tests/languages/tremor/boolean_feature.test b/tests/languages/tremor/boolean_feature.test new file mode 100644 index 0000000000..7994a0c8c3 --- /dev/null +++ b/tests/languages/tremor/boolean_feature.test @@ -0,0 +1,15 @@ +true +false +null + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"], + ["boolean", "null"] +] + +---------------------------------------------------- + +Checks for booleans. diff --git a/tests/languages/tremor/comment_feature.test b/tests/languages/tremor/comment_feature.test new file mode 100644 index 0000000000..91a302165a --- /dev/null +++ b/tests/languages/tremor/comment_feature.test @@ -0,0 +1,15 @@ +# +## foobar +### snot badger + +---------------------------------------------------- + +[ + ["comment", "#"], + ["comment", "## foobar"], + ["comment", "### snot badger"] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/tremor/extractor_feature.test b/tests/languages/tremor/extractor_feature.test new file mode 100644 index 0000000000..b32715509b --- /dev/null +++ b/tests/languages/tremor/extractor_feature.test @@ -0,0 +1,15 @@ +re|^(?Pbat.*)$| +datetime|%Y-%m-%d %H:%M| + +---------------------------------------------------- + +[ + ["extractor", [ + ["function", "re"], + ["regex", "|^(?Pbat.*)$|"] + ]], + ["extractor", [ + ["function", "datetime"], + ["value", "|%Y-%m-%d %H:%M|"] + ]] +] diff --git a/tests/languages/tremor/function_feature.test b/tests/languages/tremor/function_feature.test new file mode 100644 index 0000000000..896990e8e7 --- /dev/null +++ b/tests/languages/tremor/function_feature.test @@ -0,0 +1,9 @@ +foo() + +---------------------------------------------------- + +[ + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/tremor/identifier_feature.test b/tests/languages/tremor/identifier_feature.test new file mode 100644 index 0000000000..c7fce26834 --- /dev/null +++ b/tests/languages/tremor/identifier_feature.test @@ -0,0 +1,12 @@ +foo +foo_bar_42 +`foo` +`bar` + +---------------------------------------------------- + +[ + "foo\r\nfoo_bar_42\r\n", + ["identifier", "`foo`"], + ["identifier", "`bar`"] +] diff --git a/tests/languages/tremor/keyword_escape_feature.test b/tests/languages/tremor/keyword_escape_feature.test new file mode 100644 index 0000000000..bd1ec9fb3a --- /dev/null +++ b/tests/languages/tremor/keyword_escape_feature.test @@ -0,0 +1,115 @@ +`args` +`as` +`by` +`case` +`config` +`connect` +`connector` +`const` +`copy` +`create` +`default` +`define` +`deploy` +`drop` +`each` +`emit` +`end` +`erase` +`event` +`flow` +`fn` +`for` +`from` +`group` +`having` +`insert` +`into` +`intrinsic` +`let` +`links` +`match` +`merge` +`mod` +`move` +`of` +`operator` +`patch` +`pipeline` +`recur` +`script` +`select` +`set` +`sliding` +`state` +`stream` +`to` +`tumbling` +`update` +`use` +`when` +`where` +`window` +`with` + +---------------------------------------------------- + +[ + ["identifier", "`args`"], + ["identifier", "`as`"], + ["identifier", "`by`"], + ["identifier", "`case`"], + ["identifier", "`config`"], + ["identifier", "`connect`"], + ["identifier", "`connector`"], + ["identifier", "`const`"], + ["identifier", "`copy`"], + ["identifier", "`create`"], + ["identifier", "`default`"], + ["identifier", "`define`"], + ["identifier", "`deploy`"], + ["identifier", "`drop`"], + ["identifier", "`each`"], + ["identifier", "`emit`"], + ["identifier", "`end`"], + ["identifier", "`erase`"], + ["identifier", "`event`"], + ["identifier", "`flow`"], + ["identifier", "`fn`"], + ["identifier", "`for`"], + ["identifier", "`from`"], + ["identifier", "`group`"], + ["identifier", "`having`"], + ["identifier", "`insert`"], + ["identifier", "`into`"], + ["identifier", "`intrinsic`"], + ["identifier", "`let`"], + ["identifier", "`links`"], + ["identifier", "`match`"], + ["identifier", "`merge`"], + ["identifier", "`mod`"], + ["identifier", "`move`"], + ["identifier", "`of`"], + ["identifier", "`operator`"], + ["identifier", "`patch`"], + ["identifier", "`pipeline`"], + ["identifier", "`recur`"], + ["identifier", "`script`"], + ["identifier", "`select`"], + ["identifier", "`set`"], + ["identifier", "`sliding`"], + ["identifier", "`state`"], + ["identifier", "`stream`"], + ["identifier", "`to`"], + ["identifier", "`tumbling`"], + ["identifier", "`update`"], + ["identifier", "`use`"], + ["identifier", "`when`"], + ["identifier", "`where`"], + ["identifier", "`window`"], + ["identifier", "`with`"] +] + +---------------------------------------------------- + +Checks for variables. diff --git a/tests/languages/tremor/keyword_feature.test b/tests/languages/tremor/keyword_feature.test new file mode 100644 index 0000000000..e65df8c8dc --- /dev/null +++ b/tests/languages/tremor/keyword_feature.test @@ -0,0 +1,115 @@ +args +as +by +case +config +connect +connector +const +copy +create +default +define +deploy +drop +each +emit +end +erase +event +flow +fn +for +from +group +having +insert +into +intrinsic +let +links +match +merge +mod +move +of +operator +patch +pipeline +recur +script +select +set +sliding +state +stream +to +tumbling +update +use +when +where +window +with + +---------------------------------------------------- + +[ + ["keyword", "args"], + ["keyword", "as"], + ["keyword", "by"], + ["keyword", "case"], + ["keyword", "config"], + ["keyword", "connect"], + ["keyword", "connector"], + ["keyword", "const"], + ["keyword", "copy"], + ["keyword", "create"], + ["keyword", "default"], + ["keyword", "define"], + ["keyword", "deploy"], + ["keyword", "drop"], + ["keyword", "each"], + ["keyword", "emit"], + ["keyword", "end"], + ["keyword", "erase"], + ["keyword", "event"], + ["keyword", "flow"], + ["keyword", "fn"], + ["keyword", "for"], + ["keyword", "from"], + ["keyword", "group"], + ["keyword", "having"], + ["keyword", "insert"], + ["keyword", "into"], + ["keyword", "intrinsic"], + ["keyword", "let"], + ["keyword", "links"], + ["keyword", "match"], + ["keyword", "merge"], + ["keyword", "mod"], + ["keyword", "move"], + ["keyword", "of"], + ["keyword", "operator"], + ["keyword", "patch"], + ["keyword", "pipeline"], + ["keyword", "recur"], + ["keyword", "script"], + ["keyword", "select"], + ["keyword", "set"], + ["keyword", "sliding"], + ["keyword", "state"], + ["keyword", "stream"], + ["keyword", "to"], + ["keyword", "tumbling"], + ["keyword", "update"], + ["keyword", "use"], + ["keyword", "when"], + ["keyword", "where"], + ["keyword", "window"], + ["keyword", "with"] +] + +---------------------------------------------------- + +Checks for keywords. diff --git a/tests/languages/tremor/modularity_feature.test b/tests/languages/tremor/modularity_feature.test new file mode 100644 index 0000000000..fd8ec5fe52 --- /dev/null +++ b/tests/languages/tremor/modularity_feature.test @@ -0,0 +1,36 @@ +foo +foo::bar +foo::bar::baz +`foo`::bar::`baz` +`foo` +`foo`::`bar`::`baz` + +---------------------------------------------------- + +[ + "foo\r\nfoo", + ["punctuation", "::"], + "bar\r\nfoo", + ["punctuation", "::"], + "bar", + ["punctuation", "::"], + "baz\r\n", + + ["identifier", "`foo`"], + ["punctuation", "::"], + "bar", + ["punctuation", "::"], + ["identifier", "`baz`"], + + ["identifier", "`foo`"], + + ["identifier", "`foo`"], + ["punctuation", "::"], + ["identifier", "`bar`"], + ["punctuation", "::"], + ["identifier", "`baz`"] +] + +---------------------------------------------------- + +Checks modularity and references for bare/namespaced variables diff --git a/tests/languages/tremor/number_feature.test b/tests/languages/tremor/number_feature.test new file mode 100644 index 0000000000..cc80672c43 --- /dev/null +++ b/tests/languages/tremor/number_feature.test @@ -0,0 +1,19 @@ +42 +0.154 +0xBadFace +0b10101010 +1_000_000_000 + +---------------------------------------------------- + +[ + ["number", "42"], + ["number", "0.154"], + ["number", "0xBadFace"], + ["number", "0b10101010"], + ["number", "1_000_000_000"] +] + +---------------------------------------------------- + +Checks for decimal and hexadecimal numbers. diff --git a/tests/languages/tremor/operator_feature.test b/tests/languages/tremor/operator_feature.test new file mode 100644 index 0000000000..226189cd9e --- /dev/null +++ b/tests/languages/tremor/operator_feature.test @@ -0,0 +1,61 @@ ++ - / * % ~ ^ & | ++= -= /= *= %= ~= ^= &= |= +== != < > <= >= += => + +! && || + +<< >> >>> +<<= >>= >>>= + +not and or xor present absent + +---------------------------------------------------- + +[ + ["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", "not"], + ["operator", "and"], + ["operator", "or"], + ["operator", "xor"], + ["operator", "present"], + ["operator", "absent"] +] + +---------------------------------------------------- + +Checks for operators diff --git a/tests/languages/tremor/punctuation_feature.test b/tests/languages/tremor/punctuation_feature.test new file mode 100644 index 0000000000..57cd9ac349 --- /dev/null +++ b/tests/languages/tremor/punctuation_feature.test @@ -0,0 +1,29 @@ +( ) [ ] { } +, ; . : +%( ) %[ ] %{ } + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."], + ["punctuation", ":"], + + ["pattern-punctuation", "%"], + ["punctuation", "("], + ["punctuation", ")"], + ["pattern-punctuation", "%"], + ["punctuation", "["], + ["punctuation", "]"], + ["pattern-punctuation", "%"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/tremor/string_feature.test b/tests/languages/tremor/string_feature.test new file mode 100644 index 0000000000..b9a5dea593 --- /dev/null +++ b/tests/languages/tremor/string_feature.test @@ -0,0 +1,87 @@ +"" +"" "" +""" +""" +"fo\"obar" +"foo\ +bar" +""" +multiline +""" +"snot#{badger}badger" +""" + I am + a + long + multi-line + string with #{ "#{a+1} interpolation" } +""" + +---------------------------------------------------- + +[ + ["interpolated-string", [ + ["string", "\"\""] + ]], + + ["interpolated-string", [ + ["string", "\"\""] + ]], + ["interpolated-string", [ + ["string", "\"\""] + ]], + + ["interpolated-string", [ + ["string", "\"\"\"\r\n\"\"\""] + ]], + + ["interpolated-string", [ + ["string", "\"fo\\\"obar\""] + ]], + + ["interpolated-string", [ + ["string", "\"foo\\\r\nbar\""] + ]], + + ["interpolated-string", [ + ["string", "\"\"\"\r\nmultiline\r\n\"\"\""] + ]], + + ["interpolated-string", [ + ["string", "\"snot"], + ["interpolation", [ + ["punctuation", "#{"], + ["expression", ["badger"]], + ["punctuation", "}"] + ]], + ["string", "badger\""] + ]], + + ["interpolated-string", [ + ["string", "\"\"\"\r\n I am\r\n a\r\n long\r\n multi-line\r\n string with "], + ["interpolation", [ + ["punctuation", "#{"], + ["expression", [ + ["interpolated-string", [ + ["string", "\""], + ["interpolation", [ + ["punctuation", "#{"], + ["expression", [ + "a", + ["operator", "+"], + ["number", "1"] + ]], + ["punctuation", "}"] + ]], + ["string", " interpolation\""] + ]] + ]], + ["punctuation", "}"] + ]], + ["string", "\r\n\"\"\""] + ]] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/tsx/issue2594.test b/tests/languages/tsx/issue2594.test new file mode 100644 index 0000000000..e0540febdd --- /dev/null +++ b/tests/languages/tsx/issue2594.test @@ -0,0 +1,242 @@ +function Add1(a, b) { return
    a + b
    } + +type Bar = Foo; + +function Add2(a, b) { return
    a + b
    } + +function handleSubmit(event: FormEvent) { + event.preventDefault(); +} + +function handleChange(event: ChangeEvent) { + console.log(event.target.value); +} + +function handleClick(event: MouseEvent) { + console.log(event.button); +} + +export default function Form() { + return ( +
    + + +
    + ); +} + +---------------------------------------------------- + +[ + ["keyword", "function"], + ["function", "Add1"], + ["punctuation", "("], + "a", + ["punctuation", ","], + " b", + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "return"], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["plain-text", "a + b"], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["punctuation", "}"], + + ["keyword", "type"], + ["class-name", ["Bar"]], + ["operator", "="], + " Foo", + ["operator", "<"], + ["builtin", "string"], + ["operator", ">"], + ["punctuation", ";"], + + ["keyword", "function"], + ["function", "Add2"], + ["punctuation", "("], + "a", + ["punctuation", ","], + " b", + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "return"], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["plain-text", "a + b"], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["punctuation", "}"], + + ["keyword", "function"], + ["function", "handleSubmit"], + ["punctuation", "("], + "event", + ["operator", ":"], + " FormEvent", + ["operator", "<"], + "HTMLFormElement", + ["operator", ">"], + ["punctuation", ")"], + ["punctuation", "{"], + + "\r\n event", + ["punctuation", "."], + ["function", "preventDefault"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "function"], + ["function", "handleChange"], + ["punctuation", "("], + "event", + ["operator", ":"], + " ChangeEvent", + ["operator", "<"], + "HTMLInputElement", + ["operator", ">"], + ["punctuation", ")"], + ["punctuation", "{"], + + ["builtin", "console"], + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "event", + ["punctuation", "."], + "target", + ["punctuation", "."], + "value", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "function"], + ["function", "handleClick"], + ["punctuation", "("], + "event", + ["operator", ":"], + " MouseEvent", + ["punctuation", ")"], + ["punctuation", "{"], + + ["builtin", "console"], + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "event", + ["punctuation", "."], + "button", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "export"], + ["keyword", "default"], + ["keyword", "function"], + ["function", "Form"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["punctuation", "("], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "form" + ]], + ["attr-name", ["onSubmit"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "handleSubmit", + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["plain-text", "\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "input" + ]], + ["attr-name", ["onChange"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "handleChange", + ["punctuation", "}"] + ]], + ["attr-name", ["placeholder"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "Name", + ["punctuation", "\""] + ]], + ["punctuation", "/>"] + ]], + ["plain-text", "\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "button" + ]], + ["attr-name", ["onClick"]], + ["script", [ + ["script-punctuation", "="], + ["punctuation", "{"], + "handleClick", + ["punctuation", "}"] + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["plain-text", "\r\n "], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/tsx/issue3089.test b/tests/languages/tsx/issue3089.test new file mode 100644 index 0000000000..02c2e728bb --- /dev/null +++ b/tests/languages/tsx/issue3089.test @@ -0,0 +1,31 @@ +// react tsx +function log(msg: string): void { + console.log(msg); +} + +---------------------------------------------------- + +[ + ["comment", "// react tsx"], + + ["keyword", "function"], + ["function", "log"], + ["punctuation", "("], + "msg", + ["operator", ":"], + ["builtin", "string"], + ["punctuation", ")"], + ["operator", ":"], + ["keyword", "void"], + ["punctuation", "{"], + + ["builtin", "console"], + ["punctuation", "."], + ["function", "log"], + ["punctuation", "("], + "msg", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/tsx/tag_feature.test b/tests/languages/tsx/tag_feature.test index 97e8e7127a..3008a30eea 100644 --- a/tests/languages/tsx/tag_feature.test +++ b/tests/languages/tsx/tag_feature.test @@ -40,14 +40,15 @@ class Test extends Component { ]], ["attr-name", ["someProperty"]], ["script", [ - ["script-punctuation", "="], - ["punctuation", "{"], - ["boolean", "true"], - ["punctuation", "}"] + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["punctuation", "}"] ]], ["punctuation", "/>"] ]], ["punctuation", ";"], + ["tag", [ ["tag", [ ["punctuation", "<"], @@ -55,8 +56,8 @@ class Test extends Component { ]], ["spread", [ ["punctuation", "{"], - ["punctuation", "..."], - ["attr-value", "foo"], + ["operator", "..."], + "foo", ["punctuation", "}"] ]], ["punctuation", "/>"] @@ -69,10 +70,10 @@ class Test extends Component { ]], ["attr-name", ["leaf"]], ["script", [ - ["script-punctuation", "="], - ["punctuation", "{"], - ["boolean", "true"], - ["punctuation", "}"] + ["script-punctuation", "="], + ["punctuation", "{"], + ["boolean", "true"], + ["punctuation", "}"] ]], ["punctuation", ">"] ]], @@ -84,16 +85,18 @@ class Test extends Component { ["punctuation", ">"] ]], - ["keyword", "class"], + ["keyword", "class"], ["class-name", ["Test"]], ["keyword", "extends"], ["class-name", ["Component"]], ["punctuation", "{"], + ["function", "render"], ["punctuation", "("], ["punctuation", ")"], ["punctuation", "{"], - ["keyword","return"], + + ["keyword", "return"], ["tag", [ ["tag", [ ["punctuation", "<"], @@ -119,8 +122,10 @@ class Test extends Component { ["punctuation", ">"] ]], ["punctuation", ";"], + ["punctuation", "}"], - ["punctuation","}"] + + ["punctuation", "}"] ] ---------------------------------------------------- diff --git a/tests/languages/twig+pug/twig_inclusion.test b/tests/languages/twig+pug/twig_inclusion.test index 90f32d1452..8066230fa9 100644 --- a/tests/languages/twig+pug/twig_inclusion.test +++ b/tests/languages/twig+pug/twig_inclusion.test @@ -5,15 +5,15 @@ [ ["filter-atpl", [ - ["filter-name", ":atpl"], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["number", "42"], - ["rd", [["punctuation", "}}"]]] - ]] + ["filter-name", ":atpl"], + ["text", [ + ["delimiter", "{{"], + ["number", "42"], + ["delimiter", "}}"] + ]] ]] ] ---------------------------------------------------- -Checks for atpl filter (Twig) in Jade. \ No newline at end of file +Checks for atpl filter (Twig) in pug. diff --git a/tests/languages/twig/boolean_feature.test b/tests/languages/twig/boolean_feature.test index 01bb17279b..0637abfefb 100644 --- a/tests/languages/twig/boolean_feature.test +++ b/tests/languages/twig/boolean_feature.test @@ -5,23 +5,23 @@ ---------------------------------------------------- [ - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["boolean", "null"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{-"]]], + ["twig", [ + ["delimiter", "{{-"], ["boolean", "true"], - ["rd", [["punctuation", "-}}"]]] + ["delimiter", "-}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["boolean", "false"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]] ] ---------------------------------------------------- -Checks for booleans and null. \ No newline at end of file +Checks for booleans and null. diff --git a/tests/languages/twig/comment_feature.test b/tests/languages/twig/comment_feature.test index 41c2cf774a..264112e7a3 100644 --- a/tests/languages/twig/comment_feature.test +++ b/tests/languages/twig/comment_feature.test @@ -6,11 +6,17 @@ bar #} ---------------------------------------------------- [ - ["comment", "{##}"], - ["comment", "{# foo #}"], - ["comment", "{# foo\r\nbar #}"] + ["twig", [ + ["comment", "{##}"] + ]], + ["twig", [ + ["comment", "{# foo #}"] + ]], + ["twig", [ + ["comment", "{# foo\r\nbar #}"] + ]] ] ---------------------------------------------------- -Checks for comments. \ No newline at end of file +Checks for comments. diff --git a/tests/languages/twig/keyword_feature.test b/tests/languages/twig/keyword_feature.test index 19a1229cd5..fe2c0c4c5f 100644 --- a/tests/languages/twig/keyword_feature.test +++ b/tests/languages/twig/keyword_feature.test @@ -6,48 +6,63 @@ ---------------------------------------------------- [ - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "for"]]], - ["property", "foo"], - ["operator", "in"], ["property", "bar"], - ["keyword", "if"], ["property", "baz"], - ["rd", [["punctuation", "%}"]]] + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "for"], + " foo ", + ["operator", "in"], + " bar ", + ["keyword", "if"], + " baz ", + ["delimiter", "%}"] ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "endfor"]]], - ["rd", [["punctuation", "%}"]]] + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "endfor"], + ["delimiter", "%}"] ]], - ["tag", [ - ["ld", [["punctuation", "{%-"], ["keyword", "if"]]], - ["property", "foo"], ["punctuation", "("], ["punctuation", ")"], - ["rd", [["punctuation", "-%}"]]] + + ["twig", [ + ["delimiter", "{%-"], + ["tag-name", "if"], + " foo", + ["punctuation", "("], + ["punctuation", ")"], + ["delimiter", "-%}"] ]], - ["tag", [ - ["ld", [["punctuation", "{%-"], ["keyword", "endif"]]], - ["rd", [["punctuation", "-%}"]]] + ["twig", [ + ["delimiter", "{%-"], + ["tag-name", "endif"], + ["delimiter", "-%}"] ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "macro"]]], - ["property", "foobar"], ["punctuation", "("], ["punctuation", ")"], - ["rd", [["punctuation", "%}"]]] + + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "macro"], + " foobar", + ["punctuation", "("], + ["punctuation", ")"], + ["delimiter", "%}"] ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "endmacro"]]], - ["rd", [["punctuation", "%}"]]] + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "endmacro"], + ["delimiter", "%}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "foo"], + + ["twig", [ + ["delimiter", "{{"], + " foo ", ["operator", "is"], ["keyword", "even"], ["operator", "or"], - ["property", "bar"], + " bar ", ["operator", "is"], ["keyword", "odd"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]] ] ---------------------------------------------------- -Checks for keywords. \ No newline at end of file +Checks for keywords. diff --git a/tests/languages/twig/markup_feature.test b/tests/languages/twig/markup_feature.test new file mode 100644 index 0000000000..94d8f2273a --- /dev/null +++ b/tests/languages/twig/markup_feature.test @@ -0,0 +1,200 @@ + + + + My Webpage + + + + +

    My Webpage

    + {{ a_variable }} + + + +---------------------------------------------------- + +[ + ["doctype", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "html" + ]], + ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "head" + ]], + ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "title" + ]], + ["punctuation", ">"] + ]], + "My Webpage", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "body" + ]], + ["punctuation", ">"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "ul" + ]], + ["attr-name", ["id"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + "navigation", + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "for"], + " item ", + ["operator", "in"], + " navigation ", + ["delimiter", "%}"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "li" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "a" + ]], + ["attr-name", ["href"]], + ["attr-value", [ + ["punctuation", "="], + ["punctuation", "\""], + ["twig", [ + ["delimiter", "{{"], + " item", + ["punctuation", "."], + "href ", + ["delimiter", "}}"] + ]], + ["punctuation", "\""] + ]], + ["punctuation", ">"] + ]], + ["twig", [ + ["delimiter", "{{"], + " item", + ["punctuation", "."], + "caption ", + ["delimiter", "}}"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "endfor"], + ["delimiter", "%}"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "h1" + ]], + ["punctuation", ">"] + ]], + "My Webpage", + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["twig", [ + ["delimiter", "{{"], + " a_variable ", + ["delimiter", "}}"] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]], + + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] +] diff --git a/tests/languages/twig/number_feature.test b/tests/languages/twig/number_feature.test index 4ac5271049..2746d5cbd6 100644 --- a/tests/languages/twig/number_feature.test +++ b/tests/languages/twig/number_feature.test @@ -8,38 +8,38 @@ ---------------------------------------------------- [ - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["number", "0xBadFace"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["number", "42"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["number", "3.14159"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["number", "3e15"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["number", "4.5E-4"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], + ["twig", [ + ["delimiter", "{{"], ["number", "0.2e+8"], - ["rd", [["punctuation", "}}"]]] + ["delimiter", "}}"] ]] ] ---------------------------------------------------- -Checks for hexadecimal and decimal numbers. \ No newline at end of file +Checks for hexadecimal and decimal numbers. diff --git a/tests/languages/twig/operator_feature.test b/tests/languages/twig/operator_feature.test index 1d924df397..84e47b787a 100644 --- a/tests/languages/twig/operator_feature.test +++ b/tests/languages/twig/operator_feature.test @@ -28,152 +28,225 @@ ---------------------------------------------------- [ - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "set"]]], - ["property", "a"], ["operator", "="], ["number", "4"], - ["rd", [["punctuation", "%}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "a"], ["operator", "=="], ["number", "4"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "b"], ["operator", "!="], ["property", "c"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "c"], ["operator", "<"], ["property", "d"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "d"], ["operator", "<="], ["property", "e"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "e"], ["operator", ">"], ["property", "f"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "f"], ["operator", ">="], ["property", "g"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "g"], ["operator", "+"], ["property", "h"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "h"], ["operator", "-"], ["property", "i"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "i"], ["operator", "~"], ["property", "j"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "j"], ["operator", "*"], ["property", "k"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "k"], ["operator", "**"], ["property", "l"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "l"], ["operator", "/"], ["property", "m"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "m"], ["operator", "//"], ["property", "n"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "n"], ["operator", "%"], ["property", "o"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "o"], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "set"], + " a ", + ["operator", "="], + ["number", "4"], + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " a ", + ["operator", "=="], + ["number", "4"], + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " b ", + ["operator", "!="], + " c ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " c ", + ["operator", "<"], + " d ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " d ", + ["operator", "<="], + " e ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " e ", + ["operator", ">"], + " f ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " f ", + ["operator", ">="], + " g ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " g ", + ["operator", "+"], + " h ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " h ", + ["operator", "-"], + " i ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " i ", + ["operator", "~"], + " j ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " j ", + ["operator", "*"], + " k ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " k ", + ["operator", "**"], + " l ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " l ", + ["operator", "/"], + " m ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " m ", + ["operator", "//"], + " n ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " n ", + ["operator", "%"], + " o ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " o", ["operator", "|"], - ["property", "default"], + "default", ["punctuation", "("], - ["string", [["punctuation", "'"], "foo", ["punctuation", "'"]]], + ["string", [ + ["punctuation", "'"], + "foo", + ["punctuation", "'"] + ]], ["punctuation", ")"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "p"], ["operator", "?"], - ["property", "q"], ["punctuation", ":"], - ["property", "r"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["property", "s"], ["operator", "?:"], ["property", "t"], - ["rd", [["punctuation", "}}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "if"]]], - ["property", "a"], ["operator", "and"], ["property", "b"], - ["operator", "or"], ["operator", "not"], ["property", "c"], - ["rd", [["punctuation", "%}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "for"]]], - ["property", "p"], ["operator", "in"], ["property", "foo"], - ["rd", [["punctuation", "%}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "if"]]], - ["property", "d"], ["operator", "b-and"], - ["property", "e"], ["operator", "and"], - ["property", "f"], ["operator", "b-xor"], - ["property", "g"], ["operator", "or"], - ["property", "h"], ["operator", "b-or"], - ["property", "i"], - ["rd", [["punctuation", "%}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "if"]]], - ["property", "j"], - ["operator", "starts with"], - ["string", [["punctuation", "'"], "h", ["punctuation", "'"]]], - ["rd", [["punctuation", "%}"]]] + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " p ", + ["operator", "?"], + " q ", + ["punctuation", ":"], + " r ", + ["delimiter", "}}"] + ]], + ["twig", [ + ["delimiter", "{{"], + " s ", + ["operator", "?:"], + " t ", + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "if"]]], - ["property", "i"], + + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "if"], + " a ", + ["operator", "and"], + " b ", + ["operator", "or"], + ["operator", "not"], + " c ", + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "for"], + " p ", + ["operator", "in"], + " foo ", + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "if"], + " d ", + ["operator", "b-and"], + " e ", + ["operator", "and"], + " f ", + ["operator", "b-xor"], + " g ", + ["operator", "or"], + " h ", + ["operator", "b-or"], + " i ", + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "if"], + " j ", + ["operator", "starts with"], + ["string", [ + ["punctuation", "'"], + "h", + ["punctuation", "'"] + ]], + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "if"], + " i ", ["operator", "ends with"], - ["string", [["punctuation", "'"], "j", ["punctuation", "'"]]], - ["rd", [["punctuation", "%}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "if"]]], - ["property", "k"], ["operator", "is"], - ["operator", "same as"], ["boolean", "false"], - ["rd", [["punctuation", "%}"]]] - ]], - ["tag", [ - ["ld", [["punctuation", "{%"], ["keyword", "if"]]], - ["property", "l"], ["operator", "matches"], - ["string", [["punctuation", "'"], "/f[o]{2,}(?:bar)?", ["punctuation", "'"]]], - ["rd", [["punctuation", "%}"]]] + ["string", [ + ["punctuation", "'"], + "j", + ["punctuation", "'"] + ]], + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "if"], + " k ", + ["operator", "is"], + ["operator", "same as"], + ["boolean", "false"], + ["delimiter", "%}"] + ]], + ["twig", [ + ["delimiter", "{%"], + ["tag-name", "if"], + " l ", + ["operator", "matches"], + ["string", [ + ["punctuation", "'"], + "/f[o]{2,}(?:bar)?", + ["punctuation", "'"] + ]], + ["delimiter", "%}"] ]] ] ---------------------------------------------------- -Checks for operators. \ No newline at end of file +Checks for operators. diff --git a/tests/languages/twig/string_feature.test b/tests/languages/twig/string_feature.test index ab108d02e0..0017a83662 100644 --- a/tests/languages/twig/string_feature.test +++ b/tests/languages/twig/string_feature.test @@ -6,28 +6,42 @@ ---------------------------------------------------- [ - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["string", [["punctuation", "'"], ["punctuation", "'"]]], - ["rd", [["punctuation", "}}"]]] + ["twig", [ + ["delimiter", "{{"], + ["string", [ + ["punctuation", "'"], + ["punctuation", "'"] + ]], + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["string", [["punctuation", "\""], ["punctuation", "\""]]], - ["rd", [["punctuation", "}}"]]] + ["twig", [ + ["delimiter", "{{"], + ["string", [ + ["punctuation", "\""], + ["punctuation", "\""] + ]], + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["string", [["punctuation", "\""], "ba\\\"r", ["punctuation", "\""]]], - ["rd", [["punctuation", "}}"]]] + ["twig", [ + ["delimiter", "{{"], + ["string", [ + ["punctuation", "\""], + "ba\\\"r", + ["punctuation", "\""] + ]], + ["delimiter", "}}"] ]], - ["tag", [ - ["ld", [["punctuation", "{{"]]], - ["string", [["punctuation", "'"], "ba\\'z", ["punctuation", "'"]]], - ["rd", [["punctuation", "}}"]]] + ["twig", [ + ["delimiter", "{{"], + ["string", [ + ["punctuation", "'"], + "ba\\'z", + ["punctuation", "'"] + ]], + ["delimiter", "}}"] ]] ] ---------------------------------------------------- -Checks for strings. \ No newline at end of file +Checks for strings. diff --git a/tests/languages/typescript/decorator_feature.test b/tests/languages/typescript/decorator_feature.test new file mode 100644 index 0000000000..9fc7975792 --- /dev/null +++ b/tests/languages/typescript/decorator_feature.test @@ -0,0 +1,121 @@ +@f @g x + +@f +@g +x + +@sealed +class ExampleClass { + + @first() + @second() + method() {} + + @enumerable(false) + greet() { + return "Hello, " + this.greeting; + } + + @configurable(false) + get y() { + return this._y; + } + +} + +---------------------------------------------------- + +[ + ["decorator", [ + ["at", "@"], + ["function", "f"] + ]], + ["decorator", [ + ["at", "@"], + ["function", "g"] + ]], + " x\r\n\r\n", + + ["decorator", [ + ["at", "@"], + ["function", "f"] + ]], + ["decorator", [ + ["at", "@"], + ["function", "g"] + ]], + "\r\nx\r\n\r\n", + + ["decorator", [ + ["at", "@"], + ["function", "sealed"] + ]], + ["keyword", "class"], ["class-name", ["ExampleClass"]], ["punctuation", "{"], + + ["decorator", [ + ["at", "@"], + ["function", "first"] + ]], + ["punctuation", "("], + ["punctuation", ")"], + + ["decorator", [ + ["at", "@"], + ["function", "second"] + ]], + ["punctuation", "("], + ["punctuation", ")"], + + ["function", "method"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["decorator", [ + ["at", "@"], + ["function", "enumerable"] + ]], + ["punctuation", "("], + ["boolean", "false"], + ["punctuation", ")"], + + ["function", "greet"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["string", "\"Hello, \""], + ["operator", "+"], + ["keyword", "this"], + ["punctuation", "."], + "greeting", + ["punctuation", ";"], + + ["punctuation", "}"], + + ["decorator", [ + ["at", "@"], + ["function", "configurable"] + ]], + ["punctuation", "("], + ["boolean", "false"], + ["punctuation", ")"], + + ["keyword", "get"], + ["function", "y"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["keyword", "this"], + ["punctuation", "."], + "_y", + ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/typescript/issue2819.test b/tests/languages/typescript/issue2819.test new file mode 100644 index 0000000000..a2fd061dfc --- /dev/null +++ b/tests/languages/typescript/issue2819.test @@ -0,0 +1,38 @@ +@Component({ + selector: 'my-app', + template: `
    Hello World!
    ` +}) +export class AppComponent {} + +---------------------------------------------------- + +[ + ["decorator", [ + ["at", "@"], + ["function", "Component"] + ]], + ["punctuation", "("], + ["punctuation", "{"], + + "\r\n selector", + ["operator", ":"], + ["string", "'my-app'"], + ["punctuation", ","], + + "\r\n template", + ["operator", ":"], + ["template-string", [ + ["template-punctuation", "`"], + ["string", "
    Hello World!
    "], + ["template-punctuation", "`"] + ]], + + ["punctuation", "}"], + ["punctuation", ")"], + + ["keyword", "export"], + ["keyword", "class"], + ["class-name", ["AppComponent"]], + ["punctuation", "{"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/typescript/issue2860.test b/tests/languages/typescript/issue2860.test new file mode 100644 index 0000000000..b0805c2293 --- /dev/null +++ b/tests/languages/typescript/issue2860.test @@ -0,0 +1,37 @@ +export interface R { + data: T; + total: number; + type?: string; +} + +---------------------------------------------------- + +[ + ["keyword", "export"], + ["keyword", "interface"], + ["class-name", [ + ["constant", "R"], + ["operator", "<"], + ["constant", "T"], + ["operator", ">"] + ]], + ["punctuation", "{"], + + "\r\n data", + ["operator", ":"], + ["constant", "T"], + ["punctuation", ";"], + + "\r\n total", + ["operator", ":"], + ["builtin", "number"], + ["punctuation", ";"], + + "\r\n type", + ["operator", "?"], + ["operator", ":"], + ["builtin", "string"], + ["punctuation", ";"], + + ["punctuation", "}"] +] diff --git a/tests/languages/typescript/issue3000.test b/tests/languages/typescript/issue3000.test new file mode 100644 index 0000000000..0617bd2ed9 --- /dev/null +++ b/tests/languages/typescript/issue3000.test @@ -0,0 +1,51 @@ +import { infer, inference, infer } from 'module' +// ~~~~~ ✅ + +import { type, typeDefs, type } from 'module' +// ~~~~ ✅ + +import { const, constants, const } from 'module' +// ~~~~~ ✅ + +---------------------------------------------------- + +[ + ["keyword", "import"], + ["punctuation", "{"], + " infer", + ["punctuation", ","], + " inference", + ["punctuation", ","], + " infer ", + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'module'"], + + ["comment", "// ~~~~~ ✅"], + + ["keyword", "import"], + ["punctuation", "{"], + " type", + ["punctuation", ","], + " typeDefs", + ["punctuation", ","], + " type ", + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'module'"], + + ["comment", "// ~~~~ ✅"], + + ["keyword", "import"], + ["punctuation", "{"], + ["keyword", "const"], + ["punctuation", ","], + " constants", + ["punctuation", ","], + ["keyword", "const"], + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'module'"], + + ["comment", "// ~~~~~ ✅"] +] diff --git a/tests/languages/typescript/keyword_feature.test b/tests/languages/typescript/keyword_feature.test index f877e094e3..181f1d06e8 100644 --- a/tests/languages/typescript/keyword_feature.test +++ b/tests/languages/typescript/keyword_feature.test @@ -1,131 +1,283 @@ -abstract -as -asserts -async -await -break -case -catch +as; +await; +break; +case; class; -const -constructor -continue -debugger -declare -default -delete -do -else -enum -export +const; +continue; +debugger; +default; +delete; +do; +else; +enum; +export; extends; -finally -for -from -function -get -if +for; +if; implements; -import -in +import; +in; instanceof; interface; -is -keyof -let -module -namespace +let; new; -null -of -package -private -protected -public -readonly -return -require -set -static -super -switch -this -throw -try -type; -typeof -undefined -var -void -while -with -yield +null; +of; +package; +private; +protected; +public; +return; +static; +super; +switch; +this; +throw; +try; +typeof; +undefined; +var; +void; +while; +with; +yield; + +// contextual keywords + +try {} catch {} finally {} +try {} catch (e) {} finally {} +async function (){} +async a => {} +async (a,b,c) => {} +import {} from "foo" +import {} from 'foo' +class { get foo(){} set baz(){} get [value](){} } + +// variables, not keywords + +const { async, from, to } = bar; +promise.catch(foo).finally(bar); + +// TypeScript keywords + +abstract; +as; +declare; +implements; +is; +keyof; +readonly; +require; + +// contextual keywords + +asserts foo; +infer foo; +interface foo; +module foo; +namespace foo; +type foo; + +import type { Component } from "react"; +import type *, {} ---------------------------------------------------- [ - ["keyword", "abstract"], - ["keyword", "as"], - ["keyword", "asserts"], - ["keyword", "async"], - ["keyword", "await"], - ["keyword", "break"], - ["keyword", "case"], - ["keyword", "catch"], + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "await"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "case"], ["punctuation", ";"], ["keyword", "class"], ["punctuation", ";"], - ["keyword", "const"], - ["keyword", "constructor"], - ["keyword", "continue"], - ["keyword", "debugger"], - ["keyword", "declare"], - ["keyword", "default"], - ["keyword", "delete"], - ["keyword", "do"], - ["keyword", "else"], - ["keyword", "enum"], - ["keyword", "export"], + ["keyword", "const"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "debugger"], ["punctuation", ";"], + ["keyword", "default"], ["punctuation", ";"], + ["keyword", "delete"], ["punctuation", ";"], + ["keyword", "do"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "export"], ["punctuation", ";"], ["keyword", "extends"], ["punctuation", ";"], - ["keyword", "finally"], - ["keyword", "for"], - ["keyword", "from"], - ["keyword", "function"], - ["keyword", "get"], - ["keyword", "if"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], ["keyword", "implements"], ["punctuation", ";"], - ["keyword", "import"], - ["keyword", "in"], + ["keyword", "import"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], ["keyword", "instanceof"], ["punctuation", ";"], ["keyword", "interface"], ["punctuation", ";"], - ["keyword", "is"], - ["keyword", "keyof"], - ["keyword", "let"], - ["keyword", "module"], - ["keyword", "namespace"], + ["keyword", "let"], ["punctuation", ";"], ["keyword", "new"], ["punctuation", ";"], - ["keyword", "null"], - ["keyword", "of"], - ["keyword", "package"], - ["keyword", "private"], - ["keyword", "protected"], - ["keyword", "public"], - ["keyword", "readonly"], - ["keyword", "return"], - ["keyword", "require"], - ["keyword", "set"], - ["keyword", "static"], - ["keyword", "super"], - ["keyword", "switch"], - ["keyword", "this"], - ["keyword", "throw"], + ["keyword", "null"], ["punctuation", ";"], + ["keyword", "of"], ["punctuation", ";"], + ["keyword", "package"], ["punctuation", ";"], + ["keyword", "private"], ["punctuation", ";"], + ["keyword", "protected"], ["punctuation", ";"], + ["keyword", "public"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "super"], ["punctuation", ";"], + ["keyword", "switch"], ["punctuation", ";"], + ["keyword", "this"], ["punctuation", ";"], + ["keyword", "throw"], ["punctuation", ";"], + ["keyword", "try"], ["punctuation", ";"], + ["keyword", "typeof"], ["punctuation", ";"], + ["keyword", "undefined"], ["punctuation", ";"], + ["keyword", "var"], ["punctuation", ";"], + ["keyword", "void"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + ["keyword", "with"], ["punctuation", ";"], + ["keyword", "yield"], ["punctuation", ";"], + + ["comment", "// contextual keywords"], + + ["keyword", "try"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "catch"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "finally"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "try"], - ["keyword", "type"], ["punctuation", ";"], - ["keyword", "typeof"], - ["keyword", "undefined"], - ["keyword", "var"], - ["keyword", "void"], - ["keyword", "while"], - ["keyword", "with"], - ["keyword", "yield"] + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "catch"], + ["punctuation", "("], + "e", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "finally"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "async"], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "async"], + " a ", + ["operator", "=>"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "async"], + ["punctuation", "("], + "a", + ["punctuation", ","], + "b", + ["punctuation", ","], + "c", + ["punctuation", ")"], + ["operator", "=>"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "import"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "from"], + ["string", "\"foo\""], + + ["keyword", "import"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "from"], + ["string", "'foo'"], + + ["keyword", "class"], + ["punctuation", "{"], + ["keyword", "get"], + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "set"], + ["function", "baz"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "get"], + ["punctuation", "["], + "value", + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "}"], + + ["comment", "// variables, not keywords"], + + ["keyword", "const"], + ["punctuation", "{"], + " async", + ["punctuation", ","], + " from", + ["punctuation", ","], + " to ", + ["punctuation", "}"], + ["operator", "="], + " bar", + ["punctuation", ";"], + + "\r\npromise", + ["punctuation", "."], + ["function", "catch"], + ["punctuation", "("], + "foo", + ["punctuation", ")"], + ["punctuation", "."], + ["function", "finally"], + ["punctuation", "("], + "bar", + ["punctuation", ")"], + ["punctuation", ";"], + + ["comment", "// TypeScript keywords"], + + ["keyword", "abstract"], ["punctuation", ";"], + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "declare"], ["punctuation", ";"], + ["keyword", "implements"], ["punctuation", ";"], + ["keyword", "is"], ["punctuation", ";"], + ["keyword", "keyof"], ["punctuation", ";"], + ["keyword", "readonly"], ["punctuation", ";"], + ["keyword", "require"], ["punctuation", ";"], + + ["comment", "// contextual keywords"], + + ["keyword", "asserts"], " foo", ["punctuation", ";"], + ["keyword", "infer"], " foo", ["punctuation", ";"], + ["keyword", "interface"], ["class-name", ["foo"]], ["punctuation", ";"], + ["keyword", "module"], " foo", ["punctuation", ";"], + ["keyword", "namespace"], " foo", ["punctuation", ";"], + ["keyword", "type"], ["class-name", ["foo"]], ["punctuation", ";"], + + ["keyword", "import"], + ["keyword", "type"], + ["punctuation", "{"], + " Component ", + ["punctuation", "}"], + ["keyword", "from"], + ["string", "\"react\""], + ["punctuation", ";"], + + ["keyword", "import"], + ["keyword", "type"], + ["operator", "*"], + ["punctuation", ","], + ["punctuation", "{"], + ["punctuation", "}"] ] ---------------------------------------------------- diff --git a/tests/languages/typoscript/comment_feature.test b/tests/languages/typoscript/comment_feature.test new file mode 100644 index 0000000000..6f0529c63c --- /dev/null +++ b/tests/languages/typoscript/comment_feature.test @@ -0,0 +1,23 @@ +// comment +# comment +text // comment +/* +comment +*/ +foo = bar // comment +baz = //url + +---------------------------------------------------- + +[ + ["comment", "// comment"], + ["comment", "# comment"], + ["tag", ["text"]], ["comment", "// comment"], + ["comment", "/*\r\ncomment\r\n*/"], + ["tag", ["foo"]], ["operator", "="], ["string", ["bar "]], ["comment", "// comment"], + ["tag", ["baz"]], ["operator", "="], ["string", ["//url"]] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/typoscript/function_feature.test b/tests/languages/typoscript/function_feature.test new file mode 100644 index 0000000000..bfa58dd9a8 --- /dev/null +++ b/tests/languages/typoscript/function_feature.test @@ -0,0 +1,15 @@ +@import 'foo' +@import "bar" + + +---------------------------------------------------- + +[ + ["function", ["@import ", ["string", "'foo'"]]], + ["function", ["@import ", ["string", "\"bar\""]]], + ["function", ["<", ["keyword", "INCLUDE_TYPOSCRIPT"], ": source=", ["string", ["\"", ["keyword", "FILE"], ":", ["keyword", "EXT"], ":baz.typoscript\""]], ">"]] +] + +---------------------------------------------------- + +Checks for import functions. diff --git a/tests/languages/typoscript/keyword_feature.test b/tests/languages/typoscript/keyword_feature.test new file mode 100644 index 0000000000..c1bb30be2a --- /dev/null +++ b/tests/languages/typoscript/keyword_feature.test @@ -0,0 +1,69 @@ +TEXT LLL EXT _GIFBUILDER CARRAY CASE CLEARGIF COA COA_INT CONSTANTS CONTENT +EDITPANEL EFFECT FILE FORM FRAME FRAMESET FLUIDTEMPLATE GIFBUILDER +global globalString globalVar GMENU GMENU_FOLDOUT GMENU_LAYERS GP +HMENU HRULER HTML IENV IMAGE IMG_RESOURCE IMGMENU IMGMENUITEM IMGTEXT +JSMENU JSMENUITEM LOAD_REGISTER PAGE RECORDS RESTORE_REGISTER TEMPLATE +TMENU TMENU_LAYERS TMENUITEM USER USER_INT INCLUDE_TYPOSCRIPT NO ACT +IFSUB ACTIFSUB CUR + +---------------------------------------------------- + +[ + ["keyword", "TEXT"], + ["keyword", "LLL"], + ["keyword", "EXT"], + ["keyword", "_GIFBUILDER"], + ["keyword", "CARRAY"], + ["keyword", "CASE"], + ["keyword", "CLEARGIF"], + ["keyword", "COA"], + ["keyword", "COA_INT"], + ["keyword", "CONSTANTS"], + ["keyword", "CONTENT"], + ["keyword", "EDITPANEL"], + ["keyword", "EFFECT"], + ["keyword", "FILE"], + ["keyword", "FORM"], + ["keyword", "FRAME"], + ["keyword", "FRAMESET"], + ["keyword", "FLUIDTEMPLATE"], + ["keyword", "GIFBUILDER"], + ["keyword", "global"], + ["keyword", "globalString"], + ["keyword", "globalVar"], + ["keyword", "GMENU"], + ["keyword", "GMENU_FOLDOUT"], + ["keyword", "GMENU_LAYERS"], + ["keyword", "GP"], + ["keyword", "HMENU"], + ["keyword", "HRULER"], + ["keyword", "HTML"], + ["keyword", "IENV"], + ["keyword", "IMAGE"], + ["keyword", "IMG_RESOURCE"], + ["keyword", "IMGMENU"], + ["keyword", "IMGMENUITEM"], + ["keyword", "IMGTEXT"], + ["keyword", "JSMENU"], + ["keyword", "JSMENUITEM"], + ["keyword", "LOAD_REGISTER"], + ["keyword", "PAGE"], + ["keyword", "RECORDS"], + ["keyword", "RESTORE_REGISTER"], + ["keyword", "TEMPLATE"], + ["keyword", "TMENU"], + ["keyword", "TMENU_LAYERS"], + ["keyword", "TMENUITEM"], + ["keyword", "USER"], + ["keyword", "USER_INT"], + ["keyword", "INCLUDE_TYPOSCRIPT"], + ["keyword", "NO"], + ["keyword", "ACT"], + ["keyword", "IFSUB"], + ["keyword", "ACTIFSUB"], + ["keyword", "CUR"] +] + +---------------------------------------------------- + +Checks for all keywords. diff --git a/tests/languages/typoscript/number_feature.test b/tests/languages/typoscript/number_feature.test new file mode 100644 index 0000000000..4b2c30f26a --- /dev/null +++ b/tests/languages/typoscript/number_feature.test @@ -0,0 +1,15 @@ +foo = 423 +bar=1 +baz.10 = + +---------------------------------------------------- + +[ + ["tag", ["foo"]], ["operator", "="], ["string", [["number", "423"]]], + ["tag", ["bar"]], ["operator", "="], ["string", [["number", "1"]]], + ["tag", ["baz", ["punctuation", "."]]],["number", ["10 ", ["operator", "="]]], ["string", []] +] + +---------------------------------------------------- + +Checks for import functions. diff --git a/tests/languages/typoscript/tag_string_feature.test b/tests/languages/typoscript/tag_string_feature.test new file mode 100644 index 0000000000..17b1eec10e --- /dev/null +++ b/tests/languages/typoscript/tag_string_feature.test @@ -0,0 +1,37 @@ +foo.bar.baz = HMENU +foo.bar.baz { + baz.foo = bar + bar = {$const.foo} + foo = LLL:EXT:str + IFSUB < .NO + IFSUB = 1 + IFSUB { + foo = bar + } +} +Namespace\Classes\Test { + baz.foo = bar +} + +---------------------------------------------------- + +[ + ["tag", ["foo",["punctuation", "."]]], ["tag", ["bar", ["punctuation", "."]]],["tag", ["baz"]], ["operator", "="], ["string", [["keyword", "HMENU"]]], + ["tag", ["foo", ["punctuation", "."]]], ["tag", ["bar", ["punctuation", "."]]], ["tag", ["baz"]], ["punctuation", "{"], + ["tag", ["baz", ["punctuation", "."]]], ["tag", ["foo"]], ["operator", "="], ["string", ["bar"]], + ["tag", ["bar"]], ["operator", "="], ["string", [["function", "{$const.foo}"]]], + ["tag", ["foo"]],["operator", "="], ["string", [["keyword", "LLL"], ["punctuation", ":"], ["keyword", "EXT"], ["punctuation", ":"], "str"]], + ["keyword", "IFSUB"], ["operator", "<"], ["punctuation", "."],["keyword", "NO"], + ["keyword", "IFSUB"], ["operator", "="], ["string", [["number", "1"]]], + ["keyword", "IFSUB"], ["punctuation", "{"], + ["tag", ["foo"]], ["operator", "="], ["string", ["bar"]], + ["punctuation", "}"], + ["punctuation", "}"], + ["tag", ["Namespace\\Classes\\Test"]], ["punctuation", "{"], + ["tag", ["baz", ["punctuation", "."]]], ["tag", ["foo"]], ["operator", "="], ["string", ["bar"]], + ["punctuation", "}"] +] + +---------------------------------------------------- + +Checks for tags and string. diff --git a/tests/languages/unrealscript/category_feature.test b/tests/languages/unrealscript/category_feature.test new file mode 100644 index 0000000000..dd215ce82b --- /dev/null +++ b/tests/languages/unrealscript/category_feature.test @@ -0,0 +1,52 @@ +// MyBool is visible but not editable in UnrealEd +var(MyCategory) editconst bool MyBool; + +// MyBool is visible but not editable in UnrealEd and +// not changeable in script +var(MyCategory) const editconst bool MyBool; + +// MyBool is visible and can be set in UnrealEd but +// not changeable in script +var(MyCategory) const bool MyBool; + +---------------------------------------------------- + +[ + ["comment", "// MyBool is visible but not editable in UnrealEd"], + + ["keyword", "var"], + ["punctuation", "("], + ["category", "MyCategory"], + ["punctuation", ")"], + ["keyword", "editconst"], + ["keyword", "bool"], + " MyBool", + ["punctuation", ";"], + + ["comment", "// MyBool is visible but not editable in UnrealEd and"], + + ["comment", "// not changeable in script"], + + ["keyword", "var"], + ["punctuation", "("], + ["category", "MyCategory"], + ["punctuation", ")"], + ["keyword", "const"], + ["keyword", "editconst"], + ["keyword", "bool"], + " MyBool", + ["punctuation", ";"], + + ["comment", "// MyBool is visible and can be set in UnrealEd but"], + + ["comment", "// not changeable in script"], + + ["keyword", "var"], + ["punctuation", "("], + ["category", "MyCategory"], + ["punctuation", ")"], + ["keyword", "const"], + ["keyword", "bool"], + " MyBool", + ["punctuation", ";"] +] diff --git a/tests/languages/uorazor/boolean_feature.test b/tests/languages/uorazor/boolean_feature.test new file mode 100644 index 0000000000..7ff56484f9 --- /dev/null +++ b/tests/languages/uorazor/boolean_feature.test @@ -0,0 +1,13 @@ +false +true + +---------------------------------------------------- + +[ + ["boolean", "false"], + ["boolean", "true"] +] + +---------------------------------------------------- + +Checks for boolean values diff --git a/tests/languages/uorazor/breakdown_script_example_feature.test b/tests/languages/uorazor/breakdown_script_example_feature.test new file mode 100644 index 0000000000..fca19b44a0 --- /dev/null +++ b/tests/languages/uorazor/breakdown_script_example_feature.test @@ -0,0 +1,54 @@ +setvar "my_training_target" +while skill "anatomy" < 100 + useskill "anatomy" + wft 500 + target "my_training_target" + wait 2000 +endwhile + +---------------------------------------------------- + +[ + ["source-commands", "setvar"], + ["string", [ + ["punctuation", "\""], + "my_training_target", + ["punctuation", "\""] + ]], + + ["keyword", "while"], + ["function", "skill"], + ["string", [ + ["punctuation", "\""], + "anatomy", + ["punctuation", "\""] + ]], + ["operator", "<"], + ["number", "100"], + + ["source-commands", "useskill"], + ["string", [ + ["punctuation", "\""], + "anatomy", + ["punctuation", "\""] + ]], + + ["source-commands", "wft"], + ["number", "500"], + + ["source-commands", "target"], + ["string", [ + ["punctuation", "\""], + "my_training_target", + ["punctuation", "\""] + ]], + + ["source-commands", "wait"], + ["number", "2000"], + + ["keyword", "endwhile"] +] + +---------------------------------------------------- + +Checks for each type of syntax breakdown diff --git a/tests/languages/uorazor/commands_feature.test b/tests/languages/uorazor/commands_feature.test new file mode 100644 index 0000000000..85e70b05a2 --- /dev/null +++ b/tests/languages/uorazor/commands_feature.test @@ -0,0 +1,153 @@ +alliance +attack +cast +clearall +clearignore +clearjournal +clearlist +clearsysmsg +createlist +createtimer +dclick +dclicktype +dclickvar +dress +dressconfig +drop +droprelloc +emote +getlabel +guild +gumpclose +gumpresponse +hotkey +ignore +lasttarget +lift +lifttype +menu +menuresponse +msg +org +organize +organizer +overhead +pause +poplist +potion +promptresponse +pushlist +removelist +removetimer +rename +restock +say +scav +scavenger +script +setability +setlasttarget +setskill +settimer +sysmsg +targetloc +targetrelloc +targettype +undress +unignore +unsetvar +useobject +useonce +usetype +virtue +waitforgump +waitformenu +waitforprompt +waitforstat +waitforsysmsg +waitfortarget +walk +wfsysmsg +whisper +yell + +---------------------------------------------------- + +[ + ["source-commands", "alliance"], + ["source-commands", "attack"], + ["source-commands", "cast"], + ["source-commands", "clearall"], + ["source-commands", "clearignore"], + ["source-commands", "clearjournal"], + ["source-commands", "clearlist"], + ["source-commands", "clearsysmsg"], + ["source-commands", "createlist"], + ["source-commands", "createtimer"], + ["source-commands", "dclick"], + ["source-commands", "dclicktype"], + ["source-commands", "dclickvar"], + ["source-commands", "dress"], + ["source-commands", "dressconfig"], + ["source-commands", "drop"], + ["source-commands", "droprelloc"], + ["source-commands", "emote"], + ["source-commands", "getlabel"], + ["source-commands", "guild"], + ["source-commands", "gumpclose"], + ["source-commands", "gumpresponse"], + ["source-commands", "hotkey"], + ["source-commands", "ignore"], + ["source-commands", "lasttarget"], + ["source-commands", "lift"], + ["source-commands", "lifttype"], + ["source-commands", "menu"], + ["source-commands", "menuresponse"], + ["source-commands", "msg"], + ["source-commands", "org"], + ["source-commands", "organize"], + ["source-commands", "organizer"], + ["source-commands", "overhead"], + ["source-commands", "pause"], + ["source-commands", "poplist"], + ["source-commands", "potion"], + ["source-commands", "promptresponse"], + ["source-commands", "pushlist"], + ["source-commands", "removelist"], + ["source-commands", "removetimer"], + ["source-commands", "rename"], + ["source-commands", "restock"], + ["source-commands", "say"], + ["source-commands", "scav"], + ["source-commands", "scavenger"], + ["source-commands", "script"], + ["source-commands", "setability"], + ["source-commands", "setlasttarget"], + ["source-commands", "setskill"], + ["source-commands", "settimer"], + ["source-commands", "sysmsg"], + ["source-commands", "targetloc"], + ["source-commands", "targetrelloc"], + ["source-commands", "targettype"], + ["source-commands", "undress"], + ["source-commands", "unignore"], + ["source-commands", "unsetvar"], + ["source-commands", "useobject"], + ["source-commands", "useonce"], + ["source-commands", "usetype"], + ["source-commands", "virtue"], + ["source-commands", "waitforgump"], + ["source-commands", "waitformenu"], + ["source-commands", "waitforprompt"], + ["source-commands", "waitforstat"], + ["source-commands", "waitforsysmsg"], + ["source-commands", "waitfortarget"], + ["source-commands", "walk"], + ["source-commands", "wfsysmsg"], + ["source-commands", "whisper"], + ["source-commands", "yell"] +] + +---------------------------------------------------- + +Checks for commands. diff --git a/tests/languages/uorazor/comment_feature.test b/tests/languages/uorazor/comment_feature.test new file mode 100644 index 0000000000..9d69aa2b18 --- /dev/null +++ b/tests/languages/uorazor/comment_feature.test @@ -0,0 +1,13 @@ +# This is a comment +// so is this + +---------------------------------------------------- + +[ + ["comment-hash", "# This is a comment"], + ["comment-slash", "// so is this"] +] + +---------------------------------------------------- + +Checks for comments. diff --git a/tests/languages/uorazor/functions_feature.test b/tests/languages/uorazor/functions_feature.test new file mode 100644 index 0000000000..8982e15eee --- /dev/null +++ b/tests/languages/uorazor/functions_feature.test @@ -0,0 +1,74 @@ +atlist close closest count counter counttype dead dex diffhits diffmana diffstam diffweight find findbuff finddebuff findlayer findtype findtypelist followers gumpexists hidden hits hp hue human humanoid ingump inlist insysmessage insysmsg int invul lhandempty list listexists mana maxhits maxhp maxmana maxstam maxweight monster mounted name next noto paralyzed poisoned position prev previous queued rand random rhandempty skill stam str targetexists timer timerexists varexist warmode weight + +---------------------------------------------------- + +[ + ["function", "atlist"], + ["function", "close"], + ["function", "closest"], + ["function", "count"], + ["function", "counter"], + ["function", "counttype"], + ["function", "dead"], + ["function", "dex"], + ["function", "diffhits"], + ["function", "diffmana"], + ["function", "diffstam"], + ["function", "diffweight"], + ["function", "find"], + ["function", "findbuff"], + ["function", "finddebuff"], + ["function", "findlayer"], + ["function", "findtype"], + ["function", "findtypelist"], + ["function", "followers"], + ["function", "gumpexists"], + ["function", "hidden"], + ["function", "hits"], + ["function", "hp"], + ["function", "hue"], + ["function", "human"], + ["function", "humanoid"], + ["function", "ingump"], + ["function", "inlist"], + ["function", "insysmessage"], + ["function", "insysmsg"], + ["function", "int"], + ["function", "invul"], + ["function", "lhandempty"], + ["function", "list"], + ["function", "listexists"], + ["function", "mana"], + ["function", "maxhits"], + ["function", "maxhp"], + ["function", "maxmana"], + ["function", "maxstam"], + ["function", "maxweight"], + ["function", "monster"], + ["function", "mounted"], + ["function", "name"], + ["function", "next"], + ["function", "noto"], + ["function", "paralyzed"], + ["function", "poisoned"], + ["function", "position"], + ["function", "prev"], + ["function", "previous"], + ["function", "queued"], + ["function", "rand"], + ["function", "random"], + ["function", "rhandempty"], + ["function", "skill"], + ["function", "stam"], + ["function", "str"], + ["function", "targetexists"], + ["function", "timer"], + ["function", "timerexists"], + ["function", "varexist"], + ["function", "warmode"], + ["function", "weight"] +] + +---------------------------------------------------- + +Checks for functions. diff --git a/tests/languages/uorazor/keyword_feature.test b/tests/languages/uorazor/keyword_feature.test new file mode 100644 index 0000000000..0c6a20f08d --- /dev/null +++ b/tests/languages/uorazor/keyword_feature.test @@ -0,0 +1,39 @@ +and +as +break +continue +else +elseif +endfor +endif +for +if +loop +not +or +replay +stop + +---------------------------------------------------- + +[ + ["keyword", "and"], + ["keyword", "as"], + ["keyword", "break"], + ["keyword", "continue"], + ["keyword", "else"], + ["keyword", "elseif"], + ["keyword", "endfor"], + ["keyword", "endif"], + ["keyword", "for"], + ["keyword", "if"], + ["keyword", "loop"], + ["keyword", "not"], + ["keyword", "or"], + ["keyword", "replay"], + ["keyword", "stop"] +] + +---------------------------------------------------- + +Checks for keywords. diff --git a/tests/languages/uorazor/source_layers_feature.test b/tests/languages/uorazor/source_layers_feature.test new file mode 100644 index 0000000000..51d1f56057 --- /dev/null +++ b/tests/languages/uorazor/source_layers_feature.test @@ -0,0 +1,87 @@ +backpack +gloves +self +ARMS +BLUE +BRACELET +CANCEL +CLEAR +CLOAK +CRIMINAL +EARRINGS +ENEMY +FACIALHAIR +FRIEND +FRIENDLY +GRAY +GREY +GROUND +HAIR +HEAD +INNERLEGS +INNERTORSO +INNOCENT +LEFTHAND +MIDDLETORSO +MURDERER +NECK +NONFRIENDLY +ONEHANDEDSECONDARY +OUTERLEGS +OUTERTORSO +PANTS +RED +RIGHTHAND +RING +SHIRT +SHOES +TALISMAN +WAIST + +---------------------------------------------------- + +[ + ["source-layers", "backpack"], + ["source-layers", "gloves"], + ["source-layers", "self"], + ["source-layers", "ARMS"], + ["source-layers", "BLUE"], + ["source-layers", "BRACELET"], + ["source-layers", "CANCEL"], + ["source-layers", "CLEAR"], + ["source-layers", "CLOAK"], + ["source-layers", "CRIMINAL"], + ["source-layers", "EARRINGS"], + ["source-layers", "ENEMY"], + ["source-layers", "FACIALHAIR"], + ["source-layers", "FRIEND"], + ["source-layers", "FRIENDLY"], + ["source-layers", "GRAY"], + ["source-layers", "GREY"], + ["source-layers", "GROUND"], + ["source-layers", "HAIR"], + ["source-layers", "HEAD"], + ["source-layers", "INNERLEGS"], + ["source-layers", "INNERTORSO"], + ["source-layers", "INNOCENT"], + ["source-layers", "LEFTHAND"], + ["source-layers", "MIDDLETORSO"], + ["source-layers", "MURDERER"], + ["source-layers", "NECK"], + ["source-layers", "NONFRIENDLY"], + ["source-layers", "ONEHANDEDSECONDARY"], + ["source-layers", "OUTERLEGS"], + ["source-layers", "OUTERTORSO"], + ["source-layers", "PANTS"], + ["source-layers", "RED"], + ["source-layers", "RIGHTHAND"], + ["source-layers", "RING"], + ["source-layers", "SHIRT"], + ["source-layers", "SHOES"], + ["source-layers", "TALISMAN"], + ["source-layers", "WAIST"] +] + +---------------------------------------------------- + +Checks for source layers. diff --git a/tests/languages/uri/authority_feature.test b/tests/languages/uri/authority_feature.test new file mode 100644 index 0000000000..0d37c29fee --- /dev/null +++ b/tests/languages/uri/authority_feature.test @@ -0,0 +1,109 @@ +https://john.doe@www.example.com:123/forum/questions +ftp://ftp.is.co.za/rfc/rfc1808.txt +ldap://[2001:db8::7]/ +https://[v1.foo]/ +//192.0.2.16:80/ +//example.com/path/resource.txt + +---------------------------------------------------- + +[ + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["user-info-segment", [ + ["user-info", "john.doe"], + ["user-info-delimiter", "@"] + ]], + ["host", ["www.example.com"]], + ["port-segment", [ + ["port-delimiter", ":"], + ["port", "123"] + ]] + ]], + ["path", [ + ["path-separator", "/"], + "forum", + ["path-separator", "/"], + "questions" + ]], + + ["scheme", [ + "ftp", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["ftp.is.co.za"]] + ]], + ["path", [ + ["path-separator", "/"], + "rfc", + ["path-separator", "/"], + "rfc1808.txt" + ]], + + ["scheme", [ + "ldap", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", [ + ["ip-literal", [ + ["ip-literal-delimiter", "["], + ["ipv6-address", "2001:db8::7"], + ["ip-literal-delimiter", "]"] + ]] + ]] + ]], + ["path", [ + ["path-separator", "/"] + ]], + + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", [ + ["ip-literal", [ + ["ip-literal-delimiter", "["], + ["ipv-future", "v1.foo"], + ["ip-literal-delimiter", "]"] + ]] + ]] + ]], + ["path", [ + ["path-separator", "/"] + ]], + + ["authority", [ + ["authority-delimiter", "//"], + ["host", [ + ["ipv4-address", "192.0.2.16"] + ]], + ["port-segment", [ + ["port-delimiter", ":"], + ["port", "80"] + ]] + ]], + ["path", [ + ["path-separator", "/"] + ]], + + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]], + ["path", [ + ["path-separator", "/"], + "path", + ["path-separator", "/"], + "resource.txt" + ]] +] diff --git a/tests/languages/uri/full.test b/tests/languages/uri/full.test new file mode 100644 index 0000000000..c4877b2aa3 --- /dev/null +++ b/tests/languages/uri/full.test @@ -0,0 +1,126 @@ +https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top +ldap://[2001:db8::7]/c=GB?objectClass?one +mailto:John.Doe@example.com +news:comp.infosystems.www.servers.unix +telnet://192.0.2.16:80/ +https://example.com/path/resource.txt#fragment + +---------------------------------------------------- + +[ + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["user-info-segment", [ + ["user-info", "john.doe"], + ["user-info-delimiter", "@"] + ]], + ["host", ["www.example.com"]], + ["port-segment", [ + ["port-delimiter", ":"], + ["port", "123"] + ]] + ]], + ["path", [ + ["path-separator", "/"], + "forum", + ["path-separator", "/"], + "questions", + ["path-separator", "/"] + ]], + ["query", [ + ["query-delimiter", "?"], + ["pair", [ + ["key", "tag"], + "=", + ["value", "networking"] + ]], + ["pair-delimiter", "&"], + ["pair", [ + ["key", "order"], + "=", + ["value", "newest"] + ]] + ]], + ["fragment", [ + ["fragment-delimiter", "#"], + "top" + ]], + + ["scheme", [ + "ldap", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", [ + ["ip-literal", [ + ["ip-literal-delimiter", "["], + ["ipv6-address", "2001:db8::7"], + ["ip-literal-delimiter", "]"] + ]] + ]] + ]], + ["path", [ + ["path-separator", "/"], + "c=GB" + ]], + ["query", [ + ["query-delimiter", "?"], + ["pair", [ + ["key", "objectClass?one"] + ]] + ]], + + ["scheme", [ + "mailto", + ["scheme-delimiter", ":"] + ]], + ["path", ["John.Doe@example.com"]], + + ["scheme", [ + "news", + ["scheme-delimiter", ":"] + ]], + ["path", ["comp.infosystems.www.servers.unix"]], + + ["scheme", [ + "telnet", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", [ + ["ipv4-address", "192.0.2.16"] + ]], + ["port-segment", [ + ["port-delimiter", ":"], + ["port", "80"] + ]] + ]], + ["path", [ + ["path-separator", "/"] + ]], + + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]], + ["path", [ + ["path-separator", "/"], + "path", + ["path-separator", "/"], + "resource.txt" + ]], + ["fragment", [ + ["fragment-delimiter", "#"], + "fragment" + ]] +] diff --git a/tests/languages/uri/query_feature.test b/tests/languages/uri/query_feature.test new file mode 100644 index 0000000000..5f6bb7a3ea --- /dev/null +++ b/tests/languages/uri/query_feature.test @@ -0,0 +1,78 @@ +?tag=networking&order=newest#top +?objectClass?one +?title=Query_string&action=edit +http://example.com/kb/index.php?cat=1;id=23 + +---------------------------------------------------- + +[ + ["query", [ + ["query-delimiter", "?"], + ["pair", [ + ["key", "tag"], + "=", + ["value", "networking"] + ]], + ["pair-delimiter", "&"], + ["pair", [ + ["key", "order"], + "=", + ["value", "newest"] + ]] + ]], + ["fragment", [ + ["fragment-delimiter", "#"], + "top" + ]], + + ["query", [ + ["query-delimiter", "?"], + ["pair", [ + ["key", "objectClass?one"] + ]] + ]], + + ["query", [ + ["query-delimiter", "?"], + ["pair", [ + ["key", "title"], + "=", + ["value", "Query_string"] + ]], + ["pair-delimiter", "&"], + ["pair", [ + ["key", "action"], + "=", + ["value", "edit"] + ]] + ]], + + ["scheme", [ + "http", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]], + ["path", [ + ["path-separator", "/"], + "kb", + ["path-separator", "/"], + "index.php" + ]], + ["query", [ + ["query-delimiter", "?"], + ["pair", [ + ["key", "cat"], + "=", + ["value", "1"] + ]], + ["pair-delimiter", ";"], + ["pair", [ + ["key", "id"], + "=", + ["value", "23"] + ]] + ]] +] \ No newline at end of file diff --git a/tests/languages/uri/relative.test b/tests/languages/uri/relative.test new file mode 100644 index 0000000000..9964057a28 --- /dev/null +++ b/tests/languages/uri/relative.test @@ -0,0 +1,54 @@ +//example.com/path/resource.txt +/path/resource.txt +path/resource.txt +../resource.txt +./resource.txt +resource.txt +#fragment + +---------------------------------------------------- + +[ + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["example.com"]] + ]], + ["path", [ + ["path-separator", "/"], + "path", + ["path-separator", "/"], + "resource.txt" + ]], + + ["path", [ + ["path-separator", "/"], + "path", + ["path-separator", "/"], + "resource.txt" + ]], + + ["path", [ + "path", + ["path-separator", "/"], + "resource.txt" + ]], + + ["path", [ + "..", + ["path-separator", "/"], + "resource.txt" + ]], + + ["path", [ + ".", + ["path-separator", "/"], + "resource.txt" + ]], + + ["path", ["resource.txt"]], + + ["fragment", [ + ["fragment-delimiter", "#"], + "fragment" + ]] +] \ No newline at end of file diff --git a/tests/languages/uri/scheme_feature.test b/tests/languages/uri/scheme_feature.test new file mode 100644 index 0000000000..0196d7a260 --- /dev/null +++ b/tests/languages/uri/scheme_feature.test @@ -0,0 +1,45 @@ +ftp://ftp.is.co.za/rfc/rfc1808.txt +tel:+1-816-555-1212 +urn:oasis:names:specification:docbook:dtd:xml:4.1.2 +data:text/vnd-example+xyz;foo=bar;base64,R0lGODdh + +---------------------------------------------------- + +[ + ["scheme", [ + "ftp", + ["scheme-delimiter", ":"] + ]], + ["authority", [ + ["authority-delimiter", "//"], + ["host", ["ftp.is.co.za"]] + ]], + ["path", [ + ["path-separator", "/"], + "rfc", + ["path-separator", "/"], + "rfc1808.txt" + ]], + + ["scheme", [ + "tel", + ["scheme-delimiter", ":"] + ]], + ["path", ["+1-816-555-1212"]], + + ["scheme", [ + "urn", + ["scheme-delimiter", ":"] + ]], + ["path", ["oasis:names:specification:docbook:dtd:xml:4.1.2"]], + + ["scheme", [ + "data", + ["scheme-delimiter", ":"] + ]], + ["path", [ + "text", + ["path-separator", "/"], + "vnd-example+xyz;foo=bar;base64,R0lGODdh" + ]] +] \ No newline at end of file diff --git a/tests/languages/v/attribute_feature.test b/tests/languages/v/attribute_feature.test new file mode 100644 index 0000000000..877e2b8664 --- /dev/null +++ b/tests/languages/v/attribute_feature.test @@ -0,0 +1,59 @@ +[deprecated] +[unsafe_fn] +[typedef] +[live] +[inline] +[flag] +[ref_only] +[windows_stdcall] +[direct_array_access] + +---------------------------------------------------- + +[ + ["attribute", [ + ["punctuation", "["], + ["keyword", "deprecated"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "unsafe_fn"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "typedef"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "live"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "inline"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "flag"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "ref_only"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "windows_stdcall"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "direct_array_access"], + ["punctuation", "]"] + ]] +] diff --git a/tests/languages/v/boolean_feature.test b/tests/languages/v/boolean_feature.test new file mode 100644 index 0000000000..750aee53ad --- /dev/null +++ b/tests/languages/v/boolean_feature.test @@ -0,0 +1,13 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] + +---------------------------------------------------- + +Check for boolean \ No newline at end of file diff --git a/tests/languages/v/char_feature.test b/tests/languages/v/char_feature.test new file mode 100644 index 0000000000..aca17552bd --- /dev/null +++ b/tests/languages/v/char_feature.test @@ -0,0 +1,11 @@ +`🚀` +`\`` +`Not a Rune` + +---------------------------------------------------- + +[ + ["char", "`🚀`"], + ["char", "`\\``"], + "\r\n`Not a Rune`" +] diff --git a/tests/languages/v/class-name_feature.test b/tests/languages/v/class-name_feature.test new file mode 100644 index 0000000000..bf2387c159 --- /dev/null +++ b/tests/languages/v/class-name_feature.test @@ -0,0 +1,41 @@ +struct Abc { } +type Alphabet = Abc | Xyz +enum Token { } +interface Speaker { } +struct Repo { } + +---------------------------------------------------- + +[ + ["keyword", "struct"], + ["class-name", "Abc"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "type"], + ["class-name", "Alphabet"], + ["operator", "="], + " Abc ", + ["operator", "|"], + " Xyz\r\n", + + ["keyword", "enum"], + ["class-name", "Token"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "interface"], + ["class-name", "Speaker"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "struct"], + ["class-name", "Repo"], + ["generic", [ + ["punctuation", "<"], + ["class-name", "T"], + ["punctuation", ">"] + ]], + ["punctuation", "{"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/v/function_feature.test b/tests/languages/v/function_feature.test new file mode 100644 index 0000000000..41e1749c30 --- /dev/null +++ b/tests/languages/v/function_feature.test @@ -0,0 +1,120 @@ +fn init() { } +fn add(x int, y int) int { } +fn sum(a ...int) int { } +fn (mut t MyTime) century() int { } +fn (d Dog) speak() string { } +fn (r Repo) find_user_by_id(id int) ?User { } +fn new_repo(db DB) Repo { } +fn (r Repo) find_by_id(id int) ?T { } + +---------------------------------------------------- + +[ + ["keyword", "fn"], + ["function", "init"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["function", "add"], + ["punctuation", "("], + "x ", + ["builtin", "int"], + ["punctuation", ","], + " y ", + ["builtin", "int"], + ["punctuation", ")"], + ["builtin", "int"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["function", "sum"], + ["punctuation", "("], + "a ", + ["operator", "..."], + ["builtin", "int"], + ["punctuation", ")"], + ["builtin", "int"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["punctuation", "("], + ["keyword", "mut"], + " t MyTime", + ["punctuation", ")"], + ["function", "century"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "int"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["punctuation", "("], + "d Dog", + ["punctuation", ")"], + ["function", "speak"], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "string"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["punctuation", "("], + "r Repo", + ["punctuation", ")"], + ["function", "find_user_by_id"], + ["punctuation", "("], + "id ", + ["builtin", "int"], + ["punctuation", ")"], + ["operator", "?"], + "User ", + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["generic-function", [ + ["function", "new_repo"], + ["generic", [ + ["punctuation", "<"], + ["class-name", "T"], + ["punctuation", ">"] + ]] + ]], + ["punctuation", "("], + "db DB", + ["punctuation", ")"], + " Repo", + ["generic", [ + ["punctuation", "<"], + ["class-name", "T"], + ["punctuation", ">"] + ]], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "fn"], + ["punctuation", "("], + "r Repo", + ["generic", [ + ["punctuation", "<"], + ["class-name", "T"], + ["punctuation", ">"] + ]], + ["punctuation", ")"], + ["function", "find_by_id"], + ["punctuation", "("], + "id ", + ["builtin", "int"], + ["punctuation", ")"], + ["operator", "?"], + "T ", + ["punctuation", "{"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/v/keyword_feature.test b/tests/languages/v/keyword_feature.test new file mode 100644 index 0000000000..279ed0d8da --- /dev/null +++ b/tests/languages/v/keyword_feature.test @@ -0,0 +1,93 @@ +as; +asm; +assert; +atomic; +break; +const; +continue; +defer; +else; +embed; +enum;; +fn; +for; +__global; +go; +goto; +if; +import; +in; +interface; +is; +lock; +match; +module; +mut; +none; +or; +pub; +return; +rlock; +select; +shared; +sizeof; +static; +struct; +type;; +typeof; +union; +unsafe; +$if; +$else; +$for; +#include; +#flag; + +---------------------------------------------------- + +[ + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "asm"], ["punctuation", ";"], + ["keyword", "assert"], ["punctuation", ";"], + ["keyword", "atomic"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "const"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "defer"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "embed"], ["punctuation", ";"], + ["keyword", "enum"], ["punctuation", ";"], ["punctuation", ";"], + ["keyword", "fn"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "__global"], ["punctuation", ";"], + ["keyword", "go"], ["punctuation", ";"], + ["keyword", "goto"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "import"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "interface"], ["punctuation", ";"], + ["keyword", "is"], ["punctuation", ";"], + ["keyword", "lock"], ["punctuation", ";"], + ["keyword", "match"], ["punctuation", ";"], + ["keyword", "module"], ["punctuation", ";"], + ["keyword", "mut"], ["punctuation", ";"], + ["keyword", "none"], ["punctuation", ";"], + ["keyword", "or"], ["punctuation", ";"], + ["keyword", "pub"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "rlock"], ["punctuation", ";"], + ["keyword", "select"], ["punctuation", ";"], + ["keyword", "shared"], ["punctuation", ";"], + ["keyword", "sizeof"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "type"], ["punctuation", ";"], ["punctuation", ";"], + ["keyword", "typeof"], ["punctuation", ";"], + ["keyword", "union"], ["punctuation", ";"], + ["keyword", "unsafe"], ["punctuation", ";"], + ["keyword", "$if"], ["punctuation", ";"], + ["keyword", "$else"], ["punctuation", ";"], + ["keyword", "$for"], ["punctuation", ";"], + ["keyword", "#include"], ["punctuation", ";"], + ["keyword", "#flag"], ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/v/number_feature.test b/tests/languages/v/number_feature.test new file mode 100644 index 0000000000..06820c7115 --- /dev/null +++ b/tests/languages/v/number_feature.test @@ -0,0 +1,25 @@ +123 +0x7B +0b01111011 +0o173 +1_000_000 +0xF_F +072.40 +2.71828 + +---------------------------------------------------- + +[ + ["number", "123"], + ["number", "0x7B"], + ["number", "0b01111011"], + ["number", "0o173"], + ["number", "1_000_000"], + ["number", "0xF_F"], + ["number", "072.40"], + ["number", "2.71828"] +] + +---------------------------------------------------- + +Check for numbers \ No newline at end of file diff --git a/tests/languages/v/operator_feature.test b/tests/languages/v/operator_feature.test new file mode 100644 index 0000000000..f7744026cb --- /dev/null +++ b/tests/languages/v/operator_feature.test @@ -0,0 +1,67 @@ ++ +- +* +/ +% +~ +& +| +^ +! +&& +|| +!= +<< +>> +== +< +<= +> +>= ++= +-= +*= +/= +%= +&= +|= +^= +>>= +<<= +:= + +---------------------------------------------------- + +[ + ["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", ":="] +] \ No newline at end of file diff --git a/tests/languages/v/string_feature.test b/tests/languages/v/string_feature.test new file mode 100644 index 0000000000..b3d52c2036 --- /dev/null +++ b/tests/languages/v/string_feature.test @@ -0,0 +1,41 @@ +"https://example.com" +'single quote' +'age = $user.age' +'[${int(x):-10}]' +r'hello\nworld' + +---------------------------------------------------- + +[ + ["string", ["\"https://example.com\""]], + ["string", ["'single quote'"]], + ["string", [ + "'age = ", + ["interpolation", [ + ["interpolation-variable", "$user.age"] + ]], + "'" + ]], + ["string", [ + "'[", + ["interpolation", [ + ["interpolation-punctuation", "${"], + ["interpolation-expression", [ + ["function", "int"], + ["punctuation", "("], + "x", + ["punctuation", ")"], + ["punctuation", ":"], + ["operator", "-"], + ["number", "10"] + ]], + ["interpolation-punctuation", "}"] + ]], + "]'" + ]], + ["string", ["r'hello\\nworld'"]] +] + +---------------------------------------------------- + +Check for strings and string interpolation diff --git a/tests/languages/vala/constant_feature.test b/tests/languages/vala/constant_feature.test new file mode 100644 index 0000000000..49adc66704 --- /dev/null +++ b/tests/languages/vala/constant_feature.test @@ -0,0 +1,7 @@ +FOO + +---------------------------------------------------- + +[ + ["constant", "FOO"] +] diff --git a/tests/languages/vala/regex_feature.test b/tests/languages/vala/regex_feature.test new file mode 100644 index 0000000000..6f77366e3f --- /dev/null +++ b/tests/languages/vala/regex_feature.test @@ -0,0 +1,11 @@ +/(\d+\.\d+\.\d+)/ + +---------------------------------------------------- + +[ + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "(\\d+\\.\\d+\\.\\d+)"], + ["regex-delimiter", "/"] + ]] +] diff --git a/tests/languages/vbnet/issue2781.test b/tests/languages/vbnet/issue2781.test new file mode 100644 index 0000000000..f3ed86f72d --- /dev/null +++ b/tests/languages/vbnet/issue2781.test @@ -0,0 +1,24 @@ +bob = new SqlCommand("Select * from test Where Code=@Code"); +bob = new SqlCommand("Select * from test Where Code=Code"); + +---------------------------------------------------- + +[ + "bob ", + ["operator", "="], + ["keyword", "new"], + " SqlCommand", + ["punctuation", "("], + ["string", "\"Select * from test Where Code=@Code\""], + ["punctuation", ")"], + ["punctuation", ";"], + + "\r\nbob ", + ["operator", "="], + ["keyword", "new"], + " SqlCommand", + ["punctuation", "("], + ["string", "\"Select * from test Where Code=Code\""], + ["punctuation", ")"], + ["punctuation", ";"] +] diff --git a/tests/languages/vbnet/punctuation_feature.test b/tests/languages/vbnet/punctuation_feature.test new file mode 100644 index 0000000000..762103bc35 --- /dev/null +++ b/tests/languages/vbnet/punctuation_feature.test @@ -0,0 +1,15 @@ +, ; : +( ) { } + +---------------------------------------------------- + +[ + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/vbnet/string_feature.test b/tests/languages/vbnet/string_feature.test new file mode 100644 index 0000000000..61aa24920b --- /dev/null +++ b/tests/languages/vbnet/string_feature.test @@ -0,0 +1,20 @@ +Dim x = "hello +world" + +Console.WriteLine("Message: {0}", message) + +---------------------------------------------------- + +[ + ["keyword", "Dim"], + " x ", + ["operator", "="], + ["string", "\"hello\r\nworld\""], + + "\r\n\r\nConsole.WriteLine", + ["punctuation", "("], + ["string", "\"Message: {0}\""], + ["punctuation", ","], + " message", + ["punctuation", ")"] +] diff --git a/tests/languages/verilog/property_feature.test b/tests/languages/verilog/kernel-function_feature.test similarity index 53% rename from tests/languages/verilog/property_feature.test rename to tests/languages/verilog/kernel-function_feature.test index fd3f589018..4ce2841524 100644 --- a/tests/languages/verilog/property_feature.test +++ b/tests/languages/verilog/kernel-function_feature.test @@ -1,11 +1,13 @@ -$display() - ----------------------------------------------------- - -[ - ["property", "$display"], ["punctuation", "("], ["punctuation", ")"] -] - ----------------------------------------------------- - -Checks for kernel functions. \ No newline at end of file +$display() + +---------------------------------------------------- + +[ + ["kernel-function", "$display"], + ["punctuation", "("], + ["punctuation", ")"] +] + +---------------------------------------------------- + +Checks for kernel functions. diff --git a/tests/languages/warpscript/keyword_feature.test b/tests/languages/warpscript/keyword_feature.test new file mode 100644 index 0000000000..fb1531b3f4 --- /dev/null +++ b/tests/languages/warpscript/keyword_feature.test @@ -0,0 +1,49 @@ +BREAK +CHECKMACRO +CONTINUE +CUDF +DEFINED +DEFINEDMACRO +EVAL +FAIL +FOR +FOREACH +FORSTEP +IFT +IFTE +MSGFAIL +NRETURN +RETHROW +RETURN +SWITCH +TRY +UDF +UNTIL +WHILE + +---------------------------------------------------- + +[ + ["keyword", "BREAK"], + ["keyword", "CHECKMACRO"], + ["keyword", "CONTINUE"], + ["keyword", "CUDF"], + ["keyword", "DEFINED"], + ["keyword", "DEFINEDMACRO"], + ["keyword", "EVAL"], + ["keyword", "FAIL"], + ["keyword", "FOR"], + ["keyword", "FOREACH"], + ["keyword", "FORSTEP"], + ["keyword", "IFT"], + ["keyword", "IFTE"], + ["keyword", "MSGFAIL"], + ["keyword", "NRETURN"], + ["keyword", "RETHROW"], + ["keyword", "RETURN"], + ["keyword", "SWITCH"], + ["keyword", "TRY"], + ["keyword", "UDF"], + ["keyword", "UNTIL"], + ["keyword", "WHILE"] +] diff --git a/tests/languages/warpscript/macro_feature.test b/tests/languages/warpscript/macro_feature.test new file mode 100644 index 0000000000..72b8c76096 --- /dev/null +++ b/tests/languages/warpscript/macro_feature.test @@ -0,0 +1,7 @@ +@foo + +---------------------------------------------------- + +[ + ["macro", "@foo"] +] diff --git a/tests/languages/warpscript/variable_feature.test b/tests/languages/warpscript/variable_feature.test new file mode 100644 index 0000000000..fbb7a4110d --- /dev/null +++ b/tests/languages/warpscript/variable_feature.test @@ -0,0 +1,7 @@ +$foo + +---------------------------------------------------- + +[ + ["variable", "$foo"] +] diff --git a/tests/languages/web-idl/boolean_feature.test b/tests/languages/web-idl/boolean_feature.test new file mode 100644 index 0000000000..d342140d7b --- /dev/null +++ b/tests/languages/web-idl/boolean_feature.test @@ -0,0 +1,9 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] diff --git a/tests/languages/web-idl/builtin_feature.test b/tests/languages/web-idl/builtin_feature.test new file mode 100644 index 0000000000..541091fb27 --- /dev/null +++ b/tests/languages/web-idl/builtin_feature.test @@ -0,0 +1,43 @@ +ArrayBuffer +BigInt64Array +BigUint64Array +ByteString +DOMString +DataView +Float32Array +Float64Array +FrozenArray +Int16Array +Int32Array +Int8Array +ObservableArray +Promise +USVString +Uint16Array +Uint32Array +Uint8Array +Uint8ClampedArray + +---------------------------------------------------- + +[ + ["builtin", "ArrayBuffer"], + ["builtin", "BigInt64Array"], + ["builtin", "BigUint64Array"], + ["builtin", "ByteString"], + ["builtin", "DOMString"], + ["builtin", "DataView"], + ["builtin", "Float32Array"], + ["builtin", "Float64Array"], + ["builtin", "FrozenArray"], + ["builtin", "Int16Array"], + ["builtin", "Int32Array"], + ["builtin", "Int8Array"], + ["builtin", "ObservableArray"], + ["builtin", "Promise"], + ["builtin", "USVString"], + ["builtin", "Uint16Array"], + ["builtin", "Uint32Array"], + ["builtin", "Uint8Array"], + ["builtin", "Uint8ClampedArray"] +] diff --git a/tests/languages/web-idl/class-name_feature.test b/tests/languages/web-idl/class-name_feature.test new file mode 100644 index 0000000000..3f6ad1b8c4 --- /dev/null +++ b/tests/languages/web-idl/class-name_feature.test @@ -0,0 +1,410 @@ +// names +interface interface_identifier { /* interface_members... */ }; +partial interface interface_identifier { /* interface_members... */ }; +dictionary dictionary_identifier { /* dictionary_members... */ }; +partial dictionary dictionary_identifier { /* dictionary_members... */ }; +enum enumeration_identifier { "enum", "values" /* , ... */ }; +callback callback_identifier = return_type (/* arguments... */); +callback interface callback_interface_identifier { /* interface_members... */ }; + +// interfaces + +interface interface_identifier { + return_type identifier([extended_attributes] type identifier, [extended_attributes] type identifier); +}; +interface interface_identifier { + return_type identifier(type... identifier); + return_type identifier(type identifier, type... identifier); +}; +interface SolidColor : Paint { + constructor(double radius); + attribute double red; + readonly attribute unsigned long width; + undefined drawText(double x, double y, DOMString text); + getter DOMString (DOMString keyName); + getter DOMString foo(DOMString keyName); + boolean hasAddressForName(USVString name, optional LookupOptions options = {}); + const unsigned long BIT_MASK = 0x0000fc00; + iterable; +}; + +// dictionary + +dictionary identifier { + type identifier; +}; +dictionary identifier { + type identifier = "value"; +}; +dictionary identifier { + required type identifier; +}; +dictionary B : A { + long b; + long a; +}; + +// callback + +callback AsyncOperationCallback = undefined (DOMString status); + +// enum + +enum MealType { "rice", "noodles", "other" }; + +// typedef + +typedef sequence Points; + +// includes and implements +Foo includes Bar; +Foo implements Bar; + +---------------------------------------------------- + +[ + ["comment", "// names"], + + ["keyword", "interface"], + ["class-name", "interface_identifier"], + ["punctuation", "{"], + ["comment", "/* interface_members... */"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "partial"], + ["keyword", "interface"], + ["class-name", "interface_identifier"], + ["punctuation", "{"], + ["comment", "/* interface_members... */"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "dictionary"], + ["class-name", "dictionary_identifier"], + ["punctuation", "{"], + ["comment", "/* dictionary_members... */"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "partial"], + ["keyword", "dictionary"], + ["class-name", "dictionary_identifier"], + ["punctuation", "{"], + ["comment", "/* dictionary_members... */"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "enum"], + ["class-name", "enumeration_identifier"], + ["punctuation", "{"], + ["string", "\"enum\""], + ["punctuation", ","], + ["string", "\"values\""], + ["comment", "/* , ... */"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "callback"], + ["class-name", "callback_identifier"], + ["operator", "="], + ["class-name", ["return_type"]], + ["punctuation", "("], + ["comment", "/* arguments... */"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "callback"], + ["keyword", "interface"], + ["class-name", "callback_interface_identifier"], + ["punctuation", "{"], + ["comment", "/* interface_members... */"], + ["punctuation", "}"], + ["punctuation", ";"], + + ["comment", "// interfaces"], + + ["keyword", "interface"], + ["class-name", "interface_identifier"], + ["punctuation", "{"], + + ["class-name", ["return_type"]], + " identifier", + ["punctuation", "("], + ["punctuation", "["], + "extended_attributes", + ["punctuation", "]"], + ["class-name", ["type"]], + " identifier", + ["punctuation", ","], + ["punctuation", "["], + "extended_attributes", + ["punctuation", "]"], + ["class-name", ["type"]], + " identifier", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "interface"], + ["class-name", "interface_identifier"], + ["punctuation", "{"], + + ["class-name", ["return_type"]], + " identifier", + ["punctuation", "("], + ["class-name", ["type"]], + ["operator", "..."], + " identifier", + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", ["return_type"]], + " identifier", + ["punctuation", "("], + ["class-name", ["type"]], + " identifier", + ["punctuation", ","], + ["class-name", ["type"]], + ["operator", "..."], + " identifier", + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "interface"], + ["class-name", "SolidColor"], + ["operator", ":"], + ["class-name", "Paint"], + ["punctuation", "{"], + + ["keyword", "constructor"], + ["punctuation", "("], + ["class-name", [ + ["keyword", "double"] + ]], + " radius", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "attribute"], + ["class-name", [ + ["keyword", "double"] + ]], + " red", + ["punctuation", ";"], + + ["keyword", "readonly"], + ["keyword", "attribute"], + ["class-name", [ + ["keyword", "unsigned"], + ["keyword", "long"] + ]], + " width", + ["punctuation", ";"], + + ["class-name", [ + ["keyword", "undefined"] + ]], + " drawText", + ["punctuation", "("], + ["class-name", [ + ["keyword", "double"] + ]], + " x", + ["punctuation", ","], + ["class-name", [ + ["keyword", "double"] + ]], + " y", + ["punctuation", ","], + ["class-name", [ + ["builtin", "DOMString"] + ]], + " text", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "getter"], + ["class-name", [ + ["builtin", "DOMString"] + ]], + ["punctuation", "("], + ["class-name", [ + ["builtin", "DOMString"] + ]], + " keyName", + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "getter"], + ["class-name", [ + ["builtin", "DOMString"] + ]], + " foo", + ["punctuation", "("], + ["class-name", [ + ["builtin", "DOMString"] + ]], + " keyName", + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", [ + ["keyword", "boolean"] + ]], + " hasAddressForName", + ["punctuation", "("], + ["class-name", [ + ["builtin", "USVString"] + ]], + " name", + ["punctuation", ","], + ["keyword", "optional"], + ["class-name", ["LookupOptions"]], + " options ", + ["operator", "="], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["keyword", "const"], + ["class-name", [ + ["keyword", "unsigned"], + ["keyword", "long"] + ]], + " BIT_MASK ", + ["operator", "="], + ["number", "0x0000fc00"], + ["punctuation", ";"], + + ["class-name", [ + ["keyword", "iterable"], + ["operator", "<"], + ["builtin", "DOMString"], + ["punctuation", ","], + " Session", + ["operator", ">"] + ]], + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["comment", "// dictionary"], + + ["keyword", "dictionary"], + ["class-name", "identifier"], + ["punctuation", "{"], + + ["class-name", ["type"]], + " identifier", + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "dictionary"], + ["class-name", "identifier"], + ["punctuation", "{"], + + ["class-name", ["type"]], + " identifier ", + ["operator", "="], + ["string", "\"value\""], + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "dictionary"], + ["class-name", "identifier"], + ["punctuation", "{"], + + ["keyword", "required"], + ["class-name", ["type"]], + " identifier", + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "dictionary"], + ["class-name", "B"], + ["operator", ":"], + ["class-name", "A"], + ["punctuation", "{"], + + ["class-name", [ + ["keyword", "long"] + ]], + " b", + ["punctuation", ";"], + + ["class-name", [ + ["keyword", "long"] + ]], + " a", + ["punctuation", ";"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["comment", "// callback"], + + ["keyword", "callback"], + ["class-name", "AsyncOperationCallback"], + ["operator", "="], + ["class-name", [ + ["keyword", "undefined"] + ]], + ["punctuation", "("], + ["class-name", [ + ["builtin", "DOMString"] + ]], + " status", + ["punctuation", ")"], + ["punctuation", ";"], + + ["comment", "// enum"], + + ["keyword", "enum"], + ["class-name", "MealType"], + ["punctuation", "{"], + ["string", "\"rice\""], + ["punctuation", ","], + ["string", "\"noodles\""], + ["punctuation", ","], + ["string", "\"other\""], + ["punctuation", "}"], + ["punctuation", ";"], + + ["comment", "// typedef"], + + ["keyword", "typedef"], + ["class-name", [ + ["keyword", "sequence"], + ["operator", "<"], + "Point", + ["operator", ">"] + ]], + " Points", + ["punctuation", ";"], + + ["comment", "// includes and implements"], + + ["class-name", "Foo"], + ["keyword", "includes"], + ["class-name", "Bar"], + ["punctuation", ";"], + + ["class-name", "Foo"], + ["keyword", "implements"], + ["class-name", "Bar"], + ["punctuation", ";"] +] diff --git a/tests/languages/web-idl/comment_feature.test b/tests/languages/web-idl/comment_feature.test new file mode 100644 index 0000000000..a4a1d8faf2 --- /dev/null +++ b/tests/languages/web-idl/comment_feature.test @@ -0,0 +1,9 @@ +// comment +/* comment */ + +---------------------------------------------------- + +[ + ["comment", "// comment"], + ["comment", "/* comment */"] +] diff --git a/tests/languages/web-idl/keyword_feature.test b/tests/languages/web-idl/keyword_feature.test new file mode 100644 index 0000000000..b3c3130cf4 --- /dev/null +++ b/tests/languages/web-idl/keyword_feature.test @@ -0,0 +1,55 @@ +async; +attribute; +callback; +const; +constructor; +deleter; +dictionary; +enum; +getter; +includes; +inherit; +interface; +mixin; +namespace; +null; +optional; +or; +partial; +readonly; +required; +setter; +static; +stringifier; +typedef; +unrestricted; + +---------------------------------------------------- + +[ + ["keyword", "async"], ["punctuation", ";"], + ["keyword", "attribute"], ["punctuation", ";"], + ["keyword", "callback"], ["punctuation", ";"], + ["keyword", "const"], ["punctuation", ";"], + ["keyword", "constructor"], ["punctuation", ";"], + ["keyword", "deleter"], ["punctuation", ";"], + ["keyword", "dictionary"], ["punctuation", ";"], + ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "getter"], ["punctuation", ";"], + ["keyword", "includes"], ["punctuation", ";"], + ["keyword", "inherit"], ["punctuation", ";"], + ["keyword", "interface"], ["punctuation", ";"], + ["keyword", "mixin"], ["punctuation", ";"], + ["keyword", "namespace"], ["punctuation", ";"], + ["keyword", "null"], ["punctuation", ";"], + ["keyword", "optional"], ["punctuation", ";"], + ["keyword", "or"], ["punctuation", ";"], + ["keyword", "partial"], ["punctuation", ";"], + ["keyword", "readonly"], ["punctuation", ";"], + ["keyword", "required"], ["punctuation", ";"], + ["keyword", "setter"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "stringifier"], ["punctuation", ";"], + ["keyword", "typedef"], ["punctuation", ";"], + ["keyword", "unrestricted"], ["punctuation", ";"] +] diff --git a/tests/languages/web-idl/namespace_feature.test b/tests/languages/web-idl/namespace_feature.test new file mode 100644 index 0000000000..7ef2734ecf --- /dev/null +++ b/tests/languages/web-idl/namespace_feature.test @@ -0,0 +1,30 @@ +namespace SomeNamespace { + /* namespace_members... */ +}; + +partial namespace SomeNamespace { + /* namespace_members... */ +}; + +---------------------------------------------------- + +[ + ["keyword", "namespace"], + ["namespace", "SomeNamespace"], + ["punctuation", "{"], + + ["comment", "/* namespace_members... */"], + + ["punctuation", "}"], + ["punctuation", ";"], + + ["keyword", "partial"], + ["keyword", "namespace"], + ["namespace", "SomeNamespace"], + ["punctuation", "{"], + + ["comment", "/* namespace_members... */"], + + ["punctuation", "}"], + ["punctuation", ";"] +] diff --git a/tests/languages/web-idl/number_feature.test b/tests/languages/web-idl/number_feature.test new file mode 100644 index 0000000000..72d317370c --- /dev/null +++ b/tests/languages/web-idl/number_feature.test @@ -0,0 +1,29 @@ +0xfff +123423 +-123423 + +123.456 +123.e64 +123.324e-4 +.324e+4 + +NaN +Infinity +-Infinity + +---------------------------------------------------- + +[ + ["number", "0xfff"], + ["number", "123423"], + ["number", "-123423"], + + ["number", "123.456"], + ["number", "123.e64"], + ["number", "123.324e-4"], + ["number", ".324e+4"], + + ["number", "NaN"], + ["number", "Infinity"], + ["number", "-Infinity"] +] diff --git a/tests/languages/web-idl/operator_feature.test b/tests/languages/web-idl/operator_feature.test new file mode 100644 index 0000000000..b27e286444 --- /dev/null +++ b/tests/languages/web-idl/operator_feature.test @@ -0,0 +1,14 @@ +... += : ? < > + +---------------------------------------------------- + +[ + ["operator", "..."], + + ["operator", "="], + ["operator", ":"], + ["operator", "?"], + ["operator", "<"], + ["operator", ">"] +] diff --git a/tests/languages/web-idl/primitive-type_feature.test b/tests/languages/web-idl/primitive-type_feature.test new file mode 100644 index 0000000000..a56623fa2f --- /dev/null +++ b/tests/languages/web-idl/primitive-type_feature.test @@ -0,0 +1,43 @@ +any +bigint +boolean +byte +double +float +iterable +long +maplike +object +octet +record +sequence +setlike +short +symbol +undefined +unsigned +void + +---------------------------------------------------- + +[ + ["keyword", "any"], + ["keyword", "bigint"], + ["keyword", "boolean"], + ["keyword", "byte"], + ["keyword", "double"], + ["keyword", "float"], + ["keyword", "iterable"], + ["keyword", "long"], + ["keyword", "maplike"], + ["keyword", "object"], + ["keyword", "octet"], + ["keyword", "record"], + ["keyword", "sequence"], + ["keyword", "setlike"], + ["keyword", "short"], + ["keyword", "symbol"], + ["keyword", "undefined"], + ["keyword", "unsigned"], + ["keyword", "void"] +] diff --git a/tests/languages/web-idl/punctuation_feature.test b/tests/languages/web-idl/punctuation_feature.test new file mode 100644 index 0000000000..4437034113 --- /dev/null +++ b/tests/languages/web-idl/punctuation_feature.test @@ -0,0 +1,17 @@ +( ) [ ] { } +. , ; + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ";"] +] diff --git a/tests/languages/web-idl/string_feature.test b/tests/languages/web-idl/string_feature.test new file mode 100644 index 0000000000..c6f23ce437 --- /dev/null +++ b/tests/languages/web-idl/string_feature.test @@ -0,0 +1,11 @@ +"" +"foo" +"\" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"\\\""] +] diff --git a/tests/languages/wolfram/black_feature.test b/tests/languages/wolfram/black_feature.test new file mode 100644 index 0000000000..33d87d5ed2 --- /dev/null +++ b/tests/languages/wolfram/black_feature.test @@ -0,0 +1,9 @@ +__ +x__ + +---------------------------------------------------- + +[ + ["blank", "__"], + ["blank", "x__"] +] diff --git a/tests/languages/wolfram/boolean_feature.test b/tests/languages/wolfram/boolean_feature.test new file mode 100644 index 0000000000..1eb1763a50 --- /dev/null +++ b/tests/languages/wolfram/boolean_feature.test @@ -0,0 +1,19 @@ +True +False +0 +1 +None + +---------------------------------------------------- + +[ + ["boolean", "True"], + ["boolean", "False"], + ["number", "0"], + ["number", "1"], + ["keyword", "None"] +] + +---------------------------------------------------- + +Checks for booleans. diff --git a/tests/languages/wolfram/context_feature.test b/tests/languages/wolfram/context_feature.test new file mode 100644 index 0000000000..871beb18c9 --- /dev/null +++ b/tests/languages/wolfram/context_feature.test @@ -0,0 +1,9 @@ +Global` +System`Foo + +---------------------------------------------------- + +[ + ["context", "Global`"], + ["context", "System`Foo"] +] diff --git a/tests/languages/wolfram/keyword_feature.test b/tests/languages/wolfram/keyword_feature.test new file mode 100644 index 0000000000..88144e0799 --- /dev/null +++ b/tests/languages/wolfram/keyword_feature.test @@ -0,0 +1,41 @@ +Abs +AbsArg +Accuracy +Block +Do +For +Function +If +Manipulate +Module +Nest +NestList +None +Return +Switch +Table +Which +While + +---------------------------------------------------- + +[ + ["keyword", "Abs"], + ["keyword", "AbsArg"], + ["keyword", "Accuracy"], + ["keyword", "Block"], + ["keyword", "Do"], + ["keyword", "For"], + ["keyword", "Function"], + ["keyword", "If"], + ["keyword", "Manipulate"], + ["keyword", "Module"], + ["keyword", "Nest"], + ["keyword", "NestList"], + ["keyword", "None"], + ["keyword", "Return"], + ["keyword", "Switch"], + ["keyword", "Table"], + ["keyword", "Which"], + ["keyword", "While"] +] diff --git a/tests/languages/wolfram/operator_feature.test b/tests/languages/wolfram/operator_feature.test new file mode 100644 index 0000000000..cce139f307 --- /dev/null +++ b/tests/languages/wolfram/operator_feature.test @@ -0,0 +1,27 @@ +@ // +/@ @@ @@@ +/ /= //= +> >= <= +>> << ++ - ^ * += == === +:= =. +!= =!= + +---------------------------------------------------- + +[ + ["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/wolfram/punctuation_feature.test b/tests/languages/wolfram/punctuation_feature.test new file mode 100644 index 0000000000..73912910e5 --- /dev/null +++ b/tests/languages/wolfram/punctuation_feature.test @@ -0,0 +1,18 @@ +{ } [ ] ( ) +, ; . : + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + + ["punctuation", ","], + ["operator", ";"], + ["punctuation", "."], + ["punctuation", ":"] +] diff --git a/tests/languages/wolfram/string_feature.test b/tests/languages/wolfram/string_feature.test new file mode 100644 index 0000000000..1601aa91e3 --- /dev/null +++ b/tests/languages/wolfram/string_feature.test @@ -0,0 +1,15 @@ +"" +"foo" +"fo\"obar" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"fo\\\"obar\""] +] + +---------------------------------------------------- + +Checks for strings. diff --git a/tests/languages/wren/attribute_feature.test b/tests/languages/wren/attribute_feature.test new file mode 100644 index 0000000000..43383abd2b --- /dev/null +++ b/tests/languages/wren/attribute_feature.test @@ -0,0 +1,91 @@ +#hidden = true +class Example {} + +#key +#key = value +#group( + multiple, + lines = true, + lines = 0 +) +class Example { + #test(skip = true, iterations = 32) + doStuff() {} +} + +#doc = "not runtime data" +#!runtimeAccess = true +#!maxIterations = 16 + +---------------------------------------------------- + +[ + ["attribute", "#hidden"], + ["operator", "="], + ["boolean", "true"], + + ["keyword", "class"], + ["class-name", "Example"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["attribute", "#key"], + + ["attribute", "#key"], + ["operator", "="], + " value\r\n", + + ["attribute", "#group"], + ["punctuation", "("], + + "\r\n multiple", + ["punctuation", ","], + + "\r\n lines ", + ["operator", "="], + ["boolean", "true"], + ["punctuation", ","], + + "\r\n lines ", + ["operator", "="], + ["number", "0"], + + ["punctuation", ")"], + + ["keyword", "class"], + ["class-name", "Example"], + ["punctuation", "{"], + + ["attribute", "#test"], + ["punctuation", "("], + "skip ", + ["operator", "="], + ["boolean", "true"], + ["punctuation", ","], + " iterations ", + ["operator", "="], + ["number", "32"], + ["punctuation", ")"], + + ["function", "doStuff"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", "}"], + + ["attribute", "#doc"], + ["operator", "="], + ["string-literal", [ + ["string", "\"not runtime data\""] + ]], + + ["attribute", "#!runtimeAccess"], + ["operator", "="], + ["boolean", "true"], + + ["attribute", "#!maxIterations"], + ["operator", "="], + ["number", "16"] +] diff --git a/tests/languages/wren/boolean_feature.test b/tests/languages/wren/boolean_feature.test new file mode 100644 index 0000000000..d342140d7b --- /dev/null +++ b/tests/languages/wren/boolean_feature.test @@ -0,0 +1,9 @@ +true +false + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"] +] diff --git a/tests/languages/wren/class-name_feature.test b/tests/languages/wren/class-name_feature.test new file mode 100644 index 0000000000..e2e70d94d7 --- /dev/null +++ b/tests/languages/wren/class-name_feature.test @@ -0,0 +1,35 @@ +Foo.bar() + +import "beverages" for Coffee, Tea + +class Foo {} +class foo {} + +---------------------------------------------------- + +[ + ["class-name", "Foo"], + ["punctuation", "."], + ["function", "bar"], + ["punctuation", "("], + ["punctuation", ")"], + + ["keyword", "import"], + ["string-literal", [ + ["string", "\"beverages\""] + ]], + ["keyword", "for"], + ["class-name", "Coffee"], + ["punctuation", ","], + ["class-name", "Tea"], + + ["keyword", "class"], + ["class-name", "Foo"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", "foo"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/wren/comment_feature.test b/tests/languages/wren/comment_feature.test new file mode 100644 index 0000000000..e68f0796af --- /dev/null +++ b/tests/languages/wren/comment_feature.test @@ -0,0 +1,21 @@ +// comment + +/**/ +/* comment */ + +/* +/* +nested comment +*/ +*/ + +---------------------------------------------------- + +[ + ["comment", "// comment"], + + ["comment", "/**/"], + ["comment", "/* comment */"], + + ["comment", "/*\r\n/*\r\nnested comment\r\n*/\r\n*/"] +] diff --git a/tests/languages/wren/constant_feature.test b/tests/languages/wren/constant_feature.test new file mode 100644 index 0000000000..49adc66704 --- /dev/null +++ b/tests/languages/wren/constant_feature.test @@ -0,0 +1,7 @@ +FOO + +---------------------------------------------------- + +[ + ["constant", "FOO"] +] diff --git a/tests/languages/wren/function_feature.test b/tests/languages/wren/function_feature.test new file mode 100644 index 0000000000..ccde12e120 --- /dev/null +++ b/tests/languages/wren/function_feature.test @@ -0,0 +1,19 @@ +foo() + +foo {|x| x * 2} + +---------------------------------------------------- + +[ + ["function", "foo"], ["punctuation", "("], ["punctuation", ")"], + + ["function", "foo"], + ["punctuation", "{"], + ["operator", "|"], + "x", + ["operator", "|"], + " x ", + ["operator", "*"], + ["number", "2"], + ["punctuation", "}"] +] diff --git a/tests/languages/wren/hashbang_feature.test b/tests/languages/wren/hashbang_feature.test new file mode 100644 index 0000000000..cd9e4a669f --- /dev/null +++ b/tests/languages/wren/hashbang_feature.test @@ -0,0 +1,7 @@ +#!/usr/bin/env wren + +---------------------------------------------------- + +[ + ["hashbang", "#!/usr/bin/env wren"] +] diff --git a/tests/languages/wren/keyword_feature.test b/tests/languages/wren/keyword_feature.test new file mode 100644 index 0000000000..23f1ee9007 --- /dev/null +++ b/tests/languages/wren/keyword_feature.test @@ -0,0 +1,45 @@ +as; +break; +class; +construct; +continue; +else; +for; +foreign; +if; +import; +in; +is; +return; +static; +super; +this; +var; +while; + +null + +---------------------------------------------------- + +[ + ["keyword", "as"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ";"], + ["keyword", "class"], ["punctuation", ";"], + ["keyword", "construct"], ["punctuation", ";"], + ["keyword", "continue"], ["punctuation", ";"], + ["keyword", "else"], ["punctuation", ";"], + ["keyword", "for"], ["punctuation", ";"], + ["keyword", "foreign"], ["punctuation", ";"], + ["keyword", "if"], ["punctuation", ";"], + ["keyword", "import"], ["punctuation", ";"], + ["keyword", "in"], ["punctuation", ";"], + ["keyword", "is"], ["punctuation", ";"], + ["keyword", "return"], ["punctuation", ";"], + ["keyword", "static"], ["punctuation", ";"], + ["keyword", "super"], ["punctuation", ";"], + ["keyword", "this"], ["punctuation", ";"], + ["keyword", "var"], ["punctuation", ";"], + ["keyword", "while"], ["punctuation", ";"], + + ["null", "null"] +] diff --git a/tests/languages/wren/number_feature.test b/tests/languages/wren/number_feature.test new file mode 100644 index 0000000000..7b34e9f4a9 --- /dev/null +++ b/tests/languages/wren/number_feature.test @@ -0,0 +1,25 @@ +0 +1234 +-5678 +3.14159 +1.0 +-12.34 +0.0314159e02 +0.0314159e+02 +314.159e-02 +0xcaffe2 + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "1234"], + ["operator", "-"], ["number", "5678"], + ["number", "3.14159"], + ["number", "1.0"], + ["operator", "-"], ["number", "12.34"], + ["number", "0.0314159e02"], + ["number", "0.0314159e+02"], + ["number", "314.159e-02"], + ["number", "0xcaffe2"] +] diff --git a/tests/languages/wren/operator_feature.test b/tests/languages/wren/operator_feature.test new file mode 100644 index 0000000000..3693ebd94b --- /dev/null +++ b/tests/languages/wren/operator_feature.test @@ -0,0 +1,55 @@ +! ~ - +* / % + - +.. ... +<< >> +< <= > >= == != +& ^ | += + +&& || +? : + +1..2 1...3 + +---------------------------------------------------- + +[ + ["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", ":"], + + ["number", "1"], + ["operator", ".."], + ["number", "2"], + ["number", "1"], + ["operator", "..."], + ["number", "3"] +] diff --git a/tests/languages/wren/punctuation_feature.test b/tests/languages/wren/punctuation_feature.test new file mode 100644 index 0000000000..472d052f1b --- /dev/null +++ b/tests/languages/wren/punctuation_feature.test @@ -0,0 +1,17 @@ +( ) [ ] { } +, ; . + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "."] +] diff --git a/tests/languages/wren/string_feature.test b/tests/languages/wren/string_feature.test new file mode 100644 index 0000000000..acbd2e7acd --- /dev/null +++ b/tests/languages/wren/string_feature.test @@ -0,0 +1,60 @@ +"" +"\"\\" +"foo +bar" + +"""""" +""" +foo +bar +""" +""" + { + "hello": "wren", + "from" : "json" + } +""" + +"foo %(bar)" +"foo * %(1 + 2) ~= bar" + +---------------------------------------------------- + +[ + ["string-literal", [ + ["string", "\"\""] + ]], + ["string-literal", [ + ["string", "\"\\\"\\\\\""] + ]], + ["string-literal", [ + ["string", "\"foo\r\nbar\""] + ]], + + ["triple-quoted-string", "\"\"\"\"\"\""], + ["triple-quoted-string", "\"\"\"\r\nfoo\r\nbar\r\n\"\"\""], + ["triple-quoted-string", "\"\"\"\r\n {\r\n \"hello\": \"wren\",\r\n \"from\" : \"json\"\r\n }\r\n\"\"\""], + + ["string-literal", [ + ["string", "\"foo "], + ["interpolation", [ + ["interpolation-punctuation", "%("], + ["expression", ["bar"]], + ["interpolation-punctuation", ")"] + ]], + ["string", "\""] + ]], + ["string-literal", [ + ["string", "\"foo * "], + ["interpolation", [ + ["interpolation-punctuation", "%("], + ["expression", [ + ["number", "1"], + ["operator", "+"], + ["number", "2"] + ]], + ["interpolation-punctuation", ")"] + ]], + ["string", " ~= bar\""] + ]] +] diff --git a/tests/languages/xojo/comment_feature.test b/tests/languages/xojo/comment_feature.test index c980136164..9e66f29171 100644 --- a/tests/languages/xojo/comment_feature.test +++ b/tests/languages/xojo/comment_feature.test @@ -5,9 +5,9 @@ Rem Foobar ---------------------------------------------------- [ - ["comment", ["' Foobar"]], - ["comment", ["// Foobar"]], - ["comment", [["keyword", "Rem"], " Foobar"]] + ["comment", "' Foobar"], + ["comment", "// Foobar"], + ["comment", "Rem Foobar"] ] ---------------------------------------------------- diff --git a/tests/languages/xojo/directive_feature.test b/tests/languages/xojo/directive_feature.test new file mode 100644 index 0000000000..f5aef811af --- /dev/null +++ b/tests/languages/xojo/directive_feature.test @@ -0,0 +1,19 @@ +#If +#Else +#ElseIf +#Endif +#Pragma + +---------------------------------------------------- + +[ + ["directive", "#If"], + ["directive", "#Else"], + ["directive", "#ElseIf"], + ["directive", "#Endif"], + ["directive", "#Pragma"] +] + +---------------------------------------------------- + +Checks for conditional compilation and pragma. diff --git a/tests/languages/xojo/keyword_feature.test b/tests/languages/xojo/keyword_feature.test index 52a419b245..dd9e565d50 100644 --- a/tests/languages/xojo/keyword_feature.test +++ b/tests/languages/xojo/keyword_feature.test @@ -3,59 +3,108 @@ App Array As Assigns +Auto +Boolean ByRef +Byte ByVal Break Call Case Catch +CFStringRef +CGFloat +Class +Color Const Continue +CString +Currency CurrentMethodName Declare +Delegate Dim Do +Double DownTo Each Else ElseIf End +Enumeration +Event +Exception Exit Extends False Finally For +Function +Get +GetTypeInfo Global +GOTO If +Implements In +Inherits +Integer +Interface +Int8 +Int16 +Int32 +Int64 Lib Loop Me +Module Next Nil +Object Optional ParamArray +Private +Property +Protected +PString +Ptr Raise RaiseEvent ReDim -Rem RemoveHandler Return Select +Selector Self +Set +Single +Shared +Short Soft Static Step +String +Sub Super +Text Then To True Try Ubound +UInteger +UInt8 +UInt16 +UInt32 +UInt64 Until Using +Var +Variant Wend While +WindowPtr +WString ---------------------------------------------------- @@ -65,59 +114,108 @@ While ["keyword", "Array"], ["keyword", "As"], ["keyword", "Assigns"], + ["keyword", "Auto"], + ["keyword", "Boolean"], ["keyword", "ByRef"], + ["keyword", "Byte"], ["keyword", "ByVal"], ["keyword", "Break"], ["keyword", "Call"], ["keyword", "Case"], ["keyword", "Catch"], + ["keyword", "CFStringRef"], + ["keyword", "CGFloat"], + ["keyword", "Class"], + ["keyword", "Color"], ["keyword", "Const"], ["keyword", "Continue"], + ["keyword", "CString"], + ["keyword", "Currency"], ["keyword", "CurrentMethodName"], ["keyword", "Declare"], + ["keyword", "Delegate"], ["keyword", "Dim"], ["keyword", "Do"], + ["keyword", "Double"], ["keyword", "DownTo"], ["keyword", "Each"], ["keyword", "Else"], ["keyword", "ElseIf"], ["keyword", "End"], + ["keyword", "Enumeration"], + ["keyword", "Event"], + ["keyword", "Exception"], ["keyword", "Exit"], ["keyword", "Extends"], ["keyword", "False"], ["keyword", "Finally"], ["keyword", "For"], + ["keyword", "Function"], + ["keyword", "Get"], + ["keyword", "GetTypeInfo"], ["keyword", "Global"], + ["keyword", "GOTO"], ["keyword", "If"], + ["keyword", "Implements"], ["keyword", "In"], + ["keyword", "Inherits"], + ["keyword", "Integer"], + ["keyword", "Interface"], + ["keyword", "Int8"], + ["keyword", "Int16"], + ["keyword", "Int32"], + ["keyword", "Int64"], ["keyword", "Lib"], ["keyword", "Loop"], ["keyword", "Me"], + ["keyword", "Module"], ["keyword", "Next"], ["keyword", "Nil"], + ["keyword", "Object"], ["keyword", "Optional"], ["keyword", "ParamArray"], + ["keyword", "Private"], + ["keyword", "Property"], + ["keyword", "Protected"], + ["keyword", "PString"], + ["keyword", "Ptr"], ["keyword", "Raise"], ["keyword", "RaiseEvent"], ["keyword", "ReDim"], - ["keyword", "Rem"], ["keyword", "RemoveHandler"], ["keyword", "Return"], ["keyword", "Select"], + ["keyword", "Selector"], ["keyword", "Self"], + ["keyword", "Set"], + ["keyword", "Single"], + ["keyword", "Shared"], + ["keyword", "Short"], ["keyword", "Soft"], ["keyword", "Static"], ["keyword", "Step"], + ["keyword", "String"], + ["keyword", "Sub"], ["keyword", "Super"], + ["keyword", "Text"], ["keyword", "Then"], ["keyword", "To"], ["keyword", "True"], ["keyword", "Try"], ["keyword", "Ubound"], + ["keyword", "UInteger"], + ["keyword", "UInt8"], + ["keyword", "UInt16"], + ["keyword", "UInt32"], + ["keyword", "UInt64"], ["keyword", "Until"], ["keyword", "Using"], + ["keyword", "Var"], + ["keyword", "Variant"], ["keyword", "Wend"], - ["keyword", "While"] + ["keyword", "While"], + ["keyword", "WindowPtr"], + ["keyword", "WString"] ] ---------------------------------------------------- diff --git a/tests/languages/xojo/punctuation_feature.test b/tests/languages/xojo/punctuation_feature.test new file mode 100644 index 0000000000..29e203e997 --- /dev/null +++ b/tests/languages/xojo/punctuation_feature.test @@ -0,0 +1,12 @@ +. , ; : ( ) + +---------------------------------------------------- + +[ + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/xojo/symbol_feature.test b/tests/languages/xojo/symbol_feature.test deleted file mode 100644 index 980c0f13ed..0000000000 --- a/tests/languages/xojo/symbol_feature.test +++ /dev/null @@ -1,19 +0,0 @@ -#If -#Else -#ElseIf -#Endif -#Pragma - ----------------------------------------------------- - -[ - ["symbol", "#If"], - ["symbol", "#Else"], - ["symbol", "#ElseIf"], - ["symbol", "#Endif"], - ["symbol", "#Pragma"] -] - ----------------------------------------------------- - -Checks for conditional compilation and pragma. \ No newline at end of file diff --git a/tests/languages/yaml+markdown/front-matter_feature.test b/tests/languages/yaml+markdown/front-matter_feature.test new file mode 100644 index 0000000000..0ccafe4c41 --- /dev/null +++ b/tests/languages/yaml+markdown/front-matter_feature.test @@ -0,0 +1,24 @@ +--- +layout: post +title: Blogging Like a Hacker +--- + +# Title + +---------------------------------------------------- + +[ + ["front-matter-block", [ + ["punctuation", "---"], + ["front-matter", [ + ["key", "layout"], ["punctuation", ":"], " post\r\n", + ["key", "title"], ["punctuation", ":"], " Blogging Like a Hacker" + ]], + ["punctuation", "---"] + ]], + + ["title", [ + ["punctuation", "#"], + " Title" + ]] +] diff --git a/tests/languages/yaml/anchor_and_alias_feature.test b/tests/languages/yaml/anchor_and_alias_feature.test index eb70cb9b88..b6ed44e67e 100644 --- a/tests/languages/yaml/anchor_and_alias_feature.test +++ b/tests/languages/yaml/anchor_and_alias_feature.test @@ -71,7 +71,7 @@ tagb: !!tagb *tag-b ["punctuation", ":"], ["important", "&sca-lar"], ["punctuation", "|"], - ["scalar", "\n\tfoo\n\tbar"], + ["scalar", "\r\n\tfoo\r\n\tbar"], ["key", "x-utf8"], ["punctuation", ":"], @@ -113,7 +113,7 @@ tagb: !!tagb *tag-b ["important", "&tag-scalar"], ["tag", "!!tag-scalar"], ["punctuation", "|"], - ["scalar", "\n\tfoo\n\tbar"], + ["scalar", "\r\n\tfoo\r\n\tbar"], ["key", "x-tag-string"], ["punctuation", ":"], @@ -150,7 +150,7 @@ tagb: !!tagb *tag-b ["tag", "!!tag-scalar"], ["important", "&tag-scalar"], ["punctuation", "|"], - ["scalar", "\n\tfoo\n\tbar"], + ["scalar", "\r\n\tfoo\r\n\tbar"], ["key", "foobar"], ["punctuation", ":"], @@ -182,7 +182,7 @@ tagb: !!tagb *tag-b ["punctuation", ":"], ["tag", "!!str"], - " bar\n", + " bar\r\n", ["important", "&a2"], ["key", "baz"], diff --git a/tests/languages/yaml/key_feature.test b/tests/languages/yaml/key_feature.test index 98359b22e9..affda31feb 100644 --- a/tests/languages/yaml/key_feature.test +++ b/tests/languages/yaml/key_feature.test @@ -1,15 +1,21 @@ --- foo: 4 FooBar : 5 +hello the-world: 23 +"\"foo# : {}[]": 23 +'\'foo# : {}[]': 23 ---------------------------------------------------- [ ["punctuation", "---"], ["key", "foo"], ["punctuation", ":"], ["number", "4"], - ["key", "FooBar"], ["punctuation", ":"], ["number", "5"] + ["key", "FooBar"], ["punctuation", ":"], ["number", "5"], + ["key", "hello the-world"], ["punctuation", ":"], ["number", "23"], + ["key", "\"\\\"foo# : {}[]\""], ["punctuation", ":"], ["number", "23"], + ["key", "'\\'foo# : {}[]'"], ["punctuation", ":"], ["number", "23"] ] ---------------------------------------------------- -Checks for keys. \ No newline at end of file +Checks for keys. diff --git a/tests/languages/yang/comment_feature.test b/tests/languages/yang/comment_feature.test index ca4545e8b1..2b794ba47c 100644 --- a/tests/languages/yang/comment_feature.test +++ b/tests/languages/yang/comment_feature.test @@ -7,7 +7,7 @@ [ ["comment", "// comment"], - ["comment", "/*\n comment\n*/"] + ["comment", "/*\r\n comment\r\n*/"] ] ---------------------------------------------------- diff --git a/tests/languages/yang/namespace_feature.test b/tests/languages/yang/namespace_feature.test index 0263562808..edd1dcf0e3 100644 --- a/tests/languages/yang/namespace_feature.test +++ b/tests/languages/yang/namespace_feature.test @@ -7,7 +7,8 @@ type _foo.-bar:type ["keyword", "type"], ["namespace", "foo"], ["punctuation", ":"], - "type\n", + "type\r\n", + ["keyword", "type"], ["namespace", "_foo.-bar"], ["punctuation", ":"], diff --git a/tests/languages/yang/string_feature.test b/tests/languages/yang/string_feature.test index b7711d7e8e..6cd62156b5 100644 --- a/tests/languages/yang/string_feature.test +++ b/tests/languages/yang/string_feature.test @@ -10,8 +10,8 @@ o' ---------------------------------------------------- [ - ["string", "\"\n\n\\\"'foo'\\\"\n\n\""], - ["string", "'fo\n\"\"\no'"] + ["string", "\"\r\n\r\n\\\"'foo'\\\"\r\n\r\n\""], + ["string", "'fo\r\n\"\"\r\no'"] ] ---------------------------------------------------- diff --git a/tests/languages/zig/builtin-type_feature.test b/tests/languages/zig/builtin-type_feature.test new file mode 100644 index 0000000000..7f1043b5d6 --- /dev/null +++ b/tests/languages/zig/builtin-type_feature.test @@ -0,0 +1,75 @@ +i8 +u8 +i16 +u16 +i32 +u32 +i64 +u64 +i128 +u128 +isize +usize +c_short +c_ushort +c_int +c_uint +c_long +c_ulong +c_longlong +c_ulonglong +c_longdouble +c_void +f16 +f32 +f64 +f128 +bool +void +noreturn +type +anyerror +comptime_int +comptime_float + +---------------------------------------------------- + +[ + ["builtin-type", "i8"], + ["builtin-type", "u8"], + ["builtin-type", "i16"], + ["builtin-type", "u16"], + ["builtin-type", "i32"], + ["builtin-type", "u32"], + ["builtin-type", "i64"], + ["builtin-type", "u64"], + ["builtin-type", "i128"], + ["builtin-type", "u128"], + ["builtin-type", "isize"], + ["builtin-type", "usize"], + ["builtin-type", "c_short"], + ["builtin-type", "c_ushort"], + ["builtin-type", "c_int"], + ["builtin-type", "c_uint"], + ["builtin-type", "c_long"], + ["builtin-type", "c_ulong"], + ["builtin-type", "c_longlong"], + ["builtin-type", "c_ulonglong"], + ["builtin-type", "c_longdouble"], + ["builtin-type", "c_void"], + ["builtin-type", "f16"], + ["builtin-type", "f32"], + ["builtin-type", "f64"], + ["builtin-type", "f128"], + ["builtin-type", "bool"], + ["builtin-type", "void"], + ["builtin-type", "noreturn"], + ["builtin-type", "type"], + ["builtin-type", "anyerror"], + ["builtin-type", "comptime_int"], + ["builtin-type", "comptime_float"] +] + +---------------------------------------------------- + +Checks for builtin types. diff --git a/tests/languages/zig/builtin-types_feature.test b/tests/languages/zig/builtin-types_feature.test deleted file mode 100644 index 7af60750a9..0000000000 --- a/tests/languages/zig/builtin-types_feature.test +++ /dev/null @@ -1,75 +0,0 @@ -i8 -u8 -i16 -u16 -i32 -u32 -i64 -u64 -i128 -u128 -isize -usize -c_short -c_ushort -c_int -c_uint -c_long -c_ulong -c_longlong -c_ulonglong -c_longdouble -c_void -f16 -f32 -f64 -f128 -bool -void -noreturn -type -anyerror -comptime_int -comptime_float - ----------------------------------------------------- - -[ - ["builtin-types", "i8"], - ["builtin-types", "u8"], - ["builtin-types", "i16"], - ["builtin-types", "u16"], - ["builtin-types", "i32"], - ["builtin-types", "u32"], - ["builtin-types", "i64"], - ["builtin-types", "u64"], - ["builtin-types", "i128"], - ["builtin-types", "u128"], - ["builtin-types", "isize"], - ["builtin-types", "usize"], - ["builtin-types", "c_short"], - ["builtin-types", "c_ushort"], - ["builtin-types", "c_int"], - ["builtin-types", "c_uint"], - ["builtin-types", "c_long"], - ["builtin-types", "c_ulong"], - ["builtin-types", "c_longlong"], - ["builtin-types", "c_ulonglong"], - ["builtin-types", "c_longdouble"], - ["builtin-types", "c_void"], - ["builtin-types", "f16"], - ["builtin-types", "f32"], - ["builtin-types", "f64"], - ["builtin-types", "f128"], - ["builtin-types", "bool"], - ["builtin-types", "void"], - ["builtin-types", "noreturn"], - ["builtin-types", "type"], - ["builtin-types", "anyerror"], - ["builtin-types", "comptime_int"], - ["builtin-types", "comptime_float"] -] - ----------------------------------------------------- - -Checks for builtin types. diff --git a/tests/languages/zig/class-name_feature.test b/tests/languages/zig/class-name_feature.test index 9b0d92caf0..aa8a616255 100644 --- a/tests/languages/zig/class-name_feature.test +++ b/tests/languages/zig/class-name_feature.test @@ -61,75 +61,84 @@ var list2 = LinkedList(i32) {}; ["operator", "="], ["keyword", "struct"], ["punctuation", "{"], + "\r\n\tseconds", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "i64"] + ["builtin-type", "i64"] ]], ["punctuation", ","], + "\r\n\tnanos", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "u32"] + ["builtin-type", "u32"] ]], ["punctuation", ","], + ["keyword", "pub"], ["keyword", "fn"], ["function", "unixEpoch"], ["punctuation", "("], ["punctuation", ")"], - ["class-name", [ - "Timestamp" - ]], + ["class-name", ["Timestamp"]], ["punctuation", "{"], + ["keyword", "return"], - ["class-name", [ - "Timestamp" - ]], + ["class-name", ["Timestamp"]], ["punctuation", "{"], + ["punctuation", "."], "seconds ", ["operator", "="], ["number", "0"], ["punctuation", ","], + ["punctuation", "."], "nanos ", ["operator", "="], ["number", "0"], ["punctuation", ","], + ["punctuation", "}"], ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], " one_plus_one", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["operator", "="], ["number", "1"], ["operator", "+"], ["number", "1"], ["punctuation", ";"], + ["keyword", "var"], " x", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["punctuation", ";"], + ["keyword", "const"], " value", ["punctuation", ":"], ["class-name", [ ["operator", "?"], - ["builtin-types", "u32"] + ["builtin-type", "u32"] ]], ["operator", "="], ["keyword", "null"], ["punctuation", ";"], + ["keyword", "var"], " optional_value", ["punctuation", ":"], @@ -138,24 +147,26 @@ var list2 = LinkedList(i32) {}; ["punctuation", "["], ["punctuation", "]"], ["keyword", "const"], - ["builtin-types", "u8"] + ["builtin-type", "u8"] ]], ["operator", "="], ["keyword", "null"], ["punctuation", ";"], + ["keyword", "var"], " number_or_error", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "anyerror"], + ["builtin-type", "anyerror"], ["operator", "!"], - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["operator", "="], ["keyword", "error"], ["punctuation", "."], "ArgNotFound", ["punctuation", ";"], + ["keyword", "const"], " array1 ", ["operator", "="], @@ -163,7 +174,7 @@ var list2 = LinkedList(i32) {}; ["punctuation", "["], "_", ["punctuation", "]"], - ["builtin-types", "u32"] + ["builtin-type", "u32"] ]], ["punctuation", "{"], ["number", "1"], @@ -171,12 +182,11 @@ var list2 = LinkedList(i32) {}; ["number", "2"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "var"], " foo", ["punctuation", ":"], - ["class-name", [ - "S" - ]], + ["class-name", ["S"]], ["keyword", "align"], ["punctuation", "("], ["number", "4"], @@ -184,31 +194,35 @@ var list2 = LinkedList(i32) {}; ["operator", "="], ["keyword", "undefined"], ["punctuation", ";"], + ["keyword", "fn"], ["function", "add"], ["punctuation", "("], "a", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["punctuation", ","], " b", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["punctuation", ")"], ["class-name", [ - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["punctuation", "{"], + ["keyword", "return"], " a ", ["operator", "+"], " b", ["punctuation", ";"], + ["punctuation", "}"], + ["keyword", "extern"], ["keyword", "fn"], ["function", "foo"], @@ -216,13 +230,14 @@ var list2 = LinkedList(i32) {}; "x", ["punctuation", ":"], ["class-name", [ - ["builtin-types", "f64"] + ["builtin-type", "f64"] ]], ["punctuation", ")"], ["class-name", [ - ["builtin-types", "f64"] + ["builtin-type", "f64"] ]], ["punctuation", ";"], + ["keyword", "fn"], ["function", "noop4"], ["punctuation", "("], @@ -232,10 +247,11 @@ var list2 = LinkedList(i32) {}; ["number", "4"], ["punctuation", ")"], ["class-name", [ - ["builtin-types", "void"] + ["builtin-type", "void"] ]], ["punctuation", "{"], ["punctuation", "}"], + ["keyword", "fn"], ["function", "derp"], ["punctuation", "("], @@ -244,28 +260,30 @@ var list2 = LinkedList(i32) {}; ["punctuation", "("], ["builtin", "@sizeOf"], ["punctuation", "("], - ["builtin-types", "usize"], + ["builtin-type", "usize"], ["punctuation", ")"], ["operator", "*"], ["number", "2"], ["punctuation", ")"], ["class-name", [ - ["builtin-types", "i32"] + ["builtin-type", "i32"] ]], ["punctuation", "{"], ["keyword", "return"], ["number", "1234"], ["punctuation", ";"], ["punctuation", "}"], + ["keyword", "fn"], ["function", "eventuallyNullSequence"], ["punctuation", "("], ["punctuation", ")"], ["class-name", [ ["operator", "?"], - ["builtin-types", "u32"] + ["builtin-type", "u32"] ]], ["punctuation", "{"], + ["keyword", "return"], ["keyword", "if"], ["punctuation", "("], @@ -278,18 +296,23 @@ var list2 = LinkedList(i32) {}; ["label", "blk"], ["punctuation", ":"], ["punctuation", "{"], + "\r\n\t\tnumbers_left ", ["operator", "-="], ["number", "1"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ":"], ["label", "blk"], " numbers_left", ["punctuation", ";"], + ["punctuation", "}"], ["punctuation", ";"], + ["punctuation", "}"], + ["keyword", "const"], " message ", ["operator", "="], @@ -297,20 +320,21 @@ var list2 = LinkedList(i32) {}; ["punctuation", "["], "_", ["punctuation", "]"], - ["builtin-types", "u8"] + ["builtin-type", "u8"] ]], ["punctuation", "{"], - ["string", "'h'"], + ["char", "'h'"], ["punctuation", ","], - ["string", "'e'"], + ["char", "'e'"], ["punctuation", ","], - ["string", "'l'"], + ["char", "'l'"], ["punctuation", ","], - ["string", "'l'"], + ["char", "'l'"], ["punctuation", ","], - ["string", "'o'"], + ["char", "'o'"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], " mat4x4 ", ["operator", "="], @@ -321,14 +345,15 @@ var list2 = LinkedList(i32) {}; ["punctuation", "["], ["number", "4"], ["punctuation", "]"], - ["builtin-types", "f32"] + ["builtin-type", "f32"] ]], ["punctuation", "{"], + ["class-name", [ ["punctuation", "["], "_", ["punctuation", "]"], - ["builtin-types", "f32"] + ["builtin-type", "f32"] ]], ["punctuation", "{"], ["number", "1.0"], @@ -340,11 +365,12 @@ var list2 = LinkedList(i32) {}; ["number", "0.0"], ["punctuation", "}"], ["punctuation", ","], + ["class-name", [ ["punctuation", "["], "_", ["punctuation", "]"], - ["builtin-types", "f32"] + ["builtin-type", "f32"] ]], ["punctuation", "{"], ["number", "0.0"], @@ -356,11 +382,12 @@ var list2 = LinkedList(i32) {}; ["number", "1.0"], ["punctuation", "}"], ["punctuation", ","], + ["class-name", [ ["punctuation", "["], "_", ["punctuation", "]"], - ["builtin-types", "f32"] + ["builtin-type", "f32"] ]], ["punctuation", "{"], ["number", "0.0"], @@ -372,11 +399,12 @@ var list2 = LinkedList(i32) {}; ["number", "0.0"], ["punctuation", "}"], ["punctuation", ","], + ["class-name", [ ["punctuation", "["], "_", ["punctuation", "]"], - ["builtin-types", "f32"] + ["builtin-type", "f32"] ]], ["punctuation", "{"], ["number", "0.0"], @@ -388,8 +416,10 @@ var list2 = LinkedList(i32) {}; ["number", "1.0"], ["punctuation", "}"], ["punctuation", ","], + ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Point"], ["operator", "="], @@ -397,6 +427,7 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Point2"], ["operator", "="], @@ -405,6 +436,7 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Type"], ["operator", "="], @@ -412,6 +444,7 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Value"], ["operator", "="], @@ -422,17 +455,19 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Number"], ["operator", "="], ["keyword", "packed"], ["keyword", "enum"], ["punctuation", "("], - ["builtin-types", "u8"], + ["builtin-type", "u8"], ["punctuation", ")"], ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Foo"], ["operator", "="], @@ -446,6 +481,7 @@ var list2 = LinkedList(i32) {}; " C ", ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Foo"], ["operator", "="], @@ -459,6 +495,7 @@ var list2 = LinkedList(i32) {}; " C ", ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "Payload"], ["operator", "="], @@ -466,6 +503,7 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "const"], ["class-name", "ComplexType"], ["operator", "="], @@ -476,6 +514,7 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "var"], " node ", ["operator", "="], @@ -487,12 +526,13 @@ var list2 = LinkedList(i32) {}; ["punctuation", "{"], ["punctuation", "}"], ["punctuation", ";"], + ["keyword", "var"], " list2 ", ["operator", "="], ["function", "LinkedList"], ["punctuation", "("], - ["builtin-types", "i32"], + ["builtin-type", "i32"], ["punctuation", ")"], ["punctuation", "{"], ["punctuation", "}"], diff --git a/tests/languages/zig/comment_feature.test b/tests/languages/zig/comment_feature.test new file mode 100644 index 0000000000..0bbe6b193b --- /dev/null +++ b/tests/languages/zig/comment_feature.test @@ -0,0 +1,21 @@ +// normal comment + +/// A structure for storing a timestamp, with nanosecond precision (this is a +/// multiline doc comment). + +//! This module provides functions for retrieving the current date and +//! time with varying degrees of precision and accuracy. It does not +//! depend on libc, but will use functions from it if available. + +---------------------------------------------------- + +[ + ["comment", "// normal comment"], + + ["comment", "/// A structure for storing a timestamp, with nanosecond precision (this is a"], + ["comment", "/// multiline doc comment)."], + + ["comment", "//! This module provides functions for retrieving the current date and"], + ["comment", "//! time with varying degrees of precision and accuracy. It does not"], + ["comment", "//! depend on libc, but will use functions from it if available."] +] diff --git a/tests/languages/zig/keyword_feature.test b/tests/languages/zig/keyword_feature.test index 4143eec83d..842e149ec6 100644 --- a/tests/languages/zig/keyword_feature.test +++ b/tests/languages/zig/keyword_feature.test @@ -1,6 +1,8 @@ align allowzero and +anyframe +anytype asm async await @@ -24,6 +26,7 @@ inline linksection nakedcc noalias +nosuspend null or orelse @@ -53,6 +56,8 @@ while ["keyword", "align"], ["keyword", "allowzero"], ["keyword", "and"], + ["keyword", "anyframe"], + ["keyword", "anytype"], ["keyword", "asm"], ["keyword", "async"], ["keyword", "await"], @@ -76,6 +81,7 @@ while ["keyword", "linksection"], ["keyword", "nakedcc"], ["keyword", "noalias"], + ["keyword", "nosuspend"], ["keyword", "null"], ["keyword", "or"], ["keyword", "orelse"], diff --git a/tests/languages/zig/label_feature.test b/tests/languages/zig/label_feature.test index e402699099..ccf5e8b54b 100644 --- a/tests/languages/zig/label_feature.test +++ b/tests/languages/zig/label_feature.test @@ -21,27 +21,33 @@ fn eventuallyErrorSequence() anyerror!u32 { ["boolean", "true"], ["punctuation", ")"], ["punctuation", "{"], + ["keyword", "while"], ["punctuation", "("], ["boolean", "true"], ["punctuation", ")"], ["punctuation", "{"], + ["keyword", "break"], ["punctuation", ":"], ["label", "outer"], ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", "}"], + ["keyword", "fn"], ["function", "eventuallyErrorSequence"], ["punctuation", "("], ["punctuation", ")"], ["class-name", [ - ["builtin-types", "anyerror"], + ["builtin-type", "anyerror"], ["operator", "!"], - ["builtin-types", "u32"] + ["builtin-type", "u32"] ]], ["punctuation", "{"], + ["keyword", "return"], ["keyword", "if"], ["punctuation", "("], @@ -56,17 +62,21 @@ fn eventuallyErrorSequence() anyerror!u32 { ["label", "blk"], ["punctuation", ":"], ["punctuation", "{"], + "\r\n\t\tnumbers_left ", ["operator", "-="], ["number", "1"], ["punctuation", ";"], + ["keyword", "break"], ["punctuation", ":"], ["label", "blk"], " numbers_left", ["punctuation", ";"], + ["punctuation", "}"], ["punctuation", ";"], + ["punctuation", "}"] ] diff --git a/tests/languages/zig/string_char_feature.test b/tests/languages/zig/string_char_feature.test new file mode 100644 index 0000000000..86399d964c --- /dev/null +++ b/tests/languages/zig/string_char_feature.test @@ -0,0 +1,160 @@ +// source: https://ziglang.org/documentation/master/#String-Literals-and-Character-Literals + +const expect = @import("std").testing.expect; +const mem = @import("std").mem; + +test "string literals" { + const bytes = "hello"; + expect(@TypeOf(bytes) == *const [5:0]u8); + expect(bytes.len == 5); + expect(bytes[1] == 'e'); + expect(bytes[5] == 0); + expect('e' == '\x65'); + expect('\u{1f4a9}' == 128169); + expect('💯' == 128175); + expect(mem.eql(u8, "hello", "h\x65llo")); +} + +const hello_world_in_c = + \\#include + \\ + \\int main(int argc, char **argv) { + \\ printf("hello world\n"); + \\ return 0; + \\} +; + +---------------------------------------------------- + +[ + ["comment", "// source: https://ziglang.org/documentation/master/#String-Literals-and-Character-Literals"], + + ["keyword", "const"], + " expect ", + ["operator", "="], + ["builtin", "@import"], + ["punctuation", "("], + ["string", "\"std\""], + ["punctuation", ")"], + ["punctuation", "."], + "testing", + ["punctuation", "."], + "expect", + ["punctuation", ";"], + + ["keyword", "const"], + " mem ", + ["operator", "="], + ["builtin", "@import"], + ["punctuation", "("], + ["string", "\"std\""], + ["punctuation", ")"], + ["punctuation", "."], + "mem", + ["punctuation", ";"], + + ["keyword", "test"], + ["string", "\"string literals\""], + ["punctuation", "{"], + + ["keyword", "const"], + " bytes ", + ["operator", "="], + ["string", "\"hello\""], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + ["builtin", "@TypeOf"], + ["punctuation", "("], + "bytes", + ["punctuation", ")"], + ["operator", "=="], + ["operator", "*"], + ["keyword", "const"], + ["punctuation", "["], + ["number", "5"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", "]"], + ["builtin-type", "u8"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + "bytes", + ["punctuation", "."], + "len ", + ["operator", "=="], + ["number", "5"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + "bytes", + ["punctuation", "["], + ["number", "1"], + ["punctuation", "]"], + ["operator", "=="], + ["char", "'e'"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + "bytes", + ["punctuation", "["], + ["number", "5"], + ["punctuation", "]"], + ["operator", "=="], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + ["char", "'e'"], + ["operator", "=="], + ["char", "'\\x65'"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + ["char", "'\\u{1f4a9}'"], + ["operator", "=="], + ["number", "128169"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + ["char", "'💯'"], + ["operator", "=="], + ["number", "128175"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["function", "expect"], + ["punctuation", "("], + "mem", + ["punctuation", "."], + ["function", "eql"], + ["punctuation", "("], + ["builtin-type", "u8"], + ["punctuation", ","], + ["string", "\"hello\""], + ["punctuation", ","], + ["string", "\"h\\x65llo\""], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ";"], + + ["punctuation", "}"], + + ["keyword", "const"], " hello_world_in_c ", ["operator", "="], + ["string", " \\\\#include \r\n \\\\\r\n \\\\int main(int argc, char **argv) {\r\n \\\\ printf(\"hello world\\n\");\r\n \\\\ return 0;\r\n \\\\}"], + ["punctuation", ";"] +] diff --git a/tests/pattern-tests.js b/tests/pattern-tests.js index cbf1d54eca..91ce21eddf 100644 --- a/tests/pattern-tests.js +++ b/tests/pattern-tests.js @@ -1,32 +1,49 @@ -"use strict"; +// @ts-check +'use strict'; const { assert } = require('chai'); const PrismLoader = require('./helper/prism-loader'); -const { BFS, parseRegex } = require('./helper/util'); +const TestDiscovery = require('./helper/test-discovery'); +const TestCase = require('./helper/test-case'); +const { BFS, BFSPathToPrismTokenPath, parseRegex } = require('./helper/util'); const { languages } = require('../components.json'); const { visitRegExpAST } = require('regexpp'); +const { transform, combineTransformers, getIntersectionWordSets, JS, Words, NFA, Transformers } = require('refa'); +const scslre = require('scslre'); +const { argv } = require('yargs'); +const RAA = require('regexp-ast-analysis'); + +/** + * A map from language id to a list of code snippets in that language. + * + * @type {Map} + */ +const testSnippets = new Map(); +const testSuite = TestDiscovery.loadAllTests(); +for (const [languageIdentifier, files] of testSuite) { + const lang = TestCase.parseLanguageNames(languageIdentifier).mainLanguage; + let snippets = testSnippets.get(lang); + if (snippets === undefined) { + snippets = []; + testSnippets.set(lang, snippets); + } + + for (const file of files) { + snippets.push(TestCase.TestCaseFile.readFromFile(file).code); + } +} for (const lang in languages) { - if (lang === 'meta') { + if (lang === 'meta' || (!!argv.language && lang !== argv.language)) { continue; } describe(`Patterns of '${lang}'`, function () { const Prism = PrismLoader.createInstance(lang); - testPatterns(Prism); + testPatterns(Prism, lang); }); - function toArray(value) { - if (Array.isArray(value)) { - return value; - } else if (value != null) { - return [value]; - } else { - return []; - } - } - let optional = toArray(languages[lang].optional); let modify = toArray(languages[lang].modify); @@ -41,7 +58,7 @@ for (const lang in languages) { describe(name, function () { const Prism = PrismLoader.createInstance([...optional, ...modify, lang]); - testPatterns(Prism); + testPatterns(Prism, lang); }); } } @@ -50,12 +67,28 @@ for (const lang in languages) { * Tests all patterns in the given Prism instance. * * @param {any} Prism + * @param {string} mainLanguage * * @typedef {import("./helper/util").LiteralAST} LiteralAST + * @typedef {import("regexpp/ast").CapturingGroup} CapturingGroup * @typedef {import("regexpp/ast").Element} Element + * @typedef {import("regexpp/ast").Group} Group + * @typedef {import("regexpp/ast").LookaroundAssertion} LookaroundAssertion * @typedef {import("regexpp/ast").Pattern} Pattern */ -function testPatterns(Prism) { +function testPatterns(Prism, mainLanguage) { + + /** + * Returns a list of relevant languages in the Prism instance. + * + * The list does not included readonly dependencies and aliases. + * + * @returns {string[]} + */ + function getRelevantLanguages() { + return [mainLanguage, ...toArray(languages[mainLanguage].modify)] + .filter(lang => lang in Prism.languages); + } /** * Invokes the given function on every pattern in `Prism.languages`. @@ -72,53 +105,80 @@ function testPatterns(Prism) { * @property {string} name * @property {any} parent * @property {boolean} lookbehind Whether the first capturing group of the pattern is a Prism lookbehind group. + * @property {CapturingGroup | undefined} lookbehindGroup * @property {{ key: string, value: any }[]} path * @property {(message: string) => void} reportError */ function forEachPattern(callback) { + const visited = new Set(); const errors = []; - BFS(Prism.languages, path => { - const { key, value } = path[path.length - 1]; - - let tokenPath = 'Prism.languages'; - for (const { key } of path) { - if (!key) { - // do nothing - } else if (/^\d+$/.test(key)) { - tokenPath += `[${key}]`; - } else if (/^[a-z]\w*$/i.test(key)) { - tokenPath += `.${key}`; - } else { - tokenPath += `[${JSON.stringify(key)}]`; - } + /** + * @param {object} root + * @param {string} rootStr + */ + function traverse(root, rootStr) { + if (visited.has(root)) { + return; } + visited.add(root); + + BFS(root, path => { + const { key, value } = path[path.length - 1]; + const tokenPath = BFSPathToPrismTokenPath(path, rootStr); + visited.add(value); - if (Object.prototype.toString.call(value) == '[object RegExp]') { - try { - let ast; + if (Object.prototype.toString.call(value) == '[object RegExp]') { try { - ast = parseRegex(value); + let ast; + try { + ast = parseRegex(value); + } catch (error) { + throw new SyntaxError(`Invalid RegExp at ${tokenPath}\n\n${error.message}`); + } + + const parent = path.length > 1 ? path[path.length - 2].value : undefined; + const lookbehind = key === 'pattern' && parent && !!parent.lookbehind; + const lookbehindGroup = lookbehind ? getFirstCapturingGroup(ast.pattern) : undefined; + callback({ + pattern: value, + ast, + tokenPath, + name: key, + parent, + path, + lookbehind, + lookbehindGroup, + reportError: message => errors.push(message) + }); } catch (error) { - throw new SyntaxError(`Invalid RegExp at ${tokenPath}\n\n${error.message}`); + errors.push(error); } - - const parent = path.length > 1 ? path[path.length - 2].value : undefined; - callback({ - pattern: value, - ast, - tokenPath, - name: key, - parent, - path, - lookbehind: key === 'pattern' && parent && !!parent.lookbehind, - reportError: message => errors.push(message) - }); - } catch (error) { - errors.push(error); } + }); + } + + // static analysis + traverse(Prism.languages, 'Prism.languages'); + + // dynamic analysis + for (const lang of getRelevantLanguages()) { + const snippets = testSnippets.get(lang); + const grammar = Prism.languages[lang]; + + const oldTokenize = Prism.tokenize; + Prism.tokenize = function (_, grammar) { + const result = oldTokenize.apply(this, arguments); + traverse(grammar, lang + ': '); + return result; + }; + + for (const snippet of (snippets || [])) { + Prism.highlight(snippet, grammar, lang); } - }); + + Prism.tokenize = oldTokenize; + } if (errors.length > 0) { throw new Error(errors.map(e => String(e.message || e)).join('\n\n')); @@ -132,7 +192,7 @@ function testPatterns(Prism) { * @param {(values: ForEachCapturingGroupCallbackValue) => void} callback * * @typedef ForEachCapturingGroupCallbackValue - * @property {import("regexpp/ast").CapturingGroup} group + * @property {CapturingGroup} group * @property {number} number Note: Starts at 1. */ function forEachCapturingGroup(pattern, callback) { @@ -147,69 +207,12 @@ function testPatterns(Prism) { }); } - /** - * Returns whether the given element will always have zero width meaning that it doesn't consume characters. - * - * @param {Element} element - * @returns {boolean} - */ - function isAlwaysZeroWidth(element) { - switch (element.type) { - case 'Assertion': - // assertions == ^, $, \b, lookarounds - return true; - case 'Quantifier': - return element.max === 0 || isAlwaysZeroWidth(element.element); - case 'CapturingGroup': - case 'Group': - // every element in every alternative has to be of zero length - return element.alternatives.every(alt => alt.elements.every(isAlwaysZeroWidth)); - case 'Backreference': - // on if the group referred to is of zero length - return isAlwaysZeroWidth(element.resolved); - default: - return false; // what's left are characters - } - } - - /** - * Returns whether the given element will always at the start of the whole match. - * - * @param {Element} element - * @returns {boolean} - */ - function isFirstMatch(element) { - const parent = element.parent; - switch (parent.type) { - case 'Alternative': - // all elements before this element have to of zero length - if (!parent.elements.slice(0, parent.elements.indexOf(element)).every(isAlwaysZeroWidth)) { - return false; - } - const grandParent = parent.parent; - if (grandParent.type === 'Pattern') { - return true; - } else { - return isFirstMatch(grandParent); - } - - case 'Quantifier': - if (parent.max >= 2) { - return false; - } else { - return isFirstMatch(parent); - } - - default: - throw new Error(`Internal error: The given node should not be a '${element.type}'.`); - } - } - it('- should not match the empty string', function () { - forEachPattern(({ pattern, tokenPath }) => { + forEachPattern(({ ast, pattern, tokenPath }) => { // test for empty string - assert.notMatch('', pattern, `${tokenPath}: ${pattern} should not match the empty string.\n\n` + const empty = RAA.isPotentiallyZeroLength(ast.pattern.alternatives); + assert.isFalse(empty, `${tokenPath}: ${pattern} should not match the empty string.\n\n` + `Patterns that do match the empty string can potentially cause infinitely many empty tokens. ` + `Make sure that all patterns always consume at least one character.`); }); @@ -232,47 +235,37 @@ function testPatterns(Prism) { }); it('- should not have lookbehind groups that can be preceded by other some characters', function () { - forEachPattern(({ ast, tokenPath, lookbehind }) => { - if (!lookbehind) { - return; + forEachPattern(({ tokenPath, lookbehindGroup }) => { + if (lookbehindGroup && !isFirstMatch(lookbehindGroup)) { + assert.fail(`${tokenPath}: The lookbehind group ${lookbehindGroup.raw} might be preceded by some characters.\n\n` + + `Prism assumes that the lookbehind group, if captured, is the first thing matched by the regex. ` + + `If characters might precede the lookbehind group (e.g. /a?(b)c/), then Prism cannot correctly apply the lookbehind correctly in all cases.\n` + + `To fix this, either remove the preceding characters or include them in the lookbehind group.`); } - forEachCapturingGroup(ast.pattern, ({ group, number }) => { - if (number === 1 && !isFirstMatch(group)) { - assert.fail(`${tokenPath}: The lookbehind group ${group.raw} might be preceded by some characters.\n\n` - + `Prism assumes that the lookbehind group, if captured, is the first thing matched by the regex. ` - + `If characters might precede the lookbehind group (e.g. /a?(b)c/), then Prism cannot correctly apply the lookbehind correctly in all cases.\n` - + `To fix this, either remove the preceding characters or include them in the lookbehind group.`); - } - }); }); }); it('- should not have lookbehind groups that only have zero-width alternatives', function () { - forEachPattern(({ ast, tokenPath, lookbehind, reportError }) => { - if (!lookbehind) { - return; + forEachPattern(({ tokenPath, lookbehindGroup, reportError }) => { + if (lookbehindGroup && RAA.isZeroLength(lookbehindGroup)) { + const groupContent = lookbehindGroup.raw.substr(1, lookbehindGroup.raw.length - 2); + const replacement = lookbehindGroup.alternatives.length === 1 ? groupContent : `(?:${groupContent})`; + reportError(`${tokenPath}: The lookbehind group ${lookbehindGroup.raw} does not consume characters.\n\n` + + `Therefor it is not necessary to use a lookbehind group.\n` + + `To fix this, replace the lookbehind group with ${replacement} and remove the 'lookbehind' property.`); } - forEachCapturingGroup(ast.pattern, ({ group, number }) => { - if (number === 1 && isAlwaysZeroWidth(group)) { - const groupContent = group.raw.substr(1, group.raw.length - 2); - const replacement = group.alternatives.length === 1 ? groupContent : `(?:${groupContent})`; - reportError(`${tokenPath}: The lookbehind group ${group.raw} does not consume characters.\n\n` - + `Therefor it is not necessary to use a lookbehind group.\n` - + `To fix this, replace the lookbehind group with ${replacement} and remove the 'lookbehind' property.`); - } - }); }); }); it('- should not have unused capturing groups', function () { - forEachPattern(({ ast, tokenPath, lookbehind, reportError }) => { + forEachPattern(({ ast, tokenPath, lookbehindGroup, reportError }) => { forEachCapturingGroup(ast.pattern, ({ group, number }) => { - const isLookbehindGroup = lookbehind && number === 1; + const isLookbehindGroup = group === lookbehindGroup; if (group.references.length === 0 && !isLookbehindGroup) { const fixes = []; fixes.push(`Make this group a non-capturing group ('(?:...)' instead of '(...)'). (It's usually this option.)`); fixes.push(`Reference this group with a backreference (use '\\${number}' for this).`); - if (number === 1 && !lookbehind) { + if (number === 1 && !lookbehindGroup) { if (isFirstMatch(group)) { fixes.push(`Add a 'lookbehind: true' declaration.`); } else { @@ -291,7 +284,7 @@ function testPatterns(Prism) { }); it('- should have nice names and aliases', function () { - const niceName = /^[a-z][a-z\d]*(?:[-_][a-z\d]+)*$/; + const niceName = /^[a-z][a-z\d]*(?:-[a-z\d]+)*$/; function testName(name, desc = 'token name') { if (!niceName.test(name)) { assert.fail(`The ${desc} '${name}' does not match ${niceName}.\n\n` @@ -338,4 +331,452 @@ function testPatterns(Prism) { }); }); + it('- should not cause exponential backtracking', function () { + replaceRegExpProto(exec => { + return function (input) { + checkExponentialBacktracking('', this); + return exec.call(this, input); + }; + }, () => { + forEachPattern(({ pattern, ast, tokenPath }) => { + checkExponentialBacktracking(tokenPath, pattern, ast); + }); + }); + }); + + it('- should not cause polynomial backtracking', function () { + replaceRegExpProto(exec => { + return function (input) { + checkPolynomialBacktracking('', this); + return exec.call(this, input); + }; + }, () => { + forEachPattern(({ pattern, ast, tokenPath }) => { + checkPolynomialBacktracking(tokenPath, pattern, ast); + }); + }); + }); + +} + + +/** + * Returns the first capturing group in the given pattern. + * + * @param {Pattern} pattern + * @returns {CapturingGroup | undefined} + */ +function getFirstCapturingGroup(pattern) { + let cap = undefined; + + try { + visitRegExpAST(pattern, { + onCapturingGroupEnter(node) { + cap = node; + throw new Error('stop'); + } + }); + } catch (error) { + // ignore errors + } + + return cap; +} + +/** + * Returns whether the given element will always at the start of the whole match. + * + * @param {Element} element + * @returns {boolean} + */ +function isFirstMatch(element) { + const parent = element.parent; + switch (parent.type) { + case 'Alternative': { + // all elements before this element have to of zero length + if (!parent.elements.slice(0, parent.elements.indexOf(element)).every(RAA.isZeroLength)) { + return false; + } + const grandParent = parent.parent; + if (grandParent.type === 'Pattern') { + return true; + } else { + return isFirstMatch(grandParent); + } + } + + case 'Quantifier': + if (parent.max >= 2) { + return false; + } else { + return isFirstMatch(parent); + } + + default: + throw new Error(`Internal error: The given node should not be a '${element.type}'.`); + } +} + +/** + * Returns whether the given node either is or is a child of what is effectively a Kleene star. + * + * @param {import("regexpp/ast").Node} node + * @returns {boolean} + */ +function underAStar(node) { + return RAA.getEffectiveMaximumRepetition(node) > 10; +} + +/** + * @param {Iterable} iter + * @returns {T | undefined} + * @template T + */ +function firstOf(iter) { + const [first] = iter; + return first; +} + +/** + * A set of all safe (non-exponentially backtracking) RegExp literals (string). + * + * @type {Set} + */ +const expoSafeRegexes = new Set(); + +/** @type {Transformers.CreationOptions} */ +const options = { + ignoreOrder: true, + ignoreAmbiguity: true +}; +const transformer = combineTransformers([ + Transformers.inline(options), + Transformers.removeDeadBranches(options), + Transformers.unionCharacters(options), + Transformers.moveUpEmpty(options), + Transformers.nestedQuantifiers(options), + Transformers.sortAssertions(options), + Transformers.removeUnnecessaryAssertions(options), + Transformers.applyAssertions(options), +]); + + +/** + * @param {string} path + * @param {RegExp} pattern + * @param {LiteralAST} [ast] + * @returns {void} + */ +function checkExponentialBacktracking(path, pattern, ast) { + if (expoSafeRegexes.has(pattern)) { + // we know that the pattern won't cause exp backtracking because we checked before + return; + } + const patternStr = String(pattern); + if (expoSafeRegexes.has(patternStr)) { + // we know that the pattern won't cause exp backtracking because we checked before + return; + } + + if (!ast) { + ast = parseRegex(pattern); + } + + const parser = JS.Parser.fromAst(ast); + /** + * Parses the given element and creates its NFA. + * + * @param {import("refa").JS.ParsableElement} element + * @returns {NFA} + */ + function toNFA(element) { + let { expression, maxCharacter } = parser.parseElement(element, { + maxBackreferenceWords: 1000, + backreferences: 'disable' + }); + + return NFA.fromRegex(transform(transformer, expression), { maxCharacter }, { assertions: 'disable' }); + } + + /** + * Checks whether the alternatives of the given node are disjoint. If the alternatives are not disjoint + * and the give node is a descendant of an effective Kleene star, then an error will be thrown. + * + * @param {CapturingGroup | Group | LookaroundAssertion} node + * @returns {void} + */ + function checkDisjointAlternatives(node) { + if (!underAStar(node) || node.alternatives.length < 2) { + return; + } + + const alternatives = node.alternatives; + + const total = toNFA(alternatives[0]); + total.withoutEmptyWord(); + for (let i = 1, l = alternatives.length; i < l; i++) { + const a = alternatives[i]; + const current = toNFA(a); + current.withoutEmptyWord(); + + if (!total.isDisjointWith(current)) { + assert.fail(`${path}: The alternative \`${a.raw}\` is not disjoint with at least one previous alternative.` + + ` This will cause exponential backtracking.` + + `\n\nTo fix this issue, you have to rewrite the ${node.type} \`${node.raw}\`.` + + ` The goal is that all of its alternatives are disjoint.` + + ` This means that if a (sub-)string is matched by the ${node.type}, then only one of its alternatives can match the (sub-)string.` + + `\n\nExample: \`(?:[ab]|\\w|::)+\`` + + `\nThe alternatives of the group are not disjoint because the string "a" can be matched by both \`[ab]\` and \`\\w\`.` + + ` In this example, the pattern can easily be fixed because the \`[ab]\` is a subset of the \`\\w\`, so its enough to remove the \`[ab]\` alternative to get \`(?:\\w|::)+\` as the fixed pattern.` + + `\nIn the real world, patterns can be a lot harder to fix.` + + ` If you are trying to make the tests pass for a pull request but can\'t fix the issue yourself, then make the pull request (or commit) anyway.` + + ` A maintainer will help you.` + + `\n\nFull pattern:\n${pattern}`); + } else if (i !== l - 1) { + total.union(current); + } + } + } + + visitRegExpAST(ast.pattern, { + onCapturingGroupLeave: checkDisjointAlternatives, + onGroupLeave: checkDisjointAlternatives, + onAssertionLeave(node) { + if (node.kind === 'lookahead' || node.kind === 'lookbehind') { + checkDisjointAlternatives(node); + } + }, + + onQuantifierLeave(node) { + if (node.max < 10) { + return; // not a star + } + if (node.element.type !== 'CapturingGroup' && node.element.type !== 'Group') { + return; // not a group + } + + // The idea here is the following: + // + // We have found a part `A*` of the regex (`A` is assumed to not accept the empty word). Let `I` be + // the intersection of `A` and `A{2,}`. If `I` is not empty, then there exists a non-empty word `w` + // that is accepted by both `A` and `A{2,}`. That means that there exists some `m>1` for which `w` + // is accepted by `A{m}`. + // This means that there are at least two ways `A*` can accept `w`. It can be accepted as `A` or as + // `A{m}`. Hence there are at least 2^n ways for `A*` to accept the word `w{n}`. This is the main + // requirement for exponential backtracking. + // + // This is actually only a crude approximation for the real analysis that would have to be done. We + // would actually have to check the intersection `A{p}` and `A{p+1,}` for all p>0. However, in most + // cases, the approximation is good enough. + + const nfa = toNFA(node.element); + nfa.withoutEmptyWord(); + const twoStar = nfa.copy(); + twoStar.quantify(2, Infinity); + + if (!nfa.isDisjointWith(twoStar)) { + const word = Words.pickMostReadableWord(firstOf(getIntersectionWordSets(nfa, twoStar))); + const example = Words.fromUnicodeToString(word); + assert.fail(`${path}: The quantifier \`${node.raw}\` ambiguous for all words ${JSON.stringify(example)}.repeat(n) for any n>1.` + + ` This will cause exponential backtracking.` + + `\n\nTo fix this issue, you have to rewrite the element (let's call it E) of the quantifier.` + + ` The goal is modify E such that it is disjoint with repetitions of itself.` + + ` This means that if a (sub-)string is matched by E, then it must not be possible for E{2}, E{3}, E{4}, etc. to match that (sub-)string.` + + `\n\nExample 1: \`(?:\\w+|::)+\`` + + `\nThe problem lies in \`\\w+\` because \`\\w+\` and \`(?:\\w+){2}\` are not disjoint as the string "aa" is fully matched by both.` + + ` In this example, the pattern can easily be fixed by changing \`\\w+\` to \`\\w\`.` + + `\nExample 2: \`(?:\\w|Foo)+\`` + + `\nThe problem lies in \`\\w\` and \`Foo\` because the string "Foo" can be matched as either repeating \`\\w\` 3 times or by using the \`Foo\` alternative once.` + + ` In this example, the pattern can easily be fixed because the \`Foo\` alternative is redundant can can be removed.` + + `\nExample 3: \`(?:\\.\\w+(?:<.*?>)?)+\`` + + `\nThe problem lies in \`<.*?>\`. The string ".a<>.a<>" can be matched as either \`\\. \\w < . . . . >\` or \`\\. \\w < > \\. \\w < >\`.` + + ` When it comes to exponential backtracking, it doesn't matter whether a quantifier is greedy or lazy.` + + ` This means that the lazy \`.*?\` can jump over \`>\`.` + + ` In this example, the pattern can easily be fixed because we just have to prevent \`.*?\` jumping over \`>\`.` + + ` This can done by replacing \`<.*?>\` with \`<[^\\r\\n>]*>\`.` + + `\n\nIn the real world, patterns can be a lot harder to fix.` + + ` If you are trying to make this test pass for a pull request but can\'t fix the issue yourself, then make the pull request (or commit) anyway, a maintainer will help you.` + + `\n\nFull pattern:\n${pattern}`); + } + }, + }); + + expoSafeRegexes.add(pattern); + expoSafeRegexes.add(patternStr); +} + +/** + * A set of all safe (non-polynomially backtracking) RegExp literals (string). + * + * @type {Set} + */ +const polySafeRegexes = new Set(); +/** + * @param {string} path + * @param {RegExp} pattern + * @param {LiteralAST} [ast] + * @returns {void} + */ +function checkPolynomialBacktracking(path, pattern, ast) { + if (polySafeRegexes.has(pattern)) { + // we know that the pattern won't cause poly backtracking because we checked before + return; + } + const patternStr = String(pattern); + if (polySafeRegexes.has(patternStr)) { + // we know that the pattern won't cause poly backtracking because we checked before + return; + } + + if (!ast) { + ast = parseRegex(pattern); + } + + const result = scslre.analyse(ast, { maxReports: 1, reportTypes: { 'Move': false } }); + if (result.reports.length > 0) { + const report = result.reports[0]; + + let rangeOffset; + let rangeStr; + let rangeHighlight; + + switch (report.type) { + case 'Trade': { + const start = Math.min(report.startQuant.start, report.endQuant.start); + const end = Math.max(report.startQuant.end, report.endQuant.end); + rangeOffset = start + 1; + rangeStr = patternStr.substring(start + 1, end + 1); + rangeHighlight = highlight([ + { ...report.startQuant, label: 'start' }, + { ...report.endQuant, label: 'end' } + ], -start); + break; + } + case 'Self': { + rangeOffset = report.parentQuant.start + 1; + rangeStr = patternStr.substring(report.parentQuant.start + 1, report.parentQuant.end + 1); + rangeHighlight = highlight([{ ...report.quant, label: 'self' }], -report.parentQuant.start); + break; + } + case 'Move': { + rangeOffset = 1; + rangeStr = patternStr.substring(1, report.quant.end + 1); + rangeHighlight = highlight([report.quant]); + break; + } + default: + throw new Error('Invalid report type. This should never happen.'); + } + + const attackChar = `/${report.character.literal.source}/${report.character.literal.flags}`; + const fixed = report.fix(); + + assert.fail( + `${path}: ${report.exponential ? 'Exponential' : 'Polynomial'} backtracking. ` + + `By repeating any character that matches ${attackChar}, an attack string can be created.` + + `\n` + + `\n${indent(rangeStr)}` + + `\n${indent(rangeHighlight)}` + + `\n` + + `\nFull pattern:` + + `\n${patternStr}` + + `\n${indent(rangeHighlight, ' '.repeat(rangeOffset))}` + + `\n` + + `\n` + (fixed ? `Fixed:\n/${fixed.source}/${fixed.flags}` : `Fix not available.`) + ); + } + + polySafeRegexes.add(pattern); + polySafeRegexes.add(patternStr); +} + +/** + * @param {Highlight[]} highlights + * @param {number} [offset] + * @returns {string} + * + * @typedef Highlight + * @property {number} start + * @property {number} end + * @property {string} [label] + */ +function highlight(highlights, offset = 0) { + highlights.sort((a, b) => a.start - b.start); + + const lines = []; + while (highlights.length > 0) { + const newHighlights = []; + let l = ''; + for (const highlight of highlights) { + const start = highlight.start + offset; + const end = highlight.end + offset; + if (start < l.length) { + newHighlights.push(highlight); + } else { + l += ' '.repeat(start - l.length); + l += '^'; + l += '~'.repeat(end - start - 1); + if (highlight.label) { + l += '[' + highlight.label + ']'; + } + } + } + lines.push(l); + highlights = newHighlights; + } + + return lines.join('\n'); +} + +/** + * @param {string} str + * @param {string} amount + * @returns {string} + */ +function indent(str, amount = ' ') { + return str.split(/\r?\n/).map(m => m === '' ? '' : amount + m).join('\n'); +} + +/** + * @param {(exec: RegExp["exec"]) => RegExp["exec"]} execSupplier + * @param {() => void} fn + */ +function replaceRegExpProto(execSupplier, fn) { + const oldExec = RegExp.prototype.exec; + const oldTest = RegExp.prototype.test; + const newExec = execSupplier(oldExec); + + RegExp.prototype.exec = newExec; + RegExp.prototype.test = function (input) { + return newExec.call(this, input) !== null; + }; + + let error; + try { + fn(); + } catch (e) { + error = e; + } + + RegExp.prototype.exec = oldExec; + RegExp.prototype.test = oldTest; + + if (error) { + throw error; + } +} + +/** + * @param {undefined | null | T | T[]} value + * @returns {T[]} + * @template T + */ +function toArray(value) { + if (Array.isArray(value)) { + return value; + } else if (value != null) { + return [value]; + } else { + return []; + } } diff --git a/tests/plugins/copy-to-clipboard/basic-functionality.js b/tests/plugins/copy-to-clipboard/basic-functionality.js new file mode 100644 index 0000000000..89502f4c8d --- /dev/null +++ b/tests/plugins/copy-to-clipboard/basic-functionality.js @@ -0,0 +1,71 @@ +const { assert } = require('chai'); +const { createScopedPrismDom } = require('../../helper/prism-dom-util'); + + +class DummyClipboard { + constructor() { + this.text = ''; + } + async readText() { + return this.text; + } + /** @param {string} data */ + writeText(data) { + this.text = data; + return Promise.resolve(); + } +} + +describe('Copy to Clipboard', function () { + const { Prism, document, window } = createScopedPrismDom(this, { + languages: 'javascript', + plugins: 'copy-to-clipboard', + }); + + + it('should work', function () { + const clipboard = new DummyClipboard(); + window.navigator.clipboard = clipboard; + + document.body.innerHTML = `
    foo
    `; + Prism.highlightAll(); + + const button = document.querySelector('button'); + assert.notStrictEqual(button, null); + + button.click(); + + assert.strictEqual(clipboard.text, 'foo'); + }); + + it('should copy the current text even after the code block changes its text', function () { + const clipboard = new DummyClipboard(); + window.navigator.clipboard = clipboard; + + document.body.innerHTML = `
    foo
    `; + Prism.highlightAll(); + + const button = document.querySelector('button'); + assert.notStrictEqual(button, null); + + button.click(); + + assert.strictEqual(clipboard.text, 'foo'); + + // change text + document.querySelector('code').textContent = 'bar'; + // and click + button.click(); + + assert.strictEqual(clipboard.text, 'bar'); + + // change text + document.querySelector('code').textContent = 'baz'; + Prism.highlightAll(); + // and click + button.click(); + + assert.strictEqual(clipboard.text, 'baz'); + }); + +}); diff --git a/tests/plugins/custom-class/basic-functionality.js b/tests/plugins/custom-class/basic-functionality.js new file mode 100644 index 0000000000..54444d7886 --- /dev/null +++ b/tests/plugins/custom-class/basic-functionality.js @@ -0,0 +1,69 @@ +const { createUtil, createScopedPrismDom } = require('../../helper/prism-dom-util'); + + +describe('Custom class', function () { + const { Prism, window } = createScopedPrismDom(this, { + languages: 'javascript', + plugins: 'custom-class' + }); + const util = createUtil(window); + + + it('should set prefix', function () { + Prism.plugins.customClass.prefix('prism-'); + + util.assert.highlight({ + language: 'javascript', + code: `var a = true;`, + expected: `var a = true;` + }); + }); + + it('should reset prefix', function () { + Prism.plugins.customClass.prefix(''); + + util.assert.highlight({ + language: 'javascript', + code: `var a = true;`, + expected: `var a = true;` + }); + }); + + it('should map class names using a function', function () { + Prism.plugins.customClass.map(function (cls, language) { + return `${language}-${cls}`; + }); + + util.assert.highlight({ + language: 'javascript', + code: `var a = true;`, + expected: `var a = true;` + }); + }); + + it('should map class names using an object', function () { + Prism.plugins.customClass.map({ + boolean: 'b', + keyword: 'kw', + operator: 'op', + punctuation: 'p' + }); + + util.assert.highlight({ + language: 'javascript', + code: `var a = true;`, + expected: `var a = true;` + }); + }); + + it('should reset map', function () { + Prism.plugins.customClass.map({}); + + util.assert.highlight({ + language: 'javascript', + code: `var a = true;`, + expected: `var a = true;` + }); + }); + +}); diff --git a/tests/plugins/highlight-keywords/basic-functionality.js b/tests/plugins/highlight-keywords/basic-functionality.js new file mode 100644 index 0000000000..1d7fffa61e --- /dev/null +++ b/tests/plugins/highlight-keywords/basic-functionality.js @@ -0,0 +1,20 @@ +const { createUtil, createScopedPrismDom } = require('../../helper/prism-dom-util'); + + +describe('Highlight Keywords', function () { + const { window } = createScopedPrismDom(this, { + languages: 'javascript', + plugins: 'highlight-keywords' + }); + const util = createUtil(window); + + + it('should highlight keywords', function () { + util.assert.highlightElement({ + language: 'javascript', + code: `import * from ''; const foo;`, + expected: `import * from ''; const foo;` + }); + }); + +}); diff --git a/tests/plugins/keep-markup/test.js b/tests/plugins/keep-markup/test.js index bb0e78b34b..9f5776842f 100644 --- a/tests/plugins/keep-markup/test.js +++ b/tests/plugins/keep-markup/test.js @@ -1,92 +1,76 @@ -const expect = require('chai').expect; -const jsdom = require('jsdom') -const { JSDOM } = jsdom +const { assert } = require('chai'); +const { createScopedPrismDom } = require('../../helper/prism-dom-util'); -require('../../../prism') -// fake DOM -global.self = {} -global.self.Prism = Prism -global.document = {} -document.createRange = function () { -} -global.self.document = document -require('../../../plugins/keep-markup/prism-keep-markup') +describe('Keep Markup', function () { + const { Prism, document } = createScopedPrismDom(this, { + languages: 'javascript', + plugins: 'keep-markup' + }); -describe('Prism Keep Markup Plugin', function () { - function execute (code) { - const start = []; - const end = []; - const nodes = []; - document.createRange = function () { - return { - setStart: function (node, offset) { - start.push({ node, offset }) - }, - setEnd: function (node, offset) { - end.push({ node, offset }) - }, - extractContents: function () { - return new JSDOM('').window.document.createTextNode('') - }, - insertNode: function (node) { - nodes.push(node) - }, - detach: function () { - } - } - } - const beforeHighlight = Prism.hooks.all['before-highlight'][0] - const afterHighlight = Prism.hooks.all['after-highlight'][0] - const env = { - element: new JSDOM(code).window.document.getElementsByTagName('code')[0], - language: "javascript" - } - beforeHighlight(env) - afterHighlight(env) - return { start, end, nodes } + /** + * @param {string} html + * @param {string} language + */ + function highlightInElement(html, language = 'none') { + const pre = document.createElement('pre'); + pre.className = `language-${language}`; + pre.innerHTML = `${html}`; + + Prism.highlightElement(pre); + + return pre.querySelector('code').innerHTML; + } + + /** + * @param {string} html + * @param {string} language + */ + function keepMarkup(html, language = 'none') { + assert.equal(highlightInElement(html, language), html); } it('should keep markup', function () { - const result = execute(`xay`) - expect(result.start.length).to.equal(1) - expect(result.end.length).to.equal(1) - expect(result.nodes.length).to.equal(1) - expect(result.nodes[0].nodeName).to.equal('SPAN') - }) + keepMarkup(`xay`); + }); it('should preserve markup order', function () { - const result = execute(`xy`) - expect(result.start.length).to.equal(2) - expect(result.start[0].offset).to.equal(0) - expect(result.start[0].node.textContent).to.equal('y') - expect(result.start[1].offset).to.equal(0) - expect(result.start[1].node.textContent).to.equal('y') - expect(result.end.length).to.equal(2) - expect(result.end[0].offset).to.equal(0) - expect(result.end[0].node.textContent).to.equal('y') - expect(result.end[1].offset).to.equal(0) - expect(result.end[1].node.textContent).to.equal('y') - expect(result.nodes.length).to.equal(2) - expect(result.nodes[0].nodeName).to.equal('A') - expect(result.nodes[1].nodeName).to.equal('B') - }) - it('should keep last markup', function () { - const result = execute(`xya`) - expect(result.start.length).to.equal(1) - expect(result.end.length).to.equal(1) - expect(result.nodes.length).to.equal(1) - expect(result.nodes[0].nodeName).to.equal('SPAN') - }) + keepMarkup(`xy`); + }); + + it('should keep last markup', function () { + keepMarkup(`xya`); + keepMarkup(`xya`); + }); + + it('should support double highlighting', function () { + const pre = document.createElement('pre'); + pre.className = 'language-javascript drop-tokens'; + pre.innerHTML = 'var a = 42;'; + const code = pre.childNodes[0]; + const initial = code.innerHTML; + + Prism.highlightElement(code); + const firstPass = code.innerHTML; + + Prism.highlightElement(code); + const secondPass = code.innerHTML; + + // check that we actually did some highlighting + assert.notStrictEqual(initial, firstPass); + // check that the highlighting persists + assert.strictEqual(firstPass, secondPass); + }); + // The markup is removed if it's the last element and the element's name is a single letter: a(nchor), b(old), i(talic)... // https://github.com/PrismJS/prism/issues/1618 /* it('should keep last single letter empty markup', function () { - const result = execute(`xy`) + const result = execute(`xy`) expect(result.start.length).to.equal(1) expect(result.end.length).to.equal(1) expect(result.nodes.length).to.equal(1) expect(result.nodes[0].nodeName).to.equal('A') }) */ -}) +}); diff --git a/tests/plugins/show-invisibles/basic-functionality.js b/tests/plugins/show-invisibles/basic-functionality.js new file mode 100644 index 0000000000..2a3cbcebc9 --- /dev/null +++ b/tests/plugins/show-invisibles/basic-functionality.js @@ -0,0 +1,28 @@ +const { createUtil, createScopedPrismDom } = require('../../helper/prism-dom-util'); + + +describe('Show Invisibles', function () { + const { window } = createScopedPrismDom(this, { + languages: 'javascript', + plugins: 'show-invisibles' + }); + const util = createUtil(window); + + + it('should show invisible characters', function () { + util.assert.highlightElement({ + language: 'javascript', + code: ` \t\n\r\n\t\t`, + expected: ` \t\n\n\t\t` + }); + }); + + it('should show invisible characters inside tokens', function () { + util.assert.highlightElement({ + language: 'javascript', + code: `/* \n */`, + expected: `/* \n */` + }); + }); + +}); diff --git a/tests/plugins/show-language/basic-functionality.js b/tests/plugins/show-language/basic-functionality.js new file mode 100644 index 0000000000..3f97d84f69 --- /dev/null +++ b/tests/plugins/show-language/basic-functionality.js @@ -0,0 +1,36 @@ +const { assert } = require('chai'); +const { createScopedPrismDom } = require('../../helper/prism-dom-util'); + + +describe('Show language', function () { + const { Prism, document } = createScopedPrismDom(this, { + languages: ['markup', 'javascript'], + plugins: 'show-language' + }); + + + function test(expectedLanguage, code) { + document.body.innerHTML = code; + Prism.highlightAll(); + + assert.strictEqual(document.querySelector('.toolbar-item > span').textContent, expectedLanguage); + } + + it('should work with component titles', function () { + // simple title + test('JavaScript', `
    foo
    `); + test('Markup', `
    foo
    `); + + // aliases with the same title + test('JavaScript', `
    foo
    `); + + // aliases with a different title + test('HTML', `
    foo
    `); + test('SVG', `
    foo
    `); + }); + + it('should work with custom titles', function () { + test('Foo', `
    foo
    `); + }); + +}); diff --git a/tests/plugins/unescaped-markup/basic-functionality.js b/tests/plugins/unescaped-markup/basic-functionality.js new file mode 100644 index 0000000000..eedfaedd73 --- /dev/null +++ b/tests/plugins/unescaped-markup/basic-functionality.js @@ -0,0 +1,36 @@ +const { assert } = require('chai'); +const { createScopedPrismDom } = require('../../helper/prism-dom-util'); + + +describe('Show language', function () { + const { Prism, document } = createScopedPrismDom(this, { + languages: 'markup', + plugins: 'unescaped-markup' + }); + + + function test(expectedText, code) { + document.body.innerHTML = code; + Prism.highlightAll(); + + assert.strictEqual(document.querySelector('code').textContent, expectedText); + } + + it('should work with comments', function () { + test('\n

    Example

    \n', `
    `); + + test('\n

    Example 2

    \n', `
    `); + }); + + it('should work with script tags', function () { + test('

    Example

    ', ``); + + // inherit language + test('

    Example 2

    ', `
    `); + }); + +}); diff --git a/tests/run.js b/tests/run.js index b9c8893ffe..390d771d33 100644 --- a/tests/run.js +++ b/tests/run.js @@ -1,38 +1,30 @@ // @ts-check -"use strict"; +'use strict'; -const TestDiscovery = require("./helper/test-discovery"); -const TestCase = require("./helper/test-case"); -const path = require("path"); -const { argv } = require("yargs"); +const TestDiscovery = require('./helper/test-discovery'); +const TestCase = require('./helper/test-case'); +const path = require('path'); +const { argv } = require('yargs'); const testSuite = (argv.language) - ? TestDiscovery.loadSomeTests(__dirname + "/languages", argv.language) + ? TestDiscovery.loadSomeTests(argv.language) // load complete test suite - : TestDiscovery.loadAllTests(__dirname + "/languages"); + : TestDiscovery.loadAllTests(); -// define tests for all tests in all languages in the test suite -for (const language in testSuite) { - if (!testSuite.hasOwnProperty(language)) { - continue; - } +const update = !!argv.update; - (function (language, testFiles) { - describe("Testing language '" + language + "'", function () { - this.timeout(10000); +// define tests for all tests in all languages in the test suite +for (const [languageIdentifier, files] of testSuite) { + describe("Testing language '" + languageIdentifier + "'", function () { + this.timeout(10000); - for (const filePath of testFiles) { - const fileName = path.basename(filePath, path.extname(filePath)); + for (const filePath of files) { + const fileName = path.basename(filePath, path.extname(filePath)); - it("– should pass test case '" + fileName + "'", function () { - if (path.extname(filePath) === '.test') { - TestCase.runTestCase(language, filePath); - } else { - TestCase.runTestsWithHooks(language, require(filePath)); - } - }); - } - }); - })(language, testSuite[language]); + it("– should pass test case '" + fileName + "'", function () { + TestCase.runTestCase(languageIdentifier, filePath, update ? 'update' : 'insert'); + }); + } + }); } diff --git a/tests/testrunner-tests.js b/tests/testrunner-tests.js index 2faaf8137c..a7ca237359 100644 --- a/tests/testrunner-tests.js +++ b/tests/testrunner-tests.js @@ -1,36 +1,36 @@ -"use strict"; +'use strict'; -const { assert } = require("chai"); -const TokenStreamTransformer = require("./helper/token-stream-transformer"); -const TestCase = require("./helper/test-case"); +const { assert } = require('chai'); +const TokenStreamTransformer = require('./helper/token-stream-transformer'); +const TestCase = require('./helper/test-case'); -describe("The token stream transformer", function () { +describe('The token stream transformer', function () { - it("should handle all kinds of simple transformations", function () { + it('should handle all kinds of simple transformations', function () { const tokens = [ - { type: "type", content: "content" }, - "string" + { type: 'type', content: 'content' }, + 'string' ]; const expected = [ - ["type", "content"], - "string" + ['type', 'content'], + 'string' ]; assert.deepEqual(TokenStreamTransformer.simplify(tokens), expected); }); - it("should handle nested structures", function () { + it('should handle nested structures', function () { const tokens = [ { - type: "type", + type: 'type', content: [ { - type: "insideType", + type: 'insideType', content: [ - { type: "insideInsideType", content: "content" } + { type: 'insideInsideType', content: 'content' } ] } ] @@ -38,9 +38,9 @@ describe("The token stream transformer", function () { ]; const expected = [ - ["type", [ - ["insideType", [ - ["insideInsideType", "content"] + ['type', [ + ['insideType', [ + ['insideInsideType', 'content'] ]] ]] ]; @@ -49,12 +49,12 @@ describe("The token stream transformer", function () { }); - it("should strip empty tokens", function () { + it('should strip empty tokens', function () { const tokenStream = [ - "", - "\r\n", - "\t", - " " + '', + '\r\n', + '\t', + ' ' ]; const expectedSimplified = []; @@ -63,22 +63,22 @@ describe("The token stream transformer", function () { }); - it("should strip empty token tree branches", function () { + it('should strip empty token tree branches', function () { const tokenStream = [ { - type: "type", + type: 'type', content: [ - "", - { type: "nested", content: [""] }, - "" + '', + { type: 'nested', content: [''] }, + '' ] }, - "" + '' ]; const expectedSimplified = [ - ["type", [ - ["nested", []] + ['type', [ + ['nested', []] ]] ]; @@ -86,58 +86,58 @@ describe("The token stream transformer", function () { }); - it("should ignore all properties in tokens except value and content", function () { + it('should ignore all properties in tokens except value and content', function () { const tokenStream = [ - { type: "type", content: "content", alias: "alias" } + { type: 'type', content: 'content', alias: 'alias' } ]; const expectedSimplified = [ - ["type", "content"] + ['type', 'content'] ]; assert.deepEqual(TokenStreamTransformer.simplify(tokenStream), expectedSimplified); }); }); -describe("The language name parsing", function () { +describe('The language name parsing', function () { - it("should use the last language as the main language if no language is specified", function () { + it('should use the last language as the main language if no language is specified', function () { assert.deepEqual( - TestCase.parseLanguageNames("a"), + TestCase.parseLanguageNames('a'), { - languages: ["a"], - mainLanguage: "a" + languages: ['a'], + mainLanguage: 'a' } ); assert.deepEqual( - TestCase.parseLanguageNames("a+b+c"), + TestCase.parseLanguageNames('a+b+c'), { - languages: ["a", "b", "c"], - mainLanguage: "c" + languages: ['a', 'b', 'c'], + mainLanguage: 'c' } ); }); - it("should use the specified language as main language", function () { + it('should use the specified language as main language', function () { assert.deepEqual( - TestCase.parseLanguageNames("a+b!+c"), + TestCase.parseLanguageNames('a+b!+c'), { - languages: ["a", "b", "c"], - mainLanguage: "b" + languages: ['a', 'b', 'c'], + mainLanguage: 'b' } ); }); - it("should throw an error if there are multiple main languages", function () { + it('should throw an error if there are multiple main languages', function () { assert.throw( () => { - TestCase.parseLanguageNames("a+b!+c!"); + TestCase.parseLanguageNames('a+b!+c!'); }, - "There are multiple main languages defined." + 'There are multiple main languages defined.' ); }); }); diff --git a/themes/prism-coy.css b/themes/prism-coy.css index 5436ff7ade..ed1d399e14 100644 --- a/themes/prism-coy.css +++ b/themes/prism-coy.css @@ -32,10 +32,12 @@ pre[class*="language-"] { position: relative; margin: .5em 0; overflow: visible; - padding: 0; + padding: 1px; } -pre[class*="language-"]>code { + +pre[class*="language-"] > code { position: relative; + z-index: 1; border-left: 10px solid #358ccb; box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; background-color: #fdfdfd; @@ -77,7 +79,6 @@ pre[class*="language-"] { pre[class*="language-"]:before, pre[class*="language-"]:after { content: ''; - z-index: -2; display: block; position: absolute; bottom: 0.75em; diff --git a/themes/prism-coy.min.css b/themes/prism-coy.min.css new file mode 100644 index 0000000000..62495e569c --- /dev/null +++ b/themes/prism-coy.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{position:relative;margin:.5em 0;overflow:visible;padding:1px}pre[class*=language-]>code{position:relative;z-index:1;border-left:10px solid #358ccb;box-shadow:-1px 0 0 0 #358ccb,0 0 0 1px #dfdfdf;background-color:#fdfdfd;background-image:linear-gradient(transparent 50%,rgba(69,142,209,.04) 50%);background-size:3em 3em;background-origin:content-box;background-attachment:local}code[class*=language-]{max-height:inherit;height:inherit;padding:0 1em;display:block;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:1em}:not(pre)>code[class*=language-]{position:relative;padding:.2em;border-radius:.3em;color:#c92c2c;border:1px solid rgba(0,0,0,.1);display:inline;white-space:normal}pre[class*=language-]:after,pre[class*=language-]:before{content:'';display:block;position:absolute;bottom:.75em;left:.18em;width:40%;height:20%;max-height:13em;box-shadow:0 13px 8px #979797;-webkit-transform:rotate(-2deg);-moz-transform:rotate(-2deg);-ms-transform:rotate(-2deg);-o-transform:rotate(-2deg);transform:rotate(-2deg)}pre[class*=language-]:after{right:.75em;left:auto;-webkit-transform:rotate(2deg);-moz-transform:rotate(2deg);-ms-transform:rotate(2deg);-o-transform:rotate(2deg);transform:rotate(2deg)}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#7d8b99}.token.punctuation{color:#5f6364}.token.boolean,.token.constant,.token.deleted,.token.function-name,.token.number,.token.property,.token.symbol,.token.tag{color:#c92c2c}.token.attr-name,.token.builtin,.token.char,.token.function,.token.inserted,.token.selector,.token.string{color:#2f9c0a}.token.entity,.token.operator,.token.url,.token.variable{color:#a67f59;background:rgba(255,255,255,.5)}.token.atrule,.token.attr-value,.token.class-name,.token.keyword{color:#1990b8}.token.important,.token.regex{color:#e90}.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,.5)}.token.important{font-weight:400}.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.namespace{opacity:.7}@media screen and (max-width:767px){pre[class*=language-]:after,pre[class*=language-]:before{bottom:14px;box-shadow:none}}pre[class*=language-].line-numbers.line-numbers{padding-left:0}pre[class*=language-].line-numbers.line-numbers code{padding-left:3.8em}pre[class*=language-].line-numbers.line-numbers .line-numbers-rows{left:0}pre[class*=language-][data-line]{padding-top:0;padding-bottom:0;padding-left:0}pre[data-line] code{position:relative;padding-left:4em}pre .line-highlight{margin-top:0} \ No newline at end of file diff --git a/themes/prism-dark.min.css b/themes/prism-dark.min.css new file mode 100644 index 0000000000..e592b5b769 --- /dev/null +++ b/themes/prism-dark.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#fff;background:0 0;text-shadow:0 -.1em .2em #000;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}:not(pre)>code[class*=language-],pre[class*=language-]{background:#4c3f33}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border:.3em solid #7a6651;border-radius:.5em;box-shadow:1px 1px .5em #000 inset}:not(pre)>code[class*=language-]{padding:.15em .2em .05em;border-radius:.3em;border:.13em solid #7a6651;box-shadow:1px 1px .3em -.1em #000 inset;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#997f66}.token.punctuation{opacity:.7}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#d1939e}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#bce051}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f4b73d}.token.atrule,.token.attr-value,.token.keyword{color:#d1939e}.token.important,.token.regex{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.deleted{color:red} \ No newline at end of file diff --git a/themes/prism-funky.min.css b/themes/prism-funky.min.css new file mode 100644 index 0000000000..2e67a7a28f --- /dev/null +++ b/themes/prism-funky.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.4em .8em;margin:.5em 0;overflow:auto;background:url('data:image/svg+xml;charset=utf-8,%0D%0A%0D%0A%0D%0A<%2Fsvg>');background-size:1em 1em}code[class*=language-]{background:#000;color:#fff;box-shadow:-.3em 0 0 .3em #000,.3em 0 0 .3em #000}:not(pre)>code[class*=language-]{padding:.2em;border-radius:.3em;box-shadow:none;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#aaa}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#0cf}.token.attr-name,.token.builtin,.token.char,.token.selector,.token.string{color:#ff0}.language-css .token.string,.token.entity,.token.inserted,.token.operator,.token.url,.token.variable{color:#9acd32}.token.atrule,.token.attr-value,.token.keyword{color:#ff1493}.token.important,.token.regex{color:orange}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.deleted{color:red}pre.diff-highlight.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.3);display:inline}pre.diff-highlight.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.3);display:inline} \ No newline at end of file diff --git a/themes/prism-okaidia.min.css b/themes/prism-okaidia.min.css new file mode 100644 index 0000000000..dc0b418e32 --- /dev/null +++ b/themes/prism-okaidia.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#272822}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8292a2}.token.punctuation{color:#f8f8f2}.token.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} \ No newline at end of file diff --git a/themes/prism-solarizedlight.min.css b/themes/prism-solarizedlight.min.css new file mode 100644 index 0000000000..8deecf9e55 --- /dev/null +++ b/themes/prism-solarizedlight.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#657b83;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{background:#073642}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{background:#073642}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdf6e3}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#93a1a1}.token.punctuation{color:#586e75}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#268bd2}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#859900}.token.class-name,.token.function{color:#b58900}.token.important,.token.regex,.token.variable{color:#cb4b16}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} \ No newline at end of file diff --git a/themes/prism-tomorrow.min.css b/themes/prism-tomorrow.min.css new file mode 100644 index 0000000000..8fce55009d --- /dev/null +++ b/themes/prism-tomorrow.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green} \ No newline at end of file diff --git a/themes/prism-twilight.css b/themes/prism-twilight.css index 941d6d7f4d..63cc4c6b86 100644 --- a/themes/prism-twilight.css +++ b/themes/prism-twilight.css @@ -140,11 +140,6 @@ code[class*="language-"]::selection, code[class*="language-"] ::selection { cursor: help; } -pre[data-line] { - padding: 1em 0 1em 3em; - position: relative; -} - /* Markup */ .language-markup .token.tag, .language-markup .token.attr-name, @@ -158,42 +153,17 @@ pre[data-line] { z-index: 1; } -.line-highlight { +.line-highlight.line-highlight { background: hsla(0, 0%, 33%, 0.25); /* #545454 */ background: linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */ border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */ - left: 0; - line-height: inherit; margin-top: 0.75em; /* Same as .prism’s padding-top */ - padding: inherit 0; - pointer-events: none; - position: absolute; - right: 0; - white-space: pre; z-index: 0; } -.line-highlight:before, -.line-highlight[data-end]:after { +.line-highlight.line-highlight:before, +.line-highlight.line-highlight[data-end]:after { background-color: hsl(215, 15%, 59%); /* #8794A6 */ - border-radius: 999px; - box-shadow: 0 1px white; color: hsl(24, 20%, 95%); /* #F5F2F0 */ - content: attr(data-start); - font: bold 65%/1.5 sans-serif; - left: .6em; - min-width: 1em; - padding: 0 .5em; - position: absolute; - text-align: center; - text-shadow: none; - top: .4em; - vertical-align: .3em; -} - -.line-highlight[data-end]:after { - bottom: .4em; - content: attr(data-end); - top: auto; } diff --git a/themes/prism-twilight.min.css b/themes/prism-twilight.min.css new file mode 100644 index 0000000000..e598be8865 --- /dev/null +++ b/themes/prism-twilight.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#fff;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;text-shadow:0 -.1em .2em #000;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}:not(pre)>code[class*=language-],pre[class*=language-]{background:#141414}pre[class*=language-]{border-radius:.5em;border:.3em solid #545454;box-shadow:1px 1px .5em #000 inset;margin:.5em 0;overflow:auto;padding:1em}pre[class*=language-]::-moz-selection{background:#27292a}pre[class*=language-]::selection{background:#27292a}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:hsla(0,0%,93%,.15)}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:hsla(0,0%,93%,.15)}:not(pre)>code[class*=language-]{border-radius:.3em;border:.13em solid #545454;box-shadow:1px 1px .3em -.1em #000 inset;padding:.15em .2em .05em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#777}.token.punctuation{opacity:.7}.token.namespace{opacity:.7}.token.boolean,.token.deleted,.token.number,.token.tag{color:#ce6849}.token.builtin,.token.constant,.token.keyword,.token.property,.token.selector,.token.symbol{color:#f9ed99}.language-css .token.string,.style .token.string,.token.attr-name,.token.attr-value,.token.char,.token.entity,.token.inserted,.token.operator,.token.string,.token.url,.token.variable{color:#909e6a}.token.atrule{color:#7385a5}.token.important,.token.regex{color:#e8c062}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.language-markup .token.attr-name,.language-markup .token.punctuation,.language-markup .token.tag{color:#ac885c}.token{position:relative;z-index:1}.line-highlight.line-highlight{background:hsla(0,0%,33%,.25);background:linear-gradient(to right,hsla(0,0%,33%,.1) 70%,hsla(0,0%,33%,0));border-bottom:1px dashed #545454;border-top:1px dashed #545454;margin-top:.75em;z-index:0}.line-highlight.line-highlight:before,.line-highlight.line-highlight[data-end]:after{background-color:#8693a6;color:#f4f1ef} \ No newline at end of file diff --git a/themes/prism.min.css b/themes/prism.min.css new file mode 100644 index 0000000000..8c4cc0576b --- /dev/null +++ b/themes/prism.min.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} \ No newline at end of file diff --git a/tokens.html b/tokens.html new file mode 100644 index 0000000000..0fa13cce4f --- /dev/null +++ b/tokens.html @@ -0,0 +1,437 @@ + + + + + + +Prism tokens ▲ Prism + + + + + + + + + + + + +
    +
    + +

    Prism tokens

    +

    Prism identifies tokens in your code, which are in turn styled by CSS to produce the syntax highlighting. This page provides an overview of the standard tokens and corresponding examples.

    +
    + +
    +

    Standard tokens

    + +

    When defining a new language, you will need to provide token names for each 'type' of code, such as keywords and operators, so Prism's themes can assign colors (and other styles) accordingly. Prism's themes (both official and non-official) only guarantee coverage for these standard tokens, so it is recommended to make use of the following standard tokens to ensure that code will be highlighted.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    General purpose
    keyword + Pre-defined and reserved words. + +
    for (const foo of bar) {
    +	if (foo === 'foobar') break;
    +	await foo;
    +}
    +
    builtin + Functions/Methods/Classes/Types that are available out of the box. + +
    pi = round(float('3.14159'), 2)
    +
    type SearchFunc = (source: string, subStr: string) => boolean;
    +
    class-name + The name of a class, interface, trait, or type. + +
    class Rectangle extends Square { /* ... */ }
    +
    public class CameraController : MonoBehaviour { /* ... */ }
    +
    function + The name of a function or method. + +
    function isEven(number) {
    +	return Number(number) % 2 === 0;
    +}
    +const isOdd = (number) => !isEven(number);
    +
    boolean + True and false, and pairs with similar concepts (e.g. yes and no). + +
    console.log(true === false); // prints false
    +console.log(true === !false); // prints true
    +
    number + A numerical value, regardless of base and order, and no matter real or imaginary. + +
    print(3.14159 * 42)
    +print(1e100 + .001j)
    +return foo & 0xdeadbeef
    +
    string + Literal text, including numbers and symbols and maybe even more special characters. + +
    let greeting = 'Hello World!';
    +
    char + A string that can comprise only a single character, enforced by the language. + +
    ['A', 'z', '0', '-', '\t', '\u{2728}']
    +
    symbol + A primitive data type found in some languages, can be thought of as an identifier. + +
    #myFirstSymbol "#myFirstSymbol is a symbol in Smalltalk"
    +
    regex + A regular expression. + +
    let entity = /&#x?[\da-f]{1,8};/;
    +
    url + A link to another page or resource. + +
    body {
    +	background: url(foo.png);
    +}
    +
    [Prism](https://prismjs.com) is a cool syntax highlighter.
    +
    operator + A symbol that represents an action or process, whether it's a mathematical operation, logical operation, and so on. + +
    x += (y + 4 >> -z === w) ? b ** c : ~a;
    +
    variable + The name of a variable. This token is intended to be used sparingly. It's generally used on special variables (e.g. Less or Bash), not general variables from imperative and procedural programming languages (e.g. C, JavaScript, Python). + +
    @nice-blue: #5B83AD;
    +@light-blue: lighten(@nice-blue, 20%);
    +
    echo $STRING
    +args=("$@")
    +echo ${args[0]} ${args[1]} ${args[2]}
    +
    constant + The name of a constant. + +
    const PI = 3.14159;
    +
    const THING: u32 = 0xABAD1DEA;
    +
    fprintf(stdout, "hello world\n");
    +
    property + An attribute/characteristic or object/map key. + +
    body {
    +	color: red;
    +	line-height: normal;
    +}
    +
    {
    +	"data": { "labels": ["foo", "bar"], },
    +	"error": null,
    +	"status": "Ok"
    +}
    +
    punctuation + Punctuation such as brackets, parentheses, commas, and more. + +
    def median(pool):
    +	copy = sorted(pool)
    +	size = len(copy)
    +	if size % 2 == 1:
    +		return copy[(size - 1) / 2]
    +	else:
    +		return (copy[size/2 - 1] + copy[size/2]) / 2
    +
    important + Anything that is important and needs special highlighting. + +
    body {
    +	color: red !important;
    +}
    +
    # This is a heading. Headings are important.
    +
    comment + Code comments. + +
    <!-- Here's a comment -->
    +<style>
    +	/* Here's another comment */
    +</style>
    +<script>
    +// Here's yet another comment
    +</script>
    +
    Markup languages
    tag + A markup tag (e.g. HTML and XML tags). + +
    <p>Hello World!</p>
    +
    attr-name, attr-value + Kind of like a property of a markup tag and its value/argument respectively. + +
    <p id="greeting">Hello World!</p>
    +<video width="1280" height="720" allowfullscreen controls>
    +	<source src="hello_world.mp4" type="video/mp4" />
    +</video>
    +
    namespace + Used to provide uniquely named elements and attributes in XML documents. Outside of markup languages, it is used to tokenize the package/namespace part of identifiers. + +
    <html:p foo:bar="baz" foo:weee></html:p>
    +
    class Foo extends foo.bar.Foo {
    +	java.util.List<foo.bar.Foo.Bar> bar(foo.bar.Baz bat) {
    +		throw new java.lang.UnsupportedOperationException();
    +	}
    +}
    +
    use std::sync::Arc;
    +
    prolog + The first part of an XML document. + +
    <?xml version="1.0" encoding="utf-8"?>
    +<svg></svg>
    +
    doctype + Document type declaration, specific to markup languages. + +
    <!DOCTYPE html>
    +<html></html>
    +
    cdata + Character data, specific to markup languages. + +
    <ns1:description><![CDATA[
    +  CDATA is <not> magical.
    +]]></ns1:description>
    +
    entity + Code used to display reserved characters in markup languages. + +
    &amp; &#x2665; &#160; &#x152;
    +
    Document-markup languages
    bold + Bolded text. Mostly found in document-markup languages. + +
    **I am bolded text!**
    +
    italic + Italicised text. Mostly found in document-markup languages. + +
    *I am italicised text!*
    +
    Stylesheets
    atrule + Literally @ rules (statements) in stylesheets. + +
    @font-family {
    +	font-family: Questrial;
    +	src: url(questrial.otf);
    +}
    +@media screen and (min-width: 768px) { /* ... */ }
    +
    selector + Code that identifies or picks something out of a group to operate on, such as the names of HTML elements in stylesheets. + +
    section h1,
    +#features li strong,
    +header h2,
    +footer p { /* ... */ }
    +
    Diff
    inserted, deleted + Added or modified line and deleted line respectively, mainly for diffs. In general, also the idea of something being increased and decreased/removed respectively. + +
    --- bar.yml	2014-12-16 11:43:41 +0800
    ++++ /Users/foo/Desktop/bar.yml	2014-12-31 11:28:08 +0800
    +@@ -4,5 +4,5 @@
    +project:
    +	sources: "src/*.cpp"
    +	headers: "src/*.h"
    +-    qt: core
    ++    qt: core gui
    +public_headers: "src/*.h"
    +
    +
    + +
    +

    Embedded languages

    + +

    In addition to the standard tokens above, Prism also has a token for languages that are embedded in another language, such as CSS in HTML, JS in HTML, Bash in Shell-session, and CSS in JS, allowing Prism's themes to highlight the tokens in the embedded languages more accurately. All embedded languages are wrapped in their own special token, which includes a CSS class language-xxxx corresponding to the embedded language.

    + +

    Open your browser's developer tools and check out the example below to see it in action!

    + +
    <!DOCTYPE html>
    +<html lang="en">
    +<head>
    +	<meta charset="utf-8" />
    +	<title>I can haz embedded CSS and JS</title>
    +	<style>
    +		@media print {
    +			p { color: red !important; }
    +		}
    +	</style>
    +</head>
    +<body>
    +	<h1>I can haz embedded CSS and JS</h1>
    +	<script>
    +	if (true) {
    +		console.log('foo');
    +	}
    +	</script>
    +
    +</body>
    +</html>
    +
    + +
    +

    Non-standard tokens

    + +

    Sometimes, a language might use a particular name to refer to certain pieces of code, but which is not one of Prism's standard token names, such as function-defintion. Since function-definition is not a standard token, you might want to alias it with a standard token such as function, which is semantically similar, and will ensure that Prism's themes will highlight it. Here's an example:

    + +
    fn main() {
    +	println!("Hello World");
    +	another_function();
    +}
    +
    + +
    + + + + + + + + + + + +