diff --git a/deno.lock b/deno.lock index e3496b3..b765bbd 100644 --- a/deno.lock +++ b/deno.lock @@ -7,11 +7,8 @@ "npm:@types/node@^22.10.1": "22.10.1", "npm:@uiw/codemirror-theme-abcdef@^4.23.6": "4.23.6", "npm:@vitest/coverage-v8@^2.1.8": "2.1.8_vitest@2.1.8__@types+node@22.10.1__vite@5.4.11___@types+node@22.10.1_@types+node@22.10.1", - "npm:eslint-plugin-react-refresh@~0.4.16": "0.4.16_eslint@9.16.0", - "npm:eslint@^9.16.0": "9.16.0", "npm:globals@^15.13.0": "15.13.0", "npm:json-stable-stringify@^1.1.1": "1.1.1", - "npm:typescript-eslint@^8.17.0": "8.17.0_eslint@9.16.0_@typescript-eslint+parser@8.17.0__eslint@9.16.0__typescript@5.7.2_typescript@5.7.2", "npm:typescript@^5.5.3": "5.7.2", "npm:vitest@^2.1.5": "2.1.8_@types+node@22.10.1_vite@5.4.11__@types+node@22.10.1" }, @@ -165,78 +162,9 @@ "@esbuild/win32-x64@0.21.5": { "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==" }, - "@eslint-community/eslint-utils@4.4.1_eslint@9.16.0": { - "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", - "dependencies": [ - "eslint", - "eslint-visitor-keys@3.4.3" - ] - }, - "@eslint-community/regexpp@4.12.1": { - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==" - }, - "@eslint/config-array@0.19.1": { - "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", - "dependencies": [ - "@eslint/object-schema", - "debug", - "minimatch@3.1.2" - ] - }, - "@eslint/core@0.9.1": { - "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", - "dependencies": [ - "@types/json-schema" - ] - }, - "@eslint/eslintrc@3.2.0": { - "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", - "dependencies": [ - "ajv", - "debug", - "espree", - "globals@14.0.0", - "ignore", - "import-fresh", - "js-yaml", - "minimatch@3.1.2", - "strip-json-comments" - ] - }, "@eslint/js@9.15.0": { "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==" }, - "@eslint/js@9.16.0": { - "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==" - }, - "@eslint/object-schema@2.1.5": { - "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==" - }, - "@eslint/plugin-kit@0.2.4": { - "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", - "dependencies": [ - "levn" - ] - }, - "@humanfs/core@0.19.1": { - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==" - }, - "@humanfs/node@0.16.6": { - "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", - "dependencies": [ - "@humanfs/core", - "@humanwhocodes/retry@0.3.1" - ] - }, - "@humanwhocodes/module-importer@1.0.1": { - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" - }, - "@humanwhocodes/retry@0.3.1": { - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==" - }, - "@humanwhocodes/retry@0.4.1": { - "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==" - }, "@isaacs/cliui@8.0.2": { "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dependencies": [ @@ -298,23 +226,6 @@ "@lezer/common" ] }, - "@nodelib/fs.scandir@2.1.5": { - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": [ - "@nodelib/fs.stat", - "run-parallel" - ] - }, - "@nodelib/fs.stat@2.0.5": { - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk@1.2.8": { - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": [ - "@nodelib/fs.scandir", - "fastq" - ] - }, "@pkgjs/parseargs@0.11.0": { "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==" }, @@ -375,9 +286,6 @@ "@types/estree@1.0.6": { "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" }, - "@types/json-schema@7.0.15": { - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" - }, "@types/json-stable-stringify@1.1.0": { "integrity": "sha512-ESTsHWB72QQq+pjUFIbEz9uSCZppD31YrVkbt2rnUciTYEvcwN6uZIhX5JZeBHqRlFJ41x/7MewCs7E2Qux6Cg==" }, @@ -387,83 +295,6 @@ "undici-types" ] }, - "@typescript-eslint/eslint-plugin@8.17.0_@typescript-eslint+parser@8.17.0__eslint@9.16.0__typescript@5.7.2_eslint@9.16.0_typescript@5.7.2": { - "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", - "dependencies": [ - "@eslint-community/regexpp", - "@typescript-eslint/parser", - "@typescript-eslint/scope-manager", - "@typescript-eslint/type-utils", - "@typescript-eslint/utils", - "@typescript-eslint/visitor-keys", - "eslint", - "graphemer", - "ignore", - "natural-compare", - "ts-api-utils" - ] - }, - "@typescript-eslint/parser@8.17.0_eslint@9.16.0_typescript@5.7.2": { - "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", - "dependencies": [ - "@typescript-eslint/scope-manager", - "@typescript-eslint/types", - "@typescript-eslint/typescript-estree", - "@typescript-eslint/visitor-keys", - "debug", - "eslint" - ] - }, - "@typescript-eslint/scope-manager@8.17.0": { - "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", - "dependencies": [ - "@typescript-eslint/types", - "@typescript-eslint/visitor-keys" - ] - }, - "@typescript-eslint/type-utils@8.17.0_eslint@9.16.0_typescript@5.7.2": { - "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", - "dependencies": [ - "@typescript-eslint/typescript-estree", - "@typescript-eslint/utils", - "debug", - "eslint", - "ts-api-utils" - ] - }, - "@typescript-eslint/types@8.17.0": { - "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==" - }, - "@typescript-eslint/typescript-estree@8.17.0_typescript@5.7.2": { - "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", - "dependencies": [ - "@typescript-eslint/types", - "@typescript-eslint/visitor-keys", - "debug", - "fast-glob", - "is-glob", - "minimatch@9.0.5", - "semver", - "ts-api-utils" - ] - }, - "@typescript-eslint/utils@8.17.0_eslint@9.16.0_typescript@5.7.2": { - "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", - "dependencies": [ - "@eslint-community/eslint-utils", - "@typescript-eslint/scope-manager", - "@typescript-eslint/types", - "@typescript-eslint/typescript-estree", - "eslint" - ] - }, - "@typescript-eslint/visitor-keys@8.17.0": { - "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", - "dependencies": [ - "@typescript-eslint/types", - "eslint-visitor-keys@4.2.0" - ] - }, "@uiw/codemirror-theme-abcdef@4.23.6": { "integrity": "sha512-0RIwTzU4E0duFQcbWfPRm0cgsYbh/F5hJQlTW8BQc+keAIHD+Xsu8BQ7CEMQ6GCReQ2q2BkAhXhd2sPjxmuNsg==", "dependencies": [ @@ -549,24 +380,6 @@ "tinyrainbow" ] }, - "acorn-jsx@5.3.2_acorn@8.14.0": { - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dependencies": [ - "acorn" - ] - }, - "acorn@8.14.0": { - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==" - }, - "ajv@6.12.6": { - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": [ - "fast-deep-equal", - "fast-json-stable-stringify", - "json-schema-traverse", - "uri-js" - ] - }, "ansi-regex@5.0.1": { "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, @@ -582,34 +395,18 @@ "ansi-styles@6.2.1": { "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" }, - "argparse@2.0.1": { - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "assertion-error@2.0.1": { "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==" }, "balanced-match@1.0.2": { "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "brace-expansion@1.1.11": { - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": [ - "balanced-match", - "concat-map" - ] - }, "brace-expansion@2.0.1": { "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dependencies": [ "balanced-match" ] }, - "braces@3.0.3": { - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dependencies": [ - "fill-range" - ] - }, "cac@6.7.14": { "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==" }, @@ -623,9 +420,6 @@ "set-function-length" ] }, - "callsites@3.1.0": { - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - }, "chai@5.1.2": { "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dependencies": [ @@ -636,13 +430,6 @@ "pathval" ] }, - "chalk@4.1.2": { - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color" - ] - }, "check-error@2.1.1": { "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==" }, @@ -655,9 +442,6 @@ "color-name@1.1.4": { "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "concat-map@0.0.1": { - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, "crelt@1.0.6": { "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" }, @@ -678,9 +462,6 @@ "deep-eql@5.0.2": { "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==" }, - "deep-is@0.1.4": { - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, "define-data-property@1.1.4": { "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dependencies": [ @@ -738,156 +519,15 @@ "@esbuild/win32-x64" ] }, - "escape-string-regexp@4.0.0": { - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" - }, - "eslint-plugin-react-refresh@0.4.16_eslint@9.16.0": { - "integrity": "sha512-slterMlxAhov/DZO8NScf6mEeMBBXodFUolijDvrtTxyezyLoTQaa73FyYus/VbTdftd8wBgBxPMRk3poleXNQ==", - "dependencies": [ - "eslint" - ] - }, - "eslint-scope@8.2.0": { - "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", - "dependencies": [ - "esrecurse", - "estraverse" - ] - }, - "eslint-visitor-keys@3.4.3": { - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" - }, - "eslint-visitor-keys@4.2.0": { - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==" - }, - "eslint@9.16.0": { - "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", - "dependencies": [ - "@eslint-community/eslint-utils", - "@eslint-community/regexpp", - "@eslint/config-array", - "@eslint/core", - "@eslint/eslintrc", - "@eslint/js@9.16.0", - "@eslint/plugin-kit", - "@humanfs/node", - "@humanwhocodes/module-importer", - "@humanwhocodes/retry@0.4.1", - "@types/estree", - "@types/json-schema", - "ajv", - "chalk", - "cross-spawn", - "debug", - "escape-string-regexp", - "eslint-scope", - "eslint-visitor-keys@4.2.0", - "espree", - "esquery", - "esutils", - "fast-deep-equal", - "file-entry-cache", - "find-up", - "glob-parent@6.0.2", - "ignore", - "imurmurhash", - "is-glob", - "json-stable-stringify-without-jsonify", - "lodash.merge", - "minimatch@3.1.2", - "natural-compare", - "optionator" - ] - }, - "espree@10.3.0_acorn@8.14.0": { - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", - "dependencies": [ - "acorn", - "acorn-jsx", - "eslint-visitor-keys@4.2.0" - ] - }, - "esquery@1.6.0": { - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dependencies": [ - "estraverse" - ] - }, - "esrecurse@4.3.0": { - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dependencies": [ - "estraverse" - ] - }, - "estraverse@5.3.0": { - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" - }, "estree-walker@3.0.3": { "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dependencies": [ "@types/estree" ] }, - "esutils@2.0.3": { - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" - }, "expect-type@1.1.0": { "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==" }, - "fast-deep-equal@3.1.3": { - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob@3.3.2": { - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dependencies": [ - "@nodelib/fs.stat", - "@nodelib/fs.walk", - "glob-parent@5.1.2", - "merge2", - "micromatch" - ] - }, - "fast-json-stable-stringify@2.1.0": { - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "fast-levenshtein@2.0.6": { - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "fastq@1.17.1": { - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dependencies": [ - "reusify" - ] - }, - "file-entry-cache@8.0.0": { - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dependencies": [ - "flat-cache" - ] - }, - "fill-range@7.1.1": { - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dependencies": [ - "to-regex-range" - ] - }, - "find-up@5.0.0": { - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": [ - "locate-path", - "path-exists" - ] - }, - "flat-cache@4.0.1": { - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dependencies": [ - "flatted", - "keyv" - ] - }, - "flatted@3.3.2": { - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==" - }, "foreground-child@3.3.0": { "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dependencies": [ @@ -911,32 +551,17 @@ "hasown" ] }, - "glob-parent@5.1.2": { - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": [ - "is-glob" - ] - }, - "glob-parent@6.0.2": { - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dependencies": [ - "is-glob" - ] - }, "glob@10.4.5": { "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dependencies": [ "foreground-child", "jackspeak", - "minimatch@9.0.5", + "minimatch", "minipass", "package-json-from-dist", "path-scurry" ] }, - "globals@14.0.0": { - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==" - }, "globals@15.13.0": { "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==" }, @@ -946,9 +571,6 @@ "get-intrinsic" ] }, - "graphemer@1.4.0": { - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" - }, "has-flag@4.0.0": { "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, @@ -973,34 +595,9 @@ "html-escaper@2.0.2": { "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==" }, - "ignore@5.3.2": { - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==" - }, - "import-fresh@3.3.0": { - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dependencies": [ - "parent-module", - "resolve-from" - ] - }, - "imurmurhash@0.1.4": { - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" - }, - "is-extglob@2.1.1": { - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, "is-fullwidth-code-point@3.0.0": { "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, - "is-glob@4.0.3": { - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": [ - "is-extglob" - ] - }, - "is-number@7.0.0": { - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, "isarray@2.0.5": { "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, @@ -1040,21 +637,6 @@ "@pkgjs/parseargs" ] }, - "js-yaml@4.1.0": { - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": [ - "argparse" - ] - }, - "json-buffer@3.0.1": { - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "json-schema-traverse@0.4.1": { - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stable-stringify-without-jsonify@1.0.1": { - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" - }, "json-stable-stringify@1.1.1": { "integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==", "dependencies": [ @@ -1067,28 +649,6 @@ "jsonify@0.0.1": { "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==" }, - "keyv@4.5.4": { - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dependencies": [ - "json-buffer" - ] - }, - "levn@0.4.1": { - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dependencies": [ - "prelude-ls", - "type-check" - ] - }, - "locate-path@6.0.0": { - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dependencies": [ - "p-locate" - ] - }, - "lodash.merge@4.6.2": { - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, "loupe@3.1.2": { "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==" }, @@ -1115,26 +675,10 @@ "semver" ] }, - "merge2@1.4.1": { - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micromatch@4.0.8": { - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dependencies": [ - "braces", - "picomatch" - ] - }, - "minimatch@3.1.2": { - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": [ - "brace-expansion@1.1.11" - ] - }, "minimatch@9.0.5": { "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dependencies": [ - "brace-expansion@2.0.1" + "brace-expansion" ] }, "minipass@7.1.2": { @@ -1146,47 +690,12 @@ "nanoid@3.3.8": { "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==" }, - "natural-compare@1.4.0": { - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" - }, "object-keys@1.1.1": { "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, - "optionator@0.9.4": { - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dependencies": [ - "deep-is", - "fast-levenshtein", - "levn", - "prelude-ls", - "type-check", - "word-wrap" - ] - }, - "p-limit@3.1.0": { - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dependencies": [ - "yocto-queue" - ] - }, - "p-locate@5.0.0": { - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dependencies": [ - "p-limit" - ] - }, "package-json-from-dist@1.0.1": { "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" }, - "parent-module@1.0.1": { - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dependencies": [ - "callsites" - ] - }, - "path-exists@4.0.0": { - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, "path-key@3.1.1": { "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, @@ -1206,9 +715,6 @@ "picocolors@1.1.1": { "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" }, - "picomatch@2.3.1": { - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, "postcss@8.4.49": { "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dependencies": [ @@ -1217,21 +723,6 @@ "source-map-js" ] }, - "prelude-ls@1.2.1": { - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" - }, - "punycode@2.3.1": { - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" - }, - "queue-microtask@1.2.3": { - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "resolve-from@4.0.0": { - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" - }, - "reusify@1.0.4": { - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, "rollup@4.28.0": { "integrity": "sha512-G9GOrmgWHBma4YfCcX8PjH0qhXSdH8B4HDE2o4/jaxj93S4DPCIDoLcXz99eWMji4hB29UFCEd7B2gwGJDR9cQ==", "dependencies": [ @@ -1257,12 +748,6 @@ "fsevents" ] }, - "run-parallel@1.2.0": { - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dependencies": [ - "queue-microtask" - ] - }, "semver@7.6.3": { "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" }, @@ -1329,9 +814,6 @@ "ansi-regex@6.1.0" ] }, - "strip-json-comments@3.1.1": { - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - }, "style-mod@4.1.2": { "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==" }, @@ -1346,7 +828,7 @@ "dependencies": [ "@istanbuljs/schema", "glob", - "minimatch@9.0.5" + "minimatch" ] }, "tinybench@2.9.0": { @@ -1364,45 +846,12 @@ "tinyspy@3.0.2": { "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==" }, - "to-regex-range@5.0.1": { - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": [ - "is-number" - ] - }, - "ts-api-utils@1.4.3_typescript@5.7.2": { - "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", - "dependencies": [ - "typescript" - ] - }, - "type-check@0.4.0": { - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dependencies": [ - "prelude-ls" - ] - }, - "typescript-eslint@8.17.0_eslint@9.16.0_@typescript-eslint+parser@8.17.0__eslint@9.16.0__typescript@5.7.2_typescript@5.7.2": { - "integrity": "sha512-409VXvFd/f1br1DCbuKNFqQpXICoTB+V51afcwG1pn1a3Cp92MqAUges3YjwEdQ0cMUoCIodjVDAYzyD8h3SYA==", - "dependencies": [ - "@typescript-eslint/eslint-plugin", - "@typescript-eslint/parser", - "@typescript-eslint/utils", - "eslint" - ] - }, "typescript@5.7.2": { "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==" }, "undici-types@6.20.0": { "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" }, - "uri-js@4.4.1": { - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": [ - "punycode" - ] - }, "vite-node@2.1.8_@types+node@22.10.1": { "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dependencies": [ @@ -1465,9 +914,6 @@ "stackback" ] }, - "word-wrap@1.2.5": { - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" - }, "wrap-ansi@7.0.0": { "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dependencies": [ @@ -1483,9 +929,6 @@ "string-width@5.1.2", "strip-ansi@7.1.0" ] - }, - "yocto-queue@0.1.0": { - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } }, "workspace": { @@ -1505,7 +948,7 @@ "npm:@vitest/coverage-v8@^2.1.8", "npm:eslint-plugin-react-hooks@^5.1.0", "npm:eslint-plugin-react-refresh@~0.4.16", - "npm:eslint@^9.16.0", + "npm:eslint@^9.17.0", "npm:globals@^15.13.0", "npm:index-to-position@1", "npm:json-stable-stringify@^1.1.1", @@ -1514,7 +957,7 @@ "npm:react-dom@19", "npm:react-router-dom@^7.0.2", "npm:react@19", - "npm:typescript-eslint@^8.17.0", + "npm:typescript-eslint@^8.18.1", "npm:typescript@^5.5.3", "npm:vite@^6.0.3", "npm:vitest@^2.1.5" diff --git a/examples/arrow-function-1.ts.md b/examples/arrow-function-1.ts.md index 51b9531..707aa40 100644 --- a/examples/arrow-function-1.ts.md +++ b/examples/arrow-function-1.ts.md @@ -13,8 +13,8 @@ const h = (x) => x((x) => f(x)); ### Output Program ```typescript -export const f_2 = (x_9) => x_9; -export const g_4 = (x_12) => f_2(x_12); -export const h_6 = (x_15) => x_15((x_18) => f_2(x_18)); +export const f_1 = (x_4) => x_4; +export const g_2 = (x_5) => f_1(x_5); +export const h_3 = (x_6) => x_6((x_7) => f_1(x_7)); ``` diff --git a/examples/arrow-function-3.ts.md b/examples/arrow-function-3.ts.md index 36c3c70..acd47bd 100644 --- a/examples/arrow-function-3.ts.md +++ b/examples/arrow-function-3.ts.md @@ -13,8 +13,8 @@ const foo = (x) => { ### Output Program ```typescript -export const foo_2 = (x_5) => { - const bar_7 = x_5(13); +export const foo_1 = (x_2) => { + const bar_3 = x_2(13); }; ``` diff --git a/examples/arrow-function-4.ts.md b/examples/arrow-function-4.ts.md index 5c1972d..c32d409 100644 --- a/examples/arrow-function-4.ts.md +++ b/examples/arrow-function-4.ts.md @@ -13,8 +13,8 @@ const foo = (x) => { ### Output Program ```typescript -export const foo_2 = (x_5) => { - x_5; +export const foo_1 = (x_2) => { + x_2; }; ``` diff --git a/examples/arrow-function-5.ts.md b/examples/arrow-function-5.ts.md index e16a9e9..6b09f1a 100644 --- a/examples/arrow-function-5.ts.md +++ b/examples/arrow-function-5.ts.md @@ -15,8 +15,8 @@ const foo = (x) => { ### Output Program ```typescript -export const foo_2 = (x_5) => { - x_5; +export const foo_1 = (x_2) => { + x_2; }; ``` diff --git a/examples/confused-parens-with-calls.ts.md b/examples/confused-parens-with-calls.ts.md index 14e42c0..5ea73b4 100644 --- a/examples/confused-parens-with-calls.ts.md +++ b/examples/confused-parens-with-calls.ts.md @@ -18,9 +18,9 @@ const foo = (x) => { ### Output Program ```typescript -export const foo_2 = (x_5) => { - x_5; - x_5; +export const foo_1 = (x_2) => { + x_2; + x_2; }; ``` diff --git a/examples/curry-1.ts.md b/examples/curry-1.ts.md index 686812e..cbc6687 100644 --- a/examples/curry-1.ts.md +++ b/examples/curry-1.ts.md @@ -16,6 +16,6 @@ using_rewrite_rules( ### Output Program ```typescript -(a_6) => (b_10) => (c_14) => (d_18) => a_6 + b_10 + c_14 + d_18; +(a_1) => (b_2) => (c_3) => (d_4) => a_1 + b_2 + c_3 + d_4; ``` diff --git a/examples/curry-2.ts.md b/examples/curry-2.ts.md index 8ac692c..52da9f5 100644 --- a/examples/curry-2.ts.md +++ b/examples/curry-2.ts.md @@ -19,6 +19,6 @@ const curried = ### Output Program ```typescript -export const curried_3 = (a_7) => (b_11) => (c_15) => (d_19) => a_7 + b_11 + c_15 + d_19; +export const curried_1 = (a_2) => (b_3) => (c_4) => (d_5) => a_2 + b_3 + c_4 + d_5; ``` diff --git a/examples/export-1.ts.md b/examples/export-1.ts.md index 7765864..1bc127b 100644 --- a/examples/export-1.ts.md +++ b/examples/export-1.ts.md @@ -12,7 +12,7 @@ x; ### Output Program ```typescript -export const x_2 = 12; -x_2; +export const x_1 = 12; +x_1; ``` diff --git a/examples/expr-dot-where.ts.md b/examples/expr-dot-where.ts.md index 627da55..aa1942e 100644 --- a/examples/expr-dot-where.ts.md +++ b/examples/expr-dot-where.ts.md @@ -20,6 +20,6 @@ console.log(x + y).where(x = 1, y = x + 2); ### Output Program ```typescript -((x_5) => ((y_9) => console.log(x_5 + y_9))(x_5 + 2))(1); +((x_1) => ((y_2) => console.log(x_1 + y_2))(x_1 + 2))(1); ``` diff --git a/examples/implicit-and-explicit-type-exports.ts.md b/examples/implicit-and-explicit-type-exports.ts.md index e4b4750..3cd21af 100644 --- a/examples/implicit-and-explicit-type-exports.ts.md +++ b/examples/implicit-and-explicit-type-exports.ts.md @@ -12,7 +12,7 @@ export type explicitly_exported_type = number; // this should stay exported in t ### Output Program ```typescript -export type not_explicitly_exported_type_2 = string; -export type explicitly_exported_type_4 = number; +export type not_explicitly_exported_type_1 = string; +export type explicitly_exported_type_2 = number; ``` diff --git a/examples/lexical-declarations-1.ts.md b/examples/lexical-declarations-1.ts.md index 25ee8aa..125e23e 100644 --- a/examples/lexical-declarations-1.ts.md +++ b/examples/lexical-declarations-1.ts.md @@ -16,13 +16,13 @@ export const x = (z) => { ### Output Program ```typescript -export type t_2 = 12; -export const y_4 = 13, - z_6: t_2 = y_4, - q_8: t_2, - r_10; -export const x_12 = (z_15) => { - const t_17 = z_15; +export type t_1 = 12; +export const y_2 = 13, + z_3: t_1 = y_2, + q_4: t_1, + r_5; +export const x_6 = (z_7) => { + const t_8 = z_7; }; ``` diff --git a/examples/macro-generating-macro-1.ts.md b/examples/macro-generating-macro-1.ts.md index cab8057..a489a9d 100644 --- a/examples/macro-generating-macro-1.ts.md +++ b/examples/macro-generating-macro-1.ts.md @@ -15,6 +15,6 @@ using_rewrite_rules( ### Output Program ```typescript -(x_5) => (x_11) => x_11 + x_5; +(x_1) => (x_2) => x_2 + x_1; ``` diff --git a/examples/macro-generating-macro-2.ts.md b/examples/macro-generating-macro-2.ts.md index 988a633..531b969 100644 --- a/examples/macro-generating-macro-2.ts.md +++ b/examples/macro-generating-macro-2.ts.md @@ -22,9 +22,9 @@ using_rewrite_rules( ### Output Program ```typescript -(x_5) => { - const using_rewrite_rules_7 = 10; - (x_13) => x_13 + x_5; +(x_1) => { + const using_rewrite_rules_2 = 10; + (x_3) => x_3 + x_1; }; ``` diff --git a/examples/macro-generating-tmp-binding-1.ts.md b/examples/macro-generating-tmp-binding-1.ts.md index 67bba4b..a8b1260 100644 --- a/examples/macro-generating-tmp-binding-1.ts.md +++ b/examples/macro-generating-tmp-binding-1.ts.md @@ -19,9 +19,9 @@ const tmp = 17; // which has nothing to do with this tmp ### Output Program ```typescript -export const x_3 = 1; -export const tmp_6 = x_3; -console.log(tmp_6); -export const tmp_8 = 17; +export const x_1 = 1; +export const tmp_2 = x_1; +console.log(tmp_2); +export const tmp_3 = 17; ``` diff --git a/examples/macro-generating-type-1.ts.md b/examples/macro-generating-type-1.ts.md index 0739f85..c9d66b0 100644 --- a/examples/macro-generating-type-1.ts.md +++ b/examples/macro-generating-type-1.ts.md @@ -17,7 +17,7 @@ type b = a; ### Output Program ```typescript -export type a_5 = string; -export type b_7 = a_5; +export type a_1 = string; +export type b_2 = a_1; ``` diff --git a/examples/not-test-1.ts.md b/examples/not-test-1.ts.md index bfa3cb8..5f38c45 100644 --- a/examples/not-test-1.ts.md +++ b/examples/not-test-1.ts.md @@ -15,6 +15,6 @@ using_rewrite_rules( ### Output Program ```typescript -1 ? !3 : (x_10) => !x_10; +1 ? !3 : (x_1) => !x_1; ``` diff --git a/examples/splice-1.ts.md b/examples/splice-1.ts.md index a649986..35aa436 100644 --- a/examples/splice-1.ts.md +++ b/examples/splice-1.ts.md @@ -16,9 +16,9 @@ const q = t + x; ### Output Program ```typescript -export const t_2 = 13; -export const x_4 = 17; -export const y_6 = x_4 + t_2; -export const q_8 = t_2 + x_4; +export const t_1 = 13; +export const x_2 = 17; +export const y_3 = x_2 + t_1; +export const q_4 = t_1 + x_2; ``` diff --git a/examples/splice-2.ts.md b/examples/splice-2.ts.md index f1e2811..f3d9236 100644 --- a/examples/splice-2.ts.md +++ b/examples/splice-2.ts.md @@ -16,9 +16,9 @@ const foo = (x) => { ### Output Program ```typescript -export const foo_2 = (x_5) => { - x_5; - x_5; +export const foo_1 = (x_2) => { + x_2; + x_2; }; ``` diff --git a/examples/test-1.ts.md b/examples/test-1.ts.md index 74361a9..9084862 100644 --- a/examples/test-1.ts.md +++ b/examples/test-1.ts.md @@ -12,7 +12,7 @@ x; ### Output Program ```typescript -export const x_2 = 12; -x_2; +export const x_1 = 12; +x_1; ``` diff --git a/examples/test-2.ts.md b/examples/test-2.ts.md index 68e2abe..07af283 100644 --- a/examples/test-2.ts.md +++ b/examples/test-2.ts.md @@ -12,7 +12,7 @@ x + x; ### Output Program ```typescript -export const x_2 = 12; -x_2 + x_2; +export const x_1 = 12; +x_1 + x_1; ``` diff --git a/examples/type-alias-1.ts.md b/examples/type-alias-1.ts.md index 5721e55..f0bf114 100644 --- a/examples/type-alias-1.ts.md +++ b/examples/type-alias-1.ts.md @@ -13,8 +13,8 @@ type q = number; ### Output Program ```typescript -export type t_2 = string; -export const t_4 = 12; -export type q_6 = number; +export type t_1 = string; +export const t_2 = 12; +export type q_3 = number; ``` diff --git a/examples/type-associativity-1.ts.md b/examples/type-associativity-1.ts.md index de0d518..db65b3f 100644 --- a/examples/type-associativity-1.ts.md +++ b/examples/type-associativity-1.ts.md @@ -12,7 +12,7 @@ const q = 12 | 13 & 14 | 15 ### Output Program ```typescript -export type q_2 = (number | (string & 17)) | 13; -export const q_4 = 12 | (13 & 14) | 15; +export type q_1 = (number | (string & 17)) | 13; +export const q_2 = 12 | (13 & 14) | 15; ``` diff --git a/examples/using-rewrite-rules-2.ts.md b/examples/using-rewrite-rules-2.ts.md index ccaeef5..4b25746 100644 --- a/examples/using-rewrite-rules-2.ts.md +++ b/examples/using-rewrite-rules-2.ts.md @@ -15,7 +15,7 @@ const x = 12; ### Output Program ```typescript -x_7 + x_7; -export const x_7 = 12; +x_1 + x_1; +export const x_1 = 12; ``` diff --git a/examples/using-rewrite-rules-3.ts.md b/examples/using-rewrite-rules-3.ts.md index 2a88269..dcd6de9 100644 --- a/examples/using-rewrite-rules-3.ts.md +++ b/examples/using-rewrite-rules-3.ts.md @@ -15,7 +15,7 @@ const x = 12; ### Output Program ```typescript -(foo_8) => x_5 + x_5; -export const x_5 = 12; +(foo_2) => x_1 + x_1; +export const x_1 = 12; ``` diff --git a/examples/using-rewrite-rules-4.ts.md b/examples/using-rewrite-rules-4.ts.md index 5591071..00d8e6e 100644 --- a/examples/using-rewrite-rules-4.ts.md +++ b/examples/using-rewrite-rules-4.ts.md @@ -16,7 +16,7 @@ const x = 12; ### Output Program ```typescript -x_6 + ((foo_9, foo_11) => foo_11 + foo_9); -export const x_6 = 12; +x_1 + ((foo_2, foo_3) => foo_3 + foo_2); +export const x_1 = 12; ``` diff --git a/src/data.ts b/src/data.ts index 7a5d3c3..ed982ed 100644 --- a/src/data.ts +++ b/src/data.ts @@ -2,11 +2,13 @@ import { preexpand_helpers } from "./preexpand-helpers"; import { import_req, lexical_extension, modular_extension } from "./stx"; import { CompilationUnit, Context, Loc } from "./syntax-structures"; +export type counters = { vars: number; internal: number }; + export type data = { loc: Loc; lexical: lexical_extension; context: Context; - counter: number; + counters: counters; unit: CompilationUnit; helpers: preexpand_helpers; imp: import_req; diff --git a/src/expander.ts b/src/expander.ts index a570a63..90e8e4f 100644 --- a/src/expander.ts +++ b/src/expander.ts @@ -27,7 +27,7 @@ import { debug, in_isolation, syntax_error } from "./stx-error"; import { array_to_ll, join_separated, llappend } from "./llhelpers"; import { gen_binding, preexpand_list_handlers } from "./preexpand-handlers"; import { preexpand_helpers } from "./preexpand-helpers"; -import { data, swalker, walker, walkerplus } from "./data"; +import { counters, data, swalker, walker, walkerplus } from "./data"; export function initial_step( ast: AST, @@ -43,14 +43,14 @@ export function initial_step( modular: modular_extension; }>, ] { - const { stx, counter, unit, rib, rib_id } = init_top_level(ast, cu_id, globals, global_macros); + const { stx, counters, unit, rib, rib_id } = init_top_level(ast, cu_id, globals, global_macros); const initial_loc: Loc = mkzipper(stx); const lexical: lexical_extension = { extensible: true, rib, rib_id }; const empty_rib: Rib = { type: "rib", normal_env: {}, types_env: {} }; const modular: modular_extension = { extensible: true, explicit: empty_rib, implicit: empty_rib }; const context: Context = {}; const imp: import_req = {}; - const data = { loc: initial_loc, unit, context, imp, counter, lexical, modular }; + const data = { loc: initial_loc, unit, context, imp, counters, lexical, modular }; return [ initial_loc, (helpers: preexpand_helpers) => @@ -196,7 +196,7 @@ const preexpand_body_curly: walker = async ({ loc, ...data }) => async function handle_core_syntax({ name, ...data }: data & { name: string }): Promise<{ loc: Loc; - counter: number; + counters: counters; unit: CompilationUnit; context: Context; lexical: lexical_extension; @@ -354,13 +354,13 @@ const preexpand_forms = case "syntax_rules_transformer": { const { clauses } = binding; return data.helpers.inspect(loc, `transformer form`, () => - apply_syntax_rules(loc, clauses, data.unit, data.counter, data.helpers).then( - ({ loc, counter }) => { + apply_syntax_rules(loc, clauses, data.unit, data.counters, data.helpers).then( + ({ loc, counters }) => { const rewrapped = data.lexical.extensible ? rewrap(loc, data.lexical.rib_id, data.unit.cu_id) : loc; return data.helpers.inspect(rewrapped, `transformer output`, () => - preexpand_forms(sort)({ loc: rewrapped, ...data, counter }), + preexpand_forms(sort)({ loc: rewrapped, ...data, counters }), ); }, ), @@ -541,15 +541,15 @@ function check_punct(loc: Loc, content: string) { } } -const expand_arrow_function: walker = ({ loc, counter, ...data }) => +const expand_arrow_function: walker = ({ loc, counters, ...data }) => go_down(loc, (loc) => { - const [rib_id, new_counter] = new_rib_id(counter); + const [rib_id, new_counters] = new_rib_id(counters); const lexical: lexical_extension = { extensible: true, rib_id, rib: { type: "rib", normal_env: {}, types_env: {} }, }; - const pgs = extract_parameters({ ...data, loc, lexical, counter: new_counter }); + const pgs = extract_parameters({ ...data, loc, lexical, counters: new_counters }); const arr = go_right(pgs.loc, itself); check_punct(arr, "=>"); const body = go_right(arr, itself); @@ -616,7 +616,7 @@ const expand_type_parameters: walker = ({ loc, ...data }) => { } }; - const pre_after_var: walker = ({ loc, lexical, counter, unit, ...data }) => { + const pre_after_var: walker = ({ loc, lexical, counters, unit, ...data }) => { assert(lexical.extensible); return go_right( loc, @@ -624,7 +624,7 @@ const expand_type_parameters: walker = ({ loc, ...data }) => { if (loc.t.content !== ",") syntax_error(loc, "expected a comma ','"); return go_right( loc, - (loc) => pre_var({ loc, lexical, counter, unit, ...data }), + (loc) => pre_var({ loc, lexical, counters, unit, ...data }), (loc) => debug(loc, "cant go past commma?"), ); }, @@ -633,7 +633,7 @@ const expand_type_parameters: walker = ({ loc, ...data }) => { post_var({ loc, lexical, - counter, + counters, unit: extend_unit(unit, lexical), ...data, }), @@ -657,15 +657,15 @@ const expand_type_parameters: walker = ({ loc, ...data }) => { } }; - const start: walker = ({ loc, counter, ...data }) => { + const start: walker = ({ loc, counters, ...data }) => { assert(loc.t.tag === "syntax_list"); - const [rib_id, new_counter] = new_rib_id(counter); + const [rib_id, new_counters] = new_rib_id(counters); const rib: Rib = { type: "rib", normal_env: {}, types_env: {} }; const lexical: lexical_extension = { extensible: true, rib_id, rib }; return go_down( loc, - (loc) => pre_var({ loc, ...data, lexical, counter: new_counter }), - (loc) => end({ loc, ...data, lexical, counter: new_counter }), + (loc) => pre_var({ loc, ...data, lexical, counters: new_counters }), + (loc) => end({ loc, ...data, lexical, counters: new_counters }), ); }; @@ -760,25 +760,25 @@ const as_keyword: STX = { src: false, }; -const insert_export_keyword: swalker = ({ loc, counter, modular, imp, ...data }) => { +const insert_export_keyword: swalker = ({ loc, counters, modular, imp, ...data }) => { if (modular.extensible) { assert(loc.t.type === "list"); const content = stx_list_content(loc.t); assert(content !== null); const fst = content[0]; if (fst.content === "export") { - return { ...data, loc, modular, imp, counter }; + return { ...data, loc, modular, imp, counters }; } else { return { ...data, loc: { type: "loc", t: { ...loc.t, content: [export_keyword, content] }, p: loc.p }, modular, imp, - counter, + counters, }; } } else { - return { ...data, loc, modular, counter, imp }; + return { ...data, loc, modular, counters, imp }; } }; @@ -1057,14 +1057,14 @@ const postexpand_body = (sort: "type" | "value") => (data: data) => { return cont({ ...data, loc: rename(loc, binding.name) }); } case "imported_lexical": { - const { imp, counter } = data; + const { imp, counters } = data; const existing = (imp[label.cuid] ?? {})[label.name]; if (existing) { return cont({ ...data, loc: rename(loc, existing.new_name) }); } else { const { name } = binding; - const new_name = `${name}_${counter}`; - const new_counter = counter + 1; + const new_name = `${name}_${counters.vars}`; + const new_counters = { ...counters, vars: counters.vars + 1 }; const new_imp: import_req = { ...imp, [label.cuid]: { @@ -1076,7 +1076,7 @@ const postexpand_body = (sort: "type" | "value") => (data: data) => { ...data, loc: rename(loc, new_name), imp: new_imp, - counter: new_counter, + counters: new_counters, }); } } diff --git a/src/preexpand-handlers.ts b/src/preexpand-handlers.ts index 1d066bd..b061ea3 100644 --- a/src/preexpand-handlers.ts +++ b/src/preexpand-handlers.ts @@ -1,5 +1,5 @@ import { assert } from "./assert"; -import { data, walker } from "./data"; +import { counters, data, walker } from "./data"; import { imported_module } from "./preexpand-helpers"; import { extend_context_lexical, @@ -32,21 +32,21 @@ function skip_required(loc: Loc, kwd_options: string[]): Loc { export function gen_binding({ loc, lexical, - counter, + counters, context, unit, sort, }: { loc: Loc; lexical: lexical_extension; - counter: number; + counters: counters; context: Context; unit: CompilationUnit; sort: "type" | "value"; }): { name: string; lexical: lexical_extension; - counter: number; + counters: counters; context: Context; unit: CompilationUnit; } { @@ -61,19 +61,19 @@ export function gen_binding({ cuid, stx.content, stx.wrap.marks, - counter, + counters, env_type, - ({ rib, counter, label }) => + ({ rib, counters, label }) => extend_context_lexical( context, - counter, + counters, label.name, { type: "type" as const, value: "lexical" as const }[sort], stx.content, - ({ context, counter, name }) => ({ + ({ context, counters, name }) => ({ lexical: { extensible: true, rib, rib_id }, context, - counter, + counters, name, unit, }), @@ -82,27 +82,27 @@ export function gen_binding({ ); } -const lexical_declaration: walker = ({ loc, lexical, context, counter, unit, ...data }) => { - const after_vars: walker = async ({ loc, lexical, context, counter, unit, ...data }) => { +const lexical_declaration: walker = ({ loc, lexical, context, counters, unit, ...data }) => { + const after_vars: walker = async ({ loc, lexical, context, counters, unit, ...data }) => { if (loc.t.type === "atom" && loc.t.tag === "other") { switch (loc.t.content) { case ";": return go_right( loc, (loc) => syntax_error(loc, "expected nothing after semicolon"), - (loc) => ({ loc, lexical, context, counter, unit, ...data }), + (loc) => ({ loc, lexical, context, counters, unit, ...data }), ); case ",": return go_right( loc, - (loc) => get_vars(loc, lexical, context, counter), + (loc) => get_vars(loc, lexical, context, counters), (loc) => syntax_error(loc, "expected variable after ','"), ); } } syntax_error(loc, "expected a ',' or a ';'"); }; - function get_vars(ls: Loc, lexical: lexical_extension, context: Context, counter: number) { + function get_vars(ls: Loc, lexical: lexical_extension, context: Context, counters: counters) { if (ls.t.type === "list" && ls.t.tag === "variable_declarator") { return go_down( ls, @@ -110,7 +110,7 @@ const lexical_declaration: walker = ({ loc, lexical, context, counter, unit, ... const goodies = gen_binding({ loc, lexical, - counter, + counters, context, unit, sort: "value", @@ -134,7 +134,7 @@ const lexical_declaration: walker = ({ loc, lexical, context, counter, unit, ... skip_required(skip_optional(loc, "export"), ["let", "const"]), lexical, context, - counter, + counters, ), syntax_error, ); @@ -175,7 +175,7 @@ const import_declaration: walker = async ({ loc, helpers, ...data }) => { const name = loc0.t.content; const wrap = loc0.t.wrap; const resolutions = await mod.resolve_exported_identifier(name, loc0); - const { loc, counter, unit, context, lexical } = await go_right( + const { loc, counters, unit, context, lexical } = await go_right( loc0, (loc) => after_var(loc, mod), syntax_error, @@ -195,7 +195,7 @@ const import_declaration: walker = async ({ loc, helpers, ...data }) => { }, rib); const new_lexical: lexical_extension = { extensible: true, rib: new_rib, rib_id }; const new_unit = extend_unit(unit, new_lexical); - return { loc, ...data, counter, unit: new_unit, context, lexical: new_lexical, helpers }; + return { loc, ...data, counters, unit: new_unit, context, lexical: new_lexical, helpers }; } default: syntax_error(loc, `unexpected ${loc.t.tag} in import context`); diff --git a/src/stx.ts b/src/stx.ts index 0e3c558..94782eb 100644 --- a/src/stx.ts +++ b/src/stx.ts @@ -10,6 +10,7 @@ import { Label, Loc, Marks, + new_label_id, new_rib_id, Rib, shift, @@ -21,6 +22,7 @@ import { import { globals_cuid, init_global_unit } from "./global-module"; import { syntax_error } from "./stx-error"; import { preexpand_helpers } from "./preexpand-helpers"; +import { counters } from "./data"; function is_top_marked(wrap: Wrap): boolean { function loop_marks(marks: Marks): boolean { @@ -176,9 +178,9 @@ export function extend_rib( cuid: string, name: string, marks: Marks, - counter: number, + counters: counters, env_type: "normal_env" | "types_env", - sk: (args: { rib: Rib; counter: number; label: Label }) => S, + sk: (args: { rib: Rib; counters: counters; label: Label }) => S, fk: (reason: string) => S, ): S { const env = rib[env_type]; @@ -186,10 +188,10 @@ export function extend_rib( if (entry.find((x) => same_marks(x[0], marks))) { return fk(`${name} is already defined in ${env_type}`); } - const label: Label = { cuid, name: `l${counter}` }; - const new_counter = counter + 1; + const [label_name, new_counters] = new_label_id(counters); + const label: Label = { cuid, name: label_name }; const new_rib = rib_push_no_check(rib, name, marks, label, env_type); - return sk({ rib: new_rib, counter: new_counter, label }); + return sk({ rib: new_rib, counters: new_counters, label }); } export function extend_context(context: Context, label: string, binding: Binding): Context { @@ -198,19 +200,19 @@ export function extend_context(context: Context, label: string, binding: Binding export function extend_context_lexical( context: Context, - counter: number, + counters: counters, label: string, binding_type: "lexical" | "type", original_name: string, - k: (args: { context: Context; name: string; counter: number }) => S, + k: (args: { context: Context; name: string; counters: counters }) => S, ): S { - const new_name = `${original_name}_${counter}`; - const new_counter = counter + 1; + const new_name = `${original_name}_${counters.vars}`; + const new_counters = { ...counters, vars: counters.vars + 1 }; const new_context: Context = { ...context, [label]: { type: binding_type, name: new_name }, }; - return k({ context: new_context, name: new_name, counter: new_counter }); + return k({ context: new_context, name: new_name, counters: new_counters }); } function llcancel(ls1: [X, LL], ls2: [X, LL]): LL { @@ -289,19 +291,20 @@ export function init_top_level( global_macros: string[], ): { stx: STX; - counter: number; + counters: counters; unit: CompilationUnit; rib: Rib; rib_id: string; } { - const [rib_id, counter] = new_rib_id(0); + const initial_counters: counters = { internal: 0, vars: 1 }; + const [rib_id, counters] = new_rib_id(initial_counters); const { top_wrap, rib, unit } = init_global_unit(cuid, rib_id, globals, global_macros); function wrap(ast: AST): STX { return { ...ast, wrap: top_wrap, src: ast }; } return { stx: wrap(ast), - counter, + counters, unit, rib, rib_id, diff --git a/src/syntax-core-patterns.ts b/src/syntax-core-patterns.ts index 69cb207..dc8106f 100644 --- a/src/syntax-core-patterns.ts +++ b/src/syntax-core-patterns.ts @@ -24,7 +24,7 @@ import { } from "./syntax-structures"; import { go_next, go_down, mkzipper, stx_list_content, go_up, change } from "./zipper"; import { preexpand_helpers } from "./preexpand-helpers"; -import { walker } from "./data"; +import { counters, walker } from "./data"; const zipper_find: (loc: Loc, pred: (x: STX) => boolean) => Loc | null = (loc, pred) => { const t = loc.t; @@ -252,7 +252,7 @@ export const core_pattern_match: ( return unification; }; -const splice: walker = async ({ loc, context, unit, counter, lexical, helpers, ...data }) => { +const splice: walker = async ({ loc, context, unit, lexical, helpers, ...data }) => { const unification = await core_pattern_match(loc, unit, "splice", helpers); assert(unification !== null); const { subst } = unification; @@ -268,7 +268,6 @@ const splice: walker = async ({ loc, context, unit, counter, lexical, helpers, . }; return { loc: change(unification.loc, mkzipper(result)), - counter, unit, context, lexical, @@ -348,7 +347,7 @@ const using_rewrite_rules: walker = async ({ loc: orig_loc, context: orig_context, unit: orig_unit, - counter: orig_counter, + counters: orig_counters, lexical: orig_lexical, helpers, ...data @@ -372,15 +371,15 @@ const using_rewrite_rules: walker = async ({ .map((x) => parse_syntax_rules_clause(x, loc)), (x, y) => bound_id_equal(x, y), ); - const [rib_id, new_counter] = new_rib_id(orig_counter); + const [rib_id, new_counters] = new_rib_id(orig_counters); const cuid = orig_unit.cu_id; const do_wrap = push_wrap({ marks: null, subst: [{ rib_id, cu_id: cuid }, null], aes: null, }); - const [new_rib, final_counter, final_context] = clauses.reduce( - (ac: [Rib, number, Context], [lhs, rhs]) => { + const [new_rib, final_counters, final_context] = clauses.reduce( + (ac: [Rib, counters, Context], [lhs, rhs]) => { assert(lhs.type === "atom" && lhs.wrap !== undefined); return extend_rib( ac[0], @@ -389,9 +388,9 @@ const using_rewrite_rules: walker = async ({ lhs.wrap.marks, ac[1], "normal_env", - ({ rib, counter, label }) => [ + ({ rib, counters, label }) => [ rib, - counter, + counters, extend_context(ac[2], label.name, { type: "syntax_rules_transformer", clauses: rhs.map(({ pattern, template }) => ({ @@ -405,13 +404,13 @@ const using_rewrite_rules: walker = async ({ }, ); }, - [{ type: "rib", normal_env: {}, types_env: {} }, new_counter, orig_context], + [{ type: "rib", normal_env: {}, types_env: {} }, new_counters, orig_context], ); const final_unit = extend_unit(orig_unit, { extensible: true, rib_id, rib: new_rib }); const final_loc = change(loc, mkzipper(do_wrap(expression))); return { loc: final_loc, - counter: final_counter, + counters: final_counters, unit: final_unit, context: final_context, lexical: orig_lexical, @@ -469,9 +468,9 @@ export async function apply_syntax_rules( orig_loc: Loc, clauses: syntax_rules_clause[], unit: CompilationUnit, - orig_counter: number, + orig_counters: counters, helpers: preexpand_helpers, -): Promise<{ loc: Loc; counter: number }> { +): Promise<{ loc: Loc; counters: counters }> { const do_antimark = push_wrap({ marks: [antimark, null], subst: [shift, null], @@ -483,17 +482,17 @@ export async function apply_syntax_rules( if (expressionls === null) syntax_error(loc, "splicing error of empty slice"); if (expressionls[1] !== null) syntax_error(loc, "splicing error of more than one thing"); const expression = expressionls[0]; - const [mark, new_counter] = new_mark(orig_counter); + const [mark, new_counters] = new_mark(orig_counters); const do_mark = push_wrap({ marks: [mark, null], subst: [shift, null], aes: [loc.t, null] }); const new_loc = change(loc, mkzipper(do_mark(expression))); - return { loc: new_loc, counter: new_counter }; + return { loc: new_loc, counters: new_counters }; } const define_rewrite_rules: walker = async ({ loc: orig_loc, context: orig_context, unit: orig_unit, - counter: orig_counter, + counters: orig_counters, lexical: orig_lexical, helpers, ...data @@ -517,8 +516,8 @@ const define_rewrite_rules: walker = async ({ (x, y) => bound_id_equal(x, y), ); const cuid = orig_unit.cu_id; - const [final_rib, final_counter, final_context] = clauses.reduce( - (ac: [Rib, number, Context], [lhs, rhs]) => { + const [final_rib, final_counters, final_context] = clauses.reduce( + (ac: [Rib, counters, Context], [lhs, rhs]) => { assert(lhs.type === "atom" && lhs.wrap !== undefined); return extend_rib( ac[0], @@ -527,9 +526,9 @@ const define_rewrite_rules: walker = async ({ lhs.wrap.marks, ac[1], "normal_env", - ({ rib, counter, label }) => [ + ({ rib, counters, label }) => [ rib, - counter, + counters, extend_context(ac[2], label.name, { type: "syntax_rules_transformer", clauses: rhs, @@ -538,7 +537,7 @@ const define_rewrite_rules: walker = async ({ (reason) => syntax_error(loc, reason), ); }, - [orig_lexical.rib, orig_counter, orig_context], + [orig_lexical.rib, orig_counters, orig_context], ); const lexical: lexical_extension = { extensible: true, @@ -558,7 +557,7 @@ const define_rewrite_rules: walker = async ({ ); return { loc: final_loc, - counter: final_counter, + counters: final_counters, unit: final_unit, context: final_context, lexical, diff --git a/src/syntax-structures.ts b/src/syntax-structures.ts index 41a9329..7984234 100644 --- a/src/syntax-structures.ts +++ b/src/syntax-structures.ts @@ -2,6 +2,7 @@ import { TaggedReconstructiveZipper } from "zipper"; import { AST } from "./ast"; import { atom_tag, list_tag } from "./tags"; import { LL } from "./llhelpers"; +import { counters } from "./data"; export type TopMark = "top"; @@ -42,10 +43,15 @@ export type Env = { [name: string]: [LL, Label][] }; export type Rib = { type: "rib"; types_env: Env; normal_env: Env }; -function label_generator(prefix: string): (counter: number) => [string, number] { - return (counter: number) => [`${prefix}${counter}`, counter + 1]; +function label_generator(prefix: string): (counters: counters) => [string, counters] { + return (counters: counters) => [ + `${prefix}${counters.internal}`, + { ...counters, internal: counters.internal + 1 }, + ]; } +export const new_label_id = label_generator("l"); + export const new_rib_id = label_generator("r"); export const new_mark = label_generator("m"); diff --git a/test-project/.rts/main.rts.ts b/test-project/.rts/main.rts.ts index 645d00b..cc6feb2 100644 --- a/test-project/.rts/main.rts.ts +++ b/test-project/.rts/main.rts.ts @@ -1,2 +1,2 @@ -import { x_2 as x_2_1 } from "./mod.rts.ts"; -console.log(x_2_1); +import { x_1 as x_1_1 } from "./mod.rts.ts"; +console.log(x_1_1); diff --git a/test-project/.rts/mod.rts.json b/test-project/.rts/mod.rts.json index 9ac5014..cb94af2 100644 --- a/test-project/.rts/mod.rts.json +++ b/test-project/.rts/mod.rts.json @@ -12,5 +12,5 @@ } ] }, - "context": {"l1": {"type": "lexical", "name": "x_2"}} + "context": {"l1": {"type": "lexical", "name": "x_1"}} } \ No newline at end of file diff --git a/test-project/.rts/mod.rts.ts b/test-project/.rts/mod.rts.ts index 5dad570..fffe005 100644 --- a/test-project/.rts/mod.rts.ts +++ b/test-project/.rts/mod.rts.ts @@ -1 +1 @@ -export const x_2 = 12; +export const x_1 = 12; diff --git a/test-project/mod.rts.ts b/test-project/mod.rts.ts index 3940d31..bee7632 100644 --- a/test-project/mod.rts.ts +++ b/test-project/mod.rts.ts @@ -1,3 +1,3 @@ /* This is an automatically generated file. Do not edit. */ -import { x_2 } from "./.rts/mod.rts.ts"; -export { x_2 as x }; +import { x_1 } from "./.rts/mod.rts.ts"; +export { x_1 as x };