diff --git a/.npmignore b/.npmignore index fa3b24da..143a8d42 100644 --- a/.npmignore +++ b/.npmignore @@ -8,3 +8,5 @@ /tsconfig.json /.npmignore /.travis.yml +/.editorconfig +/azure-pipelines.yml diff --git a/.vscode/launch.json b/.vscode/launch.json index df977905..b3b84602 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,9 +5,11 @@ "name": "Unit Tests", "type": "node", "request": "launch", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "program": "${workspaceRoot}/node_modules/.bin/tape", "stopOnEntry": false, "args": [ + "-r", + "./test/all.js", // "--grep", // "typescript" ], diff --git a/package-lock.json b/package-lock.json index 9ab0642b..2eec62b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,46 +4,53 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/node": { + "version": "14.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.0.tgz", + "integrity": "sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==", + "dev": true + }, + "@types/tape": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.13.0.tgz", + "integrity": "sha512-0V8cKowBdsiA9nbxAg7531sF2cdPZNiUogcfIUeUGm+bejUBE/bvibz3rH36iQP9bQjO/sOzFwU97/uC5mCyoA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "abab": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", - "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.4.tgz", + "integrity": "sha512-Eu9ELJWCz/c1e9gTiCY+FceWxcqzjYEbqMgtndnuSqZSUCOL73TWNK2mHfIj4Cw2E/ongOp+JISVNCmovt2KYQ==", "dev": true }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", "dev": true }, "acorn-globals": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", "dev": true, "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", - "dev": true - } + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" } }, "acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true }, "ajv": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", - "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -52,46 +59,6 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "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" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "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" - } - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -120,9 +87,9 @@ "dev": true }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, "balanced-match": { @@ -140,12 +107,6 @@ "tweetnacl": "^0.14.3" } }, - "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", - "dev": true - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -156,25 +117,10 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, "buffer-from": { @@ -183,110 +129,12 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "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": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "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" - } - } - } - }, - "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "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" - } - } - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -321,9 +169,9 @@ "dev": true }, "cssstyle": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.2.0.tgz", - "integrity": "sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", "dev": true, "requires": { "cssom": "~0.3.6" @@ -357,27 +205,26 @@ "whatwg-url": "^8.0.0" } }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, "decimal.js": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.0.tgz", "integrity": "sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw==", "dev": true }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -393,18 +240,18 @@ "object-keys": "^1.0.12" } }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, "domexception": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", @@ -412,6 +259,23 @@ "dev": true, "requires": { "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } + } + }, + "dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" } }, "ecc-jsbn": { @@ -424,29 +288,34 @@ "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 - }, "es-abstract": { - "version": "1.17.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", - "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "dependencies": { + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + } } }, "es-to-primitive": { @@ -460,16 +329,10 @@ "is-symbol": "^1.0.2" } }, - "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.14.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", - "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, "requires": { "esprima": "^4.0.1", @@ -510,9 +373,9 @@ "dev": true }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-json-stable-stringify": { @@ -527,31 +390,13 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "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" + "is-callable": "^1.1.3" } }, "forever-agent": { @@ -577,25 +422,12 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", - "dev": true, - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "get-caller-file": { - "version": "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 - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -619,21 +451,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -641,12 +458,12 @@ "dev": true }, "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "dev": true, "requires": { - "ajv": "^6.5.5", + "ajv": "^6.12.3", "har-schema": "^2.0.0" } }, @@ -659,28 +476,16 @@ "function-bind": "^1.1.1" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, - "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 - }, "html-encoding-sniffer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.0.tgz", - "integrity": "sha512-Y9prnPKkM7FXxQevZ5UH8Z6aVTY0ede1tHquck5UxGmKWDshxXh95gSa2xXYjS8AsGO5iOvrCI5+GttRKnLdNA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", "dev": true, "requires": { "whatwg-encoding": "^1.0.5" @@ -728,25 +533,16 @@ "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", "dev": true }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", "dev": true }, "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "dev": true }, "is-date-object": { @@ -755,31 +551,10 @@ "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "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-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "is-potential-custom-element-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", + "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", "dev": true }, "is-regex": { @@ -806,28 +581,12 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "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" - } - }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -835,35 +594,36 @@ "dev": true }, "jsdom": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.1.0.tgz", - "integrity": "sha512-kpIcNAuZYc/L17WADOOHslz/q5+3SipP/iRb3j6zd1zQ6pFJubLi/VCdD3NqBpj/IKKK4YXny1vv44rbEUSGFg==", + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.4.0.tgz", + "integrity": "sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w==", "dev": true, "requires": { "abab": "^2.0.3", - "acorn": "^7.1.0", - "acorn-globals": "^4.3.2", + "acorn": "^7.1.1", + "acorn-globals": "^6.0.0", "cssom": "^0.4.4", - "cssstyle": "^2.1.0", + "cssstyle": "^2.2.0", "data-urls": "^2.0.0", "decimal.js": "^10.2.0", "domexception": "^2.0.1", - "escodegen": "^1.12.1", - "html-encoding-sniffer": "^2.0.0", + "escodegen": "^1.14.1", + "html-encoding-sniffer": "^2.0.1", + "is-potential-custom-element-name": "^1.0.0", "nwsapi": "^2.2.0", "parse5": "5.1.1", - "request": "^2.88.0", + "request": "^2.88.2", "request-promise-native": "^1.0.8", - "saxes": "^4.0.2", - "symbol-tree": "^3.2.2", + "saxes": "^5.0.0", + "symbol-tree": "^3.2.4", "tough-cookie": "^3.0.1", - "w3c-hr-time": "^1.0.1", + "w3c-hr-time": "^1.0.2", "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^5.0.0", + "webidl-conversions": "^6.1.0", "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.0.0", - "ws": "^7.2.1", + "ws": "^7.2.3", "xml-name-validator": "^3.0.0" } }, @@ -907,20 +667,10 @@ "type-check": "~0.3.2" } }, - "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": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash.sortby": { @@ -929,28 +679,19 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - }, "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "1.43.0" + "mime-db": "1.44.0" } }, "minimatch": { @@ -963,68 +704,11 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.1.tgz", - "integrity": "sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg==", - "dev": true, - "requires": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "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.3.0", - "yargs-parser": "13.1.1", - "yargs-unparser": "1.6.0" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "monaco-editor-core": { "version": "0.20.0", "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.20.0.tgz", @@ -1032,9 +716,9 @@ "dev": true }, "monaco-plugin-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/monaco-plugin-helpers/-/monaco-plugin-helpers-1.0.2.tgz", - "integrity": "sha512-7kUx8dtd5qVNVgUARBRhnM8oftPglYwlINfigC4yGUiuzqtIN22u1tly8umiOCIPR0eFiBLjt6aN23oZh2QJgg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/monaco-plugin-helpers/-/monaco-plugin-helpers-1.0.3.tgz", + "integrity": "sha512-6AYI3ONAy8ki74qG2JqtFrLdiJHQlgeO5l4Rwr0OMyIpGXhc94y5rZuFxOtgGkxgSrZfHSwOt/MulUNZ/mOQOw==", "dev": true, "requires": { "typescript": "^2.7.2" @@ -1048,28 +732,6 @@ } } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -1088,6 +750,16 @@ "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", "dev": true }, + "object-is": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", + "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -1106,16 +778,6 @@ "object-keys": "^1.0.11" } }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1139,60 +801,30 @@ "word-wrap": "~1.2.3" } }, - "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", - "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": "5.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", "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": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "picomatch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -1200,9 +832,9 @@ "dev": true }, "psl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", - "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, "punycode": { @@ -1217,19 +849,20 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, - "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -1239,7 +872,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -1249,45 +882,39 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" }, "dependencies": { - "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==", + "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.24", - "punycode": "^1.4.1" + "psl": "^1.1.28", + "punycode": "^2.1.1" } } } }, "request-promise-core": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", - "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", + "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", "dev": true, "requires": { - "lodash": "^4.17.15" + "lodash": "^4.17.19" } }, "request-promise-native": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", - "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", + "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", "dev": true, "requires": { - "request-promise-core": "1.1.3", + "request-promise-core": "1.1.4", "stealthy-require": "^1.1.1", "tough-cookie": "^2.3.3" }, @@ -1304,28 +931,34 @@ } } }, - "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.6", "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", "dev": true }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "dev": true, + "requires": { + "through": "~2.3.4" + } + }, "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, "safer-buffer": { @@ -1335,26 +968,14 @@ "dev": true }, "saxes": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-4.0.2.tgz", - "integrity": "sha512-EZOTeQ4bgkOaGCDaTKux+LaRNcLNbdbvMH7R3/yjEEULPEmqvkFbFub6DJhJTub2iGMT93CfpZ5LTdKZmAbVeQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", "dev": true, "requires": { "xmlchars": "^2.2.0" } }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "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 - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1362,21 +983,15 @@ "dev": true }, "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -1400,58 +1015,35 @@ "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": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "string.prototype.trimleft": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", - "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "string.prototype.trim": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz", + "integrity": "sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw==", "dev": true, "requires": { "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1" } }, - "string.prototype.trimright": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", - "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, "symbol-tree": { @@ -1460,10 +1052,33 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "tape": { + "version": "4.13.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.13.3.tgz", + "integrity": "sha512-0/Y20PwRIUkQcTCSi4AASs+OANZZwqPKaipGCEwp10dQMipVvSZwUUCi01Y/OklIGyHKFhIcjock+DKnBfLAFw==", + "dev": true, + "requires": { + "deep-equal": "~1.1.1", + "defined": "~1.0.0", + "dotignore": "~0.1.2", + "for-each": "~0.3.3", + "function-bind": "~1.1.1", + "glob": "~7.1.6", + "has": "~1.0.3", + "inherits": "~2.0.4", + "is-regex": "~1.0.5", + "minimist": "~1.2.5", + "object-inspect": "~1.7.0", + "resolve": "~1.17.0", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.2.1", + "through": "~2.3.8" + } + }, "terser": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz", - "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", "dev": true, "requires": { "commander": "^2.20.0", @@ -1471,14 +1086,11 @@ "source-map-support": "~0.5.12" } }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true }, "tough-cookie": { "version": "3.0.1", @@ -1492,9 +1104,9 @@ } }, "tr46": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.0.tgz", - "integrity": "sha512-LrErSqfhdUw73AC/eXV2fEmNkvgSYxfm5lvxnLvuVgoVDknvD28Pa5FeDGc8RuVouDxUD3GnHHFv7xnBp7As5w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", + "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", "dev": true, "requires": { "punycode": "^2.1.1" @@ -1557,12 +1169,12 @@ } }, "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dev": true, "requires": { - "browser-process-hrtime": "^0.1.2" + "browser-process-hrtime": "^1.0.0" } }, "w3c-xmlserializer": { @@ -1575,9 +1187,9 @@ } }, "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", "dev": true }, "whatwg-encoding": { @@ -1596,38 +1208,14 @@ "dev": true }, "whatwg-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.0.0.tgz", - "integrity": "sha512-41ou2Dugpij8/LPO5Pq64K5q++MnRCBpEHvQr26/mArEKTkCV5aoXIqyhuYtE0pkqScXwhf2JP57rkRTYM29lQ==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.2.1.tgz", + "integrity": "sha512-ZmVCr6nfBeaMxEHALLEGy0LszYjpJqf6PVNQUQ1qd9Et+q7Jpygd4rGGDXgHjD8e99yLFseD69msHDM4YwPZ4A==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", - "tr46": "^2.0.0", - "webidl-conversions": "^5.0.0" - } - }, - "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" + "tr46": "^2.0.2", + "webidl-conversions": "^6.1.0" } }, "word-wrap": { @@ -1636,45 +1224,6 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.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" - } - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1682,9 +1231,9 @@ "dev": true }, "ws": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", - "integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", "dev": true }, "xml-name-validator": { @@ -1698,79 +1247,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "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.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "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.1.1" - }, - "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.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "dev": true, - "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - } } } } diff --git a/package.json b/package.json index 4c1e9400..739473eb 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "compile": "mrmdir ./release && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json", "watch": "tsc -p ./src --watch", - "test": "mocha", + "watch-esm": "tsc -p ./src/tsconfig.esm.json --watch", + "test": "tape -r ./test/all.js", "prepublishOnly": "npm run compile && node ./scripts/bundle" }, "author": "Microsoft Corporation", @@ -18,13 +19,14 @@ "url": "https://github.com/Microsoft/monaco-languages/issues" }, "devDependencies": { + "@types/tape": "^4.2.34", "glob": "^7.1.6", - "jsdom": "^16.1.0", - "mocha": "^7.0.1", + "jsdom": "^16.4.0", "monaco-editor-core": "0.20.0", "monaco-plugin-helpers": "^1.0.2", "requirejs": "^2.3.6", - "terser": "^4.6.3", + "tape": "^4.13.2", + "terser": "^4.6.6", "typescript": "3.7.5" } } diff --git a/src/abap/abap.test.ts b/src/abap/abap.test.ts index fc3b5bfd..fcb8a143 100644 --- a/src/abap/abap.test.ts +++ b/src/abap/abap.test.ts @@ -92,4 +92,93 @@ testTokenization('abap', [ { startIndex: 0, type: 'string.abap' }, ] }], + [{ + line: 'FIELD-SYMBOLS .', + tokens: [ + { startIndex: 0, type: 'keyword.abap' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'identifier.abap' }, + { startIndex: 19, type: 'delimiter.abap' }, + ] + }], + [{ + line: 'IF foo IS NOT INITIAL.', + tokens: [ + { startIndex: 0, type: 'keyword.abap' }, + { startIndex: 2, type: '' }, + { startIndex: 3, type: 'identifier.abap' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'keyword.abap' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'keyword.abap' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'keyword.abap' }, + { startIndex: 21, type: 'delimiter.abap' }, + ] + }], + [{ + line: 'WRITE `moo`.', + tokens: [ + { startIndex: 0, type: 'keyword.abap' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'string.abap' }, + { startIndex: 11, type: 'delimiter.abap' }, + ] + }], + [{ + line: 'FORM foo.', + tokens: [ + { startIndex: 0, type: 'keyword.abap' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'identifier.abap' }, + { startIndex: 8, type: 'delimiter.abap' }, + ] + }], + [{ + line: 'moo = CONV #( 1 ).', + tokens: [ + { startIndex: 0, type: 'identifier.abap' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'operator.abap' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.abap' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'operator.abap' }, + { startIndex: 12, type: "delimiter.parenthesis.abap" }, + { startIndex: 13, type: "" }, + { startIndex: 14, type: "number.abap" }, + { startIndex: 15, type: "" }, + { startIndex: 16, type: "delimiter.parenthesis.abap" }, + { startIndex: 17, type: "delimiter.abap" } + ] + }], + [{ + line: 'WRITE foo ##pragma.', + tokens: [ + { startIndex: 0, type: 'keyword.abap' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'identifier.abap' }, + { startIndex: 9, type: '' }, + { startIndex: 12, type: 'identifier.abap' }, + { startIndex: 18, type: 'delimiter.abap' }, + ] + }], + [{ + line: 'SELECT * FROM foo02 INTO @foo.', + tokens: [ + { startIndex: 0, type: 'keyword.abap' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'operator.abap' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'keyword.abap' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'identifier.abap' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'keyword.abap' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'operator.abap' }, + { startIndex: 26, type: 'identifier.abap' }, + { startIndex: 29, type: 'delimiter.abap' }, + ] + }], ]); diff --git a/src/abap/abap.ts b/src/abap/abap.ts index 00bdf670..f664c218 100644 --- a/src/abap/abap.ts +++ b/src/abap/abap.ts @@ -29,26 +29,27 @@ const abapKeywords = [ 'editor-call','end','endexec','endfunction','ending','endmodule','end-of-definition','end-of-page','end-of-selection','end-test-injection','end-test-seam','exit-command','endclass','endmethod','endform','endinterface', 'endprovide','endselect','endtry','endwhile','enum','event','events','exec','exit','export', 'exporting','extract','exception','exceptions', - 'field-symbols','field-groups','field','first','fetch','fields','format','frame','free','from','function','find','for','found','function-pool', + 'form','field-symbols','field-groups','field','first','fetch','fields','format','frame','free','from','function','find','for','found','function-pool', 'generate','get', 'handle','hide','hashed', 'include','import','importing','index','infotypes','initial','initialization', - 'id','is','in','interface','interfaces','init','input','insert','instance','into', + 'id','is','in','interface','interfaces','init','input','insert','instance','into','implemented', 'key', 'left-justified','leave','like','line','line-count','line-size','load','local','log-point','length','left','leading','lower', - 'matchcode','method','mesh','message','message-id','methods','modify','module','move','move-corresponding','multiply','multiply-corresponding','match', - 'new','new-line','new-page','new-section','next','no','no-gap','no-gaps','no-sign','no-zero','non-unique','number', + 'matchcode','method','mesh','message','message-id','methods','modify','module','move','move-corresponding','multiply','multiply-corresponding','match','mode', + 'not','new','new-line','new-page','new-section','next','no','no-gap','no-gaps','no-sign','no-zero','non-unique','number', 'occurrence','object','obligatory','of','output','overlay','optional','others','occurrences','occurs','offset','options', - 'pack','parameters','perform','places','position','print-control','private','program','protected','provide','public','put', + 'pack','parameters','perform','places','position','print-control','private','program','protected','provide','public','put','partially', 'radiobutton','raising','ranges','receive','receiving','redefinition','reduce','reference','refresh','regex','reject','results','requested', 'ref','replace','report','reserve','restore','result','return','returning','right-justified','rollback','read','read-only','rp-provide-from-last','run', - 'scan','screen','scroll','search','select','select-options','selection-screen','stamp','source','subkey', + 'scan','screen','scroll','search','select','select-options','selection-screen','stamp','source','subkey','subscreen', 'separated','set','shift','single','skip','sort','sorted','split','standard','stamp','starting','start-of-selection','sum','subtract-corresponding','statics','step','stop','structure','submatches','submit','subtract','summary','supplied','suppress','section','syntax-check','syntax-trace','system-call','switch', - 'tables','table','task','testing','test-seam','test-injection','then','time','times','title','titlebar','to','top-of-page','trailing','transfer','transformation','translate','transporting','types','type','type-pool','type-pools', - 'unassign','unique','uline','unpack','update','upper','using', + 'tables','table','task','testing','test-seam','test-injection','then','time','times','title','titlebar','to','top-of-page','trailing','transfer','transformation','translate','transporting','types','type','type-pool','type-pools','tabbed', + 'unassign','unique','uline','unpack','update','upper','using','user-command', 'value', 'when','while','window','write','where','with','work', 'at','case','catch','continue','do','elseif','else','endat','endcase','enddo','endif','endloop','endon','if','loop','on','raise','try', + // built-in: 'abs','sign','ceil','floor','trunc','frac','acos','asin','atan','cos','sin','tan','cosh','sinh','tanh','exp','log','log10','sqrt','strlen','xstrlen','charlen','lines','numofchar','dbmaxlen','round','rescale','nmax','nmin','cmax','cmin','boolc','boolx','xsdbool','contains','contains_any_of','contains_any_not_of','matches','line_exists','ipow','char_off','count','count_any_of','count_any_not_of','distance','condense','concat_lines_of','escape','find','find_end','find_any_of','find_any_not_of','insert','match','repeat','replace','reverse','segment','shift_left','shift_right','substring','substring_after','substring_from','substring_before','substring_to','to_upper','to_lower','to_mixed','from_mixed','translate','bit-set','line_index', 'definition','implementation','public','inheriting','final' ]; @@ -65,19 +66,22 @@ export const language = { ], operators: [ - '+', '-', '/', '*', - '=', '<', '>', '<=', '>=', '<>', '><', '=<', '=>', + ' +', ' -', '/', '*', + '=', ' < ', ' > ', '<=', '>=', '<>', '><', '=<', '=>', + '#', '@', 'EQ', 'NE', 'GE', 'LE', 'CS', 'CN', 'CA', 'CO', 'CP', 'NS', 'NA', 'NP', ], - symbols: /[=>/, 'identifier'], // field symbols { include: '@whitespace' }, @@ -88,6 +92,7 @@ export const language = { '@default' : '' } } ], [/'/, { token: 'string', bracket: '@open', next: '@stringquote' } ], + [/`/, { token: 'string', bracket: '@open', next: '@stringping' } ], [/\|/, { token: 'string', bracket: '@open', next: '@stringtemplate' } ], [/\d+/, 'number'], @@ -99,6 +104,11 @@ export const language = { [/\|/, { token: 'string', bracket: '@close', next: '@pop' } ] ], + stringping: [ + [/[^\\`]+/, 'string'], + [/`/, { token: 'string', bracket: '@close', next: '@pop' } ] + ], + stringquote: [ [/[^\\']+/, 'string'], [/'/, { token: 'string', bracket: '@close', next: '@pop' } ] diff --git a/src/dart/dart.contribution.ts b/src/dart/dart.contribution.ts new file mode 100644 index 00000000..cdc287ce --- /dev/null +++ b/src/dart/dart.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: 'dart', + extensions: ['.dart'], + aliases: ['Dart', 'dart'], + mimetypes: ['text/x-dart-source', 'text/x-dart'], + loader: () => import('./dart') +}); diff --git a/src/dart/dart.test.ts b/src/dart/dart.test.ts new file mode 100644 index 00000000..dfe6a5f6 --- /dev/null +++ b/src/dart/dart.test.ts @@ -0,0 +1,559 @@ +/*--------------------------------------------------------------------------------------------- + * 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("dart", [ + // Comments - single line + [ + { + line: "//", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: " // a comment", + tokens: [ + { startIndex: 0, type: "" }, + { startIndex: 4, type: "comment.dart" } + ] + } + ], + + // Broken nested tokens due to invalid comment tokenization + [ + { + line: "/* //*/ a", + tokens: [ + { startIndex: 0, type: "comment.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "// a comment", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "//sticky comment", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "/almost a comment", + tokens: [ + { startIndex: 0, type: "delimiter.dart" }, + { startIndex: 1, type: "identifier.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "identifier.dart" }, + { startIndex: 9, type: "" }, + { startIndex: 10, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "1 / 2; /* comment", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "number.dart" }, + { startIndex: 5, type: "delimiter.dart" }, + { startIndex: 6, type: "" }, + { startIndex: 7, type: "comment.dart" } + ] + } + ], + + [ + { + line: "var x = 1; // my comment // is a nice one", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "number.dart" }, + { startIndex: 9, type: "delimiter.dart" }, + { startIndex: 10, type: "" }, + { startIndex: 11, type: "comment.dart" } + ] + } + ], + + // Comments - range comment, single line + [ + { + line: "/* a simple comment */", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "var x = /* a simple comment */ 1;", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "comment.dart" }, + { startIndex: 30, type: "" }, + { startIndex: 31, type: "number.dart" }, + { startIndex: 32, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: "var x = /* comment */ 1; */", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "comment.dart" }, + { startIndex: 21, type: "" }, + { startIndex: 22, type: "number.dart" }, + { startIndex: 23, type: "delimiter.dart" }, + { startIndex: 24, type: "" } + ] + } + ], + + [ + { + line: "x = /**/;", + tokens: [ + { startIndex: 0, type: "identifier.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "comment.dart" }, + { startIndex: 8, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: "x = /*/;", + tokens: [ + { startIndex: 0, type: "identifier.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "comment.dart" } + ] + } + ], + + // Comments - range comment, multiple lines + [ + { + line: "/* start of multiline comment", + tokens: [{ startIndex: 0, type: "comment.dart" }] + }, + { + line: "a comment between without a star", + tokens: [{ startIndex: 0, type: "comment.dart" }] + }, + { + line: "end of multiline comment*/", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "var x = /* start a comment", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "comment.dart" } + ] + }, + { + line: " a ", + tokens: [{ startIndex: 0, type: "comment.dart" }] + }, + { + line: "and end it */ 2;", + tokens: [ + { startIndex: 0, type: "comment.dart" }, + { startIndex: 13, type: "" }, + { startIndex: 14, type: "number.dart" }, + { startIndex: 15, type: "delimiter.dart" } + ] + } + ], + + // Keywords + [ + { + line: "var x = function() { };", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "identifier.dart" }, + { startIndex: 16, type: "delimiter.parenthesis.dart" }, + { startIndex: 18, type: "" }, + { startIndex: 19, type: "delimiter.bracket.dart" }, + { startIndex: 20, type: "" }, + { startIndex: 21, type: "delimiter.bracket.dart" }, + { startIndex: 22, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: " var ", + tokens: [ + { startIndex: 0, type: "" }, + { startIndex: 4, type: "keyword.dart" }, + { startIndex: 7, type: "" } + ] + } + ], + + // Numbers + [ + { + line: "0", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + + [ + { + line: "0.10", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "0x", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0x123", + tokens: [{ startIndex: 0, type: "number.hex.dart" }] + } + ], + + [ + { + line: "0x5_2", + tokens: [{ startIndex: 0, type: "number.hex.dart" }] + } + ], + [ + { + line: "0b1010_0101", + tokens: [{ startIndex: 0, type: "number.binary.dart" }] + } + ], + + [ + { + line: "0B001", + tokens: [{ startIndex: 0, type: "number.binary.dart" }] + } + ], + + [ + { + line: "10e3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + [ + { + line: "23.5", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5e3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5e-3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5E3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5E-3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "0_52", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + + [ + { + line: "5_2", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + + [ + { + line: "5_______2", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + [ + { + line: "3._1415F", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "delimiter.dart" }, + { startIndex: 2, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "999_99_9999_L", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 11, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "52_", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 2, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0_x52", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0x_52", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0x52_", + tokens: [ + { startIndex: 0, type: "number.hex.dart" }, + { startIndex: 4, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "052_", + tokens: [ + { startIndex: 0, type: "number.octal.dart" }, + { startIndex: 3, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "23.5L", + tokens: [ + { startIndex: 0, type: "number.float.dart" }, + { startIndex: 4, type: "type.identifier.dart" } + ] + } + ], + + [ + { + line: "0+0", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "delimiter.dart" }, + { startIndex: 2, type: "number.dart" } + ] + } + ], + + [ + { + line: "100+10", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 3, type: "delimiter.dart" }, + { startIndex: 4, type: "number.dart" } + ] + } + ], + + [ + { + line: "0 + 0", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "number.dart" } + ] + } + ], + + // Strings + [ + { + line: "var s = 's';", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "string.dart" }, + { startIndex: 11, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: 'String s = "concatenated" + " String" ;', + tokens: [ + { startIndex: 0, type: "type.identifier.dart" }, + { startIndex: 6, type: "" }, + { startIndex: 7, type: "identifier.dart" }, + { startIndex: 8, type: "" }, + { startIndex: 9, type: "delimiter.dart" }, + { startIndex: 10, type: "" }, + { startIndex: 11, type: "string.dart" }, + { startIndex: 25, type: "" }, + { startIndex: 26, type: "delimiter.dart" }, + { startIndex: 27, type: "" }, + { startIndex: 28, type: "string.dart" }, + { startIndex: 37, type: "" }, + { startIndex: 38, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: '"quote in a string"', + tokens: [{ startIndex: 0, type: "string.dart" }] + } + ], + + [ + { + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: "string.dart" }, + { startIndex: 10, type: "string.escape.dart" }, + { startIndex: 12, type: "string.dart" }, + { startIndex: 18, type: "string.escape.dart" }, + { startIndex: 20, type: "string.dart" } + ] + } + ], + + [ + { + line: '"\\"', + tokens: [{ startIndex: 0, type: "string.invalid.dart" }] + } + ], + + // Annotations + [ + { + line: "@", + tokens: [{ startIndex: 0, type: "invalid.dart" }] + } + ], + + [ + { + line: "@Override", + tokens: [{ startIndex: 0, type: "annotation.dart" }] + } + ] +]); diff --git a/src/dart/dart.ts b/src/dart/dart.ts new file mode 100644 index 00000000..10b2166f --- /dev/null +++ b/src/dart/dart.ts @@ -0,0 +1,326 @@ +/*--------------------------------------------------------------------------------------------- + * 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 LanguageConfiguration = monaco.languages.LanguageConfiguration; +import IMonarchLanguage = monaco.languages.IMonarchLanguage; + +export const conf: LanguageConfiguration = { + comments: { + lineComment: "//", + blockComment: ["/*", "*/"] + }, + brackets: [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + autoClosingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + { open: "'", close: "'", notIn: ["string", "comment"] }, + { open: '"', close: '"', notIn: ["string"] }, + { open: "`", close: "`", notIn: ["string", "comment"] }, + { open: "/**", close: " */", notIn: ["string"] } + ], + surroundingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + + { open: "<", close: ">" }, + { open: "'", close: "'" }, + { open: "(", close: ")" }, + { open: '"', close: '"' }, + { open: "`", close: "`" } + ], + folding: { + markers: { + start: /^\s*\s*#?region\b/, + end: /^\s*\s*#?endregion\b/ + } + } +}; + +export const language = { + defaultToken: "invalid", + tokenPostfix: ".dart", + + keywords: [ + "abstract", + "dynamic", + "implements", + "show", + "as", + "else", + "import", + "static", + "assert", + "enum", + "in", + "super", + "async", + "export", + "interface", + "switch", + "await", + "extends", + "is", + "sync", + "break", + "external", + "library", + "this", + "case", + "factory", + "mixin", + "throw", + "catch", + "false", + "new", + "true", + "class", + "final", + "null", + "try", + "const", + "finally", + "on", + "typedef", + "continue", + "for", + "operator", + "var", + "covariant", + "Function", + "part", + "void", + "default", + "get", + "rethrow", + "while", + "deferred", + "hide", + "return", + "with", + "do", + "if", + "set", + "yield" + ], + typeKeywords: ["int", "double", "String", "bool"], + + operators: [ + "+", + "-", + "*", + "/", + "~/", + "%", + "++", + "--", + "==", + "!=", + ">", + "<", + ">=", + "<=", + "=", + "-=", + "/=", + "%=", + ">>=", + "^=", + "+=", + "*=", + "~/=", + "<<=", + "&=", + "!=", + "||", + "&&", + "&", + "|", + "^", + "~", + "<<", + ">>", + "!", + ">>>", + "??", + "?", + ":", + "|=" + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, "@brackets"], + [/!(?=([^=]|$))/, "delimiter"], + [ + /@symbols/, + { + cases: { + "@operators": "delimiter", + "@default": "" + } + } + ], + + // numbers + [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"], + [/0[xX](@hexdigits)n?/, "number.hex"], + [/0[oO]?(@octaldigits)n?/, "number.octal"], + [/0[bB](@binarydigits)n?/, "number.binary"], + [/(@digits)n?/, "number"], + + // delimiter: after number because of .\d floats + [/[;,.]/, "delimiter"], + + // strings + [/"([^"\\]|\\.)*$/, "string.invalid"], // non-teminated string + [/'([^'\\]|\\.)*$/, "string.invalid"], // non-teminated string + [/"/, "string", "@string_double"], + [/'/, "string", "@string_single"] + + // [/[a-zA-Z]+/, "variable"] + ], + + whitespace: [ + [/[ \t\r\n]+/, ""], + [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"], + [/\/\*/, "comment", "@comment"], + [/\/\/\/.*$/, "comment.doc"], + [/\/\/.*$/, "comment"] + ], + + comment: [ + [/[^\/*]+/, "comment"], + [/\*\//, "comment", "@pop"], + [/[\/*]/, "comment"] + ], + + jsdoc: [ + [/[^\/*]+/, "comment.doc"], + [/\*\//, "comment.doc", "@pop"], + [/[\/*]/, "comment.doc"] + ], + + // We match regular expression quite precisely + regexp: [ + [ + /(\{)(\d+(?:,\d*)?)(\})/, + [ + "regexp.escape.control", + "regexp.escape.control", + "regexp.escape.control" + ] + ], + [ + /(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, + [ + "regexp.escape.control", + { token: "regexp.escape.control", next: "@regexrange" } + ] + ], + [ + /(\()(\?:|\?=|\?!)/, + ["regexp.escape.control", "regexp.escape.control"] + ], + [/[()]/, "regexp.escape.control"], + [/@regexpctl/, "regexp.escape.control"], + [/[^\\\/]/, "regexp"], + [/@regexpesc/, "regexp.escape"], + [/\\\./, "regexp.invalid"], + [ + /(\/)([gimsuy]*)/, + [ + { token: "regexp", bracket: "@close", next: "@pop" }, + "keyword.other" + ] + ] + ], + + regexrange: [ + [/-/, "regexp.escape.control"], + [/\^/, "regexp.invalid"], + [/@regexpesc/, "regexp.escape"], + [/[^\]]/, "regexp"], + [ + /\]/, + { + token: "regexp.escape.control", + next: "@pop", + bracket: "@close" + } + ] + ], + + string_double: [ + [/[^\\"\$]+/, "string"], [/[^\\"]+/, "string"], + [/@escapes/, "string.escape"], + [/\\./, "string.escape.invalid"], + [/"/, "string", "@pop"], + [/\$\w+/, 'identifier'] + ], + + string_single: [ + [/[^\\'\$]+/, "string"], + [/@escapes/, "string.escape"], + [/\\./, "string.escape.invalid"], + [/'/, "string", "@pop"], + [/\$\w+/, 'identifier'] + ], + } +}; diff --git a/src/handlebars/handlebars.test.ts b/src/handlebars/handlebars.test.ts index 4e5aa2bd..71738d77 100644 --- a/src/handlebars/handlebars.test.ts +++ b/src/handlebars/handlebars.test.ts @@ -281,5 +281,35 @@ testTokenization(['handlebars', 'css'], [ { startIndex: 30, type: 'delimiter.handlebars' }, { startIndex: 32, type: '' } ] - }] + }], + + // Block comment + [{ + line: '{{!-- block comment --}}', + tokens: [ + { startIndex: 0, type: 'comment.block.start.handlebars' }, + { startIndex: 5, type: 'comment.content.handlebars' }, + { startIndex: 20, type: 'comment.block.end.handlebars' } + ] + }], + + // Block comment with mustache + [{ + line: '{{!-- block comment }} with mustache --}}', + tokens: [ + { startIndex: 0, type: 'comment.block.start.handlebars' }, + { startIndex: 5, type: 'comment.content.handlebars' }, + { startIndex: 37, type: 'comment.block.end.handlebars' } + ] + }], + + // Handlebars comment + [{ + line: '{{! comment }}', + tokens: [ + { startIndex: 0, type: 'comment.start.handlebars' }, + { startIndex: 3, type: 'comment.content.handlebars' }, + { startIndex: 12, type: 'comment.end.handlebars' } + ] + }], ]); diff --git a/src/handlebars/handlebars.ts b/src/handlebars/handlebars.ts index dc1eee51..17db3fc3 100644 --- a/src/handlebars/handlebars.ts +++ b/src/handlebars/handlebars.ts @@ -63,9 +63,11 @@ export const language = { // The main tokenizer for our languages tokenizer: { root: [ + [/\{\{!--/, 'comment.block.start.handlebars', '@commentBlock'], + [/\{\{!/, 'comment.start.handlebars', '@comment'], [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.root' }], [/)/, ['delimiter.html', 'tag.html', 'delimiter.html']], [/(<)(script)/, ['delimiter.html', { token: 'tag.html', next: '@script' }]], [/(<)(style)/, ['delimiter.html', { token: 'tag.html', next: '@style' }]], @@ -83,6 +85,16 @@ export const language = { ], comment: [ + [/\}\}/, 'comment.end.handlebars', '@pop'], + [/./, 'comment.content.handlebars'] + ], + + commentBlock: [ + [/--\}\}/, 'comment.block.end.handlebars', '@pop'], + [/./, 'comment.content.handlebars'] + ], + + commentHtml: [ [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.comment' }], [/-->/, 'comment.html', '@pop'], [/[^-]+/, 'comment.content.html'], diff --git a/src/javascript/javascript.contribution.ts b/src/javascript/javascript.contribution.ts index 8f3cc5cb..e4b1d85e 100644 --- a/src/javascript/javascript.contribution.ts +++ b/src/javascript/javascript.contribution.ts @@ -8,7 +8,7 @@ import { registerLanguage } from '../_.contribution'; registerLanguage({ id: 'javascript', - extensions: ['.js', '.es6', '.jsx'], + extensions: ['.js', '.es6', '.jsx', '.mjs'], firstLine: '^#!.*\\bnode', filenames: ['jakefile'], aliases: ['JavaScript', 'javascript', 'js'], diff --git a/src/lexon/lexon.contribution.ts b/src/lexon/lexon.contribution.ts new file mode 100644 index 00000000..0485d747 --- /dev/null +++ b/src/lexon/lexon.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: 'lexon', + extensions: ['.lex'], + aliases: ['Lexon'], + loader: () => import('./lexon') +}); diff --git a/src/lexon/lexon.test.ts b/src/lexon/lexon.test.ts new file mode 100644 index 00000000..5e9405cd --- /dev/null +++ b/src/lexon/lexon.test.ts @@ -0,0 +1,131 @@ +/*--------------------------------------------------------------------------------------------- + * 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('lexon', [ + // Tests + + [{ + line: 'LEX Paid Escrow', + tokens: [ + { startIndex: 0, type: 'keyword.lexon' }, + { startIndex: 3, type: 'white.lexon' }, + { startIndex: 4, type: 'identifier.lexon' }, + { startIndex: 8, type: 'white.lexon' }, + { startIndex: 9, type: 'identifier.lexon' }, + ] + }], + + [{ + line: 'LEXON: 0.2.20', + tokens: [ + { startIndex: 0, type: 'keyword.lexon' }, + { startIndex: 5, type: 'delimiter.lexon' }, + { startIndex: 6, type: 'white.lexon' }, + { startIndex: 7, type: 'number.semver.lexon' }, + ] + }], + + [{ + line: 'COMMENT: 3.f - an escrow that is controlled by a third party for a fee.', + tokens: [ + { startIndex: 0, type: 'comment.lexon' }, + ] + }], + + [{ + line: '"Payer" is a person.', + tokens: [ + { startIndex: 0, type: 'identifier.quote.lexon' }, + { startIndex: 1, type: 'identifier.lexon' }, + { startIndex: 6, type: 'identifier.quote.lexon' }, + { startIndex: 7, type: 'white.lexon' }, + { startIndex: 8, type: 'operator.lexon' }, + { startIndex: 10, type: 'white.lexon' }, + { startIndex: 11, type: 'identifier.lexon' }, + { startIndex: 12, type: 'white.lexon' }, + { startIndex: 13, type: 'keyword.type.lexon' }, + { startIndex: 19, type: 'delimiter.lexon' }, + ] + }], + + [{ + line: '"Fee" is an amount.', + tokens: [ + { startIndex: 0, type: 'identifier.quote.lexon' }, + { startIndex: 1, type: 'identifier.lexon' }, + { startIndex: 4, type: 'identifier.quote.lexon' }, + { startIndex: 5, type: 'white.lexon' }, + { startIndex: 6, type: 'operator.lexon' }, + { startIndex: 8, type: 'white.lexon' }, + { startIndex: 9, type: 'identifier.lexon' }, + { startIndex: 11, type: 'white.lexon' }, + { startIndex: 12, type: 'keyword.type.lexon' }, + { startIndex: 18, type: 'delimiter.lexon' }, + ] + }], + + [{ + line: 'The Payer pays an Amount into escrow,', + tokens: [ + { startIndex: 0, type: 'identifier.lexon' }, // The + { startIndex: 3, type: 'white.lexon' }, + { startIndex: 4, type: 'identifier.lexon' }, // Payer + { startIndex: 9, type: 'white.lexon' }, + { startIndex: 10, type: 'keyword.lexon' }, // pays + { startIndex: 14, type: 'white.lexon' }, + { startIndex: 15, type: 'identifier.lexon' }, // an + { startIndex: 17, type: 'white.lexon' }, + { startIndex: 18, type: 'keyword.type.lexon' }, // Amount + { startIndex: 24, type: 'white.lexon' }, + { startIndex: 25, type: 'keyword.lexon' }, // into + { startIndex: 29, type: 'white.lexon' }, + { startIndex: 30, type: 'identifier.lexon' }, // escrow + { startIndex: 36, type: 'delimiter.lexon' }, // , + ] + }], + + [{ + line: 'appoints the Payee,', + tokens: [ + { startIndex: 0, type: 'keyword.lexon' }, // Appoints + { startIndex: 8, type: 'white.lexon' }, + { startIndex: 9, type: 'identifier.lexon' }, // the + { startIndex: 12, type: 'white.lexon' }, + { startIndex: 13, type: 'identifier.lexon' }, // Payee + { startIndex: 18, type: 'delimiter.lexon' }, // , + ] + }], + + [{ + line: 'and also fixes the Fee.', + tokens: [ + { startIndex: 0, type: 'operator.lexon' }, // and + { startIndex: 3, type: 'white.lexon' }, + { startIndex: 4, type: 'identifier.lexon' }, // also + { startIndex: 8, type: 'white.lexon' }, + { startIndex: 9, type: 'identifier.lexon' }, // fixes + { startIndex: 14, type: 'white.lexon' }, + { startIndex: 15, type: 'identifier.lexon' }, // the + { startIndex: 18, type: 'white.lexon' }, + { startIndex: 19, type: 'identifier.lexon' }, // Fee + { startIndex: 22, type: 'delimiter.lexon' }, // . + ] + }], + + [{ + line: 'CLAUSE: Pay Out.', + tokens: [ + { startIndex: 0, type: 'keyword.lexon' }, // CLAUSE + { startIndex: 6, type: 'delimiter.lexon' }, // : + { startIndex: 7, type: 'white.lexon' }, + { startIndex: 8, type: 'identifier.lexon' }, // Pay out + { startIndex: 15, type: 'delimiter.lexon' }, // . + ] + }], +]); diff --git a/src/lexon/lexon.ts b/src/lexon/lexon.ts new file mode 100644 index 00000000..bc020bfd --- /dev/null +++ b/src/lexon/lexon.ts @@ -0,0 +1,140 @@ +/*--------------------------------------------------------------------------------------------- + * 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: 'COMMENT', + // blockComment: ['COMMENT', '.'], + }, + 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: '\'' }, + { open: ':', close: '.', }, + ], + folding: { + markers: { + start: new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"), + end: new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion") + } + } +}; + +export const language = { + // Set defaultToken to invalid to see what you do not tokenize yet + // defaultToken: 'invalid', + tokenPostfix: '.lexon', + ignoreCase: true, + + keywords: [ + 'lexon', 'lex', 'clause', 'terms', 'contracts', 'may', 'pay', + 'pays', 'appoints', 'into', 'to' + ], + + typeKeywords: [ + 'amount', 'person', 'key', 'time', 'date', 'asset', 'text' + ], + + operators: [ + 'less', 'greater', 'equal', 'le', 'gt', 'or', 'and', + 'add', 'added', 'subtract', 'subtracted', 'multiply', 'multiplied', 'times', 'divide', 'divided', + 'is', 'be', 'certified' + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, 'delimiter'], + + // numbers + [/\d*\.\d*\.\d*/, 'number.semver'], + [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], + [/0[xX][0-9a-fA-F]+/, 'number.hex'], + [/\d+/, 'number'], + + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + ], + + quoted_identifier: [ + [/[^\\"]+/, 'identifier'], + [/"/, { token: 'identifier.quote', bracket: '@close', next: '@pop' }] + ], + + space_identifier_until_period: [ + [':', 'delimiter'], + [' ', { token: 'white', next: '@identifier_rest' }], + ], + + identifier_until_period: [ + { include: '@whitespace' }, + [':', { token: 'delimiter', next: '@identifier_rest' }], + [/[^\\.]+/, 'identifier'], + [/\./, { token: 'delimiter', bracket: '@close', next: '@pop' }] + ], + + identifier_rest: [ + [/[^\\.]+/, 'identifier'], + [/\./, { token: 'delimiter', bracket: '@close', next: '@pop' }] + ], + + semver: [ + { include: '@whitespace' }, + [':', 'delimiter'], + [/\d*\.\d*\.\d*/, { token: 'number.semver', bracket: '@close', next: '@pop' }] + ], + + whitespace: [ + [/[ \t\r\n]+/, 'white'], + ], + }, +}; diff --git a/src/monaco.contribution.ts b/src/monaco.contribution.ts index 77065787..f5083a86 100644 --- a/src/monaco.contribution.ts +++ b/src/monaco.contribution.ts @@ -15,6 +15,7 @@ import './cpp/cpp.contribution'; import './csharp/csharp.contribution'; import './csp/csp.contribution'; import './css/css.contribution'; +import './dart/dart.contribution'; import './dockerfile/dockerfile.contribution'; import './fsharp/fsharp.contribution'; import './go/go.contribution'; @@ -27,6 +28,7 @@ import './javascript/javascript.contribution'; import './julia/julia.contribution'; import './kotlin/kotlin.contribution'; import './less/less.contribution'; +import './lexon/lexon.contribution'; import './lua/lua.contribution'; import './markdown/markdown.contribution'; import './mips/mips.contribution'; diff --git a/src/python/python.ts b/src/python/python.ts index dfff3bfe..3ae85906 100644 --- a/src/python/python.ts +++ b/src/python/python.ts @@ -55,9 +55,18 @@ export const language = { tokenPostfix: '.python', keywords: [ + // This section is the result of running + // `for k in keyword.kwlist: print(' "' + k + '",')` in a Python REPL, + // though note that the output from Python 3 is not a strict superset of the + // output from Python 2. + 'False', // promoted to keyword.kwlist in Python 3 + 'None', // promoted to keyword.kwlist in Python 3 + 'True', // promoted to keyword.kwlist in Python 3 'and', 'as', 'assert', + 'async', // new in Python 3 + 'await', // new in Python 3 'break', 'class', 'continue', @@ -66,7 +75,7 @@ export const language = { 'elif', 'else', 'except', - 'exec', + 'exec', // Python 2, but not 3. 'finally', 'for', 'from', @@ -76,14 +85,13 @@ export const language = { 'in', 'is', 'lambda', - 'None', + 'nonlocal', // new in Python 3 'not', 'or', 'pass', - 'print', + 'print', // Python 2, but not 3. 'raise', 'return', - 'self', 'try', 'while', 'with', @@ -156,6 +164,7 @@ export const language = { 'repr', 'reversed', 'round', + 'self', 'set', 'setattr', 'slice', @@ -172,9 +181,6 @@ export const language = { 'xrange', 'zip', - 'True', - 'False', - '__dict__', '__methods__', '__members__', diff --git a/src/r/r.contribution.ts b/src/r/r.contribution.ts index c78eedbe..489d514c 100644 --- a/src/r/r.contribution.ts +++ b/src/r/r.contribution.ts @@ -8,7 +8,7 @@ import { registerLanguage } from '../_.contribution'; registerLanguage({ id: 'r', - extensions: ['.r', '.rhistory', '.rprofile', '.rt'], + extensions: ['.r', '.rhistory', '.rmd', '.rprofile', '.rt'], aliases: ['R', 'r'], loader: () => import('./r') }); diff --git a/src/scala/scala.contribution.ts b/src/scala/scala.contribution.ts index 84bd2178..c625a77f 100644 --- a/src/scala/scala.contribution.ts +++ b/src/scala/scala.contribution.ts @@ -8,8 +8,8 @@ import { registerLanguage } from '../_.contribution'; registerLanguage({ id: 'scala', - extensions: ['.scala', '.sbt', '.sc'], + extensions: ['.scala', '.sc', '.sbt'], aliases: ['Scala', 'scala', 'SBT', 'Sbt', 'sbt', 'Dotty', 'dotty'], - mimetypes: ['text/x-scala', 'text/x-sbt', 'text/x-dotty'], + mimetypes: ['text/x-scala-source', 'text/x-scala', 'text/x-sbt', 'text/x-dotty'], loader: () => import('./scala') }); diff --git a/src/scala/scala.test.ts b/src/scala/scala.test.ts index 2f93a17d..a1063dfe 100644 --- a/src/scala/scala.test.ts +++ b/src/scala/scala.test.ts @@ -34,5 +34,655 @@ testTokenization('scala', [ {startIndex: 7, type: 'white.scala'}, {startIndex: 8, type: 'number.scala'} ] + }], + + // Comments - single line + [{ + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + [{ + line: ' // a comment', + tokens: [ + { startIndex: 0, type: 'white.scala' }, + { startIndex: 4, type: 'comment.scala' } + ] + }], + + // Broken nested tokens due to invalid comment tokenization + [{ + line: '/* //*/ a', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + [{ + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + [{ + line: '//sticky comment', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + [{ + line: '/almost a comment', + tokens: [ + { startIndex: 0, type: 'operator.scala' }, + { startIndex: 1, type: 'identifier.scala' }, + { startIndex: 7, type: 'white.scala' }, + { startIndex: 8, type: 'keyword.flow.scala' }, + { startIndex: 9, type: 'white.scala' }, + { startIndex: 10, type: 'identifier.scala' } + ] + }], + + [{ + line: '1 / 2; /* comment', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'white.scala' }, + { startIndex: 2, type: 'keyword.flow.scala' }, // TODO + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'number.scala' }, + { startIndex: 5, type: 'delimiter.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'comment.scala' } + ] + }], + + [{ + line: 'val x: Int = 1; // my comment // is a nice one', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'variable.scala' }, + { startIndex: 5, type: 'operator.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'type.scala' }, + { startIndex: 10, type: 'white.scala' }, + { startIndex: 11, type: 'keyword.flow.scala' }, // TODO + { startIndex: 12, type: 'white.scala' }, + { startIndex: 13, type: 'number.scala' }, + { startIndex: 14, type: 'delimiter.scala' }, + { startIndex: 15, type: 'white.scala' }, + { startIndex: 16, type: 'comment.scala' } + ] + }], + + // Comments - range comment, single line + [{ + line: '/* a simple comment */', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + [{ + line: 'val x: Int = /* a simple comment */ 1;', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'variable.scala' }, + { startIndex: 5, type: 'operator.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'type.scala' }, + { startIndex: 10, type: 'white.scala' }, + { startIndex: 11, type: 'operator.scala' }, + { startIndex: 12, type: 'white.scala' }, + { startIndex: 13, type: 'comment.scala' }, + { startIndex: 35, type: 'white.scala' }, + { startIndex: 36, type: 'number.scala' }, + { startIndex: 37, type: 'delimiter.scala' } + ] + }], + + [{ + line: 'val x: Int = /* a simple comment */ 1; */', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'variable.scala' }, + { startIndex: 5, type: 'operator.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'type.scala' }, + { startIndex: 10, type: 'white.scala' }, + { startIndex: 11, type: 'operator.scala' }, + { startIndex: 12, type: 'white.scala' }, + { startIndex: 13, type: 'comment.scala' }, + { startIndex: 35, type: 'white.scala' }, + { startIndex: 36, type: 'number.scala' }, + { startIndex: 37, type: 'delimiter.scala' }, + { startIndex: 38, type: 'white.scala' }, + { startIndex: 39, type: 'operator.scala' }, + ] + }], + + [{ + line: 'x = /**/;', + tokens: [ + { startIndex: 0, type: 'identifier.scala' }, + { startIndex: 1, type: 'white.scala' }, + { startIndex: 2, type: 'operator.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'comment.scala' }, + { startIndex: 8, type: 'delimiter.scala' } + ] + }], + + [{ + line: 'x = /*/;', + tokens: [ + { startIndex: 0, type: 'identifier.scala' }, + { startIndex: 1, type: 'white.scala' }, + { startIndex: 2, type: 'operator.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'comment.scala' } + ] + }], + + // Comments - range comment, multiple lines + [{ + line: '/* start of multiline comment', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + [{ + line: 'val x: Int = /* start a comment', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'variable.scala' }, + { startIndex: 5, type: 'operator.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'type.scala' }, + { startIndex: 10, type: 'white.scala' }, + { startIndex: 11, type: 'operator.scala' }, + { startIndex: 12, type: 'white.scala' }, + { startIndex: 13, type: 'comment.scala' }, + ] + }, { + line: ' a ', + tokens: [ + { startIndex: 0, type: 'comment.scala' }, + ] + }, { + line: 'and end it */ 2;', + tokens: [ + { startIndex: 0, type: 'comment.scala' }, + { startIndex: 13, type: 'white.scala' }, + { startIndex: 14, type: 'number.scala' }, + { startIndex: 15, type: 'delimiter.scala' } + ] + }], + + // Scala Doc, multiple lines + [{ + line: '/** start of Scala Doc', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.scala' } + ] + }], + + // Keywords + [{ + line: 'package test; object Program { def main(args: Array[String]): Unit = {} }', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 7, type: 'white.scala' }, + { startIndex: 8, type: 'identifier.scala' }, + { startIndex: 12, type: 'delimiter.scala' }, + { startIndex: 13, type: 'white.scala' }, + { startIndex: 14, type: 'keyword.scala' }, + { startIndex: 20, type: 'white.scala' }, + { startIndex: 21, type: 'type.scala' }, + { startIndex: 28, type: 'white.scala' }, + { startIndex: 29, type: 'delimiter.curly.scala' }, + { startIndex: 30, type: 'white.scala' }, + { startIndex: 31, type: 'keyword.scala' }, + { startIndex: 34, type: 'white.scala' }, + { startIndex: 35, type: 'identifier.scala' }, + { startIndex: 39, type: 'delimiter.parenthesis.scala' }, + { startIndex: 40, type: 'variable.scala' }, + { startIndex: 44, type: 'operator.scala' }, + { startIndex: 45, type: 'white.scala' }, + { startIndex: 46, type: 'type.scala' }, + { startIndex: 51, type: 'operator.square.scala' }, + { startIndex: 52, type: 'type.scala' }, + { startIndex: 58, type: 'operator.square.scala' }, + { startIndex: 59, type: 'delimiter.parenthesis.scala' }, + { startIndex: 60, type: 'keyword.flow.scala' }, // TODO + { startIndex: 61, type: 'white.scala' }, + { startIndex: 62, type: 'type.scala' }, + { startIndex: 66, type: 'white.scala' }, + { startIndex: 67, type: 'keyword.flow.scala' }, // TODO + { startIndex: 68, type: 'white.scala' }, + { startIndex: 69, type: 'delimiter.curly.scala' }, + { startIndex: 71, type: 'white.scala' }, + { startIndex: 72, type: 'delimiter.curly.scala' } + ] + }], + + // Numbers + [{ + line: '0', + tokens: [ + { startIndex: 0, type: 'number.scala' } + ] + }], + + [{ + line: '0.10', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '0x', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'identifier.scala' } + ] + }], + + [{ + line: '0x123', + tokens: [ + { startIndex: 0, type: 'number.hex.scala' } + ] + }], + + [{ + line: '0x5_2', + tokens: [ + { startIndex: 0, type: 'number.hex.scala' } + ] + }], + + [{ + line: '10e3', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '10f', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5e3', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5e-3', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5E3', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5E-3', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5F', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5f', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5D', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23.5d', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '1.72E3D', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '1.72E3d', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '1.72E-3d', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '1.72e3D', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '1.72e3d', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '1.72e-3d', + tokens: [ + { startIndex: 0, type: 'number.float.scala' } + ] + }], + + [{ + line: '23L', + tokens: [ + { startIndex: 0, type: 'number.scala' } + ] + }], + + [{ + line: '23l', + tokens: [ + { startIndex: 0, type: 'number.scala' } + ] + }], + + [{ + line: '5_2', + tokens: [ + { startIndex: 0, type: 'number.scala' } + ] + }], + + [{ + line: '5_______2', + tokens: [ + { startIndex: 0, type: 'number.scala' } + ] + }], + + [{ + line: '3_.1415F', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'keyword.scala' }, // TODO + { startIndex: 2, type: 'delimiter.scala' }, + { startIndex: 3, type: 'number.float.scala' } + ] + }], + + [{ + line: '3._1415F', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'operator.scala' }, + { startIndex: 2, type: 'keyword.flow.scala' } // TODO + ] + }], + + [{ + line: '999_99_9999_L', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 11, type: 'identifier.scala' } + ] + }], + + [{ + line: '52_', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 2, type: 'keyword.scala' } // TODO + ] + }], + + [{ + line: '0_x52', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'identifier.scala' } + ] + }], + + [{ + line: '0x_52', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'identifier.scala' } + ] + }], + + [{ + line: '0x52_', + tokens: [ + { startIndex: 0, type: 'number.hex.scala' }, + { startIndex: 4, type: 'keyword.scala' } // TODO + ] + }], + + [{ + line: '23.5L', + tokens: [ + { startIndex: 0, type: 'number.float.scala' }, + { startIndex: 4, type: 'type.scala' } + ] + }], + + [{ + line: '0+0', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'operator.scala' }, + { startIndex: 2, type: 'number.scala' } + ] + }], + + [{ + line: '100+10', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 3, type: 'operator.scala' }, + { startIndex: 4, type: 'number.scala' } + ] + }], + + [{ + line: '0 + 0', + tokens: [ + { startIndex: 0, type: 'number.scala' }, + { startIndex: 1, type: 'white.scala' }, + { startIndex: 2, type: 'keyword.flow.scala' }, // TODO + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'number.scala' } + ] + }], + + // single line Strings + [{ + line: 'val s: String = "I\'m a Scala String";', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'variable.scala' }, + { startIndex: 5, type: 'operator.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'type.scala' }, + { startIndex: 13, type: 'white.scala' }, + { startIndex: 14, type: 'keyword.flow.scala' }, // TODO + { startIndex: 15, type: 'white.scala' }, + { startIndex: 16, type: 'string.quote.scala' }, + { startIndex: 17, type: 'string.scala' }, + { startIndex: 35, type: 'string.quote.scala' }, + { startIndex: 36, type: 'delimiter.scala' } + ] + }], + + [{ + line: 'val s: String = "concatenated" + " String" ;', + tokens: [ + { startIndex: 0, type: 'keyword.scala' }, + { startIndex: 3, type: 'white.scala' }, + { startIndex: 4, type: 'variable.scala' }, + { startIndex: 5, type: 'operator.scala' }, + { startIndex: 6, type: 'white.scala' }, + { startIndex: 7, type: 'type.scala' }, + { startIndex: 13, type: 'white.scala' }, + { startIndex: 14, type: 'keyword.flow.scala' }, // TODO + { startIndex: 15, type: 'white.scala' }, + { startIndex: 16, type: 'string.quote.scala' }, + { startIndex: 17, type: 'string.scala' }, + { startIndex: 29, type: 'string.quote.scala' }, + { startIndex: 30, type: 'white.scala' }, + { startIndex: 31, type: 'keyword.flow.scala' }, // TODO + { startIndex: 32, type: 'white.scala' }, + { startIndex: 33, type: 'string.quote.scala' }, + { startIndex: 34, type: 'string.scala' }, + { startIndex: 41, type: 'string.quote.scala' }, + { startIndex: 42, type: 'white.scala' }, + { startIndex: 43, type: 'delimiter.scala' } + ] + }], + + [{ + line: '"quote in a string"', + tokens: [ + { startIndex: 0, type: 'string.quote.scala' }, + { startIndex: 1, type: 'string.scala' }, + { startIndex: 18, type: 'string.quote.scala' } + ] + }], + + [{ + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: 'string.quote.scala' }, + { startIndex: 1, type: 'string.scala' }, + { startIndex: 10, type: 'string.escape.scala' }, + { startIndex: 12, type: 'string.scala' }, + { startIndex: 18, type: 'string.escape.scala' }, + { startIndex: 20, type: 'string.scala' }, + { startIndex: 28, type: 'string.quote.scala' }, + ] + }], + + [{ + line: '"\\"', + tokens: [ + { startIndex: 0, type: 'string.quote.scala' }, + { startIndex: 1, type: 'string.escape.scala' } + ] + }], + + // Annotations + [{ + line: '@', + tokens: [ + { startIndex: 0, type: 'operator.scala' } + ] + }], + + [{ + line: '@uncheckedStable', + tokens: [ + { startIndex: 0, type: 'annotation.scala' } + ] + }], + + [{ + line: '@silent("deprecated")', + tokens: [ + { startIndex: 0, type: 'annotation.scala' }, + { startIndex: 7, type: 'delimiter.parenthesis.scala' }, + { startIndex: 8, type: 'string.quote.scala' }, + { startIndex: 9, type: 'string.scala' }, + { startIndex: 19, type: 'string.quote.scala' }, + { startIndex: 20, type: 'delimiter.parenthesis.scala' } + ] + }], + + [{ + line: '@AnnotationWithKeywordAfter private', + tokens: [ + { startIndex: 0, type: 'annotation.scala' }, + { startIndex: 27, type: 'white.scala' }, + { startIndex: 28, type: 'keyword.modifier.scala' } + ] }] ]); diff --git a/src/scala/scala.ts b/src/scala/scala.ts index 03b87972..6b1efcdb 100644 --- a/src/scala/scala.ts +++ b/src/scala/scala.ts @@ -99,6 +99,8 @@ export const language = { // we include these common regular expressions symbols: /[=>{ [/"/, {token: 'string.quote', bracket: '@open', next: '@string'}], // numbers - [/[+\-]?(?:\d[_\d])*\.\d+[dDfFlL]?([eE][\-+]?\d+)?/, 'number.float', '@allowMethod'], - [/0[xX][0-9a-fA-F]+/, 'number.hex', '@allowMethod'], - [/[+\-]?\d[_\d]*[dDfFlL]?/, 'number', '@allowMethod'], + [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float', '@allowMethod'], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float', '@allowMethod'], + [/0[xX](@hexdigits)[Ll]?/, 'number.hex', '@allowMethod'], + [/(@digits)[fFdD]/, 'number.float', '@allowMethod'], + [/(@digits)[lL]?/, 'number', '@allowMethod'], [/\b_\*/, 'key'], [/\b(_)\b/, 'keyword', '@allowMethod'], // identifiers and keywords [/\bimport\b/, 'keyword', '@import'], - [/\b(case)([ \t]+)(class)\b/, ['tag.id.pug', 'white', 'keyword']], + [/\b(case)([ \t]+)(class)\b/, ['keyword.modifier', 'white', 'keyword']], [/\bcase\b/, 'keyword', '@case'], [/\bva[lr]\b/, 'keyword', '@vardef'], - [/\b(def[ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/, ['keyword', 'keyword.flow']], + [/\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/, ['keyword', 'white', 'identifier']], [/@name(?=[ \t]*:(?!:))/, 'variable'], [/(\.)(@name|@symbols)/, ['operator', {token: 'keyword.flow', next: '@allowMethod'}]], [/([{(])(\s*)(@name(?=\s*=>))/, ['@brackets', 'white', 'variable']], [/@name/, {cases: { '@keywords': 'keyword', '@softKeywords': 'keyword', - '@modifiers': 'tag.id.pug', - '@softModifiers': 'tag.id.pug', + '@modifiers': 'keyword.modifier', + '@softModifiers': 'keyword.modifier', '@constants': {token: 'constant', next: '@allowMethod'}, '@default': {token: 'identifier', next: '@allowMethod'} }}], @@ -157,9 +161,9 @@ export const language = { // delimiters and operators [/[{(]/, '@brackets'], [/[})]/, '@brackets', '@allowMethod'], - [/\[/, 'operator.scss'], - [/](?!\s*(?:va[rl]|def|type)\b)/, 'operator.scss', '@allowMethod'], - [/]/, 'operator.scss'], + [/\[/, 'operator.square'], + [/](?!\s*(?:va[rl]|def|type)\b)/, 'operator.square', '@allowMethod'], + [/]/, 'operator.square'], [/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},\."'`])/, 'keyword'], [/@symbols/, 'operator'], @@ -183,7 +187,7 @@ export const language = { [/\/\*/, 'comment', '@comment'], [/@name|@type/, 'type'], [/[(){}]/, '@brackets'], - [/[[\]]/, 'operator.scss'], + [/[[\]]/, 'operator.square'], [/[\.,]/, 'delimiter'], ], @@ -253,9 +257,9 @@ export const language = { [/(\$)([a-z_]\w*)/, ['operator', 'identifier']], [/\$\{/, 'operator', '@interp'], [/%%/, 'string'], - [/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ['metatag', 'tag.id.pug', 'number', 'metatag']], + [/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ['metatag', 'keyword.modifier', 'number', 'metatag']], [/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ['metatag', 'number', 'metatag']], - [/(%)([\-#+ 0,(])(@fstring_conv)/, ['metatag', 'tag.id.pug', 'metatag']], + [/(%)([\-#+ 0,(])(@fstring_conv)/, ['metatag', 'keyword.modifier', 'metatag']], [/(%)(@fstring_conv)/, ['metatag', 'metatag']], [/./, 'string'] ], @@ -268,9 +272,9 @@ export const language = { [/(\$)([a-z_]\w*)/, ['operator', 'identifier']], [/\$\{/, 'operator', '@interp'], [/%%/, 'string'], - [/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ['metatag', 'tag.id.pug', 'number', 'metatag']], + [/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ['metatag', 'keyword.modifier', 'number', 'metatag']], [/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ['metatag', 'number', 'metatag']], - [/(%)([\-#+ 0,(])(@fstring_conv)/, ['metatag', 'tag.id.pug', 'metatag']], + [/(%)([\-#+ 0,(])(@fstring_conv)/, ['metatag', 'keyword.modifier', 'metatag']], [/(%)(@fstring_conv)/, ['metatag', 'metatag']], [/./, 'string'] ], diff --git a/src/test/assert.d.ts b/src/test/assert.d.ts deleted file mode 100644 index 59fc4358..00000000 --- a/src/test/assert.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -declare module "assert" { - function internal (value: any, message?: string): void; - namespace internal { - export class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - - constructor(options?: {message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function}); - } - - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export function deepStrictEqual(actual: any, expected: any, message?: string): void; - export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; - export var throws: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export var doesNotThrow: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export function ifError(value: any): void; - } - - export = internal; -} \ No newline at end of file diff --git a/src/test/testRunner.ts b/src/test/testRunner.ts index f99a424b..d5f6fbfb 100644 --- a/src/test/testRunner.ts +++ b/src/test/testRunner.ts @@ -5,7 +5,7 @@ import '../monaco.contribution'; import {loadLanguage} from '../_.contribution'; -import * as assert from 'assert'; +import * as test from 'tape'; // Allow for running under nodejs/requirejs in tests const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); @@ -28,24 +28,23 @@ export function testTokenization(_language:string|string[], tests:ITestItem[][]) languages = _language; } let mainLanguage = languages[0]; - suite(mainLanguage + ' tokenization', () => { - test('', (done) => { - Promise.all(languages.map(l => loadLanguage(l))).then(() => { - // clean stack - setTimeout(() => { - runTests(mainLanguage, tests); - done(); - }); - }).then(null, done); - }); + + test(mainLanguage + ' tokenization', (t: test.Test) => { + Promise.all(languages.map(l => loadLanguage(l))).then(() => { + // clean stack + setTimeout(() => { + runTests(t, mainLanguage, tests); + t.end(); + }); + }).then(null, () => t.end()); }); } -function runTests(languageId:string, tests:ITestItem[][]): void { - tests.forEach((test) => runTest(languageId, test)); +function runTests(t: test.Test, languageId:string, tests:ITestItem[][]): void { + tests.forEach((test) => runTest(t, languageId, test)); } -function runTest(languageId:string, test:ITestItem[]): void { +function runTest(t: test.Test, languageId:string, test:ITestItem[]): void { let text = test.map(t => t.line).join('\n'); let actualTokens = _monaco.editor.tokenize(text, languageId); @@ -61,5 +60,5 @@ function runTest(languageId:string, test:ITestItem[]): void { }; }); - assert.deepEqual(actual, test); + t.deepEqual(actual, test); } diff --git a/src/typescript/typescript.ts b/src/typescript/typescript.ts index 0c564d0e..d88441f3 100644 --- a/src/typescript/typescript.ts +++ b/src/typescript/typescript.ts @@ -73,19 +73,17 @@ export const language = { tokenPostfix: '.ts', keywords: [ - 'abstract', 'as', 'break', 'case', 'catch', 'class', 'continue', 'const', - 'constructor', 'debugger', 'declare', 'default', 'delete', 'do', 'else', - 'enum', 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', - 'get', 'if', 'implements', 'import', 'in', 'infer', 'instanceof', 'interface', - 'is', 'keyof', 'let', 'module', 'namespace', 'never', 'new', 'null', 'package', - 'private', 'protected', 'public', 'readonly', 'require', 'global', 'return', - 'set', 'static', 'super', 'switch', 'symbol', 'this', 'throw', 'true', 'try', - 'type', 'typeof', 'unique', 'var', 'void', 'while', 'with', 'yield', 'async', - 'await', 'of' - ], - - typeKeywords: [ - 'any', 'boolean', 'number', 'object', 'string', 'undefined' + // Should match the keys of textToKeywordObj in + // https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts + 'abstract', 'any', 'as', 'asserts', 'bigint', 'boolean', 'break', 'case', 'catch', + 'class', 'continue', 'const', 'constructor', 'debugger', 'declare', 'default', + 'delete', 'do', 'else', 'enum', 'export', 'extends', 'false', 'finally', 'for', + 'from', 'function', 'get', 'if', 'implements', 'import', 'in', 'infer', + 'instanceof', 'interface', 'is', 'keyof', 'let', 'module', 'namespace', 'never', + 'new', 'null', 'number', 'object', 'package', 'private', 'protected', 'public', + 'readonly', 'require', 'global', 'return', 'set', 'static', 'string', 'super', + 'switch', 'symbol', 'this', 'throw', 'true', 'try', 'type', 'typeof', 'undefined', + 'unique', 'unknown', 'var', 'void', 'while', 'with', 'yield', 'async', 'await', 'of' ], operators: [ @@ -118,7 +116,6 @@ export const language = { // identifiers and keywords [/[a-z_$][\w$]*/, { cases: { - '@typeKeywords': 'keyword', '@keywords': 'keyword', '@default': 'identifier' } diff --git a/src/vb/vb.test.ts b/src/vb/vb.test.ts index f847a92e..8f71ac7c 100644 --- a/src/vb/vb.test.ts +++ b/src/vb/vb.test.ts @@ -289,18 +289,95 @@ testTokenization('vb', [ { startIndex: 8, type: '' }, { startIndex: 9, type: 'delimiter.vb' }, { startIndex: 10, type: '' }, - { startIndex: 11, type: 'string.vb' } + { startIndex: 11, type: 'string.quote.vb' }, + { startIndex: 12, type: 'string.vb' }, + { startIndex: 18, type: 'string.quote.vb' } ] }], [{ line: '"use strict";', tokens: [ - { startIndex: 0, type: 'string.vb' }, + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 11, type: 'string.quote.vb' }, { startIndex: 12, type: 'delimiter.vb' } ] }], + [{ + line: '"a""b"', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 2, type: 'string.escape.vb' }, + { startIndex: 4, type: 'string.vb' }, + { startIndex: 5, type: 'string.quote.vb' } + ] + }, { + line: '"a““b"', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 2, type: 'string.escape.vb' }, + { startIndex: 4, type: 'string.vb' }, + { startIndex: 5, type: 'string.quote.vb' } + ] + }, { + line: '"a””b"', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 2, type: 'string.escape.vb' }, + { startIndex: 4, type: 'string.vb' }, + { startIndex: 5, type: 'string.quote.vb' } + ] + }], + + [{ + line: '"mixed quotes 1“', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 15, type: 'string.quote.vb' } + ] + }, { + line: '"mixed quotes 2”', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 15, type: 'string.quote.vb' } + ] + }, { + line: '“mixed quotes 3"', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 15, type: 'string.quote.vb' } + ] + }, { + line: '“mixed quotes 4”', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 15, type: 'string.quote.vb' } + ] + }, { + line: '”mixed quotes 5"', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 15, type: 'string.quote.vb' } + ] + }, { + line: '”mixed quotes 6“', + tokens: [ + { startIndex: 0, type: 'string.quote.vb' }, + { startIndex: 1, type: 'string.vb' }, + { startIndex: 15, type: 'string.quote.vb' } + ] + }], + // Tags [{ line: 'Public Sub ToString()', @@ -445,12 +522,14 @@ testTokenization('vb', [ { startIndex: 5, type: '' }, { startIndex: 6, type: 'delimiter.vb' }, { startIndex: 7, type: '' }, - { startIndex: 8, type: 'string.vb' } + { startIndex: 8, type: 'string.quote.vb' }, + { startIndex: 9, type: 'string.vb' } ] }, { line: 'world"', tokens: [ { startIndex: 0, type: 'string.vb' }, + { startIndex: 5, type: 'string.quote.vb' } ] }], diff --git a/src/vb/vb.ts b/src/vb/vb.ts index 82c7e179..b738096d 100644 --- a/src/vb/vb.ts +++ b/src/vb/vb.ts @@ -124,7 +124,6 @@ export const language = { // we include these common regular expressions symbols: /[=>{ [/@symbols/, 'delimiter'], // strings - [/"/, 'string', '@string'], + [/["\u201c\u201d]/, { token: 'string.quote', next: '@string' }], ], @@ -179,10 +178,9 @@ export const language = { ], string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"C?/, 'string', '@pop'] + [/[^"\u201c\u201d]+/, 'string'], + [/["\u201c\u201d]{2}/, 'string.escape'], + [/["\u201c\u201d]C?/, { token: 'string.quote', next: '@pop' }] ], }, }; diff --git a/test/all.js b/test/all.js index 229f7b6c..30a42262 100644 --- a/test/all.js +++ b/test/all.js @@ -27,7 +27,7 @@ requirejs(['./test/setup'], function () { return; } requirejs(files.map(f => f.replace(/\.js$/, '')), function () { - run(); // We can launch the tests! + // We can launch the tests! }, function (err) { console.log(err); }) diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 6a755a82..00000000 --- a/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---delay ---ui tdd -test/all.js \ No newline at end of file