diff --git a/package-lock.json b/package-lock.json index 5e1d7eb..d571dfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,8 @@ "classnames": "2.3.1", "copy-to-clipboard": "3.3.1", "highlight.js": "11.6.0", - "highlightjs-motoko": "1.0.0", - "motoko": "^3.6.16", + "highlightjs-motoko": "1.0.3", + "motoko": "3.7.0", "pako": "2.0.4", "react": "17.0.2", "react-device-detect": "2.2.2", @@ -4123,12 +4123,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -6446,9 +6446,9 @@ } }, "node_modules/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==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -7035,9 +7035,9 @@ } }, "node_modules/highlightjs-motoko": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/highlightjs-motoko/-/highlightjs-motoko-1.0.0.tgz", - "integrity": "sha512-KiCE6g33i8RQ1ufHc+/H+iPqEJrCHRgIajwmzMrDPxB5hSrTBXuj1/O18L8kKvG9Q921923AJgiOsOA+VGSwsA==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/highlightjs-motoko/-/highlightjs-motoko-1.0.3.tgz", + "integrity": "sha512-uyBTpZDMwG0BztAc8UKNHc2VGMk1ddV0gfYtGpY97vy4igadSV10ldxEsrYROlZbtuFeZhgD9+K+BERX0BSeBQ==" }, "node_modules/hmac-drbg": { "version": "1.0.1", @@ -9184,9 +9184,9 @@ } }, "node_modules/motoko": { - "version": "3.6.16", - "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.6.16.tgz", - "integrity": "sha512-BNjeRuXrdtvz8NG8nmv7px/j60bn6jv3FGMJlR4HhXoc64xEMKSufUW2GjiV4uMPqUZ38TJ9i54kumBuwQFjQQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.7.0.tgz", + "integrity": "sha512-1+xuoRkgWDBCNBoxG0IoXx+vX79LFYM2G+0B0/fiHC5NF4wsVQb5hbA3LHrqKDJ1krepU2BJDeyzZ+mXly34fA==", "dependencies": { "cross-fetch": "3.1.5", "debug": "4.3.4", @@ -13229,16 +13229,16 @@ "dev": true }, "node_modules/ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -16177,12 +16177,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "brorand": { @@ -17935,9 +17935,9 @@ "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==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -18365,9 +18365,9 @@ "integrity": "sha512-ig1eqDzJaB0pqEvlPVIpSSyMaO92bH1N2rJpLMN/nX396wTpDA4Eq0uK+7I/2XG17pFaaKE0kjV/XPeGt7Evjw==" }, "highlightjs-motoko": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/highlightjs-motoko/-/highlightjs-motoko-1.0.0.tgz", - "integrity": "sha512-KiCE6g33i8RQ1ufHc+/H+iPqEJrCHRgIajwmzMrDPxB5hSrTBXuj1/O18L8kKvG9Q921923AJgiOsOA+VGSwsA==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/highlightjs-motoko/-/highlightjs-motoko-1.0.3.tgz", + "integrity": "sha512-uyBTpZDMwG0BztAc8UKNHc2VGMk1ddV0gfYtGpY97vy4igadSV10ldxEsrYROlZbtuFeZhgD9+K+BERX0BSeBQ==" }, "hmac-drbg": { "version": "1.0.1", @@ -19959,9 +19959,9 @@ } }, "motoko": { - "version": "3.6.16", - "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.6.16.tgz", - "integrity": "sha512-BNjeRuXrdtvz8NG8nmv7px/j60bn6jv3FGMJlR4HhXoc64xEMKSufUW2GjiV4uMPqUZ38TJ9i54kumBuwQFjQQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.7.0.tgz", + "integrity": "sha512-1+xuoRkgWDBCNBoxG0IoXx+vX79LFYM2G+0B0/fiHC5NF4wsVQb5hbA3LHrqKDJ1krepU2BJDeyzZ+mXly34fA==", "requires": { "cross-fetch": "3.1.5", "debug": "4.3.4", @@ -22796,9 +22796,9 @@ "dev": true }, "ws": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", - "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 15c111d..a837c02 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "classnames": "2.3.1", "copy-to-clipboard": "3.3.1", "highlight.js": "11.6.0", - "highlightjs-motoko": "1.0.0", - "motoko": "^3.6.16", + "highlightjs-motoko": "1.0.3", + "motoko": "3.7.0", "pako": "2.0.4", "react": "17.0.2", "react-device-detect": "2.2.2", diff --git a/src/utils/preprocessMotoko.ts b/src/utils/preprocessMotoko.ts index 374241e..c39e767 100644 --- a/src/utils/preprocessMotoko.ts +++ b/src/utils/preprocessMotoko.ts @@ -78,7 +78,7 @@ export default function preprocessMotoko(code: string): PreprocessResult { trimmedLine.endsWith('[') || ((trimmedLine.startsWith('/*') || !trimmedLine.includes('/*')) && trimmedLine.endsWith('*/')) || - /^(else|catch)([^a-zA-Z0-9_]|$)/.test(nextTrimmedLine) + /^(else|catch|finally)([^a-zA-Z0-9_]|$)/.test(nextTrimmedLine) ) ) { line += ';';