diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b4180a87 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Tab indentation +[*] +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true + +# The indent size used in the `package.json` file cannot be changed +# https://github.com/npm/npm/pull/3180#issuecomment-16336516 +[{*.yml,*.yaml,package.json}] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index 79b9535b..64fd3c52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +/.idea/ +/*.iml /node_modules/ /release/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1568bc80..00000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "8.9.3" -script: - - npm run compile - - npm run test diff --git a/.vscode/launch.json b/.vscode/launch.json index 6aa227c6..df977905 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,8 +8,8 @@ "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", "stopOnEntry": false, "args": [ - "--grep", - "php" + // "--grep", + // "typescript" ], "cwd": "${workspaceRoot}", "preLaunchTask": null, @@ -25,4 +25,4 @@ "outDir": null } ] -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index f945f18d..01aeb218 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,6 @@ "files.insertFinalNewline": true, "editor.tabSize": 4, "editor.insertSpaces": false, + "editor.detectIndentation": false, "typescript.tsdk": "./node_modules/typescript/lib" } diff --git a/README.md b/README.md index ba15e6a0..f3000902 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,35 @@ -# Monaco Languages [![Build Status](https://travis-ci.org/Microsoft/monaco-languages.svg?branch=master)](https://travis-ci.org/Microsoft/monaco-languages) +# Monaco Languages [![Build Status](https://dev.azure.com/ms/monaco-languages/_apis/build/status/microsoft.monaco-languages?branchName=master)](https://dev.azure.com/ms/monaco-languages/_build/latest?definitionId=140&branchName=master) Colorization and configuration supports for multiple languages for the Monaco Editor: ![monaco-languages](https://cloud.githubusercontent.com/assets/5047891/15938606/1fd4bac6-2e74-11e6-8839-d455da8bc8a7.gif) +* apex +* azcli * bat +* clojure * coffee script * cpp * csharp +* csp +* dockerfile * fsharp * go +* graphql * handlebars * html * ini +* java +* javascript * lua +* markdown +* msdax +* mysql * objective-c -* postiats +* pascal +* pgsql * php +* postiats * powershell * pug * python @@ -24,11 +37,16 @@ Colorization and configuration supports for multiple languages for the Monaco Ed * razor * ruby * rust +* small basic +* scheme +* solidity * sql +* st * swift +* typescript * vb * xml -* small basic +* yaml Also `css` dialects: @@ -49,7 +67,7 @@ This npm module is bundled and distributed in the [monaco-editor](https://www.np * initial setup with `npm install .` * compile with `npm run watch` * test with `npm run test` -* bundle with `npm run prepublish` +* bundle with `npm run prepublishOnly` ## Dev: Adding a new language diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..0da1e9ea --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,28 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '10.x' + displayName: 'Install Node.js' + +- script: | + npm install + displayName: 'npm install' + +- script: | + npm run compile + displayName: 'compile' + +- script: | + npm test + displayName: 'test' diff --git a/package-lock.json b/package-lock.json index 21ff4369..76fb339d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,33 +1,106 @@ { "name": "monaco-languages", - "version": "1.2.0", + "version": "1.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "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.2.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", + "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", + "dev": true + }, + "acorn-globals": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz", + "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + } + }, + "acorn-walk": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "dev": true + }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.1.tgz", + "integrity": "sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ==", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "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 + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "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" + } + }, + "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" + } + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "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 }, + "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 + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -41,9 +114,9 @@ "dev": true }, "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, "balanced-match": { @@ -53,22 +126,12 @@ "dev": true }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "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": { - "hoek": "4.2.1" + "tweetnacl": "^0.14.3" } }, "brace-expansion": { @@ -77,20 +140,26 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "browser-request": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", - "integrity": "sha1-ns5bWsqJopkyJC4Yv5M975h2zBc=", + "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.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "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 + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "caseless": { @@ -99,30 +168,75 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "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" + } + } + } + }, + "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" + } + }, + "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 }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "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": { - "delayed-stream": "1.0.0" + "color-name": "1.1.3" } }, - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "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": { - "graceful-readlink": "1.0.1" + "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -135,39 +249,32 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "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": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - } + "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.2", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", - "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", "dev": true }, "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.3.0.tgz", + "integrity": "sha512-wXsoRfsRfsLVNaVzoKdqvEmK/5PFaEXNspVT22Ots6K/cnJdpoDKuQFw+qlMiXnmaif1OgeC466X1zISgAOcGg==", "dev": true, "requires": { - "cssom": "0.3.2" + "cssom": "~0.3.6" } }, "dashdash": { @@ -176,16 +283,48 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "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.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "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 + }, + "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" } }, "delayed-stream": { @@ -195,80 +334,126 @@ "dev": true }, "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", "dev": true, "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - } + "webidl-conversions": "^4.0.2" } }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "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" + } + }, + "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 }, - "domhandler": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", - "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", + "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": { - "domelementtype": "1.3.0" + "once": "^1.4.0" } }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "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": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "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" } }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "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, - "optional": true, "requires": { - "jsbn": "0.1.1" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", - "dev": true - }, "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" + } + }, + "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" + } + }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "extsprintf": { @@ -278,9 +463,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "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": { @@ -289,6 +474,30 @@ "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 + }, + "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" + } + }, + "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" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -296,14 +505,14 @@ "dev": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "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.18" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" } }, "fs.realpath": { @@ -312,39 +521,54 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": 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": "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 + }, + "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" + } + }, "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" + "assert-plus": "^1.0.0" } }, "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "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.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "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" } }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, "har-schema": { @@ -354,57 +578,49 @@ "dev": true }, "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "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": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^6.5.5", + "har-schema": "^2.0.0" } }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "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": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" + "function-bind": "^1.1.1" } }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "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-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "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 }, - "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "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": { - "domelementtype": "1.3.0", - "domhandler": "2.4.1", - "domutils": "1.7.0", - "entities": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.5" + "whatwg-encoding": "^1.0.1" } }, "http-signature": { @@ -413,9 +629,18 @@ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" + "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": { @@ -424,26 +649,86 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "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 + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, + "is-buffer": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "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-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-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 + }, + "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-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 }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isstream": { @@ -452,28 +737,62 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "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 + } + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "dev": true }, - "jsdom-no-contextify": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsdom-no-contextify/-/jsdom-no-contextify-3.1.0.tgz", - "integrity": "sha1-DYvq9hDC/yOJT1Tfp/id0i/Q96s=", + "jsdom": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.1.1.tgz", + "integrity": "sha512-cQZRBB33arrDAeCrAEWn1U3SvrvC8XysBua9Oqg1yWrsY/gYcusloJC3RZJXuY5eehSCmws8f2YeliCqGSkrtQ==", "dev": true, "requires": { - "browser-request": "0.3.3", - "cssom": "0.3.2", - "cssstyle": "0.2.37", - "htmlparser2": "3.9.2", - "nwmatcher": "1.4.3", - "parse5": "1.5.1", - "request": "2.85.0", - "xml-name-validator": "1.0.0", - "xmlhttprequest": "1.8.0" + "abab": "^2.0.0", + "acorn": "^6.1.1", + "acorn-globals": "^4.3.2", + "array-equal": "^1.0.0", + "cssom": "^0.3.6", + "cssstyle": "^1.2.2", + "data-urls": "^1.1.0", + "domexception": "^1.0.1", + "escodegen": "^1.11.1", + "html-encoding-sniffer": "^1.0.2", + "nwsapi": "^2.1.4", + "parse5": "5.1.0", + "pn": "^1.1.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.7", + "saxes": "^3.1.9", + "symbol-tree": "^3.2.2", + "tough-cookie": "^3.0.1", + "w3c-hr-time": "^1.0.1", + "w3c-xmlserializer": "^1.1.2", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^7.0.0", + "ws": "^7.0.0", + "xml-name-validator": "^3.0.0" } }, "json-schema": { @@ -483,9 +802,9 @@ "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "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-stringify-safe": { @@ -494,12 +813,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -512,96 +825,104 @@ "verror": "1.10.0" } }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" + "invert-kv": "^2.0.0" } }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true + "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" + } }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true + "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" + } }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "lodash": { + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", "dev": true }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "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.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "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": { - "lodash._baseassign": "3.2.0", - "lodash._basecreate": "3.0.3", - "lodash._isiterateecall": "3.0.9" + "chalk": "^2.0.1" } }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true + "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" + } }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" } }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "1.33.0" + "mime-db": "1.40.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -620,29 +941,40 @@ } }, "mocha": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", - "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", + "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", "dev": true, "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.8", - "diff": "3.2.0", + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "debug": "3.2.6", + "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "he": "1.1.1", - "json3": "3.3.2", - "lodash.create": "3.1.1", + "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", - "supports-color": "3.1.2" + "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" } }, "monaco-editor-core": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.12.0.tgz", - "integrity": "sha512-wOoEVAoZtrarDRcQC32Fp0ocacpQd6/Nb0FmUZOHeD3swZuPZhDLOxTyoNLjKq3d+h/6g+IARBLnDaLT5OQD4g==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.17.0.tgz", + "integrity": "sha512-8q7b0itiX4UDv6e2F/EJc53G0iLL7P905IZsemu/bXffS7mIcjKKtX+TlzT13YbkuGFC/86Q32ANXERaJTM+mw==", "dev": true }, "monaco-plugin-helpers": { @@ -651,40 +983,180 @@ "integrity": "sha512-7kUx8dtd5qVNVgUARBRhnM8oftPglYwlINfigC4yGUiuzqtIN22u1tly8umiOCIPR0eFiBLjt6aN23oZh2QJgg==", "dev": true, "requires": { - "typescript": "2.7.2" + "typescript": "^2.7.2" + }, + "dependencies": { + "typescript": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", + "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "dev": true + } } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "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 + }, + "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" + } + }, + "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 }, - "nwmatcher": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.3.tgz", - "integrity": "sha512-IKdSTiDWCarf2JTS5e9e2+5tPZGdkRJ79XjYV0pzK8Q9BpsFyBq1RGKxzs7Q8UBushGw7m6TzVKz6fcY99iSWw==", + "nwsapi": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", + "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==", "dev": true }, "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "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.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.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" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "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" + } + }, + "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" } }, + "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.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "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-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "parse5": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", - "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", + "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", + "dev": true + }, + "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-is-absolute": { @@ -693,149 +1165,307 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "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==", + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "psl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", + "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==", + "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" + } + }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "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.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "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 }, - "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "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": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", - "dev": true, - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.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" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } + } + }, + "require-directory": { + "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": "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 + }, "requirejs": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.5.tgz", - "integrity": "sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", + "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", "dev": true }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "saxes": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", + "integrity": "sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g==", + "dev": true, + "requires": { + "xmlchars": "^2.1.1" + } + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "hoek": "4.2.1" + "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 + }, "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 }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "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.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "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" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "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 + }, + "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": { - "safe-buffer": "5.1.1" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "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" + } + }, + "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": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "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": "1.0.0" + "has-flag": "^3.0.0" } }, + "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 + }, "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "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": "1.4.1" + "punycode": "^2.1.0" } }, "tunnel-agent": { @@ -844,50 +1474,53 @@ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "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-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, - "optional": true + "requires": { + "prelude-ls": "~1.1.2" + } }, "typescript": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", - "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", + "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", "dev": true }, "uglify-js": { - "version": "3.3.14", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.14.tgz", - "integrity": "sha512-OY8VPQU25q09gQRbC+Ekk3xgEVBmYFEfVcgS47ksjTiNht2LmLlUkWutyi38ZsDSToJHwbe76kDGwmD226Z2Fg==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "dev": true, "requires": { - "commander": "2.14.1", - "source-map": "0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", - "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==", - "dev": true - } + "commander": "~2.20.0", + "source-map": "~0.6.1" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "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" + } }, "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, "verror": { @@ -896,9 +1529,138 @@ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" + } + }, + "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.1.2", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz", + "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==", + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "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" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "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" + } + }, + "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" + } + }, + "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" + } + } } }, "wrappy": { @@ -907,17 +1669,144 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "ws": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.1.0.tgz", + "integrity": "sha512-Swie2C4fs7CkwlHu1glMePLYJJsWjzhl1vm3ZaLplD0h7OMkZyZ6kLTB/OagiU923bZrPFXuDTeEqaEN4NWG4g==", + "dev": true, + "requires": { + "async-limiter": "^1.0.0" + } + }, "xml-name-validator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-1.0.0.tgz", - "integrity": "sha1-3Pgu4JIyKVHvjMG6WWycv9FKg/E=", + "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 }, - "xmlhttprequest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "xmlchars": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.1.1.tgz", + "integrity": "sha512-7hew1RPJ1iIuje/Y01bGD/mXokXxegAgVS+e+E0wSi2ILHQkYAH1+JXARwTjZSM4Z4Z+c73aKspEcqj+zPPL/w==", + "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": { + "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": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "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" + } + }, + "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": { + "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 + }, + "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 + }, + "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 index bb528288..2fa054e4 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "monaco-languages", - "version": "1.2.0", + "version": "1.7.0", "description": "Bundle of many languages for the Monaco Editor.", "scripts": { "compile": "mrmdir ./release && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json", "watch": "tsc -p ./src --watch", "test": "mocha", - "prepublish": "npm run compile && node ./scripts/bundle" + "prepublishOnly": "npm run compile && node ./scripts/bundle" }, "author": "Microsoft Corporation", "license": "MIT", @@ -18,12 +18,12 @@ "url": "https://github.com/Microsoft/monaco-languages/issues" }, "devDependencies": { - "jsdom-no-contextify": "^3.1.0", - "mocha": "^3.4.2", - "monaco-editor-core": "0.12.0", + "jsdom": "^15.1.1", + "mocha": "^6.1.4", + "monaco-editor-core": "0.17.0", "monaco-plugin-helpers": "^1.0.2", - "requirejs": "^2.3.5", - "typescript": "2.7.2", - "uglify-js": "^3.3.14" + "requirejs": "^2.3.6", + "typescript": "3.5.3", + "uglify-js": "^3.6.0" } } diff --git a/scripts/bundle.js b/scripts/bundle.js index 531a17c2..0f20da1a 100644 --- a/scripts/bundle.js +++ b/scripts/bundle.js @@ -34,11 +34,14 @@ bundleOne('html/html'); bundleOne('ini/ini'); bundleOne('pug/pug'); bundleOne('java/java'); +bundleOne('javascript/javascript'); +bundleOne('kotlin/kotlin'); bundleOne('less/less'); bundleOne('lua/lua'); bundleOne('markdown/markdown'); bundleOne('msdax/msdax'); bundleOne('objective-c/objective-c'); +bundleOne('pascal/pascal'); bundleOne('php/php'); bundleOne('powershell/powershell'); bundleOne('postiats/postiats'); @@ -51,6 +54,7 @@ bundleOne('scss/scss'); bundleOne('sql/sql'); bundleOne('st/st'); bundleOne('swift/swift'); +bundleOne('typescript/typescript'); bundleOne('vb/vb'); bundleOne('xml/xml'); bundleOne('yaml/yaml'); @@ -61,6 +65,15 @@ bundleOne('redshift/redshift'); bundleOne('pgsql/pgsql'); bundleOne('redis/redis'); bundleOne('csp/csp'); +bundleOne('scheme/scheme'); +bundleOne('clojure/clojure'); +bundleOne('shell/shell'); +bundleOne('perl/perl'); +bundleOne('powerquery/powerquery'); +bundleOne('azcli/azcli'); +bundleOne('apex/apex'); +bundleOne('tcl/tcl'); +bundleOne('graphql/graphql'); function bundleOne(moduleId, exclude) { requirejs.optimize({ @@ -72,7 +85,7 @@ function bundleOne(moduleId, exclude) { 'vs/basic-languages': REPO_ROOT + '/release/dev' }, optimize: 'none' - }, function(buildResponse) { + }, function (buildResponse) { const filePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js'); const fileContents = fs.readFileSync(filePath).toString(); console.log(); diff --git a/src/_.contribution.ts b/src/_.contribution.ts index 80594a56..5aafec65 100644 --- a/src/_.contribution.ts +++ b/src/_.contribution.ts @@ -8,7 +8,7 @@ const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); interface ILang extends monaco.languages.ILanguageExtensionPoint { - loader: () => monaco.Promise; + loader: () => Promise; } interface ILangImpl { @@ -18,7 +18,7 @@ interface ILangImpl { let languageDefinitions: { [languageId: string]: ILang } = {}; -function _loadLanguage(languageId: string): monaco.Promise { +function _loadLanguage(languageId: string): Promise { const loader = languageDefinitions[languageId].loader; return loader().then((mod) => { _monaco.languages.setMonarchTokensProvider(languageId, mod.language); @@ -26,9 +26,9 @@ function _loadLanguage(languageId: string): monaco.Promise { }); } -let languagePromises: { [languageId: string]: monaco.Promise } = {}; +let languagePromises: { [languageId: string]: Promise } = {}; -export function loadLanguage(languageId: string): monaco.Promise { +export function loadLanguage(languageId: string): Promise { if (!languagePromises[languageId]) { languagePromises[languageId] = _loadLanguage(languageId); } diff --git a/src/apex/apex.contribution.ts b/src/apex/apex.contribution.ts new file mode 100644 index 00000000..921873df --- /dev/null +++ b/src/apex/apex.contribution.ts @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'apex', + extensions: ['.cls'], + aliases: ['Apex', 'apex'], + mimetypes: ['text/x-apex-source', 'text/x-apex'], + loader: () => import('./apex') +}); diff --git a/src/apex/apex.test.ts b/src/apex/apex.test.ts new file mode 100644 index 00000000..5f9f6c8f --- /dev/null +++ b/src/apex/apex.test.ts @@ -0,0 +1,651 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { testTokenization } from '../test/testRunner'; + +testTokenization('apex', [ + // Comments - single line + [{ + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }], + + [{ + line: ' // a comment', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'comment.apex' } + ] + }], + + // Broken nested tokens due to invalid comment tokenization + [{ + line: '/* //*/ a', + tokens: [ + { startIndex: 0, type: 'comment.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.apex' } + ] + }], + + [{ + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }], + + [{ + line: '//sticky comment', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }], + + [{ + line: '/almost a comment', + tokens: [ + { startIndex: 0, type: 'delimiter.apex' }, + { startIndex: 1, type: 'identifier.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.apex' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'identifier.apex' } + ] + }], + + [{ + line: '1 / 2; /* comment', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.apex' }, + { startIndex: 5, type: 'delimiter.apex' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'comment.apex' } + ] + }], + + [{ + line: 'int x = 1; // my comment // is a nice one', + tokens: [ + { startIndex: 0, type: 'keyword.int.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.apex' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'number.apex' }, + { startIndex: 9, type: 'delimiter.apex' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'comment.apex' } + ] + }], + + // Comments - range comment, single line + [{ + line: '/* a simple comment */', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }], + + [{ + line: 'int x = /* a simple comment */ 1;', + tokens: [ + { startIndex: 0, type: 'keyword.int.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.apex' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.apex' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'number.apex' }, + { startIndex: 32, type: 'delimiter.apex' } + ] + }], + + [{ + line: 'int x = /* comment */ 1; */', + tokens: [ + { startIndex: 0, type: 'keyword.int.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.apex' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.apex' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'number.apex' }, + { startIndex: 23, type: 'delimiter.apex' }, + { startIndex: 24, type: '' } + ] + }], + + [{ + line: 'x = /**/;', + tokens: [ + { startIndex: 0, type: 'identifier.apex' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.apex' }, + { startIndex: 8, type: 'delimiter.apex' } + ] + }], + + [{ + line: 'x = /*/;', + tokens: [ + { startIndex: 0, type: 'identifier.apex' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.apex' } + ] + }], + + // Comments - range comment, multiple lines + [{ + line: '/* start of multiline comment', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }], + + [{ + line: 'int x = /* start a comment', + tokens: [ + { startIndex: 0, type: 'keyword.int.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.apex' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.apex' } + ] + }, { + line: ' a ', + tokens: [ + { startIndex: 0, type: 'comment.apex' } + ] + }, { + line: 'and end it */ 2;', + tokens: [ + { startIndex: 0, type: 'comment.apex' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'number.apex' }, + { startIndex: 15, type: 'delimiter.apex' } + ] + }], + + // Comments - apex doc, multiple lines + [{ + line: '/** start of Apex Doc', + tokens: [ + { startIndex: 0, type: 'comment.doc.apex' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.doc.apex' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.doc.apex' } + ] + }], + + // Keywords + [{ + line: 'package test; class Program { static void main(String[] args) {} } }', + tokens: [ + { startIndex: 0, type: 'keyword.package.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.apex' }, + { startIndex: 12, type: 'delimiter.apex' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'keyword.class.apex' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'type.identifier.apex' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'delimiter.curly.apex' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'keyword.static.apex' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'keyword.void.apex' }, + { startIndex: 41, type: '' }, + { startIndex: 42, type: 'identifier.apex' }, + { startIndex: 46, type: 'delimiter.parenthesis.apex' }, + { startIndex: 47, type: 'type.identifier.apex' }, + { startIndex: 53, type: 'delimiter.square.apex' }, + { startIndex: 55, type: '' }, + { startIndex: 56, type: 'identifier.apex' }, + { startIndex: 60, type: 'delimiter.parenthesis.apex' }, + { startIndex: 61, type: '' }, + { startIndex: 62, type: 'delimiter.curly.apex' }, + { startIndex: 64, type: '' }, + { startIndex: 65, type: 'delimiter.curly.apex' }, + { startIndex: 66, type: '' }, + { startIndex: 67, type: 'delimiter.curly.apex' } + ] + }], + + // Keywords with case variations + [{ + line: 'Package test; CLASS Program { Static void main(String[] args) {} } }', + tokens: [ + { startIndex: 0, type: 'keyword.Package.apex' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.apex' }, + { startIndex: 12, type: 'delimiter.apex' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'keyword.CLASS.apex' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'type.identifier.apex' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'delimiter.curly.apex' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'keyword.Static.apex' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'keyword.void.apex' }, + { startIndex: 41, type: '' }, + { startIndex: 42, type: 'identifier.apex' }, + { startIndex: 46, type: 'delimiter.parenthesis.apex' }, + { startIndex: 47, type: 'type.identifier.apex' }, + { startIndex: 53, type: 'delimiter.square.apex' }, + { startIndex: 55, type: '' }, + { startIndex: 56, type: 'identifier.apex' }, + { startIndex: 60, type: 'delimiter.parenthesis.apex' }, + { startIndex: 61, type: '' }, + { startIndex: 62, type: 'delimiter.curly.apex' }, + { startIndex: 64, type: '' }, + { startIndex: 65, type: 'delimiter.curly.apex' }, + { startIndex: 66, type: '' }, + { startIndex: 67, type: 'delimiter.curly.apex' } + ] + }], + + // Numbers + [{ + line: '0', + tokens: [ + { startIndex: 0, type: 'number.apex' } + ] + }], + + [{ + line: '0.10', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '0x', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: 'identifier.apex' } + ] + }], + + [{ + line: '10e3', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '10f', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5e3', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5e-3', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5E3', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5E-3', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5F', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5f', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5D', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23.5d', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '1.72E3D', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '1.72E3d', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '1.72E-3d', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '1.72e3D', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '1.72e3d', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '1.72e-3d', + tokens: [ + { startIndex: 0, type: 'number.float.apex' } + ] + }], + + [{ + line: '23L', + tokens: [ + { startIndex: 0, type: 'number.apex' } + ] + }], + + [{ + line: '23l', + tokens: [ + { startIndex: 0, type: 'number.apex' } + ] + }], + + [{ + line: '0_52', + tokens: [ + { startIndex: 0, type: 'number.apex' } + ] + }], + + [{ + line: '5_2', + tokens: [ + { startIndex: 0, type: 'number.apex' } + ] + }], + + [{ + line: '5_______2', + tokens: [ + { startIndex: 0, type: 'number.apex' } + ] + }], + + [{ + line: '3_.1415F', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: 'identifier.apex' }, + { startIndex: 2, type: 'delimiter.apex' }, + { startIndex: 3, type: 'number.float.apex' } + ] + }], + + [{ + line: '3._1415F', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: 'delimiter.apex' }, + { startIndex: 2, type: 'identifier.apex' } + ] + }], + + [{ + line: '999_99_9999_L', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 11, type: 'identifier.apex' } + ] + }], + + [{ + line: '52_', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 2, type: 'identifier.apex' } + ] + }], + + [{ + line: '0_x52', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: 'identifier.apex' } + ] + }], + + [{ + line: '0x_52', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: 'identifier.apex' } + ] + }], + + [{ + line: '23.5L', + tokens: [ + { startIndex: 0, type: 'number.float.apex' }, + { startIndex: 4, type: 'type.identifier.apex' } + ] + }], + + [{ + line: '0+0', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: 'delimiter.apex' }, + { startIndex: 2, type: 'number.apex' } + ] + }], + + [{ + line: '100+10', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 3, type: 'delimiter.apex' }, + { startIndex: 4, type: 'number.apex' } + ] + }], + + [{ + line: '0 + 0', + tokens: [ + { startIndex: 0, type: 'number.apex' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.apex' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.apex' } + ] + }], + + // single line Strings + [{ + line: 'String s = "I\'m an Apex String";', + tokens: [ + { startIndex: 0, type: 'type.identifier.apex' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'identifier.apex' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.apex' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.apex' }, + { startIndex: 31, type: 'delimiter.apex' } + ] + }], + + [{ + line: 'String s = "concatenated" + " String" ;', + tokens: [ + { startIndex: 0, type: 'type.identifier.apex' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'identifier.apex' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.apex' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.apex' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'delimiter.apex' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'string.apex' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'delimiter.apex' } + ] + }], + + [{ + line: '"quote in a string"', + tokens: [ + { startIndex: 0, type: 'string.apex' } + ] + }], + + [{ + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: 'string.apex' }, + { startIndex: 10, type: 'string.escape.apex' }, + { startIndex: 12, type: 'string.apex' }, + { startIndex: 18, type: 'string.escape.apex' }, + { startIndex: 20, type: 'string.apex' } + ] + }], + + [{ + line: '"\\"', + tokens: [ + { startIndex: 0, type: 'string.invalid.apex' } + ] + }], + + // Annotations + [{ + line: '@', + tokens: [ + { startIndex: 0, type: '' } + ] + }], + + [{ + line: '@Override', + tokens: [ + { startIndex: 0, type: 'annotation.apex' } + ] + }], + + [{ + line: '@SuppressWarnings(value = "aString")', + tokens: [ + { startIndex: 0, type: 'annotation.apex' }, + { startIndex: 17, type: 'delimiter.parenthesis.apex' }, + { startIndex: 18, type: 'identifier.apex' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'delimiter.apex' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'string.apex' }, + { startIndex: 35, type: 'delimiter.parenthesis.apex' } + ] + }], + + [{ + line: '@ AnnotationWithKeywordAfter private', + tokens: [ + { startIndex: 0, type: 'annotation.apex' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'keyword.private.apex' } + ] + }] +]); + diff --git a/src/apex/apex.ts b/src/apex/apex.ts new file mode 100644 index 00000000..c02eddd9 --- /dev/null +++ b/src/apex/apex.ts @@ -0,0 +1,310 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; +import ILanguage = monaco.languages.IMonarchLanguage; + +export const conf: IRichLanguageConfiguration = { + // the default separators except `@$` + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, + comments: { + lineComment: '//', + blockComment: ['/*', '*/'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + { open: '<', close: '>' }, + ], + folding: { + markers: { + start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))") + } + } +}; + +const keywords = [ + 'abstract', + 'activate', + 'and', + 'any', + 'array', + 'as', + 'asc', + 'assert', + 'autonomous', + 'begin', + 'bigdecimal', + 'blob', + 'boolean', + 'break', + 'bulk', + 'by', + 'case', + 'cast', + 'catch', + 'char', + 'class', + 'collect', + 'commit', + 'const', + 'continue', + 'convertcurrency', + 'decimal', + 'default', + 'delete', + 'desc', + 'do', + 'double', + 'else', + 'end', + 'enum', + 'exception', + 'exit', + 'export', + 'extends', + 'false', + 'final', + 'finally', + 'float', + 'for', + 'from', + 'future', + 'get', + 'global', + 'goto', + 'group', + 'having', + 'hint', + 'if', + 'implements', + 'import', + 'in', + 'inner', + 'insert', + 'instanceof', + 'int', + 'interface', + 'into', + 'join', + 'last_90_days', + 'last_month', + 'last_n_days', + 'last_week', + 'like', + 'limit', + 'list', + 'long', + 'loop', + 'map', + 'merge', + 'native', + 'new', + 'next_90_days', + 'next_month', + 'next_n_days', + 'next_week', + 'not', + 'null', + 'nulls', + 'number', + 'object', + 'of', + 'on', + 'or', + 'outer', + 'override', + 'package', + 'parallel', + 'pragma', + 'private', + 'protected', + 'public', + 'retrieve', + 'return', + 'returning', + 'rollback', + 'savepoint', + 'search', + 'select', + 'set', + 'short', + 'sort', + 'stat', + 'static', + 'strictfp', + 'super', + 'switch', + 'synchronized', + 'system', + 'testmethod', + 'then', + 'this', + 'this_month', + 'this_week', + 'throw', + 'throws', + 'today', + 'tolabel', + 'tomorrow', + 'transaction', + 'transient', + 'trigger', + 'true', + 'try', + 'type', + 'undelete', + 'update', + 'upsert', + 'using', + 'virtual', + 'void', + 'volatile', + 'webservice', + 'when', + 'where', + 'while', + 'yesterday' +]; + +// create case variations of the keywords - apex is case insensitive, but we can't make the highlighter case insensitive +// because we use a heuristic to assume that identifiers starting with an upper case letter are types. +const uppercaseFirstLetter = (lowercase) => lowercase.charAt(0).toUpperCase() + lowercase.substr(1); + +let keywordsWithCaseVariations = []; +keywords.forEach(lowercase => { + keywordsWithCaseVariations.push(lowercase); + keywordsWithCaseVariations.push(lowercase.toUpperCase()); + keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase)); +}) + +export const language = { + defaultToken: '', + tokenPostfix: '.apex', + + keywords: keywordsWithCaseVariations, + + operators: [ + '=', '>', '<', '!', '~', '?', ':', + '==', '<=', '>=', '!=', '&&', '||', '++', '--', + '+', '-', '*', '/', '&', '|', '^', '%', '<<', + '>>', '>>>', '+=', '-=', '*=', '/=', '&=', '|=', + '^=', '%=', '<<=', '>>=', '>>>=' + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + + // @ annotations. + [/@\s*[a-zA-Z_\$][\w\$]*/, 'annotation'], + + // numbers + [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], + [/(@digits)[fFdD]/, 'number.float'], + [/(@digits)[lL]?/, 'number'], + + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string + [/'([^'\\]|\\.)*$/, 'string.invalid' ], // non-teminated string + [/"/, 'string', '@string."' ], + [/'/, 'string', '@string.\'' ], + + + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@apexdoc'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + + comment: [ + [/[^\/*]+/, 'comment'], + // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( + // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + + //Identical copy of comment above, except for the addition of .doc + apexdoc: [ + [/[^\/*]+/, 'comment.doc'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], + + string: [ + [/[^\\"']+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/["']/, { cases: { '$#==$S2' : { token: 'string', next: '@pop' }, + '@default': 'string' }} ] + ], + }, +}; diff --git a/src/azcli/azcli.contribution.ts b/src/azcli/azcli.contribution.ts new file mode 100644 index 00000000..50511a41 --- /dev/null +++ b/src/azcli/azcli.contribution.ts @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'azcli', + extensions: ['.azcli'], + aliases: ['Azure CLI', 'azcli'], + loader: () => import('./azcli') +}); diff --git a/src/azcli/azcli.test.ts b/src/azcli/azcli.test.ts new file mode 100644 index 00000000..d1ae3bd3 --- /dev/null +++ b/src/azcli/azcli.test.ts @@ -0,0 +1,157 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { testTokenization as actualTestTokenization, ITestItem } from '../test/testRunner'; + +function testTokenization(_language: string | string[], tests: ITestItem[][]): void { + tests = tests.map(t => { + return t.map(t => { + return { + line: t.line.replace(/\n/g, ' '), + tokens: t.tokens + }; + }); + }); + actualTestTokenization(_language, tests); +} + +testTokenization('azcli', [ + // Comment single line + [{ + line: '#', + tokens: [ + { startIndex: 0, type: 'comment.azcli' } + ] + }], + [{ + line: '# az find -q secret', + tokens: [ + { startIndex: 0, type: 'comment.azcli' } + ] + }], + [{ + line: ' # az find -q secret', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' }, + { startIndex: 4, type: 'comment.azcli' } + ] + }], + [{ + line: '#az find -q secret', + tokens: [ + { startIndex: 0, type: 'comment.azcli' } + ] + }], + + // Other cases + [{ + line: 'az find -q secret', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' }, + { startIndex: 7, type: 'key.identifier.azcli' }, + { startIndex: 11, type: 'string.azcli' } + ] + }], + [{ + line: '', + tokens: [ + ] + }], + [{ + line: ' ', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' } + ] + }], + [{ + line: '--assignee', + tokens: [ + { startIndex: 0, type: 'key.identifier.azcli' } + ] + }], + [{ + line: ' --service-principal', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' }, + { startIndex: 3, type: 'key.identifier.azcli' } + ] + }], + [{ + line: 'az ad sp create-for-rb --name ServicePrincipalName --password PASSWORD', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' }, + { startIndex: 23, type: 'key.identifier.azcli' }, + { startIndex: 31, type: 'string.azcli' }, + { startIndex: 52, type: 'key.identifier.azcli' }, + { startIndex: 63, type: 'string.azcli' } + ] + }], + [{ + line: '--name!~`\"$%^&*(|\/\.,-=+', + tokens: [ + { startIndex: 0, type: 'key.identifier.azcli' } + ] + }], + [{ + line: '--name#some comment', + tokens: [ + { startIndex: 0, type: 'key.identifier.azcli' }, + { startIndex: 6, type: 'comment.azcli' } + ] + }], + [{ + line: '--query osPro ``````', + tokens: [ + { startIndex: 0, type: 'key.identifier.azcli' }, + { startIndex: 8, type: 'string.azcli' } + ] + }], + [{ + line: 'az ad sp create-for-rbac', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' } + ] + }], + [{ + line: '123456789', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' } + ] + }], + [{ + line: '- abc', + tokens: [ + { startIndex: 0, type: 'key.identifier.azcli' }, + { startIndex: 2, type: 'string.azcli' } + ] + }], + [{ + line: '- @!$()', + tokens: [ + { startIndex: 0, type: 'key.identifier.azcli' }, + { startIndex: 2, type: 'string.azcli' } + ] + }], + [{ + line: '""', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' } + ] + }], + [{ + line: '// some text', + tokens: [ + { startIndex: 0, type: 'keyword.azcli' } + ] + }], + [{ + line: `'APP_ID'`, + tokens: [ + { startIndex: 0, type: 'keyword.azcli' } + ] + }] +]); diff --git a/src/azcli/azcli.ts b/src/azcli/azcli.ts new file mode 100644 index 00000000..62bf5740 --- /dev/null +++ b/src/azcli/azcli.ts @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; +import ILanguage = monaco.languages.IMonarchLanguage; + +export const conf: IRichLanguageConfiguration = { + comments: { + lineComment: '#', + } +}; + +export const language = { + defaultToken: 'keyword', + ignoreCase: true, + tokenPostfix: '.azcli', + + str: /[^#\s]/, + + tokenizer: { + root: [ + {include: '@comment'}, + [/\s-+@str*\s*/, { + cases: { + '@eos': { token: 'key.identifier', next: '@popall' }, + '@default': { token: 'key.identifier', next: '@type' } + } + }], + [/^-+@str*\s*/, { + cases: { + '@eos': { token: 'key.identifier', next: '@popall' }, + '@default': { token: 'key.identifier', next: '@type' } + } + }] + ], + + type: [ + {include: '@comment'}, + [/-+@str*\s*/, { + cases: { + '@eos': { token: 'key.identifier', next: '@popall' }, + '@default': 'key.identifier' + } + }], + [/@str+\s*/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }] + ], + + comment: [ + [/#.*$/, { + cases: { + '@eos': { token: 'comment', next: '@popall' } + } + }] + ] + } +}; diff --git a/src/bat/bat.contribution.ts b/src/bat/bat.contribution.ts index 91261712..a17f9d0f 100644 --- a/src/bat/bat.contribution.ts +++ b/src/bat/bat.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'bat', extensions: ['.bat', '.cmd'], aliases: ['Batch', 'bat'], - loader: () => _monaco.Promise.wrap(import('./bat')) + loader: () => import('./bat') }); diff --git a/src/clojure/clojure.contribution.ts b/src/clojure/clojure.contribution.ts new file mode 100644 index 00000000..a5c7696b --- /dev/null +++ b/src/clojure/clojure.contribution.ts @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'clojure', + extensions: ['.clj', '.cljs', '.cljc', '.edn'], + aliases: ['clojure', 'Clojure'], + loader: () => import('./clojure') +}); diff --git a/src/clojure/clojure.test.ts b/src/clojure/clojure.test.ts new file mode 100644 index 00000000..57807964 --- /dev/null +++ b/src/clojure/clojure.test.ts @@ -0,0 +1,901 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import {ITestItem, testTokenization} from '../test/testRunner'; + +const specialForms = [ + '.', + 'catch', + 'def', + 'do', + 'if', + 'monitor-enter', + 'monitor-exit', + 'new', + 'quote', + 'recur', + 'set!', + 'throw', + 'try', + 'var', +]; + +const coreSymbols = [ + '*', + '*\'', + '*1', + '*2', + '*3', + '*agent*', + '*allow-unresolved-vars*', + '*assert*', + '*clojure-version*', + '*command-line-args*', + '*compile-files*', + '*compile-path*', + '*compiler-options*', + '*data-readers*', + '*default-data-reader-fn*', + '*e', + '*err*', + '*file*', + '*flush-on-newline*', + '*fn-loader*', + '*in*', + '*math-context*', + '*ns*', + '*out*', + '*print-dup*', + '*print-length*', + '*print-level*', + '*print-meta*', + '*print-namespace-maps*', + '*print-readably*', + '*read-eval*', + '*reader-resolver*', + '*source-path*', + '*suppress-read*', + '*unchecked-math*', + '*use-context-classloader*', + '*verbose-defrecords*', + '*warn-on-reflection*', + '+', + '+\'', + '-', + '-\'', + '->', + '->>', + '->ArrayChunk', + '->Eduction', + '->Vec', + '->VecNode', + '->VecSeq', + '-cache-protocol-fn', + '-reset-methods', + '..', + '/', + '<', + '<=', + '=', + '==', + '>', + '>=', + 'EMPTY-NODE', + 'Inst', + 'StackTraceElement->vec', + 'Throwable->map', + 'accessor', + 'aclone', + 'add-classpath', + 'add-watch', + 'agent', + 'agent-error', + 'agent-errors', + 'aget', + 'alength', + 'alias', + 'all-ns', + 'alter', + 'alter-meta!', + 'alter-var-root', + 'amap', + 'ancestors', + 'and', + 'any?', + 'apply', + 'areduce', + 'array-map', + 'as->', + 'aset', + 'aset-boolean', + 'aset-byte', + 'aset-char', + 'aset-double', + 'aset-float', + 'aset-int', + 'aset-long', + 'aset-short', + 'assert', + 'assoc', + 'assoc!', + 'assoc-in', + 'associative?', + 'atom', + 'await', + 'await-for', + 'await1', + 'bases', + 'bean', + 'bigdec', + 'bigint', + 'biginteger', + 'binding', + 'bit-and', + 'bit-and-not', + 'bit-clear', + 'bit-flip', + 'bit-not', + 'bit-or', + 'bit-set', + 'bit-shift-left', + 'bit-shift-right', + 'bit-test', + 'bit-xor', + 'boolean', + 'boolean-array', + 'boolean?', + 'booleans', + 'bound-fn', + 'bound-fn*', + 'bound?', + 'bounded-count', + 'butlast', + 'byte', + 'byte-array', + 'bytes', + 'bytes?', + 'case', + 'cast', + 'cat', + 'char', + 'char-array', + 'char-escape-string', + 'char-name-string', + 'char?', + 'chars', + 'chunk', + 'chunk-append', + 'chunk-buffer', + 'chunk-cons', + 'chunk-first', + 'chunk-next', + 'chunk-rest', + 'chunked-seq?', + 'class', + 'class?', + 'clear-agent-errors', + 'clojure-version', + 'coll?', + 'comment', + 'commute', + 'comp', + 'comparator', + 'compare', + 'compare-and-set!', + 'compile', + 'complement', + 'completing', + 'concat', + 'cond', + 'cond->', + 'cond->>', + 'condp', + 'conj', + 'conj!', + 'cons', + 'constantly', + 'construct-proxy', + 'contains?', + 'count', + 'counted?', + 'create-ns', + 'create-struct', + 'cycle', + 'dec', + 'dec\'', + 'decimal?', + 'declare', + 'dedupe', + 'default-data-readers', + 'definline', + 'definterface', + 'defmacro', + 'defmethod', + 'defmulti', + 'defn', + 'defn-', + 'defonce', + 'defprotocol', + 'defrecord', + 'defstruct', + 'deftype', + 'delay', + 'delay?', + 'deliver', + 'denominator', + 'deref', + 'derive', + 'descendants', + 'destructure', + 'disj', + 'disj!', + 'dissoc', + 'dissoc!', + 'distinct', + 'distinct?', + 'doall', + 'dorun', + 'doseq', + 'dosync', + 'dotimes', + 'doto', + 'double', + 'double-array', + 'double?', + 'doubles', + 'drop', + 'drop-last', + 'drop-while', + 'eduction', + 'empty', + 'empty?', + 'ensure', + 'ensure-reduced', + 'enumeration-seq', + 'error-handler', + 'error-mode', + 'eval', + 'even?', + 'every-pred', + 'every?', + 'ex-data', + 'ex-info', + 'extend', + 'extend-protocol', + 'extend-type', + 'extenders', + 'extends?', + 'false?', + 'ffirst', + 'file-seq', + 'filter', + 'filterv', + 'find', + 'find-keyword', + 'find-ns', + 'find-protocol-impl', + 'find-protocol-method', + 'find-var', + 'first', + 'flatten', + 'float', + 'float-array', + 'float?', + 'floats', + 'flush', + 'fn', + 'fn?', + 'fnext', + 'fnil', + 'for', + 'force', + 'format', + 'frequencies', + 'future', + 'future-call', + 'future-cancel', + 'future-cancelled?', + 'future-done?', + 'future?', + 'gen-class', + 'gen-interface', + 'gensym', + 'get', + 'get-in', + 'get-method', + 'get-proxy-class', + 'get-thread-bindings', + 'get-validator', + 'group-by', + 'halt-when', + 'hash', + 'hash-combine', + 'hash-map', + 'hash-ordered-coll', + 'hash-set', + 'hash-unordered-coll', + 'ident?', + 'identical?', + 'identity', + 'if-let', + 'if-not', + 'if-some', + 'ifn?', + 'import', + 'in-ns', + 'inc', + 'inc\'', + 'indexed?', + 'init-proxy', + 'inst-ms', + 'inst-ms*', + 'inst?', + 'instance?', + 'int', + 'int-array', + 'int?', + 'integer?', + 'interleave', + 'intern', + 'interpose', + 'into', + 'into-array', + 'ints', + 'io!', + 'isa?', + 'iterate', + 'iterator-seq', + 'juxt', + 'keep', + 'keep-indexed', + 'key', + 'keys', + 'keyword', + 'keyword?', + 'last', + 'lazy-cat', + 'lazy-seq', + 'let', + 'letfn', + 'line-seq', + 'list', + 'list*', + 'list?', + 'load', + 'load-file', + 'load-reader', + 'load-string', + 'loaded-libs', + 'locking', + 'long', + 'long-array', + 'longs', + 'loop', + 'macroexpand', + 'macroexpand-1', + 'make-array', + 'make-hierarchy', + 'map', + 'map-entry?', + 'map-indexed', + 'map?', + 'mapcat', + 'mapv', + 'max', + 'max-key', + 'memfn', + 'memoize', + 'merge', + 'merge-with', + 'meta', + 'method-sig', + 'methods', + 'min', + 'min-key', + 'mix-collection-hash', + 'mod', + 'munge', + 'name', + 'namespace', + 'namespace-munge', + 'nat-int?', + 'neg-int?', + 'neg?', + 'newline', + 'next', + 'nfirst', + 'nil?', + 'nnext', + 'not', + 'not-any?', + 'not-empty', + 'not-every?', + 'not=', + 'ns', + 'ns-aliases', + 'ns-imports', + 'ns-interns', + 'ns-map', + 'ns-name', + 'ns-publics', + 'ns-refers', + 'ns-resolve', + 'ns-unalias', + 'ns-unmap', + 'nth', + 'nthnext', + 'nthrest', + 'num', + 'number?', + 'numerator', + 'object-array', + 'odd?', + 'or', + 'parents', + 'partial', + 'partition', + 'partition-all', + 'partition-by', + 'pcalls', + 'peek', + 'persistent!', + 'pmap', + 'pop', + 'pop!', + 'pop-thread-bindings', + 'pos-int?', + 'pos?', + 'pr', + 'pr-str', + 'prefer-method', + 'prefers', + 'primitives-classnames', + 'print', + 'print-ctor', + 'print-dup', + 'print-method', + 'print-simple', + 'print-str', + 'printf', + 'println', + 'println-str', + 'prn', + 'prn-str', + 'promise', + 'proxy', + 'proxy-call-with-super', + 'proxy-mappings', + 'proxy-name', + 'proxy-super', + 'push-thread-bindings', + 'pvalues', + 'qualified-ident?', + 'qualified-keyword?', + 'qualified-symbol?', + 'quot', + 'rand', + 'rand-int', + 'rand-nth', + 'random-sample', + 'range', + 'ratio?', + 'rational?', + 'rationalize', + 're-find', + 're-groups', + 're-matcher', + 're-matches', + 're-pattern', + 're-seq', + 'read', + 'read-line', + 'read-string', + 'reader-conditional', + 'reader-conditional?', + 'realized?', + 'record?', + 'reduce', + 'reduce-kv', + 'reduced', + 'reduced?', + 'reductions', + 'ref', + 'ref-history-count', + 'ref-max-history', + 'ref-min-history', + 'ref-set', + 'refer', + 'refer-clojure', + 'reify', + 'release-pending-sends', + 'rem', + 'remove', + 'remove-all-methods', + 'remove-method', + 'remove-ns', + 'remove-watch', + 'repeat', + 'repeatedly', + 'replace', + 'replicate', + 'require', + 'reset!', + 'reset-meta!', + 'reset-vals!', + 'resolve', + 'rest', + 'restart-agent', + 'resultset-seq', + 'reverse', + 'reversible?', + 'rseq', + 'rsubseq', + 'run!', + 'satisfies?', + 'second', + 'select-keys', + 'send', + 'send-off', + 'send-via', + 'seq', + 'seq?', + 'seqable?', + 'seque', + 'sequence', + 'sequential?', + 'set', + 'set-agent-send-executor!', + 'set-agent-send-off-executor!', + 'set-error-handler!', + 'set-error-mode!', + 'set-validator!', + 'set?', + 'short', + 'short-array', + 'shorts', + 'shuffle', + 'shutdown-agents', + 'simple-ident?', + 'simple-keyword?', + 'simple-symbol?', + 'slurp', + 'some', + 'some->', + 'some->>', + 'some-fn', + 'some?', + 'sort', + 'sort-by', + 'sorted-map', + 'sorted-map-by', + 'sorted-set', + 'sorted-set-by', + 'sorted?', + 'special-symbol?', + 'spit', + 'split-at', + 'split-with', + 'str', + 'string?', + 'struct', + 'struct-map', + 'subs', + 'subseq', + 'subvec', + 'supers', + 'swap!', + 'swap-vals!', + 'symbol', + 'symbol?', + 'sync', + 'tagged-literal', + 'tagged-literal?', + 'take', + 'take-last', + 'take-nth', + 'take-while', + 'test', + 'the-ns', + 'thread-bound?', + 'time', + 'to-array', + 'to-array-2d', + 'trampoline', + 'transduce', + 'transient', + 'tree-seq', + 'true?', + 'type', + 'unchecked-add', + 'unchecked-add-int', + 'unchecked-byte', + 'unchecked-char', + 'unchecked-dec', + 'unchecked-dec-int', + 'unchecked-divide-int', + 'unchecked-double', + 'unchecked-float', + 'unchecked-inc', + 'unchecked-inc-int', + 'unchecked-int', + 'unchecked-long', + 'unchecked-multiply', + 'unchecked-multiply-int', + 'unchecked-negate', + 'unchecked-negate-int', + 'unchecked-remainder-int', + 'unchecked-short', + 'unchecked-subtract', + 'unchecked-subtract-int', + 'underive', + 'unquote', + 'unquote-splicing', + 'unreduced', + 'unsigned-bit-shift-right', + 'update', + 'update-in', + 'update-proxy', + 'uri?', + 'use', + 'uuid?', + 'val', + 'vals', + 'var-get', + 'var-set', + 'var?', + 'vary-meta', + 'vec', + 'vector', + 'vector-of', + 'vector?', + 'volatile!', + 'volatile?', + 'vreset!', + 'vswap!', + 'when', + 'when-first', + 'when-let', + 'when-not', + 'when-some', + 'while', + 'with-bindings', + 'with-bindings*', + 'with-in-str', + 'with-loading-context', + 'with-local-vars', + 'with-meta', + 'with-open', + 'with-out-str', + 'with-precision', + 'with-redefs', + 'with-redefs-fn', + 'xml-seq', + 'zero?', + 'zipmap', +]; + +function createTestCases(specialForms: string[], type: string): ITestItem[] { + const testCases = []; + + for (const specialForm of specialForms) { + testCases.push({ + line: `${specialForm}`, + tokens: [ + {startIndex: 0, type: `${type}.clj`}, + ], + }); + } + + return testCases; +} + +testTokenization('clojure', [ + // special forms + createTestCases(specialForms, 'keyword'), + + // core symbols + createTestCases(coreSymbols, 'keyword'), + + // atoms + createTestCases(['false', 'nil', 'true'], 'constant'), + + // keywords + createTestCases([':foo', '::bar', ':foo/bar', ':foo.bar/baz'], 'constant'), + + // numbers + createTestCases([ + '42', '+42', '-421', + '42N', '+42N', '-42N', + '0.42', '+0.42', '-0.42', + '42M', '+42M', '-42M', + '42.42M', '+42.42M', '-42.42M', + '1/42', '+1/42', '-1/42', + '0x42af', '+0x42af', '-0x42af', + '0x42AF', '+0x42AF', '-0x42AF', + '1e2', '1e+2', '1e-2', + '+1e2', '+1e+2', '+1e-2', + '-1e2', '-1e+2', '-1e-2', + '-1.0e2', '-0.1e+2', '-1.01e-2', + '1E2', '1E+2', '1E-2', + '+1E2', '+1E+2', '+1E-2', + '-1E2', '-1E+2', '-1E-2', + '-1.0E2', '-0.1E+2', '-1.01E-2', + '2r101010', '+2r101010', '-2r101010', + '2r101010', '+2r101010', '-2r101010', + '8r52', '+8r52', '-8r52', + '36rhello', '+36rhello', '-36rhello', + '36rz', '+36rz', '-36rz', + '36rZ', '+36rZ', '-36rZ', + ], 'number'), + + // characters + createTestCases([ + '\\1', + '\\a', + '\\#', + '\\\\', + '\\\"', + '\\(', + '\\A', + '\\backspace', + '\\formfeed', + '\\newline', + '\\space', + '\\return', + '\\tab', + '\\o123', + '\\u1000', + '\\uAaAa', + '\\u9F9F' + ], 'string'), + + // strings + [ + { + line: '"I\'m a little teapot."', + tokens: [ + {startIndex: 0, type: 'string.clj'}, + ] + }, + { + line: '"I\'m a \\"little\\" teapot."', + tokens: [ + {startIndex: 0, type: 'string.clj'}, + {startIndex: 7, type: 'string.escape.clj'}, + {startIndex: 9, type: 'string.clj'}, + {startIndex: 15, type: 'string.escape.clj'}, + {startIndex: 17, type: 'string.clj'}, + ] + } + ], + + // multi-line strings + [ + { + line: '"I\'m', + tokens: [ + {startIndex: 0, type: 'string.clj'}, + ] + }, + { + line: '\\"a little\\"', + tokens: [ + {startIndex: 0, type: 'string.escape.clj'}, + {startIndex: 2, type: 'string.clj'}, + {startIndex: 10, type: 'string.escape.clj'}, + ] + }, + { + line: 'teapot."', + tokens: [ + {startIndex: 0, type: 'string.clj'}, + ] + } + ], + + // strings with other escapes in them (\" \' \\ \b \f \n \r \t) + [{ + line: '"the escape \\" \\\' \\\\ \\b \\f \\n \\r \\t characters"', + tokens: [ + {startIndex: 0, type: 'string.clj'}, + {startIndex: 12, type: 'string.escape.clj'}, + {startIndex: 14, type: 'string.clj'}, + {startIndex: 15, type: 'string.escape.clj'}, + {startIndex: 17, type: 'string.clj'}, + {startIndex: 18, type: 'string.escape.clj'}, + {startIndex: 20, type: 'string.clj'}, + {startIndex: 21, type: 'string.escape.clj'}, + {startIndex: 23, type: 'string.clj'}, + {startIndex: 24, type: 'string.escape.clj'}, + {startIndex: 26, type: 'string.clj'}, + {startIndex: 27, type: 'string.escape.clj'}, + {startIndex: 29, type: 'string.clj'}, + {startIndex: 30, type: 'string.escape.clj'}, + {startIndex: 32, type: 'string.clj'}, + {startIndex: 33, type: 'string.escape.clj'}, + {startIndex: 35, type: 'string.clj'}, + ] + }], + + // comments + createTestCases([ + '; this is an in-line comment.', + ';; this is a line comment.', + ], 'comment'), + + // `comment` + [ + { + line: '(comment)', + tokens: [ + {startIndex: 0, type: 'comment.clj'}, + ], + }, + { + line: 'foo :bar 42', + tokens: [ + {startIndex: 0, type: 'identifier.clj'}, + {startIndex: 3, type: 'white.clj'}, + {startIndex: 4, type: 'constant.clj'}, + {startIndex: 8, type: 'white.clj'}, + {startIndex: 9, type: 'number.clj'}, + ], + }, + { + line: '(comment (foo [bar :baz 1 "qux"]))', + tokens: [ + {startIndex: 0, type: 'comment.clj'}, + ], + }, + { + line: '(comments foo bar)', + tokens: [ + {startIndex: 0, type: 'delimiter.parenthesis.clj'}, + {startIndex: 1, type: 'identifier.clj'}, + {startIndex: 9, type: 'white.clj'}, + {startIndex: 10, type: 'identifier.clj'}, + {startIndex: 13, type: 'white.clj'}, + {startIndex: 14, type: 'identifier.clj'}, + {startIndex: 17, type: 'delimiter.parenthesis.clj'}, + ] + }, + { + line: '(comment6 foo bar)', + tokens: [ + {startIndex: 0, type: 'delimiter.parenthesis.clj'}, + {startIndex: 1, type: 'identifier.clj'}, + {startIndex: 9, type: 'white.clj'}, + {startIndex: 10, type: 'identifier.clj'}, + {startIndex: 13, type: 'white.clj'}, + {startIndex: 14, type: 'identifier.clj'}, + {startIndex: 17, type: 'delimiter.parenthesis.clj'}, + ] + }, + { + line: '(comment foo', + tokens: [ + {startIndex: 0, type: 'comment.clj'}, + ], + }, + { + line: 'foo', + tokens: [ + {startIndex: 0, type: 'comment.clj'}, + ], + }, + ], + + // reader macro characters + createTestCases([ + '#', + '@', + '^', + '`', + '~', + "'", + ], 'meta') +]); diff --git a/src/clojure/clojure.ts b/src/clojure/clojure.ts new file mode 100644 index 00000000..a92f4745 --- /dev/null +++ b/src/clojure/clojure.ts @@ -0,0 +1,792 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; +import ILanguage = monaco.languages.IMonarchLanguage; + +export const conf: IRichLanguageConfiguration = { + comments: { + lineComment: ';;', + }, + + brackets: [ + ['[', ']'], + ['(', ')'], + ['{', '}'] + ], + + autoClosingPairs: [ + {open: '[', close: ']'}, + {open: '"', close: '"'}, + {open: '(', close: ')'}, + {open: '{', close: '}'}, + ], + + surroundingPairs: [ + {open: '[', close: ']'}, + {open: '"', close: '"'}, + {open: '(', close: ')'}, + {open: '{', close: '}'}, + ], +}; + +export const language = { + defaultToken: '', + ignoreCase: true, + tokenPostfix: '.clj', + + brackets: [ + {open: '[', close: ']', token: 'delimiter.square'}, + {open: '(', close: ')', token: 'delimiter.parenthesis'}, + {open: '{', close: '}', token: 'delimiter.curly'}, + ], + + constants: ['true', 'false', 'nil'], + + // delimiters: /[\\\[\]\s"#'(),;@^`{}~]|$/, + + numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/, + + characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/, + + escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, + + // simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/ + // simple-symbol := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/ + // qualified-symbol := ((<.>)*)? + qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/, + + specialForms: [ + '.', + 'catch', + 'def', + 'do', + 'if', + 'monitor-enter', + 'monitor-exit', + 'new', + 'quote', + 'recur', + 'set!', + 'throw', + 'try', + 'var', + ], + + coreSymbols: [ + '*', + '*\'', + '*1', + '*2', + '*3', + '*agent*', + '*allow-unresolved-vars*', + '*assert*', + '*clojure-version*', + '*command-line-args*', + '*compile-files*', + '*compile-path*', + '*compiler-options*', + '*data-readers*', + '*default-data-reader-fn*', + '*e', + '*err*', + '*file*', + '*flush-on-newline*', + '*fn-loader*', + '*in*', + '*math-context*', + '*ns*', + '*out*', + '*print-dup*', + '*print-length*', + '*print-level*', + '*print-meta*', + '*print-namespace-maps*', + '*print-readably*', + '*read-eval*', + '*reader-resolver*', + '*source-path*', + '*suppress-read*', + '*unchecked-math*', + '*use-context-classloader*', + '*verbose-defrecords*', + '*warn-on-reflection*', + '+', + '+\'', + '-', + '-\'', + '->', + '->>', + '->ArrayChunk', + '->Eduction', + '->Vec', + '->VecNode', + '->VecSeq', + '-cache-protocol-fn', + '-reset-methods', + '..', + '/', + '<', + '<=', + '=', + '==', + '>', + '>=', + 'EMPTY-NODE', + 'Inst', + 'StackTraceElement->vec', + 'Throwable->map', + 'accessor', + 'aclone', + 'add-classpath', + 'add-watch', + 'agent', + 'agent-error', + 'agent-errors', + 'aget', + 'alength', + 'alias', + 'all-ns', + 'alter', + 'alter-meta!', + 'alter-var-root', + 'amap', + 'ancestors', + 'and', + 'any?', + 'apply', + 'areduce', + 'array-map', + 'as->', + 'aset', + 'aset-boolean', + 'aset-byte', + 'aset-char', + 'aset-double', + 'aset-float', + 'aset-int', + 'aset-long', + 'aset-short', + 'assert', + 'assoc', + 'assoc!', + 'assoc-in', + 'associative?', + 'atom', + 'await', + 'await-for', + 'await1', + 'bases', + 'bean', + 'bigdec', + 'bigint', + 'biginteger', + 'binding', + 'bit-and', + 'bit-and-not', + 'bit-clear', + 'bit-flip', + 'bit-not', + 'bit-or', + 'bit-set', + 'bit-shift-left', + 'bit-shift-right', + 'bit-test', + 'bit-xor', + 'boolean', + 'boolean-array', + 'boolean?', + 'booleans', + 'bound-fn', + 'bound-fn*', + 'bound?', + 'bounded-count', + 'butlast', + 'byte', + 'byte-array', + 'bytes', + 'bytes?', + 'case', + 'cast', + 'cat', + 'char', + 'char-array', + 'char-escape-string', + 'char-name-string', + 'char?', + 'chars', + 'chunk', + 'chunk-append', + 'chunk-buffer', + 'chunk-cons', + 'chunk-first', + 'chunk-next', + 'chunk-rest', + 'chunked-seq?', + 'class', + 'class?', + 'clear-agent-errors', + 'clojure-version', + 'coll?', + 'comment', + 'commute', + 'comp', + 'comparator', + 'compare', + 'compare-and-set!', + 'compile', + 'complement', + 'completing', + 'concat', + 'cond', + 'cond->', + 'cond->>', + 'condp', + 'conj', + 'conj!', + 'cons', + 'constantly', + 'construct-proxy', + 'contains?', + 'count', + 'counted?', + 'create-ns', + 'create-struct', + 'cycle', + 'dec', + 'dec\'', + 'decimal?', + 'declare', + 'dedupe', + 'default-data-readers', + 'definline', + 'definterface', + 'defmacro', + 'defmethod', + 'defmulti', + 'defn', + 'defn-', + 'defonce', + 'defprotocol', + 'defrecord', + 'defstruct', + 'deftype', + 'delay', + 'delay?', + 'deliver', + 'denominator', + 'deref', + 'derive', + 'descendants', + 'destructure', + 'disj', + 'disj!', + 'dissoc', + 'dissoc!', + 'distinct', + 'distinct?', + 'doall', + 'dorun', + 'doseq', + 'dosync', + 'dotimes', + 'doto', + 'double', + 'double-array', + 'double?', + 'doubles', + 'drop', + 'drop-last', + 'drop-while', + 'eduction', + 'empty', + 'empty?', + 'ensure', + 'ensure-reduced', + 'enumeration-seq', + 'error-handler', + 'error-mode', + 'eval', + 'even?', + 'every-pred', + 'every?', + 'ex-data', + 'ex-info', + 'extend', + 'extend-protocol', + 'extend-type', + 'extenders', + 'extends?', + 'false?', + 'ffirst', + 'file-seq', + 'filter', + 'filterv', + 'find', + 'find-keyword', + 'find-ns', + 'find-protocol-impl', + 'find-protocol-method', + 'find-var', + 'first', + 'flatten', + 'float', + 'float-array', + 'float?', + 'floats', + 'flush', + 'fn', + 'fn?', + 'fnext', + 'fnil', + 'for', + 'force', + 'format', + 'frequencies', + 'future', + 'future-call', + 'future-cancel', + 'future-cancelled?', + 'future-done?', + 'future?', + 'gen-class', + 'gen-interface', + 'gensym', + 'get', + 'get-in', + 'get-method', + 'get-proxy-class', + 'get-thread-bindings', + 'get-validator', + 'group-by', + 'halt-when', + 'hash', + 'hash-combine', + 'hash-map', + 'hash-ordered-coll', + 'hash-set', + 'hash-unordered-coll', + 'ident?', + 'identical?', + 'identity', + 'if-let', + 'if-not', + 'if-some', + 'ifn?', + 'import', + 'in-ns', + 'inc', + 'inc\'', + 'indexed?', + 'init-proxy', + 'inst-ms', + 'inst-ms*', + 'inst?', + 'instance?', + 'int', + 'int-array', + 'int?', + 'integer?', + 'interleave', + 'intern', + 'interpose', + 'into', + 'into-array', + 'ints', + 'io!', + 'isa?', + 'iterate', + 'iterator-seq', + 'juxt', + 'keep', + 'keep-indexed', + 'key', + 'keys', + 'keyword', + 'keyword?', + 'last', + 'lazy-cat', + 'lazy-seq', + 'let', + 'letfn', + 'line-seq', + 'list', + 'list*', + 'list?', + 'load', + 'load-file', + 'load-reader', + 'load-string', + 'loaded-libs', + 'locking', + 'long', + 'long-array', + 'longs', + 'loop', + 'macroexpand', + 'macroexpand-1', + 'make-array', + 'make-hierarchy', + 'map', + 'map-entry?', + 'map-indexed', + 'map?', + 'mapcat', + 'mapv', + 'max', + 'max-key', + 'memfn', + 'memoize', + 'merge', + 'merge-with', + 'meta', + 'method-sig', + 'methods', + 'min', + 'min-key', + 'mix-collection-hash', + 'mod', + 'munge', + 'name', + 'namespace', + 'namespace-munge', + 'nat-int?', + 'neg-int?', + 'neg?', + 'newline', + 'next', + 'nfirst', + 'nil?', + 'nnext', + 'not', + 'not-any?', + 'not-empty', + 'not-every?', + 'not=', + 'ns', + 'ns-aliases', + 'ns-imports', + 'ns-interns', + 'ns-map', + 'ns-name', + 'ns-publics', + 'ns-refers', + 'ns-resolve', + 'ns-unalias', + 'ns-unmap', + 'nth', + 'nthnext', + 'nthrest', + 'num', + 'number?', + 'numerator', + 'object-array', + 'odd?', + 'or', + 'parents', + 'partial', + 'partition', + 'partition-all', + 'partition-by', + 'pcalls', + 'peek', + 'persistent!', + 'pmap', + 'pop', + 'pop!', + 'pop-thread-bindings', + 'pos-int?', + 'pos?', + 'pr', + 'pr-str', + 'prefer-method', + 'prefers', + 'primitives-classnames', + 'print', + 'print-ctor', + 'print-dup', + 'print-method', + 'print-simple', + 'print-str', + 'printf', + 'println', + 'println-str', + 'prn', + 'prn-str', + 'promise', + 'proxy', + 'proxy-call-with-super', + 'proxy-mappings', + 'proxy-name', + 'proxy-super', + 'push-thread-bindings', + 'pvalues', + 'qualified-ident?', + 'qualified-keyword?', + 'qualified-symbol?', + 'quot', + 'rand', + 'rand-int', + 'rand-nth', + 'random-sample', + 'range', + 'ratio?', + 'rational?', + 'rationalize', + 're-find', + 're-groups', + 're-matcher', + 're-matches', + 're-pattern', + 're-seq', + 'read', + 'read-line', + 'read-string', + 'reader-conditional', + 'reader-conditional?', + 'realized?', + 'record?', + 'reduce', + 'reduce-kv', + 'reduced', + 'reduced?', + 'reductions', + 'ref', + 'ref-history-count', + 'ref-max-history', + 'ref-min-history', + 'ref-set', + 'refer', + 'refer-clojure', + 'reify', + 'release-pending-sends', + 'rem', + 'remove', + 'remove-all-methods', + 'remove-method', + 'remove-ns', + 'remove-watch', + 'repeat', + 'repeatedly', + 'replace', + 'replicate', + 'require', + 'reset!', + 'reset-meta!', + 'reset-vals!', + 'resolve', + 'rest', + 'restart-agent', + 'resultset-seq', + 'reverse', + 'reversible?', + 'rseq', + 'rsubseq', + 'run!', + 'satisfies?', + 'second', + 'select-keys', + 'send', + 'send-off', + 'send-via', + 'seq', + 'seq?', + 'seqable?', + 'seque', + 'sequence', + 'sequential?', + 'set', + 'set-agent-send-executor!', + 'set-agent-send-off-executor!', + 'set-error-handler!', + 'set-error-mode!', + 'set-validator!', + 'set?', + 'short', + 'short-array', + 'shorts', + 'shuffle', + 'shutdown-agents', + 'simple-ident?', + 'simple-keyword?', + 'simple-symbol?', + 'slurp', + 'some', + 'some->', + 'some->>', + 'some-fn', + 'some?', + 'sort', + 'sort-by', + 'sorted-map', + 'sorted-map-by', + 'sorted-set', + 'sorted-set-by', + 'sorted?', + 'special-symbol?', + 'spit', + 'split-at', + 'split-with', + 'str', + 'string?', + 'struct', + 'struct-map', + 'subs', + 'subseq', + 'subvec', + 'supers', + 'swap!', + 'swap-vals!', + 'symbol', + 'symbol?', + 'sync', + 'tagged-literal', + 'tagged-literal?', + 'take', + 'take-last', + 'take-nth', + 'take-while', + 'test', + 'the-ns', + 'thread-bound?', + 'time', + 'to-array', + 'to-array-2d', + 'trampoline', + 'transduce', + 'transient', + 'tree-seq', + 'true?', + 'type', + 'unchecked-add', + 'unchecked-add-int', + 'unchecked-byte', + 'unchecked-char', + 'unchecked-dec', + 'unchecked-dec-int', + 'unchecked-divide-int', + 'unchecked-double', + 'unchecked-float', + 'unchecked-inc', + 'unchecked-inc-int', + 'unchecked-int', + 'unchecked-long', + 'unchecked-multiply', + 'unchecked-multiply-int', + 'unchecked-negate', + 'unchecked-negate-int', + 'unchecked-remainder-int', + 'unchecked-short', + 'unchecked-subtract', + 'unchecked-subtract-int', + 'underive', + 'unquote', + 'unquote-splicing', + 'unreduced', + 'unsigned-bit-shift-right', + 'update', + 'update-in', + 'update-proxy', + 'uri?', + 'use', + 'uuid?', + 'val', + 'vals', + 'var-get', + 'var-set', + 'var?', + 'vary-meta', + 'vec', + 'vector', + 'vector-of', + 'vector?', + 'volatile!', + 'volatile?', + 'vreset!', + 'vswap!', + 'when', + 'when-first', + 'when-let', + 'when-not', + 'when-some', + 'while', + 'with-bindings', + 'with-bindings*', + 'with-in-str', + 'with-loading-context', + 'with-local-vars', + 'with-meta', + 'with-open', + 'with-out-str', + 'with-precision', + 'with-redefs', + 'with-redefs-fn', + 'xml-seq', + 'zero?', + 'zipmap', + ], + + tokenizer: { + root: [ + // whitespaces and comments + {include: '@whitespace'}, + + // numbers + [/@numbers/, 'number'], + + // characters + [/@characters/, 'string'], + + // strings + {include: '@string'}, + + // brackets + [/[()\[\]{}]/, '@brackets'], + + // regular expressions + [/\/#"(?:\.|(?:")|[^"\n])*"\/g/, 'regexp'], + + // reader macro characters + [/[#'@^`~]/, 'meta'], + + // symbols + [/@qualifiedSymbols/, { + cases: { + '^:.+$': 'constant', // Clojure keywords (e.g., `:foo/bar`) + '@specialForms': 'keyword', + '@coreSymbols': 'keyword', + '@constants': 'constant', + '@default': 'identifier', + }, + }, + ], + ], + + whitespace: [ + [/\s+/, 'white'], + [/;.*$/, 'comment'], + [/\(comment\b/, 'comment', '@comment'], + ], + + comment: [ + [/\(/, 'comment', '@push'], + [/\)/, 'comment', '@pop'], + [/[^()]/, 'comment'], + ], + + string: [ + [/"/, 'string', '@multiLineString'], + ], + + multiLineString: [ + [/"/, 'string', '@popall'], + [/@escapes/, 'string.escape'], + [/./, 'string'] + ], + }, +}; diff --git a/src/coffee/coffee.contribution.ts b/src/coffee/coffee.contribution.ts index 2e180f64..67f67311 100644 --- a/src/coffee/coffee.contribution.ts +++ b/src/coffee/coffee.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'coffeescript', extensions: ['.coffee'], aliases: ['CoffeeScript', 'coffeescript', 'coffee'], mimetypes: ['text/x-coffeescript', 'text/coffeescript'], - loader: () => _monaco.Promise.wrap(import('./coffee')) + loader: () => import('./coffee') }); diff --git a/src/cpp/cpp.contribution.ts b/src/cpp/cpp.contribution.ts index e69b052b..60700bff 100644 --- a/src/cpp/cpp.contribution.ts +++ b/src/cpp/cpp.contribution.ts @@ -6,18 +6,15 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'c', extensions: ['.c', '.h'], aliases: ['C', 'c'], - loader: () => _monaco.Promise.wrap(import('./cpp')) + loader: () => import('./cpp') }); registerLanguage({ id: 'cpp', extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'], aliases: ['C++', 'Cpp', 'cpp'], - loader: () => _monaco.Promise.wrap(import('./cpp')) + loader: () => import('./cpp') }); diff --git a/src/cpp/cpp.test.ts b/src/cpp/cpp.test.ts index 27e8d9da..a06892f0 100644 --- a/src/cpp/cpp.test.ts +++ b/src/cpp/cpp.test.ts @@ -391,17 +391,19 @@ testTokenization('cpp', [ [{ line: '#include', tokens: [ - { startIndex: 0, type: 'keyword.cpp' }, - { startIndex: 8, type: 'delimiter.angle.cpp' }, - { startIndex: 9, type: 'identifier.cpp' }, - { startIndex: 17, type: 'delimiter.angle.cpp' } + { startIndex: 0, type: 'keyword.directive.include.cpp' }, + { startIndex: 8, type: 'keyword.directive.include.begin.cpp' }, + { startIndex: 9, type: 'string.include.identifier.cpp' }, + { startIndex: 17, type: 'keyword.directive.include.end.cpp' } ] }, { line: '#include "/path/to/my/file.h"', tokens: [ - { startIndex: 0, type: 'keyword.cpp' }, + { startIndex: 0, type: 'keyword.directive.include.cpp' }, { startIndex: 8, type: '' }, - { startIndex: 9, type: 'string.cpp' } + { startIndex: 9, type: 'keyword.directive.include.begin.cpp' }, + { startIndex: 10, type: 'string.include.identifier.cpp' }, + { startIndex: 28, type: 'keyword.directive.include.end.cpp' } ] }, { line: '', diff --git a/src/cpp/cpp.ts b/src/cpp/cpp.ts index 7e631cbc..7683f63e 100644 --- a/src/cpp/cpp.ts +++ b/src/cpp/cpp.ts @@ -268,6 +268,8 @@ export const language = { // [[ attributes ]]. [/\[\[.*\]\]/, 'annotation'], + [/^\s*#include/, { token: 'keyword.directive.include', next: '@include' }], + // Preprocessor directive [/^\s*#\s*\w+/, 'keyword'], @@ -338,6 +340,11 @@ export const language = { } ], [/.*/, 'string.raw'] + ], + + include: [ + [/(\s*)(<)([^<>]*)(>)/, ['', 'keyword.directive.include.begin', 'string.include.identifier', { token: 'keyword.directive.include.end', next: '@pop'}]], + [/(\s*)(")([^"]*)(")/, ['', 'keyword.directive.include.begin', 'string.include.identifier', { token: 'keyword.directive.include.end', next: '@pop'}]] ] }, }; diff --git a/src/csharp/csharp.contribution.ts b/src/csharp/csharp.contribution.ts index 2ac1a2a8..3a34f302 100644 --- a/src/csharp/csharp.contribution.ts +++ b/src/csharp/csharp.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'csharp', - extensions: ['.cs', '.csx'], + extensions: ['.cs', '.csx', '.cake'], aliases: ['C#', 'csharp'], - loader: () => _monaco.Promise.wrap(import('./csharp')) + loader: () => import('./csharp') }); diff --git a/src/csp/csp.contribution.ts b/src/csp/csp.contribution.ts index 3deef58d..bd522448 100644 --- a/src/csp/csp.contribution.ts +++ b/src/csp/csp.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'csp', extensions: [], aliases: ['CSP', 'csp'], - loader: () => _monaco.Promise.wrap(import('./csp')) + loader: () => import('./csp') }); diff --git a/src/css/css.contribution.ts b/src/css/css.contribution.ts index bb39d00f..f434e2dc 100644 --- a/src/css/css.contribution.ts +++ b/src/css/css.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'css', extensions: ['.css'], aliases: ['CSS', 'css'], mimetypes: ['text/css'], - loader: () => _monaco.Promise.wrap(import('./css')) + loader: () => import('./css') }); diff --git a/src/dockerfile/dockerfile.contribution.ts b/src/dockerfile/dockerfile.contribution.ts index d4200e08..30cb3ba7 100644 --- a/src/dockerfile/dockerfile.contribution.ts +++ b/src/dockerfile/dockerfile.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'dockerfile', extensions: ['.dockerfile'], filenames: ['Dockerfile'], aliases: ['Dockerfile'], - loader: () => _monaco.Promise.wrap(import('./dockerfile')) + loader: () => import('./dockerfile') }); diff --git a/src/dockerfile/dockerfile.ts b/src/dockerfile/dockerfile.ts index ca020d88..78acd724 100644 --- a/src/dockerfile/dockerfile.ts +++ b/src/dockerfile/dockerfile.ts @@ -34,12 +34,6 @@ export const language = { defaultToken: '', tokenPostfix: '.dockerfile', - instructions: /FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT/, - - instructionAfter: /ONBUILD/, - - variableAfter: /ENV/, - variable: /\${?[\w]+}?/, tokenizer: { @@ -47,13 +41,9 @@ export const language = { { include: '@whitespace' }, { include: '@comment' }, - [/(@instructionAfter)(\s+)/, ['keyword', { token: '', next: '@instructions' }]], - ['', 'keyword', '@instructions'] - ], - - instructions: [ - [/(@variableAfter)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], - [/(@instructions)/, 'keyword', '@arguments'] + [/(ONBUILD)(\s+)/, ['keyword', '']], + [/(ENV)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], + [/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/, { token: 'keyword', next: '@arguments' }] ], arguments: [ diff --git a/src/fsharp/fsharp.contribution.ts b/src/fsharp/fsharp.contribution.ts index bd9a0c05..0cae93f7 100644 --- a/src/fsharp/fsharp.contribution.ts +++ b/src/fsharp/fsharp.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'fsharp', extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'], aliases: ['F#', 'FSharp', 'fsharp'], - loader: () => _monaco.Promise.wrap(import('./fsharp')) + loader: () => import('./fsharp') }); diff --git a/src/fsharp/fsharp.test.ts b/src/fsharp/fsharp.test.ts index 2fe82857..c542c833 100644 --- a/src/fsharp/fsharp.test.ts +++ b/src/fsharp/fsharp.test.ts @@ -442,5 +442,20 @@ testTokenization('fsharp', [ tokens: [ { startIndex: 0, type: 'number.float.fs' } ] + }], + + [{ + line: '(* This operator -> (*) should be ignored *) let i = 0', + tokens: [ + { startIndex: 0, type: 'comment.fs' }, + { startIndex: 44, type: '' }, + { startIndex: 45, type: 'keyword.let.fs' }, + { startIndex: 48, type: '' }, + { startIndex: 49, type: 'identifier.fs' }, + { startIndex: 50, type: '' }, + { startIndex: 51, type: 'delimiter.fs' }, + { startIndex: 52, type: '' }, + { startIndex: 53, type: 'number.fs' } + ] }] ]); diff --git a/src/fsharp/fsharp.ts b/src/fsharp/fsharp.ts index 42fce872..7e08d720 100644 --- a/src/fsharp/fsharp.ts +++ b/src/fsharp/fsharp.ts @@ -132,9 +132,11 @@ export const language = { ], comment: [ - [/[^\*]+/, 'comment'], + [/[^*(]+/, 'comment'], [/\*\)/, 'comment', '@pop'], - [/\*/, 'comment'] + [/\*/, 'comment'], + [/\(\*\)/, 'comment'], + [/\(/, 'comment'] ], string: [ diff --git a/src/go/go.contribution.ts b/src/go/go.contribution.ts index 2e0bd2cd..76771e01 100644 --- a/src/go/go.contribution.ts +++ b/src/go/go.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'go', extensions: ['.go'], aliases: ['Go'], - loader: () => _monaco.Promise.wrap(import('./go')) + loader: () => import('./go') }); diff --git a/src/graphql/graphql.contribution.ts b/src/graphql/graphql.contribution.ts new file mode 100644 index 00000000..1379e5ce --- /dev/null +++ b/src/graphql/graphql.contribution.ts @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'graphql', + extensions: ['.graphql', '.gql'], + aliases: ['GraphQL', 'graphql', 'gql'], + mimetypes: ['application/graphql'], + loader: () => import('./graphql') +}); diff --git a/src/graphql/graphql.test.ts b/src/graphql/graphql.test.ts new file mode 100644 index 00000000..20f112b4 --- /dev/null +++ b/src/graphql/graphql.test.ts @@ -0,0 +1,143 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { testTokenization } from '../test/testRunner'; + +testTokenization('graphql', [ + // Keywords + [{ + line: 'scalar Date', + tokens: [ + { startIndex: 0, type: 'keyword.gql' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'type.identifier.gql' }, + ] + }], + + // Root schema definition + [{ + line: 'schema { query: Query, mutation: Mutation subscription: Subscription }', + tokens: [ + { startIndex: 0, type: "keyword.gql" }, + { startIndex: 6, type: "" }, + { startIndex: 7, type: "delimiter.curly.gql" }, + { startIndex: 8, type: "" }, + { startIndex: 9, type: "keyword.gql" }, // this should be identifier + { startIndex: 14, type: "operator.gql" }, + { startIndex: 15, type: "" }, + { startIndex: 16, type: "type.identifier.gql" }, + { startIndex: 21, type: "delimiter.gql" }, + { startIndex: 22, type: "" }, + { startIndex: 23, type: "keyword.gql" }, // this should be identifier + { startIndex: 31, type: "operator.gql" }, + { startIndex: 32, type: "" }, + { startIndex: 33, type: "type.identifier.gql" }, + { startIndex: 41, type: "" }, + { startIndex: 42, type: "keyword.gql" }, // this should be identifier + { startIndex: 54, type: "operator.gql" }, + { startIndex: 55, type: "" }, + { startIndex: 56, type: "type.identifier.gql" }, + { startIndex: 68, type: "" }, + { startIndex: 69, type: "delimiter.curly.gql" }, + ] + }], + + [{ + line: `query testQuery($intValue:Int=3){value(arg:{string:"string" int:$intValue}){field1 field2}}`, + tokens: [ + { startIndex: 0, type: "keyword.gql" }, // 'query' + { startIndex: 5, type: "" }, // ' ' + { startIndex: 6, type: "identifier.gql" }, // 'testQuery' + { startIndex: 15, type: "delimiter.parenthesis.gql" }, // '(' + { startIndex: 16, type: "identifier.gql" }, // '$intValue' + { startIndex: 25, type: "operator.gql" }, // ':' + { startIndex: 26, type: "keyword.gql" }, // 'Int' + { startIndex: 29, type: "operator.gql" }, // '=' + { startIndex: 30, type: "number.gql" }, // '3' + { startIndex: 31, type: "delimiter.parenthesis.gql" }, // ')' + { startIndex: 32, type: "delimiter.curly.gql" }, // '{' + { startIndex: 33, type: "identifier.gql" }, // 'value' + { startIndex: 38, type: "delimiter.parenthesis.gql" }, // '(' + { startIndex: 39, type: "identifier.gql" }, // 'arg' + { startIndex: 42, type: "operator.gql" }, // ':' + { startIndex: 43, type: "delimiter.curly.gql" }, // '{' + { startIndex: 44, type: "identifier.gql" }, // 'string' + { startIndex: 50, type: "operator.gql" }, // ':' + { startIndex: 51, type: "string.quote.gql" }, // '"' + { startIndex: 52, type: "string.gql" }, // 'string' + { startIndex: 58, type: "string.quote.gql" }, // '"' + { startIndex: 59, type: "" }, // ' ' + { startIndex: 60, type: "identifier.gql" }, // 'int' + { startIndex: 63, type: "operator.gql" }, // ':' + { startIndex: 64, type: "identifier.gql" }, // '$intValue' + { startIndex: 73, type: "delimiter.curly.gql" }, // '}' + { startIndex: 74, type: "delimiter.parenthesis.gql" }, // ')' + { startIndex: 75, type: "delimiter.curly.gql" }, // '{' + { startIndex: 76, type: "identifier.gql" }, // 'field1' + { startIndex: 82, type: "" }, // ' ' + { startIndex: 83, type: "identifier.gql" }, // 'field2' + { startIndex: 89, type: "delimiter.curly.gql" }, // '}}' + ], + }], + + // More complex test: + // """ + // Node interface + // - allows (re)fetch arbitrary entity only by ID + // """ + // interface Node { + // id: ID! + // } + [ + { + line: '"""', + tokens: [ + { startIndex: 0, type: "string.gql" } + ], + }, + { + line: 'This is MarkDown', + tokens: [ + { startIndex: 0, type: "" } + ], + }, + { + line: '"""', + tokens: [ + { startIndex: 0, type: "string.gql" } + ], + }, + { + line: 'interface Node {', + tokens: [ + { startIndex: 0, type: "keyword.gql" }, + { startIndex: 9, type: "" }, + { startIndex: 10, type: "type.identifier.gql" }, + { startIndex: 14, type: "" }, + { startIndex: 15, type: "delimiter.curly.gql" }, + ], + }, + { + line: ' id: ID!', + tokens: [ + { startIndex: 0, type: "" }, + { startIndex: 2, type: "identifier.gql" }, + { startIndex: 4, type: "operator.gql" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "keyword.gql" }, + { startIndex: 8, type: "operator.gql" }, + ], + }, + { + line: '}', + tokens: [ + { startIndex: 0, type: "delimiter.curly.gql", }, + ], + }, + ] + +]); diff --git a/src/graphql/graphql.ts b/src/graphql/graphql.ts new file mode 100644 index 00000000..5d4cbd07 --- /dev/null +++ b/src/graphql/graphql.ts @@ -0,0 +1,141 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; +import ILanguage = monaco.languages.IMonarchLanguage; + +export const conf: IRichLanguageConfiguration = { + comments: { + lineComment: '#' + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"""', close: '"""', notIn: ['string', 'comment'] }, + { open: '"', close: '"', notIn: ['string', 'comment'] }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"""', close: '"""' }, + { open: '"', close: '"' }, + ], + folding: { + offSide: true + } +}; + +export const language = { + // Set defaultToken to invalid to see what you do not tokenize yet + defaultToken: 'invalid', + tokenPostfix: '.gql', + + keywords: [ + 'null', 'true', 'false', + 'query', 'mutation', 'subscription', + 'extend', 'schema', 'directive', + 'scalar', 'type', 'interface', 'union', 'enum', 'input', 'implements', + 'fragment', 'on', + ], + + typeKeywords: ['Int', 'Float', 'String', 'Boolean', 'ID'], + + directiveLocations: [ + 'SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', + 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION', + 'QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', + 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT', 'VARIABLE_DEFINITION', + ], + + operators: ['=', '!', '?', ':', '&', '|'], + + // we include these common regular expressions + symbols: /[=!?:&|]+/, + + // https://facebook.github.io/graphql/draft/#sec-String-Value + escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/, + + // The main tokenizer for our languages + tokenizer: { + root: [ + // identifiers and keywords + [ + /[a-z_$][\w$]*/, + { + cases: { + '@keywords': 'keyword', + '@default': 'identifier', + }, + }, + ], + [ + /[A-Z][\w\$]*/, + { + cases: { + '@typeKeywords': 'keyword', + '@default': 'type.identifier', + }, + }, + ], // to show class names nicely + + // whitespace + { include: '@whitespace' }, + + // delimiters and operators + [/[{}()\[\]]/, '@brackets'], + [ + /@symbols/, + { cases: { '@operators': 'operator', '@default': '' } }, + ], + + // @ annotations. + // As an example, we emit a debugging log message on these tokens. + // Note: message are supressed during the first load -- change some lines to see them. + [ + /@\s*[a-zA-Z_\$][\w\$]*/, + { token: 'annotation', log: 'annotation token: $0' }, + ], + + // numbers + [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], + [/0[xX][0-9a-fA-F]+/, 'number.hex'], + [/\d+/, 'number'], + + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + + [/"""/, + { token: 'string', next: '@mlstring', nextEmbedded: 'markdown' } + ], + + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, { token: 'string.quote', bracket: '@open', next: '@string' }], + ], + + mlstring: [ + [/[^"]+/, 'string'], + ['"""', { token: 'string', next: '@pop', nextEmbedded: '@pop' }] + ], + + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }], + ], + + whitespace: [[/[ \t\r\n]+/, ''], [/#.*$/, 'comment']], + }, +}; diff --git a/src/handlebars/handlebars.contribution.ts b/src/handlebars/handlebars.contribution.ts index a0252eed..de7bd310 100644 --- a/src/handlebars/handlebars.contribution.ts +++ b/src/handlebars/handlebars.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'handlebars', extensions: ['.handlebars', '.hbs'], aliases: ['Handlebars', 'handlebars'], mimetypes: ['text/x-handlebars-template'], - loader: () => _monaco.Promise.wrap(import('./handlebars')) + loader: () => import('./handlebars') }); diff --git a/src/html/html.contribution.ts b/src/html/html.contribution.ts index a9eabe15..ec632e8e 100644 --- a/src/html/html.contribution.ts +++ b/src/html/html.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'html', extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'], aliases: ['HTML', 'htm', 'html', 'xhtml'], mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'], - loader: () => _monaco.Promise.wrap(import('./html')) + loader: () => import('./html') }); diff --git a/src/html/html.test.ts b/src/html/html.test.ts index 07c7fe56..65c03567 100644 --- a/src/html/html.test.ts +++ b/src/html/html.test.ts @@ -7,7 +7,7 @@ import { testTokenization } from '../test/testRunner'; -testTokenization(['html', 'css'], [ +testTokenization(['html', 'css', 'javascript'], [ // Open Start Tag #1' [{ @@ -147,7 +147,13 @@ testTokenization(['html', 'css'], [ { startIndex: 12, type: 'delimiter.html' }, { startIndex: 13, type: 'attribute.value.html' }, { startIndex: 30, type: 'delimiter.html' }, - { startIndex: 31, type: '' }, + { startIndex: 31, type: 'keyword.js' }, + { startIndex: 34, type: '' }, + { startIndex: 35, type: 'identifier.js' }, + { startIndex: 36, type: 'delimiter.js' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'number.js' }, + { startIndex: 40, type: 'delimiter.js' }, { startIndex: 41, type: 'delimiter.html' }, { startIndex: 43, type: 'tag.html' }, { startIndex: 49, type: 'delimiter.html' } @@ -169,7 +175,13 @@ testTokenization(['html', 'css'], [ }, { line: 'var i= 10;', tokens: [ - { startIndex: 0, type: '' }, + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: 'delimiter.js' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'number.js' }, + { startIndex: 9, type: 'delimiter.js' }, ] }, { line: '', @@ -191,7 +203,14 @@ testTokenization(['html', 'css'], [ { startIndex: 12, type: 'delimiter.html' }, { startIndex: 13, type: 'attribute.value.html' }, { startIndex: 30, type: 'delimiter.html' }, - { startIndex: 31, type: '' }, + { startIndex: 31, type: 'keyword.js' }, + { startIndex: 34, type: '' }, + { startIndex: 35, type: 'identifier.js' }, + { startIndex: 36, type: 'delimiter.js' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'number.js' }, + { startIndex: 40, type: 'delimiter.js' }, + ] }, { line: '', @@ -217,7 +236,13 @@ testTokenization(['html', 'css'], [ }, { line: 'var i= 10;', tokens: [ - { startIndex: 0, type: '' }, + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: 'delimiter.js' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'number.js' }, + { startIndex: 9, type: 'delimiter.js' }, { startIndex: 10, type: 'delimiter.html' }, { startIndex: 12, type: 'tag.html' }, { startIndex: 18, type: 'delimiter.html' } @@ -254,14 +279,14 @@ testTokenization(['html', 'css'], [ { startIndex: 0, type: 'delimiter.html' }, { startIndex: 1, type: 'tag.html' }, { startIndex: 7, type: 'delimiter.html' }, - { startIndex: 8, type: '' }, + { startIndex: 8, type: 'identifier.js' }, { startIndex: 9, type: 'delimiter.html' }, { startIndex: 11, type: 'tag.html' }, { startIndex: 17, type: 'delimiter.html' }, // { startIndex:18, type: 'delimiter.html' }, { startIndex: 19, type: 'tag.html' }, { startIndex: 25, type: 'delimiter.html' }, - { startIndex: 26, type: '' }, + { startIndex: 26, type: 'identifier.js' }, { startIndex: 27, type: 'delimiter.html' }, { startIndex: 29, type: 'tag.html' }, { startIndex: 35, type: 'delimiter.html' } @@ -292,7 +317,13 @@ testTokenization(['html', 'css'], [ { startIndex: 0, type: 'delimiter.html' }, { startIndex: 1, type: 'tag.html' }, { startIndex: 7, type: 'delimiter.html' }, - { startIndex: 8, type: '' }, + { startIndex: 8, type: 'keyword.js' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'identifier.js' }, + { startIndex: 13, type: 'delimiter.js' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'number.js' }, + { startIndex: 17, type: 'delimiter.js' }, { startIndex: 18, type: 'delimiter.html' }, { startIndex: 20, type: 'tag.html' }, { startIndex: 26, type: 'delimiter.html' } diff --git a/src/ini/ini.contribution.ts b/src/ini/ini.contribution.ts index a8344d48..7176bdcb 100644 --- a/src/ini/ini.contribution.ts +++ b/src/ini/ini.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'ini', extensions: ['.ini', '.properties', '.gitconfig'], filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'], aliases: ['Ini', 'ini'], - loader: () => _monaco.Promise.wrap(import('./ini')) + loader: () => import('./ini') }); diff --git a/src/java/java.contribution.ts b/src/java/java.contribution.ts index 866a69be..1680542d 100644 --- a/src/java/java.contribution.ts +++ b/src/java/java.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'java', extensions: ['.java', '.jav'], aliases: ['Java', 'java'], mimetypes: ['text/x-java-source', 'text/x-java'], - loader: () => _monaco.Promise.wrap(import('./java')) + loader: () => import('./java') }); diff --git a/src/javascript/javascript.contribution.ts b/src/javascript/javascript.contribution.ts new file mode 100644 index 00000000..8f3cc5cb --- /dev/null +++ b/src/javascript/javascript.contribution.ts @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'javascript', + extensions: ['.js', '.es6', '.jsx'], + firstLine: '^#!.*\\bnode', + filenames: ['jakefile'], + aliases: ['JavaScript', 'javascript', 'js'], + mimetypes: ['text/javascript'], + loader: () => import('./javascript') +}); diff --git a/src/javascript/javascript.test.ts b/src/javascript/javascript.test.ts new file mode 100644 index 00000000..fd5236c4 --- /dev/null +++ b/src/javascript/javascript.test.ts @@ -0,0 +1,662 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { testTokenization } from '../test/testRunner'; + +testTokenization('javascript', [ + // Keywords + [{ + line: 'var x = function() { };', + tokens: [ + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'keyword.js' }, + { startIndex: 16, type: 'delimiter.parenthesis.js' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'delimiter.bracket.js' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'delimiter.bracket.js' }, + { startIndex: 22, type: 'delimiter.js' } + ] + }], + + [{ + line: ' var ', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'keyword.js' }, + { startIndex: 7, type: '' } + ] + }], + + // Comments - single line + [{ + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: ' // a comment', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'comment.js' } + ] + }], + + [{ + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: '// a comment /*', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: '// a comment /**', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: '//sticky comment', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: 'var x = 1; // my comment // is a nice one', + tokens: [ + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'number.js' }, + { startIndex: 9, type: 'delimiter.js' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'comment.js' } + ] + }], + + // Comments - range comment, single line + [{ + line: '/* a simple comment */', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: 'var x = /* a simple comment */ 1;', + tokens: [ + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.js' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'number.js' }, + { startIndex: 32, type: 'delimiter.js' } + ] + }], + + [{ + line: 'x = /**/;', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.js' }, + { startIndex: 8, type: 'delimiter.js' } + ] + }], + + [{ + line: 'x = /*/;', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.js' } + ] + }], + + // Comments - range comment, multi lines + [{ + line: '/* a multiline comment', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }, { + line: 'can actually span', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }, { + line: 'multiple lines */', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: 'var x = /* start a comment', + tokens: [ + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.js' } + ] + }, { + line: ' a ', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }, { + line: 'and end it */ var a = 2;', + tokens: [ + { startIndex: 0, type: 'comment.js' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'keyword.js' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'identifier.js' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'delimiter.js' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'number.js' }, + { startIndex: 23, type: 'delimiter.js' } + ] + }], + + // Strings + [{ + line: 'var a = \'a\';', + tokens: [ + { startIndex: 0, type: 'keyword.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'string.js' }, + { startIndex: 11, type: 'delimiter.js' } + ] + }], + + [{ + line: '"use strict";', + tokens: [ + { startIndex: 0, type: 'string.js' }, + { startIndex: 12, type: 'delimiter.js' } + ] + }], + + [{ + line: 'b = a + " \'cool\' "', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'string.js' } + ] + }], + + [{ + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: 'string.js' }, + { startIndex: 10, type: 'string.escape.js' }, + { startIndex: 12, type: 'string.js' }, + { startIndex: 18, type: 'string.escape.js' }, + { startIndex: 20, type: 'string.js' }, + ] + }], + + [{ + line: '\'\'\'', + tokens: [ + { startIndex: 0, type: 'string.js' }, + { startIndex: 2, type: 'string.invalid.js' }, + ] + }], + + [{ + line: '\'\\\'\'', + tokens: [ + { startIndex: 0, type: 'string.js' }, + { startIndex: 1, type: 'string.escape.js' }, + { startIndex: 3, type: 'string.js' }, + ] + }], + + [{ + line: '\'be careful \\not to escape\'', + tokens: [ + { startIndex: 0, type: 'string.js' }, + { startIndex: 12, type: 'string.escape.js' }, + { startIndex: 14, type: 'string.js' }, + ] + }], + + // Numbers + [{ + line: '0', + tokens: [ + { startIndex: 0, type: 'number.js' } + ] + }], + + [{ + line: ' 0', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 1, type: 'number.js' } + ] + }], + + [{ + line: ' 0 ', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 1, type: 'number.js' }, + { startIndex: 2, type: '' } + ] + }], + + [{ + line: '0 ', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: '' } + ] + }], + + [{ + line: '0+0', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: 'delimiter.js' }, + { startIndex: 2, type: 'number.js' } + ] + }], + + [{ + line: '100+10', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 3, type: 'delimiter.js' }, + { startIndex: 4, type: 'number.js' } + ] + }], + + [{ + line: '0 + 0', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.js' } + ] + }], + + [{ + line: '0123', + tokens: [ + { startIndex: 0, type: 'number.octal.js' } + ] + }], + + [{ + line: '01239', + tokens: [ + { startIndex: 0, type: 'number.octal.js' }, + { startIndex: 4, type: 'number.js' } + ] + }], + + [{ + line: '0o123', + tokens: [ + { startIndex: 0, type: 'number.octal.js' } + ] + }], + + [{ + line: '0O123', + tokens: [ + { startIndex: 0, type: 'number.octal.js' } + ] + }], + + [{ + line: '0x', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: 'identifier.js' } + ] + }], + + [{ + line: '0x123', + tokens: [ + { startIndex: 0, type: 'number.hex.js' } + ] + }], + + [{ + line: '0X123', + tokens: [ + { startIndex: 0, type: 'number.hex.js' } + ] + }], + + [{ + line: '0b101', + tokens: [ + { startIndex: 0, type: 'number.binary.js' } + ] + }], + + [{ + line: '0B101', + tokens: [ + { startIndex: 0, type: 'number.binary.js' } + ] + }], + + // Regular Expressions + [{ + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: '/**/', + tokens: [ + { startIndex: 0, type: 'comment.js' } + ] + }], + + [{ + line: '/***/', + tokens: [ + { startIndex: 0, type: 'comment.doc.js' } + ] + }], + + [{ + line: '5 / 3;', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.js' }, + { startIndex: 5, type: 'delimiter.js' } + ] + }], + + // Advanced regular expressions + [{ + line: '1 / 2; /* comment', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.js' }, + { startIndex: 5, type: 'delimiter.js' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'comment.js' } + ] + }], + + [{ + line: '1 / 2 / x / b;', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.js' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'delimiter.js' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'identifier.js' }, + { startIndex: 13, type: 'delimiter.js' } + ] + }], + + [{ + line: 'x = /foo/.test(\'\')', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'regexp.js' }, + { startIndex: 9, type: 'delimiter.js' }, + { startIndex: 10, type: 'identifier.js' }, + { startIndex: 14, type: 'delimiter.parenthesis.js' }, + { startIndex: 15, type: 'string.js' }, + { startIndex: 17, type: 'delimiter.parenthesis.js' } + ] + }], + + [{ + line: '/foo/', + tokens: [ + { startIndex: 0, type: 'regexp.js' } + ] + }], + + [{ + line: '/foo/g', + tokens: [ + { startIndex: 0, type: 'regexp.js' }, + { startIndex: 5, type: 'keyword.other.js' } + ] + }], + + [{ + line: '/foo/gimsuy', + tokens: [ + { startIndex: 0, type: 'regexp.js' }, + { startIndex: 5, type: 'keyword.other.js' } + ] + }], + + [{ + line: '/foo/q', // invalid flag + tokens: [ + { startIndex: 0, type: 'delimiter.js' }, + { startIndex: 1, type: 'identifier.js' }, + { startIndex: 4, type: 'delimiter.js' }, + { startIndex: 5, type: 'identifier.js' } + ] + }], + + [{ + line: 'x = 1 + f(2 / 3, /foo/)', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.js' }, + { startIndex: 9, type: 'delimiter.parenthesis.js' }, + { startIndex: 10, type: 'number.js' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'delimiter.js' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'number.js' }, + { startIndex: 15, type: 'delimiter.js' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'regexp.js' }, + { startIndex: 22, type: 'delimiter.parenthesis.js' } + ] + }], + + [{ + line: 'a /ads/ b;', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: 'identifier.js' }, + { startIndex: 6, type: 'delimiter.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.js' }, + { startIndex: 9, type: 'delimiter.js' } + ] + }], + + [{ + line: '1/(2/3)/2/3;', + tokens: [ + { startIndex: 0, type: 'number.js' }, + { startIndex: 1, type: 'delimiter.js' }, + { startIndex: 2, type: 'delimiter.parenthesis.js' }, + { startIndex: 3, type: 'number.js' }, + { startIndex: 4, type: 'delimiter.js' }, + { startIndex: 5, type: 'number.js' }, + { startIndex: 6, type: 'delimiter.parenthesis.js' }, + { startIndex: 7, type: 'delimiter.js' }, + { startIndex: 8, type: 'number.js' }, + { startIndex: 9, type: 'delimiter.js' }, + { startIndex: 10, type: 'number.js' }, + { startIndex: 11, type: 'delimiter.js' } + ] + }], + + [{ + line: '{ key: 123 }', + tokens: [ + { startIndex: 0, type: 'delimiter.bracket.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'identifier.js' }, + { startIndex: 5, type: 'delimiter.js' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'number.js' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.bracket.js' } + ] + }], + + [{ + line: '[1,2,3]', + tokens: [ + { startIndex: 0, type: 'delimiter.square.js' }, + { startIndex: 1, type: 'number.js' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: 'number.js' }, + { startIndex: 4, type: 'delimiter.js' }, + { startIndex: 5, type: 'number.js' }, + { startIndex: 6, type: 'delimiter.square.js' } + ] + }], + + [{ + line: 'foo(123);', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 3, type: 'delimiter.parenthesis.js' }, + { startIndex: 4, type: 'number.js' }, + { startIndex: 7, type: 'delimiter.parenthesis.js' }, + { startIndex: 8, type: 'delimiter.js' } + ] + }], + + [{ + line: '{a:{b:[]}}', + tokens: [ + { startIndex: 0, type: 'delimiter.bracket.js' }, + { startIndex: 1, type: 'identifier.js' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: 'delimiter.bracket.js' }, + { startIndex: 4, type: 'identifier.js' }, + { startIndex: 5, type: 'delimiter.js' }, + { startIndex: 6, type: 'delimiter.square.js' }, + { startIndex: 8, type: 'delimiter.bracket.js' } + ] + }], + + [{ + line: 'x = "[{()}]"', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.js' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'string.js' } + ] + }], + + + [{ + line: '`${5 + \'x\' + 3}a${4}`', + tokens: [ + { startIndex: 0, type: 'string.js' }, + { startIndex: 1, type: 'delimiter.bracket.js' }, + { startIndex: 3, type: 'number.js' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'delimiter.js' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.js' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.js' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'number.js' }, + { startIndex: 14, type: 'delimiter.bracket.js' }, + { startIndex: 15, type: 'string.js' }, + { startIndex: 16, type: 'delimiter.bracket.js' }, + { startIndex: 18, type: 'number.js' }, + { startIndex: 19, type: 'delimiter.bracket.js' }, + { startIndex: 20, type: 'string.js' }, + + ] + }] + +]); diff --git a/src/javascript/javascript.ts b/src/javascript/javascript.ts new file mode 100644 index 00000000..e635750c --- /dev/null +++ b/src/javascript/javascript.ts @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { conf as tsConf, language as tsLanguage } from '../typescript/typescript'; +import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; +import ILanguage = monaco.languages.IMonarchLanguage; + +// Allow for running under nodejs/requirejs in tests +const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); + +export const conf: IRichLanguageConfiguration = tsConf; + +export const language = { + // Set defaultToken to invalid to see what you do not tokenize yet + defaultToken: 'invalid', + tokenPostfix: '.js', + + keywords: [ + 'break', 'case', 'catch', 'class', 'continue', 'const', + 'constructor', 'debugger', 'default', 'delete', 'do', 'else', + 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', + 'get', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'null', + 'return', 'set', 'super', 'switch', 'symbol', 'this', 'throw', 'true', + 'try', 'typeof', 'undefined', 'var', 'void', 'while', 'with', 'yield', + 'async', 'await', 'of' + ], + typeKeywords: [], + + operators: tsLanguage.operators, + symbols: tsLanguage.symbols, + escapes: tsLanguage.escapes, + digits: tsLanguage.digits, + octaldigits: tsLanguage.octaldigits, + binarydigits: tsLanguage.binarydigits, + hexdigits: tsLanguage.hexdigits, + regexpctl: tsLanguage.regexpctl, + regexpesc: tsLanguage.regexpesc, + tokenizer: tsLanguage.tokenizer, +}; diff --git a/src/kotlin/kotlin.contribution.ts b/src/kotlin/kotlin.contribution.ts new file mode 100644 index 00000000..884c5c95 --- /dev/null +++ b/src/kotlin/kotlin.contribution.ts @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'kotlin', + extensions: ['.kt'], + aliases: ['Kotlin', 'kotlin'], + mimetypes: ['text/x-kotlin-source', 'text/x-kotlin'], + loader: () => import('./kotlin') +}); diff --git a/src/kotlin/kotlin.test.ts b/src/kotlin/kotlin.test.ts new file mode 100644 index 00000000..848fc768 --- /dev/null +++ b/src/kotlin/kotlin.test.ts @@ -0,0 +1,671 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { testTokenization } from '../test/testRunner'; + +testTokenization('kotlin', [ + // inline reified function + [{ + line: 'inline fun foo()', + tokens: [ + { startIndex: 0, type: 'keyword.inline.kt' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'keyword.fun.kt' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.angle.kt' }, + { startIndex: 12, type: 'keyword.reified.kt' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'type.identifier.kt' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'delimiter.kt' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'type.identifier.kt' }, + { startIndex: 27, type: 'delimiter.angle.kt' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'identifier.kt' }, + { startIndex: 32, type: 'delimiter.parenthesis.kt' }, + ] + }], + + // Val declaration and assignment + [{ + line: 'val x: X=5', + tokens: [ + { startIndex: 0, type: 'keyword.val.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.kt' }, + { startIndex: 5, type: 'delimiter.kt' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'type.identifier.kt' }, + { startIndex: 8, type: 'delimiter.kt' }, + { startIndex: 9, type: 'number.kt' }, + ] + }], + + // Comments - single line + [{ + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.kt' } + ] + }], + + [{ + line: ' // a comment', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'comment.kt' } + ] + }], + + // Broken nested tokens due to invalid comment tokenization + [{ + line: '/* //*/ a', + tokens: [ + { startIndex: 0, type: 'comment.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.kt' } + ] + }], + + [{ + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.kt' } + ] + }], + + [{ + line: '//sticky comment', + tokens: [ + { startIndex: 0, type: 'comment.kt' } + ] + }], + + [{ + line: '/almost a comment', + tokens: [ + { startIndex: 0, type: 'delimiter.kt' }, + { startIndex: 1, type: 'identifier.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.kt' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'identifier.kt' } + ] + }], + + [{ + line: '1 / 2; /* comment', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.kt' }, + { startIndex: 5, type: 'delimiter.kt' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'comment.kt' } + ] + }], + + // [{ + // line: 'var x = 1 // my comment // is a nice one', + // tokens: [ + // { startIndex: 0, type: 'keyword.var.kt' }, + // { startIndex: 3, type: '' }, + // { startIndex: 4, type: 'identifier.kt' }, + // { startIndex: 5, type: '' }, + // { startIndex: 6, type: 'delimiter.kt' }, + // { startIndex: 7, type: '' }, + // { startIndex: 8, type: 'number.kt' }, + // { startIndex: 9, type: '' }, + // { startIndex: 10, type: 'comment.kt' }, + // { startIndex: 12, type: '' }, + // { startIndex: 13, type: 'comment.kt' } + // ] + // }], + + // Comments - range comment, single line + [{ + line: '/* a simple comment */', + tokens: [ + { startIndex: 0, type: 'comment.kt' } + ] + }], + + [{ + line: 'var x = /* a simple comment */ 1', + tokens: [ + { startIndex: 0, type: 'keyword.var.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.kt' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.kt' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'number.kt' }, + ] + }], + + [{ + line: 'var x = /* comment */ 1; */', + tokens: [ + { startIndex: 0, type: 'keyword.var.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.kt' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.kt' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'number.kt' }, + { startIndex: 23, type: 'delimiter.kt' }, + { startIndex: 24, type: '' } + ] + }], + + [{ + line: 'x = /**/', + tokens: [ + { startIndex: 0, type: 'identifier.kt' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.kt' }, + ] + }], + + [{ + line: 'var x = /** start a Java Doc comment', + tokens: [ + { startIndex: 0, type: 'keyword.var.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.kt' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.doc.kt' } + ] + }, { + line: ' a ', + tokens: [ + { startIndex: 0, type: 'comment.doc.kt' } + ] + }, { + line: 'and end it */ 2', + tokens: [ + { startIndex: 0, type: 'comment.doc.kt' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'number.kt' }, + ] + }], + + [{ + line: '/** start of Java Doc', + tokens: [ + { startIndex: 0, type: 'comment.doc.kt' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.doc.kt' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.doc.kt' } + ] + }], + + // Keywords + [{ + line: 'package test class Program { fun main(vararg args: String) {} } }', + tokens: [ + { startIndex: 0, type: 'keyword.package.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.kt' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'keyword.class.kt' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'type.identifier.kt' }, + { startIndex: 26, type: '' }, + { startIndex: 27, type: 'delimiter.curly.kt' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'keyword.fun.kt' }, + { startIndex: 32, type: '' }, + { startIndex: 33, type: 'identifier.kt' }, + { startIndex: 37, type: 'delimiter.parenthesis.kt' }, + { startIndex: 38, type: 'keyword.vararg.kt' }, + { startIndex: 44, type: '' }, + { startIndex: 45, type: 'identifier.kt' }, + { startIndex: 49, type: 'delimiter.kt' }, + { startIndex: 50, type: '' }, + { startIndex: 51, type: 'type.identifier.kt' }, + { startIndex: 57, type: 'delimiter.parenthesis.kt' }, + { startIndex: 58, type: '' }, + { startIndex: 59, type: 'delimiter.curly.kt' }, + { startIndex: 61, type: '' }, + { startIndex: 62, type: 'delimiter.curly.kt' }, + { startIndex: 63, type: '' }, + { startIndex: 64, type: 'delimiter.curly.kt' } + ] + }], + + // Numbers + [{ + line: '0', + tokens: [ + { startIndex: 0, type: 'number.kt' } + ] + }], + + [{ + line: '0.10', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '0x', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: 'identifier.kt' } + ] + }], + + [{ + line: '0x123', + tokens: [ + { startIndex: 0, type: 'number.hex.kt' } + ] + }], + + [{ + line: '0x5_2', + tokens: [ + { startIndex: 0, type: 'number.hex.kt' } + ] + }], + + [{ + line: '023L', + tokens: [ + { startIndex: 0, type: 'number.octal.kt' } + ] + }], + + [{ + line: '0123l', + tokens: [ + { startIndex: 0, type: 'number.octal.kt' } + ] + }], + + [{ + line: '05_2', + tokens: [ + { startIndex: 0, type: 'number.octal.kt' } + ] + }], + + [{ + line: '0b1010_0101', + tokens: [ + { startIndex: 0, type: 'number.binary.kt' } + ] + }], + + [{ + line: '0B001', + tokens: [ + { startIndex: 0, type: 'number.binary.kt' } + ] + }], + + [{ + line: '10e3', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '10f', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5e3', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5e-3', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5E3', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5E-3', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5F', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5f', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5D', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23.5d', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '1.72E3D', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '1.72E3d', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '1.72E-3d', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '1.72e3D', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '1.72e3d', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '1.72e-3d', + tokens: [ + { startIndex: 0, type: 'number.float.kt' } + ] + }], + + [{ + line: '23L', + tokens: [ + { startIndex: 0, type: 'number.kt' } + ] + }], + + [{ + line: '23l', + tokens: [ + { startIndex: 0, type: 'number.kt' } + ] + }], + + [{ + line: '0_52', + tokens: [ + { startIndex: 0, type: 'number.kt' } + ] + }], + + [{ + line: '5_2', + tokens: [ + { startIndex: 0, type: 'number.kt' } + ] + }], + + [{ + line: '5_______2', + tokens: [ + { startIndex: 0, type: 'number.kt' } + ] + }], + + [{ + line: '3_.1415F', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: 'identifier.kt' }, + { startIndex: 2, type: 'delimiter.kt' }, + { startIndex: 3, type: 'number.float.kt' } + ] + }], + + [{ + line: '3._1415F', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: 'delimiter.kt' }, + { startIndex: 2, type: 'identifier.kt' } + ] + }], + + [{ + line: '999_99_9999_L', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 11, type: 'identifier.kt' } + ] + }], + + [{ + line: '52_', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 2, type: 'identifier.kt' } + ] + }], + + [{ + line: '0_x52', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: 'identifier.kt' } + ] + }], + + [{ + line: '0x_52', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: 'identifier.kt' } + ] + }], + + [{ + line: '0x52_', + tokens: [ + { startIndex: 0, type: 'number.hex.kt' }, + { startIndex: 4, type: 'identifier.kt' } + ] + }], + + [{ + line: '052_', + tokens: [ + { startIndex: 0, type: 'number.octal.kt' }, + { startIndex: 3, type: 'identifier.kt' } + ] + }], + + [{ + line: '0+0', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: 'delimiter.kt' }, + { startIndex: 2, type: 'number.kt' } + ] + }], + + [{ + line: '100+10', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 3, type: 'delimiter.kt' }, + { startIndex: 4, type: 'number.kt' } + ] + }], + + [{ + line: '0 + 0', + tokens: [ + { startIndex: 0, type: 'number.kt' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.kt' } + ] + }], + + // single line Strings + [{ + line: 'var s = "I\'m a Kotlin String"', + tokens: [ + { startIndex: 0, type: 'keyword.var.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.kt' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'string.kt' }, + ] + }], + + [{ + line: 'var s = "concatenated" + " String"', + tokens: [ + { startIndex: 0, type: 'keyword.var.kt' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.kt' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.kt' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'string.kt' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'delimiter.kt' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'string.kt' }, + ] + }], + + [{ + line: '"quote in a string"', + tokens: [ + { startIndex: 0, type: 'string.kt' } + ] + }], + + [{ + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: 'string.kt' }, + { startIndex: 10, type: 'string.escape.kt' }, + { startIndex: 12, type: 'string.kt' }, + { startIndex: 18, type: 'string.escape.kt' }, + { startIndex: 20, type: 'string.kt' } + ] + }], + + [{ + line: '"\\"', + tokens: [ + { startIndex: 0, type: 'string.invalid.kt' } + ] + }], + + // Annotations + [{ + line: '@', + tokens: [ + { startIndex: 0, type: '' } + ] + }], + + [{ + line: '@Inject', + tokens: [ + { startIndex: 0, type: 'annotation.kt' } + ] + }], + + [{ + line: '@SuppressWarnings("aString")', + tokens: [ + { startIndex: 0, type: 'annotation.kt' }, + { startIndex: 17, type: 'delimiter.parenthesis.kt' }, + { startIndex: 18, type: 'string.kt' }, + { startIndex: 27, type: 'delimiter.parenthesis.kt' } + ] + }], + + [{ + line: '@ AnnotationWithKeywordAfter private', + tokens: [ + { startIndex: 0, type: 'annotation.kt' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'keyword.private.kt' } + ] + }] +]); + diff --git a/src/kotlin/kotlin.ts b/src/kotlin/kotlin.ts new file mode 100644 index 00000000..6e57fc0b --- /dev/null +++ b/src/kotlin/kotlin.ts @@ -0,0 +1,158 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; +import ILanguage = monaco.languages.IMonarchLanguage; + +export const conf: IRichLanguageConfiguration = { + // the default separators except `@$` + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, + comments: { + lineComment: '//', + blockComment: ['/*', '*/'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + { open: '<', close: '>' }, + ], + folding: { + markers: { + start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))") + } + } +}; + +export const language = { + defaultToken: '', + tokenPostfix: '.kt', + + keywords: [ + 'as', 'as?', 'break', 'class', 'continue', 'do', 'else', 'false', 'for', 'fun', 'if', + 'in', '!in', 'interface', 'is', '!is', 'null', 'object', 'package', 'return', 'super', + 'this', 'throw', 'true', 'try', 'typealias', 'val', 'var', 'when', 'while', 'by', + 'catch', 'constructor', 'delegate', 'dynamic', 'field', 'file', 'finally', 'get', + 'import', 'init', 'param', 'property', 'receiver', 'set', 'setparam', 'where', 'actual', + 'abstract','annotation', 'companion', 'const', 'crossinline', 'data', 'enum', 'expect', + 'external', 'final', 'infix', 'inline', 'inner', 'internal', 'lateinit', 'noinline', + 'open', 'operator', 'out', 'override', 'private', 'protected', 'public', 'reified', + 'sealed', 'suspend', 'tailrec', 'vararg', 'field', 'it' + ], + + operators: [ + '+', '-', '*', '/', '%', '=', '+=', '-=', '*=', '/=', + '%=', '++', '--', '&&', '||', '!', '==', '!=', '===', + '!==', '>', '<', '<=', '>=', '[', ']', '!!', '?.', '?:', + '::', '..', ':', '?', '->', '@', ';', '$', '_' + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + + // @ annotations. + [/@\s*[a-zA-Z_\$][\w\$]*/, 'annotation'], + + // numbers + [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], + [/0[xX](@hexdigits)[Ll]?/, 'number.hex'], + [/0(@octaldigits)[Ll]?/, 'number.octal'], + [/0[bB](@binarydigits)[Ll]?/, 'number.binary'], + [/(@digits)[fFdD]/, 'number.float'], + [/(@digits)[lL]?/, 'number'], + + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, 'string', '@string'], + + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@javadoc'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + //Identical copy of comment above, except for the addition of .doc + javadoc: [ + [/[^\/*]+/, 'comment.doc'], + // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-( + [/\/\*/, 'comment.doc.invalid'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], + + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] + ], + }, +}; diff --git a/src/less/less.contribution.ts b/src/less/less.contribution.ts index cc61fbce..ccaf885a 100644 --- a/src/less/less.contribution.ts +++ b/src/less/less.contribution.ts @@ -6,13 +6,10 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'less', extensions: ['.less'], aliases: ['Less', 'less'], mimetypes: ['text/x-less', 'text/less'], - loader: () => _monaco.Promise.wrap(import('./less')) + loader: () => import('./less') }); diff --git a/src/less/less.test.ts b/src/less/less.test.ts index 3b9eff59..c3b3fd5e 100644 --- a/src/less/less.test.ts +++ b/src/less/less.test.ts @@ -7,7 +7,7 @@ import { testTokenization } from '../test/testRunner'; -testTokenization(['less'], [ +testTokenization(['less', 'javascript'], [ // Keywords [{ @@ -641,7 +641,10 @@ testTokenization(['less'], [ { startIndex: 5, type: 'delimiter.less' }, { startIndex: 6, type: '' }, { startIndex: 7, type: 'delimiter.backtick.less' }, - { startIndex: 8, type: '' }, + { startIndex: 8, type: 'keyword.js' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'identifier.js' }, + { startIndex: 24, type: 'delimiter.parenthesis.js' }, { startIndex: 26, type: 'delimiter.backtick.less' }, { startIndex: 27, type: '' }, { startIndex: 28, type: 'comment.less' } diff --git a/src/lua/lua.contribution.ts b/src/lua/lua.contribution.ts index bec757e0..274f7780 100644 --- a/src/lua/lua.contribution.ts +++ b/src/lua/lua.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'lua', extensions: ['.lua'], aliases: ['Lua', 'lua'], - loader: () => _monaco.Promise.wrap(import('./lua')) + loader: () => import('./lua') }); diff --git a/src/markdown/markdown.contribution.ts b/src/markdown/markdown.contribution.ts index 0aa96e6d..16563180 100644 --- a/src/markdown/markdown.contribution.ts +++ b/src/markdown/markdown.contribution.ts @@ -6,12 +6,9 @@ import { registerLanguage } from '../_.contribution'; -// Allow for running under nodejs/requirejs in tests -const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); - registerLanguage({ id: 'markdown', extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'], aliases: ['Markdown', 'markdown'], - loader: () => _monaco.Promise.wrap(import('./markdown')) + loader: () => import('./markdown') }); diff --git a/src/markdown/markdown.ts b/src/markdown/markdown.ts index 9edf2d66..4b0653a8 100644 --- a/src/markdown/markdown.ts +++ b/src/markdown/markdown.ts @@ -8,23 +8,6 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -const TOKEN_HEADER_LEAD = 'keyword'; -const TOKEN_HEADER = 'keyword'; -const TOKEN_EXT_HEADER = 'keyword'; -const TOKEN_SEPARATOR = 'meta.separator'; -const TOKEN_QUOTE = 'comment'; -const TOKEN_LIST = 'keyword'; -const TOKEN_BLOCK = 'string'; -const TOKEN_BLOCK_CODE = 'variable.source'; - -const DELIM_ASSIGN = 'delimiter.html'; -const ATTRIB_NAME = 'attribute.name.html'; -const ATTRIB_VALUE = 'string.html'; - -function getTag(name: string) { - return 'tag'; -} - export const conf: IRichLanguageConfiguration = { comments: { blockComment: ['',] @@ -75,46 +58,46 @@ export const language = { root: [ // headers (with #) - [/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ['white', TOKEN_HEADER_LEAD, TOKEN_HEADER, TOKEN_HEADER]], + [/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ['white', 'keyword', 'keyword', 'keyword']], // headers (with =) - [/^\s*(=+|\-+)\s*$/, TOKEN_EXT_HEADER], + [/^\s*(=+|\-+)\s*$/, 'keyword'], // headers (with ***) - [/^\s*((\*[ ]?)+)\s*$/, TOKEN_SEPARATOR], + [/^\s*((\*[ ]?)+)\s*$/, 'meta.separator'], // quote - [/^\s*>+/, TOKEN_QUOTE], + [/^\s*>+/, 'comment'], // list (starting with * or number) - [/^\s*([\*\-+:]|\d+\.)\s/, TOKEN_LIST], + [/^\s*([\*\-+:]|\d+\.)\s/, 'keyword'], // code block (4 spaces indent) - [/^(\t|[ ]{4})[^ ].*$/, TOKEN_BLOCK], + [/^(\t|[ ]{4})[^ ].*$/, 'string'], // code block (3 tilde) - [/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: TOKEN_BLOCK, next: '@codeblock' }], + [/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: 'string', next: '@codeblock' }], // github style code blocks (with backticks and language) - [/^\s*```\s*((?:\w|[\/\-#])+)\s*$/, { token: TOKEN_BLOCK, next: '@codeblockgh', nextEmbedded: '$1' }], + [/^\s*```\s*((?:\w|[\/\-#])+).*$/, { token: 'string', next: '@codeblockgh', nextEmbedded: '$1' }], // github style code blocks (with backticks but no language) - [/^\s*```\s*$/, { token: TOKEN_BLOCK, next: '@codeblock' }], + [/^\s*```\s*$/, { token: 'string', next: '@codeblock' }], // markup within lines { include: '@linecontent' }, ], codeblock: [ - [/^\s*~~~\s*$/, { token: TOKEN_BLOCK, next: '@pop' }], - [/^\s*```\s*$/, { token: TOKEN_BLOCK, next: '@pop' }], - [/.*$/, TOKEN_BLOCK_CODE], + [/^\s*~~~\s*$/, { token: 'string', next: '@pop' }], + [/^\s*```\s*$/, { token: 'string', next: '@pop' }], + [/.*$/, 'variable.source'], ], // github style code blocks codeblockgh: [ - [/```\s*$/, { token: TOKEN_BLOCK_CODE, next: '@pop', nextEmbedded: '@pop' }], - [/[^`]+/, TOKEN_BLOCK_CODE], + [/```\s*$/, { token: 'variable.source', next: '@pop', nextEmbedded: '@pop' }], + [/[^`]+/, 'variable.source'], ], linecontent: [ @@ -131,7 +114,7 @@ export const language = { [/`([^\\`]|@escapes)+`/, 'variable'], // links - [/\{[^}]+\}/, 'string.target'], + [/\{+[^}]+\}+/, 'string.target'], [/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ['string.link', '', 'string.link']], [/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, 'string.link'], @@ -146,14 +129,14 @@ export const language = { // we cannot correctly tokenize it in that mode yet. html: [ // html tags - [/<(\w+)\/>/, getTag('$1')], + [/<(\w+)\/>/, 'tag'], [/<(\w+)/, { cases: { - '@empty': { token: getTag('$1'), next: '@tag.$1' }, - '@default': { token: getTag('$1'), next: '@tag.$1' } + '@empty': { token: 'tag', next: '@tag.$1' }, + '@default': { token: 'tag', next: '@tag.$1' } } }], - [/<\/(\w+)\s*>/, { token: getTag('$1') }], + [/<\/(\w+)\s*>/, { token: 'tag' }], [/