From 2446384ef8b9ef08394cb60e088f9234059bce58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:55:46 +0400 Subject: [PATCH 01/29] chore(deps-dev): bump @types/node from 22.10.1 to 22.10.2 (#1194) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.10.1 to 22.10.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7c8ef6ed6..56875c922 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1454,9 +1454,9 @@ integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== "@types/node@*", "@types/node@>=13.7.0", "@types/node@^22.5.0": - version "22.10.1" - resolved "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" - integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== + version "22.10.2" + resolved "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz#a485426e6d1fdafc7b0d4c7b24e2c78182ddabb9" + integrity sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ== dependencies: undici-types "~6.20.0" From c06b055f7190abcf848e39d7eae93a6adf8cf8c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:57:11 +0400 Subject: [PATCH 02/29] chore(deps-dev): bump knip from 5.39.2 to 5.41.0 (#1193) Bumps [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) from 5.39.2 to 5.41.0. - [Release notes](https://github.com/webpro-nl/knip/releases) - [Changelog](https://github.com/webpro-nl/knip/blob/main/packages/knip/.release-it.json) - [Commits](https://github.com/webpro-nl/knip/commits/5.41.0/packages/knip) --- updated-dependencies: - dependency-name: knip dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 56875c922..9780c5d34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4008,9 +4008,9 @@ kleur@^3.0.3: integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== knip@^5.24.1: - version "5.39.2" - resolved "https://registry.npmjs.org/knip/-/knip-5.39.2.tgz#1faacd8d8ef36b509b2f6e396cce85b645abb04e" - integrity sha512-BuvuWRllLWV/r2G4m9ggNH+DZ6gouP/dhtJPXVlMbWNF++w9/EfrF6k2g7YBKCwjzCC+PXmYtpH8S2t8RjnY4Q== + version "5.41.0" + resolved "https://registry.npmjs.org/knip/-/knip-5.41.0.tgz#c186d27df55d10fe38ce69ed66fcb0c7a44bae1a" + integrity sha512-W8omBs+jhC/P/A3kC0xdEGrhYVmsmWafUVz0wzQjYfoaK0YNEBPPLptUeqwQl6ihYVqzb/X0zs50gY9Akw1Bww== dependencies: "@nodelib/fs.walk" "1.2.8" "@snyk/github-codeowners" "1.1.0" From a29bbdecdf29ba7ad550b3d3e517589c5f4ed29b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:57:53 +0400 Subject: [PATCH 03/29] chore(deps-dev): bump cspell from 8.16.1 to 8.17.1 (#1192) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.16.1 to 8.17.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.17.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 301 +++++++++++++++++++++++++++--------------------------- 1 file changed, 151 insertions(+), 150 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9780c5d34..ec5bb19cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -308,16 +308,16 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspell/cspell-bundled-dicts@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.16.1.tgz#57d872bca1ff67a232bfefb1062cb92381686bc6" - integrity sha512-EkbtoYpmiN9YPfcOoPcMnIrJBZh13mun64jPyyaYhrPPToiU5+CisZ7ZKUBGnqNaatuciMUxwIudhanQJ7Yhnw== +"@cspell/cspell-bundled-dicts@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.1.tgz#61adad73f1bb1e12b182ffa04423d6052b18f0fc" + integrity sha512-HmkXS5uX4bk/XxsRS4Q+zRvhgRa81ddGiR2/Xfag9MIi5L5UnEJ4g21EpmIlXkMxYrTu2fp69SZFss5NfcFF9Q== dependencies: "@cspell/dict-ada" "^4.0.5" "@cspell/dict-al" "^1.0.3" "@cspell/dict-aws" "^4.0.7" "@cspell/dict-bash" "^4.1.8" - "@cspell/dict-companies" "^3.1.7" + "@cspell/dict-companies" "^3.1.8" "@cspell/dict-cpp" "^6.0.2" "@cspell/dict-cryptocurrencies" "^5.0.3" "@cspell/dict-csharp" "^4.0.5" @@ -330,12 +330,12 @@ "@cspell/dict-en-common-misspellings" "^2.0.7" "@cspell/dict-en-gb" "1.1.33" "@cspell/dict-en_us" "^4.3.28" - "@cspell/dict-filetypes" "^3.0.8" + "@cspell/dict-filetypes" "^3.0.9" "@cspell/dict-flutter" "^1.0.3" "@cspell/dict-fonts" "^4.0.3" "@cspell/dict-fsharp" "^1.0.4" "@cspell/dict-fullstack" "^3.2.3" - "@cspell/dict-gaming-terms" "^1.0.8" + "@cspell/dict-gaming-terms" "^1.0.9" "@cspell/dict-git" "^3.0.3" "@cspell/dict-golang" "^6.0.17" "@cspell/dict-google" "^1.0.4" @@ -352,16 +352,16 @@ "@cspell/dict-markdown" "^2.0.7" "@cspell/dict-monkeyc" "^1.0.9" "@cspell/dict-node" "^5.0.5" - "@cspell/dict-npm" "^5.1.14" + "@cspell/dict-npm" "^5.1.17" "@cspell/dict-php" "^4.0.13" "@cspell/dict-powershell" "^5.0.13" "@cspell/dict-public-licenses" "^2.0.11" - "@cspell/dict-python" "^4.2.12" + "@cspell/dict-python" "^4.2.13" "@cspell/dict-r" "^2.0.4" "@cspell/dict-ruby" "^5.0.7" "@cspell/dict-rust" "^4.0.10" "@cspell/dict-scala" "^5.0.6" - "@cspell/dict-software-terms" "^4.1.17" + "@cspell/dict-software-terms" "^4.1.19" "@cspell/dict-sql" "^2.1.8" "@cspell/dict-svelte" "^1.0.5" "@cspell/dict-swift" "^2.0.4" @@ -369,34 +369,34 @@ "@cspell/dict-typescript" "^3.1.11" "@cspell/dict-vue" "^3.0.3" -"@cspell/cspell-json-reporter@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.16.1.tgz#1c0708e2dd365fb2713fd892681ff02dbd783f38" - integrity sha512-ue1paJ2OE2BjIBQHXFMHnFqJL5xMrE/TLveOntDSCKJw7edCGP4XJA6Q0ZfUgR/ZAP3SYKNPkajEWbDTMfG+XA== +"@cspell/cspell-json-reporter@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.1.tgz#c1678665f183589e5fc19a1c0933b8d362165a43" + integrity sha512-EV9Xkh42Xw3aORvDZfxusICX91DDbqQpYdGKBdPGuhgxWOUYYZKpLXsHCmDkhruMPo2m5gDh++/OqjLRPZofKQ== dependencies: - "@cspell/cspell-types" "8.16.1" + "@cspell/cspell-types" "8.17.1" -"@cspell/cspell-pipe@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.16.1.tgz#e65836b145daff287c3c8d26448768209976881e" - integrity sha512-6N+QZ3y65JRgGrQhZHmaBHESR+nC0J8nySGaYKclit8yk3jLZ/ORw9aoSGIj+dMPzImkNEDh+C1B1zdV4X8W6A== +"@cspell/cspell-pipe@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.1.tgz#c247d4bd1c8ec43c49c46dc4458f00489e98232b" + integrity sha512-uhC99Ox+OH3COSgShv4fpVHiotR70dNvAOSkzRvKVRzV6IGyFnxHjmyVVPEV0dsqzVLxltwYTqFhwI+UOwm45A== -"@cspell/cspell-resolver@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.16.1.tgz#26f5091974f8db2cfa1f8198dad47515dbd35b32" - integrity sha512-CfVI2JFMwh9/n1QuU9niEONbYCX1XGKqmyCcHQUzAapSqGzbAmFrRFnvyKwNL+mmy1bxli9EZV8f5vBco26f9Q== +"@cspell/cspell-resolver@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.1.tgz#6377c9c8c05c940fee675c74e31f893b7b2f38ab" + integrity sha512-XEK2ymTdQNgsV3ny60VkKzWskbICl4zNXh/DbxsoRXHqIRg43MXFpTNkEJ7j873EqdX7BU4opQQ+5D4stWWuhQ== dependencies: global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.16.1.tgz#1a50df316faf73ae66c263416312e7404e1f2d7f" - integrity sha512-URaralJKcdHZH/Lr25L28GJo2Ub07adHPPhOL83BvmPyGkboehmz5arjNrgQFwS+IvGjHLdp5uzEJd0xyeHGdw== +"@cspell/cspell-service-bus@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.1.tgz#8d6d82ea3ab0fc9d7efed8523b070e4842780bd1" + integrity sha512-2sFWQtMEWZ4tdz7bw0bAx4NaV1t0ynGfjpuKWdQppsJFKNb+ZPZZ6Ah1dC13AdRRMZaG194kDRFwzNvRaCgWkQ== -"@cspell/cspell-types@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.16.1.tgz#ca49ea46f1141172333fb3b5fb1d30ca1557a690" - integrity sha512-B8bHlBaDSMDMEq++H8qO9osKUkzWUrP4CgWQyRqlXZ9EOdnJ469Tp1wghcQ7DezII3aXYrHiVKsUYY9VvjkhIg== +"@cspell/cspell-types@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.1.tgz#5512030b4c2e7881a8822ab3afabbd4f5ddffb6f" + integrity sha512-NJbov7Jp57fh8addoxesjb8atg/APQfssCH5Q9uZuHBN06wEJDgs7fhfE48bU+RBViC9gltblsYZzZZQKzHYKg== "@cspell/dict-ada@^4.0.5": version "4.0.5" @@ -418,10 +418,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.8.tgz#26dc898e06eddea069cf1ad475ee0e867c89e632" integrity sha512-I2CM2pTNthQwW069lKcrVxchJGMVQBzru2ygsHCwgidXRnJL/NTjAPOFTxN58Jc1bf7THWghfEDyKX/oyfc0yg== -"@cspell/dict-companies@^3.1.7": - version "3.1.7" - resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.7.tgz#c9abd6f5293f103062f54dde01f2bee939189f79" - integrity sha512-ncVs/efuAkP1/tLDhWbXukBjgZ5xOUfe03neHMWsE8zvXXc5+Lw6TX5jaJXZLOoES/f4j4AhRE20jsPCF5pm+A== +"@cspell/dict-companies@^3.1.8": + version "3.1.9" + resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.9.tgz#c3ae263ac6b4bdee8bd836441e665c397030abfb" + integrity sha512-w7XEJ2B6x2jq9ws5XNyYgpYj2MxdZ3jW3PETLxjK7nc8pulCFmaGVgZ0JTnDWfJ3QMOczoagn5f9LM2PZ/CuJg== "@cspell/dict-cpp@^6.0.2": version "6.0.2" @@ -488,10 +488,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.28.tgz#41169e1ed18465e7ff367a4f4488d4cbc6cf0baa" integrity sha512-BN1PME7cOl7DXRQJ92pEd1f0Xk5sqjcDfThDGkKcsgwbSOY7KnTc/czBW6Pr3WXIchIm6cT12KEfjNqx7U7Rrw== -"@cspell/dict-filetypes@^3.0.8": - version "3.0.8" - resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.8.tgz#016d523ca2c34dea972ea0ca931255868348d81a" - integrity sha512-D3N8sm/iptzfVwsib/jvpX+K/++rM8SRpLDFUaM4jxm8EyGmSIYRbKZvdIv5BkAWmMlTWoRqlLn7Yb1b11jKJg== +"@cspell/dict-filetypes@^3.0.9": + version "3.0.9" + resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.9.tgz#f4d5c35c341e6c3b77c08aec00678412641e1504" + integrity sha512-U7ycC1cE32A5aEgwzp/iE0TVabonUFnVt+Ygbf6NsIWqEuFWZgZChC7gfztA4T1fpuj602nFdp7eOnTWKORsnQ== "@cspell/dict-flutter@^1.0.3": version "1.0.3" @@ -513,10 +513,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.3.tgz#f6fff74eff00c6759cba510168acada0619004cc" integrity sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg== -"@cspell/dict-gaming-terms@^1.0.8": - version "1.0.8" - resolved "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.8.tgz#fb8a737f61e7cf560b4de7b2aaeae952f2550398" - integrity sha512-7OL0zTl93WFWhhtpXFrtm9uZXItC3ncAs8d0iQDMMFVNU1rBr6raBNxJskxE5wx2Ant12fgI66ZGVagXfN+yfA== +"@cspell/dict-gaming-terms@^1.0.9": + version "1.0.9" + resolved "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.9.tgz#6b920386d281b89f70857e6dacea10ab89e88658" + integrity sha512-AVIrZt3YiUnxsUzzGYTZ1XqgtkgwGEO0LWIlEf+SiDUEVLtv4CYmmyXFQ+WXDN0pyJ0wOwDazWrP0Cu7avYQmQ== "@cspell/dict-git@^3.0.3": version "3.0.3" @@ -598,10 +598,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.5.tgz#11653612ebdd833208432e8b3cbe61bd6dd35dc3" integrity sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA== -"@cspell/dict-npm@^5.1.14": - version "5.1.15" - resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.15.tgz#a27ae760c196e1da5bcbe2ca436a3ad6a4d8d7a3" - integrity sha512-95D3A8rs9SYlUQUkK48J0F1W3jOsc63dY/vlzuNHE4nuGU2OM4jtoWvLk0ovhBMHwZikaNNTHaHoJyr+VKu+Yg== +"@cspell/dict-npm@^5.1.17": + version "5.1.18" + resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.18.tgz#5f748f24a96cae46a1c601da01e1d2fc3ccdb0c7" + integrity sha512-/Nukl+DSxtEWSlb8svWFSpJVctAsM9SP+f5Q1n+qdDcXNKMb1bUCo/d3QZPwyOhuMjDawnsGBUAfp+iq7Mw83Q== "@cspell/dict-php@^4.0.13": version "4.0.13" @@ -618,10 +618,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.11.tgz#37550c4e0cd445991caba528bf4ba58ce7a935c3" integrity sha512-rR5KjRUSnVKdfs5G+gJ4oIvQvm8+NJ6cHWY2N+GE69/FSGWDOPHxulCzeGnQU/c6WWZMSimG9o49i9r//lUQyA== -"@cspell/dict-python@^4.2.12": - version "4.2.12" - resolved "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.12.tgz#ea6298bb72a6bcf2c188d5c55142e0afab8a6c1c" - integrity sha512-U25eOFu+RE0aEcF2AsxZmq3Lic7y9zspJ9SzjrC0mfJz+yr3YmSCw4E0blMD3mZoNcf7H/vMshuKIY5AY36U+Q== +"@cspell/dict-python@^4.2.13": + version "4.2.13" + resolved "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.13.tgz#c3dbaa7e2434c835e11540345e2168e5e685190a" + integrity sha512-mZIcmo9qif8LkJ6N/lqTZawcOk2kVTcuWIUOSbMcjyomO0XZ7iWz15TfONyr03Ea/l7o5ULV+MZ4vx76bAUb7w== dependencies: "@cspell/dict-data-science" "^2.0.5" @@ -645,10 +645,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.6.tgz#5e925def2fe6dc27ee2ad1c452941c3d6790fb6d" integrity sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww== -"@cspell/dict-software-terms@^4.1.17": - version "4.1.18" - resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.18.tgz#99acefeef7deb0ae109e2a6dd73469274384a1c4" - integrity sha512-QhOQ3qVFr2Y+uDw2SH15klVNU2S07ecFhG+2gpTO/K4Kuaui3INbVrzHOKW41ofP3ghv9y2TkUUtOP5KfddP8A== +"@cspell/dict-software-terms@^4.1.19": + version "4.1.20" + resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.20.tgz#8a4956bbc0df9153f792b3adb7e35035f82e679f" + integrity sha512-ma51njqbk9ZKzZF9NpCZpZ+c50EwR5JTJ2LEXlX0tX+ExVbKpthhlDLhT2+mkUh5Zvj+CLf5F9z0qB4+X3re/w== "@cspell/dict-sql@^2.1.8": version "2.1.8" @@ -680,27 +680,28 @@ resolved "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.3.tgz#295c288f6fd363879898223202ec3be048663b98" integrity sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA== -"@cspell/dynamic-import@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.16.1.tgz#64d55d2ce370cf413b66fd001e263a30ee245b5e" - integrity sha512-mEfdeS1kFKpJoDsQ8wW6PxO3+ncYuZCWCASR0trbzZDduzO2RcogMUgzP99obHtYbgXadw94qcQWXB8OYTPSwg== +"@cspell/dynamic-import@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.1.tgz#2b3f3325b6013a067a1a49cda8b69ae73aaed36a" + integrity sha512-XQtr2olYOtqbg49E+8SISd6I5DzfxmsKINDn0ZgaTFeLalnNdF3ewDU4gOEbApIzGffRa1mW9t19MsiVrznSDw== dependencies: + "@cspell/url" "8.17.1" import-meta-resolve "^4.1.0" -"@cspell/filetypes@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.16.1.tgz#14faa073a5890947c711e89af469111356875996" - integrity sha512-zpbNg3n26muR1jdMbylw5YsaVGyS9LU5Lfy20gU7RygAk6kFyx3Yz4C84EihBGQHy2gVEsEeyCCxk+R8RXuPZA== +"@cspell/filetypes@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.1.tgz#d193afc5029364334f005ff23f4c4cb80170c374" + integrity sha512-AxYw6j7EPYtDFAFjwybjFpMc9waXQzurfBXmEVfQ5RQRlbylujLZWwR6GnMqofeNg4oGDUpEjcAZFrgdkvMQlA== -"@cspell/strong-weak-map@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.16.1.tgz#845374e60c2bdd21d13d9c98e2c1cb8d79791a9c" - integrity sha512-jJQS05wg2iUkLKnPR8NEq3LqvqHWKnvUDFoPwaJzYw6ol/O4yi/lv+Me9+XCPrgjpnAz+8APhWkhrR/O71R1Bw== +"@cspell/strong-weak-map@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.1.tgz#2fa88f283ef10222fad25134b5ebb54edaad985f" + integrity sha512-8cY3vLAKdt5gQEMM3Gr57BuQ8sun2NjYNh9qTdrctC1S9gNC7XzFghTYAfHSWR4VrOUcMFLO/izMdsc1KFvFOA== -"@cspell/url@8.16.1": - version "8.16.1" - resolved "https://registry.npmjs.org/@cspell/url/-/url-8.16.1.tgz#962961ae17fdcc2fc0e8d31c23c6272a33c193b3" - integrity sha512-kGlr7Wdo4xJpXKal/Gqo3Ll5Is7ptlIlLZOB/hzR6R53Fw4N6SdipTDIeHHqC15p2AXTEG6TSNdhk9dA50LY6w== +"@cspell/url@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/url/-/url-8.17.1.tgz#e7daec1597fa31b4d0a7a685e7a24a11b0c8a193" + integrity sha512-LMvReIndW1ckvemElfDgTt282fb2C3C/ZXfsm0pJsTV5ZmtdelCHwzmgSBmY5fDr7D66XDp8EurotSE0K6BTvw== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -2262,80 +2263,80 @@ cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -cspell-config-lib@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.16.1.tgz#8b525b62ce130ce5b76d041a91a625e0673e6d0a" - integrity sha512-ohbSi9sI14rMdFc2g17ogObGGkd/x6zUVOzCH1nEOefC9yJYYfsvaMHqdhk0rOjvmF95j5OK4dm5oid+DKQcpw== +cspell-config-lib@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.1.tgz#a87973b91d51bf23a2018042c25aeaaa8a4e69c0" + integrity sha512-x1S7QWprgUcwuwiJB1Ng0ZTBC4G50qP9qQyg/aroMkcdMsHfk26E8jUGRPNt4ftHFzS4YMhwtXuJQ9IgRUuNPA== dependencies: - "@cspell/cspell-types" "8.16.1" + "@cspell/cspell-types" "8.17.1" comment-json "^4.2.5" yaml "^2.6.1" -cspell-dictionary@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.16.1.tgz#87ce50c42a6e68acacd16f23c685670742f683f0" - integrity sha512-NL/vwf5SjtkWWaEUh+0dogKdEU4UuepJaNh36FX8W1CFtQXj7yEs45x4K7/Fp+pn/4AT7Qe7WpSSWi9z5GcqKg== +cspell-dictionary@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.1.tgz#bfc9bfdbd3720d1425260a98091acffab7b03dd5" + integrity sha512-zSl9l3wii+x16yc2NVZl/+CMLeLBAiuEd5YoFkOYPcbTJnfPwdjMNcj71u7wBvNJ+qwbF+kGbutEt15yHW3NBw== dependencies: - "@cspell/cspell-pipe" "8.16.1" - "@cspell/cspell-types" "8.16.1" - cspell-trie-lib "8.16.1" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" + cspell-trie-lib "8.17.1" fast-equals "^5.0.1" -cspell-gitignore@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.16.1.tgz#49cbeee78c62295e48351b77b39592b32b898138" - integrity sha512-Gg8qvFc8wr1D7TvB+GSfT1jyrUoUmPiG3WdOnQnxOSYKJesOiVvNxLv7YXRFkcUKG1VU6XDUkpb/uzKh3k2rKw== +cspell-gitignore@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.1.tgz#38f3213a40ba86480bb5f66a91198db6e0ef37c0" + integrity sha512-bk727Zf4FBCjm9Mwvyreyhgjwe+YhPQEW7PldkHiinKd+Irfez4s8GXLQb1EgV0UpvViqaqBqLmngjZdS30BTA== dependencies: - "@cspell/url" "8.16.1" - cspell-glob "8.16.1" - cspell-io "8.16.1" + "@cspell/url" "8.17.1" + cspell-glob "8.17.1" + cspell-io "8.17.1" find-up-simple "^1.0.0" -cspell-glob@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.16.1.tgz#88fc7af7330e5be4fd390741f0d4282e753b52c6" - integrity sha512-EukaXFaUrgrY9G4bB2PguzpkAoOq6ai9acLl6gWD+6DgVEwkLqPmCWjsFJA0MaqVp9QvPsIfCy4KCnx35csG/g== +cspell-glob@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.1.tgz#23d1be46b32fb4933487e4edff347d34db446f5a" + integrity sha512-cUwM5auSt0RvLX7UkP2GEArJRWc85l51B1voArl+3ZIKeMZwcJpJgN3qvImtF8yRTZwYeYCs1sgsihb179q+mg== dependencies: - "@cspell/url" "8.16.1" + "@cspell/url" "8.17.1" micromatch "^4.0.8" -cspell-grammar@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.16.1.tgz#69beb43fc1de65a1d929eb14ba748c6663141192" - integrity sha512-7IRYa0O1xfK2HVbhGSpOPPt5HlP2ZHRHtdLU2iOvMSCkh0cSPERu++kdprvcaOf7E7koo0P+bxHSprcYbU/agg== - dependencies: - "@cspell/cspell-pipe" "8.16.1" - "@cspell/cspell-types" "8.16.1" - -cspell-io@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-8.16.1.tgz#4f65952f324ab1ab8ec2e4283384410bb806027d" - integrity sha512-25MOQfy7EhdVeoNUW/+jyb5ArDYSLbaFwVToakHtLGuYk9cW8q8MAHq1W9GzW06wXswT2sQsRvaozmIOTDIOnw== - dependencies: - "@cspell/cspell-service-bus" "8.16.1" - "@cspell/url" "8.16.1" - -cspell-lib@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.16.1.tgz#35474bdd0b5620ed423c0074a333957e2f501448" - integrity sha512-Gn1vJcyhYe78iB+9dms8rnfgDEfJgYocXapFPTOcZV3EUWKcV4wyCiHdbK3j2ElLXmPuSPg4eZSlxxk8ITD0Aw== - dependencies: - "@cspell/cspell-bundled-dicts" "8.16.1" - "@cspell/cspell-pipe" "8.16.1" - "@cspell/cspell-resolver" "8.16.1" - "@cspell/cspell-types" "8.16.1" - "@cspell/dynamic-import" "8.16.1" - "@cspell/filetypes" "8.16.1" - "@cspell/strong-weak-map" "8.16.1" - "@cspell/url" "8.16.1" +cspell-grammar@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.1.tgz#8f6619fbfaebff6aeee63b13d17898b4d0c09136" + integrity sha512-H5tLcBuW7aUj9L0rR+FSbnWPEsWb8lWppHVidtqw9Ll1CUHWOZC9HTB2RdrhJZrsz/8DJbM2yNbok0Xt0VAfdw== + dependencies: + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" + +cspell-io@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.1.tgz#b91f1cac1c64a6fa2b61a388d0dc67437fcf3ada" + integrity sha512-liIOsblt7oVItifzRAbuxiYrwlgw1VOqKppMxVKtYoAn2VUuuEpjCj6jLWpoTqSszR/38o7ChsHY1LHakhJZmw== + dependencies: + "@cspell/cspell-service-bus" "8.17.1" + "@cspell/url" "8.17.1" + +cspell-lib@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.1.tgz#21c76f1ea4e91c90245e55acddbf452d055a6607" + integrity sha512-66n83Q7bK5tnvkDH7869/pBY/65AKmZVfCOAlsbhJn3YMDbNHFCHR0d1oNMlqG+n65Aco89VGwYfXxImZY+/mA== + dependencies: + "@cspell/cspell-bundled-dicts" "8.17.1" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-resolver" "8.17.1" + "@cspell/cspell-types" "8.17.1" + "@cspell/dynamic-import" "8.17.1" + "@cspell/filetypes" "8.17.1" + "@cspell/strong-weak-map" "8.17.1" + "@cspell/url" "8.17.1" clear-module "^4.1.2" comment-json "^4.2.5" - cspell-config-lib "8.16.1" - cspell-dictionary "8.16.1" - cspell-glob "8.16.1" - cspell-grammar "8.16.1" - cspell-io "8.16.1" - cspell-trie-lib "8.16.1" + cspell-config-lib "8.17.1" + cspell-dictionary "8.17.1" + cspell-glob "8.17.1" + cspell-grammar "8.17.1" + cspell-io "8.17.1" + cspell-trie-lib "8.17.1" env-paths "^3.0.0" fast-equals "^5.0.1" gensequence "^7.0.0" @@ -2345,33 +2346,33 @@ cspell-lib@8.16.1: vscode-uri "^3.0.8" xdg-basedir "^5.1.0" -cspell-trie-lib@8.16.1: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.16.1.tgz#c4b1c538919586d891c09335e0091a8acf23fb0c" - integrity sha512-T86nszsjQjyZ35dOWk7qN17Hem0cVeXJ4D1v/gIG+Y0Umo7dBW7AwmTvUy8iMFAra29cSdgRH+yk6q1qdpA+ZA== +cspell-trie-lib@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.1.tgz#618e5cc671b0a24cf7ec27a9a9b834b197e17392" + integrity sha512-13WNa5s75VwOjlGzWprmfNbBFIfXyA7tYYrbV+LugKkznyNZJeJPojHouEudcLq3SYb2Q6tJ7qyWcuT5bR9qPA== dependencies: - "@cspell/cspell-pipe" "8.16.1" - "@cspell/cspell-types" "8.16.1" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" gensequence "^7.0.0" cspell@^8.8.3: - version "8.16.1" - resolved "https://registry.npmjs.org/cspell/-/cspell-8.16.1.tgz#10a9991fb8840cd004a7a93da97243298036d3be" - integrity sha512-ILuCjnY3JPY2oO62PodTQD6n3DGTKTwB+IU1tE9EC6EP2Xw6z3Ir+hO2DO6QlRUmZlGrkGMek5U06nNmztt4eA== - dependencies: - "@cspell/cspell-json-reporter" "8.16.1" - "@cspell/cspell-pipe" "8.16.1" - "@cspell/cspell-types" "8.16.1" - "@cspell/dynamic-import" "8.16.1" - "@cspell/url" "8.16.1" + version "8.17.1" + resolved "https://registry.npmjs.org/cspell/-/cspell-8.17.1.tgz#be3c79a5b0b2e374ac0df8f921eb30ddca170110" + integrity sha512-D0lw8XTXrTycNzOn5DkfPJNUT00X53OgvFDm+0SzhBr1r+na8LEh3CnQ6zKYVU0fL0x8vU82vs4jmGjDho9mPg== + dependencies: + "@cspell/cspell-json-reporter" "8.17.1" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" + "@cspell/dynamic-import" "8.17.1" + "@cspell/url" "8.17.1" chalk "^5.3.0" chalk-template "^1.1.0" commander "^12.1.0" - cspell-dictionary "8.16.1" - cspell-gitignore "8.16.1" - cspell-glob "8.16.1" - cspell-io "8.16.1" - cspell-lib "8.16.1" + cspell-dictionary "8.17.1" + cspell-gitignore "8.17.1" + cspell-glob "8.17.1" + cspell-io "8.17.1" + cspell-lib "8.17.1" fast-json-stable-stringify "^2.1.0" file-entry-cache "^9.1.0" get-stdin "^9.0.0" From add1456c218d05773d753781e13746ac21401675 Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:29:02 +0400 Subject: [PATCH 04/29] refactor: remove extraneous globals from semantics and AST (#1196) * refactor: move SrcInfo to a separate file --- .eslintignore | 4 +- .gitignore | 4 +- src/abi/AbiFunction.ts | 3 +- src/abi/map.ts | 2 +- src/check.ts | 7 +- src/constEval.ts | 323 +++++++++------- src/errors.ts | 4 +- src/generator/writers/resolveFuncType.spec.ts | 15 +- src/generator/writers/writeAccessors.ts | 2 +- src/generator/writers/writeContract.ts | 2 +- src/generator/writers/writeExpression.spec.ts | 10 +- .../writers/writeSerialization.spec.ts | 10 +- src/generator/writers/writeSerialization.ts | 2 +- src/grammar/ast.ts | 30 +- src/grammar/checkConstAttributes.ts | 3 +- src/grammar/checkFunctionAttributes.ts | 3 +- src/grammar/checkVariableName.ts | 2 +- src/grammar/clone.ts | 359 +++++++++--------- src/grammar/grammar.spec.ts | 15 +- src/grammar/grammar.ts | 354 +++++++++-------- src/grammar/index.ts | 3 + src/grammar/rename.ts | 2 +- src/grammar/src-info.ts | 39 ++ src/grammar/store.ts | 15 +- src/grammar/test/expr-equality.spec.ts | 9 +- src/grammar/test/expr-is-value.spec.ts | 9 +- src/imports/resolveImports.spec.ts | 4 + src/imports/resolveImports.ts | 5 +- src/interpreter.ts | 12 +- src/optimizer/algebraic.ts | 57 ++- src/optimizer/associative.ts | 260 +++++++------ src/optimizer/standardOptimizer.ts | 11 +- src/optimizer/test/partial-eval.spec.ts | 234 +++++++----- src/optimizer/types.ts | 6 +- src/optimizer/util.ts | 126 +++--- src/pipeline/build.ts | 9 +- src/pipeline/precompile.ts | 11 +- src/storage/resolveAllocation.spec.ts | 10 +- src/test/compare.spec.ts | 6 +- .../abi-global-errors.spec.ts | 5 - .../const-eval-failed.spec.ts | 5 - .../contract-duplicate-opcodes.spec.ts | 5 - .../compilation-failed/func-errors.spec.ts | 5 - .../compilation-failed/scope-errors.spec.ts | 5 - .../compilation-failed/stdlib-bugs.spec.ts | 5 - src/test/prettyPrinter.spec.ts | 8 +- src/test/rename.spec.ts | 6 +- src/types/resolveABITypeRef.ts | 2 +- src/types/resolveDescriptors.spec.ts | 14 +- src/types/resolveDescriptors.ts | 14 +- src/types/resolveSignatures.ts | 2 +- src/types/resolveStatements.spec.ts | 14 +- src/types/resolveStatements.ts | 2 +- src/types/types.ts | 3 +- 54 files changed, 1111 insertions(+), 966 deletions(-) create mode 100644 src/grammar/index.ts create mode 100644 src/grammar/src-info.ts diff --git a/.eslintignore b/.eslintignore index ebdeff259..ba91e95c6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,8 +4,8 @@ coverage/ **/output/ src/test/**/output/ src/func/funcfiftlib.js -src/grammar/grammar.ohm*.ts -src/grammar/grammar.ohm*.js +**/grammar.ohm*.ts +**/grammar.ohm*.js jest.setup.js jest.teardown.js /docs diff --git a/.gitignore b/.gitignore index 997174b31..3152343ad 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ node_modules coverage dist output/ -src/grammar/grammar.ohm-bundle.js -src/grammar/grammar.ohm-bundle.d.ts +**/grammar.ohm-bundle.js +**/grammar.ohm-bundle.d.ts src/func/funcfiftlib.wasm.js src/test/contracts/pretty-printer-output diff --git a/src/abi/AbiFunction.ts b/src/abi/AbiFunction.ts index d043df202..00faa5f73 100644 --- a/src/abi/AbiFunction.ts +++ b/src/abi/AbiFunction.ts @@ -1,7 +1,8 @@ -import { AstExpression, SrcInfo } from "../grammar/ast"; +import { AstExpression } from "../grammar/ast"; import { CompilerContext } from "../context"; import { WriterContext } from "../generator/Writer"; import { TypeRef } from "../types/types"; +import { SrcInfo } from "../grammar"; export type AbiFunction = { name: string; diff --git a/src/abi/map.ts b/src/abi/map.ts index 23370bcb1..0a8c0ea3a 100644 --- a/src/abi/map.ts +++ b/src/abi/map.ts @@ -1,5 +1,5 @@ import { CompilerContext } from "../context"; -import { SrcInfo } from "../grammar/grammar"; +import { SrcInfo } from "../grammar"; import { TypeRef } from "../types/types"; import { WriterContext } from "../generator/Writer"; import { ops } from "../generator/writers/ops"; diff --git a/src/check.ts b/src/check.ts index b26b2b912..5bc55e948 100644 --- a/src/check.ts +++ b/src/check.ts @@ -1,5 +1,7 @@ import { featureEnable } from "./config/features"; import { CompilerContext } from "./context"; +import { getAstFactory } from "./grammar/ast"; +import { getParser } from "./grammar"; import files from "./imports/stdlib"; import { createVirtualFileSystem, TactError, VirtualFileSystem } from "./main"; import { precompile } from "./pipeline/precompile"; @@ -35,10 +37,13 @@ export function check(args: { ctx = featureEnable(ctx, "masterchain"); // Enable masterchain flag to avoid masterchain-specific errors ctx = featureEnable(ctx, "external"); // Enable external messages flag to avoid external-specific errors + const ast = getAstFactory(); + const parser = getParser(ast); + // Execute check const items: CheckResultItem[] = []; try { - precompile(ctx, args.project, stdlib, args.entrypoint); + precompile(ctx, args.project, stdlib, args.entrypoint, parser, ast); } catch (e) { if (e instanceof TactError) { items.push({ diff --git a/src/constEval.ts b/src/constEval.ts index 16e509da2..630c901a7 100644 --- a/src/constEval.ts +++ b/src/constEval.ts @@ -2,19 +2,13 @@ import { CompilerContext } from "./context"; import { AstBinaryOperation, AstExpression, - SrcInfo, AstUnaryOperation, AstValue, isValue, } from "./grammar/ast"; import { TactConstEvalError } from "./errors"; import { Value } from "./types/types"; -import { - extractValue, - makeValueExpression, - makeUnaryExpression, - makeBinaryExpression, -} from "./optimizer/util"; +import { AstUtil, extractValue } from "./optimizer/util"; import { ExpressionTransformer } from "./optimizer/types"; import { StandardOptimizer } from "./optimizer/standardOptimizer"; import { @@ -25,6 +19,7 @@ import { evalUnaryOp, throwNonFatalErrorConstEval, } from "./interpreter"; +import { SrcInfo } from "./grammar"; // Utility Exception class to interrupt the execution // of functions that cannot evaluate a tree fully into a value. @@ -37,93 +32,194 @@ class PartiallyEvaluatedTree extends Error { } } -// The optimizer that applies the rewriting rules during partial evaluation. -// For the moment we use an optimizer that respects overflows. -const optimizer: ExpressionTransformer = new StandardOptimizer(); +export const getOptimizer = (util: AstUtil) => { + // The optimizer that applies the rewriting rules during partial evaluation. + // For the moment we use an optimizer that respects overflows. + const optimizer: ExpressionTransformer = new StandardOptimizer(util); -function partiallyEvalUnaryOp( - op: AstUnaryOperation, - operand: AstExpression, - source: SrcInfo, - ctx: CompilerContext, -): AstExpression { - if (operand.kind === "number" && op === "-") { - // emulating negative integer literals - return makeValueExpression(ensureInt(-operand.value, source)); - } + function partiallyEvalUnaryOp( + op: AstUnaryOperation, + operand: AstExpression, + source: SrcInfo, + ctx: CompilerContext, + ): AstExpression { + if (operand.kind === "number" && op === "-") { + // emulating negative integer literals + return util.makeValueExpression(ensureInt(-operand.value, source)); + } - const simplOperand = partiallyEvalExpression(operand, ctx); + const simplOperand = partiallyEvalExpression(operand, ctx); - if (isValue(simplOperand)) { - const valueOperand = extractValue(simplOperand as AstValue); - const result = evalUnaryOp(op, valueOperand, simplOperand.loc, source); - // Wrap the value into a Tree to continue simplifications - return makeValueExpression(result); - } else { - const newAst = makeUnaryExpression(op, simplOperand); - return optimizer.applyRules(newAst); + if (isValue(simplOperand)) { + const valueOperand = extractValue(simplOperand as AstValue); + const result = evalUnaryOp( + op, + valueOperand, + simplOperand.loc, + source, + ); + // Wrap the value into a Tree to continue simplifications + return util.makeValueExpression(result); + } else { + const newAst = util.makeUnaryExpression(op, simplOperand); + return optimizer.applyRules(newAst); + } } -} -function partiallyEvalBinaryOp( - op: AstBinaryOperation, - left: AstExpression, - right: AstExpression, - source: SrcInfo, - ctx: CompilerContext, -): AstExpression { - const leftOperand = partiallyEvalExpression(left, ctx); + function partiallyEvalBinaryOp( + op: AstBinaryOperation, + left: AstExpression, + right: AstExpression, + source: SrcInfo, + ctx: CompilerContext, + ): AstExpression { + const leftOperand = partiallyEvalExpression(left, ctx); - if (isValue(leftOperand)) { - // Because of short-circuiting, we must delay evaluation of the right operand - const valueLeftOperand = extractValue(leftOperand as AstValue); + if (isValue(leftOperand)) { + // Because of short-circuiting, we must delay evaluation of the right operand + const valueLeftOperand = extractValue(leftOperand as AstValue); - try { - const result = evalBinaryOp( + try { + const result = evalBinaryOp( + op, + valueLeftOperand, + // We delay the evaluation of the right operand inside a continuation + () => { + const rightOperand = partiallyEvalExpression( + right, + ctx, + ); + if (isValue(rightOperand)) { + // If the right operand reduces to a value, then we can let the function + // evalBinaryOp finish its normal execution by returning the value + // in the right operand. + return extractValue(rightOperand as AstValue); + } else { + // If the right operand does not reduce to a value, + // we interrupt the execution of the evalBinaryOp function + // by returning an exception with the partially evaluated right operand. + // The simplification rules will handle the partially evaluated tree in the catch + // of the try surrounding the evalBinaryOp function. + throw new PartiallyEvaluatedTree(rightOperand); + } + }, + leftOperand.loc, + right.loc, + source, + ); + + return util.makeValueExpression(result); + } catch (e) { + if (e instanceof PartiallyEvaluatedTree) { + // The right operand did not evaluate to a value. Hence, + // time to symbolically simplify the full tree. + const newAst = util.makeBinaryExpression( + op, + leftOperand, + e.tree, + ); + return optimizer.applyRules(newAst); + } else { + throw e; + } + } + } else { + // Since the left operand does not reduce to a value, no immediate short-circuiting will occur. + // Hence, we can partially evaluate the right operand and let the rules + // simplify the tree. + const rightOperand = partiallyEvalExpression(right, ctx); + const newAst = util.makeBinaryExpression( op, - valueLeftOperand, - // We delay the evaluation of the right operand inside a continuation - () => { - const rightOperand = partiallyEvalExpression(right, ctx); - if (isValue(rightOperand)) { - // If the right operand reduces to a value, then we can let the function - // evalBinaryOp finish its normal execution by returning the value - // in the right operand. - return extractValue(rightOperand as AstValue); - } else { - // If the right operand does not reduce to a value, - // we interrupt the execution of the evalBinaryOp function - // by returning an exception with the partially evaluated right operand. - // The simplification rules will handle the partially evaluated tree in the catch - // of the try surrounding the evalBinaryOp function. - throw new PartiallyEvaluatedTree(rightOperand); - } - }, - leftOperand.loc, - right.loc, - source, + leftOperand, + rightOperand, ); + return optimizer.applyRules(newAst); + } + } - return makeValueExpression(result); - } catch (e) { - if (e instanceof PartiallyEvaluatedTree) { - // The right operand did not evaluate to a value. Hence, - // time to symbolically simplify the full tree. - const newAst = makeBinaryExpression(op, leftOperand, e.tree); - return optimizer.applyRules(newAst); - } else { - throw e; - } + function partiallyEvalExpression( + ast: AstExpression, + ctx: CompilerContext, + interpreterConfig?: InterpreterConfig, + ): AstExpression { + const interpreter = new Interpreter(ctx, interpreterConfig); + switch (ast.kind) { + case "id": + try { + return util.makeValueExpression( + interpreter.interpretName(ast), + ); + } catch (e) { + if (e instanceof TactConstEvalError) { + if (!e.fatal) { + // If a non-fatal error occurs during lookup, just return the symbol + return ast; + } + } + throw e; + } + case "method_call": + // Does not partially evaluate at the moment. Will attempt to fully evaluate + return util.makeValueExpression( + interpreter.interpretMethodCall(ast), + ); + case "init_of": + throwNonFatalErrorConstEval( + "initOf is not supported at this moment", + ast.loc, + ); + break; + case "null": + return ast; + case "boolean": + return ast; + case "number": + return util.makeValueExpression( + interpreter.interpretNumber(ast), + ); + case "string": + return util.makeValueExpression( + interpreter.interpretString(ast), + ); + case "op_unary": + return partiallyEvalUnaryOp(ast.op, ast.operand, ast.loc, ctx); + case "op_binary": + return partiallyEvalBinaryOp( + ast.op, + ast.left, + ast.right, + ast.loc, + ctx, + ); + case "conditional": + // Does not partially evaluate at the moment. Will attempt to fully evaluate + return util.makeValueExpression( + interpreter.interpretConditional(ast), + ); + case "struct_instance": + // Does not partially evaluate at the moment. Will attempt to fully evaluate + return util.makeValueExpression( + interpreter.interpretStructInstance(ast), + ); + case "field_access": + // Does not partially evaluate at the moment. Will attempt to fully evaluate + return util.makeValueExpression( + interpreter.interpretFieldAccess(ast), + ); + case "static_call": + // Does not partially evaluate at the moment. Will attempt to fully evaluate + return util.makeValueExpression( + interpreter.interpretStaticCall(ast), + ); } - } else { - // Since the left operand does not reduce to a value, no immediate short-circuiting will occur. - // Hence, we can partially evaluate the right operand and let the rules - // simplify the tree. - const rightOperand = partiallyEvalExpression(right, ctx); - const newAst = makeBinaryExpression(op, leftOperand, rightOperand); - return optimizer.applyRules(newAst); } -} + + return { + partiallyEvalUnaryOp, + partiallyEvalBinaryOp, + partiallyEvalExpression, + }; +}; export function evalConstantExpression( ast: AstExpression, @@ -134,66 +230,3 @@ export function evalConstantExpression( const result = interpreter.interpretExpression(ast); return result; } - -export function partiallyEvalExpression( - ast: AstExpression, - ctx: CompilerContext, - interpreterConfig?: InterpreterConfig, -): AstExpression { - const interpreter = new Interpreter(ctx, interpreterConfig); - switch (ast.kind) { - case "id": - try { - return makeValueExpression(interpreter.interpretName(ast)); - } catch (e) { - if (e instanceof TactConstEvalError) { - if (!e.fatal) { - // If a non-fatal error occurs during lookup, just return the symbol - return ast; - } - } - throw e; - } - case "method_call": - // Does not partially evaluate at the moment. Will attempt to fully evaluate - return makeValueExpression(interpreter.interpretMethodCall(ast)); - case "init_of": - throwNonFatalErrorConstEval( - "initOf is not supported at this moment", - ast.loc, - ); - break; - case "null": - return ast; - case "boolean": - return ast; - case "number": - return makeValueExpression(interpreter.interpretNumber(ast)); - case "string": - return makeValueExpression(interpreter.interpretString(ast)); - case "op_unary": - return partiallyEvalUnaryOp(ast.op, ast.operand, ast.loc, ctx); - case "op_binary": - return partiallyEvalBinaryOp( - ast.op, - ast.left, - ast.right, - ast.loc, - ctx, - ); - case "conditional": - // Does not partially evaluate at the moment. Will attempt to fully evaluate - return makeValueExpression(interpreter.interpretConditional(ast)); - case "struct_instance": - // Does not partially evaluate at the moment. Will attempt to fully evaluate - return makeValueExpression( - interpreter.interpretStructInstance(ast), - ); - case "field_access": - // Does not partially evaluate at the moment. Will attempt to fully evaluate - return makeValueExpression(interpreter.interpretFieldAccess(ast)); - case "static_call": - // Does not partially evaluate at the moment. Will attempt to fully evaluate - return makeValueExpression(interpreter.interpretStaticCall(ast)); - } -} diff --git a/src/errors.ts b/src/errors.ts index 0dd9ce313..eee766790 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,8 +1,8 @@ import { MatchResult } from "ohm-js"; import path from "path"; import { cwd } from "process"; -import { AstFuncId, AstId, AstTypeId, SrcInfo } from "./grammar/ast"; -import { ItemOrigin } from "./grammar/grammar"; +import { AstFuncId, AstId, AstTypeId } from "./grammar/ast"; +import { ItemOrigin, SrcInfo } from "./grammar"; export class TactError extends Error { readonly loc?: SrcInfo; diff --git a/src/generator/writers/resolveFuncType.spec.ts b/src/generator/writers/resolveFuncType.spec.ts index 362f00667..e30743422 100644 --- a/src/generator/writers/resolveFuncType.spec.ts +++ b/src/generator/writers/resolveFuncType.spec.ts @@ -1,9 +1,10 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; +import { getAstFactory } from "../../grammar/ast"; import { resolveDescriptors } from "../../types/resolveDescriptors"; import { WriterContext } from "../Writer"; import { resolveFuncType } from "./resolveFuncType"; import { openContext } from "../../grammar/store"; import { CompilerContext } from "../../context"; +import { getParser } from "../../grammar"; const primitiveCode = ` primitive Int; @@ -45,17 +46,15 @@ contract Contract2 { `; describe("resolveFuncType", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - it("should process primitive types", () => { + const ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: primitiveCode, path: "", origin: "user" }], [], + getParser(ast), ); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, ast); const wCtx = new WriterContext(ctx, "Contract1"); expect( resolveFuncType( @@ -117,12 +116,14 @@ describe("resolveFuncType", () => { }); it("should process contract and struct types", () => { + const ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: primitiveCode, path: "", origin: "user" }], [], + getParser(ast), ); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, ast); const wCtx = new WriterContext(ctx, "Contract1"); expect( resolveFuncType( diff --git a/src/generator/writers/writeAccessors.ts b/src/generator/writers/writeAccessors.ts index df210313c..191235f59 100644 --- a/src/generator/writers/writeAccessors.ts +++ b/src/generator/writers/writeAccessors.ts @@ -1,6 +1,6 @@ import { contractErrors } from "../../abi/errors"; import { maxTupleSize } from "../../bindings/typescript/writeStruct"; -import { ItemOrigin } from "../../grammar/grammar"; +import { ItemOrigin } from "../../grammar"; import { getType } from "../../types/resolveDescriptors"; import { TypeDescription } from "../../types/types"; import { WriterContext } from "../Writer"; diff --git a/src/generator/writers/writeContract.ts b/src/generator/writers/writeContract.ts index 642682052..4cf60f77f 100644 --- a/src/generator/writers/writeContract.ts +++ b/src/generator/writers/writeContract.ts @@ -5,7 +5,7 @@ import { enabledIpfsAbiGetter, enabledMasterchain, } from "../../config/features"; -import { ItemOrigin } from "../../grammar/grammar"; +import { ItemOrigin } from "../../grammar"; import { InitDescription, TypeDescription } from "../../types/types"; import { WriterContext } from "../Writer"; import { funcIdOf, funcInitIdOf } from "./id"; diff --git a/src/generator/writers/writeExpression.spec.ts b/src/generator/writers/writeExpression.spec.ts index 19b9bd17f..4409dc8db 100644 --- a/src/generator/writers/writeExpression.spec.ts +++ b/src/generator/writers/writeExpression.spec.ts @@ -1,4 +1,3 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { getStaticFunction, resolveDescriptors, @@ -8,6 +7,8 @@ import { writeExpression } from "./writeExpression"; import { openContext } from "../../grammar/store"; import { resolveStatements } from "../../types/resolveStatements"; import { CompilerContext } from "../../context"; +import { getParser } from "../../grammar"; +import { getAstFactory } from "../../grammar/ast"; const code = ` @@ -68,16 +69,15 @@ const golden: string[] = [ ]; describe("writeExpression", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); it("should write expression", () => { + const ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: code, path: "", origin: "user" }], [], + getParser(ast), ); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, ast); ctx = resolveStatements(ctx); const main = getStaticFunction(ctx, "main"); if (main.ast.kind !== "function_def") { diff --git a/src/generator/writers/writeSerialization.spec.ts b/src/generator/writers/writeSerialization.spec.ts index cafbd3307..316c88160 100644 --- a/src/generator/writers/writeSerialization.spec.ts +++ b/src/generator/writers/writeSerialization.spec.ts @@ -1,4 +1,3 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { CompilerContext } from "../../context"; import { getAllocation, @@ -14,6 +13,8 @@ import { writeParser, writeSerializer } from "./writeSerialization"; import { writeStdlib } from "./writeStdlib"; import { openContext } from "../../grammar/store"; import { writeAccessors } from "./writeAccessors"; +import { getParser } from "../../grammar"; +import { getAstFactory } from "../../grammar/ast"; const code = ` primitive Int; @@ -56,17 +57,16 @@ struct C { `; describe("writeSerialization", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); for (const s of ["A", "B", "C"]) { it("should write serializer for " + s, () => { + const ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code, path: "", origin: "user" }], [], + getParser(ast), ); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, ast); ctx = resolveAllocations(ctx); const wCtx = new WriterContext(ctx, s); writeStdlib(wCtx); diff --git a/src/generator/writers/writeSerialization.ts b/src/generator/writers/writeSerialization.ts index aca186622..a51bfba09 100644 --- a/src/generator/writers/writeSerialization.ts +++ b/src/generator/writers/writeSerialization.ts @@ -1,6 +1,6 @@ import { contractErrors } from "../../abi/errors"; import { throwInternalCompilerError } from "../../errors"; -import { dummySrcInfo, ItemOrigin } from "../../grammar/grammar"; +import { dummySrcInfo, ItemOrigin } from "../../grammar"; import { AllocationCell, AllocationOperation } from "../../storage/operation"; import { StorageAllocation } from "../../storage/StorageAllocation"; import { getType } from "../../types/resolveDescriptors"; diff --git a/src/grammar/ast.ts b/src/grammar/ast.ts index 7d95641e8..f9d54810b 100644 --- a/src/grammar/ast.ts +++ b/src/grammar/ast.ts @@ -1,4 +1,5 @@ -import { dummySrcInfo, SrcInfo } from "./grammar"; +import { dummySrcInfo } from "./grammar"; +import { SrcInfo } from "./src-info"; export type AstModule = { kind: "module"; @@ -758,17 +759,22 @@ export function tryExtractPath(path: AstExpression): AstId[] | null { type DistributiveOmit = T extends any ? Omit : never; -let nextId = 1; -export function createAstNode(src: DistributiveOmit): AstNode { - return Object.freeze(Object.assign({ id: nextId++ }, src)); -} -export function cloneAstNode(src: T): T { - return { ...src, id: nextId++ }; -} -export function __DANGER_resetNodeId() { - nextId = 1; -} +export const getAstFactory = () => { + let nextId = 1; + function createNode(src: DistributiveOmit): AstNode { + return Object.freeze(Object.assign({ id: nextId++ }, src)); + } + function cloneNode(src: T): T { + return { ...src, id: nextId++ }; + } + return { + createNode, + cloneNode, + }; +}; + +export type FactoryAst = ReturnType; // Test equality of AstExpressions. export function eqExpressions( @@ -914,5 +920,3 @@ export function isValue(ast: AstExpression): boolean { return false; } } - -export { SrcInfo }; diff --git a/src/grammar/checkConstAttributes.ts b/src/grammar/checkConstAttributes.ts index 3346a9289..b7fdee28b 100644 --- a/src/grammar/checkConstAttributes.ts +++ b/src/grammar/checkConstAttributes.ts @@ -1,5 +1,6 @@ -import { AstConstantAttribute, SrcInfo } from "./ast"; +import { AstConstantAttribute } from "./ast"; import { throwSyntaxError } from "../errors"; +import { SrcInfo } from "./src-info"; export function checkConstAttributes( isAbstract: boolean, diff --git a/src/grammar/checkFunctionAttributes.ts b/src/grammar/checkFunctionAttributes.ts index dce102448..3b163fdfa 100644 --- a/src/grammar/checkFunctionAttributes.ts +++ b/src/grammar/checkFunctionAttributes.ts @@ -1,5 +1,6 @@ -import { AstFunctionAttribute, SrcInfo } from "./ast"; +import { AstFunctionAttribute } from "./ast"; import { throwCompilationError } from "../errors"; +import { SrcInfo } from "./src-info"; export function checkFunctionAttributes( isAbstract: boolean, diff --git a/src/grammar/checkVariableName.ts b/src/grammar/checkVariableName.ts index 3ba98ac10..faef19733 100644 --- a/src/grammar/checkVariableName.ts +++ b/src/grammar/checkVariableName.ts @@ -1,5 +1,5 @@ -import { SrcInfo } from "./ast"; import { throwCompilationError } from "../errors"; +import { SrcInfo } from "./src-info"; export function checkVariableName(name: string, loc: SrcInfo) { if (name.startsWith("__gen")) { diff --git a/src/grammar/clone.ts b/src/grammar/clone.ts index a63a8f25d..48e8a8a79 100644 --- a/src/grammar/clone.ts +++ b/src/grammar/clone.ts @@ -1,180 +1,187 @@ -import { AstNode, cloneAstNode } from "./ast"; +import { AstNode, FactoryAst } from "./ast"; import { throwInternalCompilerError } from "../errors"; -export function cloneNode(src: T): T { - if (src.kind === "boolean") { - return cloneAstNode(src); - } else if (src.kind === "id") { - return cloneAstNode(src); - } else if (src.kind === "null") { - return cloneAstNode(src); - } else if (src.kind === "number") { - return cloneAstNode(src); - } else if (src.kind === "string") { - return cloneAstNode(src); - } else if (src.kind === "statement_assign") { - return cloneAstNode({ - ...src, - path: cloneNode(src.path), - expression: cloneNode(src.expression), - }); - } else if (src.kind === "statement_augmentedassign") { - return cloneAstNode({ - ...src, - path: cloneNode(src.path), - expression: cloneNode(src.expression), - }); - } else if (src.kind === "statement_let") { - return cloneAstNode({ - ...src, - type: src.type ? cloneAstNode(src.type) : null, - expression: cloneNode(src.expression), - }); - } else if (src.kind === "statement_condition") { - return cloneAstNode({ - ...src, - condition: cloneNode(src.condition), - trueStatements: src.trueStatements.map(cloneNode), - falseStatements: src.falseStatements - ? src.falseStatements.map(cloneNode) - : null, - elseif: src.elseif ? cloneNode(src.elseif) : null, - }); - } else if (src.kind === "struct_field_initializer") { - return cloneAstNode({ - ...src, - initializer: cloneNode(src.initializer), - }); - } else if (src.kind === "statement_expression") { - return cloneAstNode({ - ...src, - expression: cloneNode(src.expression), - }); - } else if (src.kind === "op_binary") { - return cloneAstNode({ - ...src, - left: cloneNode(src.left), - right: cloneNode(src.right), - }); - } else if (src.kind === "op_unary") { - return cloneAstNode({ - ...src, - operand: cloneNode(src.operand), - }); - } else if (src.kind === "struct_instance") { - return cloneAstNode({ - ...src, - args: src.args.map(cloneNode), - }); - } else if (src.kind === "method_call") { - return cloneAstNode({ - ...src, - self: cloneNode(src.self), - args: src.args.map(cloneNode), - }); - } else if (src.kind === "field_access") { - return cloneAstNode({ - ...src, - aggregate: cloneNode(src.aggregate), - }); - } else if (src.kind === "static_call") { - return cloneAstNode({ - ...src, - args: src.args.map(cloneNode), - }); - } else if (src.kind === "conditional") { - return cloneAstNode({ - ...src, - condition: cloneNode(src.condition), - thenBranch: cloneNode(src.thenBranch), - elseBranch: cloneNode(src.elseBranch), - }); - } else if (src.kind === "statement_return") { - return cloneAstNode({ - ...src, - expression: src.expression ? cloneNode(src.expression) : null, - }); - } else if (src.kind === "statement_repeat") { - return cloneAstNode({ - ...src, - iterations: cloneNode(src.iterations), - statements: src.statements.map(cloneNode), - }); - } else if (src.kind === "statement_until") { - return cloneAstNode({ - ...src, - condition: cloneNode(src.condition), - statements: src.statements.map(cloneNode), - }); - } else if (src.kind === "statement_while") { - return cloneAstNode({ - ...src, - condition: cloneNode(src.condition), - statements: src.statements.map(cloneNode), - }); - } else if (src.kind === "statement_try") { - return cloneAstNode({ - ...src, - statements: src.statements.map(cloneNode), - }); - } else if (src.kind === "statement_try_catch") { - return cloneAstNode({ - ...src, - statements: src.statements.map(cloneNode), - catchStatements: src.catchStatements.map(cloneNode), - }); - } else if (src.kind === "statement_foreach") { - return cloneAstNode({ - ...src, - map: cloneNode(src.map), - statements: src.statements.map(cloneNode), - }); - } else if (src.kind === "function_def") { - return cloneAstNode({ - ...src, - return: src.return ? cloneAstNode(src.return) : null, - statements: src.statements.map(cloneNode), - params: src.params.map(cloneNode), - }); - } else if (src.kind === "function_decl") { - return cloneAstNode({ - ...src, - return: src.return ? cloneAstNode(src.return) : null, - params: src.params.map(cloneNode), - }); - } else if (src.kind === "native_function_decl") { - return cloneAstNode({ - ...src, - return: src.return ? cloneAstNode(src.return) : null, - params: src.params.map(cloneNode), - }); - } else if (src.kind === "receiver") { - return cloneAstNode({ - ...src, - statements: src.statements.map(cloneNode), - }); - } else if (src.kind === "typed_parameter") { - return cloneAstNode({ - ...src, - type: cloneAstNode(src.type), - }); - } else if (src.kind === "init_of") { - return cloneAstNode({ - ...src, - args: src.args.map(cloneNode), - }); - } else if (src.kind === "constant_def") { - return cloneAstNode({ - ...src, - type: cloneAstNode(src.type), - initializer: cloneNode(src.initializer), - }); - } else if (src.kind === "constant_decl") { - return cloneAstNode({ - ...src, - type: cloneAstNode(src.type), - }); - } +export function cloneNode( + src: T, + { cloneNode }: FactoryAst, +): T { + const recurse = (src: T): T => { + if (src.kind === "boolean") { + return cloneNode(src); + } else if (src.kind === "id") { + return cloneNode(src); + } else if (src.kind === "null") { + return cloneNode(src); + } else if (src.kind === "number") { + return cloneNode(src); + } else if (src.kind === "string") { + return cloneNode(src); + } else if (src.kind === "statement_assign") { + return cloneNode({ + ...src, + path: recurse(src.path), + expression: recurse(src.expression), + }); + } else if (src.kind === "statement_augmentedassign") { + return cloneNode({ + ...src, + path: recurse(src.path), + expression: recurse(src.expression), + }); + } else if (src.kind === "statement_let") { + return cloneNode({ + ...src, + type: src.type ? cloneNode(src.type) : null, + expression: recurse(src.expression), + }); + } else if (src.kind === "statement_condition") { + return cloneNode({ + ...src, + condition: recurse(src.condition), + trueStatements: src.trueStatements.map(recurse), + falseStatements: src.falseStatements + ? src.falseStatements.map(recurse) + : null, + elseif: src.elseif ? recurse(src.elseif) : null, + }); + } else if (src.kind === "struct_field_initializer") { + return cloneNode({ + ...src, + initializer: recurse(src.initializer), + }); + } else if (src.kind === "statement_expression") { + return cloneNode({ + ...src, + expression: recurse(src.expression), + }); + } else if (src.kind === "op_binary") { + return cloneNode({ + ...src, + left: recurse(src.left), + right: recurse(src.right), + }); + } else if (src.kind === "op_unary") { + return cloneNode({ + ...src, + operand: recurse(src.operand), + }); + } else if (src.kind === "struct_instance") { + return cloneNode({ + ...src, + args: src.args.map(recurse), + }); + } else if (src.kind === "method_call") { + return cloneNode({ + ...src, + self: recurse(src.self), + args: src.args.map(recurse), + }); + } else if (src.kind === "field_access") { + return cloneNode({ + ...src, + aggregate: recurse(src.aggregate), + }); + } else if (src.kind === "static_call") { + return cloneNode({ + ...src, + args: src.args.map(recurse), + }); + } else if (src.kind === "conditional") { + return cloneNode({ + ...src, + condition: recurse(src.condition), + thenBranch: recurse(src.thenBranch), + elseBranch: recurse(src.elseBranch), + }); + } else if (src.kind === "statement_return") { + return cloneNode({ + ...src, + expression: src.expression ? recurse(src.expression) : null, + }); + } else if (src.kind === "statement_repeat") { + return cloneNode({ + ...src, + iterations: recurse(src.iterations), + statements: src.statements.map(recurse), + }); + } else if (src.kind === "statement_until") { + return cloneNode({ + ...src, + condition: recurse(src.condition), + statements: src.statements.map(recurse), + }); + } else if (src.kind === "statement_while") { + return cloneNode({ + ...src, + condition: recurse(src.condition), + statements: src.statements.map(recurse), + }); + } else if (src.kind === "statement_try") { + return cloneNode({ + ...src, + statements: src.statements.map(recurse), + }); + } else if (src.kind === "statement_try_catch") { + return cloneNode({ + ...src, + statements: src.statements.map(recurse), + catchStatements: src.catchStatements.map(recurse), + }); + } else if (src.kind === "statement_foreach") { + return cloneNode({ + ...src, + map: recurse(src.map), + statements: src.statements.map(recurse), + }); + } else if (src.kind === "function_def") { + return cloneNode({ + ...src, + return: src.return ? cloneNode(src.return) : null, + statements: src.statements.map(recurse), + params: src.params.map(recurse), + }); + } else if (src.kind === "function_decl") { + return cloneNode({ + ...src, + return: src.return ? cloneNode(src.return) : null, + params: src.params.map(recurse), + }); + } else if (src.kind === "native_function_decl") { + return cloneNode({ + ...src, + return: src.return ? cloneNode(src.return) : null, + params: src.params.map(recurse), + }); + } else if (src.kind === "receiver") { + return cloneNode({ + ...src, + statements: src.statements.map(recurse), + }); + } else if (src.kind === "typed_parameter") { + return cloneNode({ + ...src, + type: cloneNode(src.type), + }); + } else if (src.kind === "init_of") { + return cloneNode({ + ...src, + args: src.args.map(recurse), + }); + } else if (src.kind === "constant_def") { + return cloneNode({ + ...src, + type: cloneNode(src.type), + initializer: recurse(src.initializer), + }); + } else if (src.kind === "constant_decl") { + return cloneNode({ + ...src, + type: cloneNode(src.type), + }); + } - throwInternalCompilerError(`Not implemented for ${src.kind}`); + throwInternalCompilerError(`Not implemented for ${src.kind}`); + }; + + return recurse(src); } diff --git a/src/grammar/grammar.spec.ts b/src/grammar/grammar.spec.ts index 31a5bdadf..7af9c64dc 100644 --- a/src/grammar/grammar.spec.ts +++ b/src/grammar/grammar.spec.ts @@ -1,6 +1,7 @@ -import { parse } from "./grammar"; -import { AstModule, SrcInfo, __DANGER_resetNodeId } from "./ast"; +import { AstModule, getAstFactory } from "./ast"; import { loadCases } from "../utils/loadCases"; +import { getParser } from "./grammar"; +import { SrcInfo } from "./src-info"; expect.addSnapshotSerializer({ test: (src) => src instanceof SrcInfo, @@ -8,13 +9,11 @@ expect.addSnapshotSerializer({ }); describe("grammar", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - // Test parsing of known Fift projects, wrapped in asm functions of Tact for (const r of loadCases(__dirname + "/test-asm/")) { it("should parse " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast); const parsed: AstModule | undefined = parse( r.code, "", @@ -28,12 +27,16 @@ describe("grammar", () => { for (const r of loadCases(__dirname + "/test/")) { it("should parse " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast); expect(parse(r.code, "", "user")).toMatchSnapshot(); }); } for (const r of loadCases(__dirname + "/test-failed/")) { it("should fail " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast); expect(() => parse(r.code, "", "user"), ).toThrowErrorMatchingSnapshot(); diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index 894047aef..069333659 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -1,11 +1,4 @@ -import { - Interval as RawInterval, - Node, - IterationNode, - NonterminalNode, - grammar, - Grammar, -} from "ohm-js"; +import { Node, IterationNode, NonterminalNode, grammar, Grammar } from "ohm-js"; import tactGrammar from "./grammar.ohm-bundle"; import { throwInternalCompilerError } from "../errors"; import { @@ -19,73 +12,60 @@ import { AstReceiverKind, AstString, AstType, - createAstNode, AstImport, AstConstantDef, AstNumberBase, AstId, + FactoryAst, } from "./ast"; import { throwParseError, throwSyntaxError } from "../errors"; import { checkVariableName } from "./checkVariableName"; import { checkFunctionAttributes } from "./checkFunctionAttributes"; import { checkConstAttributes } from "./checkConstAttributes"; +import { ItemOrigin, SrcInfo } from "./src-info"; -export type ItemOrigin = "stdlib" | "user"; - -let ctx: { origin: ItemOrigin } | null; +const DummyGrammar: Grammar = grammar("Dummy { DummyRule = any }"); +const DUMMY_INTERVAL = DummyGrammar.match("").getInterval(); +export const dummySrcInfo: SrcInfo = new SrcInfo(DUMMY_INTERVAL, null, "user"); -/** - * Information about source code location (file and interval within it) - * and the source code contents. - */ -export class SrcInfo { - readonly #interval: RawInterval; - readonly #file: string | null; - readonly #origin: ItemOrigin; +type Context = { + origin: ItemOrigin | null; + currentFile: string | null; + createNode: FactoryAst["createNode"] | null; +}; - constructor( - interval: RawInterval, - file: string | null, - origin: ItemOrigin, - ) { - this.#interval = interval; - this.#file = file; - this.#origin = origin; - } +const defaultContext: Context = Object.freeze({ + createNode: null, + currentFile: null, + origin: null, +}); - get file() { - return this.#file; - } +let context: Context = defaultContext; - get contents() { - return this.#interval.contents; +const withContext = (ctx: Context, callback: () => T): T => { + try { + context = ctx; + return callback(); + } finally { + context = defaultContext; } +}; - get interval() { - return this.#interval; +function createRef(s: Node): SrcInfo { + if (context.origin === null) { + throwInternalCompilerError("Parser context was not initialized"); } - get origin() { - return this.#origin; - } + return new SrcInfo(s.source, context.currentFile, context.origin); } -const DummyGrammar: Grammar = grammar("Dummy { DummyRule = any }"); -const DUMMY_INTERVAL = DummyGrammar.match("").getInterval(); -export const dummySrcInfo: SrcInfo = new SrcInfo(DUMMY_INTERVAL, null, "user"); - -let currentFile: string | null = null; - -function inFile(path: string, callback: () => T) { - currentFile = path; - const r = callback(); - currentFile = null; - return r; -} +const createNode: FactoryAst["createNode"] = (...args) => { + if (context.createNode === null) { + throwInternalCompilerError("Parser context was not initialized"); + } -function createRef(s: Node): SrcInfo { - return new SrcInfo(s.source, currentFile, ctx!.origin); -} + return context.createNode(...args); +}; // helper to unwrap optional grammar elements (marked with "?") // ohm-js represents those essentially as lists (IterationNodes) @@ -101,7 +81,7 @@ const semantics = tactGrammar.createSemantics(); semantics.addOperation("astOfModule", { Module(imports, items) { - return createAstNode({ + return createNode({ kind: "module", imports: imports.children.map((item) => item.astOfImport()), items: items.children.map((item) => item.astOfModuleItem()), @@ -118,7 +98,7 @@ semantics.addOperation("astOfImport", { createRef(path), ); } - return createAstNode({ + return createNode({ kind: "import", path: pathAST, loc: createRef(this), @@ -135,7 +115,7 @@ semantics.addOperation("astOfJustImports", { semantics.addOperation("astOfModuleItem", { PrimitiveTypeDecl(_primitive_kwd, typeId, _semicolon) { checkVariableName(typeId.sourceString, createRef(typeId)); - return createAstNode({ + return createNode({ kind: "primitive_type_decl", name: typeId.astOfType(), loc: createRef(this), @@ -155,7 +135,7 @@ semantics.addOperation("astOfModuleItem", { _semicolon, ) { checkVariableName(tactId.sourceString, createRef(tactId)); - return createAstNode({ + return createNode({ kind: "native_function_decl", attributes: funAttributes.children.map((a) => a.astOfFunctionAttributes(), @@ -169,7 +149,7 @@ semantics.addOperation("astOfModuleItem", { }, StructDecl_regular(_structKwd, typeId, _lbrace, fields, _rbrace) { checkVariableName(typeId.sourceString, createRef(typeId)); - return createAstNode({ + return createNode({ kind: "struct_decl", name: typeId.astOfType(), fields: fields.astsOfList(), @@ -187,7 +167,7 @@ semantics.addOperation("astOfModuleItem", { _rbrace, ) { checkVariableName(typeId.sourceString, createRef(typeId)); - return createAstNode({ + return createNode({ kind: "message_decl", name: typeId.astOfType(), fields: fields.astsOfList(), @@ -208,7 +188,7 @@ semantics.addOperation("astOfModuleItem", { _rbrace, ) { checkVariableName(contractId.sourceString, createRef(contractId)); - return createAstNode({ + return createNode({ kind: "contract", name: contractId.astOfExpression(), attributes: attributes.children.map((ca) => @@ -232,7 +212,7 @@ semantics.addOperation("astOfModuleItem", { _rbrace, ) { checkVariableName(traitId.sourceString, createRef(traitId)); - return createAstNode({ + return createNode({ kind: "trait", name: traitId.astOfExpression(), attributes: attributes.children.map((ca) => @@ -276,7 +256,7 @@ semantics.addOperation("astOfItem", { a.astOfConstAttribute(), ) as AstConstantAttribute[]; checkConstAttributes(false, attributes, createRef(this)); - return createAstNode({ + return createNode({ kind: "constant_def", name: constId.astOfExpression(), type: constType.astOfType(), @@ -297,7 +277,7 @@ semantics.addOperation("astOfItem", { a.astOfConstAttribute(), ) as AstConstantAttribute[]; checkConstAttributes(true, attributes, createRef(this)); - return createAstNode({ + return createNode({ kind: "constant_decl", name: constId.astOfExpression(), type: constType.astOfType(), @@ -324,7 +304,7 @@ semantics.addOperation("astOfItem", { ) as AstFunctionAttribute[]; checkVariableName(funId.sourceString, createRef(funId)); checkFunctionAttributes(false, attributes, createRef(this)); - return createAstNode({ + return createNode({ kind: "function_def", attributes, name: funId.astOfExpression(), @@ -356,7 +336,7 @@ semantics.addOperation("astOfItem", { ) as AstFunctionAttribute[]; checkVariableName(funId.sourceString, createRef(funId)); checkFunctionAttributes(false, attributes, createRef(this)); - return createAstNode({ + return createNode({ kind: "asm_function_def", shuffle, attributes, @@ -383,7 +363,7 @@ semantics.addOperation("astOfItem", { ) as AstFunctionAttribute[]; checkVariableName(funId.sourceString, createRef(funId)); checkFunctionAttributes(true, attributes, createRef(this)); - return createAstNode({ + return createNode({ kind: "function_decl", attributes, name: funId.astOfExpression(), @@ -393,7 +373,7 @@ semantics.addOperation("astOfItem", { }); }, ContractInit(_initKwd, initParameters, _lbrace, initBody, _rbrace) { - return createAstNode({ + return createNode({ kind: "contract_init", params: initParameters.astsOfList(), statements: initBody.children.map((s) => s.astOfStatement()), @@ -416,7 +396,7 @@ semantics.addOperation("astOfItem", { param: optParam.astOfDeclaration(), } : { kind: "internal-fallback" }; - return createAstNode({ + return createNode({ kind: "receiver", selector, statements: receiverBody.children.map((s) => s.astOfStatement()), @@ -432,7 +412,7 @@ semantics.addOperation("astOfItem", { receiverBody, _rbrace, ) { - return createAstNode({ + return createNode({ kind: "receiver", selector: { kind: "internal-comment", @@ -451,7 +431,7 @@ semantics.addOperation("astOfItem", { receiverBody, _rbrace, ) { - return createAstNode({ + return createNode({ kind: "receiver", selector: { kind: "bounce", param: parameter.astOfDeclaration() }, statements: receiverBody.children.map((s) => s.astOfStatement()), @@ -474,7 +454,7 @@ semantics.addOperation("astOfItem", { param: optParam.astOfDeclaration(), } : { kind: "external-fallback" }; - return createAstNode({ + return createNode({ kind: "receiver", selector, statements: receiverBody.children.map((s) => s.astOfStatement()), @@ -490,7 +470,7 @@ semantics.addOperation("astOfItem", { receiverBody, _rbrace, ) { - return createAstNode({ + return createNode({ kind: "receiver", selector: { kind: "external-comment", @@ -720,7 +700,7 @@ semantics.addOperation("astOfDeclaration", { _optEq, optInitializer, ) { - return createAstNode({ + return createNode({ kind: "field_decl", name: id.astOfExpression(), type: type.astOfType() as AstType, @@ -733,7 +713,7 @@ semantics.addOperation("astOfDeclaration", { }, Parameter(id, _colon, type) { checkVariableName(id.sourceString, createRef(id)); - return createAstNode({ + return createNode({ kind: "typed_parameter", name: id.astOfExpression(), type: type.astOfType(), @@ -741,7 +721,7 @@ semantics.addOperation("astOfDeclaration", { }); }, StructFieldInitializer_full(fieldId, _colon, initializer) { - return createAstNode({ + return createNode({ kind: "struct_field_initializer", field: fieldId.astOfExpression(), initializer: initializer.astOfExpression(), @@ -749,7 +729,7 @@ semantics.addOperation("astOfDeclaration", { }); }, StructFieldInitializer_punned(fieldId) { - return createAstNode({ + return createNode({ kind: "struct_field_initializer", field: fieldId.astOfExpression(), initializer: fieldId.astOfExpression(), @@ -773,7 +753,7 @@ semantics.addOperation("astOfStatement", { ) { checkVariableName(id.sourceString, createRef(id)); - return createAstNode({ + return createNode({ kind: "statement_let", name: id.astOfExpression(), type: unwrapOptNode(optType, (t) => t.astOfType()), @@ -782,7 +762,7 @@ semantics.addOperation("astOfStatement", { }); }, StatementReturn(_returnKwd, optExpression, _optSemicolonIfLastStmtInBlock) { - return createAstNode({ + return createNode({ kind: "statement_return", expression: unwrapOptNode(optExpression, (e) => e.astOfExpression(), @@ -791,7 +771,7 @@ semantics.addOperation("astOfStatement", { }); }, StatementExpression(expression, _optSemicolonIfLastStmtInBlock) { - return createAstNode({ + return createNode({ kind: "statement_expression", expression: expression.astOfExpression(), loc: createRef(this), @@ -804,7 +784,7 @@ semantics.addOperation("astOfStatement", { _optSemicolonIfLastStmtInBlock, ) { if (operator.sourceString === "=") { - return createAstNode({ + return createNode({ kind: "statement_assign", path: lvalue.astOfExpression(), expression: expression.astOfExpression(), @@ -854,7 +834,7 @@ semantics.addOperation("astOfStatement", { "Unreachable augmented assignment operator.", ); } - return createAstNode({ + return createNode({ kind: "statement_augmentedassign", path: lvalue.astOfExpression(), op, @@ -864,7 +844,7 @@ semantics.addOperation("astOfStatement", { } }, StatementCondition_noElse(_ifKwd, condition, _lbrace, thenBlock, _rbrace) { - return createAstNode({ + return createNode({ kind: "statement_condition", condition: condition.astOfExpression(), trueStatements: thenBlock.children.map((s) => s.astOfStatement()), @@ -884,7 +864,7 @@ semantics.addOperation("astOfStatement", { elseBlock, _rbraceElse, ) { - return createAstNode({ + return createNode({ kind: "statement_condition", condition: condition.astOfExpression(), trueStatements: thenBlock.children.map((s) => s.astOfStatement()), @@ -902,7 +882,7 @@ semantics.addOperation("astOfStatement", { _elseKwd, elseifClause, ) { - return createAstNode({ + return createNode({ kind: "statement_condition", condition: condition.astOfExpression(), trueStatements: thenBlock.children.map((s) => s.astOfStatement()), @@ -920,7 +900,7 @@ semantics.addOperation("astOfStatement", { loopBody, _rbrace, ) { - return createAstNode({ + return createNode({ kind: "statement_while", condition: condition.astOfExpression(), statements: loopBody.children.map((s) => s.astOfStatement()), @@ -936,7 +916,7 @@ semantics.addOperation("astOfStatement", { loopBody, _rbrace, ) { - return createAstNode({ + return createNode({ kind: "statement_repeat", iterations: iterations.astOfExpression(), statements: loopBody.children.map((s) => s.astOfStatement()), @@ -954,7 +934,7 @@ semantics.addOperation("astOfStatement", { _rparen, _optSemicolonIfLastStmtInBlock, ) { - return createAstNode({ + return createNode({ kind: "statement_until", condition: condition.astOfExpression(), statements: loopBody.children.map((s) => s.astOfStatement()), @@ -962,7 +942,7 @@ semantics.addOperation("astOfStatement", { }); }, StatementTry_noCatch(_tryKwd, _lbraceTry, tryBlock, _rbraceTry) { - return createAstNode({ + return createNode({ kind: "statement_try", statements: tryBlock.children.map((s) => s.astOfStatement()), loc: createRef(this), @@ -981,7 +961,7 @@ semantics.addOperation("astOfStatement", { catchBlock, _rbraceCatch, ) { - return createAstNode({ + return createNode({ kind: "statement_try_catch", statements: tryBlock.children.map((s) => s.astOfStatement()), catchName: exitCodeId.astOfExpression(), @@ -1004,7 +984,7 @@ semantics.addOperation("astOfStatement", { ) { checkVariableName(keyId.sourceString, createRef(keyId)); checkVariableName(valueId.sourceString, createRef(valueId)); - return createAstNode({ + return createNode({ kind: "statement_foreach", keyName: keyId.astOfExpression(), valueName: valueId.astOfExpression(), @@ -1024,7 +1004,7 @@ semantics.addOperation("astOfStatement", { expression, _semicolon, ) { - return createAstNode({ + return createNode({ kind: "statement_destruct", type: typeId.astOfType(), identifiers: identifiers @@ -1053,7 +1033,7 @@ semantics.addOperation("astOfStatement", { semantics.addOperation("astOfType", { typeId(firstTactTypeIdCharacter, restOfTactTypeId) { - return createAstNode({ + return createNode({ kind: "type_id", text: firstTactTypeIdCharacter.sourceString + @@ -1062,7 +1042,7 @@ semantics.addOperation("astOfType", { }); }, Type_optional(typeId, _questionMark) { - return createAstNode({ + return createNode({ kind: "optional_type", typeArg: typeId.astOfType(), loc: createRef(this), @@ -1083,7 +1063,7 @@ semantics.addOperation("astOfType", { optValueStorageType, _rangle, ) { - return createAstNode({ + return createNode({ kind: "map_type", keyType: keyTypeId.astOfType(), keyStorageType: unwrapOptNode(optKeyStorageType, (t) => @@ -1097,7 +1077,7 @@ semantics.addOperation("astOfType", { }); }, Type_bounced(_bouncedKwd, _langle, typeId, _rangle) { - return createAstNode({ + return createNode({ kind: "bounced_message_type", messageType: typeId.astOfType(), loc: createRef(this), @@ -1125,7 +1105,7 @@ function baseOfIntLiteral(node: NonterminalNode): AstNumberBase { } function astOfNumber(node: Node): AstNode { - return createAstNode({ + return createNode({ kind: "number", base: baseOfIntLiteral(node), value: bigintOfIntLiteral(node), @@ -1147,38 +1127,38 @@ semantics.addOperation("astOfExpression", { return astOfNumber(this); }, boolLiteral(boolValue) { - return createAstNode({ + return createNode({ kind: "boolean", value: boolValue.sourceString === "true", loc: createRef(this), }); }, id(firstTactIdCharacter, restOfTactId) { - return createAstNode({ + return createNode({ kind: "id", text: firstTactIdCharacter.sourceString + restOfTactId.sourceString, loc: createRef(this), }); }, funcId(firstFuncIdCharacter, restOfFuncId) { - return createAstNode({ + return createNode({ kind: "func_id", text: firstFuncIdCharacter.sourceString + restOfFuncId.sourceString, loc: createRef(this), }); }, null(_nullKwd) { - return createAstNode({ kind: "null", loc: createRef(this) }); + return createNode({ kind: "null", loc: createRef(this) }); }, stringLiteral(_startQuotationMark, string, _endQuotationMark) { - return createAstNode({ + return createNode({ kind: "string", value: string.sourceString, loc: createRef(this), }); }, DestructItem_punned(id) { - return createAstNode({ + return createNode({ kind: "destruct_mapping", field: id.astOfExpression(), name: id.astOfExpression(), @@ -1186,7 +1166,7 @@ semantics.addOperation("astOfExpression", { }); }, DestructItem_regular(idFrom, _colon, id) { - return createAstNode({ + return createNode({ kind: "destruct_mapping", field: idFrom.astOfExpression(), name: id.astOfExpression(), @@ -1194,21 +1174,21 @@ semantics.addOperation("astOfExpression", { }); }, EndOfIdentifiers_regular(_comma) { - return createAstNode({ + return createNode({ kind: "destruct_end", ignoreUnspecifiedFields: false, loc: createRef(this), }); }, EndOfIdentifiers_ignoreUnspecifiedFields(_comma, _dotDot) { - return createAstNode({ + return createNode({ kind: "destruct_end", ignoreUnspecifiedFields: true, loc: createRef(this), }); }, ExpressionAdd_add(left, _plus, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "+", left: left.astOfExpression(), @@ -1217,7 +1197,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionAdd_sub(left, _minus, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "-", left: left.astOfExpression(), @@ -1226,7 +1206,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionMul_div(left, _slash, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "/", left: left.astOfExpression(), @@ -1235,7 +1215,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionMul_mul(left, _star, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "*", left: left.astOfExpression(), @@ -1244,7 +1224,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionMul_rem(left, _percent, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "%", left: left.astOfExpression(), @@ -1253,7 +1233,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionEquality_eq(left, _equalsEquals, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "==", left: left.astOfExpression(), @@ -1262,7 +1242,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionEquality_not(left, _bangEquals, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "!=", left: left.astOfExpression(), @@ -1271,7 +1251,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionCompare_gt(left, _rangle, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: ">", left: left.astOfExpression(), @@ -1280,7 +1260,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionCompare_gte(left, _rangleEquals, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: ">=", left: left.astOfExpression(), @@ -1289,7 +1269,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionCompare_lt(left, _langle, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "<", left: left.astOfExpression(), @@ -1298,7 +1278,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionCompare_lte(left, _langleEquals, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "<=", left: left.astOfExpression(), @@ -1307,7 +1287,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionOr_or(left, _pipePipe, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "||", left: left.astOfExpression(), @@ -1316,7 +1296,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionAnd_and(left, _ampersandAmpersand, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "&&", left: left.astOfExpression(), @@ -1325,7 +1305,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionBitwiseShift_shr(left, _rangleRangle, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: ">>", left: left.astOfExpression(), @@ -1334,7 +1314,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionBitwiseShift_shl(left, _langleLangle, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "<<", left: left.astOfExpression(), @@ -1343,7 +1323,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionBitwiseAnd_bitwiseAnd(left, _ampersand, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "&", left: left.astOfExpression(), @@ -1352,7 +1332,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionBitwiseOr_bitwiseOr(left, _pipe, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "|", left: left.astOfExpression(), @@ -1361,7 +1341,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionBitwiseXor_bitwiseXor(left, _caret, right) { - return createAstNode({ + return createNode({ kind: "op_binary", op: "^", left: left.astOfExpression(), @@ -1372,7 +1352,7 @@ semantics.addOperation("astOfExpression", { // Unary ExpressionUnary_plus(_plus, operand) { - return createAstNode({ + return createNode({ kind: "op_unary", op: "+", operand: operand.astOfExpression(), @@ -1380,7 +1360,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionUnary_minus(_minus, operand) { - return createAstNode({ + return createNode({ kind: "op_unary", op: "-", operand: operand.astOfExpression(), @@ -1388,7 +1368,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionUnary_not(_bang, operand) { - return createAstNode({ + return createNode({ kind: "op_unary", op: "!", operand: operand.astOfExpression(), @@ -1396,7 +1376,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionUnary_bitwiseNot(_tilde, operand) { - return createAstNode({ + return createNode({ kind: "op_unary", op: "~", operand: operand.astOfExpression(), @@ -1407,7 +1387,7 @@ semantics.addOperation("astOfExpression", { return expression.astOfExpression(); }, ExpressionUnboxNotNull(operand, _bangBang) { - return createAstNode({ + return createNode({ kind: "op_unary", op: "!!", operand: operand.astOfExpression(), @@ -1416,7 +1396,7 @@ semantics.addOperation("astOfExpression", { }, ExpressionFieldAccess(source, _dot, fieldId) { - return createAstNode({ + return createNode({ kind: "field_access", aggregate: source.astOfExpression(), field: fieldId.astOfExpression(), @@ -1424,7 +1404,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionMethodCall(source, _dot, methodId, methodArguments) { - return createAstNode({ + return createNode({ kind: "method_call", self: source.astOfExpression(), method: methodId.astOfExpression(), @@ -1433,7 +1413,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionStaticCall(functionId, functionArguments) { - return createAstNode({ + return createNode({ kind: "static_call", function: functionId.astOfExpression(), args: functionArguments.astsOfList(), @@ -1457,7 +1437,7 @@ semantics.addOperation("astOfExpression", { ); } - return createAstNode({ + return createNode({ kind: "struct_instance", type: typeId.astOfType(), args: structFields @@ -1467,7 +1447,7 @@ semantics.addOperation("astOfExpression", { }); }, ExpressionInitOf(_initOfKwd, contractId, initArguments) { - return createAstNode({ + return createNode({ kind: "init_of", contract: contractId.astOfExpression(), args: initArguments.astsOfList(), @@ -1483,7 +1463,7 @@ semantics.addOperation("astOfExpression", { _colon, elseExpression, ) { - return createAstNode({ + return createNode({ kind: "conditional", condition: condition.astOfExpression(), thenBranch: thenExpression.astOfExpression(), @@ -1493,49 +1473,67 @@ semantics.addOperation("astOfExpression", { }, }); -export function parse( - src: string, - path: string, - origin: ItemOrigin, -): AstModule { - return inFile(path, () => { - const matchResult = tactGrammar.match(src); - if (matchResult.failed()) { - throwParseError(matchResult, path, origin); - } - ctx = { origin }; - try { - return semantics(matchResult).astOfModule(); - } finally { - ctx = null; - } - }); -} +export const getParser = (ast: FactoryAst) => { + function parse(src: string, path: string, origin: ItemOrigin): AstModule { + return withContext( + { + currentFile: path, + origin, + createNode: ast.createNode, + }, + () => { + const matchResult = tactGrammar.match(src); + if (matchResult.failed()) { + throwParseError(matchResult, path, origin); + } + return semantics(matchResult).astOfModule(); + }, + ); + } -export function parseExpression(sourceCode: string): AstExpression { - const matchResult = tactGrammar.match(sourceCode, "Expression"); - if (matchResult.failed()) { - throwParseError(matchResult, "", "user"); + function parseExpression(sourceCode: string): AstExpression { + return withContext( + { + currentFile: null, + origin: "user", + createNode: ast.createNode, + }, + () => { + const matchResult = tactGrammar.match(sourceCode, "Expression"); + if (matchResult.failed()) { + throwParseError(matchResult, "", "user"); + } + return semantics(matchResult).astOfExpression(); + }, + ); } - ctx = { origin: "user" }; - return semantics(matchResult).astOfExpression(); -} -export function parseImports( - src: string, - path: string, - origin: ItemOrigin, -): AstImport[] { - return inFile(path, () => { - const matchResult = tactGrammar.match(src, "JustImports"); - if (matchResult.failed()) { - throwParseError(matchResult, path, origin); - } - ctx = { origin }; - try { - return semantics(matchResult).astOfJustImports(); - } finally { - ctx = null; - } - }); -} + function parseImports( + src: string, + path: string, + origin: ItemOrigin, + ): AstImport[] { + return withContext( + { + currentFile: path, + origin, + createNode: ast.createNode, + }, + () => { + const matchResult = tactGrammar.match(src, "JustImports"); + if (matchResult.failed()) { + throwParseError(matchResult, path, origin); + } + return semantics(matchResult).astOfJustImports(); + }, + ); + } + + return { + parse, + parseExpression, + parseImports, + }; +}; + +export type Parser = ReturnType; diff --git a/src/grammar/index.ts b/src/grammar/index.ts new file mode 100644 index 000000000..749fc50c3 --- /dev/null +++ b/src/grammar/index.ts @@ -0,0 +1,3 @@ +export { dummySrcInfo, getParser, Parser } from "./grammar"; + +export { ItemOrigin, SrcInfo } from "./src-info"; diff --git a/src/grammar/rename.ts b/src/grammar/rename.ts index c77210210..391ab1051 100644 --- a/src/grammar/rename.ts +++ b/src/grammar/rename.ts @@ -17,9 +17,9 @@ import { AstNode, AstFunctionAttribute, } from "./ast"; -import { dummySrcInfo } from "./grammar"; import { AstSorter } from "./sort"; import { AstHasher, AstHash } from "./hash"; +import { dummySrcInfo } from "./grammar"; type GivenName = string; diff --git a/src/grammar/src-info.ts b/src/grammar/src-info.ts new file mode 100644 index 000000000..54ddf7248 --- /dev/null +++ b/src/grammar/src-info.ts @@ -0,0 +1,39 @@ +import { Interval as RawInterval } from "ohm-js"; + +export type ItemOrigin = "stdlib" | "user"; + +/** + * Information about source code location (file and interval within it) + * and the source code contents. + */ +export class SrcInfo { + readonly #interval: RawInterval; + readonly #file: string | null; + readonly #origin: ItemOrigin; + + constructor( + interval: RawInterval, + file: string | null, + origin: ItemOrigin, + ) { + this.#interval = interval; + this.#file = file; + this.#origin = origin; + } + + get file() { + return this.#file; + } + + get contents() { + return this.#interval.contents; + } + + get interval() { + return this.#interval; + } + + get origin() { + return this.#origin; + } +} diff --git a/src/grammar/store.ts b/src/grammar/store.ts index db6403278..651a13e4c 100644 --- a/src/grammar/store.ts +++ b/src/grammar/store.ts @@ -8,7 +8,8 @@ import { } from "./ast"; import { throwInternalCompilerError } from "../errors"; import { CompilerContext, createContextStore } from "../context"; -import { ItemOrigin, parse } from "./grammar"; +import { ItemOrigin } from "./src-info"; +import { Parser } from "./grammar"; /** * @public @@ -51,9 +52,12 @@ export function getRawAST(ctx: CompilerContext): AstStore { * Parses multiple Tact source files into AST modules. * @public */ -export function parseModules(sources: TactSource[]): AstModule[] { +export function parseModules( + sources: TactSource[], + parser: Parser, +): AstModule[] { return sources.map((source) => - parse(source.code, source.path, source.origin), + parser.parse(source.code, source.path, source.origin), ); } @@ -68,9 +72,12 @@ export function openContext( ctx: CompilerContext, sources: TactSource[], funcSources: { code: string; path: string }[], + parser: Parser, parsedModules?: AstModule[], ): CompilerContext { - const modules = parsedModules ? parsedModules : parseModules(sources); + const modules = parsedModules + ? parsedModules + : parseModules(sources, parser); const types: AstTypeDecl[] = []; const functions: ( | AstNativeFunctionDecl diff --git a/src/grammar/test/expr-equality.spec.ts b/src/grammar/test/expr-equality.spec.ts index ff10859c6..77fe1614e 100644 --- a/src/grammar/test/expr-equality.spec.ts +++ b/src/grammar/test/expr-equality.spec.ts @@ -1,5 +1,5 @@ -import { __DANGER_resetNodeId, eqExpressions } from "../ast"; -import { parseExpression } from "../grammar"; +import { eqExpressions, getAstFactory } from "../ast"; +import { getParser } from "../"; type Test = { expr1: string; expr2: string; equality: boolean }; @@ -366,15 +366,14 @@ const initOfExpressions: Test[] = [ ]; function testEquality(expr1: string, expr2: string, equal: boolean) { + const ast = getAstFactory(); + const { parseExpression } = getParser(ast); expect(eqExpressions(parseExpression(expr1), parseExpression(expr2))).toBe( equal, ); } describe("expression-equality", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); it("should correctly determine if two expressions involving values are equal or not.", () => { valueExpressions.forEach((test) => { testEquality(test.expr1, test.expr2, test.equality); diff --git a/src/grammar/test/expr-is-value.spec.ts b/src/grammar/test/expr-is-value.spec.ts index f26a23535..0ebee15cb 100644 --- a/src/grammar/test/expr-is-value.spec.ts +++ b/src/grammar/test/expr-is-value.spec.ts @@ -1,7 +1,7 @@ //type Test = { expr: string; isValue: boolean }; -import { __DANGER_resetNodeId, isValue } from "../ast"; -import { parseExpression } from "../grammar"; +import { getAstFactory, isValue } from "../ast"; +import { getParser } from "../"; const valueExpressions: string[] = [ "1", @@ -52,13 +52,12 @@ const notValueExpressions: string[] = [ ]; function testIsValue(expr: string, testResult: boolean) { + const ast = getAstFactory(); + const { parseExpression } = getParser(ast); expect(isValue(parseExpression(expr))).toBe(testResult); } describe("expression-is-value", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); valueExpressions.forEach((test) => { it(`should correctly determine that '${test}' is a value expression.`, () => { testIsValue(test, true); diff --git a/src/imports/resolveImports.spec.ts b/src/imports/resolveImports.spec.ts index 25b805cbf..8b65f14da 100644 --- a/src/imports/resolveImports.spec.ts +++ b/src/imports/resolveImports.spec.ts @@ -1,6 +1,8 @@ import { resolveImports } from "./resolveImports"; import { createNodeFileSystem } from "../vfs/createNodeFileSystem"; import path from "path"; +import { getParser } from "../grammar"; +import { getAstFactory } from "../grammar/ast"; describe("resolveImports", () => { it("should resolve imports", () => { @@ -10,10 +12,12 @@ describe("resolveImports", () => { const stdlib = createNodeFileSystem( path.resolve(__dirname, "__testdata", "stdlib"), ); + const ast = getAstFactory(); const resolved = resolveImports({ project, stdlib, entrypoint: "./main.tact", + parser: getParser(ast), }); expect(resolved).toMatchObject({ func: [ diff --git a/src/imports/resolveImports.ts b/src/imports/resolveImports.ts index 0dd8915af..b88c066cf 100644 --- a/src/imports/resolveImports.ts +++ b/src/imports/resolveImports.ts @@ -1,4 +1,4 @@ -import { ItemOrigin, parseImports } from "../grammar/grammar"; +import { ItemOrigin, Parser } from "../grammar"; import { VirtualFileSystem } from "../vfs/VirtualFileSystem"; import { throwCompilationError } from "../errors"; import { resolveLibrary } from "./resolveLibrary"; @@ -7,6 +7,7 @@ export function resolveImports(args: { entrypoint: string; project: VirtualFileSystem; stdlib: VirtualFileSystem; + parser: Parser; }) { // // Load stdlib and entrypoint @@ -40,7 +41,7 @@ export function resolveImports(args: { const processed: Set = new Set(); const pending: { code: string; path: string; origin: ItemOrigin }[] = []; function processImports(source: string, path: string, origin: ItemOrigin) { - const imp = parseImports(source, path, origin); + const imp = args.parser.parseImports(source, path, origin); for (const i of imp) { const importPath = i.path.value; // Resolve library diff --git a/src/interpreter.ts b/src/interpreter.ts index 8a40737c3..66424fe2a 100644 --- a/src/interpreter.ts +++ b/src/interpreter.ts @@ -31,6 +31,7 @@ import { AstOpBinary, AstOpUnary, AstPrimitiveTypeDecl, + FactoryAst, AstStatement, AstStatementAssign, AstStatementAugmentedAssign, @@ -51,10 +52,11 @@ import { AstTrait, AstUnaryOperation, eqNames, + getAstFactory, idText, isSelfId, } from "./grammar/ast"; -import { SrcInfo, dummySrcInfo, parseExpression } from "./grammar/grammar"; +import { SrcInfo, dummySrcInfo, Parser, getParser } from "./grammar"; import { divFloor, modFloor } from "./optimizer/util"; import { getStaticConstant, @@ -598,9 +600,13 @@ class EnvironmentStack { } } -export function parseAndEvalExpression(sourceCode: string): EvalResult { +export function parseAndEvalExpression( + sourceCode: string, + ast: FactoryAst = getAstFactory(), + parser: Parser = getParser(ast), +): EvalResult { try { - const ast = parseExpression(sourceCode); + const ast = parser.parseExpression(sourceCode); const constEvalResult = evalConstantExpression( ast, new CompilerContext(), diff --git a/src/optimizer/algebraic.ts b/src/optimizer/algebraic.ts index 27c1bdb86..bfde705b7 100644 --- a/src/optimizer/algebraic.ts +++ b/src/optimizer/algebraic.ts @@ -13,9 +13,6 @@ import { checkIsName, checkIsNumber, checkIsUnaryOpNode, - makeBinaryExpression, - makeUnaryExpression, - makeValueExpression, } from "./util"; export class AddZero extends Rule { @@ -23,7 +20,7 @@ export class AddZero extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -49,7 +46,7 @@ export class AddZero extends Rule { const op = topLevelNode.op; if (op === "-") { - return makeUnaryExpression("-", x); + return util.makeUnaryExpression("-", x); } else { return x; } @@ -66,7 +63,7 @@ export class AddZero extends Rule { export class MultiplyZero extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -78,7 +75,7 @@ export class MultiplyZero extends Rule { // The tree has this form: // x * 0, where x is an identifier - return makeValueExpression(0n); + return util.makeValueExpression(0n); } else if ( checkIsNumber(topLevelNode.left, 0n) && checkIsName(topLevelNode.right) @@ -86,7 +83,7 @@ export class MultiplyZero extends Rule { // The tree has this form: // 0 * x, where x is an identifier - return makeValueExpression(0n); + return util.makeValueExpression(0n); } } } @@ -138,7 +135,7 @@ export class MultiplyOne extends Rule { export class SubtractSelf extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -155,7 +152,7 @@ export class SubtractSelf extends Rule { const y = topLevelNode.right; if (eqExpressions(x, y)) { - return makeValueExpression(0n); + return util.makeValueExpression(0n); } } } @@ -170,7 +167,7 @@ export class SubtractSelf extends Rule { export class AddSelf extends Rule { public applyRule( ast: AstExpression, - optimizer: ExpressionTransformer, + { applyRules, util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -187,14 +184,14 @@ export class AddSelf extends Rule { const y = topLevelNode.right; if (eqExpressions(x, y)) { - const res = makeBinaryExpression( + const res = util.makeBinaryExpression( "*", x, - makeValueExpression(2n), + util.makeValueExpression(2n), ); // Since we joined the tree, there is further opportunity // for simplification - return optimizer.applyRules(res); + return applyRules(res); } } } @@ -209,7 +206,7 @@ export class AddSelf extends Rule { export class OrTrue extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -222,12 +219,12 @@ export class OrTrue extends Rule { // The tree has this form: // x || true, where x is an identifier or a value - return makeValueExpression(true); + return util.makeValueExpression(true); } else if (checkIsBoolean(topLevelNode.left, true)) { // The tree has this form: // true || x - return makeValueExpression(true); + return util.makeValueExpression(true); } } } @@ -241,7 +238,7 @@ export class OrTrue extends Rule { export class AndFalse extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -254,12 +251,12 @@ export class AndFalse extends Rule { // The tree has this form: // x && false, where x is an identifier or a value - return makeValueExpression(false); + return util.makeValueExpression(false); } else if (checkIsBoolean(topLevelNode.left, false)) { // The tree has this form: // false && x - return makeValueExpression(false); + return util.makeValueExpression(false); } } } @@ -391,7 +388,7 @@ export class AndSelf extends Rule { export class ExcludedMiddle extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -411,7 +408,7 @@ export class ExcludedMiddle extends Rule { (checkIsName(x) || isValue(x)) && eqExpressions(x, y) ) { - return makeValueExpression(true); + return util.makeValueExpression(true); } } } else if (checkIsUnaryOpNode(topLevelNode.left)) { @@ -429,7 +426,7 @@ export class ExcludedMiddle extends Rule { (checkIsName(x) || isValue(x)) && eqExpressions(x, y) ) { - return makeValueExpression(true); + return util.makeValueExpression(true); } } } @@ -445,7 +442,7 @@ export class ExcludedMiddle extends Rule { export class Contradiction extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -465,7 +462,7 @@ export class Contradiction extends Rule { (checkIsName(x) || isValue(x)) && eqExpressions(x, y) ) { - return makeValueExpression(false); + return util.makeValueExpression(false); } } } else if (checkIsUnaryOpNode(topLevelNode.left)) { @@ -483,7 +480,7 @@ export class Contradiction extends Rule { (checkIsName(x) || isValue(x)) && eqExpressions(x, y) ) { - return makeValueExpression(false); + return util.makeValueExpression(false); } } } @@ -527,7 +524,7 @@ export class DoubleNegation extends Rule { export class NegateTrue extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsUnaryOpNode(ast)) { const topLevelNode = ast as AstOpUnary; @@ -536,7 +533,7 @@ export class NegateTrue extends Rule { // The tree has this form // !true - return makeValueExpression(false); + return util.makeValueExpression(false); } } } @@ -550,7 +547,7 @@ export class NegateTrue extends Rule { export class NegateFalse extends Rule { public applyRule( ast: AstExpression, - _optimizer: ExpressionTransformer, + { util }: ExpressionTransformer, ): AstExpression { if (checkIsUnaryOpNode(ast)) { const topLevelNode = ast as AstOpUnary; @@ -559,7 +556,7 @@ export class NegateFalse extends Rule { // The tree has this form // !false - return makeValueExpression(true); + return util.makeValueExpression(true); } } } diff --git a/src/optimizer/associative.ts b/src/optimizer/associative.ts index 865872588..bdb26e4d9 100644 --- a/src/optimizer/associative.ts +++ b/src/optimizer/associative.ts @@ -16,9 +16,8 @@ import { checkIsBinaryOp_With_RightValue, checkIsBinaryOp_With_LeftValue, extractValue, - makeBinaryExpression, - makeValueExpression, sign, + AstUtil, } from "./util"; type TransformData = { @@ -26,7 +25,12 @@ type TransformData = { safetyCondition: boolean; }; -type Transform = (x1: AstExpression, c1: Value, c2: Value) => TransformData; +type Transform = ( + x1: AstExpression, + c1: Value, + c2: Value, + util: AstUtil, +) => TransformData; /* A simple wrapper function to transform the right value in a binary operator to a continuation so that we can call the evaluation function in the interpreter module @@ -122,7 +126,7 @@ abstract class AllowableOpRule extends AssociativeRewriteRule { export class AssociativeRule1 extends AllowableOpRule { public applyRule( ast: AstExpression, - optimizer: ExpressionTransformer, + { applyRules, util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -171,11 +175,11 @@ export class AssociativeRule1 extends AllowableOpRule { // Because we are joining x1 and x2, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newLeft = optimizer.applyRules( - makeBinaryExpression(op1, x1, x2), + const newLeft = applyRules( + util.makeBinaryExpression(op1, x1, x2), ); - const newRight = makeValueExpression(val); - return makeBinaryExpression(op, newLeft, newRight); + const newRight = util.makeValueExpression(val); + return util.makeBinaryExpression(op, newLeft, newRight); } catch (e) { // Do nothing: will exit rule without modifying tree } @@ -225,11 +229,11 @@ export class AssociativeRule1 extends AllowableOpRule { // Because we are joining x1 and val, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newValNode = makeValueExpression(val); - const newLeft = optimizer.applyRules( - makeBinaryExpression(op1, x1, newValNode), + const newValNode = util.makeValueExpression(val); + const newLeft = applyRules( + util.makeBinaryExpression(op1, x1, newValNode), ); - return makeBinaryExpression(op2, newLeft, x2); + return util.makeBinaryExpression(op2, newLeft, x2); } catch (e) { // Do nothing: will exit rule without modifying tree } @@ -281,11 +285,11 @@ export class AssociativeRule1 extends AllowableOpRule { // Because we are joining x2 and val, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newValNode = makeValueExpression(val); - const newLeft = optimizer.applyRules( - makeBinaryExpression(op2, x2, newValNode), + const newValNode = util.makeValueExpression(val); + const newLeft = applyRules( + util.makeBinaryExpression(op2, x2, newValNode), ); - return makeBinaryExpression(op1, newLeft, x1); + return util.makeBinaryExpression(op1, newLeft, x1); } catch (e) { // Do nothing: will exit rule without modifying tree } @@ -335,11 +339,11 @@ export class AssociativeRule1 extends AllowableOpRule { // Because we are joining x1 and x2, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newRight = optimizer.applyRules( - makeBinaryExpression(op2, x1, x2), + const newRight = applyRules( + util.makeBinaryExpression(op2, x1, x2), ); - const newLeft = makeValueExpression(val); - return makeBinaryExpression(op, newLeft, newRight); + const newLeft = util.makeValueExpression(val); + return util.makeBinaryExpression(op, newLeft, newRight); } catch (e) { // Do nothing: will exit rule without modifying tree } @@ -360,7 +364,7 @@ export class AssociativeRule1 extends AllowableOpRule { export class AssociativeRule2 extends AllowableOpRule { public applyRule( ast: AstExpression, - optimizer: ExpressionTransformer, + { applyRules, util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -396,10 +400,10 @@ export class AssociativeRule2 extends AllowableOpRule { // Because we are joining x1 and x2, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newLeft = optimizer.applyRules( - makeBinaryExpression(op1, x1, x2), + const newLeft = applyRules( + util.makeBinaryExpression(op1, x1, x2), ); - return makeBinaryExpression(op, newLeft, c1); + return util.makeBinaryExpression(op, newLeft, c1); } } else if ( checkIsBinaryOp_With_LeftValue(topLevelNode.left) && @@ -431,10 +435,10 @@ export class AssociativeRule2 extends AllowableOpRule { // Because we are joining x1 and x2, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newRight = optimizer.applyRules( - makeBinaryExpression(op, x1, x2), + const newRight = applyRules( + util.makeBinaryExpression(op, x1, x2), ); - return makeBinaryExpression(op1, c1, newRight); + return util.makeBinaryExpression(op1, c1, newRight); } } else if ( !isValue(topLevelNode.left) && @@ -466,10 +470,10 @@ export class AssociativeRule2 extends AllowableOpRule { // Because we are joining x1 and x2, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newLeft = optimizer.applyRules( - makeBinaryExpression(op, x2, x1), + const newLeft = applyRules( + util.makeBinaryExpression(op, x2, x1), ); - return makeBinaryExpression(op1, newLeft, c1); + return util.makeBinaryExpression(op1, newLeft, c1); } } else if ( !isValue(topLevelNode.left) && @@ -503,10 +507,10 @@ export class AssociativeRule2 extends AllowableOpRule { // Because we are joining x1 and x2, // there is further opportunity of simplification, // So, we ask the evaluator to apply all the rules in the subtree. - const newRight = optimizer.applyRules( - makeBinaryExpression(op1, x2, x1), + const newRight = applyRules( + util.makeBinaryExpression(op1, x2, x1), ); - return makeBinaryExpression(op, c1, newRight); + return util.makeBinaryExpression(op, c1, newRight); } } } @@ -622,12 +626,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: (x1 + c1) + c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression: x1 + (c1 + c2) const val_ = evalBinaryOp("+", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", x1, val_node, @@ -644,12 +648,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: (x1 + c1) - c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression: x1 + (c1 - c2) const val_ = evalBinaryOp("-", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", x1, val_node, @@ -671,12 +675,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: (x1 - c1) + c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 - (c1 - c2) const val_ = evalBinaryOp("-", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", x1, val_node, @@ -693,12 +697,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: (x1 - c1) - c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 - (c1 + c2) const val_ = evalBinaryOp("+", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", x1, val_node, @@ -720,12 +724,12 @@ export class AssociativeRule3 extends Rule { [ "*", // original expression: (x1 * c1) * c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 * (c1 * c2) const val_ = evalBinaryOp("*", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "*", x1, val_node, @@ -747,12 +751,12 @@ export class AssociativeRule3 extends Rule { [ "&&", // original expression: (x1 && c1) && c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 && (c1 && c2) const val_ = evalBinaryOp("&&", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "&&", x1, val_node, @@ -770,12 +774,12 @@ export class AssociativeRule3 extends Rule { [ "||", // original expression: (x1 || c1) || c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 || (c1 || c2) const val_ = evalBinaryOp("||", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "||", x1, val_node, @@ -807,12 +811,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: c2 + (c1 + x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 + c1) + x1 const val_ = evalBinaryOp("+", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", val_node, x1, @@ -829,12 +833,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: c2 + (c1 - x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 + c1) - x1 const val_ = evalBinaryOp("+", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", val_node, x1, @@ -856,12 +860,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: c2 - (c1 + x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 - c1) - x1 const val_ = evalBinaryOp("-", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", val_node, x1, @@ -878,12 +882,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: c2 - (c1 - x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 - c1) + x1 const val_ = evalBinaryOp("-", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", val_node, x1, @@ -906,12 +910,12 @@ export class AssociativeRule3 extends Rule { "*", // original expression: c2 * (c1 * x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 * c1) * x1 const val_ = evalBinaryOp("*", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "*", val_node, x1, @@ -934,12 +938,12 @@ export class AssociativeRule3 extends Rule { "&&", // original expression: c2 && (c1 && x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 && c1) && x1 const val_ = evalBinaryOp("&&", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "&&", val_node, x1, @@ -958,12 +962,12 @@ export class AssociativeRule3 extends Rule { "||", // original expression: c2 || (c1 || x1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 || c1) || x1 const val_ = evalBinaryOp("||", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "||", val_node, x1, @@ -995,12 +999,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: c2 + (x1 + c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 + (c2 + c1) const val_ = evalBinaryOp("+", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", x1, val_node, @@ -1017,12 +1021,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: c2 + (x1 - c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression x1 - (c1 - c2) const val_ = evalBinaryOp("-", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", x1, val_node, @@ -1044,12 +1048,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: c2 - (x1 + c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 - c1) - x1 const val_ = evalBinaryOp("-", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", val_node, x1, @@ -1066,12 +1070,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: c2 - (x1 - c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // final expression (c2 + c1) - x1 const val_ = evalBinaryOp("+", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", val_node, x1, @@ -1094,12 +1098,12 @@ export class AssociativeRule3 extends Rule { [ "*", // original expression: c2 * (x1 * c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { // Final expression x1 * (c2 * c1) const val_ = evalBinaryOp("*", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "*", x1, val_node, @@ -1120,13 +1124,13 @@ export class AssociativeRule3 extends Rule { [ "&&", // original expression: c2 && (x1 && c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { const val_ = evalBinaryOp("&&", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); let final_expr; if (c2 === true) { // Final expression x1 && (c2 && c1) - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "&&", x1, val_node, @@ -1136,7 +1140,7 @@ export class AssociativeRule3 extends Rule { // Note that by the safety condition, // at this point c1 = true. - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "&&", val_node, x1, @@ -1157,13 +1161,13 @@ export class AssociativeRule3 extends Rule { [ "||", // original expression: c2 || (x1 || c1) - (x1, c1, c2) => { + (x1, c1, c2, util) => { const val_ = evalBinaryOp("||", c2, c1); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); let final_expr; if (c2 === false) { // Final expression x1 || (c2 || c1) - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "||", x1, val_node, @@ -1173,7 +1177,7 @@ export class AssociativeRule3 extends Rule { // Note that by the safety condition, // at this point c1 = false. - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "||", val_node, x1, @@ -1207,12 +1211,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: (c1 + x1) + c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // Final expression (c1 + c2) + x1 const val_ = evalBinaryOp("+", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", val_node, x1, @@ -1229,12 +1233,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: (c1 + x1) - c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // Final expression (c1 - c2) + x1 const val_ = evalBinaryOp("-", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "+", val_node, x1, @@ -1256,12 +1260,12 @@ export class AssociativeRule3 extends Rule { [ "+", // original expression: (c1 - x1) + c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // Final expression (c1 + c2) - x1 const val_ = evalBinaryOp("+", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", val_node, x1, @@ -1278,12 +1282,12 @@ export class AssociativeRule3 extends Rule { [ "-", // original expression: (c1 - x1) - c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // Final expression (c1 - c2) - x1 const val_ = evalBinaryOp("-", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "-", val_node, x1, @@ -1305,12 +1309,12 @@ export class AssociativeRule3 extends Rule { [ "*", // original expression: (c1 * x1) * c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { // Final expression (c1 * c2) * x1 const val_ = evalBinaryOp("*", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); return { - simplifiedExpression: makeBinaryExpression( + simplifiedExpression: util.makeBinaryExpression( "*", val_node, x1, @@ -1332,13 +1336,13 @@ export class AssociativeRule3 extends Rule { [ "&&", // original expression: (c1 && x1) && c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { const val_ = evalBinaryOp("&&", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); let final_expr; if (c2 === true) { // Final expression (c1 && c2) && x1 - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "&&", val_node, x1, @@ -1348,7 +1352,7 @@ export class AssociativeRule3 extends Rule { // Note that by the safety condition, // at this point c1 = true. - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "&&", x1, val_node, @@ -1369,13 +1373,13 @@ export class AssociativeRule3 extends Rule { [ "||", // original expression: (c1 || x1) || c2 - (x1, c1, c2) => { + (x1, c1, c2, util) => { const val_ = evalBinaryOp("||", c1, c2); - const val_node = makeValueExpression(val_); + const val_node = util.makeValueExpression(val_); let final_expr; if (c2 === false) { // Final expression (c1 || c2) || x1 - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "||", val_node, x1, @@ -1385,7 +1389,7 @@ export class AssociativeRule3 extends Rule { // Note that by the safety condition, // at this point c1 = false. - final_expr = makeBinaryExpression( + final_expr = util.makeBinaryExpression( "||", x1, val_node, @@ -1456,7 +1460,7 @@ export class AssociativeRule3 extends Rule { public applyRule( ast: AstExpression, - optimizer: ExpressionTransformer, + { applyRules, util }: ExpressionTransformer, ): AstExpression { if (checkIsBinaryOpNode(ast)) { const topLevelNode = ast as AstOpBinary; @@ -1483,12 +1487,13 @@ export class AssociativeRule3 extends Rule { x1, c1, c2, + util, ); if (data.safetyCondition) { // Since the tree is simpler now, there is further // opportunity for simplification that was missed // previously - return optimizer.applyRules(data.simplifiedExpression); + return applyRules(data.simplifiedExpression); } } catch (e) { // Do nothing: will exit rule without modifying tree @@ -1516,12 +1521,13 @@ export class AssociativeRule3 extends Rule { x1, c1, c2, + util, ); if (data.safetyCondition) { // Since the tree is simpler now, there is further // opportunity for simplification that was missed // previously - return optimizer.applyRules(data.simplifiedExpression); + return applyRules(data.simplifiedExpression); } } catch (e) { // Do nothing: will exit rule without modifying tree @@ -1549,12 +1555,13 @@ export class AssociativeRule3 extends Rule { x1, c1, c2, + util, ); if (data.safetyCondition) { // Since the tree is simpler now, there is further // opportunity for simplification that was missed // previously - return optimizer.applyRules(data.simplifiedExpression); + return applyRules(data.simplifiedExpression); } } catch (e) { // Do nothing: will exit rule without modifying tree @@ -1582,12 +1589,13 @@ export class AssociativeRule3 extends Rule { x1, c1, c2, + util, ); if (data.safetyCondition) { // Since the tree is simpler now, there is further // opportunity for simplification that was missed // previously - return optimizer.applyRules(data.simplifiedExpression); + return applyRules(data.simplifiedExpression); } } catch (e) { // Do nothing: will exit rule without modifying tree diff --git a/src/optimizer/standardOptimizer.ts b/src/optimizer/standardOptimizer.ts index 1558be4b2..7df2b4ed9 100644 --- a/src/optimizer/standardOptimizer.ts +++ b/src/optimizer/standardOptimizer.ts @@ -23,16 +23,15 @@ import { AssociativeRule3, } from "./associative"; import { Rule, ExpressionTransformer } from "./types"; +import { AstUtil } from "./util"; type PrioritizedRule = { priority: number; rule: Rule }; // This optimizer uses rules that preserve overflows in integer expressions. -export class StandardOptimizer extends ExpressionTransformer { +export class StandardOptimizer implements ExpressionTransformer { private rules: PrioritizedRule[]; - constructor() { - super(); - + constructor(public util: AstUtil) { this.rules = [ { priority: 0, rule: new AssociativeRule1() }, { priority: 1, rule: new AssociativeRule2() }, @@ -60,11 +59,11 @@ export class StandardOptimizer extends ExpressionTransformer { this.rules.sort((r1, r2) => r1.priority - r2.priority); } - public applyRules(ast: AstExpression): AstExpression { + public applyRules = (ast: AstExpression): AstExpression => { return this.rules.reduce( (prev, prioritizedRule) => prioritizedRule.rule.applyRule(prev, this), ast, ); - } + }; } diff --git a/src/optimizer/test/partial-eval.spec.ts b/src/optimizer/test/partial-eval.spec.ts index db01b6c09..77c1e4ac0 100644 --- a/src/optimizer/test/partial-eval.spec.ts +++ b/src/optimizer/test/partial-eval.spec.ts @@ -1,18 +1,18 @@ import { AstExpression, + FactoryAst, AstValue, - __DANGER_resetNodeId, - cloneAstNode, eqExpressions, + getAstFactory, isValue, } from "../../grammar/ast"; -import { parseExpression } from "../../grammar/grammar"; -import { extractValue, makeValueExpression } from "../util"; -import { partiallyEvalExpression } from "../../constEval"; +import { AstUtil, extractValue, getAstUtil } from "../util"; +import { getOptimizer } from "../../constEval"; import { CompilerContext } from "../../context"; import { ExpressionTransformer, Rule } from "../types"; import { AssociativeRule3 } from "../associative"; import { evalBinaryOp, evalUnaryOp } from "../../interpreter"; +import { getParser } from "../../grammar"; const MAX: string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"; @@ -315,15 +315,21 @@ const booleanExpressions = [ function testExpression(original: string, simplified: string) { it(`should simplify ${original} to ${simplified}`, () => { - expect( - eqExpressions( - partiallyEvalExpression( - parseExpression(original), - new CompilerContext(), - ), - dummyEval(parseExpression(simplified)), - ), - ).toBe(true); + const ast = getAstFactory(); + const { parseExpression } = getParser(ast); + const util = getAstUtil(ast); + const { partiallyEvalExpression } = getOptimizer(util); + const originalValue = partiallyEvalExpression( + parseExpression(original), + new CompilerContext(), + ); + const simplifiedValue = dummyEval( + parseExpression(simplified), + ast, + util, + ); + const areMatching = eqExpressions(originalValue, simplifiedValue); + expect(areMatching).toBe(true); }); } @@ -333,12 +339,19 @@ function testExpressionWithOptimizer( optimizer: ExpressionTransformer, ) { it(`should simplify ${original} to ${simplified}`, () => { - expect( - eqExpressions( - optimizer.applyRules(dummyEval(parseExpression(original))), - dummyEval(parseExpression(simplified)), - ), - ).toBe(true); + const ast = getAstFactory(); + const { parseExpression } = getParser(ast); + const util = getAstUtil(ast); + const originalValue = optimizer.applyRules( + dummyEval(parseExpression(original), ast, util), + ); + const simplifiedValue = dummyEval( + parseExpression(simplified), + ast, + util, + ); + const areMatching = eqExpressions(originalValue, simplifiedValue); + expect(areMatching).toBe(true); }); } @@ -347,101 +360,115 @@ function testExpressionWithOptimizer( // The reason for doing this is that the partial evaluator will actually simplify constant // expressions. So, when comparing for equality of expressions, we also need to simplify // constant expressions. -function dummyEval(ast: AstExpression): AstExpression { - let newNode: AstExpression; - switch (ast.kind) { - case "null": - return ast; - case "boolean": - return ast; - case "number": - return ast; - case "string": - return ast; - case "id": - return ast; - case "method_call": - newNode = cloneAstNode(ast); - newNode.args = ast.args.map(dummyEval); - newNode.self = dummyEval(ast.self); - return newNode; - case "init_of": - newNode = cloneAstNode(ast); - newNode.args = ast.args.map(dummyEval); - return newNode; - case "op_unary": - newNode = cloneAstNode(ast); - newNode.operand = dummyEval(ast.operand); - if (isValue(newNode.operand)) { - return makeValueExpression( - evalUnaryOp( - ast.op, - extractValue(newNode.operand as AstValue), - ), - ); +function dummyEval( + ast: AstExpression, + { cloneNode }: FactoryAst, + { makeValueExpression }: AstUtil, +): AstExpression { + const recurse = (ast: AstExpression): AstExpression => { + switch (ast.kind) { + case "null": + return ast; + case "boolean": + return ast; + case "number": + return ast; + case "string": + return ast; + case "id": + return ast; + case "method_call": { + const newNode = cloneNode(ast); + newNode.args = ast.args.map(recurse); + newNode.self = recurse(ast.self); + return newNode; } - return newNode; - case "op_binary": - newNode = cloneAstNode(ast); - newNode.left = dummyEval(ast.left); - newNode.right = dummyEval(ast.right); - if (isValue(newNode.left) && isValue(newNode.right)) { - const valR = extractValue(newNode.right as AstValue); - return makeValueExpression( - evalBinaryOp( - ast.op, - extractValue(newNode.left as AstValue), - () => valR, - ), - ); + case "init_of": { + const newNode = cloneNode(ast); + newNode.args = ast.args.map(recurse); + return newNode; } - return newNode; - case "conditional": - newNode = cloneAstNode(ast); - newNode.thenBranch = dummyEval(ast.thenBranch); - newNode.elseBranch = dummyEval(ast.elseBranch); - return newNode; - case "struct_instance": - newNode = cloneAstNode(ast); - newNode.args = ast.args.map((param) => { - const newParam = cloneAstNode(param); - newParam.initializer = dummyEval(param.initializer); - return newParam; - }); - return newNode; - case "field_access": - newNode = cloneAstNode(ast); - newNode.aggregate = dummyEval(ast.aggregate); - return newNode; - case "static_call": - newNode = cloneAstNode(ast); - newNode.args = ast.args.map(dummyEval); - return newNode; - } + case "op_unary": { + const newNode = cloneNode(ast); + newNode.operand = recurse(ast.operand); + if (isValue(newNode.operand)) { + return makeValueExpression( + evalUnaryOp( + ast.op, + extractValue(newNode.operand as AstValue), + ), + ); + } + return newNode; + } + case "op_binary": { + const newNode = cloneNode(ast); + newNode.left = recurse(ast.left); + newNode.right = recurse(ast.right); + if (isValue(newNode.left) && isValue(newNode.right)) { + const valR = extractValue(newNode.right as AstValue); + return makeValueExpression( + evalBinaryOp( + ast.op, + extractValue(newNode.left as AstValue), + () => valR, + ), + ); + } + return newNode; + } + case "conditional": { + const newNode = cloneNode(ast); + newNode.thenBranch = recurse(ast.thenBranch); + newNode.elseBranch = recurse(ast.elseBranch); + return newNode; + } + case "struct_instance": { + const newNode = cloneNode(ast); + newNode.args = ast.args.map((param) => { + const newParam = cloneNode(param); + newParam.initializer = recurse(param.initializer); + return newParam; + }); + return newNode; + } + case "field_access": { + const newNode = cloneNode(ast); + newNode.aggregate = recurse(ast.aggregate); + return newNode; + } + case "static_call": { + const newNode = cloneNode(ast); + newNode.args = ast.args.map(recurse); + return newNode; + } + } + }; + + return recurse(ast); } // A dummy optimizer to test specific rules -class ParameterizableDummyOptimizer extends ExpressionTransformer { +class ParameterizableDummyOptimizer implements ExpressionTransformer { private rules: Rule[]; - constructor(rules: Rule[]) { - super(); + public util: AstUtil; + + constructor(rules: Rule[], Ast: FactoryAst) { + this.util = getAstUtil(Ast); this.rules = rules; } - public applyRules(ast: AstExpression): AstExpression { + public applyRules = (ast: AstExpression): AstExpression => { return this.rules.reduce( (prev, rule) => rule.applyRule(prev, this), ast, ); - } + }; } describe("partial-evaluator", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); additiveExpressions.forEach((test) => { testExpression(test.original, test.simplified); }); @@ -452,13 +479,14 @@ describe("partial-evaluator", () => { testExpression(test.original, test.simplified); }); - // For the following cases, we need an optimizer that only - // uses the associative rule 3. - const optimizer = new ParameterizableDummyOptimizer([ - new AssociativeRule3(), - ]); - associativeRuleExpressions.forEach((test) => { + // For the following cases, we need an optimizer that only + // uses the associative rule 3. + const optimizer = new ParameterizableDummyOptimizer( + [new AssociativeRule3()], + getAstFactory(), + ); + testExpressionWithOptimizer(test.original, test.simplified, optimizer); }); diff --git a/src/optimizer/types.ts b/src/optimizer/types.ts index bbd871efb..d4011c138 100644 --- a/src/optimizer/types.ts +++ b/src/optimizer/types.ts @@ -1,7 +1,9 @@ import { AstExpression } from "../grammar/ast"; +import { AstUtil } from "./util"; -export abstract class ExpressionTransformer { - public abstract applyRules(ast: AstExpression): AstExpression; +export interface ExpressionTransformer { + util: AstUtil; + applyRules(ast: AstExpression): AstExpression; } export abstract class Rule { diff --git a/src/optimizer/util.ts b/src/optimizer/util.ts index 4b98ab779..dc6ff85bd 100644 --- a/src/optimizer/util.ts +++ b/src/optimizer/util.ts @@ -2,11 +2,11 @@ import { AstExpression, AstUnaryOperation, AstBinaryOperation, - createAstNode, AstValue, isValue, + FactoryAst, } from "../grammar/ast"; -import { dummySrcInfo } from "../grammar/grammar"; +import { dummySrcInfo } from "../grammar"; import { throwInternalCompilerError } from "../errors"; import { Value } from "../types/types"; @@ -25,71 +25,81 @@ export function extractValue(ast: AstValue): Value { } } -export function makeValueExpression(value: Value): AstValue { - if (value === null) { - const result = createAstNode({ - kind: "null", - loc: dummySrcInfo, - }); - return result as AstValue; - } - if (typeof value === "string") { - const result = createAstNode({ - kind: "string", - value: value, - loc: dummySrcInfo, - }); - return result as AstValue; +export const getAstUtil = ({ createNode }: FactoryAst) => { + function makeValueExpression(value: Value): AstValue { + if (value === null) { + const result = createNode({ + kind: "null", + loc: dummySrcInfo, + }); + return result as AstValue; + } + if (typeof value === "string") { + const result = createNode({ + kind: "string", + value: value, + loc: dummySrcInfo, + }); + return result as AstValue; + } + if (typeof value === "bigint") { + const result = createNode({ + kind: "number", + base: 10, + value: value, + loc: dummySrcInfo, + }); + return result as AstValue; + } + if (typeof value === "boolean") { + const result = createNode({ + kind: "boolean", + value: value, + loc: dummySrcInfo, + }); + return result as AstValue; + } + throwInternalCompilerError( + `structs, addresses, cells, and comment values are not supported at the moment.`, + ); } - if (typeof value === "bigint") { - const result = createAstNode({ - kind: "number", - base: 10, - value: value, + + function makeUnaryExpression( + op: AstUnaryOperation, + operand: AstExpression, + ): AstExpression { + const result = createNode({ + kind: "op_unary", + op: op, + operand: operand, loc: dummySrcInfo, }); - return result as AstValue; + return result as AstExpression; } - if (typeof value === "boolean") { - const result = createAstNode({ - kind: "boolean", - value: value, + + function makeBinaryExpression( + op: AstBinaryOperation, + left: AstExpression, + right: AstExpression, + ): AstExpression { + const result = createNode({ + kind: "op_binary", + op: op, + left: left, + right: right, loc: dummySrcInfo, }); - return result as AstValue; + return result as AstExpression; } - throwInternalCompilerError( - `structs, addresses, cells, and comment values are not supported at the moment.`, - ); -} -export function makeUnaryExpression( - op: AstUnaryOperation, - operand: AstExpression, -): AstExpression { - const result = createAstNode({ - kind: "op_unary", - op: op, - operand: operand, - loc: dummySrcInfo, - }); - return result as AstExpression; -} + return { + makeValueExpression, + makeUnaryExpression, + makeBinaryExpression, + }; +}; -export function makeBinaryExpression( - op: AstBinaryOperation, - left: AstExpression, - right: AstExpression, -): AstExpression { - const result = createAstNode({ - kind: "op_binary", - op: op, - left: left, - right: right, - loc: dummySrcInfo, - }); - return result as AstExpression; -} +export type AstUtil = ReturnType; // Checks if the top level node is an unary op node export function checkIsUnaryOpNode(ast: AstExpression): boolean { diff --git a/src/pipeline/build.ts b/src/pipeline/build.ts index 91d93131a..f892003ca 100644 --- a/src/pipeline/build.ts +++ b/src/pipeline/build.ts @@ -19,8 +19,9 @@ import { VirtualFileSystem } from "../vfs/VirtualFileSystem"; import { compile } from "./compile"; import { precompile } from "./precompile"; import { getCompilerVersion } from "./version"; -import { idText } from "../grammar/ast"; +import { FactoryAst, getAstFactory, idText } from "../grammar/ast"; import { TactErrorCollection } from "../errors"; +import { getParser, Parser } from "../grammar"; export function enableFeatures( ctx: CompilerContext, @@ -52,12 +53,16 @@ export async function build(args: { project: VirtualFileSystem; stdlib: string | VirtualFileSystem; logger?: ILogger; + parser?: Parser; + ast?: FactoryAst; }): Promise<{ ok: boolean; error: TactErrorCollection[] }> { const { config, project } = args; const stdlib = typeof args.stdlib === "string" ? createVirtualFileSystem(args.stdlib, files) : args.stdlib; + const ast: FactoryAst = args.ast ?? getAstFactory(); + const parser: Parser = args.parser ?? getParser(ast); const logger: ILogger = args.logger ?? new Logger(); // Configure context @@ -70,7 +75,7 @@ export async function build(args: { // Precompile try { - ctx = precompile(ctx, project, stdlib, config.path); + ctx = precompile(ctx, project, stdlib, config.path, parser, ast); } catch (e) { logger.error( config.mode === "checkOnly" || config.mode === "funcOnly" diff --git a/src/pipeline/precompile.ts b/src/pipeline/precompile.ts index 8ada419da..8695f5c14 100644 --- a/src/pipeline/precompile.ts +++ b/src/pipeline/precompile.ts @@ -7,24 +7,27 @@ import { resolveErrors } from "../types/resolveErrors"; import { resolveSignatures } from "../types/resolveSignatures"; import { resolveImports } from "../imports/resolveImports"; import { VirtualFileSystem } from "../vfs/VirtualFileSystem"; -import { AstModule } from "../grammar/ast"; +import { AstModule, FactoryAst } from "../grammar/ast"; +import { Parser } from "../grammar"; export function precompile( ctx: CompilerContext, project: VirtualFileSystem, stdlib: VirtualFileSystem, entrypoint: string, + parser: Parser, + ast: FactoryAst, parsedModules?: AstModule[], ) { // Load all sources - const imported = resolveImports({ entrypoint, project, stdlib }); + const imported = resolveImports({ entrypoint, project, stdlib, parser }); // Add information about all the source code entries to the context - ctx = openContext(ctx, imported.tact, imported.func, parsedModules); + ctx = openContext(ctx, imported.tact, imported.func, parser, parsedModules); // First load type descriptors and check that // they all have valid signatures - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, ast); // This creates TLB-style type definitions ctx = resolveSignatures(ctx); diff --git a/src/storage/resolveAllocation.spec.ts b/src/storage/resolveAllocation.spec.ts index 4af8847df..f4f823556 100644 --- a/src/storage/resolveAllocation.spec.ts +++ b/src/storage/resolveAllocation.spec.ts @@ -1,5 +1,4 @@ import fs from "fs"; -import { __DANGER_resetNodeId } from "../grammar/ast"; import { resolveDescriptors } from "../types/resolveDescriptors"; import { getAllocations, resolveAllocations } from "./resolveAllocation"; import { openContext } from "../grammar/store"; @@ -7,6 +6,8 @@ import { resolveStatements } from "../types/resolveStatements"; import { CompilerContext } from "../context"; import { resolveSignatures } from "../types/resolveSignatures"; import path from "path"; +import { getParser } from "../grammar"; +import { getAstFactory } from "../grammar/ast"; const stdlibPath = path.resolve(__dirname, "../../stdlib/std/primitives.tact"); const stdlib = fs.readFileSync(stdlibPath, "utf-8"); @@ -61,10 +62,8 @@ contract Sample { `; describe("resolveAllocation", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); it("should write program", () => { + const ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [ @@ -72,8 +71,9 @@ describe("resolveAllocation", () => { { code: src, path: "", origin: "user" }, ], [], + getParser(ast), ); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, ast); ctx = resolveSignatures(ctx); ctx = resolveStatements(ctx); ctx = resolveAllocations(ctx); diff --git a/src/test/compare.spec.ts b/src/test/compare.spec.ts index d8dd63bcb..46701de5b 100644 --- a/src/test/compare.spec.ts +++ b/src/test/compare.spec.ts @@ -1,10 +1,10 @@ import fs from "fs"; -import { __DANGER_resetNodeId } from "../grammar/ast"; -import { parse } from "../grammar/grammar"; +import { getParser } from "../grammar"; import { join } from "path"; import { AstComparator } from "../grammar/compare"; import { CONTRACTS_DIR } from "./util"; import * as assert from "assert"; +import { getAstFactory } from "../grammar/ast"; describe("comparator", () => { it.each(fs.readdirSync(CONTRACTS_DIR, { withFileTypes: true }))( @@ -15,6 +15,8 @@ describe("comparator", () => { } const filePath = join(CONTRACTS_DIR, dentry.name); const src = fs.readFileSync(filePath, "utf-8"); + const Ast = getAstFactory(); + const { parse } = getParser(Ast); const ast1 = parse(src, filePath, "user"); const ast2 = parse(src, filePath, "user"); assert.strictEqual( diff --git a/src/test/compilation-failed/abi-global-errors.spec.ts b/src/test/compilation-failed/abi-global-errors.spec.ts index 3f9808dfc..f1169b512 100644 --- a/src/test/compilation-failed/abi-global-errors.spec.ts +++ b/src/test/compilation-failed/abi-global-errors.spec.ts @@ -1,11 +1,6 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { itShouldNotCompile } from "./util"; describe("abi/global.ts errors", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - itShouldNotCompile({ testName: "sha256-expects-string-or-slice", errorMessage: "sha256 expects string or slice argument", diff --git a/src/test/compilation-failed/const-eval-failed.spec.ts b/src/test/compilation-failed/const-eval-failed.spec.ts index f84d1c7e3..61f60ab21 100644 --- a/src/test/compilation-failed/const-eval-failed.spec.ts +++ b/src/test/compilation-failed/const-eval-failed.spec.ts @@ -1,11 +1,6 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { itShouldNotCompile } from "./util"; describe("fail-const-eval", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - itShouldNotCompile({ testName: "const-eval-div-by-zero", errorMessage: diff --git a/src/test/compilation-failed/contract-duplicate-opcodes.spec.ts b/src/test/compilation-failed/contract-duplicate-opcodes.spec.ts index a799e930c..96f69139f 100644 --- a/src/test/compilation-failed/contract-duplicate-opcodes.spec.ts +++ b/src/test/compilation-failed/contract-duplicate-opcodes.spec.ts @@ -1,11 +1,6 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { itShouldNotCompile } from "./util"; describe("contract-duplicate-opcodes", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - itShouldNotCompile({ testName: "contract-duplicate-bounced-opcode", errorMessage: diff --git a/src/test/compilation-failed/func-errors.spec.ts b/src/test/compilation-failed/func-errors.spec.ts index cacceea19..5c142432d 100644 --- a/src/test/compilation-failed/func-errors.spec.ts +++ b/src/test/compilation-failed/func-errors.spec.ts @@ -1,11 +1,6 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { itShouldNotCompile } from "./util"; describe("func-errors", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - itShouldNotCompile({ testName: "func-function-does-not-exist", errorMessage: diff --git a/src/test/compilation-failed/scope-errors.spec.ts b/src/test/compilation-failed/scope-errors.spec.ts index 2fcc16b65..c9384d442 100644 --- a/src/test/compilation-failed/scope-errors.spec.ts +++ b/src/test/compilation-failed/scope-errors.spec.ts @@ -1,11 +1,6 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { itShouldNotCompile } from "./util"; describe("scope-errors", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - itShouldNotCompile({ testName: "scope-const-shadows-stdlib-ident", errorMessage: diff --git a/src/test/compilation-failed/stdlib-bugs.spec.ts b/src/test/compilation-failed/stdlib-bugs.spec.ts index da8cc72e6..9a2ffc8b2 100644 --- a/src/test/compilation-failed/stdlib-bugs.spec.ts +++ b/src/test/compilation-failed/stdlib-bugs.spec.ts @@ -1,11 +1,6 @@ -import { __DANGER_resetNodeId } from "../../grammar/ast"; import { itShouldNotCompile } from "./util"; describe("stdlib-bugs", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); - itShouldNotCompile({ testName: "stdlib-skipBits", errorMessage: 'Type mismatch: "" is not assignable to "Slice"', diff --git a/src/test/prettyPrinter.spec.ts b/src/test/prettyPrinter.spec.ts index 79bdb13f6..be2e7067e 100644 --- a/src/test/prettyPrinter.spec.ts +++ b/src/test/prettyPrinter.spec.ts @@ -1,11 +1,11 @@ import fs from "fs"; -import { __DANGER_resetNodeId } from "../grammar/ast"; import { prettyPrint } from "../prettyPrinter"; -import { parse } from "../grammar/grammar"; +import { getParser } from "../grammar"; import { join } from "path"; import { trimTrailingCR, CONTRACTS_DIR } from "./util"; import * as assert from "assert"; import JSONBig from "json-bigint"; +import { getAstFactory } from "../grammar/ast"; describe("formatter", () => { it.each(fs.readdirSync(CONTRACTS_DIR, { withFileTypes: true }))( @@ -14,6 +14,8 @@ describe("formatter", () => { if (!dentry.isFile()) { return; } + const Ast = getAstFactory(); + const { parse } = getParser(Ast); const filePath = join(CONTRACTS_DIR, dentry.name); const src = trimTrailingCR(fs.readFileSync(filePath, "utf-8")); const ast = parse(src, filePath, "user"); @@ -34,6 +36,8 @@ describe("formatter", () => { if (!dentry.isFile()) { return; } + const Ast = getAstFactory(); + const { parse } = getParser(Ast); const filePath = join(CONTRACTS_DIR, dentry.name); const src = fs.readFileSync(filePath, "utf-8"); const ast = parse(src, filePath, "user"); diff --git a/src/test/rename.spec.ts b/src/test/rename.spec.ts index 297549376..31e3fb6f5 100644 --- a/src/test/rename.spec.ts +++ b/src/test/rename.spec.ts @@ -1,11 +1,11 @@ import fs from "fs"; -import { __DANGER_resetNodeId } from "../grammar/ast"; -import { parse } from "../grammar/grammar"; import { join } from "path"; import { AstRenamer } from "../grammar/rename"; import { prettyPrint } from "../prettyPrinter"; import { trimTrailingCR, CONTRACTS_DIR } from "./util"; import * as assert from "assert"; +import { getParser } from "../grammar"; +import { getAstFactory } from "../grammar/ast"; const EXPECTED_DIR = join(CONTRACTS_DIR, "renamer-expected"); @@ -16,6 +16,8 @@ describe("renamer", () => { if (!dentry.isFile()) { return; } + const ast = getAstFactory(); + const { parse } = getParser(ast); const expectedFilePath = join(EXPECTED_DIR, dentry.name); const expected = fs.readFileSync(expectedFilePath, "utf-8"); const filePath = join(CONTRACTS_DIR, dentry.name); diff --git a/src/types/resolveABITypeRef.ts b/src/types/resolveABITypeRef.ts index 79713ae47..098f3fdfa 100644 --- a/src/types/resolveABITypeRef.ts +++ b/src/types/resolveABITypeRef.ts @@ -12,7 +12,6 @@ import { isSlice, isString, isStringBuilder, - SrcInfo, } from "../grammar/ast"; import { idTextErr, @@ -22,6 +21,7 @@ import { import { TypeRef } from "./types"; import { CompilerContext } from "../context"; import { getType } from "./resolveDescriptors"; +import { SrcInfo } from "../grammar"; type FormatDef = Record< string, diff --git a/src/types/resolveDescriptors.spec.ts b/src/types/resolveDescriptors.spec.ts index 74a34e0c2..ac966baf9 100644 --- a/src/types/resolveDescriptors.spec.ts +++ b/src/types/resolveDescriptors.spec.ts @@ -5,10 +5,11 @@ import { resolveDescriptors, } from "./resolveDescriptors"; import { resolveSignatures } from "./resolveSignatures"; -import { SrcInfo, __DANGER_resetNodeId } from "../grammar/ast"; import { loadCases } from "../utils/loadCases"; import { openContext } from "../grammar/store"; import { featureEnable } from "../config/features"; +import { getParser, SrcInfo } from "../grammar"; +import { getAstFactory } from "../grammar/ast"; expect.addSnapshotSerializer({ test: (src) => src instanceof SrcInfo, @@ -16,18 +17,17 @@ expect.addSnapshotSerializer({ }); describe("resolveDescriptors", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); for (const r of loadCases(__dirname + "/test/")) { it("should resolve descriptors for " + r.name, () => { + const Ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], + getParser(Ast), ); ctx = featureEnable(ctx, "external"); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, Ast); ctx = resolveSignatures(ctx); expect(getAllTypes(ctx)).toMatchSnapshot(); expect(getAllStaticFunctions(ctx)).toMatchSnapshot(); @@ -35,14 +35,16 @@ describe("resolveDescriptors", () => { } for (const r of loadCases(__dirname + "/test-failed/")) { it("should fail descriptors for " + r.name, () => { + const Ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], + getParser(Ast), ); ctx = featureEnable(ctx, "external"); expect(() => { - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, Ast); ctx = resolveSignatures(ctx); }).toThrowErrorMatchingSnapshot(); }); diff --git a/src/types/resolveDescriptors.ts b/src/types/resolveDescriptors.ts index a334b5cd5..bd5976596 100644 --- a/src/types/resolveDescriptors.ts +++ b/src/types/resolveDescriptors.ts @@ -5,7 +5,6 @@ import { AstNativeFunctionDecl, AstNode, AstType, - createAstNode, idText, AstId, eqNames, @@ -18,6 +17,7 @@ import { AstMapType, AstTypeId, AstAsmFunctionDef, + FactoryAst, } from "../grammar/ast"; import { traverse } from "../grammar/iterators"; import { @@ -49,7 +49,7 @@ import { resolveABIType, intMapFormats } from "./resolveABITypeRef"; import { enabledExternals } from "../config/features"; import { isRuntimeType } from "./isRuntimeType"; import { GlobalFunctions } from "../abi/global"; -import { ItemOrigin } from "../grammar/grammar"; +import { ItemOrigin } from "../grammar"; import { getExpType, resolveExpression } from "./resolveExpression"; import { emptyContext } from "./resolveStatements"; import { isAssignable } from "./subtyping"; @@ -264,7 +264,7 @@ function uidForName(name: string, types: Map) { return uid; } -export function resolveDescriptors(ctx: CompilerContext) { +export function resolveDescriptors(ctx: CompilerContext, Ast: FactoryAst) { const types: Map = new Map(); const staticFunctions: Map = new Map(); const staticConstants: Map = new Map(); @@ -1422,7 +1422,7 @@ export function resolveDescriptors(ctx: CompilerContext) { if (!t.init) { t.init = { params: [], - ast: createAstNode({ + ast: Ast.createNode({ kind: "contract_init", params: [], statements: [], @@ -1626,7 +1626,7 @@ export function resolveDescriptors(ctx: CompilerContext) { name: contractOrTrait.name, optional: false, }, - ast: cloneNode(traitFunction.ast), + ast: cloneNode(traitFunction.ast, Ast), }); } @@ -1697,7 +1697,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Register constant contractOrTrait.constants.push({ ...traitConstant, - ast: cloneNode(traitConstant.ast), + ast: cloneNode(traitConstant.ast, Ast), }); } @@ -1764,7 +1764,7 @@ export function resolveDescriptors(ctx: CompilerContext) { } contractOrTrait.receivers.push({ selector: f.selector, - ast: cloneNode(f.ast), + ast: cloneNode(f.ast, Ast), }); } diff --git a/src/types/resolveSignatures.ts b/src/types/resolveSignatures.ts index aedd0f9b0..807c63300 100644 --- a/src/types/resolveSignatures.ts +++ b/src/types/resolveSignatures.ts @@ -17,7 +17,7 @@ import { throwCompilationError } from "../errors"; import { AstNumber, AstReceiver } from "../grammar/ast"; import { commentPseudoOpcode } from "../generator/writers/writeRouter"; import { sha256_sync } from "@ton/crypto"; -import { dummySrcInfo } from "../grammar/grammar"; +import { dummySrcInfo } from "../grammar"; import { ensureInt } from "../interpreter"; import { evalConstantExpression } from "../constEval"; diff --git a/src/types/resolveStatements.spec.ts b/src/types/resolveStatements.spec.ts index ab0d59d2a..fa8539bda 100644 --- a/src/types/resolveStatements.spec.ts +++ b/src/types/resolveStatements.spec.ts @@ -1,38 +1,40 @@ import { getAllExpressionTypes } from "./resolveExpression"; import { resolveDescriptors } from "./resolveDescriptors"; import { loadCases } from "../utils/loadCases"; -import { __DANGER_resetNodeId } from "../grammar/ast"; import { openContext } from "../grammar/store"; import { resolveStatements } from "./resolveStatements"; import { CompilerContext } from "../context"; import { featureEnable } from "../config/features"; +import { getParser } from "../grammar"; +import { getAstFactory } from "../grammar/ast"; describe("resolveStatements", () => { - beforeEach(() => { - __DANGER_resetNodeId(); - }); for (const r of loadCases(__dirname + "/stmts/")) { it("should resolve statements for " + r.name, () => { + const Ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], + getParser(Ast), ); ctx = featureEnable(ctx, "external"); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, Ast); ctx = resolveStatements(ctx); expect(getAllExpressionTypes(ctx)).toMatchSnapshot(); }); } for (const r of loadCases(__dirname + "/stmts-failed/")) { it("should fail statements for " + r.name, () => { + const Ast = getAstFactory(); let ctx = openContext( new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], + getParser(Ast), ); ctx = featureEnable(ctx, "external"); - ctx = resolveDescriptors(ctx); + ctx = resolveDescriptors(ctx, Ast); expect(() => resolveStatements(ctx)).toThrowErrorMatchingSnapshot(); }); } diff --git a/src/types/resolveStatements.ts b/src/types/resolveStatements.ts index 760c4b950..e5ca22bbf 100644 --- a/src/types/resolveStatements.ts +++ b/src/types/resolveStatements.ts @@ -1,7 +1,6 @@ import { CompilerContext } from "../context"; import { AstCondition, - SrcInfo, AstStatement, tryExtractPath, AstId, @@ -31,6 +30,7 @@ import { FunctionDescription, printTypeRef, TypeRef } from "./types"; import { evalConstantExpression } from "../constEval"; import { ensureInt } from "../interpreter"; import { crc16 } from "../utils/crc16"; +import { SrcInfo } from "../grammar"; export type StatementContext = { root: SrcInfo; diff --git a/src/types/types.ts b/src/types/types.ts index 8b34e74cf..4bcdd65fa 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -6,7 +6,6 @@ import { AstContractInit, AstNativeFunctionDecl, AstReceiver, - SrcInfo, AstTypeDecl, AstId, AstFunctionDecl, @@ -15,7 +14,7 @@ import { AstAsmFunctionDef, AstNumber, } from "../grammar/ast"; -import { dummySrcInfo, ItemOrigin } from "../grammar/grammar"; +import { dummySrcInfo, ItemOrigin, SrcInfo } from "../grammar"; export type TypeDescription = { kind: "struct" | "primitive_type_decl" | "contract" | "trait"; From 672f2d65384cab68ac485ed9b7f2795369f403c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:56:22 +0400 Subject: [PATCH 05/29] chore(deps): bump zod from 3.23.8 to 3.24.1 (#1191) Bumps [zod](https://github.com/colinhacks/zod) from 3.23.8 to 3.24.1. - [Release notes](https://github.com/colinhacks/zod/releases) - [Changelog](https://github.com/colinhacks/zod/blob/main/CHANGELOG.md) - [Commits](https://github.com/colinhacks/zod/compare/v3.23.8...v3.24.1) --- updated-dependencies: - dependency-name: zod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ec5bb19cc..b5824478b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5680,6 +5680,6 @@ zod-validation-error@^3.0.3: integrity sha512-Syib9oumw1NTqEv4LT0e6U83Td9aVRk9iTXPUQr1otyV1PuXQKOvOwhMNqZIq5hluzHP2pMgnOmHEo7kPdI2mw== zod@^3.20.2, zod@^3.22.4: - version "3.23.8" - resolved "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" - integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== + version "3.24.1" + resolved "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee" + integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A== From 92ea2862f9ebc2e706ddccec16116b9a946352ba Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:24:31 +0400 Subject: [PATCH 06/29] refactor: use own error printing instead of Ohm's (#1203) * refactor: abstract away SrcInfo interface --- src/errors.ts | 3 +- src/grammar/ast.ts | 3 +- src/grammar/grammar.spec.ts | 4 +- src/grammar/grammar.ts | 10 +- src/grammar/index.ts | 4 +- src/grammar/rename.ts | 2 +- src/grammar/src-info.ts | 303 +++++++++++++-- .../resolveAllocation.spec.ts.snap | 356 +++++++++--------- src/types/resolveDescriptors.spec.ts | 3 +- 9 files changed, 466 insertions(+), 222 deletions(-) diff --git a/src/errors.ts b/src/errors.ts index eee766790..3bceaeffa 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -3,6 +3,7 @@ import path from "path"; import { cwd } from "process"; import { AstFuncId, AstId, AstTypeId } from "./grammar/ast"; import { ItemOrigin, SrcInfo } from "./grammar"; +import { getSrcInfoFromOhm } from "./grammar/src-info"; export class TactError extends Error { readonly loc?: SrcInfo; @@ -64,7 +65,7 @@ export function throwParseError( origin: ItemOrigin, ): never { const interval = matchResult.getInterval(); - const source = new SrcInfo(interval, path, origin); + const source = getSrcInfoFromOhm(interval, path, origin); // eslint-disable-next-line @typescript-eslint/no-explicit-any const message = `Parse error: expected ${(matchResult as any).getExpectedText()}\n`; throw new TactParseError( diff --git a/src/grammar/ast.ts b/src/grammar/ast.ts index f9d54810b..58b9c5a3a 100644 --- a/src/grammar/ast.ts +++ b/src/grammar/ast.ts @@ -1,5 +1,4 @@ -import { dummySrcInfo } from "./grammar"; -import { SrcInfo } from "./src-info"; +import { dummySrcInfo, SrcInfo } from "./src-info"; export type AstModule = { kind: "module"; diff --git a/src/grammar/grammar.spec.ts b/src/grammar/grammar.spec.ts index 7af9c64dc..ee7d75f18 100644 --- a/src/grammar/grammar.spec.ts +++ b/src/grammar/grammar.spec.ts @@ -1,10 +1,10 @@ import { AstModule, getAstFactory } from "./ast"; import { loadCases } from "../utils/loadCases"; import { getParser } from "./grammar"; -import { SrcInfo } from "./src-info"; +import { SrcInfo, isSrcInfo } from "./src-info"; expect.addSnapshotSerializer({ - test: (src) => src instanceof SrcInfo, + test: (src) => isSrcInfo(src), print: (src) => (src as SrcInfo).contents, }); diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index 069333659..09acefac8 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -1,4 +1,4 @@ -import { Node, IterationNode, NonterminalNode, grammar, Grammar } from "ohm-js"; +import { Node, IterationNode, NonterminalNode } from "ohm-js"; import tactGrammar from "./grammar.ohm-bundle"; import { throwInternalCompilerError } from "../errors"; import { @@ -22,11 +22,7 @@ import { throwParseError, throwSyntaxError } from "../errors"; import { checkVariableName } from "./checkVariableName"; import { checkFunctionAttributes } from "./checkFunctionAttributes"; import { checkConstAttributes } from "./checkConstAttributes"; -import { ItemOrigin, SrcInfo } from "./src-info"; - -const DummyGrammar: Grammar = grammar("Dummy { DummyRule = any }"); -const DUMMY_INTERVAL = DummyGrammar.match("").getInterval(); -export const dummySrcInfo: SrcInfo = new SrcInfo(DUMMY_INTERVAL, null, "user"); +import { getSrcInfoFromOhm, ItemOrigin, SrcInfo } from "./src-info"; type Context = { origin: ItemOrigin | null; @@ -56,7 +52,7 @@ function createRef(s: Node): SrcInfo { throwInternalCompilerError("Parser context was not initialized"); } - return new SrcInfo(s.source, context.currentFile, context.origin); + return getSrcInfoFromOhm(s.source, context.currentFile, context.origin); } const createNode: FactoryAst["createNode"] = (...args) => { diff --git a/src/grammar/index.ts b/src/grammar/index.ts index 749fc50c3..dd5411a2e 100644 --- a/src/grammar/index.ts +++ b/src/grammar/index.ts @@ -1,3 +1,3 @@ -export { dummySrcInfo, getParser, Parser } from "./grammar"; +export { getParser, Parser } from "./grammar"; -export { ItemOrigin, SrcInfo } from "./src-info"; +export { dummySrcInfo, ItemOrigin, SrcInfo } from "./src-info"; diff --git a/src/grammar/rename.ts b/src/grammar/rename.ts index 391ab1051..fb3960148 100644 --- a/src/grammar/rename.ts +++ b/src/grammar/rename.ts @@ -19,7 +19,7 @@ import { } from "./ast"; import { AstSorter } from "./sort"; import { AstHasher, AstHash } from "./hash"; -import { dummySrcInfo } from "./grammar"; +import { dummySrcInfo } from "./src-info"; type GivenName = string; diff --git a/src/grammar/src-info.ts b/src/grammar/src-info.ts index 54ddf7248..4ca54f771 100644 --- a/src/grammar/src-info.ts +++ b/src/grammar/src-info.ts @@ -1,39 +1,286 @@ import { Interval as RawInterval } from "ohm-js"; +import { throwInternalCompilerError } from "../errors"; + export type ItemOrigin = "stdlib" | "user"; +type LineAndColumnInfo = { + lineNum: number; + colNum: number; + toString(...ranges: number[][]): string; +}; + +type Interval = { + contents: string; + getLineAndColumnMessage(): string; + getLineAndColumn(): LineAndColumnInfo; + startIdx: number; + endIdx: number; +}; + +// Do not export! Use isSrcInfo +const srcInfoSymbol = Symbol("src-info"); + +export const isSrcInfo = (t: unknown): t is SrcInfo => { + return ( + typeof t === "object" && + t !== null && + srcInfoSymbol in t && + Boolean(t[srcInfoSymbol]) + ); +}; + +export interface SrcInfo { + file: string | null; + contents: string; + interval: Interval; + origin: ItemOrigin; + + /** + * Tag so that custom snapshot serializer can distinguish it + */ + [srcInfoSymbol]: true; + /** + * toJSON method is provided, so that it's not serialized into snapshots + */ + toJSON: () => object; +} + +const isEndline = (s: string) => s === "\n"; + +const repeat = (s: string, n: number): string => new Array(n + 1).join(s); + +type Range = { + start: number; + end: number; +}; + +const intersect = (a: Range, b: Range): Range => { + return { + start: Math.max(a.start, b.start), + end: Math.min(a.end, b.end), + }; +}; + +const shift = (a: Range, b: number) => { + return { + start: a.start + b, + end: a.end + b, + }; +}; + +type Line = { + id: number; + text: string; + range: Range; +}; + /** - * Information about source code location (file and interval within it) - * and the source code contents. + * Convert code into a list of lines */ -export class SrcInfo { - readonly #interval: RawInterval; - readonly #file: string | null; - readonly #origin: ItemOrigin; - - constructor( - interval: RawInterval, - file: string | null, - origin: ItemOrigin, - ) { - this.#interval = interval; - this.#file = file; - this.#origin = origin; +const toLines = (source: string): Line[] => { + const result: Line[] = []; + let position = 0; + for (const [id, text] of source.split("\n").entries()) { + result.push({ + id, + text, + range: { + start: position, + end: position + text.length, + }, + }); + position += text.length + 1; } + return result; +}; - get file() { - return this.#file; - } +/** + * Should wrap string into ANSI codes for coloring + */ +type Colorer = (s: string) => string; - get contents() { - return this.#interval.contents; - } +type ErrorPrinterParams = { + /** + * Number of context lines below and above error + */ + contextLines: number; + /** + * Colorer for code with error + */ + error: Colorer; + /** + * Colorer for context lines of code + */ + context: Colorer; +}; - get interval() { - return this.#interval; - } +const getErrorPrinter = ({ + error, + context, + contextLines, +}: ErrorPrinterParams) => { + const displayLine = (line: Line, range: Range) => { + // Only the line that contains range.start is underlined in error message + // Otherwise error on `while (...) {}` would display the whole loop body, for example + const hasInterval = + line.range.start <= range.start && range.start < line.range.end; - get origin() { - return this.#origin; - } -} + // Find the line-relative range + const mapped = shift(intersect(range, line.range), -line.range.start); + + // All lines except with error message are displayed in gray + if (!hasInterval) { + return [ + { + id: line.id, + text: context(line.text), + hasInterval, + startOfError: mapped.start, + }, + ]; + } + + // Source line with error colored + const sourceLine = { + id: line.id, + text: [ + line.text.substring(0, mapped.start), + error(line.text.substring(mapped.start, mapped.end)), + line.text.substring(mapped.end), + ].join(""), + hasInterval: true, + startOfError: mapped.start, + }; + + // Wiggly line underneath it + const underline = { + id: null, + text: [ + repeat(" ", mapped.start), + "^", + repeat("~", Math.max(0, mapped.end - mapped.start - 1)), + ].join(""), + hasInterval: true, + startOfError: mapped.start, + }; + + return [sourceLine, underline]; + }; + + const show = (str: string, range: Range): string => { + // Display all lines of source file + const lines = toLines(str).flatMap((line) => displayLine(line, range)); + + // Find first and lines lines with error message + const firstLineNum = lines.findIndex((line) => line.hasInterval); + const lastLineNum = lines.findLastIndex((line) => line.hasInterval); + if (firstLineNum === -1 || lastLineNum === -1) { + throwInternalCompilerError( + `Interval [${range.start}, ${range.end}[ is empty or out of source bounds (${str.length})`, + ); + } + + // Expand the line range so that `contextLines` are above and below + const rangeStart = Math.max(0, firstLineNum - contextLines); + const rangeEnd = Math.min(lines.length - 1, lastLineNum + contextLines); + + // Pick displayed lines out of full list + const displayedLines = lines.slice(rangeStart, rangeEnd + 1); + + // Find padding based on the line with largest line number + const maxLineId = displayedLines.reduce((acc, line) => { + return line.id === null ? acc : Math.max(acc, line.id); + }, 1); + const lineNumLength = String(maxLineId + 1).length; + + // Add line numbers and cursor to lines + const paddedLines = displayedLines.map(({ hasInterval, id, text }) => { + const prefix = hasInterval && id !== null ? ">" : " "; + const paddedLineNum = + id === null + ? repeat(" ", lineNumLength) + " " + : String(id + 1).padStart(lineNumLength) + " |"; + return `${prefix} ${paddedLineNum} ${text}`; + }); + + // Add header and concatenate lines + const header = `Line ${firstLineNum + 1}, col ${(lines[firstLineNum]?.startOfError ?? 0) + 1}:`; + return [header, ...paddedLines].join("\n") + "\n"; + }; + + const getLineAndColumn = (str: string, range: Range) => { + const prefix = str.substring(0, range.start).split(""); + const lineNum = prefix.filter(isEndline).length; + const prevLineEndPos = prefix.findLastIndex(isEndline); + const lineStartPos = prevLineEndPos === -1 ? 0 : prevLineEndPos + 1; + const colNum = range.start - lineStartPos; + + return { + offset: range.start, + lineNum: lineNum + 1, + colNum: colNum + 1, + toString: () => show(str, range), + }; + }; + + return { show, getLineAndColumn }; +}; + +// Default error printer. Should be initialized in entry point instead +const errorPrinter = getErrorPrinter({ + // This should be `chalk.red` + error: (s) => s, + // This should be `chalk.gray` + context: (s) => s, + contextLines: 1, +}); + +const getSrcInfo = ( + sourceString: string, + startIdx: number, + endIdx: number, + file: string | null, + origin: ItemOrigin, +): SrcInfo => { + const getLineAndColumn = () => { + return errorPrinter.getLineAndColumn(sourceString, { + start: startIdx, + end: endIdx, + }); + }; + + const getLineAndColumnMessage = () => { + return getLineAndColumn().toString(); + }; + + const contents = sourceString.substring(startIdx, endIdx); + + return { + [srcInfoSymbol]: true, + contents: contents, + file, + interval: { + contents: contents, + startIdx: startIdx, + endIdx: endIdx, + getLineAndColumn, + getLineAndColumnMessage, + }, + origin, + toJSON: () => ({}), + }; +}; + +/** + * @deprecated + */ +export const getSrcInfoFromOhm = ( + { sourceString, startIdx, endIdx }: RawInterval, + file: string | null, + origin: ItemOrigin, +): SrcInfo => { + return getSrcInfo(sourceString, startIdx, endIdx, file, origin); +}; + +export const dummySrcInfo: SrcInfo = getSrcInfo("", 0, 0, null, "user"); diff --git a/src/storage/__snapshots__/resolveAllocation.spec.ts.snap b/src/storage/__snapshots__/resolveAllocation.spec.ts.snap index 79708c492..eac051980 100644 --- a/src/storage/__snapshots__/resolveAllocation.spec.ts.snap +++ b/src/storage/__snapshots__/resolveAllocation.spec.ts.snap @@ -85,17 +85,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 31, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 29, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "x", }, "type": { "id": 30, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -104,28 +104,28 @@ exports[`resolveAllocation should write program 1`] = ` "id": 34, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 32, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "y", }, "type": { "id": 33, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, ], "id": 35, "kind": "struct_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 28, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point", }, }, @@ -148,23 +148,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 31, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 29, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "x", }, "type": { "id": 30, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 0, - "loc": SrcInfo {}, + "loc": {}, "name": "x", "type": { "kind": "ref", @@ -188,23 +188,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 34, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 32, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "y", }, "type": { "id": 33, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 1, - "loc": SrcInfo {}, + "loc": {}, "name": "y", "type": { "kind": "ref", @@ -291,28 +291,28 @@ exports[`resolveAllocation should write program 1`] = ` "id": 39, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 37, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "z", }, "type": { "id": 38, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point", }, }, ], "id": 40, "kind": "struct_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 36, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point2", }, }, @@ -334,23 +334,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 39, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 37, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "z", }, "type": { "id": 38, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point", }, }, "default": undefined, "index": 0, - "loc": SrcInfo {}, + "loc": {}, "name": "z", "type": { "kind": "ref", @@ -481,17 +481,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 23, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 21, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 22, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point", }, }, @@ -500,28 +500,28 @@ exports[`resolveAllocation should write program 1`] = ` "id": 26, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 24, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 25, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point2", }, }, ], "id": 27, "kind": "struct_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 20, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point3", }, }, @@ -543,23 +543,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 23, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 21, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 22, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point", }, }, "default": undefined, "index": 0, - "loc": SrcInfo {}, + "loc": {}, "name": "a", "type": { "kind": "ref", @@ -582,23 +582,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 26, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 24, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 25, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Point2", }, }, "default": undefined, "index": 1, - "loc": SrcInfo {}, + "loc": {}, "name": "b", "type": { "kind": "ref", @@ -981,17 +981,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 44, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 42, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 43, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1000,17 +1000,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 47, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 45, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 46, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1019,17 +1019,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 50, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 48, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "c", }, "type": { "id": 49, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1038,17 +1038,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 53, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 51, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "d", }, "type": { "id": 52, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1057,17 +1057,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 56, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 54, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "e", }, "type": { "id": 55, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1076,17 +1076,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 59, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 57, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "f", }, "type": { "id": 58, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1095,17 +1095,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 62, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 60, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "g", }, "type": { "id": 61, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1114,17 +1114,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 65, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 63, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "h", }, "type": { "id": 64, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1133,17 +1133,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 68, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 66, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "i", }, "type": { "id": 67, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1152,17 +1152,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 71, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 69, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "j", }, "type": { "id": 70, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -1171,28 +1171,28 @@ exports[`resolveAllocation should write program 1`] = ` "id": 74, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 72, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "k", }, "type": { "id": 73, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, ], "id": 75, "kind": "struct_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 41, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, @@ -1215,23 +1215,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 44, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 42, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 43, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 0, - "loc": SrcInfo {}, + "loc": {}, "name": "a", "type": { "kind": "ref", @@ -1255,23 +1255,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 47, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 45, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 46, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 1, - "loc": SrcInfo {}, + "loc": {}, "name": "b", "type": { "kind": "ref", @@ -1295,23 +1295,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 50, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 48, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "c", }, "type": { "id": 49, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 2, - "loc": SrcInfo {}, + "loc": {}, "name": "c", "type": { "kind": "ref", @@ -1335,23 +1335,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 53, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 51, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "d", }, "type": { "id": 52, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 3, - "loc": SrcInfo {}, + "loc": {}, "name": "d", "type": { "kind": "ref", @@ -1375,23 +1375,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 56, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 54, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "e", }, "type": { "id": 55, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 4, - "loc": SrcInfo {}, + "loc": {}, "name": "e", "type": { "kind": "ref", @@ -1415,23 +1415,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 59, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 57, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "f", }, "type": { "id": 58, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 5, - "loc": SrcInfo {}, + "loc": {}, "name": "f", "type": { "kind": "ref", @@ -1455,23 +1455,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 62, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 60, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "g", }, "type": { "id": 61, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 6, - "loc": SrcInfo {}, + "loc": {}, "name": "g", "type": { "kind": "ref", @@ -1495,23 +1495,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 65, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 63, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "h", }, "type": { "id": 64, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 7, - "loc": SrcInfo {}, + "loc": {}, "name": "h", "type": { "kind": "ref", @@ -1535,23 +1535,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 68, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 66, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "i", }, "type": { "id": 67, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 8, - "loc": SrcInfo {}, + "loc": {}, "name": "i", "type": { "kind": "ref", @@ -1575,23 +1575,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 71, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 69, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "j", }, "type": { "id": 70, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 9, - "loc": SrcInfo {}, + "loc": {}, "name": "j", "type": { "kind": "ref", @@ -1615,23 +1615,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 74, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 72, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "k", }, "type": { "id": 73, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": undefined, "index": 10, - "loc": SrcInfo {}, + "loc": {}, "name": "k", "type": { "kind": "ref", @@ -1806,17 +1806,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 79, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 77, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 78, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, @@ -1825,17 +1825,17 @@ exports[`resolveAllocation should write program 1`] = ` "id": 82, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 80, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 81, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, @@ -1844,28 +1844,28 @@ exports[`resolveAllocation should write program 1`] = ` "id": 85, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 83, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "c", }, "type": { "id": 84, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, ], "id": 86, "kind": "struct_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 76, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep2", }, }, @@ -1887,23 +1887,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 79, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 77, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 78, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, "default": undefined, "index": 0, - "loc": SrcInfo {}, + "loc": {}, "name": "a", "type": { "kind": "ref", @@ -1926,23 +1926,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 82, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 80, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 81, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, "default": undefined, "index": 1, - "loc": SrcInfo {}, + "loc": {}, "name": "b", "type": { "kind": "ref", @@ -1965,23 +1965,23 @@ exports[`resolveAllocation should write program 1`] = ` "id": 85, "initializer": null, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 83, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "c", }, "type": { "id": 84, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Deep", }, }, "default": undefined, "index": 2, - "loc": SrcInfo {}, + "loc": {}, "name": "c", "type": { "kind": "ref", @@ -2063,28 +2063,28 @@ exports[`resolveAllocation should write program 1`] = ` "base": 10, "id": 90, "kind": "number", - "loc": SrcInfo {}, + "loc": {}, "value": 0n, }, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 88, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "v", }, "type": { "id": 89, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, { "id": 92, "kind": "contract_init", - "loc": SrcInfo {}, + "loc": {}, "params": [], "statements": [], }, @@ -2092,45 +2092,45 @@ exports[`resolveAllocation should write program 1`] = ` "attributes": [], "id": 100, "kind": "function_def", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 93, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "main", }, "params": [ { "id": 96, "kind": "typed_parameter", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 94, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 95, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, { "id": 99, "kind": "typed_parameter", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 97, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 98, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -2141,11 +2141,11 @@ exports[`resolveAllocation should write program 1`] = ` ], "id": 101, "kind": "contract", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 87, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "Sample", }, "traits": [], @@ -2171,27 +2171,27 @@ exports[`resolveAllocation should write program 1`] = ` "base": 10, "id": 90, "kind": "number", - "loc": SrcInfo {}, + "loc": {}, "value": 0n, }, "kind": "field_decl", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 88, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "v", }, "type": { "id": 89, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, "default": 0n, "index": 0, - "loc": SrcInfo {}, + "loc": {}, "name": "v", "type": { "kind": "ref", @@ -2206,45 +2206,45 @@ exports[`resolveAllocation should write program 1`] = ` "attributes": [], "id": 100, "kind": "function_def", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 93, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "main", }, "params": [ { "id": 96, "kind": "typed_parameter", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 94, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { "id": 95, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, { "id": 99, "kind": "typed_parameter", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 97, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { "id": 98, "kind": "type_id", - "loc": SrcInfo {}, + "loc": {}, "text": "Int", }, }, @@ -2263,11 +2263,11 @@ exports[`resolveAllocation should write program 1`] = ` "origin": "user", "params": [ { - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 94, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "a", }, "type": { @@ -2277,11 +2277,11 @@ exports[`resolveAllocation should write program 1`] = ` }, }, { - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 97, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "b", }, "type": { @@ -2306,7 +2306,7 @@ exports[`resolveAllocation should write program 1`] = ` "ast": { "id": 92, "kind": "contract_init", - "loc": SrcInfo {}, + "loc": {}, "params": [], "statements": [], }, @@ -2327,11 +2327,11 @@ exports[`resolveAllocation should write program 1`] = ` "declarations": [], "id": 19, "kind": "trait", - "loc": SrcInfo {}, + "loc": {}, "name": { "id": 18, "kind": "id", - "loc": SrcInfo {}, + "loc": {}, "text": "BaseTrait", }, "traits": [], diff --git a/src/types/resolveDescriptors.spec.ts b/src/types/resolveDescriptors.spec.ts index ac966baf9..c311b8b7f 100644 --- a/src/types/resolveDescriptors.spec.ts +++ b/src/types/resolveDescriptors.spec.ts @@ -10,9 +10,10 @@ import { openContext } from "../grammar/store"; import { featureEnable } from "../config/features"; import { getParser, SrcInfo } from "../grammar"; import { getAstFactory } from "../grammar/ast"; +import { isSrcInfo } from "../grammar/src-info"; expect.addSnapshotSerializer({ - test: (src) => src instanceof SrcInfo, + test: (src) => isSrcInfo(src), print: (src) => (src as SrcInfo).contents, }); From 45a006b8d4466defcb0c2c1ba290e7e3bf2feebe Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:47:06 +0100 Subject: [PATCH 07/29] fix(docs): links in Chinese translation (#1206) --- CHANGELOG.md | 1 + docs/src/content/docs/zh-cn/book/bounced.mdx | 2 +- docs/src/content/docs/zh-cn/book/cells.mdx | 98 ++++++++--------- docs/src/content/docs/zh-cn/book/config.mdx | 16 +-- .../src/content/docs/zh-cn/book/constants.mdx | 2 +- .../src/content/docs/zh-cn/book/contracts.mdx | 64 +++++------ docs/src/content/docs/zh-cn/book/debug.mdx | 46 ++++---- .../content/docs/zh-cn/book/exit-codes.mdx | 2 +- .../content/docs/zh-cn/book/expressions.mdx | 44 ++++---- docs/src/content/docs/zh-cn/book/func.mdx | 18 ++-- .../src/content/docs/zh-cn/book/functions.mdx | 18 ++-- docs/src/content/docs/zh-cn/book/import.mdx | 6 +- docs/src/content/docs/zh-cn/book/index.mdx | 4 +- docs/src/content/docs/zh-cn/book/integers.mdx | 32 +++--- docs/src/content/docs/zh-cn/book/maps.mdx | 48 ++++----- .../content/docs/zh-cn/book/masterchain.mdx | 10 +- .../content/docs/zh-cn/book/message-mode.mdx | 8 +- .../src/content/docs/zh-cn/book/operators.mdx | 38 +++---- .../src/content/docs/zh-cn/book/optionals.mdx | 10 +- docs/src/content/docs/zh-cn/book/send.mdx | 44 ++++---- .../content/docs/zh-cn/book/statements.mdx | 30 +++--- .../docs/zh-cn/book/structs-and-messages.mdx | 32 +++--- docs/src/content/docs/zh-cn/book/types.mdx | 44 ++++---- .../content/docs/zh-cn/cookbook/access.mdx | 2 +- .../docs/zh-cn/cookbook/data-structures.mdx | 14 +-- .../content/docs/zh-cn/cookbook/jettons.mdx | 6 +- docs/src/content/docs/zh-cn/cookbook/misc.mdx | 2 +- .../content/docs/zh-cn/cookbook/random.mdx | 4 +- .../zh-cn/cookbook/single-communication.mdx | 12 +-- docs/src/content/docs/zh-cn/cookbook/time.mdx | 4 +- .../docs/zh-cn/cookbook/type-conversion.mdx | 24 ++--- .../content/docs/zh-cn/ref/core-advanced.mdx | 62 +++++------ docs/src/content/docs/zh-cn/ref/core-base.mdx | 8 +- .../src/content/docs/zh-cn/ref/core-cells.mdx | 102 +++++++++--------- .../content/docs/zh-cn/ref/core-common.mdx | 66 ++++++------ .../content/docs/zh-cn/ref/core-comptime.mdx | 12 +-- .../src/content/docs/zh-cn/ref/core-debug.mdx | 50 ++++----- docs/src/content/docs/zh-cn/ref/core-math.mdx | 30 +++--- .../content/docs/zh-cn/ref/core-random.mdx | 8 +- .../content/docs/zh-cn/ref/core-strings.mdx | 24 ++--- docs/src/content/docs/zh-cn/ref/index.mdx | 8 +- .../docs/zh-cn/ref/standard-libraries.mdx | 40 +++---- .../content/docs/zh-cn/ref/stdlib-config.mdx | 4 +- .../content/docs/zh-cn/ref/stdlib-content.mdx | 4 +- .../content/docs/zh-cn/ref/stdlib-deploy.mdx | 4 +- .../src/content/docs/zh-cn/ref/stdlib-dns.mdx | 12 +-- .../content/docs/zh-cn/ref/stdlib-ownable.mdx | 12 +-- .../docs/zh-cn/ref/stdlib-stoppable.mdx | 8 +- 48 files changed, 570 insertions(+), 569 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fa421de7..e5a6df838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed the Programmatic API page due to frequent changes. To use the API, please refer to the compiler sources: PR [#1184](https://github.com/tact-lang/tact/pull/1184) - Added a link to the article by CertiK to Security best practices page: PR [#1185](https://github.com/tact-lang/tact/pull/1185) - Added a note on `dump()` being computationally expensive: PR [#1189](https://github.com/tact-lang/tact/pull/1189) +- Fixed links in Chinese translation: PR [#1206](https://github.com/tact-lang/tact/pull/1206) ### Release contributors diff --git a/docs/src/content/docs/zh-cn/book/bounced.mdx b/docs/src/content/docs/zh-cn/book/bounced.mdx index f9c900d2c..a41410c18 100644 --- a/docs/src/content/docs/zh-cn/book/bounced.mdx +++ b/docs/src/content/docs/zh-cn/book/bounced.mdx @@ -26,7 +26,7 @@ contract MyContract { } ``` -要手动处理被退回的信息,您可以使用回退定义,直接处理原始的 [`Slice{:tact}`](/book/cells#slices)。请注意,这样的接收器将获得由您的合约产生的**所有**被退回的信息: +要手动处理被退回的信息,您可以使用回退定义,直接处理原始的 [`Slice{:tact}`](/zh-cn/book/cells#slices)。请注意,这样的接收器将获得由您的合约产生的**所有**被退回的信息: ```tact /rawMsg: Slice/ contract MyContract { diff --git a/docs/src/content/docs/zh-cn/book/cells.mdx b/docs/src/content/docs/zh-cn/book/cells.mdx index 841856951..d1de13592 100644 --- a/docs/src/content/docs/zh-cn/book/cells.mdx +++ b/docs/src/content/docs/zh-cn/book/cells.mdx @@ -12,7 +12,7 @@ title: 细胞、建造者和切片 ### Kinds {#cells-kinds} -虽然 [TVM][tvm] 类型 [`单元格{:tact}`](#cells)指的是所有单元格,但有不同的单元格类型,其内存布局也各不相同。 前面描述的单元格(#cells)通常被称为_ordinary_(或 simple)单元格--这是最简单、最常用的单元格,只能包含数据。 绝大多数关于细胞及其用法的描述、指南和[参考文献](/ref/core-cells)都假定细胞是普通的。 +虽然 [TVM][tvm] 类型 [`单元格{:tact}`](#cells)指的是所有单元格,但有不同的单元格类型,其内存布局也各不相同。 前面描述的单元格(#cells)通常被称为_ordinary_(或 simple)单元格--这是最简单、最常用的单元格,只能包含数据。 绝大多数关于细胞及其用法的描述、指南和[参考文献](/zh-cn/ref/core-cells)都假定细胞是普通的。 其他类型的细胞统称为_外来细胞_(或特殊细胞)。 它们有时会出现在 TON 区块链上的区块和其他数据结构的实际表示中。 它们的内存布局和用途与普通电池大不相同。 @@ -21,7 +21,7 @@ title: 细胞、建造者和切片 [TVM][tvm]目前支持以下奇异细胞子类型: - [剪枝单元格][c-pruned],子类型编码为 $1$ - 它们代表删除的单元格子树。 -- [图书馆引用单元][c-library],子类型编码为 $2$ - 它们用于存储图书馆,通常在[masterchain](/book/masterchain)上下文中使用。 +- [图书馆引用单元][c-library],子类型编码为 $2$ - 它们用于存储图书馆,通常在[masterchain](/zh-cn/book/masterchain)上下文中使用。 - [梅克尔证明单元][c-mproof],子类型编码为 $3$ - 它们用于验证其他单元的树数据的某些部分是否属于完整树。 - [梅克尔更新单元][c-mupdate],子类型编码为 $4$ - 它们总是有两个引用,对这两个引用的行为类似于[梅克尔证明][mproof]。 @@ -63,7 +63,7 @@ title: 细胞、建造者和切片 最后,为每个参考单元存储其标准表示的[SHA-256][sha-2] 哈希值,每个参考单元占用 $32$ 字节,并递归重复上述算法。 请注意,不允许循环引用单元格,因此递归总是以定义明确的方式结束。 -如果我们要计算这个单元格的标准表示的哈希值,就需要将上述步骤中的所有字节连接在一起,然后使用 [SHA-256][sha-2] 哈希值进行散列。 这是[TVM][tvm]的[`HASHCU`和`HASHSU`指令](https://docs.ton.org/learn/tvm-instructions/instructions)以及 Tact 的[`Cell.hash(){:tact}`](/ref/core-cells#cellhash)和[`Slice.hash(){:tact}`](/ref/core-cells#slicehash)函数背后的算法。 +如果我们要计算这个单元格的标准表示的哈希值,就需要将上述步骤中的所有字节连接在一起,然后使用 [SHA-256][sha-2] 哈希值进行散列。 这是[TVM][tvm]的[`HASHCU`和`HASHSU`指令](https://docs.ton.org/learn/tvm-instructions/instructions)以及 Tact 的[`Cell.hash(){:tact}`](/zh-cn/ref/core-cells#cellhash)和[`Slice.hash(){:tact}`](/zh-cn/ref/core-cells#slicehash)函数背后的算法。 #### Bag of Cells {#cells-boc} @@ -122,10 +122,10 @@ title: 细胞、建造者和切片 ## Serialization types -与 [`Int{:tact}`](/book/integers)类型的序列化选项类似,`Cell{:tact}`、`Builder{:tact}` 和`Slice{:tact}` 在以下情况下也有不同的值编码方式: +与 [`Int{:tact}`](/zh-cn/book/integers)类型的序列化选项类似,`Cell{:tact}`、`Builder{:tact}` 和`Slice{:tact}` 在以下情况下也有不同的值编码方式: -- 作为 [contracts](/book/contracts) 和 [traits](/book/types#traits) 的 [storage variables](/book/contracts#variables) 、 -- 以及 [Structs](/book/structs and-messages#structs) 和 [Messages](/book/structs and-messages#messages) 的字段。 +- 作为 [contracts](/zh-cn/book/contracts) 和 [traits](/zh-cn/book/types#traits) 的 [storage variables](/zh-cn/book/contracts#variables) 、 +- 以及 [Structs](/zh-cn/book/structs and-messages#structs) 和 [Messages](/zh-cn/book/structs and-messages#messages) 的字段。 ```tact {2-3} contract SerializationExample { @@ -201,9 +201,9 @@ receive(msg: JettonTransferNotification) { :::note - 注意,通过 `as remaining{:tact}` 序列化的单元格不能是 [可选](/book/optionals)。 也就是说,指定类似 `Cell? as remaining{:tact}`, `Builder? 作为剩余{:tact}` 或 `切片? 剩余的{:tact}` 会导致编译错误。 + 注意,通过 `as remaining{:tact}` 序列化的单元格不能是 [可选](/zh-cn/book/optionals)。 也就是说,指定类似 `Cell? as remaining{:tact}`, `Builder? 作为剩余{:tact}` 或 `切片? 剩余的{:tact}` 会导致编译错误。 - 另外请注意,将 `Cell{:tact}` 指定为[map](/book/maps) 值类型的 `remaining{:tact}` 会被视为错误,无法编译。 + 另外请注意,将 `Cell{:tact}` 指定为[map](/zh-cn/book/maps) 值类型的 `remaining{:tact}` 会被视为错误,无法编译。 ::: @@ -229,7 +229,7 @@ receive(msg: JettonTransferNotification) { 在 Tact 中,至少有两种构建和解析单元格的方法: -- [手动](#cnp-manually),其中涉及积极使用[`Builder{:tact}`](#builders)、[`Slice{:tact}`](#slices)和[相关方法](/ref/core-cells)。 +- [手动](#cnp-manually),其中涉及积极使用[`Builder{:tact}`](#builders)、[`Slice{:tact}`](#slices)和[相关方法](/zh-cn/ref/core-cells)。 - [使用结构体](#cnp-structs),这是一种值得推荐且更加方便的方法。 #### Manually {#cnp-manually} @@ -246,30 +246,30 @@ receive(msg: JettonTransferNotification) { | [`.storeRef(cell){:tact}`][b-8] | [`Slice.loadRef(){:tact}`][s-8] | | [`.endCell(){:tact}`][b-9] | [`Slice.endParse(){:tact}`][s-9] | -[b-1]: /ref/core-cells#begincell -[b-2]: /ref/core-cells#builderstoreuint -[b-3]: /ref/core-cells#builderstoreint -[b-4]: /ref/core-cells#builderstorebool -[b-5]: /ref/core-cells#builderstoreslice -[b-6]: /ref/core-cells#builderstorecoins -[b-7]: /ref/core-cells#builderstoreaddress -[b-8]: /ref/core-cells#builderstoreref -[b-9]: /ref/core-cells#builderendcell -[s-1]: /ref/core-cells#cellbeginparse -[s-2]: /ref/core-cells#sliceloaduint -[s-3]: /ref/core-cells#sliceloadint -[s-4]: /ref/core-cells#sliceloadbool -[s-5]: /ref/core-cells#sliceloadbits -[s-6]: /ref/core-cells#sliceloadcoins -[s-7]: /ref/core-cells#sliceloadaddress -[s-8]: /ref/core-cells#sliceloadref -[s-9]: /ref/core-cells#sliceendparse +[b-1]: /zh-cn/ref/core-cells#begincell +[b-2]: /zh-cn/ref/core-cells#builderstoreuint +[b-3]: /zh-cn/ref/core-cells#builderstoreint +[b-4]: /zh-cn/ref/core-cells#builderstorebool +[b-5]: /zh-cn/ref/core-cells#builderstoreslice +[b-6]: /zh-cn/ref/core-cells#builderstorecoins +[b-7]: /zh-cn/ref/core-cells#builderstoreaddress +[b-8]: /zh-cn/ref/core-cells#builderstoreref +[b-9]: /zh-cn/ref/core-cells#builderendcell +[s-1]: /zh-cn/ref/core-cells#cellbeginparse +[s-2]: /zh-cn/ref/core-cells#sliceloaduint +[s-3]: /zh-cn/ref/core-cells#sliceloadint +[s-4]: /zh-cn/ref/core-cells#sliceloadbool +[s-5]: /zh-cn/ref/core-cells#sliceloadbits +[s-6]: /zh-cn/ref/core-cells#sliceloadcoins +[s-7]: /zh-cn/ref/core-cells#sliceloadaddress +[s-8]: /zh-cn/ref/core-cells#sliceloadref +[s-9]: /zh-cn/ref/core-cells#sliceendparse #### Using Structs {#cnp-structs} [结构][struct]和[消息][messages]几乎就是活生生的[TL-B 模式][tlb]。 也就是说,它们本质上是用可维护、可验证和用户友好的 Tact 代码表达的[TL-B 模式][tlb]。 -强烈建议使用它们及其 [方法](/book/functions#extension-function),如 [`Struct.toCell(){:tact}`][st-tc]和 [`Struct.fromCell(){:tact}`][st-fc],而不是手动构造和解析单元格,因为这样可以得到更多声明性和不言自明的合约。 +强烈建议使用它们及其 [方法](/zh-cn/book/functions#extension-function),如 [`Struct.toCell(){:tact}`][st-tc]和 [`Struct.fromCell(){:tact}`][st-fc],而不是手动构造和解析单元格,因为这样可以得到更多声明性和不言自明的合约。 [上文](#cnp-manually)的手动解析示例可以使用[Structs][struct]重新编写,如果愿意,还可以使用字段的描述性名称: @@ -313,7 +313,7 @@ fun example() { :::note[Useful links:] - [Convert serialization](/book/func#convert-serialization) + [Convert serialization](/zh-cn/book/func#convert-serialization) [`Struct.toCell(){:tact}` 在核心库中][st-tc] [`Struct.fromCell(){:tact}` 在核心库中][st-fc] [`Struct.fromSlice(){:tact}` 在核心库中][st-fs] @@ -323,12 +323,12 @@ fun example() { ::: -[st-tc]: /ref/core-cells#structtocell -[st-fc]: /ref/core-cells#structfromcell -[st-fs]: /ref/core-cells#structfromslice -[msg-tc]: /ref/core-cells#messagetocell -[msg-fc]: /ref/core-cells#messagefromcell -[msg-fs]: /ref/core-cells#messagefromslice +[st-tc]: /zh-cn/ref/core-cells#structtocell +[st-fc]: /zh-cn/ref/core-cells#structfromcell +[st-fs]: /zh-cn/ref/core-cells#structfromslice +[msg-tc]: /zh-cn/ref/core-cells#messagetocell +[msg-fc]: /zh-cn/ref/core-cells#messagefromcell +[msg-fs]: /zh-cn/ref/core-cells#messagefromslice ### Check if empty {#operations-empty} @@ -336,7 +336,7 @@ fun example() { 要检查是否有任何位,请使用[`Slice.dataEmpty(){:tact}`][s-de]。要检查是否存在引用,请使用[`Slice.refsEmpty(){:tact}`][s-re]。要同时检查这两项,请使用[`Slice.empty(){:tact}`][s-e]。 -如果[`Slice{:tact}`](#slices)不完全为空,也要抛出[exit code 9](/book/exit-codes#9),请使用[`Slice.endParse(){:tact}`][s-ep]。 +如果[`Slice{:tact}`](#slices)不完全为空,也要抛出[exit code 9](/zh-cn/book/exit-codes#9),请使用[`Slice.endParse(){:tact}`][s-ep]。 ```tact // 准备工作 @@ -370,8 +370,8 @@ try { :::note[Useful links:] - [`Cell.asSlice(){:tact}` 在核心库中](/ref/core-cells#cellasslice)\ - [`Builder.asSlice(){:tact}` 在核心库中](/ref/core-cells#builderasslice)\ + [`Cell.asSlice(){:tact}` 在核心库中](/zh-cn/ref/core-cells#cellasslice)\ + [`Builder.asSlice(){:tact}` 在核心库中](/zh-cn/ref/core-cells#builderasslice)\ [`Slice.dataEmpty(){:tact}` 在核心库中][s-de]\ [`Slice.refsEmpty(){:tact}` 在核心库中][s-re]\ [`Slice.empty(){:tact}` 在核心库中][s-e]\ @@ -379,10 +379,10 @@ try { ::: -[咝--咝]: /ref/core-cells#slicedataempty -[re]: /ref/core-cells#slicerefsempty -[s-e]: /ref/core-cells#sliceempty -[s-ep]: /ref/core-cells#sliceendparse +[咝--咝]: /zh-cn/ref/core-cells#slicedataempty +[re]: /zh-cn/ref/core-cells#slicerefsempty +[s-e]: /zh-cn/ref/core-cells#sliceempty +[s-ep]: /zh-cn/ref/core-cells#sliceendparse ### Check if equal {#operations-equal} @@ -424,16 +424,16 @@ let areSlicesNotEqual = aSlice.hash() != bSlice.hash(); // false :::note[Useful links:] - [核心库中的 `Cell.hash(){:tact}`](/ref/core-cells#cellhash)/ - [核心库中的 `Slice.hash(){:tact}`](/ref/core-cells#slicehash)/ + [核心库中的 `Cell.hash(){:tact}`](/zh-cn/ref/core-cells#cellhash)/ + [核心库中的 `Slice.hash(){:tact}`](/zh-cn/ref/core-cells#slicehash)/ [`=={:tact}`和`!={:tact}`][bin-eq]。 ::: -[p]: /book/types#primitive-types -[struct]: /book/structs-and-messages#structs -[message]: /book/structs-and-messages#messages -[recv]: /book/contracts#receiver-functions +[p]: /zh-cn/book/types#primitive-types +[struct]: /zh-cn/book/structs-and-messages#structs +[message]: /zh-cn/book/structs-and-messages#messages +[recv]: /zh-cn/book/contracts#receiver-functions [tvm]: https://docs.ton.org/learn/tvm-instructions/tvm-overview [tlb]: https://docs.ton.org/develop/data-formats/tl-b-language @@ -441,4 +441,4 @@ let areSlicesNotEqual = aSlice.hash() != bSlice.hash(); // false [sha-2]: https://en.wikipedia.org/wiki/SHA-2#Hash_standard [quadtree]: https://en.wikipedia.org/wiki/Quadtree -[bin-eq]: /book/operators#binary-equality +[bin-eq]: /zh-cn/book/operators#binary-equality diff --git a/docs/src/content/docs/zh-cn/book/config.mdx b/docs/src/content/docs/zh-cn/book/config.mdx index f12a4bacf..4d41ca9fc 100644 --- a/docs/src/content/docs/zh-cn/book/config.mdx +++ b/docs/src/content/docs/zh-cn/book/config.mdx @@ -144,7 +144,7 @@ title: 配置 :::note - 更多信息,请访问专用页面:[调试](/book/debug)。 + 更多信息,请访问专用页面:[调试](/zh-cn/book/debug)。 ::: @@ -152,7 +152,7 @@ title: 配置 默认为 `false{:json}`。 -如果设置为 `true{:json}`,则启用 [masterchain](/book/masterchain) 支持。 +如果设置为 `true{:json}`,则启用 [masterchain](/zh-cn/book/masterchain) 支持。 ```json filename="tact.config.json" {8,14} { @@ -177,7 +177,7 @@ title: 配置 :::note - 更多信息,请访问专用页面:[大师链](/book/masterchain)。 + 更多信息,请访问专用页面:[大师链](/zh-cn/book/masterchain)。 ::: @@ -185,7 +185,7 @@ title: 配置 默认为 `false{:json}`。 -如果设置为 `true{:json}`,则启用对 [external](/book/external) 消息接收器的支持。 +如果设置为 `true{:json}`,则启用对 [external](/zh-cn/book/external) 消息接收器的支持。 ```json filename="tact.config.json" {8,14} { @@ -210,7 +210,7 @@ title: 配置 :::note - 更多信息,请访问专用页面:[外部信息](/book/external)。 + 更多信息,请访问专用页面:[外部信息](/zh-cn/book/external)。 ::: @@ -218,7 +218,7 @@ title: 配置 默认为 `false{:json}`。 -如果设置为 `true{:json}`,则可生成带有描述合同 ABI 的 IPFS 链接的[getter](/book/contracts#getter-functions)。 +如果设置为 `true{:json}`,则可生成带有描述合同 ABI 的 IPFS 链接的[getter](/zh-cn/book/contracts#getter-functions)。 ```json filename="tact.config.json" {8,14} { @@ -243,7 +243,7 @@ title: 配置 :::note - 在专用网页上阅读更多信息:[OTP-003:自我 ABI 报告](/ref/evolution/otp-003)。 + 在专用网页上阅读更多信息:[OTP-003:自我 ABI 报告](/zh-cn/ref/evolution/otp-003)。 ::: @@ -276,7 +276,7 @@ title: 配置 :::note - 了解更多信息:[支持的接口](/book/contracts#interfaces)。 + 了解更多信息:[支持的接口](/zh-cn/book/contracts#interfaces)。 ::: diff --git a/docs/src/content/docs/zh-cn/book/constants.mdx b/docs/src/content/docs/zh-cn/book/constants.mdx index 0a378befb..b0d83935f 100644 --- a/docs/src/content/docs/zh-cn/book/constants.mdx +++ b/docs/src/content/docs/zh-cn/book/constants.mdx @@ -24,7 +24,7 @@ contract MyContract { } ``` -## 虚拟常量和抽象常量 +## 虚拟常量和抽象常量 {#virtual-and-abstract-constants} 虚拟常量是可以在特质中定义但在合约中改变的常量。 当您需要在编译时配置某些特征时,它非常有用。 让我们定义一个虚拟常量和一个抽象常量: diff --git a/docs/src/content/docs/zh-cn/book/contracts.mdx b/docs/src/content/docs/zh-cn/book/contracts.mdx index f9692c109..ff7d10718 100644 --- a/docs/src/content/docs/zh-cn/book/contracts.mdx +++ b/docs/src/content/docs/zh-cn/book/contracts.mdx @@ -2,11 +2,11 @@ title: 合同 --- -Tact 中的合约类似于流行的面向对象语言中的类,只是它们的实例部署在区块链上,不能像 [Structs and Messages](/book/structs-and-messages) 那样被传递。 +Tact 中的合约类似于流行的面向对象语言中的类,只是它们的实例部署在区块链上,不能像 [Structs and Messages](/zh-cn/book/structs-and-messages) 那样被传递。 ## Self-references {#self} -契约和[特质][trait]有一个内置的[标识符](/book/expressions#identifiers) `self{:tact}`,用于引用它们的字段(持久状态[变量](#variables)和[常量](#constants))和方法([内部函数](#internal-functions)): +契约和[特质][trait]有一个内置的[标识符](/zh-cn/book/expressions#identifiers) `self{:tact}`,用于引用它们的字段(持久状态[变量](#variables)和[常量](#constants))和方法([内部函数](#internal-functions)): ```tact contract Example { @@ -34,7 +34,7 @@ contract Example { ### Inherited traits, `with{:tact}` {#traits} -契约可以继承[traits][trait]的所有声明和定义,并覆盖它们的某些默认行为。除此之外,每个契约和特质都隐式继承了特殊的[`BaseTrait{:tact}` trait](/ref/core-base)。 +契约可以继承[traits][trait]的所有声明和定义,并覆盖它们的某些默认行为。除此之外,每个契约和特质都隐式继承了特殊的[`BaseTrait{:tact}` trait](/zh-cn/ref/core-base)。 要继承[trait][trait],请在合约声明中的关键字`with{:tact}`后指定其名称。要同时继承多个特质,请在逗号分隔的列表中指定它们的名称,并在后面加上逗号。 @@ -64,15 +64,15 @@ contract Vot with Supe { } ``` -如果在特质中声明或定义了内部函数和常量,则可将其标记为[虚拟或抽象](/book/functions#virtual-and-abstract-functions),并在从特质继承的合约中重写。 +如果在特质中声明或定义了内部函数和常量,则可将其标记为[虚拟或抽象](/zh-cn/book/functions#virtual-and-abstract-functions),并在从特质继承的合约中重写。 ### Supported interfaces, `@interface(…)` {#interfaces} 如果不查看源代码,就很难弄清一个合约是做什么的,有哪些[接收器](#receiver-functions)和[获取器](#getter-functions)。有时,无法获得或无法访问源代码,剩下的办法就是尝试拆解合同,并以这种方式对其进行反省,这是一种非常混乱且容易出错的方法,其收益会递减,而且没有真正的可重复性。 -为了解决这个问题,创建了[OTP-001:支持的接口](/ref/evolution/otp-001)。据此,Tact 合约[可以报告](/book/config#options-interfacesgetter)支持的接口列表,作为特殊的`supported_interfaces` [getter](#getter-functions)的返回值。使用任何 TON 区块链浏览器都可以在链外访问该获取器--只需指定"supported_interfaces"作为要执行的方法,即可获得十六进制值列表。 +为了解决这个问题,创建了[OTP-001:支持的接口](/zh-cn/ref/evolution/otp-001)。据此,Tact 合约[可以报告](/zh-cn/book/config#options-interfacesgetter)支持的接口列表,作为特殊的`supported_interfaces` [getter](#getter-functions)的返回值。使用任何 TON 区块链浏览器都可以在链外访问该获取器--只需指定"supported_interfaces"作为要执行的方法,即可获得十六进制值列表。 -这些十六进制值被截断为受支持接口的原始[`String{:tact}`][p]值的[SHA-256](https://en.wikipedia.org/wiki/SHA-2#Hash_standard)哈希值的前 128 位。该列表中的第一个值**必须**等于$\mathrm{0x5cec3d5d2cae7b1e84ec39d64a851b66}$([十六进制符号](/book/integers#hexadecimal)),即`"org.ton.introspection.v0"{:tact}`的 SHA-256 哈希值的前半部分。如果第一个值是错误的,就必须停止反省合同,因为它不符合[支持的接口](/ref/evolution/otp-001)建议。 +这些十六进制值被截断为受支持接口的原始[`String{:tact}`][p]值的[SHA-256](https://en.wikipedia.org/wiki/SHA-2#Hash_standard)哈希值的前 128 位。该列表中的第一个值**必须**等于$\mathrm{0x5cec3d5d2cae7b1e84ec39d64a851b66}$([十六进制符号](/zh-cn/book/integers#hexadecimal)),即`"org.ton.introspection.v0"{:tact}`的 SHA-256 哈希值的前半部分。如果第一个值是错误的,就必须停止反省合同,因为它不符合[支持的接口](/zh-cn/ref/evolution/otp-001)建议。 要声明支持某个接口,可在 contract 和[trait][trait]声明之前添加一个或多个`@interface("…"){:tact}`属性: @@ -91,19 +91,19 @@ trait Misc { Tact 有一小套在特定条件下提供的接口: -- `"org.ton.abi.ipfs.v0"{:tact}`,根据 [OTP-003: Self-ABI Reporting](/ref/evolution/otp-003) - 通过 [`ipfsAbiGetter`](/book/config#options-ipfsabigetter)配置属性选择加入 -- `"org.ton.deploy.lazy.v0"{:tact}`,符合[OTP-005:参数可寻址合约](/ref/evolution/otp-005) -- `"org.ton.debug.v0"{:tact}`,但只有在启用了[调试模式](/book/debug#debug-mode)时才会这样做 -- `"org.ton.chain.any.v0"{:tact}` 如果启用了 [masterchain](/book/masterchain) 支持,否则为 `"org.ton.chain.workchain.v0"{:tact}` +- `"org.ton.abi.ipfs.v0"{:tact}`,根据 [OTP-003: Self-ABI Reporting](/zh-cn/ref/evolution/otp-003) - 通过 [`ipfsAbiGetter`](/zh-cn/book/config#options-ipfsabigetter)配置属性选择加入 +- `"org.ton.deploy.lazy.v0"{:tact}`,符合[OTP-005:参数可寻址合约](/zh-cn/ref/evolution/otp-005) +- `"org.ton.debug.v0"{:tact}`,但只有在启用了[调试模式](/zh-cn/book/debug#debug-mode)时才会这样做 +- `"org.ton.chain.any.v0"{:tact}` 如果启用了 [masterchain](/zh-cn/book/masterchain) 支持,否则为 `"org.ton.chain.workchain.v0"{:tact}` -[标准库](/ref/standard-libraries)中的一些[traits][trait]也定义了它们的接口: +[标准库](/zh-cn/ref/standard-libraries)中的一些[traits][trait]也定义了它们的接口: -- [`Ownable{:tact}`](/ref/stdlib-ownable#ownable) trait 指定`"org.ton.ownable"{:tact}` -- [`OwnableTransferable{:tact}`](/ref/stdlib-ownable#ownabletransferable) trait 指定`"org.ton.ownable.transferable.v2"{:tact}` -- [`Stoppable{:tact}`](/ref/stdlib-stoppable#stoppable) trait 指定`"org.ton.stoppable"{:tact}` -- [`Resumable{:tact}`](/ref/stdlib-stoppable#resumable) trait 指定`"org.ton.resumable"{:tact}` +- [`Ownable{:tact}`](/zh-cn/ref/stdlib-ownable#ownable) trait 指定`"org.ton.ownable"{:tact}` +- [`OwnableTransferable{:tact}`](/zh-cn/ref/stdlib-ownable#ownabletransferable) trait 指定`"org.ton.ownable.transferable.v2"{:tact}` +- [`Stoppable{:tact}`](/zh-cn/ref/stdlib-stoppable#stoppable) trait 指定`"org.ton.stoppable"{:tact}` +- [`Resumable{:tact}`](/zh-cn/ref/stdlib-stoppable#resumable) trait 指定`"org.ton.resumable"{:tact}` -要启用 `supported_interfaces` [getter](#getter-functions) 生成并在 Tact 合约中使用 `@interface(){:tact}` 属性,请修改项目根目录下的 [`tact.config.json`](/book/config) 文件(如果该文件不存在,则创建该文件),并 [将 `interfacesGetter` 属性设置为 `true{:json}`](/book/config#options-interfacesgetter)。 +要启用 `supported_interfaces` [getter](#getter-functions) 生成并在 Tact 合约中使用 `@interface(){:tact}` 属性,请修改项目根目录下的 [`tact.config.json`](/zh-cn/book/config) 文件(如果该文件不存在,则创建该文件),并 [将 `interfacesGetter` 属性设置为 `true{:json}`](/zh-cn/book/config#options-interfacesgetter)。 如果您的项目基于 [Blueprint][bp],您可以在合约的编译配置中启用`supported_interfaces`,这些配置位于名为`wrappers/`的目录中: @@ -119,7 +119,7 @@ export const compile:CompilerConfig = { }; ``` -除此之外,[蓝图][bp] 项目中仍可使用 [`tact.config.json`](/book/config)。 在这种情况下,除非在 `wrappers/` 中进行修改,否则 [`tact.config.json`](/book/config)中指定的值将作为默认值。 +除此之外,[蓝图][bp] 项目中仍可使用 [`tact.config.json`](/zh-cn/book/config)。 在这种情况下,除非在 `wrappers/` 中进行修改,否则 [`tact.config.json`](/zh-cn/book/config)中指定的值将作为默认值。 :::caution 请注意,添加接口并不能保证合约实际实现任何特定功能,也不能保证以任何特定方式实现这些功能。 这只是一种可验证的链外承诺,即合同中可能包含某些特定代码。 您应该相信但要核实这些说法。 @@ -129,7 +129,7 @@ export const compile:CompilerConfig = { ### Persistent state variables {#variables} -合约可以定义在合约调用之间持续存在的状态变量。 TON 中的合约[支付租金](https://docs.ton.org/develop/smart-contracts/fees#storage-fee) 与它们消耗的持久空间成正比,因此鼓励[通过序列化进行紧凑表示](/book/integers#serialization)。 +合约可以定义在合约调用之间持续存在的状态变量。 TON 中的合约[支付租金](https://docs.ton.org/develop/smart-contracts/fees#storage-fee) 与它们消耗的持久空间成正比,因此鼓励[通过序列化进行紧凑表示](/zh-cn/book/integers#serialization)。 ```tact contract Example { @@ -141,11 +141,11 @@ contract Example { } ``` -状态变量必须有默认值或在 [`init(){:tact}`](#init-function) 函数中初始化,该函数在部署合约时运行。唯一的例外是 [`map{:tact}`](/book/maps) 类型的持久状态变量,因为它们默认初始化为空。 +状态变量必须有默认值或在 [`init(){:tact}`](#init-function) 函数中初始化,该函数在部署合约时运行。唯一的例外是 [`map{:tact}`](/zh-cn/book/maps) 类型的持久状态变量,因为它们默认初始化为空。 :::note - 请注意,Tact 也支持非持续状态的局部变量,请参阅:[变量声明](/book/statements#let)。 + 请注意,Tact 也支持非持续状态的局部变量,请参阅:[变量声明](/zh-cn/book/statements#let)。 ::: @@ -159,7 +159,7 @@ contract Example { 您可以在 [接收器](#receiver-functions) 和 [获取器](#getter-functions) 中读取常量。 -与[合约变量](#variables)不同,**合约常量不会占用持久状态**的空间。 它们的值直接存储在合约的代码 [`单元格`](/book/cells#cells)中。 +与[合约变量](#variables)不同,**合约常量不会占用持久状态**的空间。 它们的值直接存储在合约的代码 [`单元格`](/zh-cn/book/cells#cells)中。 ```tact // 全局常量在编译时计算,不能更改 @@ -182,7 +182,7 @@ contract Example { } ``` -有关常量的更多信息,请访问其专门页面:[常量](/book/constants)。 +有关常量的更多信息,请访问其专门页面:[常量](/zh-cn/book/constants)。 ### Constructor function `init()` {#init-function} @@ -226,13 +226,13 @@ contract TheySeeMeTrailing { :::note - 要获取 [内部函数](#internal-functions)、[接收器](#receiver-functions) 或 [getters](#getter-functions) 中目标合约的初始状态,请使用 [`initOf{:tact}`](/book/expressions#initof)表达式。 + 要获取 [内部函数](#internal-functions)、[接收器](#receiver-functions) 或 [getters](#getter-functions) 中目标合约的初始状态,请使用 [`initOf{:tact}`](/zh-cn/book/expressions#initof)表达式。 ::: ### Getter functions -[获取函数](/book/functions#getter-functions) **不能从其他合约访问,只能导出到链外世界**。 +[获取函数](/zh-cn/book/functions#getter-functions) **不能从其他合约访问,只能导出到链外世界**。 此外,**获取器不能修改合约的状态变量**,只能读取它们的值并在表达式中使用。 @@ -251,15 +251,15 @@ contract HelloWorld { } ``` -请在其专门章节中阅读更多相关信息:[获取函数](/book/functions#getter-functions) +请在其专门章节中阅读更多相关信息:[获取函数](/zh-cn/book/functions#getter-functions) ### Receiver functions -Tact 中的[接收器函数](/book/functions#receiver-functions)可以是以下三种之一: +Tact 中的[接收器函数](/zh-cn/book/functions#receiver-functions)可以是以下三种之一: -- [`receive(){:tact}`](/book/receive),用于接收内部消息(来自其他合约)。 -- [`bounced(){:tact}`](/book/bounced),当该合约发出的消息被退回时会调用。 -- [`external(){:tact}`](/book/external),没有发送者,世界上任何人都可以发送。 +- [`receive(){:tact}`](/zh-cn/book/receive),用于接收内部消息(来自其他合约)。 +- [`bounced(){:tact}`](/zh-cn/book/bounced),当该合约发出的消息被退回时会调用。 +- [`external(){:tact}`](/zh-cn/book/external),没有发送者,世界上任何人都可以发送。 ```tact message CanBounce { @@ -339,9 +339,9 @@ contract Functions { } ``` :::note - 请注意,Tact 还支持其他类型的函数,请参阅[函数](/book/functions)。 + 请注意,Tact 还支持其他类型的函数,请参阅[函数](/zh-cn/book/functions)。 ::: -[p]: /book/types#primitive-types -[特质]: /book/types#traits +[p]: /zh-cn/book/types#primitive-types +[特质]: /zh-cn/book/types#traits [bp]: https://github.com/ton-org/blueprint diff --git a/docs/src/content/docs/zh-cn/book/debug.mdx b/docs/src/content/docs/zh-cn/book/debug.mdx index b53790668..1dcc46c20 100644 --- a/docs/src/content/docs/zh-cn/book/debug.mdx +++ b/docs/src/content/docs/zh-cn/book/debug.mdx @@ -61,7 +61,7 @@ import { LinkCard, CardGrid, Steps, Tabs, TabItem } from '@astrojs/starlight/com 目前,Tact 还没有步进式调试器。 尽管如此,仍然可以使用["printf 调试"](https://en.wikipedia.org/wiki/Debugging#printf_debugging) 方法。 -这包括在整个代码中主动调用 [`dump(){:tact}`][dump]和 [`dumpStack(){:tact}`](/ref/core-debug#dumpstack)函数,并观察特定时间点的变量状态。 请注意,这些函数只在 [调试模式](#debug-mode)下工作,否则不会执行。 +这包括在整个代码中主动调用 [`dump(){:tact}`][dump]和 [`dumpStack(){:tact}`](/zh-cn/ref/core-debug#dumpstack)函数,并观察特定时间点的变量状态。 请注意,这些函数只在 [调试模式](#debug-mode)下工作,否则不会执行。 :::note @@ -69,13 +69,13 @@ import { LinkCard, CardGrid, Steps, Tabs, TabItem } from '@astrojs/starlight/com ::: -除了转储值之外,使用 [`require(){:tact}`](/ref/core-debug#require)、[`nativeThrowIf(){:tact}`](/ref/core-debug#nativethrowif)和 [`nativeThrowUnless(){:tact}`](/ref/core-debug#nativethrowunless)等自信的函数通常也很有帮助。 它们有助于明确说明你的假设,并方便设置 "绊线",以便在将来发现问题。 +除了转储值之外,使用 [`require(){:tact}`](/zh-cn/ref/core-debug#require)、[`nativeThrowIf(){:tact}`](/zh-cn/ref/core-debug#nativethrowif)和 [`nativeThrowUnless(){:tact}`](/zh-cn/ref/core-debug#nativethrowunless)等自信的函数通常也很有帮助。 它们有助于明确说明你的假设,并方便设置 "绊线",以便在将来发现问题。 如果您没有找到或无法解决您的问题,请尝试在 Tact 的[Telegram 聊天][tg]中询问社区;如果您的问题或疑问与 TON 的关系大于与 Tact 的关系,请进入[TON Dev Telegram 聊天](https://t.me/tondev_eng)。 ## 常用调试功能 {#debug-functions} -Tact 提供了大量对调试有用的各种函数:[核心库 → 调试](/ref/core-debug)。 +Tact 提供了大量对调试有用的各种函数:[核心库 → 调试](/zh-cn/ref/core-debug)。 ## 在编译选项中启用调试模式 {#debug-mode} @@ -99,7 +99,7 @@ export const compile:CompilerConfig = { 请注意,从 0.20.0 开始的 [Blueprint][bp] 版本会自动为新合约启用 `wrappers/` 中的调试模式。 -除此之外,[蓝图][bp] 项目中仍可使用 [`tact.config.json`](/book/config)。 在这种情况下,除非在 `wrappers/` 中修改,否则 [`tact.config.json`](/book/config)中指定的值将作为默认值。 +除此之外,[蓝图][bp] 项目中仍可使用 [`tact.config.json`](/zh-cn/book/config)。 在这种情况下,除非在 `wrappers/` 中修改,否则 [`tact.config.json`](/zh-cn/book/config)中指定的值将作为默认值。 :::note @@ -139,7 +139,7 @@ Ton Emulator allows you to have a small virtual blockchain in your Node.js code. :::note - 强烈建议不要修改 `beforeEach(){:tact}` 中的内容,除非您确实需要为每个测试闭包设置某些特定行为,或者 [`init(){:tact}`](/book/contracts#init-function)函数的参数发生了变化。 + 强烈建议不要修改 `beforeEach(){:tact}` 中的内容,除非您确实需要为每个测试闭包设置某些特定行为,或者 [`init(){:tact}`](/zh-cn/book/contracts#init-function)函数的参数发生了变化。 ::: @@ -160,7 +160,7 @@ it('should deploy', async () => { 1. 在代码的相关位置调用 [`dump(){:tact}`][dump]和其他[常用调试函数](#debug-functions)。 2. 运行 [Jest][jest]测试,这些测试将调用目标函数并向目标接收器发送信息。 -假设你已经创建了一个 [新计数器合约项目](/#start),让我们来看看它是如何实际运行的。 +假设你已经创建了一个 [新计数器合约项目](/zh-cn/#start),让我们来看看它是如何实际运行的。 首先,让我们在 `contracts/simple_counter.tact` 中调用 [`dump(){:tact}`][dump],这将把 `msg{:tact}` [Struct][struct] 中传递的 `amount` 输出到合约的调试控制台: @@ -185,7 +185,7 @@ it('should dump', async () => { }); ``` -它向我们合约的 `receive(msg: Add){:tact}` [接收器](/book/receive) 发送信息,而不存储[发送结果](#tests-send)。 +它向我们合约的 `receive(msg: Add){:tact}` [接收器](/zh-cn/book/receive) 发送信息,而不存储[发送结果](#tests-send)。 现在,如果我们使用 `yarn build{:shell}` 构建我们的合约,并使用 `yarn test{:shell}` 运行我们的测试套件,我们将在测试日志中看到以下内容: @@ -277,7 +277,7 @@ expect(res.transactions).toHaveTransaction({ #### toEqualCell -方法 `expect(…).toEqualCell(){:typescript}` 检查两个 [单元格](/book/cells#cells)是否相等: +方法 `expect(…).toEqualCell(){:typescript}` 检查两个 [单元格](/zh-cn/book/cells#cells)是否相等: ```typescript {3} expect(oneCell).toEqualCell(anotherCell); @@ -285,7 +285,7 @@ expect(oneCell).toEqualCell(anotherCell); #### 对等切片 -方法 `expect(…).toEqualSlice(){:typescript}` 检查两个 [slices](/book/cells#slices) 是否相等: +方法 `expect(…).toEqualSlice(){:typescript}` 检查两个 [slices](/zh-cn/book/cells#slices) 是否相等: ```typescript {3} expect(oneSlice).toEqualSlice(anotherSlice); @@ -293,7 +293,7 @@ expect(oneSlice).toEqualSlice(anotherSlice); #### toEqualAddress -方法 `expect(…).toEqualAddress(){:typescript}` 检查两个 [地址](/book/types#primitive-types)是否相等: +方法 `expect(…).toEqualAddress(){:typescript}` 检查两个 [地址](/zh-cn/book/types#primitive-types)是否相等: ```typescript {3} expect(oneAddress).toEqualAddress(anotherAddress); @@ -317,7 +317,7 @@ await yourContractName.send( ); ``` -消息体可以是简单的字符串,也可以是指定 [消息](/book/structs-and-messages#messages)类型字段的对象: +消息体可以是简单的字符串,也可以是指定 [消息](/zh-cn/book/structs-and-messages#messages)类型字段的对象: ```typescript {4-8} await yourContractName.send( @@ -403,7 +403,7 @@ expect( ### 有故意错误的交易 {#tests-errors} -有时,进行负面测试也很有用,它可以故意出错并抛出特定的[退出代码](/book/exit-codes)。 +有时,进行负面测试也很有用,它可以故意出错并抛出特定的[退出代码](/zh-cn/book/exit-codes)。 [蓝图][bp]中此类[Jest][jest]测试闭包的示例: @@ -466,13 +466,13 @@ it('your test clause title', async () => { ## 通过 `emit` 记录 {#logging} -[全局静态函数](/book/functions#global-static-functions) [`emit(){:tact}`](/ref/core-common#emit)向外部世界发送信息--它没有特定的接收者。 +[全局静态函数](/zh-cn/book/functions#global-static-functions) [`emit(){:tact}`](/zh-cn/ref/core-common#emit)向外部世界发送信息--它没有特定的接收者。 -该功能对于记录和分析链外数据非常方便,只需查看合约生成的 [external messages](/book/external) 即可。 +该功能对于记录和分析链外数据非常方便,只需查看合约生成的 [external messages](/zh-cn/book/external) 即可。 ### 本地沙箱测试中的日志 {#logging-local} -在 [Sandbox][sb] 中部署时,您可以从 [receiver function](/book/contracts#receiver-functions) 中调用 [`emit(){:tact}`](/ref/core-common#emit),然后观察已发送的 [external messages](/book/external) 列表: +在 [Sandbox][sb] 中部署时,您可以从 [receiver function](/zh-cn/book/contracts#receiver-functions) 中调用 [`emit(){:tact}`](/zh-cn/ref/core-common#emit),然后观察已发送的 [external messages](/zh-cn/book/external) 列表: ```typescript {9-10} it('emits', async () => { @@ -492,7 +492,7 @@ it('emits', async () => { TON 区块链上的每笔交易都[包含`out_msgs`](https://docs.ton.org/develop/data-formats/transaction-layout#transaction) - 这是一个字典,保存着执行交易时创建的传出消息列表。 -要查看字典中 [`emit(){:tact}`](/ref/core-common#emit)的日志,请查找没有收件人的外部消息。 在各种 TON 区块链探索器中,此类交易将被标记为 "外部输出",目的地指定为"-"或 "空"。 +要查看字典中 [`emit(){:tact}`](/zh-cn/ref/core-common#emit)的日志,请查找没有收件人的外部消息。 在各种 TON 区块链探索器中,此类交易将被标记为 "外部输出",目的地指定为"-"或 "空"。 请注意,有些探索者会为你反序列化发送的信息体,而有些则不会。 不过,您可以随时在本地[自行解析](#logging-parsing)。 @@ -533,7 +533,7 @@ it('emits', async () => { }); ``` -在这里,`res` 对象的`externals`字段将包含已发送的[外部信息](/book/external)列表。 让我们访问它,以解析通过调用 Tact 代码中的 [`emit(){:tact}`](/ref/core-common#emit)(或简称 _emitted_)发送的第一条信息: +在这里,`res` 对象的`externals`字段将包含已发送的[外部信息](/book/external)列表。 让我们访问它,以解析通过调用 Tact 代码中的 [`emit(){:tact}`](/zh-cn/ref/core-common#emit)(或简称 _emitted_)发送的第一条信息: ```typescript /body/ it('emits', async () => { @@ -586,7 +586,7 @@ it('emits', async () => { ## 处理退回的邮件 {#bounced} -当 [send](/book/send) 带有 `bounce: true{:tact}` 时,信息会在出错时反弹。确保编写相关的 [`bounced(){:tact}`](/book/bounced) 消息[接收器](/book/contracts#receiver-functions),并优雅地处理被退回的消息: +当 [send](/zh-cn/book/send) 带有 `bounce: true{:tact}` 时,信息会在出错时反弹。确保编写相关的 [`bounced(){:tact}`](/zh-cn/book/bounced) 消息[接收器](/zh-cn/book/contracts#receiver-functions),并优雅地处理被退回的消息: ```tact bounced(msg: YourMessage) { @@ -596,7 +596,7 @@ bounced(msg: YourMessage) { 请记住,在 TON 中被退回的邮件正文中只有 $224$ 个可用数据位,而且没有任何引用,因此无法从中恢复很多数据。 不过,您仍然可以看到邮件是否被退回,从而可以创建更稳健的合同。 -了解更多有关退信和收信人的信息:[退信](/book/bounced)。 +了解更多有关退信和收信人的信息:[退信](/zh-cn/book/bounced)。 ## 实验实验室设置 {#lab} @@ -669,7 +669,7 @@ bounced(msg: YourMessage) { } ``` - 此设置的基本思想是将要测试的代码放入 [receiver function](/book/contracts#receiver-functions) 中,以响应 [string](/book/types#primitive-types) 消息 `"plays"{:tact}`。 + 此设置的基本思想是将要测试的代码放入 [receiver function](/zh-cn/book/contracts#receiver-functions) 中,以响应 [string](/zh-cn/book/types#primitive-types) 消息 `"plays"{:tact}`。 请注意,您仍然可以在[接收器](/book/contracts#receiver-functions)之外编写任何有效的 Tact 代码。 但为了测试它,你需要在其中编写相关的测试逻辑。 @@ -714,11 +714,11 @@ bounced(msg: YourMessage) { -[转储]: /ref/core-debug#dump +[转储]: /zh-cn/ref/core-debug#dump [结构]: [信息]: -[电池]: /book/cells#cells -[一片]: /book/cells#slices +[电池]: /zh-cn/book/cells#cells +[一片]: /zh-cn/book/cells#slices [tg]: https://t.me/tactlang [bp]: https://github.com/ton-org/blueprint [某人]: https://github.com/ton-org/sandbox diff --git a/docs/src/content/docs/zh-cn/book/exit-codes.mdx b/docs/src/content/docs/zh-cn/book/exit-codes.mdx index 1dd9c39cc..bda221e3f 100644 --- a/docs/src/content/docs/zh-cn/book/exit-codes.mdx +++ b/docs/src/content/docs/zh-cn/book/exit-codes.mdx @@ -167,7 +167,7 @@ send(SendParameters{to: context().sender, value: ton("10")}); ### 128:空引用异常 {#128} -如果有一个非空断言,例如 [`!!{:tact}`](/book/operators#unary-non-null-assert)操作符,而检查值是 [`null{:tact}`](/book/optionals),则会抛出一个退出代码为 $128$ 的错误:"空引用异常"。 +如果有一个非空断言,例如 [`!!{:tact}`](/zh-cn/book/operators#unary-non-null-assert)操作符,而检查值是 [`null{:tact}`](/zh-cn/book/optionals),则会抛出一个退出代码为 $128$ 的错误:"空引用异常"。 ```tact let gotcha: String? = null; diff --git a/docs/src/content/docs/zh-cn/book/expressions.mdx b/docs/src/content/docs/zh-cn/book/expressions.mdx index 2ef28534e..50a7662bd 100644 --- a/docs/src/content/docs/zh-cn/book/expressions.mdx +++ b/docs/src/content/docs/zh-cn/book/expressions.mdx @@ -8,7 +8,7 @@ Tact 中的每个运算符都能构成一个表达式,但 Tact 还提供了更 字面表示 Tact 中的值。 这些是固定值,而不是变量,是您在代码中实际提供的。 Tact 中的所有字面量都是表达式本身。 -您还可以调用定义在某些 [基元类型][p]上的 [扩展函数](/book/functions#extension-function),这些 [基元类型][p] 与字面值相对应: +您还可以调用定义在某些 [基元类型][p]上的 [扩展函数](/zh-cn/book/functions#extension-function),这些 [基元类型][p] 与字面值相对应: ```tact // 在整数字面量上调用为 Int 定义的 toString() 函数: @@ -20,15 +20,15 @@ Tact 中的每个运算符都能构成一个表达式,但 Tact 还提供了更 ### Integer literals -整数字面可以用[十进制](/book/integers#decimal)(基 $10$)、[十六进制](/book/integers#hexadecimal)(基 $16$)、[八进制](/book/integers#octal)(基 $8$)和[二进制](/book/integers#binary)(基 $2$)符号书写: +整数字面可以用[十进制](/zh-cn/book/integers#decimal)(基 $10$)、[十六进制](/zh-cn/book/integers#hexadecimal)(基 $16$)、[八进制](/zh-cn/book/integers#octal)(基 $8$)和[二进制](/zh-cn/book/integers#binary)(基 $2$)符号书写: -- 一个 [_decimal_ integer](/book/integers#decimal) 字面量是一串数字($\mathrm{0 - 9}$)。 +- 一个 [_decimal_ integer](/zh-cn/book/integers#decimal) 字面量是一串数字($\mathrm{0 - 9}$)。 -- 前导 $\mathrm{0x}$(或 $\mathrm{0X}$)表示[十六进制整数](/book/integers#hexadecimal) 字面量。 它们可以包括数字($\mathrm{0 - 9}$)和字母 $\mathrm{a - f}$ 和 $\mathrm{A - F}$。 请注意,字符的大小写不会改变其值。 因此:$\mathrm{0xa}$ = $\mathrm{0xA}$ = $10$ 和 $\mathrm{0xf}$ = $\mathrm{0xF}$ = $15$。 +- 前导 $\mathrm{0x}$(或 $\mathrm{0X}$)表示[十六进制整数](/zh-cn/book/integers#hexadecimal) 字面量。 它们可以包括数字($\mathrm{0 - 9}$)和字母 $\mathrm{a - f}$ 和 $\mathrm{A - F}$。 请注意,字符的大小写不会改变其值。 因此:$\mathrm{0xa}$ = $\mathrm{0xA}$ = $10$ 和 $\mathrm{0xf}$ = $\mathrm{0xF}$ = $15$。 -- 前导 $\mathrm{0o}$(或 $\mathrm{0O}$)表示 [octal integer](/book/integers#octal) 字面量。 它们只能包括数字 $\mathrm{0 - 7}$。 +- 前导 $\mathrm{0o}$(或 $\mathrm{0O}$)表示 [octal integer](/zh-cn/book/integers#octal) 字面量。 它们只能包括数字 $\mathrm{0 - 7}$。 -- 前导 $\mathrm{0b}$(或 $\mathrm{0B}$)表示 [二进制整数](/book/integers#binary) 字面量。 它们只能包括数字 $0$ 和 $1$。 +- 前导 $\mathrm{0b}$(或 $\mathrm{0B}$)表示 [二进制整数](/zh-cn/book/integers#binary) 字面量。 它们只能包括数字 $0$ 和 $1$。 :::caution 需要注意的是,在 Tact 中,以 $0$ 为前导的整数字面量仍被视为小数,而在 JavaScript/TypeScript 中,以 $0$ 为前导的整数字面量表示八进制! @@ -50,18 +50,18 @@ Tact 中的每个运算符都能构成一个表达式,但 Tact 还提供了更 0b01111001_01101111_01110101_00100000_01100001_01110010_01100101_00100000_01100001_01110111_01100101_01110011_01101111_01101101_01100101 ``` -有关整数和 [`Int{:tact}`](/book/integers)类型的更多信息,请访问专门页面:[整数](/book/integers)。 +有关整数和 [`Int{:tact}`](/zh-cn/book/integers)类型的更多信息,请访问专门页面:[整数](/zh-cn/book/integers)。 ### Boolean literals -[`Bool{:tact}`](/book/types#booleans)类型只有两个字面值:`true{:tact}`和`false{:tact}`。 +[`Bool{:tact}`](/zh-cn/book/types#booleans)类型只有两个字面值:`true{:tact}`和`false{:tact}`。 ```tact true == true; true != false; ``` -有关布尔和 [`Bool{:tact}`](/book/types#booleans)类型的更多信息,请参阅专门章节:[布尔](/book/types#booleans)。 +有关布尔和 [`Bool{:tact}`](/zh-cn/book/types#booleans)类型的更多信息,请参阅专门章节:[布尔](/zh-cn/book/types#booleans)。 ### String literals @@ -127,7 +127,7 @@ Tact 字符串支持一系列从反斜杠字符开始的[转义序列](https://e 阅读更多关于字符串和[`字符串{:tact}`][p]类型:\ [书中的原始类型][p]\ - [参考资料中的字符串和字符串构造器](/ref/core-strings)的内容 + [参考资料中的字符串和字符串构造器](/zh-cn/ref/core-strings)的内容 ::: @@ -143,15 +143,15 @@ if (var != null) { } ``` -有关使用 `null{:tact}`的更多信息,请访问专门页面:[选项](/book/optionals)。 +有关使用 `null{:tact}`的更多信息,请访问专门页面:[选项](/zh-cn/book/optionals)。 ## Identifiers -标识符是代码中的一串字符,用于标识[变量](/book/statements#let)、[常量](/book/constants)、[映射](/book/maps)和[函数](/book/functions),以及[结构][s]、[消息][m]、[契约](/book/contracts)、[特质](/book/types#traits)或它们的字段和方法。 标识符区分大小写,不加引号。 +标识符是代码中的一串字符,用于标识[变量](/zh-cn/book/statements#let)、[常量](/zh-cn/book/constants)、[映射](/zh-cn/book/maps)和[函数](/zh-cn/book/functions),以及[结构][s]、[消息][m]、[契约](/zh-cn/book/contracts)、[特质](/zh-cn/book/types#traits)或它们的字段和方法。 标识符区分大小写,不加引号。 在 Tact 中,标识符可以包含拉丁小写字母 (`a-z`)、拉丁大写字母 (`A-Z`)、下划线 (`_`)和数字 ($\mathrm{0 - 9}$),但不能以数字开头。 标识符与 [字符串](#string-literals)的区别在于,字符串是数据,而标识符是代码的一部分。 -请注意,当[基元类型][p]的标识符以大写字母开头时。 已使用定义的 [复合类型](/book/types#composite-types),如 [Structs][s] 和 [Messages][m] 也必须大写。 +请注意,当[基元类型][p]的标识符以大写字母开头时。 已使用定义的 [复合类型](/zh-cn/book/types#composite-types),如 [Structs][s] 和 [Messages][m] 也必须大写。 ## Instantiation @@ -201,7 +201,7 @@ fun example():Int { ## Extension function call -[扩展函数](/book/functions#extension-function)仅在特定类型中定义。 它们的调用方式类似于许多其他语言中的方法调用: +[扩展函数](/zh-cn/book/functions#extension-function)仅在特定类型中定义。 它们的调用方式类似于许多其他语言中的方法调用: ```tact 42.toString(); // toString() 是针对 Int 类型定义的 stdlib 函数。 @@ -209,7 +209,7 @@ fun example():Int { ## Static function call -在函数体的任何位置,都可以调用全局 [static function](/book/functions#global-static-functions) 或 [contract](/book/contracts) 的内部函数: +在函数体的任何位置,都可以调用全局 [static function](/zh-cn/book/functions#global-static-functions) 或 [contract](/zh-cn/book/contracts) 的内部函数: ```tact contract ExampleContract { @@ -226,7 +226,7 @@ contract ExampleContract { ## `initOf` -表达式 `initOf{:tact}` 计算 [contract](/book/contracts) 的初始状态 (`StateInit{:tact}`): +表达式 `initOf{:tact}` 计算 [contract](/zh-cn/book/contracts) 的初始状态 (`StateInit{:tact}`): ```tact // 合同的 init() 函数的参数值 @@ -247,10 +247,10 @@ initOf ExampleContract( | 现场 | 类型 | 说明 | | :-- | :------------------ | :------------------------------------------------ | -| 代码 | [`单元格{:tact}`][单元格] | [合同](/book/contracts)的初始代码(编译后的字节码 | -| 数据 | [`单元格{:tact}`][单元格] | [合同](/book/contracts)的初始数据(合同的 `init(){:tact}`函数参数 | +| 代码 | [`单元格{:tact}`][单元格] | [合同](/zh-cn/book/contracts)的初始代码(编译后的字节码 | +| 数据 | [`单元格{:tact}`][单元格] | [合同](/zh-cn/book/contracts)的初始数据(合同的 `init(){:tact}`函数参数 | -[p]: /book/types#primitive-types -[cell]: /book/cells#cells -[s]: /book/structs-and-messages#structs -[m]: /book/structs-and-messages#messages \ No newline at end of file +[p]: /zh-cn/book/types#primitive-types +[cell]: /zh-cn/book/cells#cells +[s]: /zh-cn/book/structs-and-messages#structs +[m]: /zh-cn/book/structs-and-messages#messages \ No newline at end of file diff --git a/docs/src/content/docs/zh-cn/book/func.mdx b/docs/src/content/docs/zh-cn/book/func.mdx index 2daa2ec75..6faffa6ea 100644 --- a/docs/src/content/docs/zh-cn/book/func.mdx +++ b/docs/src/content/docs/zh-cn/book/func.mdx @@ -4,19 +4,19 @@ title: 与 func 的兼容性 Tact 本身编译为 FunC,并将其所有实体直接映射到各种 FunC 和 TL-B 类型。 -## 转换类型 +## 转换类型 {#convert-types} -Tact 中的 [原始类型](/book/types#primitive-types)可直接映射到 FunC 中的类型。 +Tact 中的 [原始类型](/zh-cn/book/types#primitive-types)可直接映射到 FunC 中的类型。 -所有关于复制变量的规则都是一样的。其中一个最大的不同是,在 Tact 中没有可见的突变操作符,大多数 [`切片{:tact}`](/book/cells#slices)操作都是就地突变变量。 +所有关于复制变量的规则都是一样的。其中一个最大的不同是,在 Tact 中没有可见的突变操作符,大多数 [`切片{:tact}`](/zh-cn/book/cells#slices)操作都是就地突变变量。 -## 转换序列化 +## 转换序列化 {#convert-serialization} -在 Tact 中,[Structs](/book/structs-and-messages#structs)和[Messages](/book/structs-and-messages#messages)的序列化是自动进行的,不像 FunC 需要手动定义序列化逻辑。 +在 Tact 中,[Structs](/zh-cn/book/structs-and-messages#structs)和[Messages](/zh-cn/book/structs-and-messages#messages)的序列化是自动进行的,不像 FunC 需要手动定义序列化逻辑。 Tact 的自动布局算法是贪婪的。这意味着它会获取下一个变量,计算其大小,并尝试将其放入当前单元格。如果不合适,它就会创建一个新单元格并继续。所有用于自动布局的内部结构都会在分配前被扁平化。 -除了 [`Address{:tact}`](/book/types#primitive-types) 以外,所有可选类型在 TL-B 中都序列化为 `Maybe`。 +除了 [`Address{:tact}`](/zh-cn/book/types#primitive-types) 以外,所有可选类型在 TL-B 中都序列化为 `Maybe`。 没有对 `Either` 的支持,因为它没有定义在某些情况下序列化时应选择什么。 @@ -100,7 +100,7 @@ struct SomeValue { } ``` -## 将收到的信息转换为 `op` 操作 +## 将收到的信息转换为 `op` 操作 {#convert-received-messages-to-op-operations} Tact 会为每条接收到的键入信息生成一个唯一的 `op`,但它可以被覆盖。 @@ -177,7 +177,7 @@ get fun seqno(): Int { 在 FunC 中,张量类型 `(int, int){:func}` 和 `(int, (int)){:func}` 是有区别的,但对于 TVM 来说没有区别,它们都表示两个整数的堆栈。 -要转换从 FunC `get` 方法返回的张量,需要定义一个 [Struct](/book/structs-and-messages#structs),它与张量的字段类型相同,顺序也相同。 +要转换从 FunC `get` 方法返回的张量,需要定义一个 [Struct](/zh-cn/book/structs-and-messages#structs),它与张量的字段类型相同,顺序也相同。 下面是 FunC 中的代码 @@ -265,7 +265,7 @@ contract StatefulContract { ### 参数 制图 -获取 "方法参数的转换非常简单。每个参数都_原样_映射到 FunC one,每个元组都映射到 [结构](/book/structs-and-messages#structs)。 +获取 "方法参数的转换非常简单。每个参数都_原样_映射到 FunC one,每个元组都映射到 [结构](/zh-cn/book/structs-and-messages#structs)。 下面是 FunC 中的代码 diff --git a/docs/src/content/docs/zh-cn/book/functions.mdx b/docs/src/content/docs/zh-cn/book/functions.mdx index f75355245..8abd57b11 100644 --- a/docs/src/content/docs/zh-cn/book/functions.mdx +++ b/docs/src/content/docs/zh-cn/book/functions.mdx @@ -27,7 +27,7 @@ fun bar() { } ``` -## 全局静态函数 +## 全局静态函数 {#global-static-functions} 您可以在程序的任何地方定义全局函数: @@ -41,9 +41,9 @@ fun pow(a: Int, c: Int): Int { } ``` -## 虚拟和抽象函数 +## 虚拟和抽象函数 {#virtual-and-abstract-functions} -如果 [traits](/book/types#traits) 有 `virtual{:tact}` 关键字,则可以使用 `override{:tact}` 允许继承 [traits](/book/types#traits) 的合约修改内部函数。 函数也可以标记为 `抽象{:tact}`,在这种情况下,继承合约必须定义其实现: +如果 [traits](/zh-cn/book/types#traits) 有 `virtual{:tact}` 关键字,则可以使用 `override{:tact}` 允许继承 [traits](/zh-cn/book/types#traits) 的合约修改内部函数。 函数也可以标记为 `抽象{:tact}`,在这种情况下,继承合约必须定义其实现: ```tact trait FilterTrait with Ownable { @@ -67,7 +67,7 @@ contract Filter with FilterTrait { } ``` -## 扩展功能 +## 扩展功能 {#extension-function} 扩展函数允许你为任何可能的类型实现扩展。 @@ -84,7 +84,7 @@ extends fun customPow(self: Int, c: Int): Int { } ``` -## 可变函数 +## 可变函数 {#mutation-functions} 可变函数是对数值进行变异,用执行结果代替数值。 要执行突变,函数必须改变 `self` 值。 @@ -98,7 +98,7 @@ extends mutates fun customPow(self: Int, c: Int) { } ``` -## 本地功能 +## 本地功能 {#native-functions} 本地函数是 FunC 函数的直接绑定: @@ -113,7 +113,7 @@ native storeUint(s: Builder, value: Int, bits: Int): Builder; extends mutates native loadInt(self: Slice, l: Int): Int; ``` -## Receiver functions +## Receiver functions {#receiver-functions} 接收器函数是负责在合约中接收信息的特殊函数,只能在合约或特质中定义。 @@ -126,7 +126,7 @@ contract Treasure { } ``` -## 获取器函数 +## 获取器函数 {#getter-functions} 获取器函数定义智能合约上的获取器,只能在合约或特征中定义。 @@ -169,4 +169,4 @@ contract ManualMethodId { 用户指定的方法 ID 是 19 位有符号整数,因此可以使用从 $-2^{18}$ 到 $-5$ 以及从 $2^{14}$ 到 $2^{18}$ 的整数。- 1$. -此外,还有一些方法 ID 是为 Tact 编译器在编译过程中插入的获取器保留的,它们是 113617、115390 和 121275。 \ No newline at end of file +此外,还有一些方法 ID 是为 Tact 编译器在编译过程中插入的获取器保留的,它们是 113617、115390 和 121275。 diff --git a/docs/src/content/docs/zh-cn/book/import.mdx b/docs/src/content/docs/zh-cn/book/import.mdx index 73814226c..3840e458b 100644 --- a/docs/src/content/docs/zh-cn/book/import.mdx +++ b/docs/src/content/docs/zh-cn/book/import.mdx @@ -4,7 +4,7 @@ title: 导入代码 Tact 允许您导入 Tact 和 [FunC](https://docs.ton.org/develop/func/overview) 代码--任何给定的 `.tact` 或 `.fc`/`.func` 文件都可以使用 `import{:tact}` 关键字导入到您的项目中。 -此外,Tact 编译器还拥有一套通用的标准库,这些标准库捆绑在 Tact 编译器中,但并不立即包含在 Tact 编译器中,请参阅 [标准库概述](/ref/standard-libraries)。 +此外,Tact 编译器还拥有一套通用的标准库,这些标准库捆绑在 Tact 编译器中,但并不立即包含在 Tact 编译器中,请参阅 [标准库概述](/zh-cn/ref/standard-libraries)。 :::caution @@ -38,7 +38,7 @@ import "./relative/path/to/the/target/func/file.fc"; import "../subfolder/imported/func/file.fc"; ``` -但要使用此类文件中的函数,必须先将它们声明为 "本地 "函数。 For example, when standard library [@stdlib/dns](/ref/stdlib-dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so: +但要使用此类文件中的函数,必须先将它们声明为 "本地 "函数。 For example, when standard library [@stdlib/dns](/zh-cn/ref/stdlib-dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so: ```tact // FunC 代码位于当前 Tact 代码旁边的文件中: @@ -51,4 +51,4 @@ native dnsStringToInternal(str: String):Slice? ## 标准图书馆 -See [Standard libraries overview](/ref/standard-libraries). +See [Standard libraries overview](/zh-cn/ref/standard-libraries). diff --git a/docs/src/content/docs/zh-cn/book/index.mdx b/docs/src/content/docs/zh-cn/book/index.mdx index 306b5aeb2..16d338945 100644 --- a/docs/src/content/docs/zh-cn/book/index.mdx +++ b/docs/src/content/docs/zh-cn/book/index.mdx @@ -12,7 +12,7 @@ Here are it's main contents: 1. #### Guides - [Cheatsheets](/book/cs/from-func) 是关于 Tact 语法和习语的快速介绍,并与其他区块链语言(如 FunC(也在 TON 上)和 Solidity(以太坊区块链))进行了比较。 利用这些优势尽快过渡到战术。 + [Cheatsheets](/zh-cn/book/cs/from-func) 是关于 Tact 语法和习语的快速介绍,并与其他区块链语言(如 FunC(也在 TON 上)和 Solidity(以太坊区块链))进行了比较。 利用这些优势尽快过渡到战术。 {:tact}` 用于将 `K{:tact}` 类型的键与 `V{:tact}` 类型的相应值关联起来。 +[复合类型](/zh-cn/book/types#composite-types) `map{:tact}` 用于将 `K{:tact}` 类型的键与 `V{:tact}` 类型的相应值关联起来。 例如,`map{:tact}` 的键和值使用 [`英特{:tact}`][英特] 类型: @@ -14,7 +14,7 @@ struct IntToInt { } ``` -## 允许的类型 +## 允许的类型 {#allowed-types} 允许的密钥类型 @@ -24,24 +24,24 @@ struct IntToInt { 允许的值类型: - [`Int{:tact}`][int]。 -- [`Bool{:tact}`](/book/types#booleans) +- [`Bool{:tact}`](/zh-cn/book/types#booleans) - [`单元格{:tact}`][单元格] - [`地址{:tact}`][p] -- [结构](/book/structs-and-messages#structs) -- [消息](/book/structs-and-messages#messages) +- [结构](/zh-cn/book/structs-and-messages#structs) +- [消息](/zh-cn/book/structs-and-messages#messages) ## 业务 ### 声明,`emptyMap()` {#emptymap} -作为[局部变量](/book/statements#let),使用标准库的 `emptyMap(){:tact}` 函数: +作为[局部变量](/zh-cn/book/statements#let),使用标准库的 `emptyMap(){:tact}` 函数: ```tact let fizz: map = emptyMap(); let fizz: map = null; // 与前一行相同,但描述性较弱 ``` -作为 [持久状态变量](/book/contracts#variables): +作为 [持久状态变量](/zh-cn/book/contracts#variables): ```tact contract Example { @@ -52,11 +52,11 @@ contract Example { } ``` -请注意,类型为 `map{:tact}` 的 [持久状态变量](/book/contracts#variables) 默认为空,不需要默认值,也不需要在 [`init(){:tact}` 函数](/book/contracts#init-function)中进行初始化。 +请注意,类型为 `map{:tact}` 的 [持久状态变量](/zh-cn/book/contracts#variables) 默认为空,不需要默认值,也不需要在 [`init(){:tact}` 函数](/zh-cn/book/contracts#init-function)中进行初始化。 ### 设置值,`.set()` {#set} -要设置或替换键下的值,请调用 `.set(){:tact}` [方法](/book/functions#extension-function),所有地图都可以使用该方法。 +要设置或替换键下的值,请调用 `.set(){:tact}` [方法](/zh-cn/book/functions#extension-function),所有地图都可以使用该方法。 ```tact // 空 map @@ -72,7 +72,7 @@ fizz.set(7, 68); // 键 7 现在指向值 68 ### 获取值,`.get()` {#get} -通过调用 `.get(){:tact}` [方法](/book/functions#extension-function),检查是否在地图中找到了键,所有地图都可以访问该方法。 如果键丢失,则返回 `null{:tact}`;如果键找到,则返回值。 +通过调用 `.get(){:tact}` [方法](/zh-cn/book/functions#extension-function),检查是否在地图中找到了键,所有地图都可以访问该方法。 如果键丢失,则返回 `null{:tact}`;如果键找到,则返回值。 ```tact // Empty map @@ -97,7 +97,7 @@ if (gotButUnsure != null) { ### 删除条目,`.del()` {#del} -要删除单个键值对(单个条目),请使用 `.del(){:tact}` [方法](/book/functions#extension-function)。 如果删除成功,则返回 `true{:tact}`,否则返回 `false{:tact}`。 +要删除单个键值对(单个条目),请使用 `.del(){:tact}` [方法](/zh-cn/book/functions#extension-function)。 如果删除成功,则返回 `true{:tact}`,否则返回 `false{:tact}`。 ```tact // 空 map @@ -138,7 +138,7 @@ fizz = null; // 与上一行相同,但描述性较弱

-映射上的 `.exists(){:tact}` [方法](/book/functions#extension-function),如果给定键下的值在映射中存在,则返回 `true{:tact}`,否则返回 `false{:tact}`。 +映射上的 `.exists(){:tact}` [方法](/zh-cn/book/functions#extension-function),如果给定键下的值在映射中存在,则返回 `true{:tact}`,否则返回 `false{:tact}`。 ```tact let fizz: map = emptyMap(); @@ -165,7 +165,7 @@ if (fizz.get(1 / 2) != null) { // also true, but consumes more gas ### 检查是否为空,`.isEmpty()` {#isempty} -地图上的 `.isEmpty(){:tact}` [方法](/book/functions#extension-function) 如果地图为空,则返回 `true{:tact}`,否则返回 `false{:tact}`: +地图上的 `.isEmpty(){:tact}` [方法](/zh-cn/book/functions#extension-function) 如果地图为空,则返回 `true{:tact}`,否则返回 `false{:tact}`: ```tact let fizz: map = emptyMap(); @@ -183,7 +183,7 @@ if (fizz == null) { ### 转换为 `Cell`, `.asCell()` {#ascell} -在地图上使用 `.asCell(){:tact}` [方法](/book/functions#extension-function),将其所有值转换为 [`单元格{:tact}`][单元格] 类型。 请注意,[`Cell{:tact}`][单元格] 类型最多只能存储 1023 位,因此将更大的映射转换为单元格会导致错误。 +在地图上使用 `.asCell(){:tact}` [方法](/zh-cn/book/functions#extension-function),将其所有值转换为 [`单元格{:tact}`][单元格] 类型。 请注意,[`Cell{:tact}`][单元格] 类型最多只能存储 1023 位,因此将更大的映射转换为单元格会导致错误。 例如,这种方法适用于在回复正文中直接发送小地图: @@ -212,7 +212,7 @@ contract Example { ### 遍历条目 {#traverse} -要遍历地图条目,有一个 [`foreach{:tact}`](/book/statements#foreach-loop)循环语句: +要遍历地图条目,有一个 [`foreach{:tact}`](/zh-cn/book/statements#foreach-loop)循环语句: ```tact // Empty map @@ -228,7 +228,7 @@ foreach (key, value in fizz) { } ``` -了解更多相关信息:[`foreach{:tact}` loop in Book→Statements](/book/statements#foreach-loop). +了解更多相关信息:[`foreach{:tact}` loop in Book→Statements](/zh-cn/book/statements#foreach-loop). 请注意,也可以将映射作为简单数组使用,只要定义一个 `map{:tact}`,键为 [`Int{:tact}`][int] 类型,值为任何允许的 `V{:tact}` 类型,并跟踪单独变量中的项数即可: @@ -285,7 +285,7 @@ contract Iteration { :::caution - 请注意,手动记录项目数或检查此类地图的长度非常容易出错,一般不建议使用。 相反,请尝试将您的地图封装到 [Struct](/book/structs-and-messages#structs) 中,并在其上定义 [extension functions](/book/functions#extension-function) 。 参见 Cookbook 中的示例:[如何使用包裹在 Struct 中的 map 来模拟数组](/cookbook/data-structures#array)。 + 请注意,手动记录项目数或检查此类地图的长度非常容易出错,一般不建议使用。 相反,请尝试将您的地图封装到 [Struct](/zh-cn/book/structs-and-messages#structs) 中,并在其上定义 [extension functions](/zh-cn/book/functions#extension-function) 。 参见 Cookbook 中的示例:[如何使用包裹在 Struct 中的 map 来模拟数组](/zh-cn/cookbook/data-structures#array)。 ::: @@ -294,14 +294,14 @@ contract Iteration { 本例改编自 [howardpen9/while-example-tact](https://github.com/howardpen9/while-example-tact/blob/de5807fcd20dba5f6a3748d112511477fb22bfcc/contracts/awesome.tact#L19C10-L19C10). 查看 Cookbook 中有关 map 使用的其他示例:\ - [如何使用包裹在 Struct 中的 map 来模拟堆栈](/cookbook/data-structures#stack)\ - [如何使用包裹在 Struct 中的 map 来模拟循环缓冲区](/cookbook/data-structures#circular-buffer) + [如何使用包裹在 Struct 中的 map 来模拟堆栈](/zh-cn/cookbook/data-structures#stack)\ + [如何使用包裹在 Struct 中的 map 来模拟循环缓冲区](/zh-cn/cookbook/data-structures#circular-buffer) ::: ## 序列化 -可以对映射键、值或两者进行[整数序列化](/zh-cn/book/integers#serialization-types),以[保留空间并降低存储成本](/book/integers#serialization): +可以对映射键、值或两者进行[整数序列化](/zh-cn/book/integers#serialization-types),以[保留空间并降低存储成本](/zh-cn/book/integers#serialization): ```tact struct SerializedMapInside { @@ -313,7 +313,7 @@ struct SerializedMapInside { :::note - 了解其他序列化选项:[与 FunC 兼容](/book/func#convert-serialization)。 + 了解其他序列化选项:[与 FunC 兼容](/zh-cn/book/func#convert-serialization)。 ::: @@ -357,6 +357,6 @@ contract Example { TODO:添加对分片页面的引用,如: https://github.com/tact-lang/tact-docs/issues/155 */} -[p]: /book/types#primitive-types -[int]: /book/integers -[电池]: /book/cells#cells +[p]: /zh-cn/book/types#primitive-types +[int]: /zh-cn/book/integers +[电池]: /zh-cn/book/cells#cells diff --git a/docs/src/content/docs/zh-cn/book/masterchain.mdx b/docs/src/content/docs/zh-cn/book/masterchain.mdx index fc24dda14..b168765bb 100644 --- a/docs/src/content/docs/zh-cn/book/masterchain.mdx +++ b/docs/src/content/docs/zh-cn/book/masterchain.mdx @@ -4,19 +4,19 @@ title: 主链 :::caution - 除非将[配置文件](/book/config)中的 "masterchain "选项设置为 `true{:json}`,否则主链地址将被视为无效。 + 除非将[配置文件](/zh-cn/book/config)中的 "masterchain "选项设置为 `true{:json}`,否则主链地址将被视为无效。 ::: 在 TON 区块链中,一条名为["主链"](https://docs.ton.org/learn/overviews/ton-blockchain#masterchain-blockchain-of-blockchains) 的特殊链用于同步消息路由和交易执行,因此网络中的节点可以固定多链状态中的某个特定点,并就该状态达成共识。 -主链存储 [网络配置](/ref/core-advanced#getconfigparam) 和所有 [工作链] 的最终状态(https://docs.ton.org/learn/overviews/ton-blockchain#workchain-blockchain-with-your-own-rules)。 它承载着基本的协议信息,包括当前设置、活动验证器及其赌注列表、活动工作链以及相关的[分块链](https://docs.ton.org/develop/blockchain/shards)。 最重要的是,它为所有工作链和分块链维护最新的区块哈希值记录,从而在整个网络中达成共识。 +主链存储 [网络配置](/zh-cn/ref/core-advanced#getconfigparam) 和所有 [工作链] 的最终状态(https://docs.ton.org/learn/overviews/ton-blockchain#workchain-blockchain-with-your-own-rules)。 它承载着基本的协议信息,包括当前设置、活动验证器及其赌注列表、活动工作链以及相关的[分块链](https://docs.ton.org/develop/blockchain/shards)。 最重要的是,它为所有工作链和分块链维护最新的区块哈希值记录,从而在整个网络中达成共识。 ## 主链如何保护合约 Tact 强制所有合约使用 [basechain](https://docs.ton.org/develop/blockchain/shards),即 ID 为 $0$ 的默认工作链。这样做是为了防止在合约中使用主链地址。 -在未[启用主链支持](#support)的情况下,任何指向主链或以其他方式与之交互的尝试都会产生异常,并显示[退出代码 137](/book/exit-codes#137): 此合约未启用 “主链支持”。 +在未[启用主链支持](#support)的情况下,任何指向主链或以其他方式与之交互的尝试都会产生异常,并显示[退出代码 137](/zh-cn/book/exit-codes#137): 此合约未启用 “主链支持”。 也就是说,意外部署到主链、从主链账户接收消息、向此类账户发送消息以及使用主链地址或其链 ID ($-1$) 都是默认禁止的。 @@ -28,7 +28,7 @@ Tact 强制所有合约使用 [basechain](https://docs.ton.org/develop/blockchai ::: -如果您确实需要主链支持,最简单也是最推荐的方法是修改项目根目录下的 [`tact.config.json`](/book/config) 文件(如果还不存在,则创建该文件),并 [将 `masterchain` 属性设置为 `true{:json}`](/book/config#options-masterchain)。 +如果您确实需要主链支持,最简单也是最推荐的方法是修改项目根目录下的 [`tact.config.json`](/zh-cn/book/config) 文件(如果还不存在,则创建该文件),并 [将 `masterchain` 属性设置为 `true{:json}`](/zh-cn/book/config#options-masterchain)。 如果您正在开发基于 [Blueprint][bp] 的项目,可以在合约的编译配置中启用主链支持,这些配置位于名为 `wrappers/` 的目录中: @@ -44,6 +44,6 @@ export const compile:CompilerConfig = { }; ``` -不过,[蓝图][bp] 项目中仍可使用 [`tact.config.json`](/book/config)。 在这种情况下,除非在 `wrappers/` 中修改,否则 [`tact.config.json`](/book/config)中指定的值将作为默认值。 +不过,[蓝图][bp] 项目中仍可使用 [`tact.config.json`](/zh-cn/book/config)。 在这种情况下,除非在 `wrappers/` 中修改,否则 [`tact.config.json`](/zh-cn/book/config)中指定的值将作为默认值。 [bp]: https://github.com/ton-org/blueprint diff --git a/docs/src/content/docs/zh-cn/book/message-mode.mdx b/docs/src/content/docs/zh-cn/book/message-mode.mdx index fc466018f..e028c903c 100644 --- a/docs/src/content/docs/zh-cn/book/message-mode.mdx +++ b/docs/src/content/docs/zh-cn/book/message-mode.mdx @@ -23,9 +23,9 @@ title: Message `mode` | $+16$ | SendBounceIfActionFail | 如果在操作阶段出现任何错误,则退回交易。 Has no effect if flag $+2$, SendIgnoreErrors is used. | | $+32$ | SendDestroyIfZero | Current account must be destroyed if its resulting balance is zero (often used with mode $128$, SendRemainingBalance). | -## 将模式与标志相结合 +## 将模式与标志相结合 {#combining-modes-with-flags} -要为 `SendParameters{:tact}` 的 `mode` 字段创建 [`Int{:tact}`][int] 值,只需通过 [bitwise OR](/book/operators#binary-bitwise-or) 运算将基本模式与可选标记结合起来。 +要为 `SendParameters{:tact}` 的 `mode` 字段创建 [`Int{:tact}`][int] 值,只需通过 [bitwise OR](/zh-cn/book/operators#binary-bitwise-or) 运算将基本模式与可选标记结合起来。 例如,如果您想分别发送普通信息和支付转账费用,请使用模式 $0$(默认)和标志 $+1$,以获得 `mode` $= 1$,这等同于使用 `SendPayGasSeparately{:tact}` 常量。 @@ -46,7 +46,7 @@ send(SendParameters{ :::caution - 请注意,虽然可以将([`+{:tact}`](/book/operators#binary-add))基本模式与可选标志一起添加,但由于可能会出现多余的值,因此不鼓励这样做。 请使用位wise OR ([`|{:tact}`](/book/operators#binary-bitwise-or)),因为它是为处理此类标志和对 `mode` 的位操作而设计的。 + 请注意,虽然可以将([`+{:tact}`](/zh-cn/book/operators#binary-add))基本模式与可选标志一起添加,但由于可能会出现多余的值,因此不鼓励这样做。 请使用位wise OR ([`|{:tact}`](/zh-cn/book/operators#binary-bitwise-or)),因为它是为处理此类标志和对 `mode` 的位操作而设计的。 ::: @@ -56,4 +56,4 @@ send(SendParameters{ ::: -[int]: /book/integers +[int]: /zh-cn/book/integers diff --git a/docs/src/content/docs/zh-cn/book/operators.mdx b/docs/src/content/docs/zh-cn/book/operators.mdx index 30d41cbfa..3f8b78715 100644 --- a/docs/src/content/docs/zh-cn/book/operators.mdx +++ b/docs/src/content/docs/zh-cn/book/operators.mdx @@ -8,7 +8,7 @@ title: 操作员 :::note - 需要注意的是,Tact 中没有隐式类型转换,因此运算符不能用来添加不同类型的值,或者在不明确转换为相同类型的情况下比较它们的相等性。 这是通过标准库中的某些函数实现的。 请参阅 [`Int.toString(){:tact}`](/ref/core-strings#inttostring),了解此类函数的示例。 + 需要注意的是,Tact 中没有隐式类型转换,因此运算符不能用来添加不同类型的值,或者在不明确转换为相同类型的情况下比较它们的相等性。 这是通过标准库中的某些函数实现的。 请参阅 [`Int.toString(){:tact}`](/zh-cn/ref/core-strings#inttostring),了解此类函数的示例。 ::: @@ -95,11 +95,11 @@ title: 操作员 ### 非空断言,`!!` {#unary-non-null-assert} -一元双叹号(_非空断言_)运算符 `!{:tact}`是一个后缀运算符,它强制执行非`null{:tact}`值,如果可选变量不是`null{:tact}`,则允许直接访问可选变量的值。 否则,如果编译器可以跟踪,则引发编译错误;如果不能跟踪,则抛出[退出代码 128](/book/exit-codes#128)异常:空引用异常"。 可应用于任何可选变量,无论其类型是`非空{:tact}`。 +一元双叹号(_非空断言_)运算符 `!{:tact}`是一个后缀运算符,它强制执行非`null{:tact}`值,如果可选变量不是`null{:tact}`,则允许直接访问可选变量的值。 否则,如果编译器可以跟踪,则引发编译错误;如果不能跟踪,则抛出[退出代码 128](/zh-cn/book/exit-codes#128)异常:空引用异常"。 可应用于任何可选变量,无论其类型是`非空{:tact}`。 :::note - 点击此处了解更多有关可选变量和字段的信息:[可选变量](/book/optionals) + 点击此处了解更多有关可选变量和字段的信息:[可选变量](/zh-cn/book/optionals) ::: @@ -152,7 +152,7 @@ let answer:Int = 42; #### 乘法,`*` {#binary-multiply} -二进制星号 (_multiplication_) 运算符 `*{:tact}` 用于两个值的乘法运算。 可能导致 [整数溢出](/book/integers#operations)。 +二进制星号 (_multiplication_) 运算符 `*{:tact}` 用于两个值的乘法运算。 可能导致 [整数溢出](/zh-cn/book/integers#operations)。 只能应用于 [`Int{:tact}`][int]类型的值: @@ -169,7 +169,7 @@ pow(2, 255) * pow(2, 255); // build error: integer overflow! 二进制斜线 (_division_) 运算符 `/{:tact}` 用于两个值的整除,如果结果为正,则向零截断,如果结果为负,则从零截断。这也叫[向下舍入](https://en.wikipedia.org/wiki/Rounding#Rounding_down)(或向 $-\infty$ 舍入)。 -如果尝试除以零,则会出现[退出代码 4](/book/exit-codes#4)错误:整数溢出。 +如果尝试除以零,则会出现[退出代码 4](/zh-cn/book/exit-codes#4)错误:整数溢出。 只能应用于 [`Int{:tact}`][int] 类型的值: @@ -214,7 +214,7 @@ two % 1; // 1 -1 % -5; // -1 ``` -避免两者混淆的最简单方法是通过 [`abs(x: Int){:tact}`](/ref/core-math#abs)优先使用正值: +避免两者混淆的最简单方法是通过 [`abs(x: Int){:tact}`](/zh-cn/ref/core-math#abs)优先使用正值: ```tact abs(-1) % abs(-5); // 1 @@ -234,7 +234,7 @@ abs(-1) % abs(-5); // 1 #### 添加,`+` {#binary-add} -二进制加法运算符 `+{:tact}` 用于将数字相加。 超出 [`Int{:tact}`][int]的最大值将导致[退出代码 4](/book/exit-codes#4)错误:整数溢出"。 +二进制加法运算符 `+{:tact}` 用于将数字相加。 超出 [`Int{:tact}`][int]的最大值将导致[退出代码 4](/zh-cn/book/exit-codes#4)错误:整数溢出"。 只能应用于 [`Int{:tact}`][int]类型的值: @@ -250,7 +250,7 @@ pow(2, 255) - 1 + pow(2, 255); // 2^256 - 1,Tact 中任何整数的最大值 #### 减去,`-` {#binary-subtract} -二进制减号(_subtraction_)运算符 `-{:tact}` 用于将数字相减。 超出 [`Int{:tact}`][int]的最小值将导致[退出代码 4](/book/exit-codes#4)错误:整数溢出。 +二进制减号(_subtraction_)运算符 `-{:tact}` 用于将数字相减。 超出 [`Int{:tact}`][int]的最小值将导致[退出代码 4](/zh-cn/book/exit-codes#4)错误:整数溢出。 只能应用于 [`Int{:tact}`][int]类型的值: @@ -292,7 +292,7 @@ pow(2, 254) >> 254; // 1 #### 左移,`<<` {#binary-bitwise-shift-left} -二进制双小于号(_bitwise shift left_)运算符 `<<{:tact}` 返回一个整数,其二进制表示为*左操作数*的值向左移动*右操作数*的位数。向左移位的多余比特被丢弃,零比特从右边移入。这是一种更有效的方法,可以将*左操作数*乘以 $2^n$,其中 $n$ 等于*右操作数*。超出 [`Int{:tact}`][int] 的最大值将导致[退出代码 4](/book/exit-codes#4)错误:整数溢出。 +二进制双小于号(_bitwise shift left_)运算符 `<<{:tact}` 返回一个整数,其二进制表示为*左操作数*的值向左移动*右操作数*的位数。向左移位的多余比特被丢弃,零比特从右边移入。这是一种更有效的方法,可以将*左操作数*乘以 $2^n$,其中 $n$ 等于*右操作数*。超出 [`Int{:tact}`][int] 的最大值将导致[退出代码 4](/zh-cn/book/exit-codes#4)错误:整数溢出。 只能应用于 [`Int{:tact}`][int] 类型的值: @@ -374,8 +374,8 @@ two <= 2; // true - [`单元格{:tact}`][单元格],通过`.hash(){:tact}`隐式比较 - [`片{:tact}`][片],通过`.hash(){:tact}`隐式比较 - [`字符串{:tact}`][p] -- [`map{:tact}`](/book/maps),但前提是它们的键和值类型相同 -- [选项和 `null{:tact}` 值](/book/optionals) +- [`map{:tact}`](/zh-cn/book/maps),但前提是它们的键和值类型相同 +- [选项和 `null{:tact}` 值](/zh-cn/book/optionals) ```tact // Int: @@ -474,7 +474,7 @@ two ^ 3; // 1 二进制条形 (_bitwise OR_) 运算符 `|{:tact}` 应用 [bitwise OR](https://en.wikipedia.org/wiki/Bitwise_operation#OR),对操作数的每一对相应位执行 [logical OR](#binary-logical-or) 运算。 当我们要应用特定的 [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) 时,这很有用。 -例如,_bitwise OR_ 通常用于 Tact 中的[将基本模式与可选标记结合](/book/message-mode#combining-modes-with-flags),方法是将特定位屏蔽到 $1$ ,以构建目标[信息`模式`](/book/message-mode)。 +例如,_bitwise OR_ 通常用于 Tact 中的[将基本模式与可选标记结合](/zh-cn/book/message-mode#combining-modes-with-flags),方法是将特定位屏蔽到 $1$ ,以构建目标[信息`模式`](/zh-cn/book/message-mode)。 只能应用于 [`Int{:tact}`][int]类型的值: @@ -524,7 +524,7 @@ true || iLikeSnails; // true, didn't evaluate iLikeSnails ## 三元,`?:` {#ternary} -条件(_ternary_)运算符是唯一一个包含三个操作数的 Tact 运算符:一个条件,后面跟一个问号(`?{:tact}`),然后是如果条件被评估为`true{:tact}`时要执行的表达式,后面跟一个冒号(`:{:tact}`),最后是如果条件被评估为`false{:tact}`时要执行的表达式。 该运算符常用于替代 [`if...else{:tact}`](/book/statements#if-else) 语句。 +条件(_ternary_)运算符是唯一一个包含三个操作数的 Tact 运算符:一个条件,后面跟一个问号(`?{:tact}`),然后是如果条件被评估为`true{:tact}`时要执行的表达式,后面跟一个冒号(`:{:tact}`),最后是如果条件被评估为`false{:tact}`时要执行的表达式。 该运算符常用于替代 [`if...else{:tact}`](/zh-cn/book/statements#if-else) 语句。 条件必须解析为 [`布尔{:tact}`][布尔] 类型: @@ -557,7 +557,7 @@ true ?(false ? 1 : 2) : 3; // 2 ## 赋值,`=` {#assignment} -赋值操作符 `={:tact}` 用于为变量或 [Message](/book/structs-and-messages#messages) 或 [Struct](/book/structs-and-messages#structs) 的属性赋值。 赋值是一个语句,不返回值。 +赋值操作符 `={:tact}` 用于为变量或 [Message](/zh-cn/book/structs-and-messages#messages) 或 [Struct](/zh-cn/book/structs-and-messages#structs) 的属性赋值。 赋值是一个语句,不返回值。 ```tact let someVar:Int = 5; // 这里使用了赋值运算符 =... @@ -635,8 +635,8 @@ value = value | 5; // 位似 OR 5 并返回结果 value |= 5; // 也是位似 OR 5 并返回结果 ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[电池]: /book/cells#cells -[一片]: /book/cells#slices +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[电池]: /zh-cn/book/cells#cells +[一片]: /zh-cn/book/cells#slices diff --git a/docs/src/content/docs/zh-cn/book/optionals.mdx b/docs/src/content/docs/zh-cn/book/optionals.mdx index 48e13b234..1b52aa082 100644 --- a/docs/src/content/docs/zh-cn/book/optionals.mdx +++ b/docs/src/content/docs/zh-cn/book/optionals.mdx @@ -2,15 +2,15 @@ title: 可选项 --- -[类型系统概述](/book/types#optionals)中提到,所有[原始类型](/book/types#primitive-types)、[结构体](/book/structs-and-messages#structs)和[消息](/book/structs-and-messages#messages)都可以为空。也就是说,除了 `null{:tact}`(一种特殊值,表示故意没有任何其他值)之外,它们不一定持有任何值。 +[类型系统概述](/zh-cn/book/types#optionals)中提到,所有[原始类型](/zh-cn/book/types#primitive-types)、[结构体](/zh-cn/book/structs-and-messages#structs)和[消息](/zh-cn/book/structs-and-messages#messages)都可以为空。也就是说,除了 `null{:tact}`(一种特殊值,表示故意没有任何其他值)之外,它们不一定持有任何值。 -[变量](/book/statements#let)或[结构](/book/structs-and-messages#structs)和[消息](/book/structs-and-messages#messages)中可容纳 `null{:tact}` 的字段被称为"可选项"。当变量不一定被使用时,它们对减少状态大小很有用。 +[变量](/zh-cn/book/statements#let)或[结构](/zh-cn/book/structs-and-messages#structs)和[消息](/zh-cn/book/structs-and-messages#messages)中可容纳 `null{:tact}` 的字段被称为"可选项"。当变量不一定被使用时,它们对减少状态大小很有用。 -在变量或字段的类型声明后添加问号 (`?{:tact}`),就可以将其设为可选变量或字段。唯一的例外是 [`map{:tact}`](/book/maps)和 [`bounced{:tact}`](/book/bounced),你不能让它们、内部键/值类型(如果是 map)或内部[消息](/book/structs-and-messages#messages)(如果是 bounced)成为可选项。 +在变量或字段的类型声明后添加问号 (`?{:tact}`),就可以将其设为可选变量或字段。唯一的例外是 [`map{:tact}`](/zh-cn/book/maps)和 [`bounced{:tact}`](/zh-cn/book/bounced),你不能让它们、内部键/值类型(如果是 map)或内部[消息](/zh-cn/book/structs-and-messages#messages)(如果是 bounced)成为可选项。 -未定义的可选变量或可选字段默认为 `null{:tact}` 值。如果不先检查 `null{:tact}`,就无法访问它们。但如果你确定它们在某一时刻不是 `null{:tact}`,可以使用[非空断言操作符 `!!{:tact}`](/book/operators#unary-non-null-assert)访问它们的值。 +未定义的可选变量或可选字段默认为 `null{:tact}` 值。如果不先检查 `null{:tact}`,就无法访问它们。但如果你确定它们在某一时刻不是 `null{:tact}`,可以使用[非空断言操作符 `!!{:tact}`](/zh-cn/book/operators#unary-non-null-assert)访问它们的值。 -在未使用 [`!!{:tact}`](/book/operators#unary-non-null-assert)或未事先检查 `null{:tact}` 的情况下尝试访问可选变量或可选字段的值,如果编译器可以跟踪,则会导致编译错误;如果不能跟踪,则会导致[退出代码 128](/book/exit-codes#128)异常:空引用异常。 +在未使用 [`!!{:tact}`](/zh-cn/book/operators#unary-non-null-assert)或未事先检查 `null{:tact}` 的情况下尝试访问可选变量或可选字段的值,如果编译器可以跟踪,则会导致编译错误;如果不能跟踪,则会导致[退出代码 128](/zh-cn/book/exit-codes#128)异常:空引用异常。 可选项举例: diff --git a/docs/src/content/docs/zh-cn/book/send.mdx b/docs/src/content/docs/zh-cn/book/send.mdx index 922270973..de6996634 100644 --- a/docs/src/content/docs/zh-cn/book/send.mdx +++ b/docs/src/content/docs/zh-cn/book/send.mdx @@ -4,19 +4,19 @@ title: 发送信息 TON 区块链是基于消息的--要与其他合约通信和部署新合约,您需要发送消息。 -Tact 中的消息通常使用内置[Struct](/book/structs-and-messages#structs) `SendParameters{:tact}`组成,它由以下部分组成: +Tact 中的消息通常使用内置[Struct](/zh-cn/book/structs-and-messages#structs) `SendParameters{:tact}`组成,它由以下部分组成: | 现场 | 类型 | 说明 | | :---- | :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 弹跳 | [`Bool{:tact}`][p] | `bounce` - if set to `true` (default) then the message will be bounced back to the sender if the receiver contract doesn't exist or wasn't able to process the message. | | 到 | [`地址{:tact}`][p] | TON 区块链中的内部接收器 [`地址{:tact}`][p]。 | | 值 | [`Int{:tact}`][int]。 | `value` in TON - the amount of TON you want to send with the message. This value is used to cover gas fees on the receiver side. | -| 模式 | [`Int{:tact}`][int]。 | 一个 8 位值,用于配置发送信息的方式,默认值为 $0$。 参见:[消息`模式`](/book/message-mode)。 | +| 模式 | [`Int{:tact}`][int]。 | 一个 8 位值,用于配置发送信息的方式,默认值为 $0$。 参见:[消息`模式`](/zh-cn/book/message-mode)。 | | 身体 | [`Cell?{:tact}`][单元格] | [可选][选项]信息正文作为[`单元格{:tact}`][单元格] | | 代码 | [`Cell?{:tact}`][单元格] | [可选][opt] 合同的初始代码(编译后的字节码) | -| 数据 | [`Cell?{:tact}`][单元格] | [可选][选项]合同的初始数据(合同的[`init(){:tact}`函数](/book/contracts#init-function)的参数) | +| 数据 | [`Cell?{:tact}`][单元格] | [可选][选项]合同的初始数据(合同的[`init(){:tact}`函数](/zh-cn/book/contracts#init-function)的参数) | -字段 `code` 和 `data` 被称为 [初始包](/book/expressions#initof),用于部署新合约。 +字段 `code` 和 `data` 被称为 [初始包](/zh-cn/book/expressions#initof),用于部署新合约。 ## 发送简单回复 {#send-simple-reply} @@ -28,9 +28,9 @@ receive() { } ``` -## 发送信息 +## 发送信息 {#send-message} -如果需要更高级的逻辑,可以直接使用 `send(){:tact}` 函数和 `SendParameters{:tact}` [Struct](/book/structs-and-messages#structs) 。 +如果需要更高级的逻辑,可以直接使用 `send(){:tact}` 函数和 `SendParameters{:tact}` [Struct](/zh-cn/book/structs-and-messages#structs) 。 事实上,前面使用 [`.reply(){:tact}`](#send-simple-reply)的示例可以通过调用下面的`send(){:tact}`函数来实现: @@ -60,7 +60,7 @@ send(SendParameters{ }); ``` -[可选标记](/book/message-mode#optional-flags) `SendIgnoreErrors{:tact}`表示即使在发送信息过程中发生错误,也会继续发送下一条信息。**发送阶段的任何错误都不会导致事务逆转**。 +[可选标记](/zh-cn/book/message-mode#optional-flags) `SendIgnoreErrors{:tact}`表示即使在发送信息过程中发生错误,也会继续发送下一条信息。**发送阶段的任何错误都不会导致事务逆转**。 ## 发送打字信息 @@ -80,7 +80,7 @@ send(SendParameters{ ## 部署合约 -要部署一个合约,你需要用 [`initOf{:tact}`](/book/expressions#initof)计算它的地址和初始状态,然后在初始化信息中发送它们: +要部署一个合约,你需要用 [`initOf{:tact}`](/zh-cn/book/expressions#initof)计算它的地址和初始状态,然后在初始化信息中发送它们: ```tact let init: StateInit = initOf SecondContract(arg1, arg2); @@ -97,7 +97,7 @@ send(SendParameters{ }); ``` -## 外发信息处理 +## 外发信息处理 {#outbound-message-processing} TON 区块链上的每笔交易都由 [多个阶段][阶段] 组成。 出站报文在[计算阶段][计算]中进行评估,但\*\*\*不在该阶段发送。 在[计算阶段][compute]中列出的所有操作,如外向消息或[储备请求](/ref/core-advanced#nativereserve),都会在[操作阶段][phases]中执行。 @@ -131,29 +131,29 @@ contract FailureIsNothingButAnotherStep { - [计算阶段][计算]结束后,计算合约的剩余价值 $\mathrm{R}$。 -- 在出站信息处理过程中,假设入站信息中提供了足够的价值,第一条信息会在余额上留下 $\mathrm{R} - (0.042 + \mathrm{forward\_fees})$ [nanoToncoins](/book/integers#nanotoncoin) 。 +- 在出站信息处理过程中,假设入站信息中提供了足够的价值,第一条信息会在余额上留下 $\mathrm{R} - (0.042 + \mathrm{forward\_fees})$ [nanoToncoins](/zh-cn/book/integers#nanotoncoin) 。 -- 处理第二条信息时,合约会尝试发送 $\mathrm{R}$ [纳米通币](/book/integers#nanotoncoin),但发送失败,因为剩余的金额已经较少。 +- 处理第二条信息时,合约会尝试发送 $\mathrm{R}$ [纳米通币](/zh-cn/book/integers#nanotoncoin),但发送失败,因为剩余的金额已经较少。 :::note 有关所有信息发送功能的更多信息,请参阅参考资料: -- [`send(){:tact}`](/ref/core-common#send) -- [`emit(){:tact}`](/ref/core-common#emit) -- [`self.notify(){:tact}`](/ref/core-base#self-notify) -- [`self.reply(){:tact}`](/ref/core-base#self-reply) -- [`self.forward(){:tact}`](/ref/core-base#self-forward) -- [`nativeSendMessage(){:tact}`](/ref/core-advanced#nativesendmessage) +- [`send(){:tact}`](/zh-cn/ref/core-common#send) +- [`emit(){:tact}`](/zh-cn/ref/core-common#emit) +- [`self.notify(){:tact}`](/zh-cn/ref/core-base#self-notify) +- [`self.reply(){:tact}`](/zh-cn/ref/core-base#self-reply) +- [`self.forward(){:tact}`](/zh-cn/ref/core-base#self-forward) +- [`nativeSendMessage(){:tact}`](/zh-cn/ref/core-advanced#nativesendmessage) ::: -[p]: /book/types#primitive-types -[int]: /book/integers -[电池]: /book/cells#cells -[选择]: /book/optionals +[p]: /zh-cn/book/types#primitive-types +[int]: /zh-cn/book/integers +[电池]: /zh-cn/book/cells#cells +[选择]: /zh-cn/book/optionals [阶段]: https://docs.ton.org/learn/tvm-instructions/tvm-overview#transactions-and-phases [算]: https://docs.ton.org/learn/tvm-instructions/tvm-overview#compute-phase -[纳米]: /book/integers#nanotoncoin +[纳米]: /zh-cn/book/integers#nanotoncoin [fwdfee]: https://docs.ton.org/develop/howto/fees-low-level#forward-fees diff --git a/docs/src/content/docs/zh-cn/book/statements.mdx b/docs/src/content/docs/zh-cn/book/statements.mdx index 92e61efd7..9cf0a4e95 100644 --- a/docs/src/content/docs/zh-cn/book/statements.mdx +++ b/docs/src/content/docs/zh-cn/book/statements.mdx @@ -2,7 +2,7 @@ title: 发言 --- -以下语句可出现在 [function](/book/functions) 主体的任何位置。 +以下语句可出现在 [function](/zh-cn/book/functions) 主体的任何位置。 ## `let`语句 {#let} @@ -18,7 +18,7 @@ let vExplicitCtx:Context = context(); // 显式类型 Context,内置结构 let vCtx = context(); // 推断类型 Context ``` -请注意,`null{:tact}`的初始值既可以指具有任意 `K{:tact}`和 `V{:tact}`类型的空[`map{:tact}`](/book/maps),也可以指故意不为[optional](/book/optionals)类型设置任何其他值。 这就是为什么在声明 [optional](/book/optionals) 或 [`map{:tact}`](/book/maps)时,需要明确指定类型,因为无法推断: +请注意,`null{:tact}`的初始值既可以指具有任意 `K{:tact}`和 `V{:tact}`类型的空[`map{:tact}`](/zh-cn/book/maps),也可以指故意不为[optional](/zh-cn/book/optionals)类型设置任何其他值。 这就是为什么在声明 [optional](/zh-cn/book/optionals) 或 [`map{:tact}`](/zh-cn/book/maps)时,需要明确指定类型,因为无法推断: ```tact let vOptional: Int? = null; // explicit type Int or null @@ -40,7 +40,7 @@ dump(_); // COMPILATION ERROR!无法访问 _ ## `return` 语句 {#return} -`return{:tact}` 语句结束 [function](/book/functions) 的执行,并指定要返回给 [function](/book/functions) 调用者的值。 +`return{:tact}` 语句结束 [function](/zh-cn/book/functions) 的执行,并指定要返回给 [function](/zh-cn/book/functions) 调用者的值。 ```tact // Simple wrapper over stdlib function now() @@ -81,7 +81,7 @@ dump(2 + 2); // stdlib 函数 ## 任务 -赋值语句使用 [赋值运算符](/book/operators#assignment) (`={:tact}`)或 [增强赋值运算符](/book/operators#augmented-assignment) (赋值与运算相结合): +赋值语句使用 [赋值运算符](/zh-cn/book/operators#assignment) (`={:tact}`)或 [增强赋值运算符](/zh-cn/book/operators#augmented-assignment) (赋值与运算相结合): ```tact let value:Int; // 声明 @@ -91,7 +91,7 @@ value += 5; // 增强赋值(众多赋值之一,见下文) :::note - 有关赋值和增强赋值的更多信息,请参阅其专门章节:[赋值运算符](/book/operators#assignment)。 + 有关赋值和增强赋值的更多信息,请参阅其专门章节:[赋值运算符](/zh-cn/book/operators#assignment)。 ::: @@ -154,13 +154,13 @@ if (2 + 2 == 3) { :::note - Tact 也有一个三元表达式 `?:{:tact}`,在本书前面已有介绍:[三元表达式](/book/operators#ternary)。 + Tact 也有一个三元表达式 `?:{:tact}`,在本书前面已有介绍:[三元表达式](/zh-cn/book/operators#ternary)。 ::: ### `try...catch` {#try-catch} -`try...catch{:tact}`语句由一个 `try{:tact}`块和一个可选的 `catch{:tact}`块组成,它接收一个 [`Int{:tact}`][int][退出代码](/book/exit-codes)作为唯一参数。 首先执行 `try{:tact}`块中的代码,如果失败,则执行`catch{:tact}`块中的代码,并尽可能回滚`try{:tact}` 块中的更改。 +`try...catch{:tact}`语句由一个 `try{:tact}`块和一个可选的 `catch{:tact}`块组成,它接收一个 [`Int{:tact}`][int][退出代码](/zh-cn/book/exit-codes)作为唯一参数。 首先执行 `try{:tact}`块中的代码,如果失败,则执行`catch{:tact}`块中的代码,并尽可能回滚`try{:tact}` 块中的更改。 :::note @@ -217,7 +217,7 @@ try { } ``` -请注意,与 [`let{:tact}` 语句](#let)类似,在 `catch (){:tact}` 子句中捕获的[退出代码](/book/exit-codes)可以通过指定下划线 `_{:tact}` 来丢弃: +请注意,与 [`let{:tact}` 语句](#let)类似,在 `catch (){:tact}` 子句中捕获的[退出代码](/zh-cn/book/exit-codes)可以通过指定下划线 `_{:tact}` 来丢弃: ```tact try { @@ -229,7 +229,7 @@ try { :::note - 在专用页面上阅读更多有关退出代码的信息:[图书中的出口代码](/book/exit-codes)。 + 在专用页面上阅读更多有关退出代码的信息:[图书中的出口代码](/zh-cn/book/exit-codes)。 ::: @@ -239,7 +239,7 @@ try { ### `repeat` {#repeat-loop} -`repeat复{:tact}`循环执行指定次数的代码块。重复次数应该是一个正的 $32$ 位 [`Int{:tact}`][int],范围从 $1$ 到 $2^{31} - 1$。如果数值大于这个范围,将出现 [exit code 5](/book/exit-codes#5),“Integer out of the expected range ”的错误。 +`repeat复{:tact}`循环执行指定次数的代码块。重复次数应该是一个正的 $32$ 位 [`Int{:tact}`][int],范围从 $1$ 到 $2^{31} - 1$。如果数值大于这个范围,将出现 [exit code 5](/zh-cn/book/exit-codes#5),“Integer out of the expected range ”的错误。 如果指定的重复次数等于 $0$ 或包含范围 $-2^{256}$ 至 $-1$ 中的任何负数,则忽略该值,不执行代码块。 @@ -287,9 +287,9 @@ do { ### `foreach` {#foreach-loop} -`foreach{:tact}` 循环按顺序对 [`map{:tact}`](/book/maps) 类型的键值对(条目)进行操作:从 map 的最小键到最大键。 +`foreach{:tact}` 循环按顺序对 [`map{:tact}`](/zh-cn/book/maps) 类型的键值对(条目)进行操作:从 map 的最小键到最大键。 -该循环为给定映射中的每个条目执行一个代码块,每次迭代都会捕获键和值。 当您事先不知道地图中有多少个条目,或不想明确地使用地图的 [`.get(){:tact}`](/book/maps#get) [method](/book/functions#extension-function) 查找每个条目时,这将非常方便。 +该循环为给定映射中的每个条目执行一个代码块,每次迭代都会捕获键和值。 当您事先不知道地图中有多少个条目,或不想明确地使用地图的 [`.get(){:tact}`](/zh-cn/book/maps#get) [method](/zh-cn/book/functions#extension-function) 查找每个条目时,这将非常方便。 请注意,每次迭代时捕获的键和值对的名称是任意的,可以是任何有效的 Tact 标识符,只要它们是当前作用域的新标识符即可。 最常见的选项是k "和 "v",或 "key "和 "value"。 @@ -316,7 +316,7 @@ foreach (key, value in cells) { // or just k, v dump(sum); // 1000 ``` -还可以遍历合约存储中的映射,以及作为 [Struct](/book/structs-and-messages#structs) 或 [Message](/book/structs-and-messages#messages) 类型实例成员的映射: +还可以遍历合约存储中的映射,以及作为 [Struct](/zh-cn/book/structs-and-messages#structs) 或 [Message](/zh-cn/book/structs-and-messages#messages) 类型实例成员的映射: ```tact import "@stdlib/deploy"; @@ -394,7 +394,7 @@ foreach (k, v in emptyMap()) { } ``` - 试图遍历函数返回的 [Struct](/book/structs-and-messages#structs)的 map 成员也是行不通的,因为函数调用是一种表达式,而不是标识符或嵌套标识符访问: + 试图遍历函数返回的 [Struct](/zh-cn/book/structs-and-messages#structs)的 map 成员也是行不通的,因为函数调用是一种表达式,而不是标识符或嵌套标识符访问: ```tact foreach (k, v in genCoolStruct().map) { @@ -413,4 +413,4 @@ foreach (k, v in genCoolStruct().map) { ::: -[initOf]: /book/integers +[initOf]: /zh-cn/book/integers diff --git a/docs/src/content/docs/zh-cn/book/structs-and-messages.mdx b/docs/src/content/docs/zh-cn/book/structs-and-messages.mdx index 8c0a026b3..2b7ef902d 100644 --- a/docs/src/content/docs/zh-cn/book/structs-and-messages.mdx +++ b/docs/src/content/docs/zh-cn/book/structs-and-messages.mdx @@ -2,7 +2,7 @@ title: 结构和信息 --- -Tact 支持许多专为智能合约使用而定制的 [原始数据类型](/book/types#primitive-types)。 不过,使用单独的存储方式往往会变得繁琐,因此有 [Structs](#structs) 和 [Messages](#messages)可以将类型组合在一起。 +Tact 支持许多专为智能合约使用而定制的 [原始数据类型](/zh-cn/book/types#primitive-types)。 不过,使用单独的存储方式往往会变得繁琐,因此有 [Structs](#structs) 和 [Messages](#messages)可以将类型组合在一起。 :::caution @@ -116,7 +116,7 @@ message(0x7362d09c) TokenNotification { :::note 更深入的信息请参见: - [Convert received messages to `op` operations](/book/func#convert-received-messages-to-op-operations)\ + [Convert received messages to `op` operations](/zh-cn/book/func#convert-received-messages-to-op-operations)\ [Internal message body layout in TON Docs](https://docs.ton.org/develop/smart-contracts/guidelines/internal-messages#internal-message-body)\ [Messages of the Jetton implementation in Tact](https://github.com/howardpen9/jetton-implementation-in-tact/blob/9eee917877a92af218002874a9f2bd3f9c619229/sources/messages.tact)\ [Jetton Standard in Tact on Tact-by-Example](https://tact-by-example.org/07-jetton-standard) @@ -127,7 +127,7 @@ message(0x7362d09c) TokenNotification { ### 实例化 -创建 [Struct](#structs) 和 [Message](#messages) 实例类似于 [function calls](/book/expressions#static-function-call),但需要用大括号 `{}{:tact}`(大括号)代替小括号 `(){:tact}`指定参数: +创建 [Struct](#structs) 和 [Message](#messages) 实例类似于 [function calls](/zh-cn/book/expressions#static-function-call),但需要用大括号 `{}{:tact}`(大括号)代替小括号 `(){:tact}`指定参数: ```tact struct StA { @@ -183,13 +183,13 @@ fun example() { :::note - 因为实例化是 Tact 中的一个表达式,所以在相关页面中也有描述:[实例化表达式](/book/expressions#instantiation)。 + 因为实例化是 Tact 中的一个表达式,所以在相关页面中也有描述:[实例化表达式](/zh-cn/book/expressions#instantiation)。 ::: ### 转换为 `Cell`, `.toCell()` {#tocell} -通过使用 `.toCell(){:tact}` [扩展函数](/book/functions#extension-function),可以将任意 [Struct](#structs) 或 [Message](#messages) 转换为 [`单元格{:tact}`][单元格] 类型: +通过使用 `.toCell(){:tact}` [扩展函数](/zh-cn/book/functions#extension-function),可以将任意 [Struct](#structs) 或 [Message](#messages) 转换为 [`单元格{:tact}`][单元格] 类型: ```tact struct Big { @@ -212,16 +212,16 @@ fun conversionFun() { :::note 参见参考资料中的扩展函数: - [`Struct.toCell(){:tact}`](/ref/core-cells#structtocell)/ - [`Message.toCell(){:tact}`](/ref/core-cells#messagetocell)。 + [`Struct.toCell(){:tact}`](/zh-cn/ref/core-cells#structtocell)/ + [`Message.toCell(){:tact}`](/zh-cn/ref/core-cells#messagetocell)。 ::: ### 从 `Cell` 或 `Slice` 获取,`.fromCell()` 和 `.fromSlice()` {#fromcellslice} -无需通过一系列相关的 `.loadSomething(){:tact}` 函数调用来手动解析 [`Cell{:tact}`][cell] 或 [`Slice{:tact}`][slice],而是可以使用 `.fromCell(){:tact}` 和 `.fromSlice(){:tact}` [扩展函数](/book/functions#extension-function)。这些扩展函数将所提供的 [`Cell{:tact}`][cell] 或 [`Slice{:tact}`][slice] 转换为所需的 [Struct](#structs) 或 [Message](#messages)。 +无需通过一系列相关的 `.loadSomething(){:tact}` 函数调用来手动解析 [`Cell{:tact}`][cell] 或 [`Slice{:tact}`][slice],而是可以使用 `.fromCell(){:tact}` 和 `.fromSlice(){:tact}` [扩展函数](/zh-cn/book/functions#extension-function)。这些扩展函数将所提供的 [`Cell{:tact}`][cell] 或 [`Slice{:tact}`][slice] 转换为所需的 [Struct](#structs) 或 [Message](#messages)。 -这些扩展函数仅尝试根据 [Struct](#structs) 或 [Message](#messages) 的结构解析 [`Cell{:tact}`][cell] 或 [`Slice{:tact}`][slice]。如果布局不匹配,可能会抛出各种异常——确保用 [`try...catch{:tact}`](/book/statements#try-catch) 块封装代码,以防止意外结果。 +这些扩展函数仅尝试根据 [Struct](#structs) 或 [Message](#messages) 的结构解析 [`Cell{:tact}`][cell] 或 [`Slice{:tact}`][slice]。如果布局不匹配,可能会抛出各种异常——确保用 [`try...catch{:tact}`](/zh-cn/book/statements#try-catch) 块封装代码,以防止意外结果。 ```tact struct Fizz { foo: Int } @@ -292,10 +292,10 @@ fun lawTwo() { } ``` -[st-fc]: /ref/core-cells#structfromcell -[st-fs]: /ref/core-cells#structfromslice -[msg-fc]: /ref/core-cells#messagefromcell -[msg-fs]: /ref/core-cells#messagefromslice -[p]: /book/types#primitive-types -[电池]: /book/cells#cells -[一片]: /book/cells#slices +[st-fc]: /zh-cn/ref/core-cells#structfromcell +[st-fs]: /zh-cn/ref/core-cells#structfromslice +[msg-fc]: /zh-cn/ref/core-cells#messagefromcell +[msg-fs]: /zh-cn/ref/core-cells#messagefromslice +[p]: /zh-cn/book/types#primitive-types +[电池]: /zh-cn/book/cells#cells +[一片]: /zh-cn/book/cells#slices diff --git a/docs/src/content/docs/zh-cn/book/types.mdx b/docs/src/content/docs/zh-cn/book/types.mdx index 78b1532b4..90aed3128 100644 --- a/docs/src/content/docs/zh-cn/book/types.mdx +++ b/docs/src/content/docs/zh-cn/book/types.mdx @@ -5,7 +5,7 @@ title: 类型系统概述 Tact 程序中的每个变量、项目和值都有一个类型。 它们可以是 - [原始类型](#primitive-types) 之一 -- 或 [复合类型](#复合类型) +- 或 [复合类型](#composite-types) Additionally, many of those types [can be made nullable](#optionals). @@ -13,10 +13,10 @@ Additionally, many of those types [can be made nullable](#optionals). Tact 支持许多专为智能合约定制的原始数据类型: -- `Int{:tact}` — Tact 中的所有数字都是 257 位有符号整数,但可以使用[较小的表示方法](/book/integers#serialization)来减少存储成本。 +- `Int{:tact}` — Tact 中的所有数字都是 257 位有符号整数,但可以使用[较小的表示方法](/zh-cn/book/integers#serialization)来减少存储成本。 - `Bool{:tact}` — 经典布尔类型,具有 `true{:tact}` 和 `false{:tact}` 值。 - `Address{:tact}` — TON 区块链中的标准[智能合约地址](https://docs.ton.org/learn/overviews/addresses#address-of-smart-contract)。 -- [`Cell{:tact}`](/book/cells#cells)、[`Builder{:tact}`](/book/cells#builders)、[`Slice{:tact}`](/book/cells#slices) — [TVM][tvm] 的底层基元。 +- [`Cell{:tact}`](/zh-cn/book/cells#cells)、[`Builder{:tact}`](/zh-cn/book/cells#builders)、[`Slice{:tact}`](/zh-cn/book/cells#slices) — [TVM][tvm] 的底层基元。 - `String{:tact}` — 不可变的文本字符串。 - `StringBuilder{:tact}` — 辅助类型,允许以节省 gas 的方式连接字符串。 @@ -26,17 +26,17 @@ Tact 支持许多专为智能合约定制的原始数据类型: 原始类型 `Bool{:tact}` 是经典的布尔类型,只能容纳两个值:`true{:tact}` 和 `false{:tact}`。它便于布尔和逻辑运算,也便于存储标志。 -Tact 中没有隐式类型转换,因此两个布尔值的加法([`+{:tact}`](/book/operators#binary-add))是不可能的。这里有许多比较[运算符](/book/operators),例如: +Tact 中没有隐式类型转换,因此两个布尔值的加法([`+{:tact}`](/zh-cn/book/operators#binary-add))是不可能的。这里有许多比较[运算符](/zh-cn/book/operators),例如: -- `&&{:tact}` 为 [logical AND](/book/operators#binary-logical-and) -- `||{:tact}` 为 [logical OR](/book/operators#binary-logical-or) -- `!{:tact}` 为 [logical inversion](/book/operators#unary-inverse) -- `=={:tact}` 和 `!={:tact}` 用于检查[相等](/book/operators#binary-equality) -- `!{:tact}` 表示[非空断言](/book/optionals) +- `&&{:tact}` 为 [logical AND](/zh-cn/book/operators#binary-logical-and) +- `||{:tact}` 为 [logical OR](/zh-cn/book/operators#binary-logical-or) +- `!{:tact}` 为 [logical inversion](/zh-cn/book/operators#unary-inverse) +- `=={:tact}` 和 `!={:tact}` 用于检查[相等](/zh-cn/book/operators#binary-equality) +- `!{:tact}` 表示[非空断言](/zh-cn/book/optionals) 将 bools 持久化为状态非常节省空间,因为它们只占用 1 位。 每年在州[花费](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees)存储 1000 个布尔约需 $0.00072$ ton 。 -## 复合类型 +## 复合类型 {#composite-types} 使用单独的存储手段往往会变得繁琐,因此有办法将多个[原始类型](#primitive-types)组合在一起,创建复合类型: @@ -44,9 +44,9 @@ Tact 中没有隐式类型转换,因此两个布尔值的加法([`+{:tact}`] - 复合类型,如[结构体和消息](#structs-and-messages) - [可选项](#optionals) - [结构体和消息](#structs-and-messages)变量或字段的`null{:tact}`值。 -除上述复合类型外,Tact 还提供了一种特殊的类型构造函数[`bounced{:tact}`](/book/bounced),它只能在[弹回消息接收器](/book/bounced)中指定。 +除上述复合类型外,Tact 还提供了一种特殊的类型构造函数[`bounced{:tact}`](/zh-cn/book/bounced),它只能在[弹回消息接收器](/zh-cn/book/bounced)中指定。 -请注意,虽然[合约](#contracts)和[特质](#traits)也被视为Tact类型系统的一部分,但我们不能像[结构体和消息](#structs-and-messages)那样传递它们。相反,我们可以使用[`initOf{:tact}`](/book/expressions#initof)表达式来获取给定合约的初始状态。 +请注意,虽然[合约](#contracts)和[特质](#traits)也被视为Tact类型系统的一部分,但我们不能像[结构体和消息](#structs-and-messages)那样传递它们。相反,我们可以使用[`initOf{:tact}`](/zh-cn/book/expressions#initof)表达式来获取给定合约的初始状态。 ### 映射 {#maps} @@ -58,7 +58,7 @@ let mapExample: map = emptyMap(); // 带有 Int 键和值的空地图 在专门页面了解更多信息:[地图][地图]。 -[[Maps](#maps)]: /book/maps +[[Maps](#maps)]: /zh-cn/book/maps ### 结构和信息 {#structs-and-messages} @@ -88,9 +88,9 @@ message(0x11111111) SetValue { 有关它们的更多信息,请访问专门页面:[结构和信息][s-n-m]。 -[s-n-m]: /book/structs-and-messages -[structs]: /book/structs-and-messages#structs -[messages]: /book/structs-and-messages#messages +[s-n-m]: /zh-cn/book/structs-and-messages +[structs]: /zh-cn/book/structs-and-messages#structs +[messages]: /zh-cn/book/structs-and-messages#messages ### 可选项 {#optionals} @@ -104,13 +104,13 @@ let opt: Int? = null; // Int or null, with explicitly assigned null Learn more about them on a dedicated page: [Optionals][optionals]. -[选修课]: /book/optionals +[选修课]: /zh-cn/book/optionals ### 合同 {#contracts} Contracts are the main entry of a smart contract on the TON blockchain. It holds all functions, getters, and receivers of a TON contract. -[合同示例](/book/contracts): +[合同示例](/zh-cn/book/contracts): ```tact contract HelloWorld { @@ -138,11 +138,11 @@ or [Contracts](#contracts) and [Traits](#traits) ### 特质 {#traits} -Tact 不支持经典的类继承,而是引入了**特质**(traits)的概念。它们的结构与[合约](#contracts)相同,但不能[初始化持久状态变量](/book/contracts#init-function)。 +Tact 不支持经典的类继承,而是引入了**特质**(traits)的概念。它们的结构与[合约](#contracts)相同,但不能[初始化持久状态变量](/zh-cn/book/contracts#init-function)。 -特质还可以让继承它的契约重写其[函数](/book/functions#virtual-and-abstract-functions)的行为和[常量](/book/constants#virtual-and-abstract-constants)的值。 +特质还可以让继承它的契约重写其[函数](/zh-cn/book/functions#virtual-and-abstract-functions)的行为和[常量](/zh-cn/book/constants#virtual-and-abstract-constants)的值。 -来自 [`@stdlib/ownable`](/ref/stdlib-ownable) 的 trait [`Ownable`](/ref/stdlib-ownable#ownable) 示例: +来自 [`@stdlib/ownable`](/zh-cn/ref/stdlib-ownable) 的 trait [`Ownable`](/zh-cn/ref/stdlib-ownable#ownable) 示例: ```tact trait Ownable { @@ -161,7 +161,7 @@ trait Ownable { } ``` -而 [contract](#contracts) 使用了 trait [`Ownable{:tact}`](/ref/stdlib-ownable#ownable): +而 [contract](#contracts) 使用了 trait [`Ownable{:tact}`](/zh-cn/ref/stdlib-ownable#ownable): ```tact contract Treasure with Ownable { diff --git a/docs/src/content/docs/zh-cn/cookbook/access.mdx b/docs/src/content/docs/zh-cn/cookbook/access.mdx index 013ad9fb6..76053d144 100644 --- a/docs/src/content/docs/zh-cn/cookbook/access.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/access.mdx @@ -41,7 +41,7 @@ Deployable, Ownable 的 SenderChecker 合约 { :::note[Useful links:] - [核心库中的 `trait Ownable{:tact}`](/ref/stdlib-ownable#ownable) + [核心库中的 `trait Ownable{:tact}`](/zh-cn/ref/stdlib-ownable#ownable) ::: diff --git a/docs/src/content/docs/zh-cn/cookbook/data-structures.mdx b/docs/src/content/docs/zh-cn/cookbook/data-structures.mdx index ab76104e0..1b1399cf5 100644 --- a/docs/src/content/docs/zh-cn/cookbook/data-structures.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/data-structures.mdx @@ -8,11 +8,11 @@ title: 数据结构 这里列出的所有数据结构都是使用内置的 [`map{:tact}`][map]类型制作的。 有关地图的描述和基本用法,请参阅[本书专页][地图]。 -## 数组 +## Array [数组](https://en.wikipedia.org/wiki/Array_(data_structure)) 是一种数据结构,由连续的内存块组成,代表相同内存大小的元素集合,每个元素至少由一个数组键或_index_标识。 -下面的示例使用[结构](/book/structs-and-messages#structs)包装的[`map{:tact}`][map]模拟数组,其中`V{:tact}`可以是 map 的任何[允许值类型](/book/maps#allowed-types): +下面的示例使用[结构](/zh-cn/book/structs-and-messages#structs)包装的[`map{:tact}`][map]模拟数组,其中`V{:tact}`可以是 map 的任何[允许值类型](/zh-cn/book/maps#allowed-types): ```tact import "@stdlib/deploy"; // for Deployable trait @@ -158,14 +158,14 @@ contract MapAsArray with Deployable { } ``` -## 堆栈 +## Stack [堆栈](https://en.wikipedia.org/wiki/Stack_(abstract_data_type)) 是一种由元素集合组成的数据结构,主要有两种操作: - 推送,将一个元素添加到集合的末尾 - 弹出,移除最近添加的元素 -下面的示例使用[结构](/book/structs-and-messages#structs)包装的[`map{:tact}`][map]模拟堆栈,其中 `V{:tact}`可以是 map 的任何[允许值类型](/book/maps#allowed-types): +下面的示例使用[结构](/zh-cn/book/structs-and-messages#structs)包装的[`map{:tact}`][map]模拟堆栈,其中 `V{:tact}`可以是 map 的任何[允许值类型](/zh-cn/book/maps#allowed-types): ```tact import "@stdlib/deploy"; // for Deployable trait @@ -262,11 +262,11 @@ contract MapAsStack with Deployable { } ``` -## 圆形缓冲区 +## Circular buffer [循环缓冲区](https://en.wikipedia.org/wiki/Circular_buffer)(循环队列、循环缓冲区或环形缓冲区)是一种数据结构,它使用单个固定大小的[缓冲区](https://en.wikipedia.org/wiki/Data_buffer),就像端对端连接一样。 -下面的示例使用包裹在 [Struct](/book/structs-and-messages#structs) 中的 [`map{:tact}`][map]模拟循环缓冲区,其中 `V{:tact}` 可以是 map 的任何 [允许值类型](/book/maps#allowed-types): +下面的示例使用包裹在 [Struct](/zh-cn/book/structs-and-messages#structs) 中的 [`map{:tact}`][map]模拟循环缓冲区,其中 `V{:tact}` 可以是 map 的任何 [允许值类型](/zh-cn/book/maps#allowed-types): ```tact import "@stdlib/deploy"; // for Deployable trait @@ -374,4 +374,4 @@ fun emptyCircularBuffer():CircularBuffer { ::: -[地图]: /book/maps +[地图]: /zh-cn/book/maps diff --git a/docs/src/content/docs/zh-cn/cookbook/jettons.mdx b/docs/src/content/docs/zh-cn/cookbook/jettons.mdx index 1bf076fda..66ae7d1fc 100644 --- a/docs/src/content/docs/zh-cn/cookbook/jettons.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/jettons.mdx @@ -17,7 +17,7 @@ message(0x7362d09c) JettonTransferNotification { } ``` -使用 [receiver](/book/receive) 功能接受令牌通知信息。 +使用 [receiver](/zh-cn/book/receive) 功能接受令牌通知信息。 :::caution @@ -26,7 +26,7 @@ message(0x7362d09c) JettonTransferNotification { ::: 可使用 jetton 钱包状态初始值和计算 jetton 地址进行验证。 -请注意,通知来自您的合约的 jetton 钱包,因此所有者地址栏应使用 [`myAddress()`](/ref/core-common#myaddress)。 +请注意,通知来自您的合约的 jetton 钱包,因此所有者地址栏应使用 [`myAddress()`](/zh-cn/ref/core-common#myaddress)。 钱包的初始数据布局如下所示,但有时会有所不同。 请注意,"myJettonWalletAddress "也可以存储在合约存储中,以便在每次交易中减少 gas 使用量。 @@ -69,7 +69,7 @@ contract Sample { ## 发送 jetton 转送 -要发送 jetton 传输,请使用 [`send(){:tact}`](/book/send)函数。 +要发送 jetton 传输,请使用 [`send(){:tact}`](/zh-cn/book/send)函数。 请注意,"myJettonWalletAddress" 也可以存储在合约存储中,以便在每次交易中减少 gas 使用量。 ```tact diff --git a/docs/src/content/docs/zh-cn/cookbook/misc.mdx b/docs/src/content/docs/zh-cn/cookbook/misc.mdx index 9f615a92e..6b3dfb11a 100644 --- a/docs/src/content/docs/zh-cn/cookbook/misc.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/misc.mdx @@ -25,7 +25,7 @@ nativeThrowUnless(39, number == 198); :::note[Useful links:] - [核心库中的 `throw(){:tact}`](/ref/core-debug#throw)/ + [核心库中的 `throw(){:tact}`](/zh-cn/ref/core-debug#throw)/ [Tact-By-Example中的错误](https://tact-by-example.org/03-errors) ::: diff --git a/docs/src/content/docs/zh-cn/cookbook/random.mdx b/docs/src/content/docs/zh-cn/cookbook/random.mdx index 98e557e1b..847e9787b 100644 --- a/docs/src/content/docs/zh-cn/cookbook/random.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/random.mdx @@ -19,8 +19,8 @@ number = random(1, 12); :::note[Useful links:] - [`randomInt(){:tact}` in Core library](/ref/core-random#randomint)\ - [`random(){:tact}` in Core library](/ref/core-random#random) + [`randomInt(){:tact}` in Core library](/zh-cn/ref/core-random#randomint)\ + [`random(){:tact}` in Core library](/zh-cn/ref/core-random#random) ::: diff --git a/docs/src/content/docs/zh-cn/cookbook/single-communication.mdx b/docs/src/content/docs/zh-cn/cookbook/single-communication.mdx index c367a54fd..a28aed8aa 100644 --- a/docs/src/content/docs/zh-cn/cookbook/single-communication.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/single-communication.mdx @@ -4,7 +4,7 @@ title: 单项合同通信 本页列出了单个已部署合约与区块链上其他合约进行通信的示例。 -有关多个已部署合同之间的通信示例,请参阅:[多合约通信](/cookbook/multi-communication)。 +有关多个已部署合同之间的通信示例,请参阅:[多合约通信](/zh-cn/cookbook/multi-communication)。 ## 如何进行基本回复 {#how-to-make-a-basic-reply} @@ -69,7 +69,7 @@ send(SendParameters{ ## 如何发送带有长文本注释的信息 -如果我们需要发送一条带有冗长文本注释的信息,我们应该创建一个 [`String{:tact}`](/book/types#primitive-types),由超过 $127$ 个字符组成。 为此,我们可以利用 [`StringBuilder{:tact}`](/book/types#primitive-types)原始类型及其名为 `beginComment(){:tact}` 和 `append(){:tact}` 的方法。 在发送之前,我们应该使用 `toCell(){:tact}` 方法将字符串转换为单元格。 +如果我们需要发送一条带有冗长文本注释的信息,我们应该创建一个 [`String{:tact}`](/zh-cn/book/types#primitive-types),由超过 $127$ 个字符组成。 为此,我们可以利用 [`StringBuilder{:tact}`](/zh-cn/book/types#primitive-types)原始类型及其名为 `beginComment(){:tact}` 和 `append(){:tact}` 的方法。 在发送之前,我们应该使用 `toCell(){:tact}` 方法将字符串转换为单元格。 ```tact let comment: StringBuilder = beginComment(); @@ -87,10 +87,10 @@ send(SendParameters{ :::note[Useful links:] - ["Sending messages" in the Book](/book/send#send-message)\ - ["Message `mode`" in the Book](/book/message-mode) - [`StringBuilder{:tact}` in the Book](/book/types#primitive-types) - [`Cell{:tact}` in Core library](/ref/core-cells) + ["Sending messages" in the Book](/zh-cn/book/send#send-message)\ + ["Message `mode`" in the Book](/zh-cn/book/message-mode) + [`StringBuilder{:tact}` in the Book](/zh-cn/book/types#primitive-types) + [`Cell{:tact}` in Core library](/zh-cn/ref/core-cells) ::: diff --git a/docs/src/content/docs/zh-cn/cookbook/time.mdx b/docs/src/content/docs/zh-cn/cookbook/time.mdx index 9a3a40eea..ae4e40801 100644 --- a/docs/src/content/docs/zh-cn/cookbook/time.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/time.mdx @@ -6,7 +6,7 @@ title: 时间和日期 使用 `now(){:tact}` 方法获取当前标准[Unix 时间](https://en.wikipedia.org/wiki/Unix_time)。 -如果需要在状态中存储时间或在信息中编码时间,请使用下面的 [serialization](/book/integers#serialization):`Int as uint32{:tact}`。 +如果需要在状态中存储时间或在信息中编码时间,请使用下面的 [serialization](/zh-cn/book/integers#serialization):`Int as uint32{:tact}`。 ```tact let currentTime: Int = now(); @@ -18,7 +18,7 @@ if (currentTime > 1672080143) { :::note[Useful links:] - [核心库中的 `now(){:tact}`](/ref/core-common#now)/ + [核心库中的 `now(){:tact}`](/zh-cn/ref/core-common#now)/ [Tact-By-Example中的 "当前时间"](https://tact-by-example.org/04-current-time) ::: diff --git a/docs/src/content/docs/zh-cn/cookbook/type-conversion.mdx b/docs/src/content/docs/zh-cn/cookbook/type-conversion.mdx index f28880e0a..5cda9999b 100644 --- a/docs/src/content/docs/zh-cn/cookbook/type-conversion.mdx +++ b/docs/src/content/docs/zh-cn/cookbook/type-conversion.mdx @@ -2,11 +2,11 @@ title: 类型转换 --- -本页展示了在[原始类型][p]之间进行转换以及从[复合类型](/book/types#composite-types)中获取这些类型的示例。 +本页展示了在[原始类型][p]之间进行转换以及从[复合类型](/zh-cn/book/types#composite-types)中获取这些类型的示例。 ## `Int` ↔ `String` {#int-string} -### 如何将 "字符串 "转换为 "整数 +### 如何将 "字符串 "转换为 "整数 {#how-to-convert-a-string-to-an-int} ```tact // 为 String 类型定义一个新的扩展函数,返回 Int 类型的值 @@ -59,9 +59,9 @@ dump(coinsString); // "0.261119911" :::note[Useful links:] - [`Int.toString(){:tact}` 在核心库中](/ref/core-strings#inttostring)/ - [`Int.toFloatString(){:tact}` 在核心库中](/ref/core-strings#inttofloatstring)/ - [`Int.toCoinsString(){:tact}` 在核心库中](/ref/core-strings#inttocoinsstring) + [`Int.toString(){:tact}` 在核心库中](/zh-cn/ref/core-strings#inttostring)/ + [`Int.toFloatString(){:tact}` 在核心库中](/zh-cn/ref/core-strings#inttofloatstring)/ + [`Int.toCoinsString(){:tact}` 在核心库中](/zh-cn/ref/core-strings#inttocoinsstring) ::: @@ -98,8 +98,8 @@ fun convert() { :::note[Useful links:] - [`Struct.toCell(){:tact}` 在核心库中](/ref/core-cells#structtocell)/ - [`Message.toCell(){:tact}` 在核心库中](/ref/core-cells#messagetocell) + [`Struct.toCell(){:tact}` 在核心库中](/zh-cn/ref/core-cells#structtocell)/ + [`Message.toCell(){:tact}` 在核心库中](/zh-cn/ref/core-cells#messagetocell) ::: @@ -134,10 +134,10 @@ fun convert() { :::note[Useful links:] - [`Struct.fromCell(){:tact}` in Core library](/ref/core-cells#structfromcell)\ - [`Struct.fromSlice(){:tact}` in Core library](/ref/core-cells#structfromslice)\ - [`Message.fromCell(){:tact}` 在核心库中](/ref/core-cells#messagefromcell)/ - [`Message.fromSlice(){:tact}` 在核心库中](/ref/core-cells#messagefromslice) + [`Struct.fromCell(){:tact}` in Core library](/zh-cn/ref/core-cells#structfromcell)\ + [`Struct.fromSlice(){:tact}` in Core library](/zh-cn/ref/core-cells#structfromslice)\ + [`Message.fromCell(){:tact}` 在核心库中](/zh-cn/ref/core-cells#messagefromcell)/ + [`Message.fromSlice(){:tact}` 在核心库中](/zh-cn/ref/core-cells#messagefromslice) ::: @@ -147,4 +147,4 @@ fun convert() { ::: -[p]: /book/types#primitive-types +[p]: /zh-cn/book/types#primitive-types diff --git a/docs/src/content/docs/zh-cn/ref/core-advanced.mdx b/docs/src/content/docs/zh-cn/ref/core-advanced.mdx index 3284b6c53..f4c875f4c 100644 --- a/docs/src/content/docs/zh-cn/ref/core-advanced.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-advanced.mdx @@ -16,9 +16,9 @@ title: 高级 extends fun readForwardFee(self: Context):Int ``` -[`Context{:tact}`](/ref/core-common#context) 的扩展函数。 +[`Context{:tact}`](/zh-cn/ref/core-common#context) 的扩展函数。 -读取 [forward fee](https://docs.ton.org/develop/smart-contracts/guidelines/processing),并以 [`Int{:tact}`][int] 的形式返回 [nanoToncoins](/book/integers#nanotoncoin) 的金额。 +读取 [forward fee](https://docs.ton.org/develop/smart-contracts/guidelines/processing),并以 [`Int{:tact}`][int] 的形式返回 [nanoToncoins](/zh-cn/book/integers#nanotoncoin) 的金额。 使用示例 @@ -26,7 +26,7 @@ extends fun readForwardFee(self: Context):Int let fwdFee: Int = context().readForwardFee(); ``` -## 获取配置参数 +## getConfigParam ```tact fun getConfigParam(id: Int):Cell? @@ -46,15 +46,15 @@ let dataStorageFeeConfig: Cell = getConfigParam(18)!!; :::note - 标准库 [`@stdlib/config`](/ref/stdlib-config) 提供了两个相关的辅助函数:\ - [`getConfigAddress(){:tact}`](/ref/stdlib-config#getconfigaddress),用于获取配置 [`Address{:tact}`][p]/ - [`getElectorAddress(){:tact}`](/ref/stdlib-config#getconfigaddress),用于获取选区 [`地址{:tact}`][p]。 + 标准库 [`@stdlib/config`](/zh-cn/ref/stdlib-config) 提供了两个相关的辅助函数:\ + [`getConfigAddress(){:tact}`](/zh-cn/ref/stdlib-config#getconfigaddress),用于获取配置 [`Address{:tact}`][p]/ + [`getElectorAddress(){:tact}`](/zh-cn/ref/stdlib-config#getconfigaddress),用于获取选区 [`地址{:tact}`][p]。 了解有关其他参数的更多信息:[TON 文档中的配置参数](https://docs.ton.org/develop/howto/blockchain-configs)。 ::: -## 接受消息 +## acceptMessage ```tact fun acceptMessage(); @@ -86,7 +86,7 @@ contract Timeout { ::: -## 承诺 +## commit ```tact fun commit(); @@ -101,13 +101,13 @@ commit(); // 现在,事务被视为 "成功" throw(42); // 这样就不会失败了 ``` -## nativePrepareRandom {#nativePrepareRandom} +## nativePrepareRandom {#nativepreparerandom} ```tact fun nativePrepareRandom(); ``` -使用 [`nativeRandomizeLt(){:tact}`](#本机随机化)准备随机数生成器。 由 [`randomInt(){:tact}`](/ref/core-random#randomint) 和 [`random(){:tact}`](/ref/core-random#random) 函数自动调用。 +使用 [`nativeRandomizeLt(){:tact}`](#nativerandomizelt)准备随机数生成器。 由 [`randomInt(){:tact}`](/zh-cn/ref/core-random#randomint) 和 [`random(){:tact}`](/zh-cn/ref/core-random#random) 函数自动调用。 使用示例 @@ -116,7 +116,7 @@ nativePrepareRandom(); // prepare the RNG // ... do your random things ... ``` -## 本机随机化 +## nativeRandomize ```tact fun nativeRandomize(x: Int); @@ -131,7 +131,7 @@ nativeRandomize(); // 现在,随机数的可预测性降低了 let idk:Int = randomInt(); // ????, it's random! ``` -## 本机随机化 +## nativeRandomizeLt ```tact fun nativeRandomizeLt(); @@ -148,55 +148,55 @@ nativeRandomizeLt(); // 现在,随机数对用户来说是不可预测的, let idk:Int = randomInt(); // ???,它是随机的! ``` -## 本机随机 +## nativeRandom ```tact fun nativeRandom():Int; ``` -生成并返回 $256$-bit 随机数,就像 [`randomInt(){:tact}`](/ref/core-random#randomint),但不会事先用 [`nativePrepareRandom(){:tact}`](#nativePrepareRandom)初始化随机生成器。 +生成并返回 $256$-bit 随机数,就像 [`randomInt(){:tact}`](/zh-cn/ref/core-random#randomint),但不会事先用 [`nativePrepareRandom(){:tact}`](#nativepreparerandom)初始化随机生成器。 :::note - 不要直接使用该函数,而应使用 [`randomInt(){:tact}`](/ref/core-random#randomint)。 + 不要直接使用该函数,而应使用 [`randomInt(){:tact}`](/zh-cn/ref/core-random#randomint)。 ::: -## 本机随机时间间隔 +## nativeRandomInterval ```tact fun nativeRandomInterval(max: Int):Int; ``` -生成并返回 $256$-bit 的随机数,范围从 $0$ 到 `max`,类似于 [`random(){:tact}`](/ref/core-random#random),但不会事先用 [`nativePrepareRandom(){:tact}`](#nativePrepareRandom)初始化随机生成器。 +生成并返回 $256$-bit 的随机数,范围从 $0$ 到 `max`,类似于 [`random(){:tact}`](/zh-cn/ref/core-random#random),但不会事先用 [`nativePrepareRandom(){:tact}`](#nativepreparerandom)初始化随机生成器。 :::note - 不要直接使用该函数,而应使用 [`random(){:tact}`](/ref/core-random#random)。 + 不要直接使用该函数,而应使用 [`random(){:tact}`](/zh-cn/ref/core-random#random)。 ::: -## 本机发送消息 +## nativeSendMessage ```tact fun nativeSendMessage(cell: Cell, mode: Int); ``` -通过指定完整的 "单元格 "和[信息 "模式"](/book/message-mode),[排队发送信息](/book/send#outbound-message-processing)。 +通过指定完整的 "单元格 "和[信息 "模式"](/zh-cn/book/message-mode),[排队发送信息](/zh-cn/book/send#outbound-message-processing)。 :::note - 除非您有无法以其他方式表达的复杂逻辑,否则请优先使用更常见、更方便用户使用的 [`send(){:tact}`](/ref/core-common#send)函数。 + 除非您有无法以其他方式表达的复杂逻辑,否则请优先使用更常见、更方便用户使用的 [`send(){:tact}`](/zh-cn/ref/core-common#send)函数。 ::: -## 本地储备金 +## nativeReserve ```tact fun nativeReserve(amount: Int, mode: Int); ``` -以指定的金额和模式调用本地 `raw_reserve` 函数。 raw_reserve "是一个函数,用于创建输出操作,从账户余额中储备特定数量的[nanoToncoins](/book/integers#nanotoncoin)。 +以指定的金额和模式调用本地 `raw_reserve` 函数。 raw_reserve "是一个函数,用于创建输出操作,从账户余额中储备特定数量的[nanoToncoins](/zh-cn/book/integers#nanotoncoin)。 它在 FunC 中的签名如下 @@ -206,10 +206,10 @@ raw_reserve(int amount, int mode) impure asm "RAWRESERVE"; 该函数有两个参数: -- 金额:要储备的 [nanoToncoins](/book/integers#nanotoncoin)的数量。 +- 金额:要储备的 [nanoToncoins](/zh-cn/book/integers#nanotoncoin)的数量。 - 模式决定预订行为。 -函数 "raw_reserve "大致等同于创建一个向外发送的消息,将指定的 "金额"[nanoToncoins](/book/integers#nanotoncoin)(或 "b " $-$ "金额"[nanoToncoins](/book/integers#nanotoncoin),其中 "b "为余额)发送给自己。 这就确保了后续产出行动所花费的资金不会超过剩余资金。 +函数 "raw_reserve "大致等同于创建一个向外发送的消息,将指定的 "金额"[nanoToncoins](/zh-cn/book/integers#nanotoncoin)(或 "b " $-$ "金额"[nanoToncoins](/zh-cn/book/integers#nanotoncoin),其中 "b "为余额)发送给自己。 这就确保了后续产出行动所花费的资金不会超过剩余资金。 您可以使用原始的 [`Int{:tact}`][int]值,并手动为 `mode` 提供这些值,但为了方便起见,您可以使用一组常量来轻松构建复合 `mode`。 有关基本模式和可选标记的更多信息,请参阅下表。 @@ -225,9 +225,9 @@ raw_reserve(int amount, int mode) impure asm "RAWRESERVE"; | 模式值 | 恒定名称 | 说明 | | ---------: | :---------------------------- | ------------------------------------------------------------------------------------ | -| $0$ | `ReserveExact{:tact}` | 精确保留指定数量的 [纳顿币](/book/integers#nanotoncoin)。 | +| $0$ | `ReserveExact{:tact}` | 精确保留指定数量的 [纳顿币](/zh-cn/book/integers#nanotoncoin)。 | | $1$ | `ReserveAllExcept{:tact}` | 保留所有 [纳米通币](/book/integers#nanotoncoin),但保留指定数量的 [纳米通币](/book/integers#nanotoncoin)。 | -| $2$ | `ReserveAtMost{:tact}` | 最多保留指定 "数量 "的 [纳顿币](/book/integers#nanotoncoin)。 | +| $2$ | `ReserveAtMost{:tact}` | 最多保留指定 "数量 "的 [纳顿币](/zh-cn/book/integers#nanotoncoin)。 | ### 可选标记 {#nativereserve-optional-flags} @@ -241,7 +241,7 @@ raw_reserve(int amount, int mode) impure asm "RAWRESERVE"; ### 使用标志组合模式 {#nativereserve-combining-modes-with-flags} -要为 `mode` 参数创建 [`Int{:tact}`][int]值,只需通过 [bitwise OR](/book/operators#binary-bitwise-or)操作将基本模式与可选标志结合起来: +要为 `mode` 参数创建 [`Int{:tact}`][int]值,只需通过 [bitwise OR](/zh-cn/book/operators#binary-bitwise-or)操作将基本模式与可选标志结合起来: ```tact nativeReserve(ton("0.1"), ReserveExact | ReserveBounceIfActionFail); @@ -251,6 +251,6 @@ nativeReserve(ton("0.1"), ReserveExact | ReserveBounceIfActionFail); // 要预订的纳吨币数量 ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers diff --git a/docs/src/content/docs/zh-cn/ref/core-base.mdx b/docs/src/content/docs/zh-cn/ref/core-base.mdx index b96ad6705..ecfa671e6 100644 --- a/docs/src/content/docs/zh-cn/ref/core-base.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-base.mdx @@ -2,7 +2,7 @@ title: 基本特质 --- -Tact 中的每个 [contract](/book/contracts) 和 [trait](/book/types#traits) 都隐式 [继承](/book/contracts#traits) `BaseTrait{:tact}` trait,该 trait 包含大量对任何类型的 contract 最有用的 [internal functions](/book/contracts#internal-functions) 以及一个针对 Tact 高级用户的常量 `self.storageReserve{:tact}`。 +Tact 中的每个 [contract](/zh-cn/book/contracts) 和 [trait](/zh-cn/book/types#traits) 都隐式 [继承](/zh-cn/book/contracts#traits) `BaseTrait{:tact}` trait,该 trait 包含大量对任何类型的 contract 最有用的 [internal functions](/zh-cn/book/contracts#internal-functions) 以及一个针对 Tact 高级用户的常量 `self.storageReserve{:tact}`。 ## 常数 @@ -79,7 +79,7 @@ self.notify("Beware, this is my reply to you!".asComment()); virtual fun forward(to: Address, body: Cell?, bounce: Bool, init: StateInit?); ``` -[将信息](/book/send#outbound-message-processing)(可跳转或不可跳转)发送到指定地址 `to`。 您可以选择提供信息的 "body "和[`init`包](/book/expressions#initof)。 +[将信息](/zh-cn/book/send#outbound-message-processing)(可跳转或不可跳转)发送到指定地址 `to`。 您可以选择提供信息的 "body "和[`init`包](/zh-cn/book/expressions#initof)。 当[`self.storageReserve{:tact}`](#self-storagereserve)常量被覆盖为$> 0$时,在发送信息之前,它也会尝试从剩余余额中预留`self.storageReserve{:tact}`的[nanoToncoins][nano]金额,然后再以[`SendRemainingBalance{:tact}`](https://docs.tact-lang.org/book/message-mode#base-modes)($128$) 模式发送信息。 @@ -88,7 +88,7 @@ virtual fun forward(to: Address, body: Cell?, bounce: Bool, init: StateInit?); :::note 请注意,`self.forward(){:tact}` 不会在余额上可用的[nanoToncoins][nano]之外发送额外的[nanoToncoins][nano]。 - 要想用一条信息发送更多的[nanoToncoins][nano],请使用[`send(){:tact}`](/ref/core-common#send)函数。 + 要想用一条信息发送更多的[nanoToncoins][nano],请使用[`send(){:tact}`](/zh-cn/ref/core-common#send)函数。 ::: @@ -124,4 +124,4 @@ message PayoutOk { } ``` -[nano]: /book/integers#nanotoncoin +[nano]: /zh-cn/book/integers#nanotoncoin diff --git a/docs/src/content/docs/zh-cn/ref/core-cells.mdx b/docs/src/content/docs/zh-cn/ref/core-cells.mdx index bf2f5438a..83aca63ce 100644 --- a/docs/src/content/docs/zh-cn/ref/core-cells.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-cells.mdx @@ -12,7 +12,7 @@ title: 细胞、建造者和切片 为此,建议高级用户使用[类型语言 - 二进制(TL-B)模式][tlb]。 - 建议每位用户使用 [Structs][struct] 及其 [方法](/book/functions#extension-function),如 [`Struct.toCell(){:tact}`](#structtocell) 和 [`Struct.fromCell(){:tact}`](#structfromcell),而不是手动构建和解析单元格,因为 [Structs][struct] 和 [Messages][message] 最接近于[您的合约的活 TL-B 架构](/book/cells#cnp-structs)。 + 建议每位用户使用 [Structs][struct] 及其 [方法](/zh-cn/book/functions#extension-function),如 [`Struct.toCell(){:tact}`](#structtocell) 和 [`Struct.fromCell(){:tact}`](#structfromcell),而不是手动构建和解析单元格,因为 [Structs][struct] 和 [Messages][message] 最接近于[您的合约的活 TL-B 架构](/zh-cn/book/cells#cnp-structs)。 ::: @@ -30,7 +30,7 @@ fun beginCell():生成器 让 fizz:Builder = beginCell(); ``` -## 空单元格 +## emptyCell ```tact fun emptyCell():单元格; @@ -47,7 +47,7 @@ let buzz:Cell = beginCell().endCell(); fizz == buzz; // true ``` -## 空切片 +## emptySlice ```tact fun emptySlice():Slice; @@ -81,7 +81,7 @@ extends fun beginParse(self: Cell):Slice; let fizz:Slice = c.beginParse(); ``` -## 单元格哈希值 +## Cell.hash ```tact extends fun hash(self: Cell):Int; @@ -142,7 +142,7 @@ extends fun storeUint(self: Builder, value: Int, bits: Int):Builder; 将 $0 \leq \text{bits} \leq 256$ 的无符号 `bits` 位 `value` 存储到 [`Builder{:tact}`][builder] 的副本中。返回该副本。 -试图存储负 `value` 或提供不足或超界 `bits` 数时,会出现 [退出代码 5](/book/exit-codes#5) 异常:"整数超出预期范围"。 +试图存储负 `value` 或提供不足或超界 `bits` 数时,会出现 [退出代码 5](/zh-cn/book/exit-codes#5) 异常:"整数超出预期范围"。 使用示例 @@ -161,7 +161,7 @@ extends fun storeInt(self: Builder, value: Int, bits: Int):Builder; 将$0 ≤$ `bits` $≤ 257$的有符号`bits`-位`值`存储到[`builder{:tact}`][builder]的副本中。 返回该副本。 -试图提供一个不足或超出范围的`比特`数时,会出现[退出代码5](/book/exit-codes#5)的异常:整数超出预期范围"。 +试图提供一个不足或超出范围的`比特`数时,会出现[退出代码5](/zh-cn/book/exit-codes#5)的异常:整数超出预期范围"。 使用示例 @@ -216,7 +216,7 @@ extends fun storeCoins(self: Builder, value: Int):Builder; 存储(序列化)一个范围为 $0 \ldots 2^{120} - 1$ 的无符号 [`Int{:tact}`][int] `value` 到 [`Builder{:tact}`][builder] 的副本中。`value` 的序列化由 $4$ 位无符号大端整数 $l$ 组成,它是最小的整数 $l \geq 0$,使得 $\text{value} < 2^{8l}$,然后是 `value` 的 $8l$ 位无符号大端表示。返回 [`Builder{:tact}`][builder] 的副本。 -试图存储一个超出范围的`值`时,会出现[退出代码5](/book/exit-codes#5)的异常:超出预期范围的`整数`。 +试图存储一个超出范围的`值`时,会出现[退出代码5](/zh-cn/book/exit-codes#5)的异常:超出预期范围的`整数`。 这是最常见的[纳米通币]存储方式(/book/integers#nanotoncoin)。 @@ -229,7 +229,7 @@ let fizz:Builder = b.storeCoins(42); :::note[Useful links:] - [特殊的 "硬币 "序列化类型](/book/integers#serialization-coins) + [特殊的 "硬币 "序列化类型](/zh-cn/book/integers#serialization-coins) ::: @@ -260,7 +260,7 @@ extends fun storeRef(self: Builder, cell: Cell):Builder; 将引用 `cell` 存储到[`Builder{:tact}`][builder]的副本中。 返回该副本。 -由于单个 [`单元格{:tact}`][单元格] 最多可存储 $4$ 引用,如果尝试存储更多引用,则会出现[退出代码 8](/book/exit-codes#8)异常:单元格溢出"。 +由于单个 [`单元格{:tact}`][单元格] 最多可存储 $4$ 引用,如果尝试存储更多引用,则会出现[退出代码 8](/zh-cn/book/exit-codes#8)异常:单元格溢出"。 使用示例 @@ -269,7 +269,7 @@ let b: Builder = beginCell(); let fizz:Builder = b.storeRef(emptyCell()); ``` -## 建造者参考资料 +## Builder.refs ```tact extends fun refs(self: Builder):Int; @@ -286,7 +286,7 @@ let b: Builder = beginCell(); let fizz:Int = b.refs(); // 0 ``` -## 构建器位 +## Builder.bits ```tact extends fun bits(self: Builder):Int; @@ -347,9 +347,9 @@ extends mutates fun loadUint(self: Slice, l: Int):Int; 从 [`Slice{:tact}`][slice]中加载并返回一个无符号的 `l` 位 [`Int{:tact}`][int],条件是 $0 ≤$ `l` $≤ 256$。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试加载的数据超过 [`片{:tact}`][片] 包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:单元格下溢"。 使用示例 @@ -368,9 +368,9 @@ extends fun preloadUint(self: Slice, l: Int):Int; 为 $0 ≤$ `l` $≤ 256$ 从 [`Slice{:tact}`][slice]中预载并返回一个无符号的 `l` 位 [`Int{:tact}`][int]。 不会修改 [`切片{:tact}`][切片]。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试预载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9)异常:单元格下溢"。 +尝试预载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9)异常:单元格下溢"。 使用示例 @@ -389,9 +389,9 @@ extends mutates fun loadInt(self: Slice, l: Int):Int; 从 [`Slice{:tact}`][slice]中加载并返回一个有符号的 `l` 位 [`Int{:tact}`][int],值为 $0 ≤$ `l` $≤ 257$。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:单元格下溢"。 使用示例 @@ -410,9 +410,9 @@ extends fun preloadInt(self: Slice, l: Int):Int; 为 $0 ≤$ `l` $≤ 257$ 从 [`Slice{:tact}`][slice]中预载并返回一个有符号的 `l` 位 [`Int{:tact}`][int]。 不会修改 [`切片{:tact}`][切片]。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试预载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9)异常:单元格下溢"。 +尝试预载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9)异常:单元格下溢"。 使用示例 @@ -431,9 +431,9 @@ extends mutates fun loadBits(self: Slice, l: Int):Slice; 从 [`片{:tact}`][片] 中加载 $0 ≤$ `l` $≤ 1023$ 位,并作为单独的 [`片{:tact}`][片] 返回。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:单元格下溢"。 使用示例 @@ -452,9 +452,9 @@ extends fun preloadBits(self: Slice, l: Int):Slice; 从 [`片{:tact}`][片] 中预载 $0 ≤$ `l` $≤ 1023$ 位,并将其作为单独的 [`片{:tact}`][片] 返回。 不修改原始 [`切片{:tact}`][切片]。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试预载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9)异常:单元格下溢"。 +尝试预载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9)异常:单元格下溢"。 使用示例 @@ -473,9 +473,9 @@ extends mutates fun skipBits(self: Slice, l: Int); 从 [`片{:tact}`][片] 中加载除第一个 0 ≤$ `l` $≤ 1023$ 位以外的所有位。 -试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/book/exit-codes#5)异常:超出预期范围的整数。 +试图指定一个超出范围的 `l` 值时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:超出预期范围的整数。 -尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:单元格下溢"。 使用示例 @@ -495,9 +495,9 @@ extends mutates fun loadBool(self: Slice):Bool; 从[`Slice{:tact}`][slice]加载单个位并返回[`Bool{:tact}`][bool]值。 如果加载的位等于 $1$,则读取 `true{:tact}`,否则读取 `false{:tact}`。 -当 [`Bool{:tact}`][bool][`slice{:tact}`][slice]不包含它时,尝试加载此类 [`Bool `][bool]会产生异常,[退出代码 8](/book/exit-codes#8):单元格溢出"。 +当 [`Bool{:tact}`][bool][`slice{:tact}`][slice]不包含它时,尝试加载此类 [`Bool `][bool]会产生异常,[退出代码 8](/zh-cn/book/exit-codes#8):单元格溢出"。 -尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:单元格下溢"。 使用示例 @@ -514,11 +514,11 @@ extends mutates fun loadCoins(self: Slice):Int; [`切片{:tact}`][切片]的扩展突变函数。 -加载并返回[序列化](#builderstorecoins)的一个范围为 $0 ... 2^{120} - 1$ 的无符号 [`Int{:tact}`][int]值,来自 [`片{:tact}`][片]。该值通常代表以[纳吨币](/book/integers#nanotoncoin)为单位的金额。 +加载并返回[序列化](#builderstorecoins)的一个范围为 $0 ... 2^{120} - 1$ 的无符号 [`Int{:tact}`][int]值,来自 [`片{:tact}`][片]。该值通常代表以[纳吨币](/zh-cn/book/integers#nanotoncoin)为单位的金额。 -当 [`Slice{:tact}`][slice]中不包含[`Int{:tact}`][int]时,尝试加载此类[`Int`][int]会产生异常,[退出代码为 8](/book/exit-codes#8):"单元格溢出"。 +当 [`Slice{:tact}`][slice]中不包含[`Int{:tact}`][int]时,尝试加载此类[`Int`][int]会产生异常,[退出代码为 8](/zh-cn/book/exit-codes#8):"单元格溢出"。 -尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:"单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:"单元格下溢"。 使用示例 @@ -529,7 +529,7 @@ let fizz:Int = s.loadCoins(); :::note[Useful links:] - [特殊的 "硬币 "序列化类型](/book/integers#serialization-coins) + [特殊的 "硬币 "序列化类型](/zh-cn/book/integers#serialization-coins) ::: @@ -543,9 +543,9 @@ extends mutates fun loadAddress(self: Slice):地址; 从[`Slice{:tact}`][slice]加载并返回一个[`Address{:tact}`][address]。 -当[`Slice{:tact}`][slice]不包含该地址时,尝试加载该[`Address{:tact}`][address]会产生异常,[退出代码 8](/book/exit-codes#8):"单元格溢出"。 +当[`Slice{:tact}`][slice]不包含该地址时,尝试加载该[`Address{:tact}`][address]会产生异常,[退出代码 8](/zh-cn/book/exit-codes#8):"单元格溢出"。 -尝试加载的数据超过 [`Slice{:tact}`][slice] 所包含的数据时,会出现 [退出代码 9](/book/exit-codes#9) 异常:"单元格下溢"。 +尝试加载的数据超过 [`Slice{:tact}`][slice] 所包含的数据时,会出现 [退出代码 9](/zh-cn/book/exit-codes#9) 异常:"单元格下溢"。 使用示例 @@ -564,9 +564,9 @@ extends mutates fun loadRef(self: Slice):Cell; 从 [`切片{:tact}`][切片] 中加载下一个引用作为 [`单元格{:tact}`][单元格]。 -当 [`切片{:tact}`][切片]不包含该引用时,尝试加载该引用会产生异常,[退出代码 8](/book/exit-codes#8):"单元格溢出"。 +当 [`切片{:tact}`][切片]不包含该引用时,尝试加载该引用会产生异常,[退出代码 8](/zh-cn/book/exit-codes#8):"单元格溢出"。 -尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9) 异常:单元格下溢"。 +尝试加载的数据超过 [`片{:tact}`][片] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9) 异常:单元格下溢"。 使用示例 @@ -686,7 +686,7 @@ extends fun endParse(self: Slice); [`切片{:tact}`][切片]的扩展函数。 -检查 [`片{:tact}`][片] 是否为空(即不包含数据位和单元格引用)。 如果不是,则抛出异常[退出代码 9](/book/exit-codes#9):单元格下溢。 +检查 [`片{:tact}`][片] 是否为空(即不包含数据位和单元格引用)。 如果不是,则抛出异常[退出代码 9](/zh-cn/book/exit-codes#9):单元格下溢。 使用示例 @@ -737,7 +737,7 @@ let buzz:Cell = beginCell().storeSlice(s).endCell(); fizz == buzz; // true ``` -## 地址.asSlice +## Address.asSlice ```tact extends fun asSlice(self: Address):Slice; @@ -793,7 +793,7 @@ extends fun fromCell(self: Struct, cell: Cell):Struct; 将 [`单元格{:tact}`][单元格] 转换为指定的 [结构体][struct],并返回该 [结构体][struct]。 -试图传递布局与指定 [Struct][struct] 不同的 [`单元格{:tact}`][单元格],或加载的数据超过 [`单元格{:tact}`][单元格] 所包含的数据时,会出现 [exit code 9](/book/exit-codes#9)异常:单元格下溢"。 +试图传递布局与指定 [Struct][struct] 不同的 [`单元格{:tact}`][单元格],或加载的数据超过 [`单元格{:tact}`][单元格] 所包含的数据时,会出现 [exit code 9](/zh-cn/book/exit-codes#9)异常:单元格下溢"。 使用示例 @@ -828,7 +828,7 @@ extends fun fromSlice(self: Struct, cell: Slice):Struct; 将 [`片{:tact}`][slice]转换为指定的 [Struct][struct],并返回该 [Struct][struct]。 -尝试传递布局与指定 [结构][struct]不同的 [`片{:tact}`][片],或加载比 [`片{:tact}`][片] 包含的数据更多的数据时,会出现[退出代码 9](/book/exit-codes#9)异常:单元下溢"。 +尝试传递布局与指定 [结构][struct]不同的 [`片{:tact}`][片],或加载比 [`片{:tact}`][片] 包含的数据更多的数据时,会出现[退出代码 9](/zh-cn/book/exit-codes#9)异常:单元下溢"。 使用示例 @@ -889,7 +889,7 @@ extends fun fromCell(self: Message, cell: Cell):消息; 将 [`单元格{:tact}`][单元格] 转换为指定的 [信息][消息],并返回该 [信息][消息]。 -尝试传递布局与指定[信息][message]不同的[`单元格{:tact}`][单元格],或加载的数据超过[`单元格{:tact}`][单元格]所包含的数据时,会出现[退出代码 9](/book/exit-codes#9)的异常:单元格下溢"。 +尝试传递布局与指定[信息][message]不同的[`单元格{:tact}`][单元格],或加载的数据超过[`单元格{:tact}`][单元格]所包含的数据时,会出现[退出代码 9](/zh-cn/book/exit-codes#9)的异常:单元格下溢"。 使用示例 @@ -923,7 +923,7 @@ extends fun fromSlice(self: Message, cell: Slice):消息; 将 [`片{:tact}`][片] 转换为指定的 [信息][消息],并返回该 [信息][消息]。 -试图传递布局不同于指定[信息][消息]的[`片{:tact}`][片],或加载的数据多于[`片{:tact}`][片]所包含的数据时,会出现[退出代码 9](/book/exit-codes#9)的异常:单元下溢"。 +试图传递布局不同于指定[信息][消息]的[`片{:tact}`][片],或加载的数据多于[`片{:tact}`][片]所包含的数据时,会出现[退出代码 9](/zh-cn/book/exit-codes#9)的异常:单元下溢"。 使用示例 @@ -947,17 +947,17 @@ fun cautiousParse(payload: Slice):TripleAxe?{ } ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[cell]: /book/cells#cells -[builder]: /book/cells#builders -[slice]: /book/cells#slices -[map]: /book/maps -[struct]: /book/structs-and-messages#structs -[message]: /book/structs-and-messages#messages +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[cell]: /zh-cn/book/cells#cells +[builder]: /zh-cn/book/cells#builders +[slice]: /zh-cn/book/cells#slices +[map]: /zh-cn/book/maps +[struct]: /zh-cn/book/structs-and-messages#structs +[message]: /zh-cn/book/structs-and-messages#messages -[std-repr]: /book/cells#cells-representation +[std-repr]: /zh-cn/book/cells#cells-representation [tlb]: https://docs.ton.org/develop/data-formats/tl-b-language [sha-2]: https://en.wikipedia.org/wiki/SHA-2#Hash_standard diff --git a/docs/src/content/docs/zh-cn/ref/core-common.mdx b/docs/src/content/docs/zh-cn/ref/core-common.mdx index d752c719b..f30147f6b 100644 --- a/docs/src/content/docs/zh-cn/ref/core-common.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-common.mdx @@ -6,7 +6,7 @@ title: 常见问题 ## 语境 -### 现在 +### now ```tact fun now():Int @@ -20,13 +20,13 @@ fun now():Int let timeOffset:Int = now() + 1000; // 距离 now() 千秒 ``` -### 我的余额 +### myBalance ```tact fun myBalance():Int; ``` -返回当前交易的 [计算阶段](https://docs.ton.org/learn/tvm-instructions/tvm-overview#compute-phase) 开始时智能合约的 [纳米通币](/book/integers#nanotoncoin) 余额。 +返回当前交易的 [计算阶段](https://docs.ton.org/learn/tvm-instructions/tvm-overview#compute-phase) 开始时智能合约的 [纳米通币](/zh-cn/book/integers#nanotoncoin) 余额。 使用示例 @@ -36,11 +36,11 @@ fun myBalance():Int; :::caution - 请注意,Tact 的 [所有信息发送函数](/book/send) 可以更改_实际_合约的余额,但不会_更新此函数返回的值。 + 请注意,Tact 的 [所有信息发送函数](/zh-cn/book/send) 可以更改_实际_合约的余额,但不会_更新此函数返回的值。 ::: -### 我的地址 +### myAddress ```tact fun myAddress():地址; @@ -72,7 +72,7 @@ receive() { :::caution - 对于 [getter 函数](/book/contracts#getter-functions),行为是未定义的,因为它们不能有发送者,也不能发送信息。 + 对于 [getter 函数](/zh-cn/book/contracts#getter-functions),行为是未定义的,因为它们不能有发送者,也不能发送信息。 ::: @@ -88,13 +88,13 @@ receive() { fun context():Context; ``` -Returns `Context{:tact}` [Struct](/book/structs-and-messages#structs), that consists of: +Returns `Context{:tact}` [Struct](/zh-cn/book/structs-and-messages#structs), that consists of: | 现场 | 类型 | 说明 | | :----- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | 宣布 | [`Bool{:tact}`][bool]。 | [退信](https://ton.org/docs/learn/overviews/addresses#bounceable-vs-non-bounceable-addresses) 标志。 | | 发件人 | [`地址{:tact}`][p] | 发送方在 TON 区块链上的内部地址。 | -| 值 | [`Int{:tact}`][int]。 | 信息中 [nanoToncoins](/book/integers#nanotoncoin) 的数量。 | +| 值 | [`Int{:tact}`][int]。 | 信息中 [nanoToncoins](/zh-cn/book/integers#nanotoncoin) 的数量。 | | 生 | [`切片{:tact}`][切片] | 信息的其余部分作为 [`片{:tact}`][片]。 它遵循 TON 的[内部报文布局](https://docs.ton.org/develop/smart-contracts/messages#message-layout),从目的地[`地址{:tact}`][p]([TL-B 符号](https://docs.ton.org/develop/data-formats/tl-b-language) 中的`dest:MsgAddressInt`)开始。 | 使用示例 @@ -112,15 +112,15 @@ require(ctx.value != 68 + 1, "Invalid amount of nanoToncoins, bye!"); ## 地址 -### 新地址 +### newAddress ```tact fun newAddress(chain: Int, hash: Int):地址; ``` -根据[`链`id](https://ton-blockchain.github.io/docs/#/overviews/TON_blockchain_overview)和[SHA-256](/ref/core-math#sha256)编码的[`哈希`值](https://docs.ton.org/learn/overviews/addresses#account-id)创建一个新的[`地址{:tact}`][p]。 +根据[`链`id](https://ton-blockchain.github.io/docs/#/overviews/TON_blockchain_overview)和[SHA-256](/zh-cn/ref/core-math#sha256)编码的[`哈希`值](https://docs.ton.org/learn/overviews/addresses#account-id)创建一个新的[`地址{:tact}`][p]。 -该函数尽可能在[编译时](/ref/core-comptime)解析常量值。 +该函数尽可能在[编译时](/zh-cn/ref/core-comptime)解析常量值。 使用示例 @@ -135,7 +135,7 @@ let oldTonFoundationAddr: Address = :::caution - 如果 `chain` 无效,该方法会抛出错误[退出代码 136](/book/exit-codes#136);如果 `chain` 指向主链 ($-1$) 且未启用[主链支持](/book/masterchain),该方法会抛出错误[退出代码 137](/book/exit-codes#137)。 + 如果 `chain` 无效,该方法会抛出错误[退出代码 136](/zh-cn/book/exit-codes#136);如果 `chain` 指向主链 ($-1$) 且未启用[主链支持](/zh-cn/book/masterchain),该方法会抛出错误[退出代码 137](/zh-cn/book/exit-codes#137)。 ::: @@ -143,17 +143,17 @@ let oldTonFoundationAddr: Address = [TON文档中的`chain`(工作链ID)](https://docs.ton.org/learn/overviews/addresses#workchain-id)\ [TON文档中的`hash`(账户ID)](https://docs.ton.org/learn/overviews/addresses#account-id)\ - [合约的初始包(`StateInit{:tact}`)](/book/expressions#initof) + [合约的初始包(`StateInit{:tact}`)](/zh-cn/book/expressions#initof) ::: -### 合同地址 +### contractAddress ```tact fun contractAddress(s: StateInit):地址; ``` -根据智能合约的 [`StateInit{:tact}`](/book/expressions#initof),计算智能合约在工作链 $0$ 中的 [`地址{:tact}`][p]。 +根据智能合约的 [`StateInit{:tact}`](/zh-cn/book/expressions#initof),计算智能合约在工作链 $0$ 中的 [`地址{:tact}`][p]。 使用示例 @@ -161,13 +161,13 @@ fun contractAddress(s: StateInit):地址; 让 foundMeSome:Address = contractAddress(initOf SomeContract()); ``` -### 合同地址扩展 +### contractAddressExt ```tact fun contractAddressExt(chain: Int, code: Cell, data: Cell):地址; ``` -根据 "链 "id、合约 "代码 "和合约初始状态 "数据 "计算智能合约的[`地址{:tact}`][p]。 使用 [`initOf{:tact}`](/book/expressions#initof)表达式获取给定合约的初始 `code` 和初始 `data` 。 +根据 "链 "id、合约 "代码 "和合约初始状态 "数据 "计算智能合约的[`地址{:tact}`][p]。 使用 [`initOf{:tact}`](/zh-cn/book/expressions#initof)表达式获取给定合约的初始 `code` 和初始 `data` 。 使用示例 @@ -178,26 +178,26 @@ let hereBeDragons:Address = contractAddressExt(0, initPkg.code, initPkg.data) :::caution - 如果 `chain` 无效,该方法会抛出错误[退出代码 136](/book/exit-codes#136);如果 `chain` 指向主链 ($-1$) 且未启用[主链支持](/book/masterchain),该方法会抛出错误[退出代码 137](/book/exit-codes#137)。 + 如果 `chain` 无效,该方法会抛出错误[退出代码 136](/zh-cn/book/exit-codes#136);如果 `chain` 指向主链 ($-1$) 且未启用[主链支持](/zh-cn/book/masterchain),该方法会抛出错误[退出代码 137](/zh-cn/book/exit-codes#137)。 ::: :::note - 要使用该功能,必须在 [configuration file](/book/config). - 中为当前项目将编译器选项 `debug` 设置为 `true{:tact}`:[调试](/book/debug)。 + 要使用该功能,必须在 [configuration file](/zh-cn/book/config). + 中为当前项目将编译器选项 `debug` 设置为 `true{:tact}`:[调试](/zh-cn/book/debug)。 ::: ## 交流 -### 发送 +### send ```tact fun send(params: SendParameters); ``` -使用 [`发送参数{:tact}`](/book/send)[结构](/book/structs-and-messages#structs)发送[队列信息](/book/send#outbound-message-processing)。 +使用 [`发送参数{:tact}`](/zh-cn/book/send)[结构](/zh-cn/book/structs-and-messages#structs)发送[队列信息](/zh-cn/book/send#outbound-message-processing)。 使用示例 @@ -211,19 +211,19 @@ send(SendParameters{ :::note[Useful links:] - [Sending messages in the Book](/book/send)/ - [Message`mode` in the Book](/book/message-mode)/ - [Single-contract communication in the Cookbook](/cookbook/single-communication) + [Sending messages in the Book](/zh-cn/book/send)/ + [Message`mode` in the Book](/zh-cn/book/message-mode)/ + [Single-contract communication in the Cookbook](/zh-cn/cookbook/single-communication) ::: -### 发出 +### emit ```tact fun emit(body: Cell); ``` -将[信息排队](/book/send#outbound-message-processing) `body` 发送到外部世界,以便在链外进行记录和分析。 该信息没有收件人,与使用 Tact 的其他信息发送功能相比更省油。 +将[信息排队](/zh-cn/book/send#outbound-message-processing) `body` 发送到外部世界,以便在链外进行记录和分析。 该信息没有收件人,与使用 Tact 的其他信息发送功能相比更省油。 使用示例 @@ -233,13 +233,13 @@ emit("Catch me if you can, Mr. Holmes".asComment()); // asComment() 将字符串 :::note - 要分析 `emit(){:tact}` 调用,必须查看合约产生的 [外部信息](/book/external)。 + 要分析 `emit(){:tact}` 调用,必须查看合约产生的 [外部信息](/zh-cn/book/external)。 - 了解更多信息:[通过 `emit(){:tact}`记录日志](/book/debug#logging)。 + 了解更多信息:[通过 `emit(){:tact}`记录日志](/zh-cn/book/debug#logging)。 ::: -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[一片]: /book/cells#slices +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[一片]: /zh-cn/book/cells#slices diff --git a/docs/src/content/docs/zh-cn/ref/core-comptime.mdx b/docs/src/content/docs/zh-cn/ref/core-comptime.mdx index ef491aa09..034738eff 100644 --- a/docs/src/content/docs/zh-cn/ref/core-comptime.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-comptime.mdx @@ -2,7 +2,7 @@ title: 编译时 --- -本页列出了所有内置 [全局静态函数](/book/functions#global-static-functions),这些函数在构建 Tact 项目时进行评估,无法处理非恒定的运行时数据。 这些函数通常被称为 "编译时函数"。 +本页列出了所有内置 [全局静态函数](/zh-cn/book/functions#global-static-functions),这些函数在构建 Tact 项目时进行评估,无法处理非恒定的运行时数据。 这些函数通常被称为 "编译时函数"。 ## 地址 @@ -53,7 +53,7 @@ contract Example { fun ton(value: String):Int; ``` -编译时函数,将给定的通币`值`从人类可读格式[`String{:tact}`][p]转换为[nanoToncoin](/book/integers#nanotoncoin)[`Int{:tact}`][int]格式。 +编译时函数,将给定的通币`值`从人类可读格式[`String{:tact}`][p]转换为[nanoToncoin](/zh-cn/book/integers#nanotoncoin)[`Int{:tact}`][int]格式。 使用示例 @@ -67,7 +67,7 @@ contract Example { } ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[电池]: /book/cells#cells +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[电池]: /zh-cn/book/cells#cells diff --git a/docs/src/content/docs/zh-cn/ref/core-debug.mdx b/docs/src/content/docs/zh-cn/ref/core-debug.mdx index 111c409c7..09e47d7ec 100644 --- a/docs/src/content/docs/zh-cn/ref/core-debug.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-debug.mdx @@ -6,17 +6,17 @@ Tact 中调试智能合约常用的函数列表。 :::note - 有关调试的更多信息,请访问专用页面:[调试](/book/debug)。 + 有关调试的更多信息,请访问专用页面:[调试](/zh-cn/book/debug)。 ::: -## 要求 +## require ```tact fun require(condition: Bool, error: String); ``` -检查 `condition` 并抛出错误,如果 `condition` 为 `false{:tact}`,则从 `error` 消息中生成 [exit code](/book/exit-codes)。 除此之外,别无其他作用。 +检查 `condition` 并抛出错误,如果 `condition` 为 `false{:tact}`,则从 `error` 消息中生成 [exit code](/zh-cn/book/exit-codes)。 除此之外,别无其他作用。 生成退出代码的算法如下: @@ -24,7 +24,7 @@ fun require(condition: Bool, error: String); - 然后,按此顺序将其值读作一个 32 位 [big-endian](https://en.wikipedia.org/wiki/Endianness) 数字 modulo $63000$ 加 $1000$。 - 最后,它将被放入 `.md` 编译报告文件,该文件与其他编译工件一起存放在项目的 `outputs/` 或 `build/` 目录中。 -保证生成的退出代码不在为 TVM 和 Tact 合同错误保留的常用 $0 - 255$ 范围内,这样就可以将退出代码与 `require(){:tact}` 和任何其他 [标准退出代码](/book/exit-codes) 区分开来。 +保证生成的退出代码不在为 TVM 和 Tact 合同错误保留的常用 $0 - 255$ 范围内,这样就可以将退出代码与 `require(){:tact}` 和任何其他 [标准退出代码](/zh-cn/book/exit-codes) 区分开来。 使用示例 @@ -41,13 +41,13 @@ try { } ``` -## 转储 +## dump ```tact fun dump(arg); ``` -将参数 `arg` 打印到合约的调试控制台。 仅当[配置文件](/book/config) 中的 "debug "选项设置为 `true{:json}`时才进行评估,否则不执行任何操作。 +将参数 `arg` 打印到合约的调试控制台。 仅当[配置文件](/zh-cn/book/config) 中的 "debug "选项设置为 `true{:json}`时才进行评估,否则不执行任何操作。 可应用于下列类型和值: @@ -56,8 +56,8 @@ fun dump(arg); - [`地址{:tact}`][p] - [`单元格{:tact}`][单元格]、[`构建器{:tact}`][构建器]或[`切片{:tact}`][切片] - [`String{:tact}`][p] 或 [`StringBuilder{:tact}`][p] -- [`map{:tact}`](/book/maps) -- [选项和 `null{:tact}` 值](/book/optionals) +- [`map{:tact}`](/zh-cn/book/maps) +- [选项和 `null{:tact}` 值](/zh-cn/book/optionals) - void",当函数没有定义返回值时隐式返回 使用示例 @@ -94,7 +94,7 @@ dump(emit("msg".asComment())); // 由于 emit() 函数不返回值,dump() 将 :::note[Useful links:] - [使用 `dump(){:tact}` 调试](/book/debug#tests-dump) + [使用 `dump(){:tact}` 调试](/zh-cn/book/debug#tests-dump) ::: @@ -104,7 +104,7 @@ dump(emit("msg".asComment())); // 由于 emit() 函数不返回值,dump() 将 fun dumpStack(); ``` -将 [持久状态变量](/book/contracts#variables)的所有值打印到合约的调试控制台。 仅当[配置文件](/book/config) 中的 "debug "选项设置为 `true{:json}`时才进行评估,否则不执行任何操作。 +将 [持久状态变量](/zh-cn/book/contracts#variables)的所有值打印到合约的调试控制台。 仅当[配置文件](/zh-cn/book/config) 中的 "debug "选项设置为 `true{:json}`时才进行评估,否则不执行任何操作。 使用示例 @@ -121,11 +121,11 @@ contract DumpsterFire { :::note[Useful links:] - [使用 `dump(){:tact}` 调试](/book/debug#tests-dump) + [使用 `dump(){:tact}` 调试](/zh-cn/book/debug#tests-dump) ::: -## 丢 +## throw ```tact fun throw(code: Int); @@ -133,15 +133,15 @@ fun throw(code: Int); 是 [`nativeThrow(){:tact}`](#nativethrow)的别名。 -## nativethrow +## nativeThrow ```tact fun nativeThrow(code: Int); ``` -抛出错误代码等于 `code` 的异常。 当前上下文的执行将停止("nativeThrow "后的语句将不会执行),控制权将传递给调用栈中的第一个[`try...catch{:tact}`块](/book/statements#try-catch)。 如果调用者函数中不存在 `try{:tact}`或 `try...catch{:tact}`块,[TVM](https://docs.ton.org/learn/tvm-instructions/tvm-overview)将终止事务。 +抛出错误代码等于 `code` 的异常。 当前上下文的执行将停止("nativeThrow "后的语句将不会执行),控制权将传递给调用栈中的第一个[`try...catch{:tact}`块](/zh-cn/book/statements#try-catch)。 如果调用者函数中不存在 `try{:tact}`或 `try...catch{:tact}`块,[TVM](https://docs.ton.org/learn/tvm-instructions/tvm-overview)将终止事务。 -试图在 $0 - 65535$ 范围之外指定 `code` 时,会出现 [exit code 5](/book/exit-codes#5)异常:整数超出预期范围"。 +试图在 $0 - 65535$ 范围之外指定 `code` 时,会出现 [exit code 5](/zh-cn/book/exit-codes#5)异常:整数超出预期范围"。 使用示例 @@ -159,7 +159,7 @@ fun butThisDoesNot() { } ``` -## 原生抛出条件 +## nativeThrowIf ```tact fun nativeThrowIf(code: Int, condition: Bool); @@ -167,7 +167,7 @@ fun nativeThrowIf(code: Int, condition: Bool); 类似于 [`nativeThrow(){:tact}`](#nativethrow),但会在 `condition` 等于 `true{:tact}` 时有条件地抛出异常。 否则不会扔。 -试图在 $0 - 65535$ 范围之外指定 `code` 时,会出现 [exit code 5](/book/exit-codes#5) 异常:整数超出预期范围"。 +试图在 $0 - 65535$ 范围之外指定 `code` 时,会出现 [exit code 5](/zh-cn/book/exit-codes#5) 异常:整数超出预期范围"。 使用示例 @@ -184,7 +184,7 @@ fun butThisDoesNot() { } ``` -## 本机无投掷 +## nativeThrowUnless ```tact fun nativeThrowUnless(code: Int, condition: Bool); @@ -192,7 +192,7 @@ fun nativeThrowUnless(code: Int, condition: Bool); 类似于 [`nativeThrow(){:tact}`](#nativethrow),但会在 `condition` 等于 `false{:tact}` 时有条件地抛出异常。 否则不会扔。 -试图在 $0 - 65535$ 范围之外指定 `code` 时,会出现 [exit code 5](/book/exit-codes#5) 异常:整数超出预期范围"。 +试图在 $0 - 65535$ 范围之外指定 `code` 时,会出现 [exit code 5](/zh-cn/book/exit-codes#5) 异常:整数超出预期范围"。 使用示例 @@ -209,9 +209,9 @@ fun butThisDoesNot() { } ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[电池]: /book/cells#cells -[建筑工人]: /book/cells#builders -[一片]: /book/cells#slices +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[电池]: /zh-cn/book/cells#cells +[建筑工人]: /zh-cn/book/cells#builders +[一片]: /zh-cn/book/cells#slices diff --git a/docs/src/content/docs/zh-cn/ref/core-math.mdx b/docs/src/content/docs/zh-cn/ref/core-math.mdx index 4cb2aeffe..c2d5d5a49 100644 --- a/docs/src/content/docs/zh-cn/ref/core-math.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-math.mdx @@ -4,7 +4,7 @@ title: 数学 各种数学辅助功能 -## 分钟 +## min ```tact fun min(x: Int, y: Int):Int; @@ -23,7 +23,7 @@ min(0x45, 3_0_0); // 69, nice // 69 300 ``` -## 最大 +## max ```tact fun max(x: Int, y: Int):Int; @@ -42,7 +42,7 @@ max(0x45, 3_0_0); // 300 // 69 300 ``` -## 腹肌 +## abs ```tact fun abs(x: Int):Int @@ -64,7 +64,7 @@ abs(-(-(-42))); // 42 fun log(num: Int, base: Int):Int; ``` -计算并返回数字 `num` $> 0$ 以 `base` $≥1$ 为底的 [logarithm](https://en.wikipedia.org/wiki/Logarithm) 值。 结果[四舍五入](https://en.wikipedia.org/wiki/Rounding#Rounding_down)。 传入一个非正数`num`值或`base`小于 $1$ 会产生错误[退出代码 5](/book/exit-codes#5):整数超出预期范围"。 +计算并返回数字 `num` $> 0$ 以 `base` $≥1$ 为底的 [logarithm](https://en.wikipedia.org/wiki/Logarithm) 值。 结果[四舍五入](https://en.wikipedia.org/wiki/Rounding#Rounding_down)。 传入一个非正数`num`值或`base`小于 $1$ 会产生错误[退出代码 5](/zh-cn/book/exit-codes#5):整数超出预期范围"。 使用示例 @@ -118,7 +118,7 @@ log2(1024); // 10,因为 2^10 是 1024 fun pow(base: Int, exp: Int):Int; ``` -计算并返回涉及两个数的 [幂级数](https://en.wikipedia.org/wiki/Exponentiation):"基数 "和指数(或_幂_)"exp"。 指数 `exp` 必须是非负数,否则将产生[退出代码 5](/book/exit-codes#5)错误:`整数超出预期范围`。 +计算并返回涉及两个数的 [幂级数](https://en.wikipedia.org/wiki/Exponentiation):"基数 "和指数(或_幂_)"exp"。 指数 `exp` 必须是非负数,否则将产生[退出代码 5](/zh-cn/book/exit-codes#5)错误:`整数超出预期范围`。 请注意,该函数在运行时和[编译时](/ref/core-comptime)均有效。 @@ -147,7 +147,7 @@ contract Example { :::note - 仅在编译时有效的函数列表:[API 编译时间](/ref/core-comptime)。 + 仅在编译时有效的函数列表:[API 编译时间](/zh-cn/ref/core-comptime)。 ::: @@ -184,11 +184,11 @@ contract Example { :::note - 仅在编译时有效的函数列表:[API 编译时间](/ref/core-comptime)。 + 仅在编译时有效的函数列表:[API 编译时间](/zh-cn/ref/core-comptime)。 ::: -## checksignature +## checkSignature ```tact fun checkSignature(hash: Int, signature: Slice, public_key: Int):Bool; @@ -229,13 +229,13 @@ contract Showcase { } ``` -## 检查数据签名 +## checkDataSignature ```tact fun checkDataSignature(data: Slice, signature: Slice, public_key: Int):Bool; ``` -使用 "公钥 "检查 "数据 "的[Ed25519][ed]"签名",类似于[`checkSignature(){:tact}`](#checksignature)。 如果 `data` 的位长不能被 $8$整除,该函数将产生错误[退出代码 9](/book/exit-codes#9):单元格下溢。 验证本身是间接进行的:根据 "数据 "的[SHA-256][sha-2] 哈希值进行验证。 +使用 "公钥 "检查 "数据 "的[Ed25519][ed]"签名",类似于[`checkSignature(){:tact}`](#checksignature)。 如果 `data` 的位长不能被 $8$整除,该函数将产生错误[退出代码 9](/zh-cn/book/exit-codes#9):单元格下溢。 验证本身是间接进行的:根据 "数据 "的[SHA-256][sha-2] 哈希值进行验证。 如果签名有效,则返回 `true{:tact}`,否则返回 `false{:tact}`。 @@ -260,7 +260,7 @@ fun sha256(data: String):Int; 如果 `data` 是一个 [`字符串{:tact}`][p],它的位数应能被 $8$除,如果它是一个 [`片{:tact}`][片],它也必须\*\*\*没有引用(即总共最多只有 1023 位数据)。 -该函数尽可能在 [编译时](/ref/core-comptime) 解析常量字符串值。 +该函数尽可能在 [编译时](/zh-cn/ref/core-comptime) 解析常量字符串值。 使用示例 @@ -271,9 +271,9 @@ sha256(someVariableElsewhere); // 将尝试在编译时解析, // 并回退到运行时评估 ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[一片]: /book/cells#slices +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[一片]: /zh-cn/book/cells#slices [编辑]: https://en.wikipedia.org/wiki/EdDSA#Ed25519 [屏蔽-2]: https://en.wikipedia.org/wiki/SHA-2#Hash_standard diff --git a/docs/src/content/docs/zh-cn/ref/core-random.mdx b/docs/src/content/docs/zh-cn/ref/core-random.mdx index d92359473..af4aaf131 100644 --- a/docs/src/content/docs/zh-cn/ref/core-random.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-random.mdx @@ -4,7 +4,7 @@ title: 随机数生成 为 Tact 智能合约生成随机数。 -## 随机的 +## random ```tact fun random(min: Int, max: Int):Int; @@ -19,7 +19,7 @@ random(42, 43); // 42, always random(0, 42); // 0-41, but never a 42 ``` -## 随机常数 +## randomInt ```tact fun randomInt():Int; @@ -37,8 +37,8 @@ let allYourRandomBelongsToUs:Int = randomInt(); // ????, it's random :) :::caution - 用于处理随机数的高级函数列在一个专门页面上:[高级应用程序接口](/ref/core-advanced)。 + 用于处理随机数的高级函数列在一个专门页面上:[高级应用程序接口](/zh-cn/ref/core-advanced)。 ::: -[int]: /book/integers +[int]: /zh-cn/book/integers diff --git a/docs/src/content/docs/zh-cn/ref/core-strings.mdx b/docs/src/content/docs/zh-cn/ref/core-strings.mdx index 15baa333a..a05044d91 100644 --- a/docs/src/content/docs/zh-cn/ref/core-strings.mdx +++ b/docs/src/content/docs/zh-cn/ref/core-strings.mdx @@ -6,7 +6,7 @@ title: 字符串和字符串构造器 要以省 gas 的方式连接字符串,请使用 [`字符串生成器{:tact}`][p]。 -要直接使用 [`字符串{:tact}`][p]字面量,请参阅:[字符串字面量](/book/expressions#string-literals)。 +要直接使用 [`字符串{:tact}`][p]字面量,请参阅:[字符串字面量](/zh-cn/book/expressions#string-literals)。 ## beginString @@ -144,7 +144,7 @@ extends fun toSlice(self: StringBuilder):Slice; [`字符串生成器{:tact}`][p]的扩展函数。 -从 [`StringBuilder{:tact}`][p]返回一个组装好的 [`单元格{:tact}`][单元格] 作为 [`片{:tact}`][片]。 别名为 [`self.toCell().asSlice(){:tact}`](/ref/core-cells#cellasslice)。 +从 [`StringBuilder{:tact}`][p]返回一个组装好的 [`单元格{:tact}`][单元格] 作为 [`片{:tact}`][片]。 别名为 [`self.toCell().asSlice(){:tact}`](/zh-cn/ref/core-cells#cellasslice)。 使用示例 @@ -180,7 +180,7 @@ fizz == buzz; // true, 但要小心,因为并非总是如此。 :::note - 查看 `String.asSlice{:tact}` 函数如何实际使用:[如何将 `String` 转换为 `Int`](/cookbook/type-conversion#how-to-convert-a-string-to-an-int). + 查看 `String.asSlice{:tact}` 函数如何实际使用:[如何将 `String` 转换为 `Int`](/zh-cn/cookbook/type-conversion#how-to-convert-a-string-to-an-int). ::: @@ -219,7 +219,7 @@ extends fun fromBase64(self: String):Slice; 请注意,该函数是有限制的,只能从给定的 [`字符串{:tact}`][p] 中获取前 $1023$ 位数据,当 [`字符串{:tact}`][p] 较大(即包含超过 $1023$ 位数据)时,不会抛出异常。 -如果给定的 [`String{:tact}`][p] 包含不属于 Base64 集的字符,则会出现[退出代码 134](/book/exit-codes#134)异常:"无效参数"。 +如果给定的 [`String{:tact}`][p] 包含不属于 Base64 集的字符,则会出现[退出代码 134](/zh-cn/book/exit-codes#134)异常:"无效参数"。 使用示例 @@ -265,7 +265,7 @@ extends fun fromBase64(self: Slice):Slice; 请注意,该函数是有限制的,只能从给定的 [`片{:tact}`][片] 中获取前 $1023$ 位数据,如果 [`片{:tact}`][片] 有更多数据(即有任何引用),则不会抛出异常。 -如果给定的 [`Slice{:tact}`][p]包含不属于 Base64 集的字符,将产生[退出代码 134](/book/exit-codes#134)异常:"无效参数"。 +如果给定的 [`Slice{:tact}`][p]包含不属于 Base64 集的字符,将产生[退出代码 134](/zh-cn/book/exit-codes#134)异常:"无效参数"。 使用示例 @@ -300,7 +300,7 @@ extends fun toFloatString(self: Int, digits: Int):String; 使用小数的[定点表示](https://en.wikipedia.org/wiki/Fixed-point_arithmetic)从[`Int{:tact}`][int]值返回[`String{:tact}`][p],其中`self`是数字的有效部分,`digits`是小数部分的位数。 -更确切地说,"digits "是 $10^{-\mathrm{digits}}$ 表达式的指数化参数,它给出了实际 [`Int{:tact}`][int]值乘以后所代表的小数。 参数 `digits` 必须在封闭区间内:$0 <$ `digits` $< 78$,否则会出现 [exit code 134](/book/exit-codes#134)异常:"无效参数"。 +更确切地说,"digits "是 $10^{-\mathrm{digits}}$ 表达式的指数化参数,它给出了实际 [`Int{:tact}`][int]值乘以后所代表的小数。 参数 `digits` 必须在封闭区间内:$0 <$ `digits` $< 78$,否则会出现 [exit code 134](/zh-cn/book/exit-codes#134)异常:"无效参数"。 使用示例 @@ -318,7 +318,7 @@ extends fun toCoinsString(self: Int):String; 使用小数的[定点表示法](https://en.wikipedia.org/wiki/Fixed-point_arithmetic)从[`Int{:tact}`][int]值返回[`String{:tact}`][p]。 别名为 `self.toFloatString(9){:tact}`。 -用于用字符串表示 [纳米通币](/book/integers#nanotoncoin) [`Int{:tact}`][int]值。 +用于用字符串表示 [纳米通币](/zh-cn/book/integers#nanotoncoin) [`Int{:tact}`][int]值。 使用示例 @@ -347,8 +347,8 @@ extends fun toString(self: Address):String; let fizz:String = community.toString(); ``` -[p]: /book/types#primitive-types -[bool]: /book/types#booleans -[int]: /book/integers -[电池]: /book/cells#cells -[一片]: /book/cells#slices +[p]: /zh-cn/book/types#primitive-types +[bool]: /zh-cn/book/types#booleans +[int]: /zh-cn/book/integers +[电池]: /zh-cn/book/cells#cells +[一片]: /zh-cn/book/cells#slices diff --git a/docs/src/content/docs/zh-cn/ref/index.mdx b/docs/src/content/docs/zh-cn/ref/index.mdx index d3379ca18..684f98dfe 100644 --- a/docs/src/content/docs/zh-cn/ref/index.mdx +++ b/docs/src/content/docs/zh-cn/ref/index.mdx @@ -12,7 +12,7 @@ import { LinkCard, CardGrid, Steps } from '@astrojs/starlight/components'; 1. #### 核心图书馆 - [核心库](/ref/core-base)提供了自动包含的函数、特质和其他结构体的完整列表及其使用示例。 + [核心库](/zh-cn/ref/core-base)提供了自动包含的函数、特质和其他结构体的完整列表及其使用示例。 Date: Wed, 18 Dec 2024 16:33:47 +0400 Subject: [PATCH 08/29] refactor: typed errors (#1210) * refactor: split parser errors * refactor: improve error messages and update snapshots --- knip.json | 2 + src/error/display-to-json.ts | 67 ++++++++ src/error/display-to-string.ts | 24 +++ src/error/display.ts | 19 +++ src/errors.ts | 45 +----- .../__snapshots__/grammar.spec.ts.snap | 152 +++++++++--------- src/grammar/checkConstAttributes.ts | 32 ---- src/grammar/checkFunctionAttributes.ts | 35 ---- src/grammar/checkVariableName.ts | 11 -- src/grammar/grammar.ts | 99 ++++++++---- src/grammar/parser-error.ts | 73 +++++++++ src/grammar/src-info.ts | 9 ++ src/index.ts | 2 - src/interpreter.ts | 4 +- 14 files changed, 340 insertions(+), 234 deletions(-) create mode 100644 src/error/display-to-json.ts create mode 100644 src/error/display-to-string.ts create mode 100644 src/error/display.ts delete mode 100644 src/grammar/checkConstAttributes.ts delete mode 100644 src/grammar/checkFunctionAttributes.ts delete mode 100644 src/grammar/checkVariableName.ts create mode 100644 src/grammar/parser-error.ts diff --git a/knip.json b/knip.json index b6828108d..99d24972e 100644 --- a/knip.json +++ b/knip.json @@ -5,6 +5,8 @@ "ignore": [ "src/grammar/ast.ts", "src/prettyPrinter.ts", + "src/error/display-to-json.ts", + "src/grammar/src-info.ts", ".github/workflows/tact*.yml" ], "ignoreDependencies": ["@tact-lang/ton-abi"] diff --git a/src/error/display-to-json.ts b/src/error/display-to-json.ts new file mode 100644 index 000000000..6c7e55daa --- /dev/null +++ b/src/error/display-to-json.ts @@ -0,0 +1,67 @@ +/** + * Render error message to JSON for tests + */ + +import { throwInternalCompilerError } from "../errors"; +import { SrcInfo } from "../grammar"; +import { srcInfoEqual } from "../grammar/src-info"; +import { ErrorDisplay } from "./display"; + +export type ErrorJson = ErrorSub | ErrorText | ErrorLink | ErrorAt; + +export type ErrorText = { kind: "text"; text: string }; +export type ErrorSub = { kind: "sub"; parts: string[]; subst: ErrorJson[] }; +export type ErrorLink = { kind: "link"; text: string; loc: SrcInfo }; +export type ErrorAt = { kind: "at"; body: ErrorJson; loc: SrcInfo }; + +export const errorJsonEqual = (left: ErrorJson, right: ErrorJson): boolean => { + switch (left.kind) { + case "link": { + return ( + left.kind === right.kind && + left.text === right.text && + srcInfoEqual(left.loc, right.loc) + ); + } + case "at": { + return ( + left.kind === right.kind && + errorJsonEqual(left.body, right.body) && + srcInfoEqual(left.loc, right.loc) + ); + } + case "text": { + return left.kind === right.kind && left.text === right.text; + } + case "sub": { + if (left.kind !== right.kind) { + return false; + } + if (left.parts.length !== right.parts.length) { + return false; + } + if (left.parts.some((part, index) => part != right.parts[index])) { + return false; + } + if (left.subst.length !== right.subst.length) { + return false; + } + return left.subst.every((leftChild, index) => { + const rightChild = right.subst[index]; + if (typeof rightChild === "undefined") { + throwInternalCompilerError( + "Impossible: by this moment array lengths must match", + ); + } + return errorJsonEqual(leftChild, rightChild); + }); + } + } +}; + +export const displayToJson: ErrorDisplay = { + text: (text) => ({ kind: "text", text }), + sub: (parts, ...subst) => ({ kind: "sub", parts: [...parts], subst }), + link: (text, loc) => ({ kind: "link", text, loc }), + at: (loc, body) => ({ kind: "at", body, loc }), +}; diff --git a/src/error/display-to-string.ts b/src/error/display-to-string.ts new file mode 100644 index 000000000..e93d1a06a --- /dev/null +++ b/src/error/display-to-string.ts @@ -0,0 +1,24 @@ +/** + * Render error message to string for compiler CLI + */ + +import { ErrorDisplay } from "./display"; +import { locationStr } from "../errors"; + +export const displayToString: ErrorDisplay = { + text: (text) => text, + sub: (parts, ...subst) => { + const [head, ...tail] = parts; + if (!head) { + return ""; + } + return tail.reduce((acc, part, index) => { + const sub = subst[index]; + return acc + sub + part; + }, head); + }, + link: (text, _loc) => text, + at: (loc, body) => { + return `${locationStr(loc)}${body}\n${loc.interval.getLineAndColumnMessage()}`; + }, +}; diff --git a/src/error/display.ts b/src/error/display.ts new file mode 100644 index 000000000..6f7cbf473 --- /dev/null +++ b/src/error/display.ts @@ -0,0 +1,19 @@ +/** + * Describes DSL for displaying errors + */ + +import { SrcInfo } from "../grammar"; + +export interface ErrorDisplay { + // Specify main error location + at: (loc: SrcInfo, body: T) => T; + + // Regular string + text: (text: string) => T; + + // Text with substitutions + sub: (text: TemplateStringsArray, ...subst: T[]) => T; + + // Reference some code location + link: (text: string, loc: SrcInfo) => T; +} diff --git a/src/errors.ts b/src/errors.ts index 3bceaeffa..0b2cac041 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,9 +1,7 @@ -import { MatchResult } from "ohm-js"; import path from "path"; import { cwd } from "process"; import { AstFuncId, AstId, AstTypeId } from "./grammar/ast"; -import { ItemOrigin, SrcInfo } from "./grammar"; -import { getSrcInfoFromOhm } from "./grammar/src-info"; +import { SrcInfo } from "./grammar"; export class TactError extends Error { readonly loc?: SrcInfo; @@ -13,19 +11,8 @@ export class TactError extends Error { } } -export class TactParseError extends TactError { - constructor(message: string, loc: SrcInfo) { - super(message, loc); - } -} - -export class TactSyntaxError extends TactError { - constructor(message: string, loc: SrcInfo) { - super(message, loc); - } -} - -/// This will be split at least into two categories: typechecking and codegen errors +// Any regular compilation error shown to user: +// parsing, typechecking, code generation export class TactCompilationError extends TactError { constructor(message: string, loc?: SrcInfo) { super(message, loc); @@ -46,7 +33,7 @@ export class TactConstEvalError extends TactCompilationError { } } -function locationStr(sourceInfo: SrcInfo): string { +export function locationStr(sourceInfo: SrcInfo): string { if (sourceInfo.file) { const loc = sourceInfo.interval.getLineAndColumn() as { lineNum: number; @@ -59,28 +46,6 @@ function locationStr(sourceInfo: SrcInfo): string { } } -export function throwParseError( - matchResult: MatchResult, - path: string, - origin: ItemOrigin, -): never { - const interval = matchResult.getInterval(); - const source = getSrcInfoFromOhm(interval, path, origin); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const message = `Parse error: expected ${(matchResult as any).getExpectedText()}\n`; - throw new TactParseError( - `${locationStr(source)}${message}\n${interval.getLineAndColumnMessage()}`, - source, - ); -} - -export function throwSyntaxError(message: string, source: SrcInfo): never { - throw new TactSyntaxError( - `Syntax error: ${locationStr(source)}${message}\n${source.interval.getLineAndColumnMessage()}`, - source, - ); -} - export function throwCompilationError( message: string, source?: SrcInfo, @@ -128,8 +93,6 @@ export function idTextErr( export type TactErrorCollection = | Error - | TactParseError - | TactSyntaxError | TactCompilationError | TactInternalCompilerError | TactConstEvalError; diff --git a/src/grammar/__snapshots__/grammar.spec.ts.snap b/src/grammar/__snapshots__/grammar.spec.ts.snap index fe2cecf11..7a65aa252 100644 --- a/src/grammar/__snapshots__/grammar.spec.ts.snap +++ b/src/grammar/__snapshots__/grammar.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`grammar should fail abstract-const-without-modifier 1`] = ` -"Syntax error: :2:5: Abstract constant doesn't have abstract modifier +":2:5: Abstract constant doesn't have abstract modifier Line 2, col 5: 1 | trait t { > 2 | const c: Int; @@ -11,7 +11,7 @@ Line 2, col 5: `; exports[`grammar should fail const-abstract-abstract 1`] = ` -"Syntax error: :4:10: Duplicate constant attribute "abstract" +":4:10: Duplicate constant attribute "abstract" Line 4, col 10: 3 | > 4 | abstract abstract const Foo: Int = 42; @@ -21,7 +21,7 @@ Line 4, col 10: `; exports[`grammar should fail const-override 1`] = ` -"Syntax error: :4:1: Module-level constants do not support attributes +":4:1: Module-level constants do not support attributes Line 4, col 1: 3 | > 4 | override const Foo: Int = 42; @@ -31,7 +31,7 @@ Line 4, col 1: `; exports[`grammar should fail const-override-override 1`] = ` -"Syntax error: :4:10: Duplicate constant attribute "override" +":4:10: Duplicate constant attribute "override" Line 4, col 10: 3 | > 4 | override override const Foo: Int = 42; @@ -41,7 +41,7 @@ Line 4, col 10: `; exports[`grammar should fail const-override-virtual 1`] = ` -"Syntax error: :4:1: Module-level constants do not support attributes +":4:1: Module-level constants do not support attributes Line 4, col 1: 3 | > 4 | override virtual const Foo: Int = 42; @@ -51,7 +51,7 @@ Line 4, col 1: `; exports[`grammar should fail const-virtual 1`] = ` -"Syntax error: :4:1: Module-level constants do not support attributes +":4:1: Module-level constants do not support attributes Line 4, col 1: 3 | > 4 | virtual const Foo: Int = 42; @@ -61,7 +61,7 @@ Line 4, col 1: `; exports[`grammar should fail const-virtual-override 1`] = ` -"Syntax error: :4:1: Module-level constants do not support attributes +":4:1: Module-level constants do not support attributes Line 4, col 1: 3 | > 4 | virtual override const Foo: Int = 42; @@ -71,7 +71,7 @@ Line 4, col 1: `; exports[`grammar should fail const-virtual-virtual 1`] = ` -"Syntax error: :4:9: Duplicate constant attribute "virtual" +":4:9: Duplicate constant attribute "virtual" Line 4, col 9: 3 | > 4 | virtual virtual const Foo: Int = 42; @@ -81,7 +81,7 @@ Line 4, col 9: `; exports[`grammar should fail contract-const-abstract 1`] = ` -":5:26: Parse error: expected "=" +":5:26: Expected "=" Line 5, col 26: 4 | contract TestContract { @@ -92,7 +92,7 @@ Line 5, col 26: `; exports[`grammar should fail contract-const-abstract-abstract 1`] = ` -"Syntax error: :5:12: Duplicate constant attribute "abstract" +":5:12: Duplicate constant attribute "abstract" Line 5, col 12: 4 | contract TestContract { > 5 | abstract abstract const Foo: Int = 42; @@ -102,7 +102,7 @@ Line 5, col 12: `; exports[`grammar should fail contract-const-abstract-with-initializer 1`] = ` -"Syntax error: :5:3: Non-abstract constant has abstract modifier +":5:3: Non-abstract constant has abstract modifier Line 5, col 3: 4 | contract TestContract { > 5 | abstract const Foo: Int = 42; @@ -112,7 +112,7 @@ Line 5, col 3: `; exports[`grammar should fail contract-const-override-override 1`] = ` -"Syntax error: :5:12: Duplicate constant attribute "override" +":5:12: Duplicate constant attribute "override" Line 5, col 12: 4 | contract TestContract { > 5 | override override const Foo: Int = 42; @@ -122,7 +122,7 @@ Line 5, col 12: `; exports[`grammar should fail contract-const-virtual-virtual 1`] = ` -"Syntax error: :5:11: Duplicate constant attribute "virtual" +":5:11: Duplicate constant attribute "virtual" Line 5, col 11: 4 | contract TestContract { > 5 | virtual virtual const Foo: Int = 42; @@ -132,7 +132,7 @@ Line 5, col 11: `; exports[`grammar should fail contract-empty-traits-list-with-keyword 1`] = ` -":1:20: Parse error: expected "_", "A".."Z", or "a".."z" +":1:20: Expected "_", "A".."Z", or "a".."z" Line 1, col 20: > 1 | contract Name with {} @@ -142,7 +142,7 @@ Line 1, col 20: `; exports[`grammar should fail contract-getter-parens-no-method-id 1`] = ` -":2:9: Parse error: expected "\\"", "initOf", "null", "_", "A".."Z", "a".."z", "false", "true", "0", "1".."9", "0O", "0o", "0B", "0b", "0X", "0x", "(", "~", "!", "+", or "-" +":2:9: Expected "\\"", "initOf", "null", "_", "A".."Z", "a".."z", "false", "true", "0", "1".."9", "0O", "0o", "0B", "0b", "0X", "0x", "(", "~", "!", "+", or "-" Line 2, col 9: 1 | contract Test { @@ -153,7 +153,7 @@ Line 2, col 9: `; exports[`grammar should fail contract-init-trailing-comma-empty-params 1`] = ` -"Syntax error: :2:10: Empty parameter list should not have a dangling comma. +":2:10: Empty parameter list should not have a dangling comma Line 2, col 10: 1 | contract Name { > 2 | init(,) {} @@ -163,7 +163,7 @@ Line 2, col 10: `; exports[`grammar should fail contract-trailing-comma-empty-traits-list 1`] = ` -":1:19: Parse error: expected "_", "A".."Z", or "a".."z" +":1:19: Expected "_", "A".."Z", or "a".."z" Line 1, col 19: > 1 | contract Name with, {} @@ -173,7 +173,7 @@ Line 1, col 19: `; exports[`grammar should fail contract-with-imports 1`] = ` -":6:1: Parse error: expected end of input, "trait", "contract", "message", "struct", "const", "@name", "asm", "fun", or "primitive" +":6:1: Expected end of input, "trait", "contract", "message", "struct", "const", "@name", "asm", "fun", or "primitive" Line 6, col 1: 5 | // all imports must be at the very top of the file @@ -184,7 +184,7 @@ Line 6, col 1: `; exports[`grammar should fail destructuring-duplicate-source-id 1`] = ` -"Syntax error: :15:19: Duplicate destructuring field: 'a' +":15:19: Duplicate field destructuring: "a" Line 15, col 19: 14 | let s = S{ a: 1, b: 2, c: 3 }; > 15 | let S { a: x, a: y } = s; @@ -194,7 +194,7 @@ Line 15, col 19: `; exports[`grammar should fail expr-fun-call-trailing-comma-no-args 1`] = ` -"Syntax error: :6:14: Empty argument list should not have a dangling comma. +":6:14: Empty parameter list should not have a dangling comma Line 6, col 14: 5 | fun b(): Int { > 6 | return a(,); @@ -204,7 +204,7 @@ Line 6, col 14: `; exports[`grammar should fail expr-method-call-trailing-comma-no-args 1`] = ` -"Syntax error: :2:24: Empty argument list should not have a dangling comma. +":2:24: Empty parameter list should not have a dangling comma Line 2, col 24: 1 | fun another() { > 2 | return 42.toString(,); @@ -214,7 +214,7 @@ Line 2, col 24: `; exports[`grammar should fail funcid-native-fun-arith-operator 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(/) @@ -224,7 +224,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-assign-operator 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(^>>=) @@ -234,7 +234,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-bitwise-operator 1`] = ` -":1:8: Parse error: expected not (a whiteSpace or "(" or ")" or "[" or "]" or "," or "." or ";" or "~") or "\`" +":1:8: Expected not (a whiteSpace or "(" or ")" or "[" or "]" or "," or "." or ";" or "~") or "\`" Line 1, col 8: > 1 | @name(~) @@ -244,7 +244,7 @@ Line 1, col 8: `; exports[`grammar should fail funcid-native-fun-comma 1`] = ` -":1:19: Parse error: expected ")" +":1:19: Expected ")" Line 1, col 19: > 1 | @name(send_message,then_terminate) @@ -254,7 +254,7 @@ Line 1, col 19: `; exports[`grammar should fail funcid-native-fun-comparison-operator 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(<=>) @@ -264,7 +264,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-control-keyword 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(elseifnot) @@ -274,7 +274,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-delimiter 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name([) @@ -284,7 +284,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-directive 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(#include) @@ -294,7 +294,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-dot 1`] = ` -":1:10: Parse error: expected ")" +":1:10: Expected ")" Line 1, col 10: > 1 | @name(msg.sender) @@ -304,7 +304,7 @@ Line 1, col 10: `; exports[`grammar should fail funcid-native-fun-keyword 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(global) @@ -314,7 +314,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-multiline-comments 1`] = ` -":1:7: Parse error: expected not ("\\"" or "{-") +":1:7: Expected not ("\\"" or "{-") Line 1, col 7: > 1 | @name({-aaa-}) @@ -324,7 +324,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-number 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(123) @@ -334,7 +334,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-number-decimal 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(0) @@ -344,7 +344,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-number-hexadecimal 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(0x0) @@ -354,7 +354,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-number-hexadecimal-2 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(0xDEADBEEF) @@ -364,7 +364,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-number-neg-decimal 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(-1) @@ -374,7 +374,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-number-neg-hexadecimal 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(-0x0) @@ -384,7 +384,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-only-underscore 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(_) @@ -394,7 +394,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-parens 1`] = ` -":1:11: Parse error: expected ")" +":1:11: Expected ")" Line 1, col 11: > 1 | @name(take(first)Entry) @@ -404,7 +404,7 @@ Line 1, col 11: `; exports[`grammar should fail funcid-native-fun-semicolons 1`] = ` -":1:9: Parse error: expected ")" +":1:9: Expected ")" Line 1, col 9: > 1 | @name(pa;;in"\`aaa\`") @@ -414,7 +414,7 @@ Line 1, col 9: `; exports[`grammar should fail funcid-native-fun-space 1`] = ` -":1:11: Parse error: expected ")" +":1:11: Expected ")" Line 1, col 11: > 1 | @name(foo foo) @@ -424,7 +424,7 @@ Line 1, col 11: `; exports[`grammar should fail funcid-native-fun-square-brackets 1`] = ` -":1:11: Parse error: expected ")" +":1:11: Expected ")" Line 1, col 11: > 1 | @name(take[some]entry) @@ -434,7 +434,7 @@ Line 1, col 11: `; exports[`grammar should fail funcid-native-fun-string 1`] = ` -":1:7: Parse error: expected not ("\\"" or "{-") +":1:7: Expected not ("\\"" or "{-") Line 1, col 7: > 1 | @name("not_a_string) @@ -444,7 +444,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-type-keyword 1`] = ` -":1:7: Parse error: expected not a funcInvalidId or "\`" +":1:7: Expected not a funcInvalidId or "\`" Line 1, col 7: > 1 | @name(->) @@ -454,7 +454,7 @@ Line 1, col 7: `; exports[`grammar should fail funcid-native-fun-unclosed-parens 1`] = ` -":1:9: Parse error: expected ")" +":1:9: Expected ")" Line 1, col 9: > 1 | @name(aa(bb) @@ -464,7 +464,7 @@ Line 1, col 9: `; exports[`grammar should fail ident-cannot-be-if-reserved-word 1`] = ` -":2:9: Parse error: expected "A".."Z" or not a reservedWord +":2:9: Expected "A".."Z" or not a reservedWord Line 2, col 9: 1 | fun hello(): Int { @@ -542,7 +542,7 @@ Line 2, col 9: `; exports[`grammar should fail ident-struct-cannot-start-with-__gen 1`] = ` -":1:8: Parse error: expected "A".."Z" +":1:8: Expected "A".."Z" Line 1, col 8: > 1 | struct __genA { @@ -552,7 +552,7 @@ Line 1, col 8: `; exports[`grammar should fail item-fun-non-void-trailing-comma-no-params 1`] = ` -"Syntax error: :1:14: Empty parameter list should not have a dangling comma. +":1:14: Empty parameter list should not have a dangling comma Line 1, col 14: > 1 | fun function(,) : Int { ^ @@ -561,7 +561,7 @@ Line 1, col 14: `; exports[`grammar should fail item-fun-void-trailing-comma-no-params 1`] = ` -"Syntax error: :1:14: Empty parameter list should not have a dangling comma. +":1:14: Empty parameter list should not have a dangling comma Line 1, col 14: > 1 | fun function(,) {} ^ @@ -570,7 +570,7 @@ Line 1, col 14: `; exports[`grammar should fail item-fun-without-body 1`] = ` -":1:20: Parse error: expected "{" +":1:20: Expected "{" Line 1, col 20: > 1 | fun testFunc(): Int; @@ -579,7 +579,7 @@ Line 1, col 20: `; exports[`grammar should fail item-native-fun-not-void-decl-trailing-comma-no-params 1`] = ` -"Syntax error: :2:31: Empty parameter list should not have a dangling comma. +":2:31: Empty parameter list should not have a dangling comma Line 2, col 31: 1 | @name(native_name_2) > 2 | native testNativeFuncWithType(,): Int; @@ -588,7 +588,7 @@ Line 2, col 31: `; exports[`grammar should fail item-native-fun-void-decl-trailing-comma-no-params 1`] = ` -"Syntax error: :2:23: Empty parameter list should not have a dangling comma. +":2:23: Empty parameter list should not have a dangling comma Line 2, col 23: 1 | @name(native_name_1) > 2 | native testNativeFunc(,); @@ -597,7 +597,7 @@ Line 2, col 23: `; exports[`grammar should fail items-asm-fun-1 1`] = ` -":1:5: Parse error: expected ")" +":1:5: Expected ")" Line 1, col 5: > 1 | asm(1 0) extends fun loadCoins(self: Slice): Int { @@ -607,7 +607,7 @@ Line 1, col 5: `; exports[`grammar should fail items-asm-fun-2 1`] = ` -":1:9: Parse error: expected ")", "->", "_", "A".."Z", or "a".."z" +":1:9: Expected ")", "->", "_", "A".."Z", or "a".."z" Line 1, col 9: > 1 | asm(c b 42) extends fun storeDict(b: Builder, c: Cell) { @@ -617,7 +617,7 @@ Line 1, col 9: `; exports[`grammar should fail items-asm-fun-3 1`] = ` -":1:14: Parse error: expected "0" or "1".."9" +":1:14: Expected "0" or "1".."9" Line 1, col 14: > 1 | asm(s len -> len 1 0) extends fun loadInt(self: Slice, len: Int): Int { @@ -627,7 +627,7 @@ Line 1, col 14: `; exports[`grammar should fail items-asm-fun-4 1`] = ` -":1:7: Parse error: expected "0" or "1".."9" +":1:7: Expected "0" or "1".."9" Line 1, col 7: > 1 | asm(->) extends fun loadInt(self: Slice, len: Int): Int { @@ -637,7 +637,7 @@ Line 1, col 7: `; exports[`grammar should fail items-asm-fun-5 1`] = ` -":3:5: Parse error: expected end of input, "trait", "contract", "message", "struct", "const", "@name", "asm", "fun", or "primitive" +":3:5: Expected end of input, "trait", "contract", "message", "struct", "const", "@name", "asm", "fun", or "primitive" Line 3, col 5: 2 | { INC } : } @@ -648,7 +648,7 @@ Line 3, col 5: `; exports[`grammar should fail items-asm-fun-6 1`] = ` -"Syntax error: :2:5: The binary bitstring has more than 128 digits +":2:5: Bitstring has more than 128 digits Line 2, col 5: 1 | asm fun giganticBinary() { > 2 | b{000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110} @@ -658,7 +658,7 @@ Line 2, col 5: `; exports[`grammar should fail literal-dec-trailing-underscore 1`] = ` -":2:16: Parse error: expected a digit +":2:16: Expected a digit Line 2, col 16: 1 | fun test_fun(): Int { @@ -669,7 +669,7 @@ Line 2, col 16: `; exports[`grammar should fail literal-double-underscore 1`] = ` -":2:20: Parse error: expected a digit +":2:20: Expected a digit Line 2, col 20: 1 | fun test_fun(): Int { @@ -680,7 +680,7 @@ Line 2, col 20: `; exports[`grammar should fail literal-hex-trailing-underscore 1`] = ` -":2:18: Parse error: expected a hexadecimal digit +":2:18: Expected a hexadecimal digit Line 2, col 18: 1 | fun test_fun(): Int { @@ -691,7 +691,7 @@ Line 2, col 18: `; exports[`grammar should fail literal-no-underscore-after-0b 1`] = ` -":2:14: Parse error: expected "1" or "0" +":2:14: Expected "1" or "0" Line 2, col 14: 1 | fun test_fun(): Int { @@ -702,7 +702,7 @@ Line 2, col 14: `; exports[`grammar should fail literal-no-underscores-if-leading-zero 1`] = ` -":2:15: Parse error: expected "}" or ";" +":2:15: Expected "}" or ";" Line 2, col 15: 1 | fun test_fun(): Int { @@ -713,7 +713,7 @@ Line 2, col 15: `; exports[`grammar should fail literal-non-binary-digits 1`] = ` -":2:15: Parse error: expected "}" or ";" +":2:15: Expected "}" or ";" Line 2, col 15: 1 | fun test_fun(): Int { @@ -724,7 +724,7 @@ Line 2, col 15: `; exports[`grammar should fail literal-underscore-after-leading-zero 1`] = ` -":2:13: Parse error: expected "}" or ";" +":2:13: Expected "}" or ";" Line 2, col 13: 1 | fun test_fun(): Int { @@ -735,7 +735,7 @@ Line 2, col 13: `; exports[`grammar should fail struct-double-semicolon 1`] = ` -":2:19: Parse error: expected "}" +":2:19: Expected "}" Line 2, col 19: 1 | // too many semicolons @@ -746,7 +746,7 @@ Line 2, col 19: `; exports[`grammar should fail struct-missing-semicolon-between-fields 1`] = ` -":2:19: Parse error: expected "}", ";", "=", "as", or "?" +":2:19: Expected "}", ";", "=", "as", or "?" Line 2, col 19: 1 | // missing ; between fields @@ -757,7 +757,7 @@ Line 2, col 19: `; exports[`grammar should fail struct-missing-semicolon-between-fields-with-initializer 1`] = ` -":2:24: Parse error: expected "}", ";", ".", "!!", "%", "/", "*", ">>", "<<", "-", "+", "==", "!=", "<=", "<", ">=", ">", "^", "&", "&&", "|", "?", or "||" +":2:24: Expected "}", ";", ".", "!!", "%", "/", "*", ">>", "<<", "-", "+", "==", "!=", "<=", "<", ">=", ">", "^", "&", "&&", "|", "?", or "||" Line 2, col 24: 1 | // missing ; between fields @@ -768,7 +768,7 @@ Line 2, col 24: `; exports[`grammar should fail trait-const-abstract-with-initializer 1`] = ` -"Syntax error: :5:3: Non-abstract constant has abstract modifier +":5:3: Non-abstract constant has abstract modifier Line 5, col 3: 4 | trait TestContract { > 5 | abstract const Foo: Int = 42; @@ -778,7 +778,7 @@ Line 5, col 3: `; exports[`grammar should fail trait-empty-traits-list-with-keyword 1`] = ` -":1:17: Parse error: expected "_", "A".."Z", or "a".."z" +":1:17: Expected "_", "A".."Z", or "a".."z" Line 1, col 17: > 1 | trait Name with {} @@ -788,7 +788,7 @@ Line 1, col 17: `; exports[`grammar should fail trait-fun-non-void-trailing-comma-no-params 1`] = ` -"Syntax error: :2:39: Empty parameter list should not have a dangling comma. +":2:39: Empty parameter list should not have a dangling comma Line 2, col 39: 1 | trait Test { > 2 | abstract fun testAbstractWithType(,): Int; @@ -798,7 +798,7 @@ Line 2, col 39: `; exports[`grammar should fail trait-fun-void-trailing-comma-no-params 1`] = ` -"Syntax error: :2:31: Empty parameter list should not have a dangling comma. +":2:31: Empty parameter list should not have a dangling comma Line 2, col 31: 1 | trait Test { > 2 | abstract fun testAbstract(,); @@ -808,7 +808,7 @@ Line 2, col 31: `; exports[`grammar should fail trait-trailing-comma-empty-traits-list 1`] = ` -":1:16: Parse error: expected "_", "A".."Z", or "a".."z" +":1:16: Expected "_", "A".."Z", or "a".."z" Line 1, col 16: > 1 | trait Name with, {} @@ -818,7 +818,7 @@ Line 1, col 16: `; exports[`grammar should fail type-ident-msg-should-be-capitalized 1`] = ` -":1:14: Parse error: expected "A".."Z" +":1:14: Expected "A".."Z" Line 1, col 14: > 1 | message(123) foo { @@ -828,7 +828,7 @@ Line 1, col 14: `; exports[`grammar should fail type-ident-struct-should-be-capitalized 1`] = ` -":1:8: Parse error: expected "A".."Z" +":1:8: Expected "A".."Z" Line 1, col 8: > 1 | struct lowercaseIdForType { diff --git a/src/grammar/checkConstAttributes.ts b/src/grammar/checkConstAttributes.ts deleted file mode 100644 index b7fdee28b..000000000 --- a/src/grammar/checkConstAttributes.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { AstConstantAttribute } from "./ast"; -import { throwSyntaxError } from "../errors"; -import { SrcInfo } from "./src-info"; - -export function checkConstAttributes( - isAbstract: boolean, - attributes: AstConstantAttribute[], - loc: SrcInfo, -) { - const k: Set = new Set(); - for (const a of attributes) { - if (k.has(a.type)) { - throwSyntaxError(`Duplicate constant attribute "${a.type}"`, a.loc); - } - k.add(a.type); - } - if (isAbstract) { - if (!k.has("abstract")) { - throwSyntaxError( - `Abstract constant doesn't have abstract modifier`, - loc, - ); - } - } else { - if (k.has("abstract")) { - throwSyntaxError( - `Non-abstract constant has abstract modifier`, - loc, - ); - } - } -} diff --git a/src/grammar/checkFunctionAttributes.ts b/src/grammar/checkFunctionAttributes.ts deleted file mode 100644 index 3b163fdfa..000000000 --- a/src/grammar/checkFunctionAttributes.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { AstFunctionAttribute } from "./ast"; -import { throwCompilationError } from "../errors"; -import { SrcInfo } from "./src-info"; - -export function checkFunctionAttributes( - isAbstract: boolean, - attrs: AstFunctionAttribute[], - loc: SrcInfo, -) { - const k: Set = new Set(); - for (const a of attrs) { - if (k.has(a.type)) { - throwCompilationError( - `Duplicate function attribute "${a.type}"`, - a.loc, - ); - } - k.add(a.type); - } - if (isAbstract) { - if (!k.has("abstract")) { - throwCompilationError( - `Abstract function doesn't have abstract modifier`, - loc, - ); - } - } else { - if (k.has("abstract")) { - throwCompilationError( - `Non abstract function have abstract modifier`, - loc, - ); - } - } -} diff --git a/src/grammar/checkVariableName.ts b/src/grammar/checkVariableName.ts deleted file mode 100644 index faef19733..000000000 --- a/src/grammar/checkVariableName.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { throwCompilationError } from "../errors"; -import { SrcInfo } from "./src-info"; - -export function checkVariableName(name: string, loc: SrcInfo) { - if (name.startsWith("__gen")) { - throwCompilationError(`Variable name cannot start with "__gen"`, loc); - } - if (name.startsWith("__tact")) { - throwCompilationError(`Variable name cannot start with "__tact"`, loc); - } -} diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index 09acefac8..29c65dfe4 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -18,22 +18,22 @@ import { AstId, FactoryAst, } from "./ast"; -import { throwParseError, throwSyntaxError } from "../errors"; -import { checkVariableName } from "./checkVariableName"; -import { checkFunctionAttributes } from "./checkFunctionAttributes"; -import { checkConstAttributes } from "./checkConstAttributes"; import { getSrcInfoFromOhm, ItemOrigin, SrcInfo } from "./src-info"; +import { parserErrorSchema, ParserErrors } from "./parser-error"; +import { displayToString } from "../error/display-to-string"; type Context = { origin: ItemOrigin | null; currentFile: string | null; createNode: FactoryAst["createNode"] | null; + errorTypes: ParserErrors | null; }; const defaultContext: Context = Object.freeze({ createNode: null, currentFile: null, origin: null, + errorTypes: null, }); let context: Context = defaultContext; @@ -63,6 +63,14 @@ const createNode: FactoryAst["createNode"] = (...args) => { return context.createNode(...args); }; +const err = () => { + if (context.errorTypes === null) { + throwInternalCompilerError("Parser context was not initialized"); + } + + return context.errorTypes; +}; + // helper to unwrap optional grammar elements (marked with "?") // ohm-js represents those essentially as lists (IterationNodes) function unwrapOptNode( @@ -73,6 +81,42 @@ function unwrapOptNode( return optNode !== undefined ? f(optNode) : null; } +function checkVariableName(name: string, loc: SrcInfo) { + if (name.startsWith("__gen")) { + err().reservedVarPrefix("__gen")(loc); + } + if (name.startsWith("__tact")) { + err().reservedVarPrefix("__tact")(loc); + } +} + +const checkAttributes = + (kind: "constant" | "function") => + ( + isAbstract: boolean, + attributes: (AstConstantAttribute | AstFunctionAttribute)[], + loc: SrcInfo, + ) => { + const { duplicate, tooAbstract, notAbstract } = err()[kind]; + const k: Set = new Set(); + for (const a of attributes) { + if (k.has(a.type)) { + duplicate(a.type)(a.loc); + } + k.add(a.type); + } + if (isAbstract && !k.has("abstract")) { + notAbstract()(loc); + } + if (!isAbstract && k.has("abstract")) { + tooAbstract()(loc); + } + }; + +const checkConstAttributes = checkAttributes("constant"); + +const checkFunctionAttributes = checkAttributes("function"); + const semantics = tactGrammar.createSemantics(); semantics.addOperation("astOfModule", { @@ -89,10 +133,7 @@ semantics.addOperation("astOfImport", { Import(_importKwd, path, _semicolon) { const pathAST = path.astOfExpression() as AstString; if (pathAST.value.includes("\\")) { - throwSyntaxError( - 'Import path can\'t contain "\\"', - createRef(path), - ); + err().importWithBackslash()(createRef(path)); } return createNode({ kind: "import", @@ -225,8 +266,7 @@ semantics.addOperation("astOfModuleItem", { ModuleConstant(constant) { const astConstDef: AstConstantDef = constant.astOfItem(); if (astConstDef.attributes.length !== 0) { - throwSyntaxError( - `Module-level constants do not support attributes`, + err().topLevelConstantWithAttribute()( astConstDef.attributes[0]!.loc, ); } @@ -540,20 +580,14 @@ semantics.addOperation("astOfAsmInstruction", { const length = digits.numChildren; const underscore = unwrapOptNode(optUnderscore, (t) => t.sourceString); if (length > 128) { - throwSyntaxError( - "The hex bitstring has more than 128 digits", - createRef(this), - ); + err().literalTooLong()(createRef(this)); } return `${prefix.sourceString}${digits.sourceString}${underscore ?? ""}}`; }, AsmInstruction_binLiteral(_prefix, digits, _rbrace, _ws) { const length = digits.numChildren; if (length > 128) { - throwSyntaxError( - "The binary bitstring has more than 128 digits", - createRef(this), - ); + err().literalTooLong()(createRef(this)); } return `b{${digits.sourceString}}`; }, @@ -655,10 +689,7 @@ semantics.addOperation("astsOfList", { params.source.contents === "" && optTrailingComma.sourceString === "," ) { - throwSyntaxError( - "Empty parameter list should not have a dangling comma.", - createRef(optTrailingComma), - ); + err().extraneousComma()(createRef(optTrailingComma)); } return params.asIteration().children.map((p) => p.astOfDeclaration()); }, @@ -667,10 +698,7 @@ semantics.addOperation("astsOfList", { args.source.contents === "" && optTrailingComma.sourceString === "," ) { - throwSyntaxError( - "Empty argument list should not have a dangling comma.", - createRef(optTrailingComma), - ); + err().extraneousComma()(createRef(optTrailingComma)); } return args.asIteration().children.map((arg) => arg.astOfExpression()); }, @@ -1008,8 +1036,7 @@ semantics.addOperation("astOfStatement", { .children.reduce((map, item) => { const destructItem = item.astOfExpression(); if (map.has(destructItem.field.text)) { - throwSyntaxError( - `Duplicate destructuring field: '${destructItem.field.text}'`, + err().duplicateField(destructItem.field.text)( destructItem.loc, ); } @@ -1427,10 +1454,7 @@ semantics.addOperation("astOfExpression", { structFields.source.contents === "" && optTrailingComma.sourceString === "," ) { - throwSyntaxError( - "Empty parameter list should not have a dangling comma.", - createRef(optTrailingComma), - ); + err().extraneousComma()(createRef(optTrailingComma)); } return createNode({ @@ -1470,17 +1494,20 @@ semantics.addOperation("astOfExpression", { }); export const getParser = (ast: FactoryAst) => { + const errorTypes = parserErrorSchema(displayToString); + function parse(src: string, path: string, origin: ItemOrigin): AstModule { return withContext( { currentFile: path, origin, createNode: ast.createNode, + errorTypes, }, () => { const matchResult = tactGrammar.match(src); if (matchResult.failed()) { - throwParseError(matchResult, path, origin); + errorTypes.generic(matchResult, path, origin); } return semantics(matchResult).astOfModule(); }, @@ -1493,11 +1520,12 @@ export const getParser = (ast: FactoryAst) => { currentFile: null, origin: "user", createNode: ast.createNode, + errorTypes, }, () => { const matchResult = tactGrammar.match(sourceCode, "Expression"); if (matchResult.failed()) { - throwParseError(matchResult, "", "user"); + errorTypes.generic(matchResult, "", "user"); } return semantics(matchResult).astOfExpression(); }, @@ -1514,11 +1542,12 @@ export const getParser = (ast: FactoryAst) => { currentFile: path, origin, createNode: ast.createNode, + errorTypes, }, () => { const matchResult = tactGrammar.match(src, "JustImports"); if (matchResult.failed()) { - throwParseError(matchResult, path, origin); + errorTypes.generic(matchResult, path, origin); } return semantics(matchResult).astOfJustImports(); }, diff --git a/src/grammar/parser-error.ts b/src/grammar/parser-error.ts new file mode 100644 index 000000000..3b258f1fb --- /dev/null +++ b/src/grammar/parser-error.ts @@ -0,0 +1,73 @@ +import { MatchResult } from "ohm-js"; +import { ErrorDisplay } from "../error/display"; +import { TactCompilationError } from "../errors"; +import { getSrcInfoFromOhm, ItemOrigin, SrcInfo } from "./src-info"; + +const attributeSchema = + (name: string) => + ({ text, sub }: ErrorDisplay, handle: (t: T) => U) => ({ + duplicate: (attr: string) => { + return handle( + sub`Duplicate ${text(name)} attribute "${text(attr)}"`, + ); + }, + notAbstract: () => { + return handle( + sub`Abstract ${text(name)} doesn't have abstract modifier`, + ); + }, + tooAbstract: () => { + return handle( + sub`Non-abstract ${text(name)} has abstract modifier`, + ); + }, + }); + +const syntaxErrorSchema = ( + display: ErrorDisplay, + handle: (t: T) => U, +) => { + const { sub, text } = display; + + return { + constant: attributeSchema("constant")(display, handle), + function: attributeSchema("function")(display, handle), + topLevelConstantWithAttribute: () => { + return handle( + sub`Module-level constants do not support attributes`, + ); + }, + literalTooLong: () => { + return handle(sub`Bitstring has more than 128 digits`); + }, + extraneousComma: () => { + return handle( + sub`Empty parameter list should not have a dangling comma`, + ); + }, + duplicateField: (name: string) => { + return handle(text(`Duplicate field destructuring: "${name}"`)); + }, + importWithBackslash: () => { + return handle(sub`Import path can't contain "\\"`); + }, + reservedVarPrefix: (prefix: string) => { + return handle(text(`Variable name cannot start with "${prefix}"`)); + }, + }; +}; + +export const parserErrorSchema = (display: ErrorDisplay) => ({ + ...syntaxErrorSchema(display, (message) => (source: SrcInfo) => { + throw new TactCompilationError(display.at(source, message), source); + }), + generic: (matchResult: MatchResult, path: string, origin: ItemOrigin) => { + const interval = matchResult.getInterval(); + const source = getSrcInfoFromOhm(interval, path, origin); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const message = `Expected ${(matchResult as any).getExpectedText()}\n`; + throw new TactCompilationError(display.at(source, message), source); + }, +}); + +export type ParserErrors = ReturnType; diff --git a/src/grammar/src-info.ts b/src/grammar/src-info.ts index 4ca54f771..8485c4e3c 100644 --- a/src/grammar/src-info.ts +++ b/src/grammar/src-info.ts @@ -46,6 +46,15 @@ export interface SrcInfo { toJSON: () => object; } +export const srcInfoEqual = (left: SrcInfo, right: SrcInfo): boolean => { + return ( + left.file === right.file && + left.interval.contents === right.interval.contents && + left.interval.startIdx === right.interval.startIdx && + left.interval.endIdx === right.interval.endIdx + ); +}; + const isEndline = (s: string) => s === "\n"; const repeat = (s: string, n: number): string => new Array(n + 1).join(s); diff --git a/src/index.ts b/src/index.ts index da47c4368..15ec85cf7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,8 +2,6 @@ export { enableFeatures, build } from "./pipeline/build"; export { precompile } from "./pipeline/precompile"; export { TactError, - TactParseError, - TactSyntaxError, TactCompilationError, TactInternalCompilerError, TactConstEvalError, diff --git a/src/interpreter.ts b/src/interpreter.ts index 66424fe2a..e81a1e1ab 100644 --- a/src/interpreter.ts +++ b/src/interpreter.ts @@ -4,8 +4,8 @@ import * as crc32 from "crc-32"; import { evalConstantExpression } from "./constEval"; import { CompilerContext } from "./context"; import { + TactCompilationError, TactConstEvalError, - TactParseError, idTextErr, throwConstEvalError, throwInternalCompilerError, @@ -614,7 +614,7 @@ export function parseAndEvalExpression( return { kind: "ok", value: constEvalResult }; } catch (error) { if ( - error instanceof TactParseError || + error instanceof TactCompilationError || error instanceof TactConstEvalError ) return { kind: "error", message: error.message }; From b3e88c2c73287b364df884df157909720482a39b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:00:08 +0400 Subject: [PATCH 09/29] chore(deps): bump astro (#1211) Bumps the npm_and_yarn group with 1 update in the /docs directory: [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro). Updates `astro` from 4.16.7 to 4.16.17 - [Release notes](https://github.com/withastro/astro/releases) - [Changelog](https://github.com/withastro/astro/blob/astro@4.16.17/packages/astro/CHANGELOG.md) - [Commits](https://github.com/withastro/astro/commits/astro@4.16.17/packages/astro) --- updated-dependencies: - dependency-name: astro dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package.json | 2 +- docs/yarn.lock | 392 ++++++++++++++++------------------------------ 2 files changed, 138 insertions(+), 256 deletions(-) diff --git a/docs/package.json b/docs/package.json index 91a438685..01148353a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -17,7 +17,7 @@ "@astrojs/check": "0.9.4", "@astrojs/markdown-remark": "5.3.0", "@astrojs/starlight": "0.28.4", - "astro": "4.16.7", + "astro": "4.16.17", "cspell": "^8.14.4", "hast-util-to-string": "^3.0.0", "rehype-autolink-headings": "7.1.0", diff --git a/docs/yarn.lock b/docs/yarn.lock index c7cf90e40..3befe8455 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -186,14 +186,6 @@ dependencies: yaml "^2.5.0" -"@babel/code-frame@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz#438f2c524071531d643c6f0188e1e28f130cebc7" - integrity sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g== - dependencies: - "@babel/highlight" "^7.25.7" - picocolors "^1.0.0" - "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz#9374b5cd068d128dac0b94ff482594273b1c2815" @@ -208,7 +200,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== -"@babel/core@^7.25.8": +"@babel/core@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -229,16 +221,6 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz#de86acbeb975a3e11ee92dd52223e6b03b479c56" - integrity sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA== - dependencies: - "@babel/types" "^7.25.7" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - "@babel/generator@^7.25.9", "@babel/generator@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz#505cc7c90d92513f458a477e5ef0703e7c91b8d7" @@ -250,12 +232,12 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" -"@babel/helper-annotate-as-pure@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.7.tgz#63f02dbfa1f7cb75a9bdb832f300582f30bb8972" - integrity sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA== +"@babel/helper-annotate-as-pure@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" + integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== dependencies: - "@babel/types" "^7.25.7" + "@babel/types" "^7.25.9" "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" @@ -268,14 +250,6 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-module-imports@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz#dba00d9523539152906ba49263e36d7261040472" - integrity sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw== - dependencies: - "@babel/traverse" "^7.25.7" - "@babel/types" "^7.25.7" - "@babel/helper-module-imports@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" @@ -293,26 +267,16 @@ "@babel/helper-validator-identifier" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/helper-plugin-utils@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz#8ec5b21812d992e1ef88a9b068260537b6f0e36c" - integrity sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw== - -"@babel/helper-string-parser@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz#d50e8d37b1176207b4fe9acedec386c565a44a54" - integrity sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g== +"@babel/helper-plugin-utils@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" + integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== "@babel/helper-string-parser@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== -"@babel/helper-validator-identifier@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz#77b7f60c40b15c97df735b38a66ba1d7c3e93da5" - integrity sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg== - "@babel/helper-validator-identifier@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" @@ -331,16 +295,6 @@ "@babel/template" "^7.25.9" "@babel/types" "^7.26.0" -"@babel/highlight@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz#20383b5f442aa606e7b5e3043b0b1aafe9f37de5" - integrity sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw== - dependencies: - "@babel/helper-validator-identifier" "^7.25.7" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - "@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.25.4": version "7.25.6" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz" @@ -348,13 +302,6 @@ dependencies: "@babel/types" "^7.25.6" -"@babel/parser@^7.25.7": - version "7.25.8" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz#f6aaf38e80c36129460c1657c0762db584c9d5e2" - integrity sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ== - dependencies: - "@babel/types" "^7.25.8" - "@babel/parser@^7.25.9", "@babel/parser@^7.26.0": version "7.26.1" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.1.tgz#44e02499960df2cdce2c456372a3e8e0c3c5c975" @@ -362,23 +309,23 @@ dependencies: "@babel/types" "^7.26.0" -"@babel/plugin-syntax-jsx@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.7.tgz#5352d398d11ea5e7ef330c854dea1dae0bf18165" - integrity sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw== +"@babel/plugin-syntax-jsx@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" + integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== dependencies: - "@babel/helper-plugin-utils" "^7.25.7" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-react-jsx@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.7.tgz#f5e2af6020a562fe048dd343e571c4428e6c5632" - integrity sha512-vILAg5nwGlR9EXE8JIOX4NHXd49lrYbN8hnjffDtoULwpL9hUx/N55nqh2qd0q6FyNDfjl9V79ecKGvFbcSA0Q== +"@babel/plugin-transform-react-jsx@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.9.tgz#06367940d8325b36edff5e2b9cbe782947ca4166" + integrity sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw== dependencies: - "@babel/helper-annotate-as-pure" "^7.25.7" - "@babel/helper-module-imports" "^7.25.7" - "@babel/helper-plugin-utils" "^7.25.7" - "@babel/plugin-syntax-jsx" "^7.25.7" - "@babel/types" "^7.25.7" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-syntax-jsx" "^7.25.9" + "@babel/types" "^7.25.9" "@babel/runtime@^7.23.2": version "7.25.6" @@ -387,15 +334,6 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz#27f69ce382855d915b14ab0fe5fb4cbf88fa0769" - integrity sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA== - dependencies: - "@babel/code-frame" "^7.25.7" - "@babel/parser" "^7.25.7" - "@babel/types" "^7.25.7" - "@babel/template@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" @@ -405,19 +343,6 @@ "@babel/parser" "^7.25.9" "@babel/types" "^7.25.9" -"@babel/traverse@^7.25.7": - version "7.25.7" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz#83e367619be1cab8e4f2892ef30ba04c26a40fa8" - integrity sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg== - dependencies: - "@babel/code-frame" "^7.25.7" - "@babel/generator" "^7.25.7" - "@babel/parser" "^7.25.7" - "@babel/template" "^7.25.7" - "@babel/types" "^7.25.7" - debug "^4.3.1" - globals "^11.1.0" - "@babel/traverse@^7.25.9": version "7.25.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" @@ -431,16 +356,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.4", "@babel/types@^7.25.6", "@babel/types@^7.25.7", "@babel/types@^7.25.8": - version "7.25.8" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz#5cf6037258e8a9bcad533f4979025140cb9993e1" - integrity sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg== - dependencies: - "@babel/helper-string-parser" "^7.25.7" - "@babel/helper-validator-identifier" "^7.25.7" - to-fast-properties "^2.0.0" - -"@babel/types@^7.25.9", "@babel/types@^7.26.0": +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.4", "@babel/types@^7.25.6", "@babel/types@^7.25.9", "@babel/types@^7.26.0": version "7.26.0" resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== @@ -1268,14 +1184,14 @@ resolved "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.1.1.tgz" integrity sha512-b7/qPqgIl+lMzkQ8fJt51SfguB396xbIIR+VZ3YrL2tLuyifDJ1wL5mEm+ddmHxJ2Fki340paPcDan9en5OmAw== -"@rollup/pluginutils@^5.1.2": - version "5.1.2" - resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz#d3bc9f0fea4fd4086aaac6aa102f3fa587ce8bd9" - integrity sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw== +"@rollup/pluginutils@^5.1.3": + version "5.1.4" + resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz#bb94f1f9eaaac944da237767cdfee6c5b2262d4a" + integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ== dependencies: "@types/estree" "^1.0.0" estree-walker "^2.0.2" - picomatch "^2.3.1" + picomatch "^4.0.2" "@rollup/rollup-android-arm-eabi@4.24.0": version "4.24.0" @@ -1357,39 +1273,39 @@ resolved "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz#0574d7e87b44ee8511d08cc7f914bcb802b70818" integrity sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw== -"@shikijs/core@1.22.0": - version "1.22.0" - resolved "https://registry.npmjs.org/@shikijs/core/-/core-1.22.0.tgz#74e5d4485e5f7afa85109e322b42e400686f92bb" - integrity sha512-S8sMe4q71TJAW+qG93s5VaiihujRK6rqDFqBnxqvga/3LvqHEnxqBIOPkt//IdXVtHkQWKu4nOQNk0uBGicU7Q== +"@shikijs/core@1.24.2": + version "1.24.2" + resolved "https://registry.npmjs.org/@shikijs/core/-/core-1.24.2.tgz#6308697f84a5029983885d0a7651d1667444bbce" + integrity sha512-BpbNUSKIwbKrRRA+BQj0BEWSw+8kOPKDJevWeSE/xIqGX7K0xrCZQ9kK0nnEQyrzsUoka1l81ZtJ2mGaCA32HQ== dependencies: - "@shikijs/engine-javascript" "1.22.0" - "@shikijs/engine-oniguruma" "1.22.0" - "@shikijs/types" "1.22.0" + "@shikijs/engine-javascript" "1.24.2" + "@shikijs/engine-oniguruma" "1.24.2" + "@shikijs/types" "1.24.2" "@shikijs/vscode-textmate" "^9.3.0" "@types/hast" "^3.0.4" hast-util-to-html "^9.0.3" -"@shikijs/engine-javascript@1.22.0": - version "1.22.0" - resolved "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.22.0.tgz#2e5db29f0421755492f5279f8224ef7a7f907a29" - integrity sha512-AeEtF4Gcck2dwBqCFUKYfsCq0s+eEbCEbkUuFou53NZ0sTGnJnJ/05KHQFZxpii5HMXbocV9URYVowOP2wH5kw== +"@shikijs/engine-javascript@1.24.2": + version "1.24.2" + resolved "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.24.2.tgz#af5920fdd76765d04dc5ec1a65cc77e355d6ceed" + integrity sha512-EqsmYBJdLEwEiO4H+oExz34a5GhhnVp+jH9Q/XjPjmBPc6TE/x4/gD0X3i0EbkKKNqXYHHJTJUpOLRQNkEzS9Q== dependencies: - "@shikijs/types" "1.22.0" + "@shikijs/types" "1.24.2" "@shikijs/vscode-textmate" "^9.3.0" - oniguruma-to-js "0.4.3" + oniguruma-to-es "0.7.0" -"@shikijs/engine-oniguruma@1.22.0": - version "1.22.0" - resolved "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.22.0.tgz#74c661fac4cd1f08f2c09b5d6e2fd2a6720d0401" - integrity sha512-5iBVjhu/DYs1HB0BKsRRFipRrD7rqjxlWTj4F2Pf+nQSPqc3kcyqFFeZXnBMzDf0HdqaFVvhDRAGiYNvyLP+Mw== +"@shikijs/engine-oniguruma@1.24.2": + version "1.24.2" + resolved "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.2.tgz#90924001a17a2551a2a9073aed4af3767ce68b1b" + integrity sha512-ZN6k//aDNWRJs1uKB12pturKHh7GejKugowOFGAuG7TxDRLod1Bd5JhpOikOiFqPmKjKEPtEA6mRCf7q3ulDyQ== dependencies: - "@shikijs/types" "1.22.0" + "@shikijs/types" "1.24.2" "@shikijs/vscode-textmate" "^9.3.0" -"@shikijs/types@1.22.0": - version "1.22.0" - resolved "https://registry.npmjs.org/@shikijs/types/-/types-1.22.0.tgz#d2a572381395c9308b472c8199b8e0289753b9ad" - integrity sha512-Fw/Nr7FGFhlQqHfxzZY8Cwtwk5E9nKDUgeLjZgt3UuhcM3yJR9xj3ZGNravZZok8XmEZMiYkSMTPlPkULB8nww== +"@shikijs/types@1.24.2": + version "1.24.2" + resolved "https://registry.npmjs.org/@shikijs/types/-/types-1.24.2.tgz#770313a0072a7c14ab1a130a36d02df7e4d87375" + integrity sha512-bdeWZiDtajGLG9BudI0AHet0b6e7FbR0EsE4jpGaI0YwHm/XJunI9+3uZnzFtX65gsyJ6ngCIWUfA4NWRPnBkQ== dependencies: "@shikijs/vscode-textmate" "^9.3.0" "@types/hast" "^3.0.4" @@ -1616,12 +1532,7 @@ acorn-jsx@^5.0.0: resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.0.0, acorn@^8.12.1: - version "8.12.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz" - integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== - -acorn@^8.13.0: +acorn@^8.0.0, acorn@^8.12.1, acorn@^8.14.0: version "8.14.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== @@ -1653,13 +1564,6 @@ ansi-regex@^6.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz" integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== -ansi-styles@^3.2.1: - 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== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" @@ -1716,27 +1620,27 @@ astro-expressive-code@^0.35.6: dependencies: rehype-expressive-code "^0.35.6" -astro@4.16.7: - version "4.16.7" - resolved "https://registry.npmjs.org/astro/-/astro-4.16.7.tgz#7896148d638dab4e7f0e5eec8816a446c1178e3e" - integrity sha512-nON+8MUEkWTFwXbS4zsQIq4t0Fs42eulM4x236AL+qNnWfqNAOOqAnFxO1dxfJ1q+XopIBbbT9Mtev+0zH47PQ== +astro@4.16.17: + version "4.16.17" + resolved "https://registry.npmjs.org/astro/-/astro-4.16.17.tgz#058f222c3633704b909e8621fd90b86d40072c71" + integrity sha512-OuD+BP7U6OqQLKtZ/FJkU2S+TOlifxS/OKUbZOb5p6y+LLBa1J3zHRJrIl7DUSq6eXY+9wSWwbJpD9JS+lqhxA== dependencies: "@astrojs/compiler" "^2.10.3" "@astrojs/internal-helpers" "0.4.1" "@astrojs/markdown-remark" "5.3.0" "@astrojs/telemetry" "3.1.0" - "@babel/core" "^7.25.8" - "@babel/plugin-transform-react-jsx" "^7.25.7" - "@babel/types" "^7.25.8" + "@babel/core" "^7.26.0" + "@babel/plugin-transform-react-jsx" "^7.25.9" + "@babel/types" "^7.26.0" "@oslojs/encoding" "^1.1.0" - "@rollup/pluginutils" "^5.1.2" + "@rollup/pluginutils" "^5.1.3" "@types/babel__core" "^7.20.5" "@types/cookie" "^0.6.0" - acorn "^8.13.0" + acorn "^8.14.0" aria-query "^5.3.2" axobject-query "^4.1.0" boxen "8.0.1" - ci-info "^4.0.0" + ci-info "^4.1.0" clsx "^2.1.1" common-ancestor-path "^1.0.1" cookie "^0.7.2" @@ -1758,30 +1662,30 @@ astro@4.16.7: http-cache-semantics "^4.1.1" js-yaml "^4.1.0" kleur "^4.1.5" - magic-string "^0.30.12" + magic-string "^0.30.14" magicast "^0.3.5" micromatch "^4.0.8" mrmime "^2.0.0" neotraverse "^0.6.18" - ora "^8.1.0" + ora "^8.1.1" p-limit "^6.1.0" p-queue "^8.0.1" preferred-pm "^4.0.0" prompts "^2.4.2" rehype "^13.0.2" semver "^7.6.3" - shiki "^1.22.0" + shiki "^1.23.1" tinyexec "^0.3.1" tsconfck "^3.1.4" unist-util-visit "^5.0.0" vfile "^6.0.3" - vite "^5.4.9" - vitefu "^1.0.3" + vite "^5.4.11" + vitefu "^1.0.4" which-pm "^3.0.0" - xxhash-wasm "^1.0.2" + xxhash-wasm "^1.1.0" yargs-parser "^21.1.1" zod "^3.23.8" - zod-to-json-schema "^3.23.3" + zod-to-json-schema "^3.23.5" zod-to-ts "^1.2.0" optionalDependencies: sharp "^0.33.3" @@ -1939,15 +1843,6 @@ chalk-template@^1.1.0: dependencies: chalk "^5.2.0" -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^5.2.0, chalk@^5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz" @@ -1985,10 +1880,10 @@ chownr@^1.1.1: resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== -ci-info@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz" - integrity sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg== +ci-info@^4.0.0, ci-info@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-4.1.0.tgz#92319d2fa29d2620180ea5afed31f589bc98cf83" + integrity sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A== clear-module@^4.1.2: version "4.1.2" @@ -2034,13 +1929,6 @@ collapse-white-space@^2.0.0: resolved "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz" integrity sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw== -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" @@ -2048,11 +1936,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" @@ -2335,6 +2218,11 @@ emmet@^2.4.3: "@emmetio/abbreviation" "^2.3.3" "@emmetio/css-abbreviation" "^2.1.8" +emoji-regex-xs@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz#e8af22e5d9dbd7f7f22d280af3d19d2aab5b0724" + integrity sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg== + emoji-regex@^10.3.0: version "10.4.0" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz" @@ -2401,11 +2289,6 @@ escalade@^3.1.1, escalade@^3.1.2: resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz" integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - escape-string-regexp@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz" @@ -2674,11 +2557,6 @@ gray-matter@^4.0.3: section-matter "^1.0.0" strip-bom-string "^1.0.0" -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-own-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz" @@ -3276,10 +3154,10 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -magic-string@^0.30.12: - version "0.30.12" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz#9eb11c9d072b9bcb4940a5b2c2e1a217e4ee1a60" - integrity sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw== +magic-string@^0.30.14: + version "0.30.17" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453" + integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA== dependencies: "@jridgewell/sourcemap-codec" "^1.5.0" @@ -4048,17 +3926,19 @@ onetime@^7.0.0: dependencies: mimic-function "^5.0.0" -oniguruma-to-js@0.4.3: - version "0.4.3" - resolved "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.3.tgz" - integrity sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ== +oniguruma-to-es@0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-0.7.0.tgz#999fe7df1e6acae4507e2d77afc6de4fc8533116" + integrity sha512-HRaRh09cE0gRS3+wi2zxekB+I5L8C/gN60S+vb11eADHUaB/q4u8wGGOX3GvwvitG8ixaeycZfeoyruKQzUgNg== dependencies: - regex "^4.3.2" + emoji-regex-xs "^1.0.0" + regex "^5.0.2" + regex-recursion "^4.3.0" -ora@^8.1.0: - version "8.1.0" - resolved "https://registry.npmjs.org/ora/-/ora-8.1.0.tgz" - integrity sha512-GQEkNkH/GHOhPFXcqZs3IDahXEQcQxsSjEkK4KvEEST4t7eNzoMjxTzef+EZ+JluDEV+Raoi3WQ2CflnRdSVnQ== +ora@^8.1.1: + version "8.1.1" + resolved "https://registry.npmjs.org/ora/-/ora-8.1.1.tgz#8efc8865e44c87e4b55468a47e80a03e678b0e54" + integrity sha512-YWielGi1XzG1UTvOaCFaNgEnuhZVMSHYkW/FQ7UX8O26PtlpdM84c0f7wLPlkvx2RfiQmnzd61d/MGxmpQeJPw== dependencies: chalk "^5.3.0" cli-cursor "^5.0.0" @@ -4191,7 +4071,7 @@ picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0: resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz" integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw== -picomatch@4.0.2: +picomatch@4.0.2, picomatch@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz" integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== @@ -4334,10 +4214,24 @@ regenerator-runtime@^0.14.0: resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz" integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== -regex@^4.3.2: - version "4.3.2" - resolved "https://registry.npmjs.org/regex/-/regex-4.3.2.tgz" - integrity sha512-kK/AA3A9K6q2js89+VMymcboLOlF5lZRCYJv3gzszXFHBr6kO6qLGzbm+UIugBEV8SMMKCTR59txoY6ctRHYVw== +regex-recursion@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/regex-recursion/-/regex-recursion-4.3.0.tgz#32c3a42a57d78bf2d0c83875074c2f7ebaf2a4f6" + integrity sha512-5LcLnizwjcQ2ALfOj95MjcatxyqF5RPySx9yT+PaXu3Gox2vyAtLDjHB8NTJLtMGkvyau6nI3CfpwFCjPUIs/A== + dependencies: + regex-utilities "^2.3.0" + +regex-utilities@^2.3.0: + version "2.3.0" + resolved "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz#87163512a15dce2908cf079c8960d5158ff43280" + integrity sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng== + +regex@^5.0.2: + version "5.0.2" + resolved "https://registry.npmjs.org/regex/-/regex-5.0.2.tgz#291d960467e6499a79ceec022d20a4e0df67c54f" + integrity sha512-/pczGbKIQgfTMRV0XjABvc5RzLqQmwqxLHdQao2RTXPk+pmTXB2P0IaUHYdYyk412YLwUIkaeMd5T+RzVgTqnQ== + dependencies: + regex-utilities "^2.3.0" rehype-autolink-headings@7.1.0: version "7.1.0" @@ -4712,15 +4606,15 @@ sharp@^0.33.3: "@img/sharp-win32-ia32" "0.33.5" "@img/sharp-win32-x64" "0.33.5" -shiki@^1.1.7, shiki@^1.10.3, shiki@^1.22.0: - version "1.22.0" - resolved "https://registry.npmjs.org/shiki/-/shiki-1.22.0.tgz#45d1dfff0e03a598af70e2ec8592f14ef07827b4" - integrity sha512-/t5LlhNs+UOKQCYBtl5ZsH/Vclz73GIqT2yQsCBygr8L/ppTdmpL4w3kPLoZJbMKVWtoG77Ue1feOjZfDxvMkw== +shiki@^1.1.7, shiki@^1.10.3, shiki@^1.22.0, shiki@^1.23.1: + version "1.24.2" + resolved "https://registry.npmjs.org/shiki/-/shiki-1.24.2.tgz#9db5b2ebe452d24769377c733ae1944f996ad584" + integrity sha512-TR1fi6mkRrzW+SKT5G6uKuc32Dj2EEa7Kj0k8kGqiBINb+C1TiflVOiT9ta6GqOJtC4fraxO5SLUaKBcSY38Fg== dependencies: - "@shikijs/core" "1.22.0" - "@shikijs/engine-javascript" "1.22.0" - "@shikijs/engine-oniguruma" "1.22.0" - "@shikijs/types" "1.22.0" + "@shikijs/core" "1.24.2" + "@shikijs/engine-javascript" "1.24.2" + "@shikijs/engine-oniguruma" "1.24.2" + "@shikijs/types" "1.24.2" "@shikijs/vscode-textmate" "^9.3.0" "@types/hast" "^3.0.4" @@ -4897,13 +4791,6 @@ style-to-object@^1.0.0: dependencies: inline-style-parser "0.2.4" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - tar-fs@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz" @@ -4957,11 +4844,6 @@ tinyexec@^0.3.1: resolved "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz#0ab0daf93b43e2c211212396bdb836b468c97c98" integrity sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ== -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" @@ -5149,10 +5031,10 @@ vfile@^6.0.0, vfile@^6.0.2, vfile@^6.0.3: "@types/unist" "^3.0.0" vfile-message "^4.0.0" -vite@^5.4.9: - version "5.4.10" - resolved "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz#d358a7bd8beda6cf0f3b7a450a8c7693a4f80c18" - integrity sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ== +vite@^5.4.11: + version "5.4.11" + resolved "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz#3b415cd4aed781a356c1de5a9ebafb837715f6e5" + integrity sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q== dependencies: esbuild "^0.21.3" postcss "^8.4.43" @@ -5160,10 +5042,10 @@ vite@^5.4.9: optionalDependencies: fsevents "~2.3.3" -vitefu@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/vitefu/-/vitefu-1.0.3.tgz#0467c75ee2be951c35246605b7fdbdbfd03b65d1" - integrity sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ== +vitefu@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/vitefu/-/vitefu-1.0.4.tgz#8e0355362d2f64c499cbb22d5dbc3184d02c9a2d" + integrity sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow== volar-service-css@0.0.62: version "0.0.62" @@ -5380,10 +5262,10 @@ xdg-basedir@^5.1.0: resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz" integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== -xxhash-wasm@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.0.2.tgz" - integrity sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A== +xxhash-wasm@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz#ffe7f0b98220a4afac171e3fb9b6d1f8771f015e" + integrity sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA== y18n@^5.0.5: version "5.0.8" @@ -5446,10 +5328,10 @@ yocto-queue@^1.1.1: resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz" integrity sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g== -zod-to-json-schema@^3.23.3: - version "3.23.3" - resolved "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.23.3.tgz#56cf4e0bd5c4096ab46e63159e20998ec7b19c39" - integrity sha512-TYWChTxKQbRJp5ST22o/Irt9KC5nj7CdBKYB/AosCRdj/wxEMvv4NNaj9XVUHDOIp53ZxArGhnw5HMZziPFjog== +zod-to-json-schema@^3.23.5: + version "3.24.1" + resolved "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz#f08c6725091aadabffa820ba8d50c7ab527f227a" + integrity sha512-3h08nf3Vw3Wl3PK+q3ow/lIil81IT2Oa7YpQyUUDsEWbXveMesdfK1xBd2RhCkynwZndAxixji/7SYJJowr62w== zod-to-ts@^1.2.0: version "1.2.0" From 91569213d6f0faace7747a60a3bb7754e40cc083 Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Wed, 18 Dec 2024 22:55:14 +0400 Subject: [PATCH 10/29] feat: remove `__tact_verify_address` to save gas (#1207) There is no more automatic address validation, so the user is supposed to do it manually if it's needed. Also, removed the masterchain enabling config option. --- CHANGELOG.md | 3 + docs/astro.config.mjs | 1 - docs/cspell.json | 1 - docs/src/content/docs/book/cells.mdx | 3 +- docs/src/content/docs/book/config.mdx | 34 -- docs/src/content/docs/book/contracts.mdx | 1 - docs/src/content/docs/book/exit-codes.mdx | 16 +- docs/src/content/docs/book/masterchain.mdx | 57 --- docs/src/content/docs/ref/core-advanced.mdx | 2 +- docs/src/content/docs/ref/core-common.mdx | 4 +- .../src/content/docs/zh-cn/book/contracts.mdx | 1 - schemas/configSchema.json | 5 - src/abi/errors.ts | 5 - src/abi/global.ts | 10 +- src/benchmarks/benchmarks.spec.ts | 8 +- src/check.ts | 1 - src/config/features.ts | 4 - src/config/parseConfig.ts | 6 - .../writeSerialization.spec.ts.snap | 138 ++----- src/generator/writers/writeAccessors.ts | 19 +- src/generator/writers/writeContract.ts | 13 +- src/generator/writers/writeFunction.ts | 12 +- src/generator/writers/writeStdlib.ts | 38 +- src/interpreter.ts | 16 - src/pipeline/build.ts | 1 - .../local-type-inference.spec.ts.snap | 6 - .../e2e-emulated/contracts/masterchain.tact | 45 ++- src/test/e2e-emulated/masterchain.spec.ts | 357 +----------------- .../tact-reserved-contract-errors.tact | 18 - .../tact-reserved-contract-errors.spec.ts | 14 +- src/types/getSupportedInterfaces.ts | 7 +- tact.config.json | 12 +- 32 files changed, 97 insertions(+), 761 deletions(-) delete mode 100644 docs/src/content/docs/book/masterchain.mdx diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a6df838..c3871e2be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Optional types for `self` argument in `extends mutates` functions are now allowed: PR [#854](https://github.com/tact-lang/tact/pull/854) - Error codes in the report are now formatted as a list: PR [#1051](https://github.com/tact-lang/tact/pull/1051) - Clarify error message for bounced types from which accessed a field that does not fit in 224 bytes: PR [#1111](https://github.com/tact-lang/tact/pull/1111) +- Do not automatically validate all addresses when receiving/sending messages or using address manipulating functions: PR [#1207](https://github.com/tact-lang/tact/pull/1207) +- Remove `enabledMasterchain` compiler config option from `tact.config.json`: PR [#1207](https://github.com/tact-lang/tact/pull/1207) +- Remove `org.ton.chain.any.v0` interface: PR [#1207](https://github.com/tact-lang/tact/pull/1207) ### Fixed diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 61d5bd0c6..65b3500ea 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -186,7 +186,6 @@ export default defineConfig({ { slug: 'book/upgrades' }, { slug: 'book/import' }, { slug: 'book/config' }, - { slug: 'book/masterchain' }, { slug: 'book/func' }, { slug: 'book/security-best-practices' }, ], diff --git a/docs/cspell.json b/docs/cspell.json index ef92d9e55..7b2c12f56 100644 --- a/docs/cspell.json +++ b/docs/cspell.json @@ -156,7 +156,6 @@ "lvalue", "lvalues", "masterchain", - "masterchain", "mathrm", "maxint", "minmax", diff --git a/docs/src/content/docs/book/cells.mdx b/docs/src/content/docs/book/cells.mdx index 621c8e36d..9e5e5cb9a 100644 --- a/docs/src/content/docs/book/cells.mdx +++ b/docs/src/content/docs/book/cells.mdx @@ -21,7 +21,7 @@ Kinds (or subtypes) of all cells are encoded by an integer between $-1$ and $255 [TVM][tvm] currently supports the following exotic cell subtypes: * [Pruned branch cell][c-pruned], with subtype encoded as $1$ — they represent deleted subtrees of cells. -* [Library reference cell][c-library], with subtype encoded as $2$ — they are used for storing libraries, and usually, in [masterchain](/book/masterchain) contexts. +* [Library reference cell][c-library], with subtype encoded as $2$ — they are used for storing libraries, and usually, in [masterchain][masterchain] contexts. * [Merkle proof cell][c-mproof], with subtype encoded as $3$ — they are used for verifying that certain portions of other cell's tree data belong to the full tree. * [Merkle update cell][c-mupdate], with subtype encoded as $4$ — they always have two references and behave like a [Merkle proof][mproof] for both of them. @@ -40,6 +40,7 @@ Kinds (or subtypes) of all cells are encoded by an integer between $-1$ and $255 [c-mproof]: https://docs.ton.org/develop/data-formats/exotic-cells#merkle-proof [c-mupdate]: https://docs.ton.org/develop/data-formats/exotic-cells#merkle-update [mproof]: https://docs.ton.org/develop/data-formats/exotic-cells#simple-proof-verifying-example +[masterchain]: https://docs.ton.org/v3/documentation/smart-contracts/shards/shards-intro#masterchain ### Levels {#cells-levels} diff --git a/docs/src/content/docs/book/config.mdx b/docs/src/content/docs/book/config.mdx index 416856a85..10c5ded51 100644 --- a/docs/src/content/docs/book/config.mdx +++ b/docs/src/content/docs/book/config.mdx @@ -149,39 +149,6 @@ If set to `true{:json}`, enables debug output of a contract and allows usage of ::: -#### `masterchain` {#options-masterchain} - -`false{:json}` by default. - -If set to `true{:json}`, enables [masterchain](/book/masterchain) support. - -```json filename="tact.config.json" {8,14} -{ - "projects": [ - { - "name": "some_prefix", - "path": "./contract.tact", - "output": "./contract_output", - "options": { - "masterchain": true - } - }, - { - "name": "ContractUnderBlueprint", - "options": { - "masterchain": true - } - } - ] -} -``` - -:::note - - Read more on the dedicated page: [Masterchain](/book/masterchain). - -::: - #### `external` {#options-external} `false{:json}` by default. @@ -399,7 +366,6 @@ In [Blueprint][bp], `mode` is always set to `"full"{:json}` and cannot be overwr "name": "ContractUnderBlueprint", "options": { "debug": false, - "masterchain": false, "external": false, "ipfsAbiGetter": true, "interfacesGetter": true, diff --git a/docs/src/content/docs/book/contracts.mdx b/docs/src/content/docs/book/contracts.mdx index dfc317fc4..cacab40c2 100644 --- a/docs/src/content/docs/book/contracts.mdx +++ b/docs/src/content/docs/book/contracts.mdx @@ -95,7 +95,6 @@ Tact has a small set of interfaces provided under specific conditions: * `"org.ton.abi.ipfs.v0"{:tact}`, in accordance to [OTP-003: Self-ABI Reporting](/ref/evolution/otp-003) — opt-in via [`ipfsAbiGetter`](/book/config#options-ipfsabigetter) config property * `"org.ton.deploy.lazy.v0"{:tact}`, in accordance to [OTP-005: Argument-addressable contracts](/ref/evolution/otp-005) * `"org.ton.debug.v0"{:tact}`, but only if [debug mode](/book/debug#debug-mode) is enabled -* `"org.ton.chain.any.v0"{:tact}` if [masterchain](/book/masterchain) support is enabled, and `"org.ton.chain.workchain.v0"{:tact}` otherwise Some [traits][trait] in [standard libraries](/ref/standard-libraries) define their interfaces too: diff --git a/docs/src/content/docs/book/exit-codes.mdx b/docs/src/content/docs/book/exit-codes.mdx index bfb6486b7..cc1ca41f6 100644 --- a/docs/src/content/docs/book/exit-codes.mdx +++ b/docs/src/content/docs/book/exit-codes.mdx @@ -3,6 +3,8 @@ title: Exit codes description: "An exit code is a 32-bit signed integer, which indicates whether the compute or action phase of the transaction was successful, and if not — holds the code of the exception occurred" --- +import { Badge } from '@astrojs/starlight/components'; + Each transaction on TON Blockchain consists of [multiple phases](https://docs.ton.org/learn/tvm-instructions/tvm-overview#transactions-and-phases). An _exit code_ is a $32$-bit signed integer, which indicates whether the [compute](#compute) or [action](#action) phase of the transaction was successful, and if not — holds the code of the exception occurred. Each exit code represents its own exception or resulting state of the transaction. Exit codes $0$ and $1$ indicate normal (successful) execution of the [compute phase](#compute). Exit (or [result](#action)) code $0$ indicates normal (successful) execution of the [action phase](#action). Any other exit code indicates that a certain exception has occurred and that the transaction wasn't successful in one way or another, i.e. transaction was reverted or the inbound message has bounced back. @@ -60,8 +62,8 @@ Exit code | Origin | Brief description [$133$](#133) | Tact compiler ([Compute phase][c]) | Contract stopped. Reserved, but never thrown. [$134$](#134) | Tact compiler ([Compute phase][c]) | Invalid argument. [$135$](#135) | Tact compiler ([Compute phase][c]) | Code of a contract was not found. -[$136$](#136) | Tact compiler ([Compute phase][c]) | Invalid address. -[$137$](#137) | Tact compiler ([Compute phase][c]) | Masterchain support is not enabled for this contract. +~~[$136$](#136)~~ | ~~Tact compiler ([Compute phase][c])~~ | ~~Invalid address.~~ Removed since Tact 1.6 +~~[$137$](#137)~~ | ~~Tact compiler ([Compute phase][c])~~ | ~~Masterchain support is not enabled for this contract.~~ Removed since Tact 1.6 :::note @@ -526,7 +528,7 @@ If the configuration is absent, default values are: * `ext_msg_limits.max_depth` is equal to $2^{9}$ — maximum external message [depth](/book/cells#cells-representation). * `max_acc_state_cells` is equal to $2^{16}$ — maximum number of [cells][cell] that an account state can occupy. * `max_acc_state_bits` is equal to $2^{16} * 1023$ — maximum account state size in bits. -* `max_acc_public_libraries` is equal to $2^{8}$ — maximum number of [library reference cells](/book/cells#cells-kinds) that an account state can use on the [masterchain](/book/masterchain). +* `max_acc_public_libraries` is equal to $2^{8}$ — maximum number of [library reference cells](/book/cells#cells-kinds) that an account state can use on the masterchain. * `defer_out_queue_size_limit` is equal to $2^{8}$ — maximum number of outbound messages to be queued (regards validators and collators). ## Tact compiler @@ -623,10 +625,12 @@ If the code of the contract doesn't match the one saved in TypeScript wrappers, ### 136: Invalid address {#136} +

+ A value of type [`Address{:tact}`][p] is valid in Tact when: * It occupies $267$ bits: $11$ bits for the chain ID prefix and $256$ bits for the [address itself](https://docs.ton.org/learn/overviews/addresses#address-of-smart-contract). -* It belongs to either: basechain (ID $0$) or masterchain (ID $-1$), with the latter requiring [masterchain support](/book/masterchain#support) to be enabled. +* It belongs to either basechain (ID $0$) or masterchain (ID $-1$). If the [`Address{:tact}`][p] isn't valid, the error with exit code $136$ will be thrown: `Invalid address`. @@ -644,7 +648,9 @@ try { ### 137: Masterchain support is not enabled for this contract {#137} -Any attempts to point to masterchain (ID $-1$) or otherwise interact with it without [enabling masterchain support](/book/masterchain#support) throw an exception with exit code $137$: `Masterchain support is not enabled for this contract`. +

+ +Prior to removal, any attempts to point to masterchain (ID $-1$) or otherwise interact with it without enabling masterchain support were throwing an exception with exit code $137$: `Masterchain support is not enabled for this contract`. ```tact let masterchainID = -1; diff --git a/docs/src/content/docs/book/masterchain.mdx b/docs/src/content/docs/book/masterchain.mdx deleted file mode 100644 index 76c209525..000000000 --- a/docs/src/content/docs/book/masterchain.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Masterchain -description: "In TON Blockchain, a special chain called masterchain is used to synchronize message routing and transaction execution, so that nodes in the network can fix a particular point in a multi-chain state and reach a consensus about that state" ---- - -:::caution - - Masterchain addresses are treated as invalid unless the `masterchain` option in the [configuration file](/book/config) is set to `true{:json}`. - -::: - -In TON Blockchain, a special chain called ["masterchain"](https://docs.ton.org/learn/overviews/ton-blockchain#masterchain-blockchain-of-blockchains) is used to synchronize message routing and transaction execution, so that nodes in the network can fix a particular point in a multi-chain state and reach a consensus about that state. - -Masterchain stores the [network configuration](/ref/core-advanced#getconfigparam) and the final state of all [workchains](https://docs.ton.org/learn/overviews/ton-blockchain#workchain-blockchain-with-your-own-rules). It carries fundamental protocol information, including current settings, a list of active validators and their stakes, active workchains, and associated [shardchains](https://docs.ton.org/develop/blockchain/shards). Most importantly, it maintains a record of the latest block hashes for all workchains and shardchains, enforcing consensus across the network. - -## How contract is protected from masterchain {#protection} - -Tact enforces all contracts to use the [basechain](https://docs.ton.org/develop/blockchain/shards), which is the default workchain with ID $0$. This is done to prevent masterchain addresses from being used in the contract. - -Any attempts to point to masterchain or otherwise interact with it without [enabling masterchain support](#support) throw an exception with [exit code 137](/book/exit-codes#137): `Masterchain support is not enabled for this contract`. - -That is, accidental deployments to the masterchain, receiving messages from masterchain accounts, sending messages to such accounts, and using masterchain addresses or its chain ID ($-1$) are all prohibited by default. - -## Enabling masterchain support in compilation options {#support} - -:::caution - -Most contracts don't need to be deployed on a masterchain or have any interactions on a masterchain. That's because the masterchain is primarily used for voting or storing libraries. If you don't need to partake in those things, you don't need to enable masterchain support. - -::: - -If you really do need masterchain support, the simplest and recommended approach is to modify a [`tact.config.json`](/book/config) file in the root of your project (or create it if it didn't exist yet), and [set the `masterchain` property to `true{:json}`](/book/config#options-masterchain). - -If you're working on a [Blueprint][bp]-based project, you can enable masterchain support in the compilation configs of your contracts, which are located in a directory named `wrappers/`: - -```typescript title="wrappers/YourContractName.compile.ts" {7} -import { CompilerConfig } from '@ton/blueprint'; - -export const compile: CompilerConfig = { - lang: 'tact', - target: 'contracts/your_contract_name.tact', - options: { - masterchain: true, // ← that's the stuff! - } -}; -``` - -However, [`tact.config.json`](/book/config) may still be used in [Blueprint][bp] projects. In such cases values specified in [`tact.config.json`](/book/config) act as default unless modified in the `wrappers/`. - -:::note - - If you have the `separateCompilables` option set to `true{:typescript}` in the [`blueprint.config.ts`][bp-config], then the `.compile.ts` files will be located in the `compilables/` directory and **not** in `wrappers/`. - -::: - -[bp]: https://github.com/ton-org/blueprint -[bp-config]: https://github.com/ton-org/blueprint/tree/main?tab=readme-ov-file#configuration diff --git a/docs/src/content/docs/ref/core-advanced.mdx b/docs/src/content/docs/ref/core-advanced.mdx index 25dba26cd..02531ef29 100644 --- a/docs/src/content/docs/ref/core-advanced.mdx +++ b/docs/src/content/docs/ref/core-advanced.mdx @@ -581,7 +581,7 @@ parsedVarAddr.address.loadUint(123); // 345 [int]: /book/integers [slice]: /book/cells#slices [s]: /book/structs-and-messages#structs -[masterchain]: /book/masterchain +[masterchain]: https://docs.ton.org/v3/documentation/smart-contracts/shards/shards-intro#masterchain [cell-hash]: /ref/core-cell#cellhash [nanotoncoin]: /book/integers#nanotoncoin diff --git a/docs/src/content/docs/ref/core-common.mdx b/docs/src/content/docs/ref/core-common.mdx index 64c28fdc3..4afcbf27e 100644 --- a/docs/src/content/docs/ref/core-common.mdx +++ b/docs/src/content/docs/ref/core-common.mdx @@ -138,7 +138,7 @@ let oldTonFoundationAddr: Address = :::caution - This method throws an error with [exit code 136](/book/exit-codes#136) if `chain` is invalid or with [exit code 137](/book/exit-codes#137) if `chain` points to the masterchain ($-1$) without [masterchain support](/book/masterchain) enabled. + Make sure your specify only supported chain IDs: $0$ for the basechain and $-1$ for the masterchain. ::: @@ -181,7 +181,7 @@ let hereBeDragons: Address = contractAddressExt(0, initPkg.code, initPkg.data); :::caution - This method throws an error with [exit code 136](/book/exit-codes#136) if `chain` is invalid or with [exit code 137](/book/exit-codes#137) if `chain` points to the masterchain ($-1$) without [masterchain support](/book/masterchain) enabled. + Make sure your specify only supported chain IDs: $0$ for the basechain and $-1$ for the masterchain. ::: diff --git a/docs/src/content/docs/zh-cn/book/contracts.mdx b/docs/src/content/docs/zh-cn/book/contracts.mdx index ff7d10718..63c4a2f7e 100644 --- a/docs/src/content/docs/zh-cn/book/contracts.mdx +++ b/docs/src/content/docs/zh-cn/book/contracts.mdx @@ -94,7 +94,6 @@ Tact 有一小套在特定条件下提供的接口: - `"org.ton.abi.ipfs.v0"{:tact}`,根据 [OTP-003: Self-ABI Reporting](/zh-cn/ref/evolution/otp-003) - 通过 [`ipfsAbiGetter`](/zh-cn/book/config#options-ipfsabigetter)配置属性选择加入 - `"org.ton.deploy.lazy.v0"{:tact}`,符合[OTP-005:参数可寻址合约](/zh-cn/ref/evolution/otp-005) - `"org.ton.debug.v0"{:tact}`,但只有在启用了[调试模式](/zh-cn/book/debug#debug-mode)时才会这样做 -- `"org.ton.chain.any.v0"{:tact}` 如果启用了 [masterchain](/zh-cn/book/masterchain) 支持,否则为 `"org.ton.chain.workchain.v0"{:tact}` [标准库](/zh-cn/ref/standard-libraries)中的一些[traits][trait]也定义了它们的接口: diff --git a/schemas/configSchema.json b/schemas/configSchema.json index 6cf6b5d21..7b627f50f 100644 --- a/schemas/configSchema.json +++ b/schemas/configSchema.json @@ -36,11 +36,6 @@ "default": false, "description": "False by default. If set to true, enables debug output of a contract and allows usage of `dump()` function, which is useful for debugging purposes. With this option enabled, the contract will report that it was compiled in debug mode using the supported_interfaces method.\n\nRead more on debugging Tact code: https://docs.tact-lang.org/book/debug." }, - "masterchain": { - "type": "boolean", - "default": false, - "description": "False by default. If set to true, enables masterchain support.\n\nRead more about masterchain: https://docs.tact-lang.org/book/masterchain." - }, "external": { "type": "boolean", "default": false, diff --git a/src/abi/errors.ts b/src/abi/errors.ts index ee04f2fc8..42d386d54 100644 --- a/src/abi/errors.ts +++ b/src/abi/errors.ts @@ -9,9 +9,4 @@ export const contractErrors = { contractStopped: { id: 133, message: "Contract stopped" }, invalidArgument: { id: 134, message: "Invalid argument" }, codeNotFound: { id: 135, message: "Code of a contract was not found" }, - invalidAddress: { id: 136, message: "Invalid address" }, - masterchainNotEnabled: { - id: 137, - message: "Masterchain support is not enabled for this contract", - }, }; diff --git a/src/abi/global.ts b/src/abi/global.ts index 86025f260..87ef019df 100644 --- a/src/abi/global.ts +++ b/src/abi/global.ts @@ -1,5 +1,5 @@ import { Address, beginCell, Cell, toNano } from "@ton/core"; -import { enabledDebug, enabledMasterchain } from "../config/features"; +import { enabledDebug } from "../config/features"; import { writeAddress, writeCell, @@ -163,14 +163,6 @@ export const GlobalFunctions: Map = new Map([ ref, ); } - if (!enabledMasterchain(ctx.ctx)) { - if (address.workChain !== 0) { - throwCompilationError( - `Address ${str} from masterchain are not enabled for this contract`, - ref, - ); - } - } // Generate address const res = writeAddress(address, ctx); diff --git a/src/benchmarks/benchmarks.spec.ts b/src/benchmarks/benchmarks.spec.ts index e82e88f79..6a9a80cd0 100644 --- a/src/benchmarks/benchmarks.spec.ts +++ b/src/benchmarks/benchmarks.spec.ts @@ -33,11 +33,11 @@ describe("benchmarks", () => { .description as TransactionDescriptionGeneric ).computePhase as TransactionComputeVm ).gasUsed; - expect(gasUsed).toMatchInlineSnapshot(`3648n`); + expect(gasUsed).toMatchInlineSnapshot(`3146n`); // Verify code size const codeSize = functions.init!.code.toBoc().length; - expect(codeSize).toMatchInlineSnapshot(`281`); + expect(codeSize).toMatchInlineSnapshot(`241`); }); it("benchmark functions (inline)", async () => { @@ -57,10 +57,10 @@ describe("benchmarks", () => { .description as TransactionDescriptionGeneric ).computePhase as TransactionComputeVm ).gasUsed; - expect(gasUsed).toMatchInlineSnapshot(`3517n`); + expect(gasUsed).toMatchInlineSnapshot(`3015n`); // Verify code size const codeSize = functionsInline.init!.code.toBoc().length; - expect(codeSize).toMatchInlineSnapshot(`274`); + expect(codeSize).toMatchInlineSnapshot(`234`); }); }); diff --git a/src/check.ts b/src/check.ts index 5bc55e948..27584a5e0 100644 --- a/src/check.ts +++ b/src/check.ts @@ -34,7 +34,6 @@ export function check(args: { const stdlib = createVirtualFileSystem("@stdlib/", files); let ctx: CompilerContext = new CompilerContext(); ctx = featureEnable(ctx, "debug"); // Enable debug flag (does not affect type checking in practice) - ctx = featureEnable(ctx, "masterchain"); // Enable masterchain flag to avoid masterchain-specific errors ctx = featureEnable(ctx, "external"); // Enable external messages flag to avoid external-specific errors const ast = getAstFactory(); diff --git a/src/config/features.ts b/src/config/features.ts index 4d8a9d0af..1b9cc5a14 100644 --- a/src/config/features.ts +++ b/src/config/features.ts @@ -10,10 +10,6 @@ export function enabledDebug(ctx: CompilerContext) { return featureEnabled(ctx, "debug"); } -export function enabledMasterchain(ctx: CompilerContext) { - return featureEnabled(ctx, "masterchain"); -} - export function enabledExternals(ctx: CompilerContext) { return featureEnabled(ctx, "external"); } diff --git a/src/config/parseConfig.ts b/src/config/parseConfig.ts index f4633b186..1aa303f45 100644 --- a/src/config/parseConfig.ts +++ b/src/config/parseConfig.ts @@ -9,12 +9,6 @@ export const optionsSchema = z * Read more: https://docs.tact-lang.org/book/debug */ debug: z.boolean().optional(), - /** - * If set to true, enables masterchain support. - * - * Read more: https://docs.tact-lang.org/book/masterchain - */ - masterchain: z.boolean().optional(), /** * If set to true, enables support of external message receivers. * diff --git a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap index 30db3674f..10b4a432c 100644 --- a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap +++ b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap @@ -57,36 +57,15 @@ exports[`writeSerialization should write serializer for A 1`] = ` "name": "__tact_address_to_slice", "signature": "", }, - { - "code": { - "code": "throw_unless(136, address.slice_bits() == 267); -var h = address.preload_uint(11); -throw_if(137, h == 1279); -throw_unless(136, h == 1024); -return address;", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { - "impure", - "inline", - }, - "name": "__tact_verify_address", - "signature": "slice __tact_verify_address(slice address)", - }, { "code": { "code": "slice raw = cs~load_msg_addr(); -return (cs, __tact_verify_address(raw));", +return (cs, raw);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -97,7 +76,7 @@ return (cs, __tact_verify_address(raw));", "code": { "code": "if (cs.preload_uint(2) != 0) { slice raw = cs~load_msg_addr(); - return (cs, __tact_verify_address(raw)); + return (cs, raw); } else { cs~skip_bits(2); return (cs, null()); @@ -106,9 +85,7 @@ return (cs, __tact_verify_address(raw));", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -117,14 +94,12 @@ return (cs, __tact_verify_address(raw));", }, { "code": { - "code": "return b.store_slice(__tact_verify_address(address));", + "code": "return b.store_slice(address);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -160,14 +135,12 @@ b = b.store_uint(0, 1); b = b.store_int(chain, 8); b = b.store_uint(hash, 256); var addr = b.end_cell().begin_parse(); -return __tact_verify_address(addr);", +return addr;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -4318,13 +4291,12 @@ return $C$_to_tuple($C$_not_null(v)); ", { "code": { "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, __tact_verify_address(v'h));", +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", "kind": "generic", }, "comment": null, "context": "type:C", "depends": Set { - "__tact_verify_address", "__tact_tuple_destroy_8", }, "flags": Set { @@ -4483,36 +4455,15 @@ exports[`writeSerialization should write serializer for B 1`] = ` "name": "__tact_address_to_slice", "signature": "", }, - { - "code": { - "code": "throw_unless(136, address.slice_bits() == 267); -var h = address.preload_uint(11); -throw_if(137, h == 1279); -throw_unless(136, h == 1024); -return address;", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { - "impure", - "inline", - }, - "name": "__tact_verify_address", - "signature": "slice __tact_verify_address(slice address)", - }, { "code": { "code": "slice raw = cs~load_msg_addr(); -return (cs, __tact_verify_address(raw));", +return (cs, raw);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -4523,7 +4474,7 @@ return (cs, __tact_verify_address(raw));", "code": { "code": "if (cs.preload_uint(2) != 0) { slice raw = cs~load_msg_addr(); - return (cs, __tact_verify_address(raw)); + return (cs, raw); } else { cs~skip_bits(2); return (cs, null()); @@ -4532,9 +4483,7 @@ return (cs, __tact_verify_address(raw));", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -4543,14 +4492,12 @@ return (cs, __tact_verify_address(raw));", }, { "code": { - "code": "return b.store_slice(__tact_verify_address(address));", + "code": "return b.store_slice(address);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -4586,14 +4533,12 @@ b = b.store_uint(0, 1); b = b.store_int(chain, 8); b = b.store_uint(hash, 256); var addr = b.end_cell().begin_parse(); -return __tact_verify_address(addr);", +return addr;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -8744,13 +8689,12 @@ return $C$_to_tuple($C$_not_null(v)); ", { "code": { "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, __tact_verify_address(v'h));", +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", "kind": "generic", }, "comment": null, "context": "type:C", "depends": Set { - "__tact_verify_address", "__tact_tuple_destroy_8", }, "flags": Set { @@ -8909,36 +8853,15 @@ exports[`writeSerialization should write serializer for C 1`] = ` "name": "__tact_address_to_slice", "signature": "", }, - { - "code": { - "code": "throw_unless(136, address.slice_bits() == 267); -var h = address.preload_uint(11); -throw_if(137, h == 1279); -throw_unless(136, h == 1024); -return address;", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { - "impure", - "inline", - }, - "name": "__tact_verify_address", - "signature": "slice __tact_verify_address(slice address)", - }, { "code": { "code": "slice raw = cs~load_msg_addr(); -return (cs, __tact_verify_address(raw));", +return (cs, raw);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -8949,7 +8872,7 @@ return (cs, __tact_verify_address(raw));", "code": { "code": "if (cs.preload_uint(2) != 0) { slice raw = cs~load_msg_addr(); - return (cs, __tact_verify_address(raw)); + return (cs, raw); } else { cs~skip_bits(2); return (cs, null()); @@ -8958,9 +8881,7 @@ return (cs, __tact_verify_address(raw));", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -8969,14 +8890,12 @@ return (cs, __tact_verify_address(raw));", }, { "code": { - "code": "return b.store_slice(__tact_verify_address(address));", + "code": "return b.store_slice(address);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -9012,14 +8931,12 @@ b = b.store_uint(0, 1); b = b.store_int(chain, 8); b = b.store_uint(hash, 256); var addr = b.end_cell().begin_parse(); -return __tact_verify_address(addr);", +return addr;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_verify_address", - }, + "depends": Set {}, "flags": Set { "inline", }, @@ -13173,13 +13090,12 @@ return $C$_to_tuple($C$_not_null(v)); ", { "code": { "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, __tact_verify_address(v'h));", +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", "kind": "generic", }, "comment": null, "context": "type:C", "depends": Set { - "__tact_verify_address", "__tact_tuple_destroy_8", }, "flags": Set { diff --git a/src/generator/writers/writeAccessors.ts b/src/generator/writers/writeAccessors.ts index 191235f59..dab34430f 100644 --- a/src/generator/writers/writeAccessors.ts +++ b/src/generator/writers/writeAccessors.ts @@ -212,21 +212,10 @@ export function writeAccessors( t.kind === "primitive_type_decl" && t.name === "Address" ) { - if (f.type.optional) { - vars.push( - `${resolveFuncType(f.type, ctx)} v'${f.name}`, - ); - out.push( - `null?(v'${f.name}) ? null() : ${ctx.used(`__tact_verify_address`)}(v'${f.name})`, - ); - } else { - vars.push( - `${resolveFuncType(f.type, ctx)} v'${f.name}`, - ); - out.push( - `${ctx.used(`__tact_verify_address`)}(v'${f.name})`, - ); - } + vars.push( + `${resolveFuncType(f.type, ctx)} v'${f.name}`, + ); + out.push(`v'${f.name}`); continue; } } diff --git a/src/generator/writers/writeContract.ts b/src/generator/writers/writeContract.ts index 4cf60f77f..14264c06a 100644 --- a/src/generator/writers/writeContract.ts +++ b/src/generator/writers/writeContract.ts @@ -3,7 +3,6 @@ import { enabledInline, enabledInterfacesGetter, enabledIpfsAbiGetter, - enabledMasterchain, } from "../../config/features"; import { ItemOrigin } from "../../grammar"; import { InitDescription, TypeDescription } from "../../types/types"; @@ -50,14 +49,6 @@ export function writeStorageOps( }); ctx.append(`} else {`); ctx.inIndent(() => { - // Allow only workchain deployments - if (!enabledMasterchain(ctx.ctx)) { - ctx.write(`;; Allow only workchain deployments`); - ctx.write( - `throw_unless(${contractErrors.masterchainNotEnabled.id}, my_address().preload_uint(11) == 1024);`, - ); - } - // Load arguments if (type.init!.params.length > 0) { ctx.append( @@ -305,9 +296,7 @@ export function writeMainContract( ctx.append(`var cs = in_msg_cell.begin_parse();`); ctx.append(`var msg_flags = cs~load_uint(4);`); // int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool ctx.append(`var msg_bounced = -(msg_flags & 1);`); - ctx.append( - `slice msg_sender_addr = ${ctx.used("__tact_verify_address")}(cs~load_msg_addr());`, - ); + ctx.append(`slice msg_sender_addr = cs~load_msg_addr();`); ctx.append( `__tact_context = (msg_bounced, msg_sender_addr, msg_value, cs);`, ); diff --git a/src/generator/writers/writeFunction.ts b/src/generator/writers/writeFunction.ts index 88c3fc51c..a5536b642 100644 --- a/src/generator/writers/writeFunction.ts +++ b/src/generator/writers/writeFunction.ts @@ -54,15 +54,9 @@ function unwrapExternal( } return; } else if (t.kind === "primitive_type_decl" && t.name === "Address") { - if (type.optional) { - ctx.append( - `${resolveFuncType(type, ctx)} ${targetName} = null?(${sourceName}) ? null() : ${ctx.used(`__tact_verify_address`)}(${sourceName});`, - ); - } else { - ctx.append( - `${resolveFuncType(type, ctx)} ${targetName} = ${ctx.used(`__tact_verify_address`)}(${sourceName});`, - ); - } + ctx.append( + `${resolveFuncType(type, ctx)} ${targetName} = ${sourceName};`, + ); return; } } diff --git a/src/generator/writers/writeStdlib.ts b/src/generator/writers/writeStdlib.ts index 4bd365603..13e06f807 100644 --- a/src/generator/writers/writeStdlib.ts +++ b/src/generator/writers/writeStdlib.ts @@ -1,6 +1,5 @@ import { contractErrors } from "../../abi/errors"; import { maxTupleSize } from "../../bindings/typescript/writeStruct"; -import { enabledMasterchain } from "../../config/features"; import { match } from "../../utils/tricks"; import { WriterContext } from "../Writer"; @@ -19,33 +18,6 @@ export function writeStdlib(ctx: WriterContext): void { // Addresses // - ctx.fun("__tact_verify_address", () => { - ctx.signature(`slice __tact_verify_address(slice address)`); - ctx.flag("impure"); - ctx.flag("inline"); - ctx.context("stdlib"); - ctx.body(() => { - ctx.write(` - throw_unless(${contractErrors.invalidAddress.id}, address.slice_bits() == 267); - var h = address.preload_uint(11); - `); - - if (enabledMasterchain(ctx.ctx)) { - ctx.write(` - throw_unless(${contractErrors.invalidAddress.id}, (h == 1024) | (h == 1279)); - `); - } else { - ctx.write(` - throw_if(${contractErrors.masterchainNotEnabled.id}, h == 1279); - throw_unless(${contractErrors.invalidAddress.id}, h == 1024); - `); - } - ctx.write(` - return address; - `); - }); - }); - ctx.fun("__tact_load_address", () => { ctx.signature(`(slice, slice) __tact_load_address(slice cs)`); ctx.flag("inline"); @@ -53,7 +25,7 @@ export function writeStdlib(ctx: WriterContext): void { ctx.body(() => { ctx.write(` slice raw = cs~load_msg_addr(); - return (cs, ${ctx.used(`__tact_verify_address`)}(raw)); + return (cs, raw); `); }); }); @@ -66,7 +38,7 @@ export function writeStdlib(ctx: WriterContext): void { ctx.write(` if (cs.preload_uint(2) != 0) { slice raw = cs~load_msg_addr(); - return (cs, ${ctx.used(`__tact_verify_address`)}(raw)); + return (cs, raw); } else { cs~skip_bits(2); return (cs, null()); @@ -81,9 +53,7 @@ export function writeStdlib(ctx: WriterContext): void { ctx.context("stdlib"); ctx.body(() => { ctx.write(` - return b.store_slice(${ctx.used( - `__tact_verify_address`, - )}(address)); + return b.store_slice(address); `); }); }); @@ -118,7 +88,7 @@ export function writeStdlib(ctx: WriterContext): void { b = b.store_int(chain, 8); b = b.store_uint(hash, 256); var addr = b.end_cell().begin_parse(); - return ${ctx.used(`__tact_verify_address`)}(addr); + return addr; `); }); }); diff --git a/src/interpreter.ts b/src/interpreter.ts index e81a1e1ab..2b9268cab 100644 --- a/src/interpreter.ts +++ b/src/interpreter.ts @@ -74,7 +74,6 @@ import { showValue, } from "./types/types"; import { sha256_sync } from "@ton/crypto"; -import { enabledMasterchain } from "./config/features"; // TVM integers are signed 257-bit integers const minTvmInt: bigint = -(2n ** 256n); @@ -1228,15 +1227,6 @@ export class Interpreter { ast.loc, ); } - if ( - !enabledMasterchain(this.context) && - address.workChain !== 0 - ) { - throwErrorConstEval( - `address ${str} is from masterchain which is not enabled for this contract`, - ast.loc, - ); - } return address; } catch (_) { throwErrorConstEval( @@ -1267,12 +1257,6 @@ export class Interpreter { ast.loc, ); } - if (!enabledMasterchain(this.context) && wc !== 0n) { - throwErrorConstEval( - `${wc}:${addr.toString("hex")} address is from masterchain which is not enabled for this contract`, - ast.loc, - ); - } return new Address(Number(wc), addr); } default: diff --git a/src/pipeline/build.ts b/src/pipeline/build.ts index f892003ca..0188a7068 100644 --- a/src/pipeline/build.ts +++ b/src/pipeline/build.ts @@ -33,7 +33,6 @@ export function enableFeatures( } const features = [ { option: config.options.debug, name: "debug" }, - { option: config.options.masterchain, name: "masterchain" }, { option: config.options.external, name: "external" }, { option: config.options.experimental?.inline, name: "inline" }, { option: config.options.ipfsAbiGetter, name: "ipfsAbiGetter" }, diff --git a/src/test/e2e-emulated/__snapshots__/local-type-inference.spec.ts.snap b/src/test/e2e-emulated/__snapshots__/local-type-inference.spec.ts.snap index 5573c4ad8..b532d1103 100644 --- a/src/test/e2e-emulated/__snapshots__/local-type-inference.spec.ts.snap +++ b/src/test/e2e-emulated/__snapshots__/local-type-inference.spec.ts.snap @@ -39,12 +39,6 @@ exports[`local-type-inference should automatically set types for let statements "135": { "message": "Code of a contract was not found", }, - "136": { - "message": "Invalid address", - }, - "137": { - "message": "Masterchain support is not enabled for this contract", - }, "14": { "message": "Virtualization error", }, diff --git a/src/test/e2e-emulated/contracts/masterchain.tact b/src/test/e2e-emulated/contracts/masterchain.tact index eb9df01a7..37eae878c 100644 --- a/src/test/e2e-emulated/contracts/masterchain.tact +++ b/src/test/e2e-emulated/contracts/masterchain.tact @@ -1,6 +1,19 @@ -message TestMessage { - address: Address; - address2: Address?; +// not reusing previously used 136 and 137 exit codes +// because Tact reserves the codes from 128 to 255 +// and now this is user-land checks +const InvalidAddressExitCode: Int = 1136; +const MasterchainNotEnabled: Int = 1137; + +fun verifyAddress(addr: Address, enabledMasterChain: Bool) { + let addrSlice = addr.asSlice(); + nativeThrowUnless(InvalidAddressExitCode, addrSlice.bits() == 267); + let h = addrSlice.preloadUint(11); + if (enabledMasterChain) { + nativeThrowUnless(InvalidAddressExitCode, (h == 1024) || (h == 1279)); + } else { + nativeThrowIf(MasterchainNotEnabled, h == 1279); + nativeThrowUnless(InvalidAddressExitCode, h == 1024); + } } contract MasterchainTester { @@ -9,27 +22,11 @@ contract MasterchainTester { } - receive("Deploy") { - // Deploy - } - - receive(message: TestMessage) { - // Should fail for non-masterchain - } - - get fun createAddress(chain: Int, hash: Int): Address { - return newAddress(chain, hash); + receive("DeployToWorkchain") { + verifyAddress(sender(), false); } - get fun parseAddress(src: Slice): Address { - return src.loadAddress(); + receive("DeployToMasterchain") { + verifyAddress(sender(), true); } - - get fun serializeAddress(src: Address): Bool { - return true; // NOTE: src is unused but still have to be checked - } - - get fun handleStruct(src: TestMessage): Bool { - return true; // NOTE: src is unused but still have to be checked - } -} \ No newline at end of file +} diff --git a/src/test/e2e-emulated/masterchain.spec.ts b/src/test/e2e-emulated/masterchain.spec.ts index 40a50a961..a351dd5ee 100644 --- a/src/test/e2e-emulated/masterchain.spec.ts +++ b/src/test/e2e-emulated/masterchain.spec.ts @@ -1,7 +1,6 @@ -import { Address, beginCell, toNano } from "@ton/core"; +import { toNano } from "@ton/core"; import { Blockchain, SandboxContract, TreasuryContract } from "@ton/sandbox"; import { MasterchainTester } from "./contracts/output/masterchain_MasterchainTester"; -import { MasterchainTester as EnabledTester } from "./contracts/output/masterchain-allow_MasterchainTester"; import "@ton/test-utils"; describe("masterchain", () => { @@ -18,7 +17,7 @@ describe("masterchain", () => { // Deployment and simple message receiving // - it("should deploy to the workchain", async () => { + it("should deploy to workchain", async () => { const contract = blockchain.openContract( await MasterchainTester.fromInit(), ); @@ -26,7 +25,7 @@ describe("masterchain", () => { const deployResult = await contract.send( treasure.getSender(), { value: toNano("10") }, - "Deploy", + "DeployToWorkchain", ); expect(deployResult.transactions).toHaveTransaction({ @@ -37,26 +36,7 @@ describe("masterchain", () => { }); }); - it("should deploy to the workchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - const deployResult = await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - expect(deployResult.transactions).toHaveTransaction({ - from: treasure.address, - to: contract.address, - success: true, - deploy: true, - }); - }); - - it("should not deploy to the workchain from masterchain", async () => { + it("should not deploy to workchain from masterchain", async () => { const treasure = await blockchain.treasury("treasure", { workchain: -1, }); @@ -67,7 +47,7 @@ describe("masterchain", () => { const deployResult = await contract.send( treasure.getSender(), { value: toNano("10") }, - "Deploy", + "DeployToWorkchain", ); expect(deployResult.transactions).toHaveTransaction({ @@ -75,22 +55,22 @@ describe("masterchain", () => { to: contract.address, success: false, deploy: true, - exitCode: 137, + exitCode: 1137, }); }); - it("should deploy to the workchain from masterchain when masterchain enabled", async () => { + it("should deploy to masterchain from masterchain", async () => { const treasure = await blockchain.treasury("treasure", { workchain: -1, }); const contract = blockchain.openContract( - await EnabledTester.fromInit(), + await MasterchainTester.fromInit(), ); const deployResult = await contract.send( treasure.getSender(), { value: toNano("10") }, - "Deploy", + "DeployToMasterchain", ); expect(deployResult.transactions).toHaveTransaction({ @@ -100,323 +80,4 @@ describe("masterchain", () => { deploy: true, }); }); - - // - // newAddress - // - - it("should create address for the workchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const address = await contract.getCreateAddress(0n, 0n); - expect(address).toBeDefined(); - }); - - it("should not create address for the masterchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - await expect(contract.getCreateAddress(-1n, 0n)).rejects.toThrow( - "Unable to execute get method. Got exit_code: 137", - ); - }); - - it("should create address for the masterchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const address = await contract.getCreateAddress(-1n, 0n); - expect(address).toBeDefined(); - }); - - it("should not create address for invalid workchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - await expect(contract.getCreateAddress(10n, 0n)).rejects.toThrow( - "Unable to execute get method. Got exit_code: 136", - ); - }); - - // - // loadAddress - // - - it("should load address for the workchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(0, Buffer.alloc(32, 0)); - expect( - ( - await contract.getParseAddress( - beginCell().storeAddress(addr).endCell().asSlice(), - ) - ).equals(addr), - ).toBe(true); - }); - - it("should not load address for the masterchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(-1, Buffer.alloc(32, 0)); - await expect( - contract.getParseAddress( - beginCell().storeAddress(addr).endCell().asSlice(), - ), - ).rejects.toThrowError( - "Unable to execute get method. Got exit_code: 137", - ); - }); - - it("should load address for the workchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(0, Buffer.alloc(32, 0)); - expect( - ( - await contract.getParseAddress( - beginCell().storeAddress(addr).endCell().asSlice(), - ) - ).equals(addr), - ).toBe(true); - }); - - it("should load address for the masterchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(-1, Buffer.alloc(32, 0)); - expect( - ( - await contract.getParseAddress( - beginCell().storeAddress(addr).endCell().asSlice(), - ) - ).equals(addr), - ).toBe(true); - }); - - // - // argument of get method - // - - it("should handle address in get argument for the workchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(0, Buffer.alloc(32, 0)); - await contract.getSerializeAddress(addr); - }); - - it("should not handle address in get argument for the masterchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(-1, Buffer.alloc(32, 0)); - await expect(contract.getSerializeAddress(addr)).rejects.toThrowError( - "Unable to execute get method. Got exit_code: 137", - ); - }); - - it("should handle address in get argument for the workchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(0, Buffer.alloc(32, 0)); - await contract.getSerializeAddress(addr); - }); - - it("should handle address in get argument for the masterchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(-1, Buffer.alloc(32, 0)); - await contract.getSerializeAddress(addr); - }); - - // - // argument of get method in struct - // - - it("should handle address in get argument struct for the workchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(0, Buffer.alloc(32, 0)); - await contract.getHandleStruct({ - $$type: "TestMessage", - address: addr, - address2: null, - }); - await contract.getHandleStruct({ - $$type: "TestMessage", - address: addr, - address2: addr, - }); - }); - - it("should not handle address in get argument struct for the masterchain", async () => { - const contract = blockchain.openContract( - await MasterchainTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(-1, Buffer.alloc(32, 0)); - const addr2 = new Address(0, Buffer.alloc(32, 0)); - await expect( - contract.getHandleStruct({ - $$type: "TestMessage", - address: addr, - address2: null, - }), - ).rejects.toThrowError( - "Unable to execute get method. Got exit_code: 137", - ); - await expect( - contract.getHandleStruct({ - $$type: "TestMessage", - address: addr2, - address2: addr, - }), - ).rejects.toThrowError( - "Unable to execute get method. Got exit_code: 137", - ); - }); - - it("should handle address in get argument struct for the workchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(0, Buffer.alloc(32, 0)); - await contract.getHandleStruct({ - $$type: "TestMessage", - address: addr, - address2: addr, - }); - }); - - it("should handle address in get argument struct for the masterchain when masterchain enabled", async () => { - const contract = blockchain.openContract( - await EnabledTester.fromInit(), - ); - - await contract.send( - treasure.getSender(), - { value: toNano("10") }, - "Deploy", - ); - - const addr = new Address(-1, Buffer.alloc(32, 0)); - await contract.getHandleStruct({ - $$type: "TestMessage", - address: addr, - address2: addr, - }); - }); }); diff --git a/src/test/exit-codes/contracts/tact-reserved-contract-errors.tact b/src/test/exit-codes/contracts/tact-reserved-contract-errors.tact index f4498f444..2d569f951 100644 --- a/src/test/exit-codes/contracts/tact-reserved-contract-errors.tact +++ b/src/test/exit-codes/contracts/tact-reserved-contract-errors.tact @@ -96,22 +96,4 @@ contract ReservedContractErrorsTester with Ownable { // so let's throw it explicitly now for the tests on Blueprint's side throw(targetCode); } - - /// Exit code 136 - receive("136") { - let unsupportedChainId = 1; - dump( - // Zero address in unsupported workchain - newAddress(unsupportedChainId, 0) - ); - } - - /// Exit code 137 - receive("137") { - let masterchainId = -1; - dump( - // Zero address in masterchain without the config option set - newAddress(masterchainId, 0) - ); - } } diff --git a/src/test/exit-codes/tact-reserved-contract-errors.spec.ts b/src/test/exit-codes/tact-reserved-contract-errors.spec.ts index d29ecddff..a1f035618 100644 --- a/src/test/exit-codes/tact-reserved-contract-errors.spec.ts +++ b/src/test/exit-codes/tact-reserved-contract-errors.spec.ts @@ -64,16 +64,6 @@ describe("Tact-reserved contract errors", () => { // 135: Code of a contract was not found // NOTE: Reserved, but one has to replace the contract code to trigger it - - // 136: Invalid address - it("should test exit code 136", async () => { - await testReservedExitCode(136, contract, treasure); - }); - - // 137: Masterchain support is not enabled for this contract - it("should test exit code 137", async () => { - await testReservedExitCode(137, contract, treasure); - }); }); async function testReservedExitCode( @@ -83,8 +73,8 @@ async function testReservedExitCode( ) { expect(code).toBeGreaterThanOrEqual(128); expect(code).toBeLessThan(256); - expect([128, 130, 132, 134, 136, 137]).toContain(code); - type testedExitCodes = "128" | "130" | "132" | "134" | "136" | "137"; + expect([128, 130, 132, 134]).toContain(code); + type testedExitCodes = "128" | "130" | "132" | "134"; const sendResult = await contract.send( treasure.getSender(), diff --git a/src/types/getSupportedInterfaces.ts b/src/types/getSupportedInterfaces.ts index 0f5cd639e..2ac15702f 100644 --- a/src/types/getSupportedInterfaces.ts +++ b/src/types/getSupportedInterfaces.ts @@ -1,4 +1,4 @@ -import { enabledDebug, enabledMasterchain } from "../config/features"; +import { enabledDebug } from "../config/features"; import { CompilerContext } from "../context"; import { TypeDescription } from "./types"; @@ -12,11 +12,6 @@ export function getSupportedInterfaces( if (enabledDebug(ctx)) { interfaces.push("org.ton.debug.v0"); } - if (!enabledMasterchain(ctx)) { - interfaces.push("org.ton.chain.workchain.v0"); - } else { - interfaces.push("org.ton.chain.any.v0"); - } type.interfaces.forEach((iface) => interfaces.push(iface)); return interfaces; } diff --git a/tact.config.json b/tact.config.json index 26d48232a..cad08c5fa 100644 --- a/tact.config.json +++ b/tact.config.json @@ -109,8 +109,7 @@ "path": "./src/test/e2e-emulated/contracts/optionals.tact", "output": "./src/test/e2e-emulated/contracts/output", "options": { - "debug": true, - "masterchain": true + "debug": true } }, { @@ -262,15 +261,6 @@ "path": "./src/test/e2e-emulated/contracts/try-catch.tact", "output": "./src/test/e2e-emulated/contracts/output" }, - { - "name": "masterchain-allow", - "path": "./src/test/e2e-emulated/contracts/masterchain.tact", - "output": "./src/test/e2e-emulated/contracts/output", - "options": { - "debug": true, - "masterchain": true - } - }, { "name": "address", "path": "./src/test/e2e-emulated/contracts/address.tact", From cffb53f51a0cb531d1964a67718a4e16c435b3c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 22:12:26 +0400 Subject: [PATCH 11/29] chore(deps): bump astro (#1218) Bumps the npm_and_yarn group with 1 update in the /docs directory: [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro). Updates `astro` from 4.16.17 to 4.16.18 - [Release notes](https://github.com/withastro/astro/releases) - [Changelog](https://github.com/withastro/astro/blob/astro@4.16.18/packages/astro/CHANGELOG.md) - [Commits](https://github.com/withastro/astro/commits/astro@4.16.18/packages/astro) --- updated-dependencies: - dependency-name: astro dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package.json | 2 +- docs/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/package.json b/docs/package.json index 01148353a..7e75ba860 100644 --- a/docs/package.json +++ b/docs/package.json @@ -17,7 +17,7 @@ "@astrojs/check": "0.9.4", "@astrojs/markdown-remark": "5.3.0", "@astrojs/starlight": "0.28.4", - "astro": "4.16.17", + "astro": "4.16.18", "cspell": "^8.14.4", "hast-util-to-string": "^3.0.0", "rehype-autolink-headings": "7.1.0", diff --git a/docs/yarn.lock b/docs/yarn.lock index 3befe8455..a49eb35b5 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1620,10 +1620,10 @@ astro-expressive-code@^0.35.6: dependencies: rehype-expressive-code "^0.35.6" -astro@4.16.17: - version "4.16.17" - resolved "https://registry.npmjs.org/astro/-/astro-4.16.17.tgz#058f222c3633704b909e8621fd90b86d40072c71" - integrity sha512-OuD+BP7U6OqQLKtZ/FJkU2S+TOlifxS/OKUbZOb5p6y+LLBa1J3zHRJrIl7DUSq6eXY+9wSWwbJpD9JS+lqhxA== +astro@4.16.18: + version "4.16.18" + resolved "https://registry.npmjs.org/astro/-/astro-4.16.18.tgz#c7db47d5554d865543d6917f42b5129819c6bc88" + integrity sha512-G7zfwJt9BDHEZwlaLNvjbInIw2hPryyD654314KV/XT34pJU6SfN1S+mWa8RAkALcZNJnJXCJmT3JXLQStD3Lw== dependencies: "@astrojs/compiler" "^2.10.3" "@astrojs/internal-helpers" "0.4.1" From 70f5a701aedd7eec1246aacd558982532f91154e Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:22:27 +0100 Subject: [PATCH 12/29] feat(docs): `asm` functions (#1061) * fix(docs): correct function signatures https://github.com/tact-lang/tact-docs/issues/368 * fix(docs): "mutable" -> "mutation" functions https://github.com/tact-lang/tact-docs/issues/374 * feat(docs): rewrote the method ID section to remove logical jumps and make it more streamlined * chore: retroactive CHANGELOG edit * feat: described the stack, described Tact-flavored assembly * fix: add note that Tact assembly will be available in v1.6 --- CHANGELOG.md | 2 +- docs/astro.config.mjs | 1 + docs/cspell.json | 44 +- docs/package.json | 2 +- .../content/docs/book/assembly-functions.mdx | 657 ++++ docs/src/content/docs/book/exit-codes.mdx | 22 +- docs/src/content/docs/book/functions.mdx | 42 +- docs/src/content/docs/book/import.mdx | 4 +- docs/src/content/docs/ref/core-cells.mdx | 6 +- docs/src/content/docs/ref/core-comptime.mdx | 2 +- docs/src/content/docs/ref/core-debug.mdx | 25 +- docs/yarn.lock | 2919 +++++++++-------- 12 files changed, 2199 insertions(+), 1527 deletions(-) create mode 100644 docs/src/content/docs/book/assembly-functions.mdx diff --git a/CHANGELOG.md b/CHANGELOG.md index c3871e2be..8e7b920a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,7 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `asm` functions now support full range of Fift-asm syntax: PR [#855](https://github.com/tact-lang/tact/pull/855) +- `asm` functions now support full range of Fift-asm syntax: PR [#855](https://github.com/tact-lang/tact/pull/855), PR [#1061](https://github.com/tact-lang/tact/pull/1061) - Fix `npm` installations of Tact compiler or any of the packages depending on it by hiding unnecessary post-install runs of `husky`: PR [#870](https://github.com/tact-lang/tact/pull/870) diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 65b3500ea..fbc654998 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -163,6 +163,7 @@ export default defineConfig({ { slug: 'book/statements' }, { slug: 'book/constants' }, { slug: 'book/functions' }, + { slug: 'book/assembly-functions' }, { label: 'Communication', translations: { 'zh-CN': '交流' }, diff --git a/docs/cspell.json b/docs/cspell.json index 7b2c12f56..401d2fb9a 100644 --- a/docs/cspell.json +++ b/docs/cspell.json @@ -14,10 +14,8 @@ ], "dictionaries": ["fift-words", "tvm-instructions"], "words": [ - "ADDRAND", - "BBITS", - "BREFS", "Brujin", + "bocchi", "Cheatsheet", "Cheatsheets", "Comptime", @@ -37,51 +35,16 @@ "Komarov", "Korshakov", "Laika", - "MYADDR", "Masterchain", "Merkle", - "NEWC", "Neovim", "Nonterminal", "Novus", "Offchain", "Offchain", - "PLDDICT", - "PLDIX", - "PLDREF", - "PLDSLICEX", - "PLDUX", - "POSIX", - "PUSHINT", - "PUSHREF", - "PUSHSLICE", "Parens", "RANDU", - "RAWRESERVE", - "RAWRESERVE", - "REWRITESTDADDR", - "REWRITEVARADDR", - "SBITS", - "SDBEGINSQ", - "SDEMPTY", - "SDSKIPFIRST", - "SEMPTY", - "SENDMSG", - "SENDRAWMSG", - "SETCONTARGS", - "SETINDEXVARQ", - "SETNUMARGS", - "SREFS", - "SREMPTY", - "STBR", - "STDICT", - "STIX", "STON.fi", - "STOPTREF", - "STREF", - "STSLICER", - "STUX", - "STVARUINT", "Satoshi", "Seamus", "Sedov", @@ -89,24 +52,25 @@ "Ston", "Stonfi", "Sánchez", - "THROWIFNOT", "TIMELOCK", + "Tactina", "Tarjan", "Timeouted", "Toncoin", "Toncoins", "Topup", "Trunov", - "UBITSIZE", "Uninit", "alnum", "assgn", "astrojs", "augmentedassign", + "babecafe", "basechain", "basechain", "bitcode", "bitstring", + "bitstrings", "blockstore", "bounceable", "bounceable", diff --git a/docs/package.json b/docs/package.json index 7e75ba860..d44a87207 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "dependencies": { "@astrojs/check": "0.9.4", "@astrojs/markdown-remark": "5.3.0", - "@astrojs/starlight": "0.28.4", + "@astrojs/starlight": "0.29.3", "astro": "4.16.18", "cspell": "^8.14.4", "hast-util-to-string": "^3.0.0", diff --git a/docs/src/content/docs/book/assembly-functions.mdx b/docs/src/content/docs/book/assembly-functions.mdx new file mode 100644 index 000000000..c9b281226 --- /dev/null +++ b/docs/src/content/docs/book/assembly-functions.mdx @@ -0,0 +1,657 @@ +--- +title: Assembly functions +description: "Advanced module-level functions that allow writing TVM instructions directly in the Tact assembly" +--- + +import { Badge } from '@astrojs/starlight/components'; + +

+ +:::caution + + These are very advanced functions that require experience and vigilance in both definitions and usage. The logical errors in them are extremely hard to spot, the error messages are abysmal, and type checking isn't currently provided by Tact. + + That said, if you know what you're doing, they can offer you the smallest possible gas usage, the best performance and the most control over [TVM][tvm] execution. Remember — with great power comes great responsibility. + +::: + +Assembly functions (or asm functions for short) are module-level functions that allow you to write Tact assembly. Unlike all other functions, their bodies consist only of [TVM instructions](#tvm) and some other primitives, and don't use any Tact [statements](/book/statements) or [expressions](/book/expressions). + +```tact +// all assembly functions must start with "asm" keyword +// ↓ + asm fun answer(): Int { 42 INT } +// ------ +// Notice, that the body contains only of +// TVM instructions and some primitives, +// like numbers or bitstrings, which serve +// as arguments to the instructions +``` + +## TVM instructions {#tvm} + +In Tact, the term _TVM instruction_ refers to the command that is executed by the [TVM][tvm] during its run-time — the [compute phase](https://docs.ton.org/learn/tvm-instructions/tvm-overview#compute-phase). Where possible, Tact will try to optimize their use for you, but it won't define new ones or introduce extraneous syntax for their [pre-processing](https://docs.ton.org/v3/documentation/smart-contracts/fift/fift-and-tvm-assembly). Instead, it is recommended to combine the best of Tact and TVM instructions, as shown in the [`onchainSha256(){:tact}` example](#onchainsha256) near the end of this page. + +Each [TVM instruction][tvm-instructions], when converted to its binary representation, is an opcode (operation code) to be executed by the [TVM][tvm] plus some optional arguments to it written immediately after. However, when writing instructions in `asm{:tact}` functions, the arguments, if any, are written before the instruction and are separated by spaces. This [reverse Polish notation (RPN)](https://en.wikipedia.org/wiki/Reverse_Polish_notation) syntax is intended to show the stack-based nature of [TVM][tvm]. + +For example, the [`DROP2`](https://docs.ton.org/v3/documentation/tvm/instructions#5B) or its alias [`2DROP`](https://docs.ton.org/v3/documentation/tvm/instructions#5B), which drop (discard) two top values from the stack, have the same opcode prefix — `0x5B`, or `1011011` in binary. + +```tact +/// Pushes `a` and `b` onto the stack, then immediately drops them from it +asm fun discardTwo(a: Int, b: Int) { DROP2 } +``` + +The arguments to [TVM instructions][tvm-instructions] in Tact are called primitives — they don't manipulate the stack themselves and aren't pushed on it by themselves. Attempting to specify a primitive without the instruction that immediately consumes it will result in compilation errors. + +```tact +/// COMPILATION ERROR! +/// The 43 were meant to be an argument to some subsequent TVM instruction +/// but there weren't found any +asm fun bad(): Int { 43 } +``` + +For some instructions, the resulting opcode depends on the specified primitive. For example, the [`PUSHINT`](https://docs.ton.org/v3/documentation/tvm/instructions#7i), or its shorter alias [`INT`](https://docs.ton.org/v3/documentation/tvm/instructions#7i), have the same opcode `0x7` if the specified number argument is in the inclusive range from $-5$ to $10$. However, if the number is greater than that, the opcode changes accordingly: [`0x80`](https://docs.ton.org/v3/documentation/tvm/instructions#80xx) for arguments in the inclusive range from $-128$ to $127$, [`0x81`](https://docs.ton.org/v3/documentation/tvm/instructions#81xxxx) for arguments in the inclusive range from $-2^{15}$ to $2^{15}$, and so on. For your convenience, all these variations of opcodes are described using the same instruction name, in this case `PUSHINT`. + +```tact +asm fun push42(): Int { + // The following will be converted to 0x80 followed by 0x2A + // in their binary representation for execution by the TVM + 42 PUSHINT +} +``` + +:::note[Useful links:] + + [List of TVM instructions in TON Docs][tvm-instructions] + +::: + +## Stack calling conventions {#conventions} + +The syntax for parameters and returns is the same as for other function kinds, but there is one caveat — argument values are pushed to the stack before the function body is executed, and return type is what's captured from the stack afterward. + +### Parameters {#conventions-parameters} + +The first parameter is pushed to the stack first, the second one second, and so on, so that the first parameter is at the bottom of the stack and the last one at the top. + +```tact +asm extends fun storeCoins(self: Builder, value: Int): Builder { + // ↑ ↑ + // | Pushed last, sits on top of the stack + // Pushed first, sits on the bottom of the stack + + // Stores the value of type `Int as coins` into the Builder, + // taking the Builder from the bottom of the stack + // and Int from the top of the stack, + // producing a new Builder back + STVARUINT16 +} +``` + +Since the bodies of `asm{:tact}` functions do not contain Tact statements, any direct references to parameters in function bodies will be recognized as [TVM][tvm] instructions, which can easily lead to very obscure error messages. + +```tact +/// Simply returns back the value of `x` +asm fun identity(x: Int): Int { } + +/// COMPILATION ERROR! +/// The `BOC` is not recognized as a parameter, +/// but instead is interpreted as a non-existent TVM instruction +asm fun bocchiThe(BOC: Cell): Cell { BOC } +``` + +The parameters of arbitrary [Struct][struct] types are distributed over their fields, recursively flattened as the arguments are pushed onto the stack. In particular, the value of the first field of the [Struct][struct] is pushed first, the second is pushed second, and so on, so that the value of the first field is at the bottom of the stack and the value of the last is at the top. If there are nested structures inside those [Structs][struct], they're flattened in the same manner. + +:::note + + This behavior of [Structs][struct] is experimental and may change in future releases of Tact. When in doubt, prefer specifying multiple parameters over a single [Struct][struct] with many fields. + +::: + +```tact +// Struct with two fields of type Int +struct AB { a: Int; b: Int } + +// This will produce the sum of two fields in the `AB` Struct +asm fun sum(two: AB): Int { ADD } + +// Struct with two nested `AB` structs as its fields +struct Nested { ab1: AB; ab2: AB } + +// This will multiply the sums of fields of nested `AB` Structs +asm fun mulOfSums(n: Nested): Int { ADD -ROT ADD MUL } + +// Action! +fun showcase() { + sum(AB{ a: 27, b: 50 }); // 77 + // ↑ ↑ + // | Pushed last, sits on top of the stack + // Pushed first, sits on the bottom of the stack + + mulOfSums(Nested{ ab1: AB{ a: 1, b: 2 }, ab2: AB{ a: 3, b: 4 } }); // 21 + // ↑ ↑ ↑ ↑ + // | | | Pushed last, + // | | | sits on top of the stack + // | | Pushed second-to-last, + // | | sits below the top of the stack + // | Pushed second, + // | sits right above the bottom of the stack + // Pushed first, sits on the bottom of the stack +} +``` + +### Returns {#conventions-returns} + +When present, return type of an assembly function attempts to capture relevant values from the resulting stack after the function execution and possible stack [arrangements](#arrangements). When not present, however, assembly function does not take any values from the stack. + +When present, an assembly function's return type attempts to grab relevant values from the resulting stack after the function execution and any [result arrangements](#arrangements). If the return type is not present, however, the assembly function does not take any values from the stack. + +```tact +// Pushes `x` onto the stack, increments it there, +// but does not capture the result, leaving it on the stack +asm fun push(x: Int) { INC } +``` + +Specifying a [primitive type][p], such as an [`Int{:tact}`][int] or a [`Cell{:tact}`][cell], will make the assembly function capture the top value from the stack. If the run-time type of the taken value doesn't match the specified return type, an exception with [exit code 7](/book/exit-codes#7) will be thrown: `Type check error`. + +```tact +// CAUSES RUN-TIME ERROR WHEN CALLED! +// Pushes `x` onto the stack, does nothing else with it, +// then tries to capture it as a Cell, causing an exit code 7: Type check error +asm fun push(x: Int): Cell { } +``` + +Just like in [parameters](#conventions-parameters), arbitrary [Struct][struct] return types are distributed across their fields and recursively flattened in exactly the same order. The only differences are that they now capture values from the stack and do so in a right-to-left fashion — the last field of the [Struct][struct] grabs the topmost value from the stack, the second-to-last grabs the second to the top, and so on, so that the last field contains the value from the top of the stack and the first field contains the value from the bottom. + +```tact +// Struct with two fields of type Int +struct MinMax { minVal: Int; maxVal: Int } + +// Pushes `a` and `b` onto the stack, +// then captures two values back via the `MinMax` Struct +asm fun minmax(a: Int, b: Int): MinMax { MINMAX } +``` + +If the run-time type of some captured value doesn't match some specified field type of the [Struct][struct] or the nested [Structs][struct], if any, an exception with [exit code 7](/book/exit-codes#7) will be thrown: `Type check error`. Moreover, attempts to capture more values than there were on the stack throw an exception with [exit code 2](/book/exit-codes#2): `Stack underflow`. + +```tact +// Struct with way too many fields for initial stack to handle +struct Handler { f1: Int; f2: Int; f3: Int; f4: Int; f5: Int; f6: Int; f7: Int } + +// CAUSES RUN-TIME ERROR WHEN CALLED! +// Tries to capture 7 values from the stack and map them onto the fields of `Handler`, +// but there's just isn't that many values on the initial stack after TVM initialization, +// which causes an exit code 2 to be thrown: Stack underflow +asm fun overHandler(): Handler { } +``` + +As parameters and return values of assembly functions, [Structs][struct] can only have up to $16$ fields. Each of these fields can in turn be declared as another [Struct][struct], where each of these nested structures can also only have up to $16$ fields. This process can be repeated until there would be a total of $256$ fields of [primitive types][p] due to the [assembly function limitations](#limitations). This restriction also applies to the parameter list of assembly functions — you can only declare up to $16$ parameters. + +```tact +// Seventeen fields +struct S17 { f1:Int; f2:Int; f3:Int; f4:Int; f5:Int; f6:Int; f7:Int; f8:Int; f9:Int; f10:Int; f11:Int; f12:Int; f13:Int; f14:Int; f15:Int; f16:Int; f17:Int } + +// COMPILATION ERROR! +asm fun chuckles(imInDanger: S17) { } +``` + +## Stack registers {#stack-registers} + +The so-called _stack registers_ are a way of referring to the values at the top of the stack. In total, there are $256$ stack registers, i.e. values held on the stack at any given time. You can specify any of them using any of `s0`, `s1`, ..., `s255`, but only if the certain [TVM][tvm] instruction expects it as an argument. Otherwise, their concept is meant for succinct descriptions of the effects of a particular [TVM][tvm] instruction in text or comments to the code, not in the code itself. + +Register `s0` is the value at the top of the stack, register `s1` is the value immediately after it, and so on, until we reach the bottom of the stack, represented by `s255`, i.e. the $256$th stack register. When a value `x` is pushed onto a stack, it becomes the new `s0`. At the same time, old `s0` becomes new `s1`, old `s1` — new `s2`, and so on. + +```tact +asm fun takeSecond(a: Int, b: Int): Int { + // ↑ ↑ + // | Pushed last, sits on top of the stack + // Pushed first, sits second from the top of the stack + + // Now, let's swap the s0 (top of the stack) with s1 (second-to-top) + + // Before │ After + // ───────┼─────── + // s0 = b │ s0 = a + // s1 = a │ s1 = b + SWAP + + // Then, let's drop the value from the top of the stack + + // Before │ After + // ───────┼─────── + // s0 = a │ s0 = b + // s1 = b │ s1 is now either some value deeper or just blank + DROP + + // At the end, we have only one value on the stack, which is b + // Thus, it is captured by our return type `Int` +} + +fun showcase() { + takeSecond(5, 10); // 10, i.e. b +} +``` + +:::caution + + Attempts to access an empty stack register, i.e. one with no value at the time of access, throw an exception with [exit code 2](/book/exit-codes#2): `Stack underflow`. + + More about stack limits: [Limitations](#limitations). + +::: + +## Arrangements {#arrangements} + +Often times it's useful to change the order of arguments pushed to the stack or the order of return values without referring to stack registers in the body. You can do this with `asm{:tact}` arrangements — with them, the evaluation flow of the assembly function can be thought of in these $5$ steps: + +1. Function takes arguments in the order specified by the parameters. +2. If an argument arrangement is present, arguments are reordered before being pushed to the stack. +3. Function body, consisting of [TVM instructions][tvm-instructions] and primitives, is executed. +4. If a result arrangement is present, resulting values are reordered on the stack. +5. The resulting values are captured (partially or fully) by the return type of the function. + +The argument arrangement has the syntax `asm(arg2 arg1)`, where `arg1` and `arg2` are some arguments of the function in the order we want to push them onto the stack: `arg1` will be pushed first and get on the bottom of the stack, while `arg2` will be pushed last and get on top of the stack. Arrangements are not limited by two arguments and operate on all parameters of the function. If there are any parameters of arbitrary [Struct][struct] types, their arrangement is done prior to their flattening. + +```tact +// Changing the order of arguments to match the STDICT signature: +// `c` will be pushed first and get on the bottom of the stack, +// while `self` will be pushed last and get on top of the stack +asm(c self) extends fun asmStoreDict(self: Builder, c: Cell?): Builder { STDICT } +``` + +The return arrangement has the syntax `asm(-> 1 0)`, where $1$ and $0$ are a left-to-right reordering of [stack registers](#stack-registers) `s1` and `s0` correspondingly: the contents of `s1` will be at the top of the stack, followed by the contents of `s0`. Arrangements are not limited by two return values and operate on captured values. If an arbitrary [Struct][struct] is specified as the return type, the arrangement is done with respect to their fields, mapping values on the stack to the recursively flattened [Struct][struct]. + +```tact +// Changing the order of return values of LDVARUINT16 instruction, +// since originally it would place the modified Slice on top of the stack +asm(-> 1 0) extends fun asmLoadCoins(self: Slice): SliceInt { LDVARUINT16 } +// ↑ ↑ +// | Value of the stack register 0, +// | which is the topmost value in the stack +// Value of the stack register 1, +// which is second-to-top value in the stack +// And the return type `SliceInt`, +// which is the following Struct: +struct SliceInt { s: Slice; val: Int } +``` + +Both argument and return arrangement can be combined together and written as follows: `asm(arg2 arg1 -> 1 0)`. + +```tact +// Changing the order of return values compared to the stack +// and switching the order of arguments as well +asm(s len -> 1 0) fun asmLoadInt(len: Int, s: Slice): SliceInt { LDIX } +// ↑ ↑ +// | Value of the stack register 0, +// | which is the topmost value in the stack +// Value of the stack register 1, +// which is second-to-top value in the stack +// And the return type `SliceInt`, +// which is the following Struct: +struct SliceInt { s: Slice; val: Int } +``` + +Using all those re-arranged functions together we get: + +```tact +asm(c self) extends fun asmStoreDict(self: Builder, c: Cell?): Builder { STDICT } +asm(-> 1 0) extends fun asmLoadCoins(self: Slice): SliceInt { LDVARUINT16 } +asm(s len -> 1 0) fun asmLoadInt(len: Int, s: Slice): SliceInt { LDIX } +struct SliceInt { s: Slice; val: Int } + +fun showcase() { + let b = beginCell() + .storeCoins(42) + .storeInt(27, 10) + .asmStoreDict(emptyMap()); + + let s = b.asSlice(); + let si: SliceInt = s.asmLoadCoins(); // Slice remainder and 42 + s = si.s; // assigning the modified Slice + let coins = si.val; // 42 + let si2: SliceInt = asmLoadInt(10, s); // Slice remainder and 27 +} +``` + +Note, that arrangements do not drop or discard any values — they only manipulate the order of arguments and return values as those are declared. This means, for example, that arrangement cannot access values from the stack that are not captured by the return type of the assembly function. + +That said, there's a [caveat to `mutates{:tact}` attribute and `asm` arrangements](#caveats-mutates). + +## Limitations {#limitations} + +Attempts to drop the number of stack values below $0$ throw an exception with [exit code 2](/book/exit-codes#2): `Stack underflow`. + +```tact +asm fun drop() { DROP } + +fun exitCode2() { + // Drops way more elements from the stack + // than there were before, causing an underflow + repeat (100) { drop() } +} +``` + +The [TVM][tvm] stack itself has **no** limit on the total number of values, so you can theoretically push new values there until you run out of gas. However, various [continuations](https://docs.ton.org/v3/documentation/tvm/tvm-overview#tvm-is-a-stack-machine) may have a maximum number of values defined for their inner stacks, going over which will throw an exception with [exit code 3](/book/exit-codes#3): `stack overflow`. + +```tact +asm fun stackOverflow() { + x{} SLICE // s + BLESS // c + 0 SETNUMARGS // c' + 2 PUSHINT // c' 2 + SWAP // 2 c' + 1 -1 SETCONTARGS // ← this blows up +} + +fun exitCode3() { + // Overflows the inner stack of a continuation + stackOverflow(); +} +``` + +Although there are only $256$ [stack registers](#stack-registers), the stack itself can have more than $256$ values on it in total. The deeper values won't be immediately accessible by any [TVM instructions][tvm-instructions], but they would be on the stack nonetheless. + +## Caveats {#caveats} + +### Case sensitivity {#caveats-case} + +[TVM instructions][tvm-instructions] are case-sensitive and are always written in upper case (capital letters). + +```tact +/// ERROR! +asm fun bad1(): Cell { mycode } + +/// ERROR! +asm fun bad2(): Cell { MyCoDe } + +/// 👍 +asm fun good(): Cell { MYCODE } +``` + +### No double quotes needed {#caveats-quotes} + +It is not necessary to enclose [TVM instructions][tvm-instructions] in double quotes. On the contrary, they are then interpreted as strings, which is probably _not_ what you want: + +```tact +// Pushes the string "MYCODE" onto the compile-time stack, +// where it gets discarded even before the compute phase starts +asm fun wrongMyCode() { "MYCODE" } + +// Invokes the TVM instruction MYCODE during the compute phase, +// which returns the contract code as a Cell +asm fun myCode(): Cell { MYCODE } +``` + +### `mutates` consumes an extra value {#caveats-mutates} + +Specifying a [`mutates{:tact}`](/book/functions#mutation-functions) attribute, i.e. defining a mutation function, makes the assembly function consume one more value deeper into the stack than the declared return values. Consider the following example: + +```tact +asm(-> 1 0) extends mutates fun loadRef(self: Slice): Cell { LDREF } +``` + +There, `LDREF` instruction produces two stack entries: a [`Cell{:tact}`][cell] and a modified [`Slice{:tact}`][slice] in that order, with the [`Slice{:tact}`][slice] pushed on top of the stack. Then, the arrangement `-> 1 0{:tact}` inverses those values, making the [`Cell{:tact}`][cell] sit on top of the stack. + +Finally, the [`mutates{:tact}`](/book/functions#mutation-functions) attribute makes the function consume the deepest value on the stack, i.e. [`Slice{:tact}`][slice], and assign it to `self{:tact}`, while returning the [`Cell{:tact}`][cell] value to the caller. + +Overall, [`mutates{:tact}`](/book/functions#mutation-functions) attribute can be useful in some cases, but you must stay vigilant when using it with assembly functions. + +:::caution + + If the type of the deepest value on the stack won't match the type of `self{:tact}`, then an exception with [exit code 7](/book/exit-codes#7) will be thrown: `Type check error`. + +::: + +### Don't rely on initial stack values {#caveats-initial} + +The [TVM][tvm] places a couple of values onto its stack upon initialization, and those values are based on the [event that caused the transaction][tvm-init]. In other languages you might've had to rely on their order and types, while in Tact the parsing is done for you. Thus, in Tact these initial stack values are different from [what's described in TON Docs][tvm-init]. + +:::caution + + The initial elements placed on the stack during the [TVM initialization][tvm-init] and altered by Tact **must** remain on the stack until the end of the function body and be the only values present there. If they don't, an exception with [exit code 7](/book/exit-codes#7) is thrown: `Type check error`. + +::: + +Therefore, to access details such as the amount of [nanoToncoins](/book/integers#nanotoncoin) in a message or the [`Address{:tact}`][p] of the sender it's strongly recommended to call the [`context(){:tact}`](/ref/core-common#context) or [`sender(){:tact}`](/ref/core-common#sender) functions instead of attempting to look for those values on the stack. + +## Debugging {#debugging} + +The number of values the stack has at any given time is called the _depth_, and it's accessible via the [`DEPTH`](https://docs.ton.org/v3/documentation/tvm/instructions#68) instruction. It's quite handy for seeing the number of values before and after calling the assembly functions you're debugging, and can be used within asm logic. + +```tact +asm fun depth(): Int { DEPTH } +``` + +To see both the stack depth and the values on it, there's a function in the Core library of Tact: [`dumpStack(){:tact}`](/ref/core-debug#dumpstack). It's great for keeping track of the stack while debugging, although it's computationally expensive and only prints values, not returns them, so use it sparingly and only when testing. + +Read more about debugging Tact contracts on the dedicated page: [Debugging](/book/debug). + +## Attributes {#attributes} + +The following attributes can be specified: + +* `inline{:tact}` — does nothing, since assembly functions are always inlined. +* [`extends{:tact}`](/book/functions#extension-function) — makes it an [extension function](/book/functions#extension-function). +* [`mutates{:tact}`](/book/functions#mutation-functions) (along with [`extends{:tact}`](/book/functions#extension-function)) — makes it an [extension mutation function](/book/functions#mutation-functions). + +Those attributes _cannot_ be specified: + +* `abstract{:tact}` — assembly functions must have a body defined. +* `virtual{:tact}` and `override{:tact}` — assembly functions cannot be defined within a contract or a trait. +* [`get{:tact}`](/book/functions#getter-functions) — assembly functions cannot be [getters](/book/functions#getter-functions). + +```tact +/// `Builder.storeCoins()` extension function +asm extends fun storeCoins(self: Builder, value: Int): Builder { + STVARUINT16 +} + +/// `Slice.skipBits()` extension mutation function +asm extends mutates fun skipBits(self: Slice, l: Int) { + SDSKIPFIRST +} +``` + +## Interesting examples {#examples} + +On the [TVM instructions][tvm-instructions] page, you may have noticed that the "signatures" of instructions are written in a special form called _stack notation_, which describes the state of the stack before and after the given instruction is executed. + +For example, `x y - z` describes an instruction that grabs two values `x` and `y` from the stack, with `y` at the top of the stack and `x` second to the top, and then pushes the result `z` onto the stack. Notice that other values deeper down the stack are not accessed. + +That notation omits the type info and only implicitly describes the state of stack registers, so for the following examples we'll use a different one, combining the notions of parameters and return values with the stack notation like this: + +```tact +// The types of parameters +// | | and types of return values are shown +// ↓ ↓ ↓ +// x:Int, y:Int → z:Int — all comma-separated +// ———————————————————— +// s1 s0 → s0 +// ↑ ↑ ↑ +// And the stack registers are shown too, +// which helps visually map them onto parameters and return values +``` + +When there are literals involved, they'll be shown as is. Additionally, when values on the stack do not represent the parameters or [Struct][struct] fields of the return type, only their type is given. + +### keccak256 + +```tact +// Computes and returns the Keccak-256 hash as an 256-bit unsigned `Int` +// from a passed `Slice` `s`. Uses the Ethereum-compatible implementation. +asm fun keccak256(s: Slice): Int { + // s:Slice → s:Slice, 1 + // ————————————————————— + // s0 → s1 s0 + ONE + + // s:Slice, 1 → h:Int + // ——————————————————— + // s1 s0 → s0 + HASHEXT_KECCAK256 +} +``` + +The [`HASHEXT_SHA256`](https://docs.ton.org/v3/documentation/tvm/instructions#F90400) and [`HASHEXT_BLAKE2B`](https://docs.ton.org/v3/documentation/tvm/instructions#F90402) instructions can be used in the similar manner, with respect to different number of return values. In addition, all of those can also work with values of type [`Builder{:tact}`][builder]. + +The [`HASHEXT_KECCAK512`](https://docs.ton.org/v3/documentation/tvm/instructions#F90404) and [`HASHEXT_SHA512`](https://docs.ton.org/v3/documentation/tvm/instructions#F90401), however, put a tuple of two integers on the stack instead of putting two separate integers there. Because of that, you'd need to also add the `UNPAIR` instruction right after them. + +```tact +// Computes and returns the Keccak-512 hash in two 256-bit unsigned `Int` +// values from a passed `Slice` `s`. Uses the Ethereum-compatible implementation. +asm fun keccak256(s: Slice): Hash512 { + // s:Slice → s:Slice, 1 + // ————————————————————— + // s0 → s1 s0 + ONE + + // s:Slice, 1 → Tuple(h1:Int, h2:Int) + // ——————————————————————————————————— + // s1 s0 → s0 + HASHEXT_KECCAK512 + + // Tuple(h1:Int, h2:Int) → h1:Int, h2:Int + // ————————————————————————————————————— + // s0 → s1 s2 + UNPAIR // could've used UNTUPLE in a more general case too +} + +// Helper Struct +struct Hash512 { h1: Int; h2: Int } +``` + +:::note[Useful links:] + + [`HASHEXT_KECCAK256`](https://docs.ton.org/v3/documentation/tvm/instructions#F90403)\ + [`HASHEXT_KECCAK512`](https://docs.ton.org/v3/documentation/tvm/instructions#F90404)\ + [Reference Keccak-256 implementation](https://keccak.team/index.html) + +::: + +### isUint8 + +Mapping onto a single instruction by itself is inefficient if the values they place onto the stack can vary depending on some conditions. That's because one cannot map them to Tact types directly and often needs to some additional stack manipulations prior or post to their execution. + +Since this is often the case for the "quiet" versions of instructions, the recommendation is to prefer their non-quiet alternatives. Usually, non-quiet versions throw exceptions and are consistent in their return values, while quiet ones push $-1$ or other values onto the stack, thus varying the number or the type of their result values. + +For the simpler cases such as this example, it's convenient to do all the stack manipulations within the same function. + +```tact +// Checks if the given `Int` `val` is in +// the inclusive range from 0 to 255 +asm fun isUint8(val: Int): Bool { + // val:Int → val:Int or NaN + // ———————————————————————— + // s0 → s0 + 8 QUFITS + + // val:Int or NaN → Bool + // ————————————————————— + // s0 → s0 + ISNAN + + // Since ISNAN gives true when the `val` NaN, + // i.e. when the `val` did not fit into the uint8 range, + // we need to flip it + + // Bool → Bool + // ——————————— + // s0 → s0 + NOT // could've used 0 EQINT too +} + +fun showcase() { + isUint8(55); // true + isUint8(-55); // false + isUint8(pow(2, 8)); // false + isUint8(pow(2, 8) - 1); // true +} +``` + +### ecrecover + +This example shows one possible way to work with partially captured results from the stack, getting the omitted ones later. + +```tact +// Recovers a public key from the signature like its done on Bitcoin or Ethereum +// +// Takes the 256-bit unsigned integer `hash` and the 65-byte signature of: +// * 8-bit unsigned integer `v` +// * and 256-bit unsigned integers `r` and `s` +// +// Returns `null` on failure, or `EcrecoverKey` structure on success +fun ecrecover(hash: Int, v: Int, r: Int, s: Int): EcrecoverKey? { + let successful = _ecrecoverExecute(hash, v, r, s); + if (successful) { + return _ecrecoverSuccess(); + } else { + return null; + } +} + +// The 65-byte public key returned by `ecrecover()` in case of success, +// which consists of the 8-bit unsigned integer `h` +// and 256-bit unsigned integers `x1` and `x2` +struct EcrecoverKey { + h: Int as uint8; + x1: Int as uint256; + x2: Int as uint256; +} + +// Underlying assembly function that does the work +// and only captures the topmost value from the stack +// +// Since the `ECRECOVER` instruction places the 0 on top of the stack +// in case of failure and -1 in case of success, +// this maps nicely onto the Bool type +asm fun _ecrecoverExecute(hash: Int, v: Int, r: Int, s: Int): Bool { ECRECOVER } + +// Simply captures the values from the stack +// if the call to `ecrecoverExecute()` was successful +asm fun _ecrecoverSuccess(): EcrecoverKey { } +``` + +### onchainSha256 + +This example extends the [`ecrecover(){:tact}`](#ecrecover) one and adds more complex stack management and interaction with Tact statements such as loops. + +```tact +// Calculates and returns the SHA-256 hash +// as a 256-bit unsigned `Int` of the given `data`. +// Unlike the `sha256()` function from the Core library, +// this one works purely on-chain (at runtime), hashing the strings completely, +// whereas the `sha256()` reliably works only with their first 1023 bits of data +fun onchainSha256(data: String): Int { + _onchainShaPush(data); + while (_onchainShaShouldProceed()) { + _onchainShaOperate(); + } + return _onchainShaHashExt(); +} + +// Helper assembly functions, +// each manipulating the stack in their own ways +// in different parts of the `onchainSha256()` function +asm fun _onchainShaPush(data: String) { ONE } +asm fun _onchainShaShouldProceed(): Bool { OVER SREFS 0 NEQINT } +asm fun _onchainShaOperate() { OVER LDREF s0 POP CTOS s0 s1 XCHG INC } +asm fun _onchainShaHashExt(): Int { HASHEXT_SHA256 } +``` + +:::note[Useful links:] + + [TVM overview in TON Docs][tvm]\ + [List of TVM instructions in TON Docs][tvm-instructions] + +::: + +[p]: /book/types#primitive-types +[struct]: /book/structs-and-messages#structs +[int]: /book/integers +[cell]: /book/cells#cells +[builder]: /book/cells#builders +[slice]: /book/cells#slices + +[tvm]: https://docs.ton.org/learn/tvm-instructions/tvm-overview +[tvm-instructions]: https://docs.ton.org/v3/documentation/tvm/instructions +[tvm-init]: https://docs.ton.org/v3/documentation/tvm/tvm-initialization#stack diff --git a/docs/src/content/docs/book/exit-codes.mdx b/docs/src/content/docs/book/exit-codes.mdx index cc1ca41f6..69d8e4fb9 100644 --- a/docs/src/content/docs/book/exit-codes.mdx +++ b/docs/src/content/docs/book/exit-codes.mdx @@ -128,7 +128,7 @@ This is an alternative exit code for the successful execution of the [compute ph ### 2: Stack underflow {#2} -If some operation consumed more elements than there were on the stacks, the error with exit code $2$ is thrown: `Stack underflow`. +If some operation consumed more elements than there were on the stack, the error with exit code $2$ is thrown: `Stack underflow`. ```tact asm fun drop() { DROP } @@ -153,17 +153,17 @@ contract Loot { ### 3: Stack overflow {#3} -If there are too many elements copied into a closure continuation or stored on the stack, an error with exit code $3$ is thrown: `Stack overflow`. Occurs rarely, unless you're deep in [Fift and TVM assembly](https://docs.ton.org/develop/fift/fift-and-tvm-assembly) trenches: +If there are too many elements copied into a closure continuation, an error with exit code $3$ is thrown: `Stack overflow`. Occurs rarely, unless you're deep in [Fift and TVM assembly](https://docs.ton.org/develop/fift/fift-and-tvm-assembly) trenches: ```tact // Remember kids, don't try to overflow the stack at home! asm fun stackOverflow() { - <{ - }>CONT // c - 0 SETNUMARGS // c' - 2 PUSHINT // c' 2 - SWAP // 2 c' - 1 -1 SETCONTARGS // <- this blows up + x{} SLICE // s + BLESS // c + 0 SETNUMARGS // c' + 2 PUSHINT // c' 2 + SWAP // 2 c' + 1 -1 SETCONTARGS // ← this blows up } contract ItsSoOver { @@ -242,11 +242,11 @@ try { ### 6: Invalid opcode {#6} -If you specify an instruction that is not defined in the current [TVM][tvm] version, an error with exit code $6$ is thrown: `Invalid opcode`. +If you specify an instruction that is not defined in the current [TVM][tvm] version or try to set an unsupported [code page](https://docs.ton.org/v3/documentation/tvm/tvm-overview#tvm-state), an error with exit code $6$ is thrown: `Invalid opcode`. ```tact -// No such thing -asm fun invalidOpcode() { x{D7FF} @addop } +// There's no such codepage, and attempt to set it fails +asm fun invalidOpcode() { 42 SETCP } contract OpOp { receive("I solemnly swear that I'm up to no good") { diff --git a/docs/src/content/docs/book/functions.mdx b/docs/src/content/docs/book/functions.mdx index 1a29b2be9..e2f3d27a6 100644 --- a/docs/src/content/docs/book/functions.mdx +++ b/docs/src/content/docs/book/functions.mdx @@ -9,8 +9,10 @@ Functions in Tact could be defined in different ways: * Global static function * Extension functions -* Mutable functions +* Mutation functions * Native functions +* [Assembly functions](#asm) +* [Internal functions](/book/contracts#internal-functions) * Receiver functions * Getter functions @@ -85,9 +87,9 @@ extends fun customPow(self: Int, c: Int): Int { } ``` -## Mutable functions +## Mutation functions -Mutable functions are performing mutation of a value replacing it with an execution result. To perform mutation, the function must change the `self` value. +Mutation functions are performing mutation of a value replacing it with an execution result. To perform mutation, the function must change the `self` value. ```tact extends mutates fun customPow(self: Int, c: Int) { @@ -104,7 +106,7 @@ extends mutates fun customPow(self: Int, c: Int) { Native functions are direct bindings of FunC functions: > **Note** -> Native functions could be also mutable and extension ones. +> Native functions could also be mutation and extension ones. ```tact @name(store_uint) @@ -114,6 +116,12 @@ native storeUint(s: Builder, value: Int, bits: Int): Builder; extends mutates native loadInt(self: Slice, l: Int): Int; ``` +## Assembly functions, `asm` {#asm} + +

+ +Read more about them on their dedicated page: [Assembly functions](/book/assembly-functions). + ## Receiver functions Receiver functions are special functions that are responsible for receiving messages in contracts and could be defined only within a contract or trait. @@ -144,32 +152,32 @@ contract Treasure {

-As other functions in TVM contracts, getters have their *unique* associated function selectors which are some integers ids (called *method IDs*). -Some of those integers are reserved for internal purposes, e.g. -4, -3, -2, -1, 0 are reserved IDs and -regular functions (internal to a contract and not callable from outside) are usually numbered by subsequent (small) integers starting from 1. -By default, getters have associated method IDs that are derived from their names using the [CRC16](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) algorithm as follows: -`crc16() & 0xffff) | 0x10000`. -Sometimes this can get you the same method ID for getters with different names. -If this happens, you can either rename some of the contract's getters or -specify the getter's method ID manually as a compile-time expression like so: +Like other functions in TON contracts, getters have their _unique_ associated function selectors, which are $19$-bit signed integer identifiers commonly called _method IDs_. + +Method IDs of getters are derived from their names using the [CRC16](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) algorithm as follows: `(crc16() & 0xffff) | 0x10000`. In addition, Tact compiler conditionally reserves some method IDs for use in [getters of supported interfaces](/book/contracts#interfaces), namely: $113617$ for `supported_interfaces`, $115390$ for `lazy_deployment_completed`, and $121275$ for `get_abi_ipfs`. + +Sometimes, getters with different names end up with the same method ID. If this happens, you can either rename some of the getters or manually specify the method ID as a [compile-time](/ref/core-comptime) expression like so: ```tact contract ManualMethodId { const methodId: Int = 16384 + 42; - get(self.methodId) fun methodId1(): Int { + get(self.methodId) + fun methodId1(): Int { return self.methodId; } get(crc32("crc32") + 42 & 0x3ffff | 0x4000) fun methodId2(): Int { - return 0; + return crc32("crc32") + 42 & 0x3ffff | 0x4000; } } ``` -Note that you *cannot* use method IDs that are reserved by TVM and you cannot use some initial positive integers because those will be used as function selectors by the compiler. +Unlike getters, method IDs for [internal functions](/book/contracts#internal-functions) and some special functions are obtained sequentially: integers in the inclusive range from $-4$ to $0$ are given to [certain message handlers](https://docs.ton.org/v3/documentation/smart-contracts/func/docs/functions#special-function-names), while internal functions are numbered with method IDs starting at $1$ and going up to $2^{14} - 1$ inclusive. -User-specified method IDs are 19-bit signed integers, so you can use integers from $-2^{18}$ to $-5$ and from $2^{14}$ to $2^{18} - 1$. +Since method IDs are $19$-bit signed integers and some of them are reserved, only the inclusive ranges from $-2^{18}$ to $-5$ and from $2^{14}$ to $2^{18} - 1$ are free to be used by users. To avoid collisions, it's recommended to specify method IDs only in these ranges, avoiding the method IDs of Tact-specific getters mentioned above. -Also, a few method IDs are reserved for the usage by the getters the Tact compiler can insert during compilation, those are 113617, 115390, 121275. +[p]: /book/types#primitive-types +[struct]: /book/structs-and-messages#structs +[slice]: /book/cells#slices diff --git a/docs/src/content/docs/book/import.mdx b/docs/src/content/docs/book/import.mdx index 019bc5e9d..8fb99715a 100644 --- a/docs/src/content/docs/book/import.mdx +++ b/docs/src/content/docs/book/import.mdx @@ -9,7 +9,7 @@ Additionally, Tact compiler has a versatile set of standard libraries, which com :::caution - NOTE: All imported code is combined together with yours, so it's important to avoid name collisions and always double-check the sources! + All imported code is combined together with yours, so it's important to avoid name collisions and always double-check the sources! ::: @@ -39,7 +39,7 @@ import "./relative/path/to/the/target/func/file.fc"; import "../subfolder/imported/func/file.fc"; ``` -But in order to use functions from such file, one has to declare them as `native` functions first. For example, when standard library [@stdlib/dns](/ref/stdlib-dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so: +But in order to use functions from such file, one has to declare them as `native` functions first. For example, when standard library [`@stdlib/dns`](/ref/stdlib-dns) uses a `dns.fc` FunC file, it maps FunC functions to Tact ones like so: ```tact // FunC code located in a file right next to the current Tact one: diff --git a/docs/src/content/docs/ref/core-cells.mdx b/docs/src/content/docs/ref/core-cells.mdx index 770130032..5815c171a 100644 --- a/docs/src/content/docs/ref/core-cells.mdx +++ b/docs/src/content/docs/ref/core-cells.mdx @@ -170,7 +170,7 @@ Usage example: ```tact let b: Builder = beginCell(); -let fizz: Builder = b.storeUint(42, 7); +let fizz: Builder = b.storeInt(42, 7); ``` ## Builder.storeBool @@ -960,7 +960,7 @@ fun cautiousParse(payload: Cell): GuessCoin? { ## Struct.fromSlice ```tact -extends fun fromSlice(self: Struct, cell: Slice): Struct; +extends fun fromSlice(self: Struct, slice: Slice): Struct; ``` Extension function for any structure type [Struct][struct]. @@ -1084,7 +1084,7 @@ fun cautiousParse(payload: Cell): TripleAxe? { ```tact -extends fun fromSlice(self: Message, cell: Slice): Message; +extends fun fromSlice(self: Message, slice: Slice): Message; ``` Extension function for any message type [Message][message]. diff --git a/docs/src/content/docs/ref/core-comptime.mdx b/docs/src/content/docs/ref/core-comptime.mdx index 8c1f2cb5f..5ce51955c 100644 --- a/docs/src/content/docs/ref/core-comptime.mdx +++ b/docs/src/content/docs/ref/core-comptime.mdx @@ -5,7 +5,7 @@ description: "Various compile-time global functions from the Core library of Tac import { Badge } from '@astrojs/starlight/components'; -This page lists all the built-in [global static functions](/book/functions#global-static-functions), which are evaluated at the time of building the Tact project and cannot work with non-constant, run-time data. These functions are commonly referred to as "compile-time functions". +This page lists all the built-in [global static functions](/book/functions#global-static-functions), which are evaluated at the time of building the Tact project and cannot work with non-constant, run-time data. These functions are commonly referred to as "compile-time functions" or _comptime_ functions for short. ## address diff --git a/docs/src/content/docs/ref/core-debug.mdx b/docs/src/content/docs/ref/core-debug.mdx index 3ca7afb08..3b05cb81a 100644 --- a/docs/src/content/docs/ref/core-debug.mdx +++ b/docs/src/content/docs/ref/core-debug.mdx @@ -5,11 +5,7 @@ description: "Various debugging functions from the Core library of Tact" List of functions commonly used for debugging smart contracts in Tact. -:::note - - Read more about debugging on the dedicated page: [Debugging](/book/debug). - -::: +Read more about debugging on the dedicated page: [Debugging](/book/debug). ## require @@ -110,24 +106,21 @@ dump(emit("msg".asComment())); // As emit() function doesn't return a value, dum fun dumpStack(); ``` -Prints all the values of [persistent state variables](/book/contracts#variables) to the contract's debug console. Evaluated only if the `debug` option in the [configuration file](/book/config) is set to `true{:json}`, otherwise does nothing. +Prints the total stack depth and up to $255$ of its values from the top to the contract's debug console. The values are positioned bottom-up: from the deepest value on the left to the topmost value on the right. Evaluated only if the `debug` option in the [configuration file](/book/config) is set to `true{:json}`, otherwise does nothing. Usage example: -```tact {6} -contract DumpsterFire { - var1: Int = 0; - var2: Int = 5; - - receive() { - dumpStack(); // would print 0 5 - } -} +```tact +dumpStack(); // prints: + // File filename.tact:1:1 + // dumpStack() + // stack(3 values) : 100000000 C{96...C7} 0 ``` :::note[Useful links:] - [Debug with `dump(){:tact}`](/book/debug#tests-dump) + [Debug with `dump(){:tact}`](/book/debug#tests-dump)\ + [Assembly functions](/book/assembly-functions) ::: diff --git a/docs/yarn.lock b/docs/yarn.lock index a49eb35b5..9ec4bc355 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -4,7 +4,7 @@ "@ampproject/remapping@^2.2.0": version "2.3.0" - resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz" + resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== dependencies: "@jridgewell/gen-mapping" "^0.3.5" @@ -22,12 +22,12 @@ "@astrojs/compiler@^2.10.3": version "2.10.3" - resolved "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.3.tgz" + resolved "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.3.tgz#852386445029f7765a70b4c1d1140e175e1d8c27" integrity sha512-bL/O7YBxsFt55YHU021oL+xz+B/9HvGNId3F9xURN16aeqDK9juHGktdkCSXz+U4nqFACq6ZFvWomOzhV+zfPw== "@astrojs/internal-helpers@0.4.1": version "0.4.1" - resolved "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.4.1.tgz" + resolved "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.4.1.tgz#ceb5de49346dbdbfb6cba1b683c07fef7df56e1c" integrity sha512-bMf9jFihO8YP940uD70SI/RDzIhUHJAolWVcO1v5PUivxGKvfLZTLTVVxEYzGYyPsA3ivdLNqMnL5VgmQySa+g== "@astrojs/language-server@^2.15.0": @@ -54,30 +54,6 @@ vscode-html-languageservice "^5.2.0" vscode-uri "^3.0.8" -"@astrojs/markdown-remark@5.2.0": - version "5.2.0" - resolved "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-5.2.0.tgz" - integrity sha512-vWGM24KZXz11jR3JO+oqYU3T2qpuOi4uGivJ9SQLCAI01+vEkHC60YJMRvHPc+hwd60F7euNs1PeOEixIIiNQw== - dependencies: - "@astrojs/prism" "3.1.0" - github-slugger "^2.0.0" - hast-util-from-html "^2.0.1" - hast-util-to-text "^4.0.2" - import-meta-resolve "^4.1.0" - mdast-util-definitions "^6.0.0" - rehype-raw "^7.0.0" - rehype-stringify "^10.0.0" - remark-gfm "^4.0.0" - remark-parse "^11.0.0" - remark-rehype "^11.1.0" - remark-smartypants "^3.0.2" - shiki "^1.10.3" - unified "^11.0.5" - unist-util-remove-position "^5.0.0" - unist-util-visit "^5.0.0" - unist-util-visit-parents "^6.0.1" - vfile "^6.0.2" - "@astrojs/markdown-remark@5.3.0": version "5.3.0" resolved "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-5.3.0.tgz#fd1f8874f2bd1e2c33a7447d069fc75005b677f2" @@ -103,17 +79,17 @@ vfile "^6.0.3" "@astrojs/mdx@^3.1.3": - version "3.1.7" - resolved "https://registry.npmjs.org/@astrojs/mdx/-/mdx-3.1.7.tgz" - integrity sha512-8lGdCt+S0TrZgQpbcP3fQJc4cTeacAirtz9TpAMtHCWrQGW8slKt3WG4/0N+bhZgYRC4h5AT5drzFz+y3wvmsg== + version "3.1.9" + resolved "https://registry.npmjs.org/@astrojs/mdx/-/mdx-3.1.9.tgz#f8c56d36a580f205cce51672bcc33bdf5f770f49" + integrity sha512-3jPD4Bff6lIA20RQoonnZkRtZ9T3i0HFm6fcDF7BMsKIZ+xBP2KXzQWiuGu62lrVCmU612N+SQVGl5e0fI+zWg== dependencies: - "@astrojs/markdown-remark" "5.2.0" - "@mdx-js/mdx" "^3.0.1" - acorn "^8.12.1" + "@astrojs/markdown-remark" "5.3.0" + "@mdx-js/mdx" "^3.1.0" + acorn "^8.14.0" es-module-lexer "^1.5.4" estree-util-visit "^2.0.0" gray-matter "^4.0.3" - hast-util-to-html "^9.0.2" + hast-util-to-html "^9.0.3" kleur "^4.1.5" rehype-raw "^7.0.0" remark-gfm "^4.0.0" @@ -124,37 +100,39 @@ "@astrojs/prism@3.1.0": version "3.1.0" - resolved "https://registry.npmjs.org/@astrojs/prism/-/prism-3.1.0.tgz" + resolved "https://registry.npmjs.org/@astrojs/prism/-/prism-3.1.0.tgz#1b70432e0b16fafda191ce780c2820822a55bc46" integrity sha512-Z9IYjuXSArkAUx3N6xj6+Bnvx8OdUSHA8YoOgyepp3+zJmtVYJIl/I18GozdJVW1p5u/CNpl3Km7/gwTJK85cw== dependencies: prismjs "^1.29.0" "@astrojs/sitemap@^3.1.6": - version "3.1.6" - resolved "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.1.6.tgz" - integrity sha512-1Qp2NvAzVImqA6y+LubKi1DVhve/hXXgFvB0szxiipzh7BvtuKe4oJJ9dXSqaubaTkt4nMa6dv6RCCAYeB6xaQ== + version "3.2.1" + resolved "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.2.1.tgz#ed3874861fbca83f9ca3e66ac24a0f7ae3f9cf49" + integrity sha512-uxMfO8f7pALq0ADL6Lk68UV6dNYjJ2xGUzyjjVj60JLBs5a6smtlkBYv3tQ0DzoqwS7c9n4FUx5lgv0yPo/fgA== dependencies: - sitemap "^7.1.2" + sitemap "^8.0.0" stream-replace-string "^2.0.0" zod "^3.23.8" -"@astrojs/starlight@0.28.4": - version "0.28.4" - resolved "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.28.4.tgz#7919226382eb99f0d2ba608561682df15beea057" - integrity sha512-SU0vgCQCQZ6AuA84doxpGr5Aowr9L/PalddUbeDWSzkjE/YierFcvmBg78cSB0pdL0Q1v4k4l+wqhz176wHmTA== +"@astrojs/starlight@0.29.3": + version "0.29.3" + resolved "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.29.3.tgz#9efde9dd695e2b6db1e352af7de3d956c0a25401" + integrity sha512-dzKuGBA7sodGV2dCzpby6UKMx/4b7WrhcYDYlhfX5Ntxh8DCdGU1hIu8jHso/LeFv/jNAfi7m6C7+w/PNSYRgA== dependencies: "@astrojs/mdx" "^3.1.3" "@astrojs/sitemap" "^3.1.6" "@pagefind/default-ui" "^1.0.3" "@types/hast" "^3.0.4" + "@types/js-yaml" "^4.0.9" "@types/mdast" "^4.0.4" - astro-expressive-code "^0.35.6" + astro-expressive-code "^0.38.3" bcp-47 "^2.1.0" hast-util-from-html "^2.0.1" hast-util-select "^6.0.2" hast-util-to-string "^3.0.0" hastscript "^9.0.0" i18next "^23.11.5" + js-yaml "^4.1.0" mdast-util-directive "^3.0.0" mdast-util-to-markdown "^2.1.0" mdast-util-to-string "^4.0.0" @@ -168,7 +146,7 @@ "@astrojs/telemetry@3.1.0": version "3.1.0" - resolved "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.1.0.tgz" + resolved "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.1.0.tgz#1038bea408a0f8cf363fb939afeefed751f1f86f" integrity sha512-/ca/+D8MIKEC8/A9cSaPUqQNZm+Es/ZinRv0ZAzvu2ios7POQSsVD+VOj7/hypWNsNM3T7RpfgNq7H2TU1KEHA== dependencies: ci-info "^4.0.0" @@ -186,19 +164,19 @@ dependencies: yaml "^2.5.0" -"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz#9374b5cd068d128dac0b94ff482594273b1c2815" - integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== +"@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": + version "7.26.2" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== dependencies: "@babel/helper-validator-identifier" "^7.25.9" js-tokens "^4.0.0" picocolors "^1.0.0" "@babel/compat-data@^7.25.9": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" - integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.3.tgz#99488264a56b2aded63983abd6a417f03b92ed02" + integrity sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g== "@babel/core@^7.26.0": version "7.26.0" @@ -221,13 +199,13 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.25.9", "@babel/generator@^7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz#505cc7c90d92513f458a477e5ef0703e7c91b8d7" - integrity sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w== +"@babel/generator@^7.26.0", "@babel/generator@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" + integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== dependencies: - "@babel/parser" "^7.26.0" - "@babel/types" "^7.26.0" + "@babel/parser" "^7.26.3" + "@babel/types" "^7.26.3" "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" @@ -295,19 +273,12 @@ "@babel/template" "^7.25.9" "@babel/types" "^7.26.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.25.4": - version "7.25.6" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz" - integrity sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q== +"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.25.4", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" + integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== dependencies: - "@babel/types" "^7.25.6" - -"@babel/parser@^7.25.9", "@babel/parser@^7.26.0": - version "7.26.1" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.1.tgz#44e02499960df2cdce2c456372a3e8e0c3c5c975" - integrity sha512-reoQYNiAJreZNsJzyrDNzFQ+IQ5JFiIzAHJg9bn94S3l+4++J7RsIhNMoB+lgP/9tpmiAQqspv+xfdxTSzREOw== - dependencies: - "@babel/types" "^7.26.0" + "@babel/types" "^7.26.3" "@babel/plugin-syntax-jsx@^7.25.9": version "7.25.9" @@ -328,9 +299,9 @@ "@babel/types" "^7.25.9" "@babel/runtime@^7.23.2": - version "7.25.6" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz" - integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ== + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" + integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== dependencies: regenerator-runtime "^0.14.0" @@ -344,430 +315,443 @@ "@babel/types" "^7.25.9" "@babel/traverse@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" - integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== + version "7.26.4" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz#ac3a2a84b908dde6d463c3bfa2c5fdc1653574bd" + integrity sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w== dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/generator" "^7.25.9" - "@babel/parser" "^7.25.9" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.3" + "@babel/parser" "^7.26.3" "@babel/template" "^7.25.9" - "@babel/types" "^7.25.9" + "@babel/types" "^7.26.3" debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.4", "@babel/types@^7.25.6", "@babel/types@^7.25.9", "@babel/types@^7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" - integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.4", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== dependencies: "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@cspell/cspell-bundled-dicts@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.4.tgz" - integrity sha512-JHZOpCJzN6fPBapBOvoeMxZbr0ZA11ZAkwcqM4w0lKoacbi6TwK8GIYf66hHvwLmMeav75TNXWE6aPTvBLMMqA== - dependencies: - "@cspell/dict-ada" "^4.0.2" - "@cspell/dict-aws" "^4.0.4" - "@cspell/dict-bash" "^4.1.4" - "@cspell/dict-companies" "^3.1.4" - "@cspell/dict-cpp" "^5.1.16" - "@cspell/dict-cryptocurrencies" "^5.0.0" - "@cspell/dict-csharp" "^4.0.2" - "@cspell/dict-css" "^4.0.13" - "@cspell/dict-dart" "^2.2.1" - "@cspell/dict-django" "^4.1.0" - "@cspell/dict-docker" "^1.1.7" - "@cspell/dict-dotnet" "^5.0.5" - "@cspell/dict-elixir" "^4.0.3" - "@cspell/dict-en-common-misspellings" "^2.0.4" +"@cspell/cspell-bundled-dicts@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.1.tgz#61adad73f1bb1e12b182ffa04423d6052b18f0fc" + integrity sha512-HmkXS5uX4bk/XxsRS4Q+zRvhgRa81ddGiR2/Xfag9MIi5L5UnEJ4g21EpmIlXkMxYrTu2fp69SZFss5NfcFF9Q== + dependencies: + "@cspell/dict-ada" "^4.0.5" + "@cspell/dict-al" "^1.0.3" + "@cspell/dict-aws" "^4.0.7" + "@cspell/dict-bash" "^4.1.8" + "@cspell/dict-companies" "^3.1.8" + "@cspell/dict-cpp" "^6.0.2" + "@cspell/dict-cryptocurrencies" "^5.0.3" + "@cspell/dict-csharp" "^4.0.5" + "@cspell/dict-css" "^4.0.16" + "@cspell/dict-dart" "^2.2.4" + "@cspell/dict-django" "^4.1.3" + "@cspell/dict-docker" "^1.1.11" + "@cspell/dict-dotnet" "^5.0.8" + "@cspell/dict-elixir" "^4.0.6" + "@cspell/dict-en-common-misspellings" "^2.0.7" "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.23" - "@cspell/dict-filetypes" "^3.0.4" - "@cspell/dict-flutter" "^1.0.0" - "@cspell/dict-fonts" "^4.0.0" - "@cspell/dict-fsharp" "^1.0.1" - "@cspell/dict-fullstack" "^3.2.0" - "@cspell/dict-gaming-terms" "^1.0.5" - "@cspell/dict-git" "^3.0.0" - "@cspell/dict-golang" "^6.0.12" - "@cspell/dict-google" "^1.0.1" - "@cspell/dict-haskell" "^4.0.1" - "@cspell/dict-html" "^4.0.5" - "@cspell/dict-html-symbol-entities" "^4.0.0" - "@cspell/dict-java" "^5.0.7" - "@cspell/dict-julia" "^1.0.1" - "@cspell/dict-k8s" "^1.0.6" - "@cspell/dict-latex" "^4.0.0" - "@cspell/dict-lorem-ipsum" "^4.0.0" - "@cspell/dict-lua" "^4.0.3" - "@cspell/dict-makefile" "^1.0.0" - "@cspell/dict-monkeyc" "^1.0.6" - "@cspell/dict-node" "^5.0.1" - "@cspell/dict-npm" "^5.1.4" - "@cspell/dict-php" "^4.0.10" - "@cspell/dict-powershell" "^5.0.8" - "@cspell/dict-public-licenses" "^2.0.8" - "@cspell/dict-python" "^4.2.6" - "@cspell/dict-r" "^2.0.1" - "@cspell/dict-ruby" "^5.0.3" - "@cspell/dict-rust" "^4.0.5" - "@cspell/dict-scala" "^5.0.3" - "@cspell/dict-software-terms" "^4.1.3" - "@cspell/dict-sql" "^2.1.5" - "@cspell/dict-svelte" "^1.0.2" - "@cspell/dict-swift" "^2.0.1" - "@cspell/dict-terraform" "^1.0.1" - "@cspell/dict-typescript" "^3.1.6" - "@cspell/dict-vue" "^3.0.0" - -"@cspell/cspell-json-reporter@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.4.tgz" - integrity sha512-gJ6tQbGCNLyHS2iIimMg77as5MMAFv3sxU7W6tjLlZp8htiNZS7fS976g24WbT/hscsTT9Dd0sNHkpo8K3nvVw== - dependencies: - "@cspell/cspell-types" "8.14.4" - -"@cspell/cspell-pipe@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.4.tgz" - integrity sha512-CLLdouqfrQ4rqdQdPu0Oo+HHCU/oLYoEsK1nNPb28cZTFxnn0cuSPKB6AMPBJmMwdfJ6fMD0BCKNbEe1UNLHcw== - -"@cspell/cspell-resolver@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.4.tgz" - integrity sha512-s3uZyymJ04yn8+zlTp7Pt1WRSlAel6XVo+iZRxls3LSvIP819KK64DoyjCD2Uon0Vg9P/K7aAPt8GcxDcnJtgA== + "@cspell/dict-en_us" "^4.3.28" + "@cspell/dict-filetypes" "^3.0.9" + "@cspell/dict-flutter" "^1.0.3" + "@cspell/dict-fonts" "^4.0.3" + "@cspell/dict-fsharp" "^1.0.4" + "@cspell/dict-fullstack" "^3.2.3" + "@cspell/dict-gaming-terms" "^1.0.9" + "@cspell/dict-git" "^3.0.3" + "@cspell/dict-golang" "^6.0.17" + "@cspell/dict-google" "^1.0.4" + "@cspell/dict-haskell" "^4.0.4" + "@cspell/dict-html" "^4.0.10" + "@cspell/dict-html-symbol-entities" "^4.0.3" + "@cspell/dict-java" "^5.0.10" + "@cspell/dict-julia" "^1.0.4" + "@cspell/dict-k8s" "^1.0.9" + "@cspell/dict-latex" "^4.0.3" + "@cspell/dict-lorem-ipsum" "^4.0.3" + "@cspell/dict-lua" "^4.0.6" + "@cspell/dict-makefile" "^1.0.3" + "@cspell/dict-markdown" "^2.0.7" + "@cspell/dict-monkeyc" "^1.0.9" + "@cspell/dict-node" "^5.0.5" + "@cspell/dict-npm" "^5.1.17" + "@cspell/dict-php" "^4.0.13" + "@cspell/dict-powershell" "^5.0.13" + "@cspell/dict-public-licenses" "^2.0.11" + "@cspell/dict-python" "^4.2.13" + "@cspell/dict-r" "^2.0.4" + "@cspell/dict-ruby" "^5.0.7" + "@cspell/dict-rust" "^4.0.10" + "@cspell/dict-scala" "^5.0.6" + "@cspell/dict-software-terms" "^4.1.19" + "@cspell/dict-sql" "^2.1.8" + "@cspell/dict-svelte" "^1.0.5" + "@cspell/dict-swift" "^2.0.4" + "@cspell/dict-terraform" "^1.0.6" + "@cspell/dict-typescript" "^3.1.11" + "@cspell/dict-vue" "^3.0.3" + +"@cspell/cspell-json-reporter@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.1.tgz#c1678665f183589e5fc19a1c0933b8d362165a43" + integrity sha512-EV9Xkh42Xw3aORvDZfxusICX91DDbqQpYdGKBdPGuhgxWOUYYZKpLXsHCmDkhruMPo2m5gDh++/OqjLRPZofKQ== + dependencies: + "@cspell/cspell-types" "8.17.1" + +"@cspell/cspell-pipe@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.1.tgz#c247d4bd1c8ec43c49c46dc4458f00489e98232b" + integrity sha512-uhC99Ox+OH3COSgShv4fpVHiotR70dNvAOSkzRvKVRzV6IGyFnxHjmyVVPEV0dsqzVLxltwYTqFhwI+UOwm45A== + +"@cspell/cspell-resolver@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.1.tgz#6377c9c8c05c940fee675c74e31f893b7b2f38ab" + integrity sha512-XEK2ymTdQNgsV3ny60VkKzWskbICl4zNXh/DbxsoRXHqIRg43MXFpTNkEJ7j873EqdX7BU4opQQ+5D4stWWuhQ== dependencies: global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.4.tgz" - integrity sha512-i3UG+ep63akNsDXZrtGgICNF3MLBHtvKe/VOIH6+L+NYaAaVHqqQvOY9MdUwt1HXh8ElzfwfoRp36wc5aAvt6g== +"@cspell/cspell-service-bus@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.1.tgz#8d6d82ea3ab0fc9d7efed8523b070e4842780bd1" + integrity sha512-2sFWQtMEWZ4tdz7bw0bAx4NaV1t0ynGfjpuKWdQppsJFKNb+ZPZZ6Ah1dC13AdRRMZaG194kDRFwzNvRaCgWkQ== -"@cspell/cspell-types@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.4.tgz" - integrity sha512-VXwikqdHgjOVperVVCn2DOe8W3rPIswwZtMHfRYnagpzZo/TOntIjkXPJSfTtl/cFyx5DnCBsDH8ytKGlMeHkw== +"@cspell/cspell-types@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.1.tgz#5512030b4c2e7881a8822ab3afabbd4f5ddffb6f" + integrity sha512-NJbov7Jp57fh8addoxesjb8atg/APQfssCH5Q9uZuHBN06wEJDgs7fhfE48bU+RBViC9gltblsYZzZZQKzHYKg== -"@cspell/dict-ada@^4.0.2": - version "4.0.2" - resolved "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz" - integrity sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA== +"@cspell/dict-ada@^4.0.5": + version "4.0.5" + resolved "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.5.tgz#c14aae2faaecbad2d99f0d701e4700a48c68ef60" + integrity sha512-6/RtZ/a+lhFVmrx/B7bfP7rzC4yjEYe8o74EybXcvu4Oue6J4Ey2WSYj96iuodloj1LWrkNCQyX5h4Pmcj0Iag== -"@cspell/dict-aws@^4.0.4": - version "4.0.4" - resolved "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.4.tgz" - integrity sha512-6AWI/Kkf+RcX/J81VX8+GKLeTgHWEr/OMhGk3dHQzWK66RaqDJCGDqi7494ghZKcBB7dGa3U5jcKw2FZHL/u3w== +"@cspell/dict-al@^1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.0.3.tgz#09e288b5ab56b126dce895d3301faf7c0dd732d6" + integrity sha512-V1HClwlfU/qwSq2Kt+MkqRAsonNu3mxjSCDyGRecdLGIHmh7yeEeaxqRiO/VZ4KP+eVSiSIlbwrb5YNFfxYZbw== -"@cspell/dict-bash@^4.1.4": - version "4.1.4" - resolved "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.4.tgz" - integrity sha512-W/AHoQcJYn3Vn/tUiXX2+6D/bhfzdDshwcbQWv9TdiNlXP9P6UJjDKWbxyA5ogJCsR2D0X9Kx11oV8E58siGKQ== +"@cspell/dict-aws@^4.0.7": + version "4.0.7" + resolved "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.7.tgz#f96f3b70cd52a25b895eb08e297de5a5cc3fc5b6" + integrity sha512-PoaPpa2NXtSkhGIMIKhsJUXB6UbtTt6Ao3x9JdU9kn7fRZkwD4RjHDGqulucIOz7KeEX/dNRafap6oK9xHe4RA== -"@cspell/dict-companies@^3.1.4": - version "3.1.4" - resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.4.tgz" - integrity sha512-y9e0amzEK36EiiKx3VAA+SHQJPpf2Qv5cCt5eTUSggpTkiFkCh6gRKQ97rVlrKh5GJrqinDwYIJtTsxuh2vy2Q== +"@cspell/dict-bash@^4.1.8": + version "4.1.8" + resolved "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.8.tgz#26dc898e06eddea069cf1ad475ee0e867c89e632" + integrity sha512-I2CM2pTNthQwW069lKcrVxchJGMVQBzru2ygsHCwgidXRnJL/NTjAPOFTxN58Jc1bf7THWghfEDyKX/oyfc0yg== -"@cspell/dict-cpp@^5.1.16": - version "5.1.16" - resolved "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.16.tgz" - integrity sha512-32fU5RkuOM55IRcxjByiSoKbjr+C4danDfYjHaQNRWdvjzJzci3fLDGA2wTXiclkgDODxGiV8LCTUwCz+3TNWA== +"@cspell/dict-companies@^3.1.8": + version "3.1.9" + resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.9.tgz#c3ae263ac6b4bdee8bd836441e665c397030abfb" + integrity sha512-w7XEJ2B6x2jq9ws5XNyYgpYj2MxdZ3jW3PETLxjK7nc8pulCFmaGVgZ0JTnDWfJ3QMOczoagn5f9LM2PZ/CuJg== -"@cspell/dict-cryptocurrencies@^5.0.0": - version "5.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz" - integrity sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA== +"@cspell/dict-cpp@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.2.tgz#e4549ee1bdf4b6402c0b978eb9dd3deac0eb05df" + integrity sha512-yw5eejWvY4bAnc6LUA44m4WsFwlmgPt2uMSnO7QViGMBDuoeopMma4z9XYvs4lSjTi8fIJs/A1YDfM9AVzb8eg== -"@cspell/dict-csharp@^4.0.2": - version "4.0.2" - resolved "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz" - integrity sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g== +"@cspell/dict-cryptocurrencies@^5.0.3": + version "5.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.3.tgz#502f9fffcb2835a3379668ddebdc487678ce6207" + integrity sha512-bl5q+Mk+T3xOZ12+FG37dB30GDxStza49Rmoax95n37MTLksk9wBo1ICOlPJ6PnDUSyeuv4SIVKgRKMKkJJglA== -"@cspell/dict-css@^4.0.13": - version "4.0.13" - resolved "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.13.tgz" - integrity sha512-WfOQkqlAJTo8eIQeztaH0N0P+iF5hsJVKFuhy4jmARPISy8Efcv8QXk2/IVbmjJH0/ZV7dKRdnY5JFVXuVz37g== +"@cspell/dict-csharp@^4.0.5": + version "4.0.5" + resolved "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.5.tgz#c677c50be09ca5bb3a2cc0be15f3cd05141fd2f7" + integrity sha512-c/sFnNgtRwRJxtC3JHKkyOm+U3/sUrltFeNwml9VsxKBHVmvlg4tk4ar58PdpW9/zTlGUkWi2i85//DN1EsUCA== -"@cspell/dict-dart@^2.2.1": - version "2.2.1" - resolved "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.2.1.tgz" - integrity sha512-yriKm7QkoPx3JPSSOcw6iX9gOb2N50bOo/wqWviqPYbhpMRh9Xiv6dkUy3+ot+21GuShZazO8X6U5+Vw67XEwg== +"@cspell/dict-css@^4.0.16": + version "4.0.16" + resolved "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.16.tgz#b7b87b5ea0f1157b023205bdb00070a7d231e367" + integrity sha512-70qu7L9z/JR6QLyJPk38fNTKitlIHnfunx0wjpWQUQ8/jGADIhMCrz6hInBjqPNdtGpYm8d1dNFyF8taEkOgrQ== -"@cspell/dict-data-science@^2.0.1": - version "2.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.1.tgz" - integrity sha512-xeutkzK0eBe+LFXOFU2kJeAYO6IuFUc1g7iRLr7HeCmlC4rsdGclwGHh61KmttL3+YHQytYStxaRBdGAXWC8Lw== +"@cspell/dict-dart@^2.2.4": + version "2.2.4" + resolved "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.2.4.tgz#8b877161ccdc65cead912b742b71aa55099c1706" + integrity sha512-of/cVuUIZZK/+iqefGln8G3bVpfyN6ZtH+LyLkHMoR5tEj+2vtilGNk9ngwyR8L4lEqbKuzSkOxgfVjsXf5PsQ== -"@cspell/dict-django@^4.1.0": - version "4.1.0" - resolved "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz" - integrity sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w== +"@cspell/dict-data-science@^2.0.5": + version "2.0.5" + resolved "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.5.tgz#816e9b394c2a423d14cdc9a5de5d6fc6141d3900" + integrity sha512-nNSILXmhSJox9/QoXICPQgm8q5PbiSQP4afpbkBqPi/u/b3K9MbNH5HvOOa6230gxcGdbZ9Argl2hY/U8siBlg== -"@cspell/dict-docker@^1.1.7": - version "1.1.7" - resolved "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz" - integrity sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A== +"@cspell/dict-django@^4.1.3": + version "4.1.3" + resolved "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.3.tgz#a02a4a9ef8c9f47344f2d4a0c3964bcb62069ef5" + integrity sha512-yBspeL3roJlO0a1vKKNaWABURuHdHZ9b1L8d3AukX0AsBy9snSggc8xCavPmSzNfeMDXbH+1lgQiYBd3IW03fg== -"@cspell/dict-dotnet@^5.0.5": - version "5.0.5" - resolved "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.5.tgz" - integrity sha512-gjg0L97ee146wX47dnA698cHm85e7EOpf9mVrJD8DmEaqoo/k1oPy2g7c7LgKxK9XnqwoXxhLNnngPrwXOoEtQ== +"@cspell/dict-docker@^1.1.11": + version "1.1.11" + resolved "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.11.tgz#6fce86eb6d86d73f77e18d3e7b9747bad3ca98de" + integrity sha512-s0Yhb16/R+UT1y727ekbR/itWQF3Qz275DR1ahOa66wYtPjHUXmhM3B/LT3aPaX+hD6AWmK23v57SuyfYHUjsw== -"@cspell/dict-elixir@^4.0.3": - version "4.0.3" - resolved "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz" - integrity sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q== +"@cspell/dict-dotnet@^5.0.8": + version "5.0.8" + resolved "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.8.tgz#8a110ca302946025e0273a9940079483ec33a88a" + integrity sha512-MD8CmMgMEdJAIPl2Py3iqrx3B708MbCIXAuOeZ0Mzzb8YmLmiisY7QEYSZPg08D7xuwARycP0Ki+bb0GAkFSqg== -"@cspell/dict-en-common-misspellings@^2.0.4": - version "2.0.4" - resolved "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.4.tgz" - integrity sha512-lvOiRjV/FG4pAGZL3PN2GCVHSTCE92cwhfLGGkOsQtxSmef6WCHfHwp9auafkBlX0yFQSKDfq6/TlpQbjbJBtQ== +"@cspell/dict-elixir@^4.0.6": + version "4.0.6" + resolved "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.6.tgz#3d8965c558d8afd190356e9a900b02c546741feb" + integrity sha512-TfqSTxMHZ2jhiqnXlVKM0bUADtCvwKQv2XZL/DI0rx3doG8mEMS8SGPOmiyyGkHpR/pGOq18AFH3BEm4lViHIw== + +"@cspell/dict-en-common-misspellings@^2.0.7": + version "2.0.7" + resolved "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.7.tgz#62861cc9e813c947ebd71c7a50fc720767b4b543" + integrity sha512-qNFo3G4wyabcwnM+hDrMYKN9vNVg/k9QkhqSlSst6pULjdvPyPs1mqz1689xO/v9t8e6sR4IKc3CgUXDMTYOpA== "@cspell/dict-en-gb@1.1.33": version "1.1.33" - resolved "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz" + resolved "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.23": - version "4.3.23" - resolved "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.23.tgz" - integrity sha512-l0SoEQBsi3zDSl3OuL4/apBkxjuj4hLIg/oy6+gZ7LWh03rKdF6VNtSZNXWAmMY+pmb1cGA3ouleTiJIglbsIg== +"@cspell/dict-en_us@^4.3.28": + version "4.3.28" + resolved "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.28.tgz#41169e1ed18465e7ff367a4f4488d4cbc6cf0baa" + integrity sha512-BN1PME7cOl7DXRQJ92pEd1f0Xk5sqjcDfThDGkKcsgwbSOY7KnTc/czBW6Pr3WXIchIm6cT12KEfjNqx7U7Rrw== -"@cspell/dict-filetypes@^3.0.4": - version "3.0.4" - resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.4.tgz" - integrity sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg== - -"@cspell/dict-flutter@^1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.0.0.tgz" - integrity sha512-W7k1VIc4KeV8BjEBxpA3cqpzbDWjfb7oXkEb0LecBCBp5Z7kcfnjT1YVotTx/U9PGyAOBhDaEdgZACVGNQhayw== +"@cspell/dict-filetypes@^3.0.9": + version "3.0.9" + resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.9.tgz#f4d5c35c341e6c3b77c08aec00678412641e1504" + integrity sha512-U7ycC1cE32A5aEgwzp/iE0TVabonUFnVt+Ygbf6NsIWqEuFWZgZChC7gfztA4T1fpuj602nFdp7eOnTWKORsnQ== -"@cspell/dict-fonts@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz" - integrity sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q== +"@cspell/dict-flutter@^1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.0.3.tgz#23e552209ab2238733d30ca3f2a141359756af51" + integrity sha512-52C9aUEU22ptpgYh6gQyIdA4MP6NPwzbEqndfgPh3Sra191/kgs7CVqXiO1qbtZa9gnYHUoVApkoxRE7mrXHfg== -"@cspell/dict-fsharp@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz" - integrity sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ== +"@cspell/dict-fonts@^4.0.3": + version "4.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.3.tgz#abf578c10a2e7b2bd8f4374002677625288560d9" + integrity sha512-sPd17kV5qgYXLteuHFPn5mbp/oCHKgitNfsZLFC3W2fWEgZlhg4hK+UGig3KzrYhhvQ8wBnmZrAQm0TFKCKzsA== -"@cspell/dict-fullstack@^3.2.0": - version "3.2.0" - resolved "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.0.tgz" - integrity sha512-sIGQwU6G3rLTo+nx0GKyirR5dQSFeTIzFTOrURw51ISf+jKG9a3OmvsVtc2OANfvEAOLOC9Wfd8WYhmsO8KRDQ== +"@cspell/dict-fsharp@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.4.tgz#19a7263a61ca89cd3ec9c17537e424907b81ef38" + integrity sha512-G5wk0o1qyHUNi9nVgdE1h5wl5ylq7pcBjX8vhjHcO4XBq20D5eMoXjwqMo/+szKAqzJ+WV3BgAL50akLKrT9Rw== -"@cspell/dict-gaming-terms@^1.0.5": - version "1.0.5" - resolved "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.5.tgz" - integrity sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw== +"@cspell/dict-fullstack@^3.2.3": + version "3.2.3" + resolved "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.3.tgz#f6fff74eff00c6759cba510168acada0619004cc" + integrity sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg== -"@cspell/dict-git@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.0.tgz" - integrity sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw== +"@cspell/dict-gaming-terms@^1.0.9": + version "1.0.9" + resolved "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.9.tgz#6b920386d281b89f70857e6dacea10ab89e88658" + integrity sha512-AVIrZt3YiUnxsUzzGYTZ1XqgtkgwGEO0LWIlEf+SiDUEVLtv4CYmmyXFQ+WXDN0pyJ0wOwDazWrP0Cu7avYQmQ== -"@cspell/dict-golang@^6.0.12": - version "6.0.12" - resolved "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.12.tgz" - integrity sha512-LEPeoqd+4O+vceHF73S7D7+LYfrAjOvp4Dqzh4MT30ruzlQ77yHRSuYOJtrFN1GK5ntAt/ILSVOKg9sgsz1Llg== +"@cspell/dict-git@^3.0.3": + version "3.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.3.tgz#3a3805ab9902bffc9255ec48f648145b957eb30b" + integrity sha512-LSxB+psZ0qoj83GkyjeEH/ZViyVsGEF/A6BAo8Nqc0w0HjD2qX/QR4sfA6JHUgQ3Yi/ccxdK7xNIo67L2ScW5A== -"@cspell/dict-google@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.1.tgz" - integrity sha512-dQr4M3n95uOhtloNSgB9tYYGXGGEGEykkFyRtfcp5pFuEecYUa0BSgtlGKx9RXVtJtKgR+yFT/a5uQSlt8WjqQ== +"@cspell/dict-golang@^6.0.17": + version "6.0.17" + resolved "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.17.tgz#8f3c11189b869db7216cb4496514b9882d1e30a5" + integrity sha512-uDDLEJ/cHdLiqPw4+5BnmIo2i/TSR+uDvYd6JlBjTmjBKpOCyvUgYRztH7nv5e7virsN5WDiUWah4/ATQGz4Pw== -"@cspell/dict-haskell@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz" - integrity sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ== +"@cspell/dict-google@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.4.tgz#e15a7ea2dee73800231a81840a59d3b50d49346f" + integrity sha512-JThUT9eiguCja1mHHLwYESgxkhk17Gv7P3b1S7ZJzXw86QyVHPrbpVoMpozHk0C9o+Ym764B7gZGKmw9uMGduQ== -"@cspell/dict-html-symbol-entities@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz" - integrity sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw== +"@cspell/dict-haskell@^4.0.4": + version "4.0.4" + resolved "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.4.tgz#37e9cb9a7f5be337a697bcffd0a0d25e80aab50d" + integrity sha512-EwQsedEEnND/vY6tqRfg9y7tsnZdxNqOxLXSXTsFA6JRhUlr8Qs88iUUAfsUzWc4nNmmzQH2UbtT25ooG9x4nA== -"@cspell/dict-html@^4.0.5": - version "4.0.6" - resolved "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.6.tgz" - integrity sha512-cLWHfuOhE4wqwC12up6Doxo2u1xxVhX1A8zriR4CUD+osFQzUIcBK1ykNXppga+rt1WyypaJdTU2eV6OpzYrgQ== +"@cspell/dict-html-symbol-entities@^4.0.3": + version "4.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.3.tgz#bf2887020ca4774413d8b1f27c9b6824ba89e9ef" + integrity sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A== -"@cspell/dict-java@^5.0.7": - version "5.0.7" - resolved "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.7.tgz" - integrity sha512-ejQ9iJXYIq7R09BScU2y5OUGrSqwcD+J5mHFOKbduuQ5s/Eh/duz45KOzykeMLI6KHPVxhBKpUPBWIsfewECpQ== +"@cspell/dict-html@^4.0.10": + version "4.0.10" + resolved "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.10.tgz#7b536b2adca4b58ed92752c9d3c7ffc724dd5991" + integrity sha512-I9uRAcdtHbh0wEtYZlgF0TTcgH0xaw1B54G2CW+tx4vHUwlde/+JBOfIzird4+WcMv4smZOfw+qHf7puFUbI5g== -"@cspell/dict-julia@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.0.1.tgz" - integrity sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ== +"@cspell/dict-java@^5.0.10": + version "5.0.10" + resolved "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.10.tgz#e6383ca645046b9f05a04a2c2e858fcc80c6fc63" + integrity sha512-pVNcOnmoGiNL8GSVq4WbX/Vs2FGS0Nej+1aEeGuUY9CU14X8yAVCG+oih5ZoLt1jaR8YfR8byUF8wdp4qG4XIw== -"@cspell/dict-k8s@^1.0.6": - version "1.0.6" - resolved "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.6.tgz" - integrity sha512-srhVDtwrd799uxMpsPOQqeDJY+gEocgZpoK06EFrb4GRYGhv7lXo9Fb+xQMyQytzOW9dw4DNOEck++nacDuymg== +"@cspell/dict-julia@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.0.4.tgz#e478c20d742cd6857b6de41dc61a92036dafb4bc" + integrity sha512-bFVgNX35MD3kZRbXbJVzdnN7OuEqmQXGpdOi9jzB40TSgBTlJWA4nxeAKV4CPCZxNRUGnLH0p05T/AD7Aom9/w== -"@cspell/dict-latex@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz" - integrity sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ== +"@cspell/dict-k8s@^1.0.9": + version "1.0.9" + resolved "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.9.tgz#e9392a002797c67ffc3e96893156cc15af3774d1" + integrity sha512-Q7GELSQIzo+BERl2ya/nBEnZeQC+zJP19SN1pI6gqDYraM51uYJacbbcWLYYO2Y+5joDjNt/sd/lJtLaQwoSlA== -"@cspell/dict-lorem-ipsum@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz" - integrity sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw== +"@cspell/dict-latex@^4.0.3": + version "4.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.3.tgz#a1254c7d9c3a2d70cd6391a9f2f7694431b1b2cb" + integrity sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw== -"@cspell/dict-lua@^4.0.3": +"@cspell/dict-lorem-ipsum@^4.0.3": version "4.0.3" - resolved "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.3.tgz" - integrity sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg== + resolved "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.3.tgz#c5fc631d934f1daf8b10c88b795278701a2469ec" + integrity sha512-WFpDi/PDYHXft6p0eCXuYnn7mzMEQLVeqpO+wHSUd+kz5ADusZ4cpslAA4wUZJstF1/1kMCQCZM6HLZic9bT8A== -"@cspell/dict-makefile@^1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz" - integrity sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ== +"@cspell/dict-lua@^4.0.6": + version "4.0.6" + resolved "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.6.tgz#7de412bfaead794445e26d566aec222e20ad69ba" + integrity sha512-Jwvh1jmAd9b+SP9e1GkS2ACbqKKRo9E1f9GdjF/ijmooZuHU0hPyqvnhZzUAxO1egbnNjxS/J2T6iUtjAUK2KQ== -"@cspell/dict-monkeyc@^1.0.6": - version "1.0.6" - resolved "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.6.tgz" - integrity sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA== +"@cspell/dict-makefile@^1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.3.tgz#08d3349bf7cbd8f5dacf8641f3d35092ca0b8b38" + integrity sha512-R3U0DSpvTs6qdqfyBATnePj9Q/pypkje0Nj26mQJ8TOBQutCRAJbr2ZFAeDjgRx5EAJU/+8txiyVF97fbVRViw== -"@cspell/dict-node@^5.0.1": - version "5.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.1.tgz" - integrity sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg== +"@cspell/dict-markdown@^2.0.7": + version "2.0.7" + resolved "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.7.tgz#15d6f9eed6bd1b33921b4332426ff387961163f1" + integrity sha512-F9SGsSOokFn976DV4u/1eL4FtKQDSgJHSZ3+haPRU5ki6OEqojxKa8hhj4AUrtNFpmBaJx/WJ4YaEzWqG7hgqg== -"@cspell/dict-npm@^5.1.4": - version "5.1.5" - resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.5.tgz" - integrity sha512-oAOGWuJYU3DlO+cAsStKMWN8YEkBue25cRC9EwdiL5Z84nchU20UIoYrLfIQejMlZca+1GyrNeyxRAgn4KiivA== +"@cspell/dict-monkeyc@^1.0.9": + version "1.0.9" + resolved "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.9.tgz#58b5f6f15fc7c11ce0eeffd0742fba4b39fc0b8b" + integrity sha512-Jvf6g5xlB4+za3ThvenYKREXTEgzx5gMUSzrAxIiPleVG4hmRb/GBSoSjtkGaibN3XxGx5x809gSTYCA/IHCpA== -"@cspell/dict-php@^4.0.10": - version "4.0.10" - resolved "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.10.tgz" - integrity sha512-NfTZdp6kcZDF1PvgQ6cY0zE4FUO5rSwNmBH/iwCBuaLfJAFQ97rgjxo+D2bic4CFwNjyHutnHPtjJBRANO5XQw== +"@cspell/dict-node@^5.0.5": + version "5.0.5" + resolved "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.5.tgz#11653612ebdd833208432e8b3cbe61bd6dd35dc3" + integrity sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA== -"@cspell/dict-powershell@^5.0.8": - version "5.0.9" - resolved "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.9.tgz" - integrity sha512-Vi0h0rlxS39tgTyUtxI6L3BPHH7MLPkLWCYkNfb/buQuNJYNFdHiF4bqoqVdJ/7ZrfIfNg4i6rzocnwGRn2ruw== +"@cspell/dict-npm@^5.1.17": + version "5.1.18" + resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.18.tgz#5f748f24a96cae46a1c601da01e1d2fc3ccdb0c7" + integrity sha512-/Nukl+DSxtEWSlb8svWFSpJVctAsM9SP+f5Q1n+qdDcXNKMb1bUCo/d3QZPwyOhuMjDawnsGBUAfp+iq7Mw83Q== -"@cspell/dict-public-licenses@^2.0.8": - version "2.0.8" - resolved "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.8.tgz" - integrity sha512-Sup+tFS7cDV0fgpoKtUqEZ6+fA/H+XUgBiqQ/Fbs6vUE3WCjJHOIVsP+udHuyMH7iBfJ4UFYOYeORcY4EaKdMg== +"@cspell/dict-php@^4.0.13": + version "4.0.13" + resolved "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.13.tgz#86f1e6fb2174b2b0fa012baf86c448b2730f04f9" + integrity sha512-P6sREMZkhElzz/HhXAjahnICYIqB/HSGp1EhZh+Y6IhvC15AzgtDP8B8VYCIsQof6rPF1SQrFwunxOv8H1e2eg== -"@cspell/dict-python@^4.2.6": - version "4.2.6" - resolved "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.6.tgz" - integrity sha512-Hkz399qDGEbfXi9GYa2hDl7GahglI86JmS2F1KP8sfjLXofUgtnknyC5NWc86nzHcP38pZiPqPbTigyDYw5y8A== +"@cspell/dict-powershell@^5.0.13": + version "5.0.13" + resolved "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.13.tgz#f557aa04ee9bda4fe091308a0bcaea09ed12fa76" + integrity sha512-0qdj0XZIPmb77nRTynKidRJKTU0Fl+10jyLbAhFTuBWKMypVY06EaYFnwhsgsws/7nNX8MTEQuewbl9bWFAbsg== + +"@cspell/dict-public-licenses@^2.0.11": + version "2.0.11" + resolved "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.11.tgz#37550c4e0cd445991caba528bf4ba58ce7a935c3" + integrity sha512-rR5KjRUSnVKdfs5G+gJ4oIvQvm8+NJ6cHWY2N+GE69/FSGWDOPHxulCzeGnQU/c6WWZMSimG9o49i9r//lUQyA== + +"@cspell/dict-python@^4.2.13": + version "4.2.13" + resolved "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.13.tgz#c3dbaa7e2434c835e11540345e2168e5e685190a" + integrity sha512-mZIcmo9qif8LkJ6N/lqTZawcOk2kVTcuWIUOSbMcjyomO0XZ7iWz15TfONyr03Ea/l7o5ULV+MZ4vx76bAUb7w== dependencies: - "@cspell/dict-data-science" "^2.0.1" + "@cspell/dict-data-science" "^2.0.5" -"@cspell/dict-r@^2.0.1": - version "2.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz" - integrity sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA== +"@cspell/dict-r@^2.0.4": + version "2.0.4" + resolved "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.4.tgz#31b5abd91cc12aebfffdde4be4d2902668789311" + integrity sha512-cBpRsE/U0d9BRhiNRMLMH1PpWgw+N+1A2jumgt1if9nBGmQw4MUpg2u9I0xlFVhstTIdzXiLXMxP45cABuiUeQ== -"@cspell/dict-ruby@^5.0.3": - version "5.0.3" - resolved "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.3.tgz" - integrity sha512-V1xzv9hN6u8r6SM4CkYdsxs4ov8gjXXo0Twfx5kWhLXbEVxTXDMt7ohLTqpy2XlF5mutixZdbHMeFiAww8v+Ug== +"@cspell/dict-ruby@^5.0.7": + version "5.0.7" + resolved "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.7.tgz#3593a955baaffe3c5d28fb178b72fdf93c7eec71" + integrity sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q== -"@cspell/dict-rust@^4.0.5": - version "4.0.5" - resolved "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.5.tgz" - integrity sha512-DIvlPRDemjKQy8rCqftAgGNZxY5Bg+Ps7qAIJjxkSjmMETyDgl0KTVuaJPt7EK4jJt6uCZ4ILy96npsHDPwoXA== +"@cspell/dict-rust@^4.0.10": + version "4.0.10" + resolved "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.10.tgz#8ae6eaf31a0ebce9dc8fd8dd68e5925e1d5290ee" + integrity sha512-6o5C8566VGTTctgcwfF3Iy7314W0oMlFFSQOadQ0OEdJ9Z9ERX/PDimrzP3LGuOrvhtEFoK8pj+BLnunNwRNrw== -"@cspell/dict-scala@^5.0.3": - version "5.0.3" - resolved "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.3.tgz" - integrity sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg== +"@cspell/dict-scala@^5.0.6": + version "5.0.6" + resolved "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.6.tgz#5e925def2fe6dc27ee2ad1c452941c3d6790fb6d" + integrity sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww== -"@cspell/dict-software-terms@^4.1.3": - version "4.1.4" - resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.4.tgz" - integrity sha512-AHS25sYEzWze/aFglp9ODKSu+phjkuGx+OLwIcmOnvyn8axtSq5GCn9UqS4XG1/Qn0UG2Lgb4i5PJbZ0QNPNXQ== +"@cspell/dict-software-terms@^4.1.19": + version "4.1.20" + resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.20.tgz#8a4956bbc0df9153f792b3adb7e35035f82e679f" + integrity sha512-ma51njqbk9ZKzZF9NpCZpZ+c50EwR5JTJ2LEXlX0tX+ExVbKpthhlDLhT2+mkUh5Zvj+CLf5F9z0qB4+X3re/w== -"@cspell/dict-sql@^2.1.5": - version "2.1.5" - resolved "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.5.tgz" - integrity sha512-FmxanytHXss7GAWAXmgaxl3icTCW7YxlimyOSPNfm+njqeUDjw3kEv4mFNDDObBJv8Ec5AWCbUDkWIpkE3IpKg== +"@cspell/dict-sql@^2.1.8": + version "2.1.8" + resolved "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.8.tgz#45ea53b3e57fd2cc5f839f49b644aa743dac4990" + integrity sha512-dJRE4JV1qmXTbbGm6WIcg1knmR6K5RXnQxF4XHs5HA3LAjc/zf77F95i5LC+guOGppVF6Hdl66S2UyxT+SAF3A== -"@cspell/dict-svelte@^1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz" - integrity sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q== +"@cspell/dict-svelte@^1.0.5": + version "1.0.5" + resolved "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.5.tgz#09752e01ff6667e737566d9dfc704c8dcc9a6492" + integrity sha512-sseHlcXOqWE4Ner9sg8KsjxwSJ2yssoJNqFHR9liWVbDV+m7kBiUtn2EB690TihzVsEmDr/0Yxrbb5Bniz70mA== -"@cspell/dict-swift@^2.0.1": - version "2.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz" - integrity sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw== +"@cspell/dict-swift@^2.0.4": + version "2.0.4" + resolved "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.4.tgz#bc19522418ed68cf914736b612c4e4febbf07e8d" + integrity sha512-CsFF0IFAbRtYNg0yZcdaYbADF5F3DsM8C4wHnZefQy8YcHP/qjAF/GdGfBFBLx+XSthYuBlo2b2XQVdz3cJZBw== -"@cspell/dict-terraform@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.1.tgz" - integrity sha512-29lmUUnZgPh+ieZ5hunick8hzNIpNRtiJh9vAusNskPCrig3RTW6u7F+GG1a8uyslbzSw+Irjf40PTOan1OJJA== +"@cspell/dict-terraform@^1.0.6": + version "1.0.6" + resolved "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.6.tgz#f67b7363d0cf08c820818980bbe8c927332ad0b8" + integrity sha512-Sqm5vGbXuI9hCFcr4w6xWf4Y25J9SdleE/IqfM6RySPnk8lISEmVdax4k6+Kinv9qaxyvnIbUUN4WFLWcBPQAg== -"@cspell/dict-typescript@^3.1.6": - version "3.1.6" - resolved "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.6.tgz" - integrity sha512-1beC6O4P/j23VuxX+i0+F7XqPVc3hhiAzGJHEKqnWf5cWAXQtg0xz3xQJ5MvYx2a7iLaSa+lu7+05vG9UHyu9Q== +"@cspell/dict-typescript@^3.1.11": + version "3.1.11" + resolved "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.11.tgz#40586f13b0337bd9cba958e0661b35888580b249" + integrity sha512-FwvK5sKbwrVpdw0e9+1lVTl8FPoHYvfHRuQRQz2Ql5XkC0gwPPkpoyD1zYImjIyZRoYXk3yp9j8ss4iz7A7zoQ== -"@cspell/dict-vue@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz" - integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== +"@cspell/dict-vue@^3.0.3": + version "3.0.3" + resolved "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.3.tgz#295c288f6fd363879898223202ec3be048663b98" + integrity sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA== -"@cspell/dynamic-import@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.4.tgz" - integrity sha512-GjKsBJvPXp4dYRqsMn7n1zpnKbnpfJnlKLOVeoFBh8fi4n06G50xYr+G25CWX1WT3WFaALAavvVICEUPrVsuqg== +"@cspell/dynamic-import@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.1.tgz#2b3f3325b6013a067a1a49cda8b69ae73aaed36a" + integrity sha512-XQtr2olYOtqbg49E+8SISd6I5DzfxmsKINDn0ZgaTFeLalnNdF3ewDU4gOEbApIzGffRa1mW9t19MsiVrznSDw== dependencies: + "@cspell/url" "8.17.1" import-meta-resolve "^4.1.0" -"@cspell/filetypes@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.4.tgz" - integrity sha512-qd68dD7xTA4Mnf/wjIKYz2SkiTBshIM+yszOUtLa06YJm0aocoNQ25FHXyYEQYm9NQXCYnRWWA02sFMGs8Sv/w== +"@cspell/filetypes@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.1.tgz#d193afc5029364334f005ff23f4c4cb80170c374" + integrity sha512-AxYw6j7EPYtDFAFjwybjFpMc9waXQzurfBXmEVfQ5RQRlbylujLZWwR6GnMqofeNg4oGDUpEjcAZFrgdkvMQlA== -"@cspell/strong-weak-map@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.4.tgz" - integrity sha512-Uyfck64TfVU24wAP3BLGQ5EsAfzIZiLfN90NhttpEM7GlOBmbGrEJd4hNOwfpYsE/TT80eGWQVPRTLr5SDbXFA== +"@cspell/strong-weak-map@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.1.tgz#2fa88f283ef10222fad25134b5ebb54edaad985f" + integrity sha512-8cY3vLAKdt5gQEMM3Gr57BuQ8sun2NjYNh9qTdrctC1S9gNC7XzFghTYAfHSWR4VrOUcMFLO/izMdsc1KFvFOA== -"@cspell/url@8.14.4": - version "8.14.4" - resolved "https://registry.npmjs.org/@cspell/url/-/url-8.14.4.tgz" - integrity sha512-htHhNF8WrM/NfaLSWuTYw0NqVgFRVHYSyHlRT3i/Yv5xvErld8Gw7C6ldm+0TLjoGlUe6X1VV72JSir7+yLp/Q== +"@cspell/url@8.17.1": + version "8.17.1" + resolved "https://registry.npmjs.org/@cspell/url/-/url-8.17.1.tgz#e7daec1597fa31b4d0a7a685e7a24a11b0c8a193" + integrity sha512-LMvReIndW1ckvemElfDgTt282fb2C3C/ZXfsm0pJsTV5ZmtdelCHwzmgSBmY5fDr7D66XDp8EurotSE0K6BTvw== "@ctrl/tinycolor@^4.0.4": version "4.1.0" - resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.1.0.tgz" + resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.1.0.tgz#91a8f8120ffc9da2feb2a38f7862b300d5e9691a" integrity sha512-WyOx8cJQ+FQus4Mm4uPIZA64gbk3Wxh0so5Lcii0aJifqwoVOlfFtorjLE0Hen4OYyHZMXDWqMmaQemBhgxFRQ== "@emmetio/abbreviation@^2.3.3": version "2.3.3" - resolved "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz" + resolved "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz#ed2b88fe37b972292d6026c7c540aaf887cecb6e" integrity sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA== dependencies: "@emmetio/scanner" "^1.0.4" "@emmetio/css-abbreviation@^2.1.8": version "2.1.8" - resolved "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz" + resolved "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz#b785313486eba6cb7eb623ad39378c4e1063dc00" integrity sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw== dependencies: "@emmetio/scanner" "^1.0.4" "@emmetio/css-parser@^0.4.0": version "0.4.0" - resolved "https://registry.npmjs.org/@emmetio/css-parser/-/css-parser-0.4.0.tgz" + resolved "https://registry.npmjs.org/@emmetio/css-parser/-/css-parser-0.4.0.tgz#96135093480c79703df0e4f178f7f8f2b669fbc2" integrity sha512-z7wkxRSZgrQHXVzObGkXG+Vmj3uRlpM11oCZ9pbaz0nFejvCDmAiNDpY75+wgXOcffKpj4rzGtwGaZxfJKsJxw== dependencies: "@emmetio/stream-reader" "^2.2.0" @@ -775,152 +759,152 @@ "@emmetio/html-matcher@^1.3.0": version "1.3.0" - resolved "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-1.3.0.tgz" + resolved "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-1.3.0.tgz#43b7a71b91cdc511cb699cbe9c67bb5d4cab6754" integrity sha512-NTbsvppE5eVyBMuyGfVu2CRrLvo7J4YHb6t9sBFLyY03WYhXET37qA4zOYUjBWFCRHO7pS1B9khERtY0f5JXPQ== dependencies: "@emmetio/scanner" "^1.0.0" "@emmetio/scanner@^1.0.0", "@emmetio/scanner@^1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz" + resolved "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz#e9cdc67194fd91f8b7eb141014be4f2d086c15f1" integrity sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA== "@emmetio/stream-reader-utils@^0.1.0": version "0.1.0" - resolved "https://registry.npmjs.org/@emmetio/stream-reader-utils/-/stream-reader-utils-0.1.0.tgz" + resolved "https://registry.npmjs.org/@emmetio/stream-reader-utils/-/stream-reader-utils-0.1.0.tgz#244cb02c77ec2e74f78a9bd318218abc9c500a61" integrity sha512-ZsZ2I9Vzso3Ho/pjZFsmmZ++FWeEd/txqybHTm4OgaZzdS8V9V/YYWQwg5TC38Z7uLWUV1vavpLLbjJtKubR1A== "@emmetio/stream-reader@^2.2.0": version "2.2.0" - resolved "https://registry.npmjs.org/@emmetio/stream-reader/-/stream-reader-2.2.0.tgz" + resolved "https://registry.npmjs.org/@emmetio/stream-reader/-/stream-reader-2.2.0.tgz#46cffea119a0a003312a21c2d9b5628cb5fcd442" integrity sha512-fXVXEyFA5Yv3M3n8sUGT7+fvecGrZP4k6FnWWMSZVQf69kAq0LLpaBQLGcPR30m3zMmKYhECP4k/ZkzvhEW5kw== "@emnapi/runtime@^1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.2.0.tgz" - integrity sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ== + version "1.3.1" + resolved "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz#0fcaa575afc31f455fd33534c19381cfce6c6f60" + integrity sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw== dependencies: tslib "^2.4.0" "@esbuild/aix-ppc64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== "@esbuild/android-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== "@esbuild/android-arm@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== "@esbuild/android-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== "@esbuild/darwin-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== "@esbuild/darwin-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== "@esbuild/freebsd-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== "@esbuild/freebsd-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== "@esbuild/linux-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== "@esbuild/linux-arm@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== "@esbuild/linux-ia32@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== "@esbuild/linux-loong64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== "@esbuild/linux-mips64el@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== "@esbuild/linux-ppc64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== "@esbuild/linux-riscv64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== "@esbuild/linux-s390x@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== "@esbuild/linux-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== "@esbuild/netbsd-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== "@esbuild/openbsd-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== "@esbuild/sunos-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== "@esbuild/win32-arm64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== "@esbuild/win32-ia32@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== "@esbuild/win32-x64@0.21.5": version "0.21.5" - resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz" + resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== -"@expressive-code/core@^0.35.6": - version "0.35.6" - resolved "https://registry.npmjs.org/@expressive-code/core/-/core-0.35.6.tgz" - integrity sha512-xGqCkmfkgT7lr/rvmfnYdDSeTdCSp1otAHgoFS6wNEeO7wGDPpxdosVqYiIcQ8CfWUABh/pGqWG90q+MV3824A== +"@expressive-code/core@^0.38.3": + version "0.38.3" + resolved "https://registry.npmjs.org/@expressive-code/core/-/core-0.38.3.tgz#e5ae46ba527846370c862c534792c2f98b51f760" + integrity sha512-s0/OtdRpBONwcn23O8nVwDNQqpBGKscysejkeBkwlIeHRLZWgiTVrusT5Idrdz1d8cW5wRk9iGsAIQmwDPXgJg== dependencies: "@ctrl/tinycolor" "^4.0.4" hast-util-select "^6.0.2" @@ -932,145 +916,145 @@ unist-util-visit "^5.0.0" unist-util-visit-parents "^6.0.1" -"@expressive-code/plugin-frames@^0.35.6": - version "0.35.6" - resolved "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.35.6.tgz" - integrity sha512-CqjSWjDJ3wabMJZfL9ZAzH5UAGKg7KWsf1TBzr4xvUbZvWoBtLA/TboBML0U1Ls8h/4TRCIvR4VEb8dv5+QG3w== +"@expressive-code/plugin-frames@^0.38.3": + version "0.38.3" + resolved "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.38.3.tgz#c0ddc5f3aa170e8009aecce508e91a10366b8203" + integrity sha512-qL2oC6FplmHNQfZ8ZkTR64/wKo9x0c8uP2WDftR/ydwN/yhe1ed7ZWYb8r3dezxsls+tDokCnN4zYR594jbpvg== dependencies: - "@expressive-code/core" "^0.35.6" + "@expressive-code/core" "^0.38.3" -"@expressive-code/plugin-shiki@^0.35.6": - version "0.35.6" - resolved "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.35.6.tgz" - integrity sha512-xm+hzi9BsmhkDUGuyAWIydOAWer7Cs9cj8FM0t4HXaQ+qCubprT6wJZSKUxuvFJIUsIOqk1xXFaJzGJGnWtKMg== +"@expressive-code/plugin-shiki@^0.38.3": + version "0.38.3" + resolved "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.38.3.tgz#07186d1f76fccf9fcd288ee64990fc065586a382" + integrity sha512-kqHnglZeesqG3UKrb6e9Fq5W36AZ05Y9tCREmSN2lw8LVTqENIeCIkLDdWtQ5VoHlKqwUEQFTVlRehdwoY7Gmw== dependencies: - "@expressive-code/core" "^0.35.6" - shiki "^1.1.7" + "@expressive-code/core" "^0.38.3" + shiki "^1.22.2" -"@expressive-code/plugin-text-markers@^0.35.6": - version "0.35.6" - resolved "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.35.6.tgz" - integrity sha512-/k9eWVZSCs+uEKHR++22Uu6eIbHWEciVHbIuD8frT8DlqTtHYaaiwHPncO6KFWnGDz5i/gL7oyl6XmOi/E6GVg== +"@expressive-code/plugin-text-markers@^0.38.3": + version "0.38.3" + resolved "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.38.3.tgz#86dadb812df4bc8ebb35dd748ad3dd9fdccc1a3d" + integrity sha512-dPK3+BVGTbTmGQGU3Fkj3jZ3OltWUAlxetMHI6limUGCWBCucZiwoZeFM/WmqQa71GyKRzhBT+iEov6kkz2xVA== dependencies: - "@expressive-code/core" "^0.35.6" + "@expressive-code/core" "^0.38.3" "@img/sharp-darwin-arm64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz#ef5b5a07862805f1e8145a377c8ba6e98813ca08" integrity sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ== optionalDependencies: "@img/sharp-libvips-darwin-arm64" "1.0.4" "@img/sharp-darwin-x64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz#e03d3451cd9e664faa72948cc70a403ea4063d61" integrity sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q== optionalDependencies: "@img/sharp-libvips-darwin-x64" "1.0.4" "@img/sharp-libvips-darwin-arm64@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz#447c5026700c01a993c7804eb8af5f6e9868c07f" integrity sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg== "@img/sharp-libvips-darwin-x64@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz#e0456f8f7c623f9dbfbdc77383caa72281d86062" integrity sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ== "@img/sharp-libvips-linux-arm64@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz#979b1c66c9a91f7ff2893556ef267f90ebe51704" integrity sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA== "@img/sharp-libvips-linux-arm@1.0.5": version "1.0.5" - resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz#99f922d4e15216ec205dcb6891b721bfd2884197" integrity sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g== "@img/sharp-libvips-linux-s390x@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz#f8a5eb1f374a082f72b3f45e2fb25b8118a8a5ce" integrity sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA== "@img/sharp-libvips-linux-x64@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz#d4c4619cdd157774906e15770ee119931c7ef5e0" integrity sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw== "@img/sharp-libvips-linuxmusl-arm64@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz#166778da0f48dd2bded1fa3033cee6b588f0d5d5" integrity sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA== "@img/sharp-libvips-linuxmusl-x64@1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz" + resolved "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz#93794e4d7720b077fcad3e02982f2f1c246751ff" integrity sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw== "@img/sharp-linux-arm64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz#edb0697e7a8279c9fc829a60fc35644c4839bb22" integrity sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA== optionalDependencies: "@img/sharp-libvips-linux-arm64" "1.0.4" "@img/sharp-linux-arm@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz#422c1a352e7b5832842577dc51602bcd5b6f5eff" integrity sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ== optionalDependencies: "@img/sharp-libvips-linux-arm" "1.0.5" "@img/sharp-linux-s390x@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz#f5c077926b48e97e4a04d004dfaf175972059667" integrity sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q== optionalDependencies: "@img/sharp-libvips-linux-s390x" "1.0.4" "@img/sharp-linux-x64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz#d806e0afd71ae6775cc87f0da8f2d03a7c2209cb" integrity sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA== optionalDependencies: "@img/sharp-libvips-linux-x64" "1.0.4" "@img/sharp-linuxmusl-arm64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz#252975b915894fb315af5deea174651e208d3d6b" integrity sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g== optionalDependencies: "@img/sharp-libvips-linuxmusl-arm64" "1.0.4" "@img/sharp-linuxmusl-x64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz#3f4609ac5d8ef8ec7dadee80b560961a60fd4f48" integrity sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw== optionalDependencies: "@img/sharp-libvips-linuxmusl-x64" "1.0.4" "@img/sharp-wasm32@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz#6f44f3283069d935bb5ca5813153572f3e6f61a1" integrity sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg== dependencies: "@emnapi/runtime" "^1.2.0" "@img/sharp-win32-ia32@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz#1a0c839a40c5351e9885628c85f2e5dfd02b52a9" integrity sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ== "@img/sharp-win32-x64@0.33.5": version "0.33.5" - resolved "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz" + resolved "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz#56f00962ff0c4e0eb93d34a047d29fa995e3e342" integrity sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg== "@jridgewell/gen-mapping@^0.3.5": - version "0.3.5" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz" - integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + version "0.3.8" + resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" + integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== dependencies: "@jridgewell/set-array" "^1.2.1" "@jridgewell/sourcemap-codec" "^1.4.10" @@ -1078,31 +1062,31 @@ "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz" + resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== "@jridgewell/set-array@^1.2.1": version "1.2.1" - resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz" + resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15", "@jridgewell/sourcemap-codec@^1.5.0": version "1.5.0" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@mdx-js/mdx@^3.0.1": - version "3.0.1" - resolved "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.1.tgz" - integrity sha512-eIQ4QTrOWyL3LWEe/bu6Taqzq2HQvHcyTMaOrI95P2/LmJE7AsfPfgJGuFLPVqBUE1BC1rik3VIhU+s9u72arA== +"@mdx-js/mdx@^3.1.0": + version "3.1.0" + resolved "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz#10235cab8ad7d356c262e8c21c68df5850a97dc3" + integrity sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw== dependencies: "@types/estree" "^1.0.0" "@types/estree-jsx" "^1.0.0" @@ -1110,14 +1094,15 @@ "@types/mdx" "^2.0.0" collapse-white-space "^2.0.0" devlop "^1.0.0" - estree-util-build-jsx "^3.0.0" estree-util-is-identifier-name "^3.0.0" - estree-util-to-js "^2.0.0" + estree-util-scope "^1.0.0" estree-walker "^3.0.0" - hast-util-to-estree "^3.0.0" hast-util-to-jsx-runtime "^2.0.0" markdown-extensions "^2.0.0" - periscopic "^3.0.0" + recma-build-jsx "^1.0.0" + recma-jsx "^1.0.0" + recma-stringify "^1.0.0" + rehype-recma "^1.0.0" remark-mdx "^3.0.0" remark-parse "^11.0.0" remark-rehype "^11.0.0" @@ -1130,7 +1115,7 @@ "@nodelib/fs.scandir@2.1.5": version "2.1.5" - resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" + resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: "@nodelib/fs.stat" "2.0.5" @@ -1138,12 +1123,12 @@ "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" - resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" + resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3": version "1.2.8" - resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" + resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: "@nodelib/fs.scandir" "2.1.5" @@ -1154,35 +1139,35 @@ resolved "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.1.0.tgz#55f3d9a597430a01f2a5ef63c6b42f769f9ce34e" integrity sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ== -"@pagefind/darwin-arm64@1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.1.1.tgz" - integrity sha512-tZ9tysUmQpFs2EqWG2+E1gc+opDAhSyZSsgKmFzhnWfkK02YHZhvL5XJXEZDqYy3s1FAKhwjTg8XDxneuBlDZQ== +"@pagefind/darwin-arm64@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.3.0.tgz#f1e63d031ba710c98b0b83db85df9251a255f543" + integrity sha512-365BEGl6ChOsauRjyVpBjXybflXAOvoMROw3TucAROHIcdBvXk9/2AmEvGFU0r75+vdQI4LJdJdpH4Y6Yqaj4A== -"@pagefind/darwin-x64@1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.1.1.tgz" - integrity sha512-ChohLQ39dLwaxQv0jIQB/SavP3TM5K5ENfDTqIdzLkmfs3+JlzSDyQKcJFjTHYcCzQOZVeieeGq8PdqvLJxJxQ== +"@pagefind/darwin-x64@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.3.0.tgz#10aa3c5988daa464c5c0db5c5aa4bf72e9bbfba1" + integrity sha512-zlGHA23uuXmS8z3XxEGmbHpWDxXfPZ47QS06tGUq0HDcZjXjXHeLG+cboOy828QIV5FXsm9MjfkP5e4ZNbOkow== "@pagefind/default-ui@^1.0.3": - version "1.1.1" - resolved "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.1.1.tgz" - integrity sha512-ZM0zDatWDnac/VGHhQCiM7UgA4ca8jpjA+VfuTJyHJBaxGqZMQnm4WoTz9E0KFcue1Bh9kxpu7uWFZfwpZZk0A== + version "1.3.0" + resolved "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.3.0.tgz#e3fb585d2fb08d463a8abc3c8f430420f0310109" + integrity sha512-CGKT9ccd3+oRK6STXGgfH+m0DbOKayX6QGlq38TfE1ZfUcPc5+ulTuzDbZUnMo+bubsEOIypm4Pl2iEyzZ1cNg== -"@pagefind/linux-arm64@1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.1.1.tgz" - integrity sha512-H5P6wDoCoAbdsWp0Zx0DxnLUrwTGWGLu/VI1rcN2CyFdY2EGSvPQsbGBMrseKRNuIrJDFtxHHHyjZ7UbzaM9EA== +"@pagefind/linux-arm64@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.3.0.tgz#cceb0391901736427738ee1232ff326a985eda8a" + integrity sha512-8lsxNAiBRUk72JvetSBXs4WRpYrQrVJXjlRRnOL6UCdBN9Nlsz0t7hWstRk36+JqHpGWOKYiuHLzGYqYAqoOnQ== -"@pagefind/linux-x64@1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.1.1.tgz" - integrity sha512-yJs7tTYbL2MI3HT+ngs9E1BfUbY9M4/YzA0yEM5xBo4Xl8Yu8Qg2xZTOQ1/F6gwvMrjCUFo8EoACs6LRDhtMrQ== +"@pagefind/linux-x64@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.3.0.tgz#06ec4c2907780a75d2fb65a22203c5a48abe7a82" + integrity sha512-hAvqdPJv7A20Ucb6FQGE6jhjqy+vZ6pf+s2tFMNtMBG+fzcdc91uTw7aP/1Vo5plD0dAOHwdxfkyw0ugal4kcQ== -"@pagefind/windows-x64@1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.1.1.tgz" - integrity sha512-b7/qPqgIl+lMzkQ8fJt51SfguB396xbIIR+VZ3YrL2tLuyifDJ1wL5mEm+ddmHxJ2Fki340paPcDan9en5OmAw== +"@pagefind/windows-x64@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.3.0.tgz#ce3394e5143aaca4850a33473a07628971773655" + integrity sha512-BR1bIRWOMqkf8IoU576YDhij1Wd/Zf2kX/kCI0b2qzCKC8wcc2GQJaaRMCpzvCCrmliO4vtJ6RITp/AnoYUUmQ== "@rollup/pluginutils@^5.1.3": version "5.1.4" @@ -1193,85 +1178,100 @@ estree-walker "^2.0.2" picomatch "^4.0.2" -"@rollup/rollup-android-arm-eabi@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz#1661ff5ea9beb362795304cb916049aba7ac9c54" - integrity sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA== - -"@rollup/rollup-android-arm64@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz#2ffaa91f1b55a0082b8a722525741aadcbd3971e" - integrity sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA== - -"@rollup/rollup-darwin-arm64@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz#627007221b24b8cc3063703eee0b9177edf49c1f" - integrity sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA== - -"@rollup/rollup-darwin-x64@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz#0605506142b9e796c370d59c5984ae95b9758724" - integrity sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ== - -"@rollup/rollup-linux-arm-gnueabihf@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz#62dfd196d4b10c0c2db833897164d2d319ee0cbb" - integrity sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA== - -"@rollup/rollup-linux-arm-musleabihf@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz#53ce72aeb982f1f34b58b380baafaf6a240fddb3" - integrity sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw== - -"@rollup/rollup-linux-arm64-gnu@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz#1632990f62a75c74f43e4b14ab3597d7ed416496" - integrity sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA== - -"@rollup/rollup-linux-arm64-musl@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz#8c03a996efb41e257b414b2e0560b7a21f2d9065" - integrity sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw== - -"@rollup/rollup-linux-powerpc64le-gnu@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz#5b98729628d5bcc8f7f37b58b04d6845f85c7b5d" - integrity sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw== - -"@rollup/rollup-linux-riscv64-gnu@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz#48e42e41f4cabf3573cfefcb448599c512e22983" - integrity sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg== - -"@rollup/rollup-linux-s390x-gnu@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz#e0b4f9a966872cb7d3e21b9e412a4b7efd7f0b58" - integrity sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g== - -"@rollup/rollup-linux-x64-gnu@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz#78144741993100f47bd3da72fce215e077ae036b" - integrity sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A== - -"@rollup/rollup-linux-x64-musl@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz#d9fe32971883cd1bd858336bd33a1c3ca6146127" - integrity sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ== - -"@rollup/rollup-win32-arm64-msvc@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz#71fa3ea369316db703a909c790743972e98afae5" - integrity sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ== - -"@rollup/rollup-win32-ia32-msvc@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz#653f5989a60658e17d7576a3996deb3902e342e2" - integrity sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ== - -"@rollup/rollup-win32-x64-msvc@4.24.0": - version "4.24.0" - resolved "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz#0574d7e87b44ee8511d08cc7f914bcb802b70818" - integrity sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw== +"@rollup/rollup-android-arm-eabi@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.1.tgz#7f4c4d8cd5ccab6e95d6750dbe00321c1f30791e" + integrity sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ== + +"@rollup/rollup-android-arm64@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.1.tgz#17ea71695fb1518c2c324badbe431a0bd1879f2d" + integrity sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA== + +"@rollup/rollup-darwin-arm64@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.1.tgz#dac0f0d0cfa73e7d5225ae6d303c13c8979e7999" + integrity sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ== + +"@rollup/rollup-darwin-x64@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.1.tgz#8f63baa1d31784904a380d2e293fa1ddf53dd4a2" + integrity sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ== + +"@rollup/rollup-freebsd-arm64@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.1.tgz#30ed247e0df6e8858cdc6ae4090e12dbeb8ce946" + integrity sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA== + +"@rollup/rollup-freebsd-x64@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.1.tgz#57846f382fddbb508412ae07855b8a04c8f56282" + integrity sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ== + +"@rollup/rollup-linux-arm-gnueabihf@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.1.tgz#378ca666c9dae5e6f94d1d351e7497c176e9b6df" + integrity sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA== + +"@rollup/rollup-linux-arm-musleabihf@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.1.tgz#a692eff3bab330d5c33a5d5813a090c15374cddb" + integrity sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg== + +"@rollup/rollup-linux-arm64-gnu@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.1.tgz#6b1719b76088da5ac1ae1feccf48c5926b9e3db9" + integrity sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA== + +"@rollup/rollup-linux-arm64-musl@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.1.tgz#865baf5b6f5ff67acb32e5a359508828e8dc5788" + integrity sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A== + +"@rollup/rollup-linux-loongarch64-gnu@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.28.1.tgz#23c6609ba0f7fa7a7f2038b6b6a08555a5055a87" + integrity sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA== + +"@rollup/rollup-linux-powerpc64le-gnu@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.1.tgz#652ef0d9334a9f25b9daf85731242801cb0fc41c" + integrity sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A== + +"@rollup/rollup-linux-riscv64-gnu@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.1.tgz#1eb6651839ee6ebca64d6cc64febbd299e95e6bd" + integrity sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA== + +"@rollup/rollup-linux-s390x-gnu@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.1.tgz#015c52293afb3ff2a293cf0936b1d43975c1e9cd" + integrity sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg== + +"@rollup/rollup-linux-x64-gnu@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.1.tgz#b83001b5abed2bcb5e2dbeec6a7e69b194235c1e" + integrity sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw== + +"@rollup/rollup-linux-x64-musl@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.1.tgz#6cc7c84cd4563737f8593e66f33b57d8e228805b" + integrity sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g== + +"@rollup/rollup-win32-arm64-msvc@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.1.tgz#631ffeee094d71279fcd1fe8072bdcf25311bc11" + integrity sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A== + +"@rollup/rollup-win32-ia32-msvc@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.1.tgz#06d1d60d5b9f718e8a6c4a43f82e3f9e3254587f" + integrity sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA== + +"@rollup/rollup-win32-x64-msvc@4.28.1": + version "4.28.1" + resolved "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz#4dff5c4259ebe6c5b4a8f2c5bc3829b7a8447ff0" + integrity sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA== "@shikijs/core@1.24.2": version "1.24.2" @@ -1311,20 +1311,20 @@ "@types/hast" "^3.0.4" "@shikijs/vscode-textmate@^9.3.0": - version "9.3.0" - resolved "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.0.tgz#b2f1776e488c1d6c2b6cd129bab62f71bbc9c7ab" - integrity sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA== + version "9.3.1" + resolved "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.1.tgz#afda31f8f42cab70a26f3603f52eae3f1c35d2f7" + integrity sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g== "@types/acorn@^4.0.0": version "4.0.6" - resolved "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz" + resolved "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz#d61ca5480300ac41a7d973dd5b84d0a591154a22" integrity sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ== dependencies: "@types/estree" "*" "@types/babel__core@^7.20.5": version "7.20.5" - resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" + resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== dependencies: "@babel/parser" "^7.20.7" @@ -1335,14 +1335,14 @@ "@types/babel__generator@*": version "7.6.8" - resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz" + resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": version "7.4.4" - resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz" + resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" @@ -1350,136 +1350,141 @@ "@types/babel__traverse@*": version "7.20.6" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== dependencies: "@babel/types" "^7.20.7" "@types/cookie@^0.6.0": version "0.6.0" - resolved "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz" + resolved "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== "@types/debug@^4.0.0": version "4.1.12" - resolved "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz" + resolved "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== dependencies: "@types/ms" "*" "@types/estree-jsx@^1.0.0": version "1.0.5" - resolved "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz" + resolved "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz#858a88ea20f34fe65111f005a689fa1ebf70dc18" integrity sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg== dependencies: "@types/estree" "*" "@types/estree@*", "@types/estree@1.0.6", "@types/estree@^1.0.0": version "1.0.6" - resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz" + resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/hast@^3.0.0", "@types/hast@^3.0.4": version "3.0.4" - resolved "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz" + resolved "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa" integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ== dependencies: "@types/unist" "*" +"@types/js-yaml@^4.0.9": + version "4.0.9" + resolved "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" + integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== + "@types/katex@^0.16.0": version "0.16.7" - resolved "https://registry.npmjs.org/@types/katex/-/katex-0.16.7.tgz" + resolved "https://registry.npmjs.org/@types/katex/-/katex-0.16.7.tgz#03ab680ab4fa4fbc6cb46ecf987ecad5d8019868" integrity sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ== "@types/mdast@^4.0.0", "@types/mdast@^4.0.4": version "4.0.4" - resolved "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz" + resolved "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6" integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA== dependencies: "@types/unist" "*" "@types/mdx@^2.0.0": version "2.0.13" - resolved "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz" + resolved "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz#68f6877043d377092890ff5b298152b0a21671bd" integrity sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw== "@types/ms@*": version "0.7.34" - resolved "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz" + resolved "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== "@types/nlcst@^2.0.0": version "2.0.3" - resolved "https://registry.npmjs.org/@types/nlcst/-/nlcst-2.0.3.tgz" + resolved "https://registry.npmjs.org/@types/nlcst/-/nlcst-2.0.3.tgz#31cad346eaab48a9a8a58465d3d05e2530dda762" integrity sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA== dependencies: "@types/unist" "*" "@types/node@*": - version "22.5.5" - resolved "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz" - integrity sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA== + version "22.10.2" + resolved "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz#a485426e6d1fdafc7b0d4c7b24e2c78182ddabb9" + integrity sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ== dependencies: - undici-types "~6.19.2" + undici-types "~6.20.0" "@types/node@^17.0.5": version "17.0.45" - resolved "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz" + resolved "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== "@types/picomatch@2.3.3": version "2.3.3" - resolved "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.3.tgz" + resolved "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.3.tgz#be60498568c19e989e43fb39aa84be1ed3655e92" integrity sha512-Yll76ZHikRFCyz/pffKGjrCwe/le2CDwOP5F210KQo27kpRE46U2rDnzikNlVn6/ezH3Mhn46bJMTfeVTtcYMg== "@types/sax@^1.2.1": version "1.2.7" - resolved "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz" + resolved "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz#ba5fe7df9aa9c89b6dff7688a19023dd2963091d" integrity sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A== dependencies: "@types/node" "*" "@types/unist@*", "@types/unist@^3.0.0": version "3.0.3" - resolved "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz" + resolved "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q== "@types/unist@^2.0.0": version "2.0.11" - resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz" + resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz#11af57b127e32487774841f7a4e54eab166d03c4" integrity sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA== "@ungap/structured-clone@^1.0.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + version "1.2.1" + resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz#28fa185f67daaf7b7a1a8c1d445132c5d979f8bd" + integrity sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA== "@volar/kit@~2.4.7": - version "2.4.8" - resolved "https://registry.npmjs.org/@volar/kit/-/kit-2.4.8.tgz#d966ee9adfea775f0b029874c254a3496b7fbf79" - integrity sha512-HY+HTP9sSqj0St9j1N8l85YMu4w0GxCtelzkzZWuq2GVz0+QRYwlyc0mPH7749OknUAdtsdozBR5Ecez55Ncug== + version "2.4.11" + resolved "https://registry.npmjs.org/@volar/kit/-/kit-2.4.11.tgz#12fa1825bdbaa54752e86d9eecb0d3b6d1c60f5e" + integrity sha512-ups5RKbMzMCr6RKafcCqDRnJhJDNWqo2vfekwOAj6psZ15v5TlcQFQAyokQJ3wZxVkzxrQM+TqTRDENfQEXpmA== dependencies: - "@volar/language-service" "2.4.8" - "@volar/typescript" "2.4.8" + "@volar/language-service" "2.4.11" + "@volar/typescript" "2.4.11" typesafe-path "^0.2.2" vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -"@volar/language-core@2.4.8", "@volar/language-core@~2.4.7": - version "2.4.8" - resolved "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.8.tgz#022f9a8f8c0615469d2f8290f9b44528807c99ca" - integrity sha512-K/GxMOXGq997bO00cdFhTNuR85xPxj0BEEAy+BaqqayTmy9Tmhfgmq2wpJcVspRhcwfgPoE2/mEJa26emUhG/g== +"@volar/language-core@2.4.11", "@volar/language-core@~2.4.7": + version "2.4.11" + resolved "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.11.tgz#d95a9ec4f14fbdb41a6a64f9f321d11d23a5291c" + integrity sha512-lN2C1+ByfW9/JRPpqScuZt/4OrUUse57GLI6TbLgTIqBVemdl1wNcZ1qYGEo2+Gw8coYLgCy7SuKqn6IrQcQgg== dependencies: - "@volar/source-map" "2.4.8" + "@volar/source-map" "2.4.11" "@volar/language-server@~2.4.7": - version "2.4.8" - resolved "https://registry.npmjs.org/@volar/language-server/-/language-server-2.4.8.tgz#f0aa0c15c97385fa32e4ad093470fe1f5ad0c152" - integrity sha512-3Jd9Y+0Zhwi/zfdRxqoNrm7AxP6lgTsw4Ni9r6eCyWYGVsTnpVwGmlcbiZyDja6anoKZxnaeDatX1jkaHHWaRQ== + version "2.4.11" + resolved "https://registry.npmjs.org/@volar/language-server/-/language-server-2.4.11.tgz#e0d87bd8d4eee0470e806e832ed26f27caf08d81" + integrity sha512-W9P8glH1M8LGREJ7yHRCANI5vOvTrRO15EMLdmh5WNF9sZYSEbQxiHKckZhvGIkbeR1WAlTl3ORTrJXUghjk7g== dependencies: - "@volar/language-core" "2.4.8" - "@volar/language-service" "2.4.8" - "@volar/typescript" "2.4.8" + "@volar/language-core" "2.4.11" + "@volar/language-service" "2.4.11" + "@volar/typescript" "2.4.11" path-browserify "^1.0.1" request-light "^0.7.0" vscode-languageserver "^9.0.1" @@ -1487,59 +1492,59 @@ vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -"@volar/language-service@2.4.8", "@volar/language-service@~2.4.7": - version "2.4.8" - resolved "https://registry.npmjs.org/@volar/language-service/-/language-service-2.4.8.tgz#039d47e4082dabeaee5ae0af738a55a4ed30f4f5" - integrity sha512-9y8X4cdUxXmy4s5HoB8jmOpDIZG7XVFu4iEFvouhZlJX2leCq0pbq5h7dhA+O8My0fne3vtE6cJ4t9nc+8UBZw== +"@volar/language-service@2.4.11", "@volar/language-service@~2.4.7": + version "2.4.11" + resolved "https://registry.npmjs.org/@volar/language-service/-/language-service-2.4.11.tgz#44008ad68ff82c618fe4f6ad338af9164853e82b" + integrity sha512-KIb6g8gjUkS2LzAJ9bJCLIjfsJjeRtmXlu7b2pDFGD3fNqdbC53cCAKzgWDs64xtQVKYBU13DLWbtSNFtGuMLQ== dependencies: - "@volar/language-core" "2.4.8" + "@volar/language-core" "2.4.11" vscode-languageserver-protocol "^3.17.5" vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -"@volar/source-map@2.4.8": - version "2.4.8" - resolved "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.8.tgz#bc699a095aaab405ddc0e2c5a011edc151e787fd" - integrity sha512-jeWJBkC/WivdelMwxKkpFL811uH/jJ1kVxa+c7OvG48DXc3VrP7pplSWPP2W1dLMqBxD+awRlg55FQQfiup4cA== +"@volar/source-map@2.4.11": + version "2.4.11" + resolved "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.11.tgz#5876d4531508129724c2755e295db1df98bd5895" + integrity sha512-ZQpmafIGvaZMn/8iuvCFGrW3smeqkq/IIh9F1SdSx9aUl0J4Iurzd6/FhmjNO5g2ejF3rT45dKskgXWiofqlZQ== -"@volar/typescript@2.4.8": - version "2.4.8" - resolved "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.8.tgz#4cfb90b3226e04d781d48fa519fed0838d7b1504" - integrity sha512-6xkIYJ5xxghVBhVywMoPMidDDAFT1OoQeXwa27HSgJ6AiIKRe61RXLoik+14Z7r0JvnblXVsjsRLmCr42SGzqg== +"@volar/typescript@2.4.11": + version "2.4.11" + resolved "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.11.tgz#aafbfa413337654db211bf4d8fb6670c89f6fa57" + integrity sha512-2DT+Tdh88Spp5PyPbqhyoYavYCPDsqbHLFwcUI9K1NlY1YgUJvujGdrqUp0zWxnW7KWNTr3xSpMuv2WnaTKDAw== dependencies: - "@volar/language-core" "2.4.8" + "@volar/language-core" "2.4.11" path-browserify "^1.0.1" vscode-uri "^3.0.8" "@vscode/emmet-helper@^2.9.3": - version "2.9.3" - resolved "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.9.3.tgz" - integrity sha512-rB39LHWWPQYYlYfpv9qCoZOVioPCftKXXqrsyqN1mTWZM6dTnONT63Db+03vgrBbHzJN45IrgS/AGxw9iiqfEw== + version "2.11.0" + resolved "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.11.0.tgz#7a53e4fdb17329cc2ed88036905c78d811d231d6" + integrity sha512-QLxjQR3imPZPQltfbWRnHU6JecWTF1QSWhx3GAKQpslx7y3Dp6sIIXhKjiUJ/BR9FX8PVthjr9PD6pNwOJfAzw== dependencies: emmet "^2.4.3" jsonc-parser "^2.3.0" vscode-languageserver-textdocument "^1.0.1" vscode-languageserver-types "^3.15.1" - vscode-uri "^2.1.2" + vscode-uri "^3.0.8" "@vscode/l10n@^0.0.18": version "0.0.18" - resolved "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz" + resolved "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz#916d3a5e960dbab47c1c56f58a7cb5087b135c95" integrity sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ== acorn-jsx@^5.0.0: version "5.3.2" - resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.0.0, acorn@^8.12.1, acorn@^8.14.0: +acorn@^8.0.0, acorn@^8.14.0: version "8.14.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== ajv@^8.11.0: version "8.17.1" - resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== dependencies: fast-deep-equal "^3.1.3" @@ -1549,24 +1554,24 @@ ajv@^8.11.0: ansi-align@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz" + resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== dependencies: string-width "^4.1.0" ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-regex@^6.0.1: version "6.1.0" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== ansi-styles@^4.0.0: version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" @@ -1578,19 +1583,19 @@ ansi-styles@^6.2.1: arg@^5.0.0: version "5.0.2" - resolved "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz" + resolved "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== argparse@^1.0.7: version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" argparse@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== aria-query@^5.3.2: @@ -1600,25 +1605,25 @@ aria-query@^5.3.2: array-iterate@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz" + resolved "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz#6efd43f8295b3fee06251d3d62ead4bd9805dd24" integrity sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg== array-timsort@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz" + resolved "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" integrity sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ== astring@^1.8.0: version "1.9.0" - resolved "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz" + resolved "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz#cc73e6062a7eb03e7d19c22d8b0b3451fd9bfeef" integrity sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg== -astro-expressive-code@^0.35.6: - version "0.35.6" - resolved "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.35.6.tgz" - integrity sha512-1U4KrvFuodaCV3z4I1bIR16SdhQlPkolGsYTtiANxPZUVv/KitGSCTjzksrkPonn1XuwVqvnwmUUVzTLWngnBA== +astro-expressive-code@^0.38.3: + version "0.38.3" + resolved "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.38.3.tgz#121d852aeeea70699c802ae42bcfa9940d427f2c" + integrity sha512-Tvdc7RV0G92BbtyEOsfJtXU35w41CkM94fOAzxbQP67Wj5jArfserJ321FO4XA7WG9QMV0GIBmQq77NBIRDzpQ== dependencies: - rehype-expressive-code "^0.35.6" + rehype-expressive-code "^0.38.3" astro@4.16.18: version "4.16.18" @@ -1692,27 +1697,27 @@ astro@4.16.18: axobject-query@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz" + resolved "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee" integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ== -b4a@^1.6.4, b4a@^1.6.6: - version "1.6.6" - resolved "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz" - integrity sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg== +b4a@^1.6.4: + version "1.6.7" + resolved "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz#a99587d4ebbfbd5a6e3b21bdb5d5fa385767abe4" + integrity sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg== bail@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz" + resolved "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" integrity sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw== bare-events@^2.0.0, bare-events@^2.2.0: - version "2.4.2" - resolved "https://registry.npmjs.org/bare-events/-/bare-events-2.4.2.tgz" - integrity sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q== + version "2.5.0" + resolved "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz#305b511e262ffd8b9d5616b056464f8e1b3329cc" + integrity sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A== bare-fs@^2.1.1: version "2.3.5" - resolved "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz" + resolved "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz#05daa8e8206aeb46d13c2fe25a2cd3797b0d284a" integrity sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw== dependencies: bare-events "^2.0.0" @@ -1721,42 +1726,41 @@ bare-fs@^2.1.1: bare-os@^2.1.0: version "2.4.4" - resolved "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz" + resolved "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz#01243392eb0a6e947177bb7c8a45123d45c9b1a9" integrity sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ== bare-path@^2.0.0, bare-path@^2.1.0: version "2.1.3" - resolved "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz" + resolved "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz#594104c829ef660e43b5589ec8daef7df6cedb3e" integrity sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA== dependencies: bare-os "^2.1.0" bare-stream@^2.0.0: - version "2.3.0" - resolved "https://registry.npmjs.org/bare-stream/-/bare-stream-2.3.0.tgz" - integrity sha512-pVRWciewGUeCyKEuRxwv06M079r+fRjAQjBEK2P6OYGrO43O+Z0LrPZZEjlc4mB6C2RpZ9AxJ1s7NLEtOHO6eA== + version "2.6.1" + resolved "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.1.tgz#b3b9874fab05b662c9aea2706a12fb0698c46836" + integrity sha512-eVZbtKM+4uehzrsj49KtCy3Pbg7kO1pJ3SKZ1SFrIH/0pnj9scuGGgUlNDf/7qS8WKtGdiJY5Kyhs/ivYPTB/g== dependencies: - b4a "^1.6.6" - streamx "^2.20.0" + streamx "^2.21.0" base-64@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz" + resolved "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz#09d0f2084e32a3fd08c2475b973788eee6ae8f4a" integrity sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg== base64-js@^1.3.1: version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== bcp-47-match@^2.0.0: version "2.0.3" - resolved "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz" + resolved "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz#603226f6e5d3914a581408be33b28a53144b09d0" integrity sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ== bcp-47@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz" + resolved "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz#7e80734c3338fe8320894981dccf4968c3092df6" integrity sha512-9IIS3UPrvIa1Ej+lVDdDwO7zLehjqsaByECw0bu2RRGP73jALm6FYbzI5gWbgHLvNdkvfXB5YrSbocZdOS0c0w== dependencies: is-alphabetical "^2.0.0" @@ -1765,7 +1769,7 @@ bcp-47@^2.1.0: bl@^4.0.3: version "4.1.0" - resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" + resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== dependencies: buffer "^5.5.0" @@ -1774,7 +1778,7 @@ bl@^4.0.3: boolbase@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz" + resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== boxen@8.0.1: @@ -1793,24 +1797,24 @@ boxen@8.0.1: braces@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" browserslist@^4.24.0: - version "4.24.0" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz#a1325fe4bc80b64fda169629fc01b3d6cecd38d4" - integrity sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A== + version "4.24.3" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz#5fc2725ca8fb3c1432e13dac278c7cc103e026d2" + integrity sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA== dependencies: - caniuse-lite "^1.0.30001663" - electron-to-chromium "^1.5.28" - node-releases "^2.0.18" - update-browserslist-db "^1.1.0" + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" buffer@^5.5.0: version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" + resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== dependencies: base64-js "^1.3.1" @@ -1818,7 +1822,7 @@ buffer@^5.5.0: callsites@^3.0.0, callsites@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camelcase@^8.0.0: @@ -1826,58 +1830,58 @@ camelcase@^8.0.0: resolved "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz#c0d36d418753fb6ad9c5e0437579745c1c14a534" integrity sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA== -caniuse-lite@^1.0.30001663: - version "1.0.30001669" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" - integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== +caniuse-lite@^1.0.30001688: + version "1.0.30001689" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001689.tgz#67ca960dd5f443903e19949aeacc9d28f6e10910" + integrity sha512-CmeR2VBycfa+5/jOfnp/NpWPGd06nf1XYiefUvhXFfZE4GkRc9jv+eGPS4nT558WS/8lYCzV8SlANCIPvbWP1g== ccount@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz" + resolved "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== chalk-template@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz" + resolved "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz#ffc55db6dd745e9394b85327c8ac8466edb7a7b1" integrity sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg== dependencies: chalk "^5.2.0" chalk@^5.2.0, chalk@^5.3.0: - version "5.3.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + version "5.4.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-5.4.0.tgz#846fdb5d5d939d6fa3d565cd5545697b6f8b6923" + integrity sha512-ZkD35Mx92acjB2yNJgziGqT9oKHEOxjTBTDRpOsRWtdecL/0jM3z5kM/CTzHWvHIen1GvkM85p6TuFfDGfc8/Q== character-entities-html4@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz" + resolved "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== character-entities-legacy@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz" + resolved "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== character-entities@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz" + resolved "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== character-reference-invalid@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz" + resolved "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== chokidar@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz#4a6dff66798fb0f72a94f616abbd7e1a19f31d41" - integrity sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA== + version "4.0.2" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-4.0.2.tgz#97b9562c9f59de559177f069eadf5dcc67d24798" + integrity sha512-/b57FK+bblSU+dfewfFe0rT1YjVDfOmeLQwCAuC+vwvgLkXboATqqmy+Ipux6JrF6L5joe5CBnFOw+gLWH6yKg== dependencies: readdirp "^4.0.1" chownr@^1.1.1: version "1.1.4" - resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" + resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== ci-info@^4.0.0, ci-info@^4.1.0: @@ -1887,7 +1891,7 @@ ci-info@^4.0.0, ci-info@^4.1.0: clear-module@^4.1.2: version "4.1.2" - resolved "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz" + resolved "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz#5a58a5c9f8dccf363545ad7284cad3c887352a80" integrity sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw== dependencies: parent-module "^2.0.0" @@ -1895,24 +1899,24 @@ clear-module@^4.1.2: cli-boxes@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz" + resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz#71a10c716feeba005e4504f36329ef0b17cf3145" integrity sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g== cli-cursor@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz#24a4831ecf5a6b01ddeb32fb71a4b2088b0dce38" integrity sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw== dependencies: restore-cursor "^5.0.0" cli-spinners@^2.9.2: version "2.9.2" - resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz" + resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== cliui@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== dependencies: string-width "^4.2.0" @@ -1921,29 +1925,29 @@ cliui@^8.0.1: clsx@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz" + resolved "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== collapse-white-space@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz" + resolved "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz#640257174f9f42c740b40f3b55ee752924feefca" integrity sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw== color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== color-string@^1.9.0: version "1.9.1" - resolved "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz" + resolved "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== dependencies: color-name "^1.0.0" @@ -1951,7 +1955,7 @@ color-string@^1.9.0: color@^4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/color/-/color-4.2.3.tgz" + resolved "https://registry.npmjs.org/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a" integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A== dependencies: color-convert "^2.0.1" @@ -1959,22 +1963,22 @@ color@^4.2.3: comma-separated-tokens@^2.0.0: version "2.0.3" - resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz" + resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== commander@^12.1.0: version "12.1.0" - resolved "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz" + resolved "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== commander@^8.3.0: version "8.3.0" - resolved "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz" + resolved "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== comment-json@^4.2.5: version "4.2.5" - resolved "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz" + resolved "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz#482e085f759c2704b60bc6f97f55b8c01bc41e70" integrity sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw== dependencies: array-timsort "^1.0.3" @@ -1985,12 +1989,12 @@ comment-json@^4.2.5: common-ancestor-path@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz" + resolved "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz#4f7d2d1394d91b7abdf51871c62f71eadb0182a7" integrity sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w== convert-source-map@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== cookie@^0.7.2: @@ -2000,83 +2004,83 @@ cookie@^0.7.2: core-util-is@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cspell-config-lib@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.4.tgz" - integrity sha512-cnUeJfniTiebqCaQmIUnbSrPrTH7xzKRQjJDHAEV0WYnOG2MhRXI13OzytdFdhkVBdStmgTzTCJKE7x+kmU2NA== +cspell-config-lib@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.1.tgz#a87973b91d51bf23a2018042c25aeaaa8a4e69c0" + integrity sha512-x1S7QWprgUcwuwiJB1Ng0ZTBC4G50qP9qQyg/aroMkcdMsHfk26E8jUGRPNt4ftHFzS4YMhwtXuJQ9IgRUuNPA== dependencies: - "@cspell/cspell-types" "8.14.4" + "@cspell/cspell-types" "8.17.1" comment-json "^4.2.5" - yaml "^2.5.1" + yaml "^2.6.1" -cspell-dictionary@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.4.tgz" - integrity sha512-pZvQHxpAW5fZAnt3ZKKy3s7M+3CX2t8tCS3uJrpEHIynlCawpG0fPF78rVE5o+g0dON36Lguc/BUuSN4IWKLmQ== +cspell-dictionary@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.1.tgz#bfc9bfdbd3720d1425260a98091acffab7b03dd5" + integrity sha512-zSl9l3wii+x16yc2NVZl/+CMLeLBAiuEd5YoFkOYPcbTJnfPwdjMNcj71u7wBvNJ+qwbF+kGbutEt15yHW3NBw== dependencies: - "@cspell/cspell-pipe" "8.14.4" - "@cspell/cspell-types" "8.14.4" - cspell-trie-lib "8.14.4" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" + cspell-trie-lib "8.17.1" fast-equals "^5.0.1" -cspell-gitignore@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.4.tgz" - integrity sha512-RwfQEW5hD7CpYwS7m3b0ONG0nTLKP6bL2tvMdl7qtaYkL7ztGdsBTtLD1pmwqUsCbiN5RuaOxhYOYeRcpFRIkQ== +cspell-gitignore@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.1.tgz#38f3213a40ba86480bb5f66a91198db6e0ef37c0" + integrity sha512-bk727Zf4FBCjm9Mwvyreyhgjwe+YhPQEW7PldkHiinKd+Irfez4s8GXLQb1EgV0UpvViqaqBqLmngjZdS30BTA== dependencies: - "@cspell/url" "8.14.4" - cspell-glob "8.14.4" - cspell-io "8.14.4" + "@cspell/url" "8.17.1" + cspell-glob "8.17.1" + cspell-io "8.17.1" find-up-simple "^1.0.0" -cspell-glob@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.4.tgz" - integrity sha512-C/xTS5nujMRMuguibq92qMVP767mtxrur7DcVolCvpzcivm1RB5NtIN0OctQxTyMbnmKeQv1t4epRKQ9A8vWRg== +cspell-glob@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.1.tgz#23d1be46b32fb4933487e4edff347d34db446f5a" + integrity sha512-cUwM5auSt0RvLX7UkP2GEArJRWc85l51B1voArl+3ZIKeMZwcJpJgN3qvImtF8yRTZwYeYCs1sgsihb179q+mg== dependencies: - "@cspell/url" "8.14.4" + "@cspell/url" "8.17.1" micromatch "^4.0.8" -cspell-grammar@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.4.tgz" - integrity sha512-yaSKAAJDiamsw3FChbw4HXb2RvTQrDsLelh1+T4MavarOIcAxXrqAJ8ysqm++g+S/ooJz2YO8YWIyzJKxcMf8g== - dependencies: - "@cspell/cspell-pipe" "8.14.4" - "@cspell/cspell-types" "8.14.4" - -cspell-io@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.4.tgz" - integrity sha512-o6OTWRyx/Az+PFhr1B0wMAwqG070hFC9g73Fkxd8+rHX0rfRS69QZH7LgSmZytqbZIMxCTDGdsLl33MFGWCbZQ== - dependencies: - "@cspell/cspell-service-bus" "8.14.4" - "@cspell/url" "8.14.4" - -cspell-lib@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.4.tgz" - integrity sha512-qdkUkKtm+nmgpA4jQbmQTuepDfjHBDWvs3zDuEwVIVFq/h8gnXrRr75gJ3RYdTy+vOOqHPoLLqgxyqkUUrUGXA== - dependencies: - "@cspell/cspell-bundled-dicts" "8.14.4" - "@cspell/cspell-pipe" "8.14.4" - "@cspell/cspell-resolver" "8.14.4" - "@cspell/cspell-types" "8.14.4" - "@cspell/dynamic-import" "8.14.4" - "@cspell/filetypes" "8.14.4" - "@cspell/strong-weak-map" "8.14.4" - "@cspell/url" "8.14.4" +cspell-grammar@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.1.tgz#8f6619fbfaebff6aeee63b13d17898b4d0c09136" + integrity sha512-H5tLcBuW7aUj9L0rR+FSbnWPEsWb8lWppHVidtqw9Ll1CUHWOZC9HTB2RdrhJZrsz/8DJbM2yNbok0Xt0VAfdw== + dependencies: + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" + +cspell-io@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.1.tgz#b91f1cac1c64a6fa2b61a388d0dc67437fcf3ada" + integrity sha512-liIOsblt7oVItifzRAbuxiYrwlgw1VOqKppMxVKtYoAn2VUuuEpjCj6jLWpoTqSszR/38o7ChsHY1LHakhJZmw== + dependencies: + "@cspell/cspell-service-bus" "8.17.1" + "@cspell/url" "8.17.1" + +cspell-lib@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.1.tgz#21c76f1ea4e91c90245e55acddbf452d055a6607" + integrity sha512-66n83Q7bK5tnvkDH7869/pBY/65AKmZVfCOAlsbhJn3YMDbNHFCHR0d1oNMlqG+n65Aco89VGwYfXxImZY+/mA== + dependencies: + "@cspell/cspell-bundled-dicts" "8.17.1" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-resolver" "8.17.1" + "@cspell/cspell-types" "8.17.1" + "@cspell/dynamic-import" "8.17.1" + "@cspell/filetypes" "8.17.1" + "@cspell/strong-weak-map" "8.17.1" + "@cspell/url" "8.17.1" clear-module "^4.1.2" comment-json "^4.2.5" - cspell-config-lib "8.14.4" - cspell-dictionary "8.14.4" - cspell-glob "8.14.4" - cspell-grammar "8.14.4" - cspell-io "8.14.4" - cspell-trie-lib "8.14.4" + cspell-config-lib "8.17.1" + cspell-dictionary "8.17.1" + cspell-glob "8.17.1" + cspell-grammar "8.17.1" + cspell-io "8.17.1" + cspell-trie-lib "8.17.1" env-paths "^3.0.0" fast-equals "^5.0.1" gensequence "^7.0.0" @@ -2086,89 +2090,88 @@ cspell-lib@8.14.4: vscode-uri "^3.0.8" xdg-basedir "^5.1.0" -cspell-trie-lib@8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.4.tgz" - integrity sha512-zu8EJ33CH+FA5lwTRGqS//Q6phO0qtgEmODMR1KPlD7WlrfTFMb3bWFsLo/tiv5hjpsn7CM6dYDAAgBOSkoyhQ== +cspell-trie-lib@8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.1.tgz#618e5cc671b0a24cf7ec27a9a9b834b197e17392" + integrity sha512-13WNa5s75VwOjlGzWprmfNbBFIfXyA7tYYrbV+LugKkznyNZJeJPojHouEudcLq3SYb2Q6tJ7qyWcuT5bR9qPA== dependencies: - "@cspell/cspell-pipe" "8.14.4" - "@cspell/cspell-types" "8.14.4" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" gensequence "^7.0.0" cspell@^8.14.4: - version "8.14.4" - resolved "https://registry.npmjs.org/cspell/-/cspell-8.14.4.tgz" - integrity sha512-R5Awb3i/RKaVVcZzFt8dkN3M6VnifIEDYBcbzbmYjZ/Eq+ASF+QTmI0E9WPhMEcFM1nd7YOyXnETo560yRdoKw== - dependencies: - "@cspell/cspell-json-reporter" "8.14.4" - "@cspell/cspell-pipe" "8.14.4" - "@cspell/cspell-types" "8.14.4" - "@cspell/dynamic-import" "8.14.4" - "@cspell/url" "8.14.4" + version "8.17.1" + resolved "https://registry.npmjs.org/cspell/-/cspell-8.17.1.tgz#be3c79a5b0b2e374ac0df8f921eb30ddca170110" + integrity sha512-D0lw8XTXrTycNzOn5DkfPJNUT00X53OgvFDm+0SzhBr1r+na8LEh3CnQ6zKYVU0fL0x8vU82vs4jmGjDho9mPg== + dependencies: + "@cspell/cspell-json-reporter" "8.17.1" + "@cspell/cspell-pipe" "8.17.1" + "@cspell/cspell-types" "8.17.1" + "@cspell/dynamic-import" "8.17.1" + "@cspell/url" "8.17.1" chalk "^5.3.0" chalk-template "^1.1.0" commander "^12.1.0" - cspell-dictionary "8.14.4" - cspell-gitignore "8.14.4" - cspell-glob "8.14.4" - cspell-io "8.14.4" - cspell-lib "8.14.4" - fast-glob "^3.3.2" + cspell-dictionary "8.17.1" + cspell-gitignore "8.17.1" + cspell-glob "8.17.1" + cspell-io "8.17.1" + cspell-lib "8.17.1" fast-json-stable-stringify "^2.1.0" file-entry-cache "^9.1.0" get-stdin "^9.0.0" semver "^7.6.3" - strip-ansi "^7.1.0" + tinyglobby "^0.2.10" css-selector-parser@^3.0.0: version "3.0.5" - resolved "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.5.tgz" + resolved "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.5.tgz#9b636ebccf7c4bcce5c1ac21ae27de9f01180ae9" integrity sha512-3itoDFbKUNx1eKmVpYMFyqKX04Ww9osZ+dLgrk6GEv6KMVeXUhUnp4I5X+evw+u3ZxVU6RFXSSRxlTeMh8bA+g== cssesc@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz" + resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== debug@^4.0.0, debug@^4.1.0, debug@^4.3.1, debug@^4.3.4, debug@^4.3.7: - version "4.3.7" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz" - integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + version "4.4.0" + resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: ms "^2.1.3" decode-named-character-reference@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz" + resolved "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz#daabac9690874c394c81e4162a0304b35d824f0e" integrity sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg== dependencies: character-entities "^2.0.0" decompress-response@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz" + resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== dependencies: mimic-response "^3.1.0" deep-extend@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" + resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== dequal@^2.0.0: version "2.0.3" - resolved "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz" + resolved "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== detect-libc@^2.0.0, detect-libc@^2.0.2, detect-libc@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz" + resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700" integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw== deterministic-object-hash@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz" + resolved "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz#b251ddc801443905f0e9fef08816a46bc9fe3807" integrity sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ== dependencies: base-64 "^1.0.0" @@ -2180,40 +2183,40 @@ devalue@^5.1.1: devlop@^1.0.0, devlop@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz" + resolved "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== dependencies: dequal "^2.0.0" diff@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz" + resolved "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== direction@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz" + resolved "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz#71800dd3c4fa102406502905d3866e65bdebb985" integrity sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA== dlv@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz" + resolved "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== dset@^3.1.3, dset@^3.1.4: version "3.1.4" - resolved "https://registry.npmjs.org/dset/-/dset-3.1.4.tgz" + resolved "https://registry.npmjs.org/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" integrity sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA== -electron-to-chromium@^1.5.28: - version "1.5.39" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.39.tgz#5cbe5200b43dff7b7c2bcb6bdacf65d514c76bb2" - integrity sha512-4xkpSR6CjuiaNyvwiWDI85N9AxsvbPawB8xc7yzLPonYTuP19BVgYweKyUMFtHEZgIcHWMt1ks5Cqx2m+6/Grg== +electron-to-chromium@^1.5.73: + version "1.5.74" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.74.tgz#cb886b504a6467e4c00bea3317edb38393c53413" + integrity sha512-ck3//9RC+6oss/1Bh9tiAVFy5vfSKbRHAFh7Z3/eTRkEqJeWgymloShB17Vg3Z4nmDNp35vAd1BZ6CMW4Wt6Iw== emmet@^2.4.3: - version "2.4.8" - resolved "https://registry.npmjs.org/emmet/-/emmet-2.4.8.tgz" - integrity sha512-wFe/dxsx7oi/M2UJ/3yBu4Fm24Irho6lqut4C1YFaZebCvCCMygoDGC7W6I+8+K8PAjfa/Ojn52UHi8WCdDiRA== + version "2.4.11" + resolved "https://registry.npmjs.org/emmet/-/emmet-2.4.11.tgz#b331f572df37a252360ebee7dc4462c8d2e32f5c" + integrity sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ== dependencies: "@emmetio/abbreviation" "^2.3.3" "@emmetio/css-abbreviation" "^2.1.8" @@ -2225,39 +2228,59 @@ emoji-regex-xs@^1.0.0: emoji-regex@^10.3.0: version "10.4.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz#03553afea80b3975749cfcb36f776ca268e413d4" integrity sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw== emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" - resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" + resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" -entities@^4.4.0: +entities@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== env-paths@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz" + resolved "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz#2f1e89c2f6dbd3408e1b1711dd82d62e317f58da" integrity sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A== es-module-lexer@^1.5.4: version "1.5.4" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz" + resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== +esast-util-from-estree@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz#8d1cfb51ad534d2f159dc250e604f3478a79f1ad" + integrity sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ== + dependencies: + "@types/estree-jsx" "^1.0.0" + devlop "^1.0.0" + estree-util-visit "^2.0.0" + unist-util-position-from-estree "^2.0.0" + +esast-util-from-js@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/esast-util-from-js/-/esast-util-from-js-2.0.1.tgz#5147bec34cc9da44accf52f87f239a40ac3e8225" + integrity sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw== + dependencies: + "@types/estree-jsx" "^1.0.0" + acorn "^8.0.0" + esast-util-from-estree "^2.0.0" + vfile-message "^4.0.0" + esbuild@^0.21.3, esbuild@^0.21.5: version "0.21.5" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== optionalDependencies: "@esbuild/aix-ppc64" "0.21.5" @@ -2284,31 +2307,31 @@ esbuild@^0.21.3, esbuild@^0.21.5: "@esbuild/win32-ia32" "0.21.5" "@esbuild/win32-x64" "0.21.5" -escalade@^3.1.1, escalade@^3.1.2: +escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== estree-util-attach-comments@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz" + resolved "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz#344bde6a64c8a31d15231e5ee9e297566a691c2d" integrity sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw== dependencies: "@types/estree" "^1.0.0" estree-util-build-jsx@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz" + resolved "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz#b6d0bced1dcc4f06f25cf0ceda2b2dcaf98168f1" integrity sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ== dependencies: "@types/estree-jsx" "^1.0.0" @@ -2318,12 +2341,20 @@ estree-util-build-jsx@^3.0.0: estree-util-is-identifier-name@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz" + resolved "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz#0b5ef4c4ff13508b34dcd01ecfa945f61fce5dbd" integrity sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg== +estree-util-scope@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz#9cbdfc77f5cb51e3d9ed4ad9c4adbff22d43e585" + integrity sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ== + dependencies: + "@types/estree" "^1.0.0" + devlop "^1.0.0" + estree-util-to-js@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz" + resolved "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz#10a6fb924814e6abb62becf0d2bc4dea51d04f17" integrity sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg== dependencies: "@types/estree-jsx" "^1.0.0" @@ -2332,7 +2363,7 @@ estree-util-to-js@^2.0.0: estree-util-visit@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz" + resolved "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz#13a9a9f40ff50ed0c022f831ddf4b58d05446feb" integrity sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww== dependencies: "@types/estree-jsx" "^1.0.0" @@ -2340,66 +2371,66 @@ estree-util-visit@^2.0.0: estree-walker@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== estree-walker@^3.0.0, estree-walker@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d" integrity sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g== dependencies: "@types/estree" "^1.0.0" eventemitter3@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz" + resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== expand-template@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz" + resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expressive-code@^0.35.6: - version "0.35.6" - resolved "https://registry.npmjs.org/expressive-code/-/expressive-code-0.35.6.tgz" - integrity sha512-+mx+TPTbMqgo0mL92Xh9QgjW0kSQIsEivMgEcOnaqKqL7qCw8Vkqc5Rg/di7ZYw4aMUSr74VTc+w8GQWu05j1g== +expressive-code@^0.38.3: + version "0.38.3" + resolved "https://registry.npmjs.org/expressive-code/-/expressive-code-0.38.3.tgz#9ac4e24e4ad83fe0df67b001faf0834b3d4e56ef" + integrity sha512-COM04AiUotHCKJgWdn7NtW2lqu8OW8owAidMpkXt1qxrZ9Q2iC7+tok/1qIn2ocGnczvr9paIySgGnEwFeEQ8Q== dependencies: - "@expressive-code/core" "^0.35.6" - "@expressive-code/plugin-frames" "^0.35.6" - "@expressive-code/plugin-shiki" "^0.35.6" - "@expressive-code/plugin-text-markers" "^0.35.6" + "@expressive-code/core" "^0.38.3" + "@expressive-code/plugin-frames" "^0.38.3" + "@expressive-code/plugin-shiki" "^0.38.3" + "@expressive-code/plugin-text-markers" "^0.38.3" extend-shallow@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== dependencies: is-extendable "^0.1.0" extend@^3.0.0: version "3.0.2" - resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" + resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== fast-deep-equal@^3.1.3: version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-equals@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz" + resolved "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== fast-fifo@^1.2.0, fast-fifo@^1.3.2: version "1.3.2" - resolved "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz" + resolved "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== fast-glob@^3.2.12, fast-glob@^3.3.2: version "3.3.2" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== dependencies: "@nodelib/fs.stat" "^2.0.2" @@ -2410,43 +2441,48 @@ fast-glob@^3.2.12, fast-glob@^3.3.2: fast-json-stable-stringify@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-uri@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz" - integrity sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw== + version "3.0.3" + resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== fastq@^1.6.0: version "1.17.1" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== dependencies: reusify "^1.0.4" +fdir@^6.4.2: + version "6.4.2" + resolved "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz#ddaa7ce1831b161bc3657bb99cb36e1622702689" + integrity sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ== + file-entry-cache@^9.1.0: version "9.1.0" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz#2e66ad98ce93f49aed1b178c57b0b5741591e075" integrity sha512-/pqPFG+FdxWQj+/WSuzXSDaNzxgTLr/OrR1QuqfEZzDakpdYE70PwUxL7BPUa8hpjbvY1+qvCl8k+8Tq34xJgg== dependencies: flat-cache "^5.0.0" fill-range@^7.1.1: version "7.1.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" find-up-simple@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz" + resolved "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz#21d035fde9fdbd56c8f4d2f63f32fd93a1cfc368" integrity sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw== find-up@^4.0.0: version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" @@ -2454,7 +2490,7 @@ find-up@^4.0.0: find-yarn-workspace-root2@1.2.16: version "1.2.16" - resolved "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz" + resolved "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz#60287009dd2f324f59646bdb4b7610a6b301c2a9" integrity sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA== dependencies: micromatch "^4.0.2" @@ -2462,94 +2498,94 @@ find-yarn-workspace-root2@1.2.16: flat-cache@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz#26c4da7b0f288b408bb2b506b2cb66c240ddf062" integrity sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ== dependencies: flatted "^3.3.1" keyv "^4.5.4" flatted@^3.3.1: - version "3.3.1" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz" - integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== + version "3.3.2" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27" + integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== flattie@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz" + resolved "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz#88182235723113667d36217fec55359275d6fe3d" integrity sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ== fs-constants@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" + resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== gensequence@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz" + resolved "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz#bb6aedec8ff665e3a6c42f92823121e3a6ea7718" integrity sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" - resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-east-asian-width@^1.0.0: - version "1.2.0" - resolved "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz" - integrity sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA== + version "1.3.0" + resolved "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz#21b4071ee58ed04ee0db653371b55b4299875389" + integrity sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ== get-stdin@^9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== github-from-package@0.0.0: version "0.0.0" - resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" + resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== github-slugger@2.0.0, github-slugger@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz" + resolved "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz#52cf2f9279a21eb6c59dd385b410f0c0adda8f1a" integrity sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw== glob-parent@^5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" global-directory@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz" + resolved "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz#4d7ac7cfd2cb73f304c53b8810891748df5e361e" integrity sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q== dependencies: ini "4.1.1" globals@^11.1.0: version "11.12.0" - resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== graceful-fs@^4.1.5: version "4.2.11" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== gray-matter@^4.0.3: version "4.0.3" - resolved "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz" + resolved "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q== dependencies: js-yaml "^3.13.1" @@ -2559,12 +2595,12 @@ gray-matter@^4.0.3: has-own-prop@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz" + resolved "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== hast-util-embedded@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-embedded/-/hast-util-embedded-3.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-embedded/-/hast-util-embedded-3.0.0.tgz#be4477780fbbe079cdba22982e357a0de4ba853e" integrity sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA== dependencies: "@types/hast" "^3.0.0" @@ -2572,7 +2608,7 @@ hast-util-embedded@^3.0.0: hast-util-format@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/hast-util-format/-/hast-util-format-1.1.0.tgz" + resolved "https://registry.npmjs.org/hast-util-format/-/hast-util-format-1.1.0.tgz#373e77382e07deb04f6676f1b4437e7d8549d985" integrity sha512-yY1UDz6bC9rDvCWHpx12aIBGRG7krurX0p0Fm6pT547LwDIZZiNr8a+IHDogorAdreULSEzP82Nlv5SZkHZcjA== dependencies: "@types/hast" "^3.0.0" @@ -2584,17 +2620,17 @@ hast-util-format@^1.0.0: unist-util-visit-parents "^6.0.0" hast-util-from-dom@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.0.tgz" - integrity sha512-d6235voAp/XR3Hh5uy7aGLbM3S4KamdW0WEgOaU1YoewnuYw4HXb5eRtv9g65m/RFGEfUY1Mw4UqCc5Y8L4Stg== + version "5.0.1" + resolved "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.1.tgz#c3c92fbd8d4e1c1625edeb3a773952b9e4ad64a8" + integrity sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q== dependencies: "@types/hast" "^3.0.0" - hastscript "^8.0.0" + hastscript "^9.0.0" web-namespaces "^2.0.0" hast-util-from-html-isomorphic@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz#b31baee386a899a2472326a3c5692f29f86d1d3c" integrity sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw== dependencies: "@types/hast" "^3.0.0" @@ -2604,7 +2640,7 @@ hast-util-from-html-isomorphic@^2.0.0: hast-util-from-html@2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz" + resolved "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz#9cd38ee81bf40b2607368b92a04b0905fa987488" integrity sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g== dependencies: "@types/hast" "^3.0.0" @@ -2616,7 +2652,7 @@ hast-util-from-html@2.0.1: hast-util-from-html@^2.0.0, hast-util-from-html@^2.0.1, hast-util-from-html@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz" + resolved "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz#485c74785358beb80c4ba6346299311ac4c49c82" integrity sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw== dependencies: "@types/hast" "^3.0.0" @@ -2627,14 +2663,14 @@ hast-util-from-html@^2.0.0, hast-util-from-html@^2.0.1, hast-util-from-html@^2.0 vfile-message "^4.0.0" hast-util-from-parse5@^8.0.0: - version "8.0.1" - resolved "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz" - integrity sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ== + version "8.0.2" + resolved "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.2.tgz#29b42758ba96535fd6021f0f533c000886c0f00f" + integrity sha512-SfMzfdAi/zAoZ1KkFEyyeXBn7u/ShQrfd675ZEE9M3qj+PMFX05xubzRyF76CCSJu8au9jgVxDV1+okFvgZU4A== dependencies: "@types/hast" "^3.0.0" "@types/unist" "^3.0.0" devlop "^1.0.0" - hastscript "^8.0.0" + hastscript "^9.0.0" property-information "^6.0.0" vfile "^6.0.0" vfile-location "^5.0.0" @@ -2642,36 +2678,36 @@ hast-util-from-parse5@^8.0.0: hast-util-has-property@3.0.0, hast-util-has-property@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz#4e595e3cddb8ce530ea92f6fc4111a818d8e7f93" integrity sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA== dependencies: "@types/hast" "^3.0.0" hast-util-heading-rank@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz#2d5c6f2807a7af5c45f74e623498dd6054d2aba8" integrity sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA== dependencies: "@types/hast" "^3.0.0" hast-util-is-body-ok-link@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-is-body-ok-link/-/hast-util-is-body-ok-link-3.0.0.tgz" - integrity sha512-VFHY5bo2nY8HiV6nir2ynmEB1XkxzuUffhEGeVx7orbu/B1KaGyeGgMZldvMVx5xWrDlLLG/kQ6YkJAMkBEx0w== + version "3.0.1" + resolved "https://registry.npmjs.org/hast-util-is-body-ok-link/-/hast-util-is-body-ok-link-3.0.1.tgz#ef63cb2f14f04ecf775139cd92bda5026380d8b4" + integrity sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ== dependencies: "@types/hast" "^3.0.0" hast-util-is-element@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz#6e31a6532c217e5b533848c7e52c9d9369ca0932" integrity sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g== dependencies: "@types/hast" "^3.0.0" hast-util-minify-whitespace@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/hast-util-minify-whitespace/-/hast-util-minify-whitespace-1.0.0.tgz" - integrity sha512-gD1m4YJSIk62ij32TlhFNqsC3dOQvpA4QAhyZOZFAT4u8LfEfB6N+F0V9oXQGBWXoqrs0h9wQRKa8RCeo8j61g== + version "1.0.1" + resolved "https://registry.npmjs.org/hast-util-minify-whitespace/-/hast-util-minify-whitespace-1.0.1.tgz#7588fd1a53f48f1d30406b81959dffc3650daf55" + integrity sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw== dependencies: "@types/hast" "^3.0.0" hast-util-embedded "^3.0.0" @@ -2681,14 +2717,14 @@ hast-util-minify-whitespace@^1.0.0: hast-util-parse-selector@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz#352879fa86e25616036037dd8931fb5f34cb4a27" integrity sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A== dependencies: "@types/hast" "^3.0.0" hast-util-phrasing@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/hast-util-phrasing/-/hast-util-phrasing-3.0.1.tgz" + resolved "https://registry.npmjs.org/hast-util-phrasing/-/hast-util-phrasing-3.0.1.tgz#fa284c0cd4a82a0dd6020de8300a7b1ebffa1690" integrity sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ== dependencies: "@types/hast" "^3.0.0" @@ -2698,9 +2734,9 @@ hast-util-phrasing@^3.0.0: hast-util-is-element "^3.0.0" hast-util-raw@^9.0.0: - version "9.0.4" - resolved "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.4.tgz" - integrity sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA== + version "9.1.0" + resolved "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.1.0.tgz#79b66b26f6f68fb50dfb4716b2cdca90d92adf2e" + integrity sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw== dependencies: "@types/hast" "^3.0.0" "@types/unist" "^3.0.0" @@ -2717,9 +2753,9 @@ hast-util-raw@^9.0.0: zwitch "^2.0.0" hast-util-select@^6.0.2: - version "6.0.2" - resolved "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.2.tgz" - integrity sha512-hT/SD/d/Meu+iobvgkffo1QecV8WeKWxwsNMzcTJsKw1cKTQKSR/7ArJeURLNJF9HDjp9nVoORyNNJxrvBye8Q== + version "6.0.3" + resolved "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.3.tgz#d30471b26efc88ae8a126ec36cd8ee6420fe3839" + integrity sha512-OVRQlQ1XuuLP8aFVLYmC2atrfWHS5UD3shonxpnyrjcCkwtvmt/+N6kYJdcY4mkMJhxp4kj2EFIxQ9kvkkt/eQ== dependencies: "@types/hast" "^3.0.0" "@types/unist" "^3.0.0" @@ -2731,7 +2767,6 @@ hast-util-select@^6.0.2: hast-util-has-property "^3.0.0" hast-util-to-string "^3.0.0" hast-util-whitespace "^3.0.0" - not "^0.1.0" nth-check "^2.0.0" property-information "^6.0.0" space-separated-tokens "^2.0.0" @@ -2740,7 +2775,7 @@ hast-util-select@^6.0.2: hast-util-to-estree@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.0.tgz" + resolved "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.0.tgz#f2afe5e869ddf0cf690c75f9fc699f3180b51b19" integrity sha512-lfX5g6hqVh9kjS/B9E2gSkvHH4SZNiQFiqWS0x9fENzEl+8W12RqdRxX6d/Cwxi30tPQs3bIO+aolQJNp1bIyw== dependencies: "@types/estree" "^1.0.0" @@ -2760,10 +2795,10 @@ hast-util-to-estree@^3.0.0: unist-util-position "^5.0.0" zwitch "^2.0.0" -hast-util-to-html@^9.0.0, hast-util-to-html@^9.0.1, hast-util-to-html@^9.0.2, hast-util-to-html@^9.0.3: - version "9.0.3" - resolved "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz" - integrity sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg== +hast-util-to-html@^9.0.0, hast-util-to-html@^9.0.1, hast-util-to-html@^9.0.3: + version "9.0.4" + resolved "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.4.tgz#d689c118c875aab1def692c58603e34335a0f5c5" + integrity sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA== dependencies: "@types/hast" "^3.0.0" "@types/unist" "^3.0.0" @@ -2778,9 +2813,9 @@ hast-util-to-html@^9.0.0, hast-util-to-html@^9.0.1, hast-util-to-html@^9.0.2, ha zwitch "^2.0.4" hast-util-to-jsx-runtime@^2.0.0: - version "2.3.0" - resolved "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.0.tgz" - integrity sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ== + version "2.3.2" + resolved "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.2.tgz#6d11b027473e69adeaa00ca4cfb5bb68e3d282fa" + integrity sha512-1ngXYb+V9UT5h+PxNRa1O1FYguZK/XL+gkeqvp7EdHlB9oHUG0eYRo/vY5inBdcqo3RkPMC58/H94HvkbfGdyg== dependencies: "@types/estree" "^1.0.0" "@types/hast" "^3.0.0" @@ -2800,7 +2835,7 @@ hast-util-to-jsx-runtime@^2.0.0: hast-util-to-parse5@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz#477cd42d278d4f036bc2ea58586130f6f39ee6ed" integrity sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw== dependencies: "@types/hast" "^3.0.0" @@ -2812,15 +2847,15 @@ hast-util-to-parse5@^8.0.0: zwitch "^2.0.0" hast-util-to-string@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.0.tgz" - integrity sha512-OGkAxX1Ua3cbcW6EJ5pT/tslVb90uViVkcJ4ZZIMW/R33DX/AkcJcRrPebPwJkHYwlDHXz4aIwvAAaAdtrACFA== + version "3.0.1" + resolved "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz#a4f15e682849326dd211c97129c94b0c3e76527c" + integrity sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A== dependencies: "@types/hast" "^3.0.0" hast-util-to-text@^4.0.0, hast-util-to-text@^4.0.1, hast-util-to-text@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz" + resolved "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz#57b676931e71bf9cb852453678495b3080bfae3e" integrity sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A== dependencies: "@types/hast" "^3.0.0" @@ -2830,25 +2865,14 @@ hast-util-to-text@^4.0.0, hast-util-to-text@^4.0.1, hast-util-to-text@^4.0.2: hast-util-whitespace@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz" + resolved "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621" integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw== dependencies: "@types/hast" "^3.0.0" -hastscript@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz" - integrity sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw== - dependencies: - "@types/hast" "^3.0.0" - comma-separated-tokens "^2.0.0" - hast-util-parse-selector "^4.0.0" - property-information "^6.0.0" - space-separated-tokens "^2.0.0" - hastscript@^9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/hastscript/-/hastscript-9.0.0.tgz" + resolved "https://registry.npmjs.org/hastscript/-/hastscript-9.0.0.tgz#2b76b9aa3cba8bf6d5280869f6f6f7165c230763" integrity sha512-jzaLBGavEDKHrc5EfFImKN7nZKKBdSLIdGvCwDZ9TfzbF2ffXiov8CKE445L2Z1Ek2t/m4SKQ2j6Ipv7NyUolw== dependencies: "@types/hast" "^3.0.0" @@ -2859,39 +2883,39 @@ hastscript@^9.0.0: html-escaper@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz" + resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz#4d336674652beb1dcbc29ef6b6ba7f6be6fdfed6" integrity sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ== html-void-elements@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz" + resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7" integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg== html-whitespace-sensitive-tag-names@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/html-whitespace-sensitive-tag-names/-/html-whitespace-sensitive-tag-names-3.0.0.tgz" - integrity sha512-KlClZ3/Qy5UgvpvVvDomGhnQhNWH5INE8GwvSIQ9CWt1K0zbbXrl7eN5bWaafOZgtmO3jMPwUqmrmEwinhPq1w== + version "3.0.1" + resolved "https://registry.npmjs.org/html-whitespace-sensitive-tag-names/-/html-whitespace-sensitive-tag-names-3.0.1.tgz#c35edd28205f3bf8c1fd03274608d60b923de5b2" + integrity sha512-q+310vW8zmymYHALr1da4HyXUQ0zgiIwIicEfotYPWGN0OJVEN/58IJ3A4GBYcEq3LGAZqKb+ugvP0GNB9CEAA== http-cache-semantics@^4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz" + resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== i18next@^23.11.5: - version "23.15.1" - resolved "https://registry.npmjs.org/i18next/-/i18next-23.15.1.tgz" - integrity sha512-wB4abZ3uK7EWodYisHl/asf8UYEhrI/vj/8aoSsrj/ZDxj4/UXPOa1KvFt1Fq5hkUHquNqwFlDprmjZ8iySgYA== + version "23.16.8" + resolved "https://registry.npmjs.org/i18next/-/i18next-23.16.8.tgz#3ae1373d344c2393f465556f394aba5a9233b93a" + integrity sha512-06r/TitrM88Mg5FdUXAKL96dJMzgqLE5dv3ryBAra4KCwD9mJ4ndOTS95ZuymIGoE+2hzfdaMak2X11/es7ZWg== dependencies: "@babel/runtime" "^7.23.2" ieee754@^1.1.13: version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== import-fresh@^3.3.0: version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" @@ -2899,47 +2923,47 @@ import-fresh@^3.3.0: import-meta-resolve@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz" + resolved "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#f9db8bead9fafa61adb811db77a2bf22c5399706" integrity sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw== inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== ini@4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz" + resolved "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== ini@~1.3.0: version "1.3.8" - resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" + resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== inline-style-parser@0.1.1: version "0.1.1" - resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz" + resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== inline-style-parser@0.2.4: version "0.2.4" - resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz" + resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz#f4af5fe72e612839fcd453d989a586566d695f22" integrity sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q== is-absolute-url@4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz" + resolved "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz#16e4d487d4fded05cfe0685e53ec86804a5e94dc" integrity sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A== is-alphabetical@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz" + resolved "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== is-alphanumerical@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz" + resolved "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" integrity sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw== dependencies: is-alphabetical "^2.0.0" @@ -2947,100 +2971,93 @@ is-alphanumerical@^2.0.0: is-arrayish@^0.3.1: version "0.3.2" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== is-decimal@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz" + resolved "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" integrity sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A== is-docker@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz" + resolved "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== is-extendable@^0.1.0: version "0.1.1" - resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-hexadecimal@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz" + resolved "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg== is-inside-container@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== dependencies: is-docker "^3.0.0" is-interactive@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz" + resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz#40c57614593826da1100ade6059778d597f16e90" integrity sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ== is-number@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-plain-obj@^4.0.0: version "4.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0" integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg== -is-reference@^3.0.0: - version "3.0.2" - resolved "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz" - integrity sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg== - dependencies: - "@types/estree" "*" - is-unicode-supported@^1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz" + resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz#d824984b616c292a2e198207d4a609983842f714" integrity sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ== is-unicode-supported@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz" + resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz#09f0ab0de6d3744d48d265ebb98f65d11f2a9b3a" integrity sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ== is-wsl@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz" + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz#e1c657e39c10090afcbedec61720f6b924c3cbd2" integrity sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw== dependencies: is-inside-container "^1.0.0" js-tokens@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.0, js-yaml@^3.13.1: version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" @@ -3048,73 +3065,73 @@ js-yaml@^3.13.0, js-yaml@^3.13.1: js-yaml@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" jsesc@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" - integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== + version "3.1.0" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== json-buffer@3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" + resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== json5@^2.2.3: version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsonc-parser@^2.3.0: version "2.3.1" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz#59549150b133f2efacca48fe9ce1ec0659af2342" integrity sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg== jsonc-parser@^3.0.0: version "3.3.1" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4" integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== katex@^0.16.0: - version "0.16.11" - resolved "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz" - integrity sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ== + version "0.16.18" + resolved "https://registry.npmjs.org/katex/-/katex-0.16.18.tgz#20781284288bc52805c519e48ac756163ad4b1f3" + integrity sha512-LRuk0rPdXrecAFwQucYjMiIs0JFefk6N1q/04mlw14aVIVgxq1FO0MA9RiIIGVaKOB5GIP5GH4aBBNraZERmaQ== dependencies: commander "^8.3.0" keyv@^4.5.4: version "4.5.4" - resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" + resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== dependencies: json-buffer "3.0.1" kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== kleur@4.1.5, kleur@^4.1.5: version "4.1.5" - resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz" + resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== kleur@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" + resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== load-yaml-file@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz" + resolved "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz#af854edaf2bea89346c07549122753c07372f64d" integrity sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw== dependencies: graceful-fs "^4.1.5" @@ -3124,19 +3141,19 @@ load-yaml-file@^0.2.0: locate-path@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: p-locate "^4.1.0" lodash@4.17.21: version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-symbols@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz#bb95e5f05322651cac30c0feb6404f9f2a8a9439" integrity sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw== dependencies: chalk "^5.3.0" @@ -3144,12 +3161,12 @@ log-symbols@^6.0.0: longest-streak@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz" + resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g== lru-cache@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: yallist "^3.0.2" @@ -3163,7 +3180,7 @@ magic-string@^0.30.14: magicast@^0.3.5: version "0.3.5" - resolved "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz" + resolved "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz#8301c3c7d66704a0771eb1bad74274f0ec036739" integrity sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ== dependencies: "@babel/parser" "^7.25.4" @@ -3172,22 +3189,22 @@ magicast@^0.3.5: markdown-extensions@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz" + resolved "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz#34bebc83e9938cae16e0e017e4a9814a8330d3c4" integrity sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q== markdown-table@^3.0.0: - version "3.0.3" - resolved "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz" - integrity sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw== + version "3.0.4" + resolved "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz#fe44d6d410ff9d6f2ea1797a3f60aa4d2b631c2a" + integrity sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw== mdast-heading-id@*: version "2.0.0" - resolved "https://registry.npmjs.org/mdast-heading-id/-/mdast-heading-id-2.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-heading-id/-/mdast-heading-id-2.0.0.tgz#07a55246f2190654392be0c51042548515dd6938" integrity sha512-JVh0xKqsI3INPzJEqqCiuq3BGde5x6AlBTQAetLQQr9qTiDjX4dCvFhIiGmyPt1rftiHELQPI5obGphIOTXeWQ== mdast-util-definitions@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz#c1bb706e5e76bb93f9a09dd7af174002ae69ac24" integrity sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ== dependencies: "@types/mdast" "^4.0.0" @@ -3196,7 +3213,7 @@ mdast-util-definitions@^6.0.0: mdast-util-directive@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz#3fb1764e705bbdf0afb0d3f889e4404c3e82561f" integrity sha512-JUpYOqKI4mM3sZcNxmF/ox04XYFFkNwr0CFlrQIkCwbvH0xzMCqkMqAde9wRd80VAhaUrwFwKm2nxretdT1h7Q== dependencies: "@types/mdast" "^4.0.0" @@ -3210,7 +3227,7 @@ mdast-util-directive@^3.0.0: mdast-util-find-and-replace@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz" + resolved "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz#a6fc7b62f0994e973490e45262e4bc07607b04e0" integrity sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA== dependencies: "@types/mdast" "^4.0.0" @@ -3219,9 +3236,9 @@ mdast-util-find-and-replace@^3.0.0: unist-util-visit-parents "^6.0.0" mdast-util-from-markdown@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz" - integrity sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA== + version "2.0.2" + resolved "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz#4850390ca7cf17413a9b9a0fbefcd1bc0eb4160a" + integrity sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA== dependencies: "@types/mdast" "^4.0.0" "@types/unist" "^3.0.0" @@ -3238,7 +3255,7 @@ mdast-util-from-markdown@^2.0.0: mdast-util-gfm-autolink-literal@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz" + resolved "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz#abd557630337bd30a6d5a4bd8252e1c2dc0875d5" integrity sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ== dependencies: "@types/mdast" "^4.0.0" @@ -3249,7 +3266,7 @@ mdast-util-gfm-autolink-literal@^2.0.0: mdast-util-gfm-footnote@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz#25a1753c7d16db8bfd53cd84fe50562bd1e6d6a9" integrity sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ== dependencies: "@types/mdast" "^4.0.0" @@ -3260,7 +3277,7 @@ mdast-util-gfm-footnote@^2.0.0: mdast-util-gfm-strikethrough@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz#d44ef9e8ed283ac8c1165ab0d0dfd058c2764c16" integrity sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg== dependencies: "@types/mdast" "^4.0.0" @@ -3269,7 +3286,7 @@ mdast-util-gfm-strikethrough@^2.0.0: mdast-util-gfm-table@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz#7a435fb6223a72b0862b33afbd712b6dae878d38" integrity sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg== dependencies: "@types/mdast" "^4.0.0" @@ -3280,7 +3297,7 @@ mdast-util-gfm-table@^2.0.0: mdast-util-gfm-task-list-item@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz#e68095d2f8a4303ef24094ab642e1047b991a936" integrity sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ== dependencies: "@types/mdast" "^4.0.0" @@ -3290,7 +3307,7 @@ mdast-util-gfm-task-list-item@^2.0.0: mdast-util-gfm@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz#3f2aecc879785c3cb6a81ff3a243dc11eca61095" integrity sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw== dependencies: mdast-util-from-markdown "^2.0.0" @@ -3303,7 +3320,7 @@ mdast-util-gfm@^3.0.0: mdast-util-math@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz#8d79dd3baf8ab8ac781f62b8853768190b9a00b0" integrity sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w== dependencies: "@types/hast" "^3.0.0" @@ -3316,7 +3333,7 @@ mdast-util-math@^3.0.0: mdast-util-mdx-expression@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz" + resolved "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz#43f0abac9adc756e2086f63822a38c8d3c3a5096" integrity sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ== dependencies: "@types/estree-jsx" "^1.0.0" @@ -3328,7 +3345,7 @@ mdast-util-mdx-expression@^2.0.0: mdast-util-mdx-jsx@^3.0.0: version "3.1.3" - resolved "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.3.tgz" + resolved "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.3.tgz#76b957b3da18ebcfd0de3a9b4451dcd6fdec2320" integrity sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ== dependencies: "@types/estree-jsx" "^1.0.0" @@ -3346,7 +3363,7 @@ mdast-util-mdx-jsx@^3.0.0: mdast-util-mdx@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz#792f9cf0361b46bee1fdf1ef36beac424a099c41" integrity sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w== dependencies: mdast-util-from-markdown "^2.0.0" @@ -3357,7 +3374,7 @@ mdast-util-mdx@^3.0.0: mdast-util-mdxjs-esm@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz" + resolved "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz#019cfbe757ad62dd557db35a695e7314bcc9fa97" integrity sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg== dependencies: "@types/estree-jsx" "^1.0.0" @@ -3369,7 +3386,7 @@ mdast-util-mdxjs-esm@^2.0.0: mdast-util-phrasing@^4.0.0: version "4.1.0" - resolved "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz#7cc0a8dec30eaf04b7b1a9661a92adb3382aa6e3" integrity sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w== dependencies: "@types/mdast" "^4.0.0" @@ -3377,7 +3394,7 @@ mdast-util-phrasing@^4.0.0: mdast-util-to-hast@^13.0.0: version "13.2.0" - resolved "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4" integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA== dependencies: "@types/hast" "^3.0.0" @@ -3391,35 +3408,36 @@ mdast-util-to-hast@^13.0.0: vfile "^6.0.0" mdast-util-to-markdown@^2.0.0, mdast-util-to-markdown@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz" - integrity sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ== + version "2.1.2" + resolved "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz#f910ffe60897f04bb4b7e7ee434486f76288361b" + integrity sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA== dependencies: "@types/mdast" "^4.0.0" "@types/unist" "^3.0.0" longest-streak "^3.0.0" mdast-util-phrasing "^4.0.0" mdast-util-to-string "^4.0.0" + micromark-util-classify-character "^2.0.0" micromark-util-decode-string "^2.0.0" unist-util-visit "^5.0.0" zwitch "^2.0.0" mdast-util-to-string@4.0.0, mdast-util-to-string@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz" + resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz#7a5121475556a04e7eddeb67b264aae79d312814" integrity sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg== dependencies: "@types/mdast" "^4.0.0" merge2@^1.3.0: version "1.4.1" - resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromark-core-commonmark@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz" - integrity sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA== + version "2.0.2" + resolved "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz#6a45bbb139e126b3f8b361a10711ccc7c6e15e93" + integrity sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w== dependencies: decode-named-character-reference "^1.0.0" devlop "^1.0.0" @@ -3440,7 +3458,7 @@ micromark-core-commonmark@^2.0.0: micromark-extension-directive@^3.0.0: version "3.0.2" - resolved "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.2.tgz" + resolved "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.2.tgz#2eb61985d1995a7c1ff7621676a4f32af29409e8" integrity sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA== dependencies: devlop "^1.0.0" @@ -3453,7 +3471,7 @@ micromark-extension-directive@^3.0.0: micromark-extension-gfm-autolink-literal@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz#6286aee9686c4462c1e3552a9d505feddceeb935" integrity sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw== dependencies: micromark-util-character "^2.0.0" @@ -3463,7 +3481,7 @@ micromark-extension-gfm-autolink-literal@^2.0.0: micromark-extension-gfm-footnote@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz#4dab56d4e398b9853f6fe4efac4fc9361f3e0750" integrity sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw== dependencies: devlop "^1.0.0" @@ -3477,7 +3495,7 @@ micromark-extension-gfm-footnote@^2.0.0: micromark-extension-gfm-strikethrough@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz#86106df8b3a692b5f6a92280d3879be6be46d923" integrity sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw== dependencies: devlop "^1.0.0" @@ -3489,7 +3507,7 @@ micromark-extension-gfm-strikethrough@^2.0.0: micromark-extension-gfm-table@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.0.tgz#5cadedfbb29fca7abf752447967003dc3b6583c9" integrity sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g== dependencies: devlop "^1.0.0" @@ -3500,14 +3518,14 @@ micromark-extension-gfm-table@^2.0.0: micromark-extension-gfm-tagfilter@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz#f26d8a7807b5985fba13cf61465b58ca5ff7dc57" integrity sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg== dependencies: micromark-util-types "^2.0.0" micromark-extension-gfm-task-list-item@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz#bcc34d805639829990ec175c3eea12bb5b781f2c" integrity sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw== dependencies: devlop "^1.0.0" @@ -3518,7 +3536,7 @@ micromark-extension-gfm-task-list-item@^2.0.0: micromark-extension-gfm@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz#3e13376ab95dd7a5cfd0e29560dfe999657b3c5b" integrity sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w== dependencies: micromark-extension-gfm-autolink-literal "^2.0.0" @@ -3532,7 +3550,7 @@ micromark-extension-gfm@^3.0.0: micromark-extension-math@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz#c42ee3b1dd5a9a03584e83dd8f08e3de510212c1" integrity sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg== dependencies: "@types/katex" "^0.16.0" @@ -3545,7 +3563,7 @@ micromark-extension-math@^3.0.0: micromark-extension-mdx-expression@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.0.tgz#1407b9ce69916cf5e03a196ad9586889df25302a" integrity sha512-sI0nwhUDz97xyzqJAbHQhp5TfaxEvZZZ2JDqUo+7NvyIYG6BZ5CPPqj2ogUoPJlmXHBnyZUzISg9+oUmU6tUjQ== dependencies: "@types/estree" "^1.0.0" @@ -3559,7 +3577,7 @@ micromark-extension-mdx-expression@^3.0.0: micromark-extension-mdx-jsx@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.1.tgz" + resolved "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.1.tgz#5abb83da5ddc8e473a374453e6ea56fbd66b59ad" integrity sha512-vNuFb9czP8QCtAQcEJn0UJQJZA8Dk6DXKBqx+bg/w0WGuSxDxNr7hErW89tHUY31dUW4NqEOWwmEUNhjTFmHkg== dependencies: "@types/acorn" "^4.0.0" @@ -3576,14 +3594,14 @@ micromark-extension-mdx-jsx@^3.0.0: micromark-extension-mdx-md@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz#1d252881ea35d74698423ab44917e1f5b197b92d" integrity sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ== dependencies: micromark-util-types "^2.0.0" micromark-extension-mdxjs-esm@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz#de21b2b045fd2059bd00d36746081de38390d54a" integrity sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A== dependencies: "@types/estree" "^1.0.0" @@ -3598,7 +3616,7 @@ micromark-extension-mdxjs-esm@^3.0.0: micromark-extension-mdxjs@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz#b5a2e0ed449288f3f6f6c544358159557549de18" integrity sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ== dependencies: acorn "^8.0.0" @@ -3611,18 +3629,18 @@ micromark-extension-mdxjs@^3.0.0: micromark-util-types "^2.0.0" micromark-factory-destination@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz" - integrity sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz#8fef8e0f7081f0474fbdd92deb50c990a0264639" + integrity sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA== dependencies: micromark-util-character "^2.0.0" micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" micromark-factory-label@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz" - integrity sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz#5267efa97f1e5254efc7f20b459a38cb21058ba1" + integrity sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg== dependencies: devlop "^1.0.0" micromark-util-character "^2.0.0" @@ -3631,7 +3649,7 @@ micromark-factory-label@^2.0.0: micromark-factory-mdx-expression@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.2.tgz" + resolved "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.2.tgz#2afaa8ba6d5f63e0cead3e4dee643cad184ca260" integrity sha512-5E5I2pFzJyg2CtemqAbcyCktpHXuJbABnsb32wX2U8IQKhhVFBqkcZR5LRm1WVoFqa4kTueZK4abep7wdo9nrw== dependencies: "@types/estree" "^1.0.0" @@ -3645,17 +3663,17 @@ micromark-factory-mdx-expression@^2.0.0: vfile-message "^4.0.0" micromark-factory-space@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz" - integrity sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz#36d0212e962b2b3121f8525fc7a3c7c029f334fc" + integrity sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg== dependencies: micromark-util-character "^2.0.0" micromark-util-types "^2.0.0" micromark-factory-title@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz" - integrity sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz#237e4aa5d58a95863f01032d9ee9b090f1de6e94" + integrity sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw== dependencies: micromark-factory-space "^2.0.0" micromark-util-character "^2.0.0" @@ -3663,9 +3681,9 @@ micromark-factory-title@^2.0.0: micromark-util-types "^2.0.0" micromark-factory-whitespace@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz" - integrity sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz#06b26b2983c4d27bfcc657b33e25134d4868b0b1" + integrity sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ== dependencies: micromark-factory-space "^2.0.0" micromark-util-character "^2.0.0" @@ -3674,54 +3692,54 @@ micromark-factory-whitespace@^2.0.0: micromark-heading-id@*: version "2.0.0" - resolved "https://registry.npmjs.org/micromark-heading-id/-/micromark-heading-id-2.0.0.tgz" + resolved "https://registry.npmjs.org/micromark-heading-id/-/micromark-heading-id-2.0.0.tgz#242ab53877a8b82e6e448910bc09a8f2677a6ad2" integrity sha512-TdR5WCmwuCroK8QrfX0/4w9bjj3ayN0GzatxGV/lWQKmM75kNKVZEmdvKZS4MOskARxWXu1WHdIJjMSVMBegow== dependencies: micromark-util-symbol "^2.0.0" micromark-util-character@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz" - integrity sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ== + version "2.1.1" + resolved "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6" + integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q== dependencies: micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" micromark-util-chunked@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz" - integrity sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz#47fbcd93471a3fccab86cff03847fc3552db1051" + integrity sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA== dependencies: micromark-util-symbol "^2.0.0" micromark-util-classify-character@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz" - integrity sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz#d399faf9c45ca14c8b4be98b1ea481bced87b629" + integrity sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q== dependencies: micromark-util-character "^2.0.0" micromark-util-symbol "^2.0.0" micromark-util-types "^2.0.0" micromark-util-combine-extensions@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz" - integrity sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz#2a0f490ab08bff5cc2fd5eec6dd0ca04f89b30a9" + integrity sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg== dependencies: micromark-util-chunked "^2.0.0" micromark-util-types "^2.0.0" micromark-util-decode-numeric-character-reference@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz" - integrity sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ== + version "2.0.2" + resolved "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz#fcf15b660979388e6f118cdb6bf7d79d73d26fe5" + integrity sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw== dependencies: micromark-util-symbol "^2.0.0" micromark-util-decode-string@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz" - integrity sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz#6cb99582e5d271e84efca8e61a807994d7161eb2" + integrity sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ== dependencies: decode-named-character-reference "^1.0.0" micromark-util-character "^2.0.0" @@ -3729,13 +3747,13 @@ micromark-util-decode-string@^2.0.0: micromark-util-symbol "^2.0.0" micromark-util-encode@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz" - integrity sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8" + integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw== micromark-util-events-to-acorn@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.2.tgz" + resolved "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.2.tgz#4275834f5453c088bd29cd72dfbf80e3327cec07" integrity sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA== dependencies: "@types/acorn" "^4.0.0" @@ -3748,37 +3766,37 @@ micromark-util-events-to-acorn@^2.0.0: vfile-message "^4.0.0" micromark-util-html-tag-name@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz" - integrity sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz#e40403096481986b41c106627f98f72d4d10b825" + integrity sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA== micromark-util-normalize-identifier@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz" - integrity sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz#c30d77b2e832acf6526f8bf1aa47bc9c9438c16d" + integrity sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q== dependencies: micromark-util-symbol "^2.0.0" micromark-util-resolve-all@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz" - integrity sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz#e1a2d62cdd237230a2ae11839027b19381e31e8b" + integrity sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg== dependencies: micromark-util-types "^2.0.0" micromark-util-sanitize-uri@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz" - integrity sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7" + integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ== dependencies: micromark-util-character "^2.0.0" micromark-util-encode "^2.0.0" micromark-util-symbol "^2.0.0" micromark-util-subtokenize@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz" - integrity sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q== + version "2.0.3" + resolved "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.3.tgz#70ffb99a454bd8c913c8b709c3dc97baefb65f96" + integrity sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg== dependencies: devlop "^1.0.0" micromark-util-chunked "^2.0.0" @@ -3786,19 +3804,19 @@ micromark-util-subtokenize@^2.0.0: micromark-util-types "^2.0.0" micromark-util-symbol@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz" - integrity sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8" + integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q== micromark-util-types@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz" - integrity sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w== + version "2.0.1" + resolved "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.1.tgz#a3edfda3022c6c6b55bfb049ef5b75d70af50709" + integrity sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ== micromark@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz" - integrity sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ== + version "4.0.1" + resolved "https://registry.npmjs.org/micromark/-/micromark-4.0.1.tgz#294c2f12364759e5f9e925a767ae3dfde72223ff" + integrity sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw== dependencies: "@types/debug" "^4.0.0" debug "^4.0.0" @@ -3820,7 +3838,7 @@ micromark@^4.0.0: micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" @@ -3828,37 +3846,37 @@ micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8: mimic-function@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz" + resolved "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz#acbe2b3349f99b9deaca7fb70e48b83e94e67076" integrity sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA== mimic-response@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz" + resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== minimist@^1.2.0, minimist@^1.2.3: version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: version "0.5.3" - resolved "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz" + resolved "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== mrmime@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz" + resolved "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz#151082a6e06e59a9a39b46b3e14d5cfe92b3abb4" integrity sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw== ms@^2.1.3: version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== muggle-string@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz" + resolved "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz#3b366bd43b32f809dc20659534dd30e7c8a0d328" integrity sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ== nanoid@^3.3.7: @@ -3868,60 +3886,55 @@ nanoid@^3.3.7: napi-build-utils@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz" + resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== neotraverse@^0.6.18: version "0.6.18" - resolved "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.18.tgz" + resolved "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.18.tgz#abcb33dda2e8e713cf6321b29405e822230cdb30" integrity sha512-Z4SmBUweYa09+o6pG+eASabEpP6QkQ70yHj351pQoEXIs8uHbaU2DWVmzBANKgflPa47A50PtB2+NgRpQvr7vA== nlcst-to-string@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz" + resolved "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz#05511e8461ebfb415952eb0b7e9a1a7d40471bd4" integrity sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA== dependencies: "@types/nlcst" "^2.0.0" node-abi@^3.3.0: - version "3.68.0" - resolved "https://registry.npmjs.org/node-abi/-/node-abi-3.68.0.tgz" - integrity sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A== + version "3.71.0" + resolved "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz#52d84bbcd8575efb71468fbaa1f9a49b2c242038" + integrity sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw== dependencies: semver "^7.3.5" node-addon-api@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz" + resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz#ac8470034e58e67d0c6f1204a18ae6995d9c0d76" integrity sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA== -node-releases@^2.0.18: - version "2.0.18" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz" - integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== - -not@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/not/-/not-0.1.0.tgz" - integrity sha512-5PDmaAsVfnWUgTUbJ3ERwn7u79Z0dYxN9ErxCpVJJqe2RK0PJ3z+iFUxuqjwtlDDegXvtWoxD/3Fzxox7tFGWA== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== nth-check@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz" + resolved "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== dependencies: boolbase "^1.0.0" once@^1.3.1, once@^1.4.0: version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" onetime@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz" + resolved "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz#9f16c92d8c9ef5120e3acd9dd9957cceecc1ab60" integrity sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ== dependencies: mimic-function "^5.0.0" @@ -3952,75 +3965,74 @@ ora@^8.1.1: p-limit@^2.2.0: version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" p-limit@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz#d91f9364d3fdff89b0a45c70d04ad4e0df30a0e8" integrity sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg== dependencies: yocto-queue "^1.1.1" p-locate@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: p-limit "^2.2.0" p-queue@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz" + resolved "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz#718b7f83836922ef213ddec263ff4223ce70bef8" integrity sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA== dependencies: eventemitter3 "^5.0.1" p-timeout "^6.1.2" p-timeout@^6.1.2: - version "6.1.2" - resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz" - integrity sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ== + version "6.1.3" + resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.3.tgz#9635160c4e10c7b4c3db45b7d5d26f911d9fd853" + integrity sha512-UJUyfKbwvr/uZSV6btANfb+0t/mOhKV/KXcCUTp8FcQI+v/0d+wXqH4htrW0E4rR6WiEO/EPvUFiV9D5OI4vlw== p-try@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== pagefind@^1.0.3: - version "1.1.1" - resolved "https://registry.npmjs.org/pagefind/-/pagefind-1.1.1.tgz" - integrity sha512-U2YR0dQN5B2fbIXrLtt/UXNS0yWSSYfePaad1KcBPTi0p+zRtsVjwmoPaMQgTks5DnHNbmDxyJUL5TGaLljK3A== + version "1.3.0" + resolved "https://registry.npmjs.org/pagefind/-/pagefind-1.3.0.tgz#467560447dcc7bbe590f1b888cc8bc733bb377fa" + integrity sha512-8KPLGT5g9s+olKMRTU9LFekLizkVIu9tes90O1/aigJ0T5LmyPqTzGJrETnSw3meSYg58YH7JTzhTTW/3z6VAw== optionalDependencies: - "@pagefind/darwin-arm64" "1.1.1" - "@pagefind/darwin-x64" "1.1.1" - "@pagefind/linux-arm64" "1.1.1" - "@pagefind/linux-x64" "1.1.1" - "@pagefind/windows-x64" "1.1.1" + "@pagefind/darwin-arm64" "1.3.0" + "@pagefind/darwin-x64" "1.3.0" + "@pagefind/linux-arm64" "1.3.0" + "@pagefind/linux-x64" "1.3.0" + "@pagefind/windows-x64" "1.3.0" parent-module@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" parent-module@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz#fa71f88ff1a50c27e15d8ff74e0e3a9523bf8708" integrity sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg== dependencies: callsites "^3.1.0" parse-entities@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz" - integrity sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w== + version "4.0.2" + resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz#61d46f5ed28e4ee62e9ddc43d6b010188443f159" + integrity sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw== dependencies: "@types/unist" "^2.0.0" - character-entities "^2.0.0" character-entities-legacy "^3.0.0" character-reference-invalid "^2.0.0" decode-named-character-reference "^1.0.0" @@ -4030,7 +4042,7 @@ parse-entities@^4.0.0: parse-latin@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/parse-latin/-/parse-latin-7.0.0.tgz" + resolved "https://registry.npmjs.org/parse-latin/-/parse-latin-7.0.0.tgz#8dfacac26fa603f76417f36233fc45602a323e1d" integrity sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ== dependencies: "@types/nlcst" "^2.0.0" @@ -4041,85 +4053,76 @@ parse-latin@^7.0.0: vfile "^6.0.0" parse5@^7.0.0: - version "7.1.2" - resolved "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz" - integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + version "7.2.1" + resolved "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== dependencies: - entities "^4.4.0" + entities "^4.5.0" path-browserify@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz" + resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== -periscopic@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz" - integrity sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw== - dependencies: - "@types/estree" "^1.0.0" - estree-walker "^3.0.0" - is-reference "^3.0.0" - -picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz" - integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw== +picocolors@^1.0.0, picocolors@^1.1.0, picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@4.0.2, picomatch@^4.0.2: version "4.0.2" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== picomatch@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pify@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" + resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== pkg-dir@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: find-up "^4.0.0" postcss-nested@^6.0.1: version "6.2.0" - resolved "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz" + resolved "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz#4c2d22ab5f20b9cb61e2c5c5915950784d068131" integrity sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ== dependencies: postcss-selector-parser "^6.1.1" postcss-selector-parser@^6.1.1: version "6.1.2" - resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz" + resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz#27ecb41fb0e3b6ba7a1ec84fff347f734c7929de" integrity sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" postcss@^8.4.38, postcss@^8.4.43: - version "8.4.47" - resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz" - integrity sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ== + version "8.4.49" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" + integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== dependencies: nanoid "^3.3.7" - picocolors "^1.1.0" + picocolors "^1.1.1" source-map-js "^1.2.1" prebuild-install@^7.1.1: version "7.1.2" - resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz" + resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz#a5fd9986f5a6251fbc47e1e5c65de71e68c0a056" integrity sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ== dependencies: detect-libc "^2.0.0" @@ -4137,7 +4140,7 @@ prebuild-install@^7.1.1: preferred-pm@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/preferred-pm/-/preferred-pm-4.0.0.tgz" + resolved "https://registry.npmjs.org/preferred-pm/-/preferred-pm-4.0.0.tgz#6b256a44d39181fb3829b3abbd9ea2ead6db082b" integrity sha512-gYBeFTZLu055D8Vv3cSPox/0iTPtkzxpLroSYYA7WXgRi31WCJ51Uyl8ZiPeUUjyvs2MBzK+S8v9JVUgHU/Sqw== dependencies: find-up-simple "^1.0.0" @@ -4146,17 +4149,17 @@ preferred-pm@^4.0.0: prettier@2.8.7: version "2.8.7" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== prismjs@^1.29.0: version "1.29.0" - resolved "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz" + resolved "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz#f113555a8fa9b57c35e637bba27509dcf802dd12" integrity sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q== prompts@^2.4.2: version "2.4.2" - resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" + resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" @@ -4164,12 +4167,12 @@ prompts@^2.4.2: property-information@^6.0.0: version "6.5.0" - resolved "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz" + resolved "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz#6212fbb52ba757e92ef4fb9d657563b933b7ffec" integrity sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig== pump@^3.0.0: version "3.0.2" - resolved "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz" + resolved "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== dependencies: end-of-stream "^1.1.0" @@ -4177,17 +4180,17 @@ pump@^3.0.0: queue-microtask@^1.2.2: version "1.2.3" - resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" + resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== queue-tick@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz" + resolved "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz#f6f07ac82c1fd60f82e098b417a80e52f1f4c142" integrity sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag== rc@^1.2.7: version "1.2.8" - resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" + resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" @@ -4197,7 +4200,7 @@ rc@^1.2.7: readable-stream@^3.1.1, readable-stream@^3.4.0: version "3.6.2" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" @@ -4209,9 +4212,49 @@ readdirp@^4.0.1: resolved "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz#388fccb8b75665da3abffe2d8f8ed59fe74c230a" integrity sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA== +recma-build-jsx@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz#c02f29e047e103d2fab2054954e1761b8ea253c4" + integrity sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew== + dependencies: + "@types/estree" "^1.0.0" + estree-util-build-jsx "^3.0.0" + vfile "^6.0.0" + +recma-jsx@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.0.tgz#f7bef02e571a49d6ba3efdfda8e2efab48dbe3aa" + integrity sha512-5vwkv65qWwYxg+Atz95acp8DMu1JDSqdGkA2Of1j6rCreyFUE/gp15fC8MnGEuG1W68UKjM6x6+YTWIh7hZM/Q== + dependencies: + acorn-jsx "^5.0.0" + estree-util-to-js "^2.0.0" + recma-parse "^1.0.0" + recma-stringify "^1.0.0" + unified "^11.0.0" + +recma-parse@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/recma-parse/-/recma-parse-1.0.0.tgz#c351e161bb0ab47d86b92a98a9d891f9b6814b52" + integrity sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ== + dependencies: + "@types/estree" "^1.0.0" + esast-util-from-js "^2.0.0" + unified "^11.0.0" + vfile "^6.0.0" + +recma-stringify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/recma-stringify/-/recma-stringify-1.0.0.tgz#54632030631e0c7546136ff9ef8fde8e7b44f130" + integrity sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g== + dependencies: + "@types/estree" "^1.0.0" + estree-util-to-js "^2.0.0" + unified "^11.0.0" + vfile "^6.0.0" + regenerator-runtime@^0.14.0: version "0.14.1" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== regex-recursion@^4.3.0: @@ -4235,7 +4278,7 @@ regex@^5.0.2: rehype-autolink-headings@7.1.0: version "7.1.0" - resolved "https://registry.npmjs.org/rehype-autolink-headings/-/rehype-autolink-headings-7.1.0.tgz" + resolved "https://registry.npmjs.org/rehype-autolink-headings/-/rehype-autolink-headings-7.1.0.tgz#531087e155d9df053944923efd47d99728f3b196" integrity sha512-rItO/pSdvnvsP4QRB1pmPiNHUskikqtPojZKJPPPAVx9Hj8i8TwMBhofrrAYRhYOOBZH9tgmG5lPqDLuIWPWmw== dependencies: "@types/hast" "^3.0.0" @@ -4245,16 +4288,16 @@ rehype-autolink-headings@7.1.0: unified "^11.0.0" unist-util-visit "^5.0.0" -rehype-expressive-code@^0.35.6: - version "0.35.6" - resolved "https://registry.npmjs.org/rehype-expressive-code/-/rehype-expressive-code-0.35.6.tgz" - integrity sha512-pPdE+pRcRw01kxMOwHQjuRxgwlblZt5+wAc3w2aPGgmcnn57wYjn07iKO7zaznDxYVxMYVvYlnL+R3vWFQS4Gw== +rehype-expressive-code@^0.38.3: + version "0.38.3" + resolved "https://registry.npmjs.org/rehype-expressive-code/-/rehype-expressive-code-0.38.3.tgz#53d9933b1d5f579b36cb38c34b7368c0cf4f133e" + integrity sha512-RYSSDkMBikoTbycZPkcWp6ELneANT4eTpND1DSRJ6nI2eVFUwTBDCvE2vO6jOOTaavwnPiydi4i/87NRyjpdOA== dependencies: - expressive-code "^0.35.6" + expressive-code "^0.38.3" rehype-format@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/rehype-format/-/rehype-format-5.0.1.tgz" + resolved "https://registry.npmjs.org/rehype-format/-/rehype-format-5.0.1.tgz#e255e59bed0c062156aaf51c16fad5a521a1f5c8" integrity sha512-zvmVru9uB0josBVpr946OR8ui7nJEdzZobwLOOqHb/OOD88W0Vk2SqLwoVOj0fM6IPCCO6TaV9CvQvJMWwukFQ== dependencies: "@types/hast" "^3.0.0" @@ -4262,7 +4305,7 @@ rehype-format@^5.0.0: rehype-katex@7.0.1: version "7.0.1" - resolved "https://registry.npmjs.org/rehype-katex/-/rehype-katex-7.0.1.tgz" + resolved "https://registry.npmjs.org/rehype-katex/-/rehype-katex-7.0.1.tgz#832e6d7af2744a228981d1b0fe89483a9e7c93a1" integrity sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA== dependencies: "@types/hast" "^3.0.0" @@ -4274,9 +4317,9 @@ rehype-katex@7.0.1: vfile "^6.0.0" rehype-parse@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz" - integrity sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw== + version "9.0.1" + resolved "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.1.tgz#9993bda129acc64c417a9d3654a7be38b2a94c20" + integrity sha512-ksCzCD0Fgfh7trPDxr2rSylbwq9iYDkSn8TCDmEJ49ljEUBxDVCzCHv7QNzZOfODanX4+bWQ4WZqLCRWYLfhag== dependencies: "@types/hast" "^3.0.0" hast-util-from-html "^2.0.0" @@ -4284,23 +4327,23 @@ rehype-parse@^9.0.0: rehype-raw@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz" + resolved "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz#59d7348fd5dbef3807bbaa1d443efd2dd85ecee4" integrity sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww== dependencies: "@types/hast" "^3.0.0" hast-util-raw "^9.0.0" vfile "^6.0.0" -rehype-stringify@^10.0.0: - version "10.0.0" - resolved "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz" - integrity sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ== +rehype-recma@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz#d68ef6344d05916bd96e25400c6261775411aa76" + integrity sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw== dependencies: + "@types/estree" "^1.0.0" "@types/hast" "^3.0.0" - hast-util-to-html "^9.0.0" - unified "^11.0.0" + hast-util-to-estree "^3.0.0" -rehype-stringify@^10.0.1: +rehype-stringify@^10.0.0, rehype-stringify@^10.0.1: version "10.0.1" resolved "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.1.tgz#2ec1ebc56c6aba07905d3b4470bdf0f684f30b75" integrity sha512-k9ecfXHmIPuFVI61B9DeLPN0qFHfawM6RsuX48hoqlaKSF61RskNjSm1lI8PhBEM0MRdLxVVm4WmTqJQccH9mA== @@ -4321,7 +4364,7 @@ rehype@^13.0.1, rehype@^13.0.2: remark-custom-heading-id@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/remark-custom-heading-id/-/remark-custom-heading-id-2.0.0.tgz" + resolved "https://registry.npmjs.org/remark-custom-heading-id/-/remark-custom-heading-id-2.0.0.tgz#9eecf63937cea189f9737df74059129906847efd" integrity sha512-LpR+c4pmuBGG/zhNbebecDnpKyXU4B7bdNu6tXW83T3QWlkwUpHYyUR8uXQ/BERK9HlI5pXGLu7DjkIS07/iVQ== dependencies: mdast-heading-id "*" @@ -4330,7 +4373,7 @@ remark-custom-heading-id@2.0.0: remark-directive@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.0.tgz" + resolved "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.0.tgz#34452d951b37e6207d2e2a4f830dc33442923268" integrity sha512-l1UyWJ6Eg1VPU7Hm/9tt0zKtReJQNOA4+iDMAxTyZNWnJnFlbS/7zhiel/rogTLQ2vMYwDzSJa4BiVNqGlqIMA== dependencies: "@types/mdast" "^4.0.0" @@ -4340,7 +4383,7 @@ remark-directive@^3.0.0: remark-gfm@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz" + resolved "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz#aea777f0744701aa288b67d28c43565c7e8c35de" integrity sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA== dependencies: "@types/mdast" "^4.0.0" @@ -4352,7 +4395,7 @@ remark-gfm@^4.0.0: remark-math@6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz" + resolved "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz#0acdf74675f1c195fea6efffa78582f7ed7fc0d7" integrity sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA== dependencies: "@types/mdast" "^4.0.0" @@ -4361,16 +4404,16 @@ remark-math@6.0.0: unified "^11.0.0" remark-mdx@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.1.tgz" - integrity sha512-3Pz3yPQ5Rht2pM5R+0J2MrGoBSrzf+tJG94N+t/ilfdh8YLyyKYtidAYwTveB20BoHAcwIopOUqhcmh2F7hGYA== + version "3.1.0" + resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz#f979be729ecb35318fa48e2135c1169607a78343" + integrity sha512-Ngl/H3YXyBV9RcRNdlYsZujAmhsxwzxpDzpDEhFBVAGthS4GDgnctpDjgFl/ULx5UEDzqtW1cyBSNKqYYrqLBA== dependencies: mdast-util-mdx "^3.0.0" micromark-extension-mdxjs "^3.0.0" remark-parse@^11.0.0: version "11.0.0" - resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz" + resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz#aa60743fcb37ebf6b069204eb4da304e40db45a1" integrity sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA== dependencies: "@types/mdast" "^4.0.0" @@ -4378,9 +4421,9 @@ remark-parse@^11.0.0: micromark-util-types "^2.0.0" unified "^11.0.0" -remark-rehype@^11.0.0, remark-rehype@^11.1.0, remark-rehype@^11.1.1: +remark-rehype@^11.0.0, remark-rehype@^11.1.1: version "11.1.1" - resolved "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.1.tgz" + resolved "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.1.tgz#f864dd2947889a11997c0a2667cd6b38f685bca7" integrity sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ== dependencies: "@types/hast" "^3.0.0" @@ -4391,7 +4434,7 @@ remark-rehype@^11.0.0, remark-rehype@^11.1.0, remark-rehype@^11.1.1: remark-smartypants@^3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-3.0.2.tgz" + resolved "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-3.0.2.tgz#cbaf2b39624c78fcbd6efa224678c1d2e9bc1dfb" integrity sha512-ILTWeOriIluwEvPjv67v7Blgrcx+LZOkAUVtKI3putuhlZm84FnqDORNXPPm+HY3NdZOMhyDwZ1E+eZB/Df5dA== dependencies: retext "^9.0.0" @@ -4401,7 +4444,7 @@ remark-smartypants@^3.0.2: remark-stringify@^11.0.0: version "11.0.0" - resolved "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz" + resolved "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz#4c5b01dd711c269df1aaae11743eb7e2e7636fd3" integrity sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw== dependencies: "@types/mdast" "^4.0.0" @@ -4420,42 +4463,42 @@ remark@^15.0.1: repeat-string@^1.6.1: version "1.6.1" - resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== request-light@^0.5.7: version "0.5.8" - resolved "https://registry.npmjs.org/request-light/-/request-light-0.5.8.tgz" + resolved "https://registry.npmjs.org/request-light/-/request-light-0.5.8.tgz#8bf73a07242b9e7b601fac2fa5dc22a094abcc27" integrity sha512-3Zjgh+8b5fhRJBQZoy+zbVKpAQGLyka0MPgW3zruTF4dFFJ8Fqcfu9YsAvi/rvdcaTeWG3MkbZv4WKxAn/84Lg== request-light@^0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz" + resolved "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a" integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q== require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== require-from-string@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== resolve-from@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-from@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== restore-cursor@^5.0.0: version "5.1.0" - resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz#0766d95699efacb14150993f55baf0953ea1ebe7" integrity sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA== dependencies: onetime "^7.0.0" @@ -4463,7 +4506,7 @@ restore-cursor@^5.0.0: retext-latin@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/retext-latin/-/retext-latin-4.0.0.tgz" + resolved "https://registry.npmjs.org/retext-latin/-/retext-latin-4.0.0.tgz#d02498aa1fd39f1bf00e2ff59b1384c05d0c7ce3" integrity sha512-hv9woG7Fy0M9IlRQloq/N6atV82NxLGveq+3H2WOi79dtIYWN8OaxogDm77f8YnVXJL2VD3bbqowu5E3EMhBYA== dependencies: "@types/nlcst" "^2.0.0" @@ -4471,9 +4514,9 @@ retext-latin@^4.0.0: unified "^11.0.0" retext-smartypants@^6.0.0: - version "6.1.1" - resolved "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-6.1.1.tgz" - integrity sha512-onsHf34i/GzgElJgtT1K2V+31yEhWs7NJboKNxXJcmVMMPxLpgxZ9iADoMdydd6j/bHic5F/aNq0CGqElEtu2g== + version "6.2.0" + resolved "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-6.2.0.tgz#4e852c2974cf2cfa253eeec427c97efc43b5d158" + integrity sha512-kk0jOU7+zGv//kfjXEBjdIryL1Acl4i9XNkHxtM7Tm5lFiCog576fjNC9hjoR7LTKQ0DsPWy09JummSsH1uqfQ== dependencies: "@types/nlcst" "^2.0.0" nlcst-to-string "^4.0.0" @@ -4481,7 +4524,7 @@ retext-smartypants@^6.0.0: retext-stringify@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/retext-stringify/-/retext-stringify-4.0.0.tgz" + resolved "https://registry.npmjs.org/retext-stringify/-/retext-stringify-4.0.0.tgz#501d5440bd4d121e351c7c509f8507de9611e159" integrity sha512-rtfN/0o8kL1e+78+uxPTqu1Klt0yPzKuQ2BfWwwfgIUSayyzxpM1PJzkKt4V8803uB9qSy32MvI7Xep9khTpiA== dependencies: "@types/nlcst" "^2.0.0" @@ -4490,7 +4533,7 @@ retext-stringify@^4.0.0: retext@^9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/retext/-/retext-9.0.0.tgz" + resolved "https://registry.npmjs.org/retext/-/retext-9.0.0.tgz#ab5cd72836894167b0ca6ae70fdcfaa166267f7a" integrity sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA== dependencies: "@types/nlcst" "^2.0.0" @@ -4500,54 +4543,57 @@ retext@^9.0.0: reusify@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" + resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rollup@^4.20.0: - version "4.24.0" - resolved "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz#c14a3576f20622ea6a5c9cad7caca5e6e9555d05" - integrity sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg== + version "4.28.1" + resolved "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz#7718ba34d62b449dfc49adbfd2f312b4fe0df4de" + integrity sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg== dependencies: "@types/estree" "1.0.6" optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.24.0" - "@rollup/rollup-android-arm64" "4.24.0" - "@rollup/rollup-darwin-arm64" "4.24.0" - "@rollup/rollup-darwin-x64" "4.24.0" - "@rollup/rollup-linux-arm-gnueabihf" "4.24.0" - "@rollup/rollup-linux-arm-musleabihf" "4.24.0" - "@rollup/rollup-linux-arm64-gnu" "4.24.0" - "@rollup/rollup-linux-arm64-musl" "4.24.0" - "@rollup/rollup-linux-powerpc64le-gnu" "4.24.0" - "@rollup/rollup-linux-riscv64-gnu" "4.24.0" - "@rollup/rollup-linux-s390x-gnu" "4.24.0" - "@rollup/rollup-linux-x64-gnu" "4.24.0" - "@rollup/rollup-linux-x64-musl" "4.24.0" - "@rollup/rollup-win32-arm64-msvc" "4.24.0" - "@rollup/rollup-win32-ia32-msvc" "4.24.0" - "@rollup/rollup-win32-x64-msvc" "4.24.0" + "@rollup/rollup-android-arm-eabi" "4.28.1" + "@rollup/rollup-android-arm64" "4.28.1" + "@rollup/rollup-darwin-arm64" "4.28.1" + "@rollup/rollup-darwin-x64" "4.28.1" + "@rollup/rollup-freebsd-arm64" "4.28.1" + "@rollup/rollup-freebsd-x64" "4.28.1" + "@rollup/rollup-linux-arm-gnueabihf" "4.28.1" + "@rollup/rollup-linux-arm-musleabihf" "4.28.1" + "@rollup/rollup-linux-arm64-gnu" "4.28.1" + "@rollup/rollup-linux-arm64-musl" "4.28.1" + "@rollup/rollup-linux-loongarch64-gnu" "4.28.1" + "@rollup/rollup-linux-powerpc64le-gnu" "4.28.1" + "@rollup/rollup-linux-riscv64-gnu" "4.28.1" + "@rollup/rollup-linux-s390x-gnu" "4.28.1" + "@rollup/rollup-linux-x64-gnu" "4.28.1" + "@rollup/rollup-linux-x64-musl" "4.28.1" + "@rollup/rollup-win32-arm64-msvc" "4.28.1" + "@rollup/rollup-win32-ia32-msvc" "4.28.1" + "@rollup/rollup-win32-x64-msvc" "4.28.1" fsevents "~2.3.2" run-parallel@^1.1.9: version "1.2.0" - resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" + resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== dependencies: queue-microtask "^1.2.2" safe-buffer@^5.0.1, safe-buffer@~5.2.0: version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== sax@^1.2.4: version "1.4.1" - resolved "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz" + resolved "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== section-matter@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz" + resolved "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167" integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA== dependencies: extend-shallow "^2.0.1" @@ -4555,17 +4601,17 @@ section-matter@^1.0.0: semver@^6.3.1: version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.3.5, semver@^7.3.8, semver@^7.5.4, semver@^7.6.2, semver@^7.6.3: version "7.6.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== sharp@^0.32.5: version "0.32.6" - resolved "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz" + resolved "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz#6ad30c0b7cd910df65d5f355f774aa4fce45732a" integrity sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w== dependencies: color "^4.2.3" @@ -4579,7 +4625,7 @@ sharp@^0.32.5: sharp@^0.33.3: version "0.33.5" - resolved "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz" + resolved "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz#13e0e4130cc309d6a9497596715240b2ec0c594e" integrity sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw== dependencies: color "^4.2.3" @@ -4606,7 +4652,7 @@ sharp@^0.33.3: "@img/sharp-win32-ia32" "0.33.5" "@img/sharp-win32-x64" "0.33.5" -shiki@^1.1.7, shiki@^1.10.3, shiki@^1.22.0, shiki@^1.23.1: +shiki@^1.22.0, shiki@^1.22.2, shiki@^1.23.1: version "1.24.2" resolved "https://registry.npmjs.org/shiki/-/shiki-1.24.2.tgz#9db5b2ebe452d24769377c733ae1944f996ad584" integrity sha512-TR1fi6mkRrzW+SKT5G6uKuc32Dj2EEa7Kj0k8kGqiBINb+C1TiflVOiT9ta6GqOJtC4fraxO5SLUaKBcSY38Fg== @@ -4620,17 +4666,17 @@ shiki@^1.1.7, shiki@^1.10.3, shiki@^1.22.0, shiki@^1.23.1: signal-exit@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== simple-concat@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz" + resolved "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== simple-get@^4.0.0, simple-get@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz" + resolved "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== dependencies: decompress-response "^6.0.0" @@ -4639,20 +4685,20 @@ simple-get@^4.0.0, simple-get@^4.0.1: simple-swizzle@^0.2.2: version "0.2.2" - resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz" + resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" integrity sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg== dependencies: is-arrayish "^0.3.1" sisteransi@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" + resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== -sitemap@^7.1.2: - version "7.1.2" - resolved "https://registry.npmjs.org/sitemap/-/sitemap-7.1.2.tgz" - integrity sha512-ARCqzHJ0p4gWt+j7NlU5eDlIO9+Rkr/JhPFZKKQ1l5GCus7rJH4UdrlVAh0xC/gDS/Qir2UMxqYNHtsKr2rpCw== +sitemap@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/sitemap/-/sitemap-8.0.0.tgz#eb6ea48f95787cd680b83683c555d6f6b5a903fd" + integrity sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A== dependencies: "@types/node" "^17.0.5" "@types/sax" "^1.2.1" @@ -4661,28 +4707,28 @@ sitemap@^7.1.2: source-map-js@^1.2.0, source-map-js@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz" + resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== source-map@^0.7.0, source-map@^0.7.4: version "0.7.4" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== space-separated-tokens@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz" + resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== sprintf-js@~1.0.2: version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== starlight-links-validator@^0.12.1: - version "0.12.1" - resolved "https://registry.npmjs.org/starlight-links-validator/-/starlight-links-validator-0.12.1.tgz" - integrity sha512-LhRuGaI9Rp7c7ltwcG0BfCZuAN1d15oYbDB4jXblJ6zsiFcrSGHNlDnKXJHEJZ6XhJ+eOpd1IsHLFLh5Sq6uHg== + version "0.12.4" + resolved "https://registry.npmjs.org/starlight-links-validator/-/starlight-links-validator-0.12.4.tgz#395e36274780c9a7fcb69c94aee9eaa5bb37a433" + integrity sha512-4MJ/BoTpdlKxfCL/pk931TGHYf7kNt812gRyNbhnIdwubjjzUy4J6J57TBY1yXcDVizWjHpGqHrqTeK0QhbemQ== dependencies: "@types/picomatch" "2.3.3" github-slugger "2.0.0" @@ -4696,18 +4742,18 @@ starlight-links-validator@^0.12.1: stdin-discarder@^0.2.2: version "0.2.2" - resolved "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz" + resolved "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz#390037f44c4ae1a1ae535c5fe38dc3aba8d997be" integrity sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ== stream-replace-string@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz" + resolved "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz#e49fd584bd1c633613e010bc73b9db49cb5024ad" integrity sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w== -streamx@^2.15.0, streamx@^2.20.0: - version "2.20.1" - resolved "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz" - integrity sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA== +streamx@^2.15.0, streamx@^2.21.0: + version "2.21.1" + resolved "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz#f02979d8395b6b637d08a589fb514498bed55845" + integrity sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw== dependencies: fast-fifo "^1.3.2" queue-tick "^1.0.1" @@ -4717,7 +4763,7 @@ streamx@^2.15.0, streamx@^2.20.0: string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" @@ -4726,7 +4772,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: string-width@^7.0.0, string-width@^7.2.0: version "7.2.0" - resolved "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz" + resolved "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz#b5bb8e2165ce275d4d43476dd2700ad9091db6dc" integrity sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ== dependencies: emoji-regex "^10.3.0" @@ -4735,14 +4781,14 @@ string-width@^7.0.0, string-width@^7.2.0: string_decoder@^1.1.1: version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" stringify-entities@^4.0.0: version "4.0.4" - resolved "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz" + resolved "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz#b3b79ef5f277cc4ac73caeb0236c5ba939b3a4f3" integrity sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg== dependencies: character-entities-html4 "^2.0.0" @@ -4750,50 +4796,50 @@ stringify-entities@^4.0.0: strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" strip-ansi@^7.1.0: version "7.1.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== dependencies: ansi-regex "^6.0.1" strip-bom-string@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" + resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" integrity sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g== strip-bom@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strip-json-comments@~2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== style-to-object@^0.4.0: version "0.4.4" - resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.4.tgz" + resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.4.tgz#266e3dfd56391a7eefb7770423612d043c3f33ec" integrity sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg== dependencies: inline-style-parser "0.1.1" style-to-object@^1.0.0: version "1.0.8" - resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz" + resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz#67a29bca47eaa587db18118d68f9d95955e81292" integrity sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g== dependencies: inline-style-parser "0.2.4" tar-fs@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz" + resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== dependencies: chownr "^1.1.1" @@ -4803,7 +4849,7 @@ tar-fs@^2.0.0: tar-fs@^3.0.4: version "3.0.6" - resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz" + resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz#eaccd3a67d5672f09ca8e8f9c3d2b89fa173f217" integrity sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w== dependencies: pump "^3.0.0" @@ -4814,7 +4860,7 @@ tar-fs@^3.0.4: tar-stream@^2.1.4: version "2.2.0" - resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" + resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== dependencies: bl "^4.0.3" @@ -4825,7 +4871,7 @@ tar-stream@^2.1.4: tar-stream@^3.1.5: version "3.1.7" - resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz" + resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz#24b3fb5eabada19fe7338ed6d26e5f7c482e792b" integrity sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ== dependencies: b4a "^1.6.4" @@ -4833,9 +4879,9 @@ tar-stream@^3.1.5: streamx "^2.15.0" text-decoder@^1.1.0: - version "1.2.0" - resolved "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.0.tgz" - integrity sha512-n1yg1mOj9DNpk3NeZOx7T6jchTbyJS3i3cucbNN6FcdPriMZx7NsgrGpWWdWZZGxD7ES1XB+3uoqHMgOKaN+fg== + version "1.2.3" + resolved "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz#b19da364d981b2326d5f43099c310cc80d770c65" + integrity sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA== dependencies: b4a "^1.6.4" @@ -4844,21 +4890,29 @@ tinyexec@^0.3.1: resolved "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz#0ab0daf93b43e2c211212396bdb836b468c97c98" integrity sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ== +tinyglobby@^0.2.10: + version "0.2.10" + resolved "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz#e712cf2dc9b95a1f5c5bbd159720e15833977a0f" + integrity sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew== + dependencies: + fdir "^6.4.2" + picomatch "^4.0.2" + to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" trim-lines@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz" + resolved "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== trough@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz" + resolved "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f" integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw== tsconfck@^3.1.4: @@ -4867,47 +4921,47 @@ tsconfck@^3.1.4: integrity sha512-kdqWFGVJqe+KGYvlSO9NIaWn9jT1Ny4oKVzAJsKii5eoE9snzTJzL4+MMVOMn+fikWGFmKEylcXL710V/kIPJQ== tslib@^2.4.0: - version "2.7.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz" - integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== + version "2.8.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== tunnel-agent@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" + resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== dependencies: safe-buffer "^5.0.1" type-fest@^4.21.0: - version "4.26.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz#a4a17fa314f976dd3e6d6675ef6c775c16d7955e" - integrity sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg== + version "4.30.2" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-4.30.2.tgz#d94429edde1f7deacf554741650aab394197a4cc" + integrity sha512-UJShLPYi1aWqCdq9HycOL/gwsuqda1OISdBO3t8RlXQC4QvtuIz4b5FCfe2dQIWEpmlRExKmcTBfP1r9bhY7ig== typesafe-path@^0.2.2: version "0.2.2" - resolved "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz" + resolved "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz#91a436681b2f514badb114061b6a5e5c2b8943b1" integrity sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA== typescript-auto-import-cache@^0.3.3: - version "0.3.3" - resolved "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.3.tgz" - integrity sha512-ojEC7+Ci1ij9eE6hp8Jl9VUNnsEKzztktP5gtYNRMrTmfXVwA1PITYYAkpxCvvupdSYa/Re51B6KMcv1CTZEUA== + version "0.3.5" + resolved "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.5.tgz#402f98995037734ef3fc208180331adfd5e495fc" + integrity sha512-fAIveQKsoYj55CozUiBoj4b/7WpN0i4o74wiGY5JVUEoD0XiqDk1tJqTEjgzL2/AizKQrXxyRosSebyDzBZKjw== dependencies: semver "^7.3.8" typescript@^5.6.2: - version "5.6.2" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz" - integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw== + version "5.7.2" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6" + integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== -undici-types@~6.19.2: - version "6.19.8" - resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== unified@^11.0.0, unified@^11.0.4, unified@^11.0.5: version "11.0.5" - resolved "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz" + resolved "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1" integrity sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA== dependencies: "@types/unist" "^3.0.0" @@ -4920,7 +4974,7 @@ unified@^11.0.0, unified@^11.0.4, unified@^11.0.5: unist-util-find-after@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz#3fccc1b086b56f34c8b798e1ff90b5c54468e896" integrity sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ== dependencies: "@types/unist" "^3.0.0" @@ -4928,14 +4982,14 @@ unist-util-find-after@^5.0.0: unist-util-is@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" integrity sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw== dependencies: "@types/unist" "^3.0.0" unist-util-modify-children@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-4.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-4.0.0.tgz#981d6308e887b005d1f491811d3cbcc254b315e9" integrity sha512-+tdN5fGNddvsQdIzUF3Xx82CU9sMM+fA0dLgR9vOmT0oPT2jH+P1nd5lSqfCfXAw+93NhcXNY2qqvTUtE4cQkw== dependencies: "@types/unist" "^3.0.0" @@ -4943,21 +4997,21 @@ unist-util-modify-children@^4.0.0: unist-util-position-from-estree@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz#d94da4df596529d1faa3de506202f0c9a23f2200" integrity sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ== dependencies: "@types/unist" "^3.0.0" unist-util-position@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz#678f20ab5ca1207a97d7ea8a388373c9cf896be4" integrity sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA== dependencies: "@types/unist" "^3.0.0" unist-util-remove-position@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz#fea68a25658409c9460408bc6b4991b965b52163" integrity sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q== dependencies: "@types/unist" "^3.0.0" @@ -4965,21 +5019,21 @@ unist-util-remove-position@^5.0.0: unist-util-stringify-position@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz#449c6e21a880e0855bf5aabadeb3a740314abac2" integrity sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ== dependencies: "@types/unist" "^3.0.0" unist-util-visit-children@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-3.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-3.0.0.tgz#4bced199b71d7f3c397543ea6cc39e7a7f37dc7e" integrity sha512-RgmdTfSBOg04sdPcpTSD1jzoNBjt9a80/ZCzp5cI9n1qPzLZWF9YdvWGN2zmTumP1HWhXKdUWexjy/Wy/lJ7tA== dependencies: "@types/unist" "^3.0.0" unist-util-visit-parents@^6.0.0, unist-util-visit-parents@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz" + resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz#4d5f85755c3b8f0dc69e21eca5d6d82d22162815" integrity sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw== dependencies: "@types/unist" "^3.0.0" @@ -4987,29 +5041,29 @@ unist-util-visit-parents@^6.0.0, unist-util-visit-parents@^6.0.1: unist-util-visit@5.0.0, unist-util-visit@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz" + resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6" integrity sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg== dependencies: "@types/unist" "^3.0.0" unist-util-is "^6.0.0" unist-util-visit-parents "^6.0.0" -update-browserslist-db@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz" - integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== +update-browserslist-db@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== dependencies: - escalade "^3.1.2" - picocolors "^1.0.1" + escalade "^3.2.0" + picocolors "^1.1.0" util-deprecate@^1.0.1, util-deprecate@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== vfile-location@^5.0.0: version "5.0.3" - resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz" + resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz#cb9eacd20f2b6426d19451e0eafa3d0a846225c3" integrity sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg== dependencies: "@types/unist" "^3.0.0" @@ -5017,7 +5071,7 @@ vfile-location@^5.0.0: vfile-message@^4.0.0: version "4.0.2" - resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz" + resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz#c883c9f677c72c166362fd635f21fc165a7d1181" integrity sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw== dependencies: "@types/unist" "^3.0.0" @@ -5025,7 +5079,7 @@ vfile-message@^4.0.0: vfile@^6.0.0, vfile@^6.0.2, vfile@^6.0.3: version "6.0.3" - resolved "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz" + resolved "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz#3652ab1c496531852bf55a6bac57af981ebc38ab" integrity sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q== dependencies: "@types/unist" "^3.0.0" @@ -5110,9 +5164,9 @@ volar-service-yaml@0.0.62: yaml-language-server "~1.15.0" vscode-css-languageservice@^6.3.0: - version "6.3.1" - resolved "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.3.1.tgz" - integrity sha512-1BzTBuJfwMc3A0uX4JBdJgoxp74cjj4q2mDJdp49yD/GuAq4X0k5WtK6fNcMYr+FfJ9nqgR6lpfCSZDkARJ5qQ== + version "6.3.2" + resolved "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.3.2.tgz#dd54161776f1663fa514a1b5df0d3990bda604bb" + integrity sha512-GEpPxrUTAeXWdZWHev1OJU9lz2Q2/PPBxQ2TIRmLGvQiH3WZbqaNoute0n0ewxlgtjzTW3AKZT+NHySk5Rf4Eg== dependencies: "@vscode/l10n" "^0.0.18" vscode-languageserver-textdocument "^1.0.12" @@ -5121,7 +5175,7 @@ vscode-css-languageservice@^6.3.0: vscode-html-languageservice@^5.2.0, vscode-html-languageservice@^5.3.0: version "5.3.1" - resolved "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.3.1.tgz" + resolved "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.3.1.tgz#93cac1cebb42165b52a15220f02c47d1320fc43a" integrity sha512-ysUh4hFeW/WOWz/TO9gm08xigiSsV/FOAZ+DolgJfeLftna54YdmZ4A+lIn46RbdO3/Qv5QHTn1ZGqmrXQhZyA== dependencies: "@vscode/l10n" "^0.0.18" @@ -5131,7 +5185,7 @@ vscode-html-languageservice@^5.2.0, vscode-html-languageservice@^5.3.0: vscode-json-languageservice@4.1.8: version "4.1.8" - resolved "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.1.8.tgz" + resolved "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.1.8.tgz#397a39238d496e3e08a544a8b93df2cd13347d0c" integrity sha512-0vSpg6Xd9hfV+eZAaYN63xVVMOTmJ4GgHxXnkLCh+9RsQBkWKIghzLhW2B9ebfG+LQQg8uLtsQ2aUKjTgE+QOg== dependencies: jsonc-parser "^3.0.0" @@ -5142,17 +5196,17 @@ vscode-json-languageservice@4.1.8: vscode-jsonrpc@6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz" + resolved "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz#108bdb09b4400705176b957ceca9e0880e9b6d4e" integrity sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg== vscode-jsonrpc@8.2.0: version "8.2.0" - resolved "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz" + resolved "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz#f43dfa35fb51e763d17cd94dcca0c9458f35abf9" integrity sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA== vscode-languageserver-protocol@3.16.0: version "3.16.0" - resolved "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz#34135b61a9091db972188a07d337406a3cdbe821" integrity sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A== dependencies: vscode-jsonrpc "6.0.0" @@ -5160,7 +5214,7 @@ vscode-languageserver-protocol@3.16.0: vscode-languageserver-protocol@3.17.5, vscode-languageserver-protocol@^3.17.5: version "3.17.5" - resolved "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz#864a8b8f390835572f4e13bd9f8313d0e3ac4bea" integrity sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg== dependencies: vscode-jsonrpc "8.2.0" @@ -5168,61 +5222,56 @@ vscode-languageserver-protocol@3.17.5, vscode-languageserver-protocol@^3.17.5: vscode-languageserver-textdocument@^1.0.1, vscode-languageserver-textdocument@^1.0.11, vscode-languageserver-textdocument@^1.0.12: version "1.0.12" - resolved "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz#457ee04271ab38998a093c68c2342f53f6e4a631" integrity sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA== vscode-languageserver-types@3.16.0: version "3.16.0" - resolved "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz#ecf393fc121ec6974b2da3efb3155644c514e247" integrity sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA== vscode-languageserver-types@3.17.5, vscode-languageserver-types@^3.15.1, vscode-languageserver-types@^3.16.0, vscode-languageserver-types@^3.17.5: version "3.17.5" - resolved "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a" integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg== vscode-languageserver@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz#49b068c87cfcca93a356969d20f5d9bdd501c6b0" integrity sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw== dependencies: vscode-languageserver-protocol "3.16.0" vscode-languageserver@^9.0.1: version "9.0.1" - resolved "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz" + resolved "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz#500aef82097eb94df90d008678b0b6b5f474015b" integrity sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g== dependencies: vscode-languageserver-protocol "3.17.5" vscode-nls@^5.0.0, vscode-nls@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz" + resolved "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== -vscode-uri@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz" - integrity sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A== - vscode-uri@^3.0.2, vscode-uri@^3.0.8: version "3.0.8" - resolved "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz" + resolved "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== web-namespaces@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz" + resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== which-pm-runs@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz" + resolved "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz#35ccf7b1a0fce87bd8b92a478c9d045785d3bf35" integrity sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA== which-pm@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/which-pm/-/which-pm-3.0.0.tgz" + resolved "https://registry.npmjs.org/which-pm/-/which-pm-3.0.0.tgz#78f2088b345a63cec9f838b390332fb1e680221f" integrity sha512-ysVYmw6+ZBhx3+ZkcPwRuJi38ZOTLJJ33PSHaitLxSKUMsh0LkKd0nC69zZCwt5D+AYUcMK2hhw4yWny20vSGg== dependencies: load-yaml-file "^0.2.0" @@ -5236,7 +5285,7 @@ widest-line@^5.0.0: wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -5254,12 +5303,12 @@ wrap-ansi@^9.0.0: wrappy@1: version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== xdg-basedir@^5.1.0: version "5.1.0" - resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz" + resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== xxhash-wasm@^1.1.0: @@ -5269,17 +5318,17 @@ xxhash-wasm@^1.1.0: y18n@^5.0.5: version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^3.0.2: version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yaml-language-server@~1.15.0: version "1.15.0" - resolved "https://registry.npmjs.org/yaml-language-server/-/yaml-language-server-1.15.0.tgz" + resolved "https://registry.npmjs.org/yaml-language-server/-/yaml-language-server-1.15.0.tgz#3bd36f1f7fd74e63b591e5148df992c7327be05a" integrity sha512-N47AqBDCMQmh6mBLmI6oqxryHRzi33aPFPsJhYy3VTUGCdLHYjGh4FZzpUjRlphaADBBkDmnkM/++KNIOHi5Rw== dependencies: ajv "^8.11.0" @@ -5297,22 +5346,22 @@ yaml-language-server@~1.15.0: yaml@2.2.2: version "2.2.2" - resolved "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz" + resolved "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz#ec551ef37326e6d42872dad1970300f8eb83a073" integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== -yaml@^2.5.0, yaml@^2.5.1: - version "2.5.1" - resolved "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz" - integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q== +yaml@^2.5.0, yaml@^2.6.1: + version "2.6.1" + resolved "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz#42f2b1ba89203f374609572d5349fb8686500773" + integrity sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg== yargs-parser@^21.1.1: version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.7.2: version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: cliui "^8.0.1" @@ -5325,7 +5374,7 @@ yargs@^17.7.2: yocto-queue@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz#fef65ce3ac9f8a32ceac5a634f74e17e5b232110" integrity sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g== zod-to-json-schema@^3.23.5: @@ -5335,15 +5384,15 @@ zod-to-json-schema@^3.23.5: zod-to-ts@^1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-1.2.0.tgz" + resolved "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-1.2.0.tgz#873a2fd8242d7b649237be97e0c64d7954ae0c51" integrity sha512-x30XE43V+InwGpvTySRNz9kB7qFU8DlyEy7BsSTCHPH1R0QasMmHWZDCzYm6bVXtj/9NNJAZF3jW8rzFvH5OFA== zod@^3.23.8: - version "3.23.8" - resolved "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz" - integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== + version "3.24.1" + resolved "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee" + integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A== zwitch@^2.0.0, zwitch@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz" + resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== From bbfa619caf447b43a1cf82cba601aa7575aec887 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:24:11 +0400 Subject: [PATCH 13/29] chore(deps): bump @ton/core from 0.59.0 to 0.59.1 (#1234) Bumps [@ton/core](https://github.com/ton-org/ton-core) from 0.59.0 to 0.59.1. - [Release notes](https://github.com/ton-org/ton-core/releases) - [Changelog](https://github.com/ton-org/ton-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/ton-org/ton-core/compare/0.59.0...0.59.1) --- updated-dependencies: - dependency-name: "@ton/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4db5dec06..3672e83f5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ }, "dependencies": { "@tact-lang/opcode": "^0.0.16", - "@ton/core": "0.59.0", + "@ton/core": "0.59.1", "@ton/crypto": "^3.2.0", "blockstore-core": "1.0.5", "change-case": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index b5824478b..8fdf9c608 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1304,10 +1304,10 @@ resolved "https://registry.npmjs.org/@tact-lang/ton-jest/-/ton-jest-0.0.4.tgz" integrity sha512-FWjfiNvhMlE44ZLLL7tgmHbrszMTPMttmYiaTekf1vwFXV3uAOawM8xM9NldYaCVs9eh8840PjgISdMMUTCSCw== -"@ton/core@0.59.0": - version "0.59.0" - resolved "https://registry.npmjs.org/@ton/core/-/core-0.59.0.tgz#58da9fcaa58e5a0c705b63baf1e86cab6e196689" - integrity sha512-LSIkGst7BoY7fMWshejzcH0UJnoW21JGlRrW0ch+6A7Xb/7EuekxgdKym7fHxcry6OIf6FoeFg97lJ960N/Ghg== +"@ton/core@0.59.1": + version "0.59.1" + resolved "https://registry.npmjs.org/@ton/core/-/core-0.59.1.tgz#fe568069ccdf2f4191da1eadc930076c0c012789" + integrity sha512-SxFBAvutYJaIllTkv82vbHTJhJI6NxzqUhi499CDEjJEZ9i6i9lHJiK2df4dlLAb/4SiWX6+QUzESkK4DEdnCw== dependencies: symbol.inspect "1.0.1" From 6c237357d63e049454f0ebac4271aa476cbea5eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:25:01 +0400 Subject: [PATCH 14/29] chore(deps-dev): bump @ton/sandbox from 0.22.0 to 0.23.0 (#1235) Bumps [@ton/sandbox](https://github.com/ton-org/sandbox) from 0.22.0 to 0.23.0. - [Changelog](https://github.com/ton-org/sandbox/blob/main/CHANGELOG.md) - [Commits](https://github.com/ton-org/sandbox/commits) --- updated-dependencies: - dependency-name: "@ton/sandbox" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3672e83f5..c7191fd01 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@tact-lang/coverage": "^0.0.8", "@tact-lang/ton-abi": "^0.0.3", "@tact-lang/ton-jest": "^0.0.4", - "@ton/sandbox": "^0.22.0", + "@ton/sandbox": "^0.23.0", "@ton/test-utils": "^0.4.2", "@types/glob": "^8.1.0", "@types/jest": "^29.5.12", diff --git a/yarn.lock b/yarn.lock index 8fdf9c608..47c916f63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1327,10 +1327,10 @@ jssha "3.2.0" tweetnacl "1.0.3" -"@ton/sandbox@^0.22.0": - version "0.22.0" - resolved "https://registry.npmjs.org/@ton/sandbox/-/sandbox-0.22.0.tgz#76a3b724f40be18512df748deee6c5d5ff0a96fb" - integrity sha512-ilvKtyAGxJyEbIwITlx1y78oDmJyvT+pkLfVm4952NjxZpANdG2nZ8/mBGJlWph9FZtxxXCjCf/79hNihC6P6A== +"@ton/sandbox@^0.23.0": + version "0.23.0" + resolved "https://registry.npmjs.org/@ton/sandbox/-/sandbox-0.23.0.tgz#c3b6ee0b9c057650a32d0c9ebf770a77e0832421" + integrity sha512-V0PfjefTJbpBvsE1b5851LyuZlOXuBZnvxtCKrvK/wDlw348dCnUJuBvWuApZ5RGXq36xJ07XBoYl6sMuS0Xug== "@ton/test-utils@^0.4.2": version "0.4.2" From a0ba3305eb31a4a9287ee25f1b6ef9694cb64b81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:25:30 +0400 Subject: [PATCH 15/29] chore(deps-dev): bump release-it from 17.10.0 to 17.11.0 (#1233) Bumps [release-it](https://github.com/release-it/release-it) from 17.10.0 to 17.11.0. - [Release notes](https://github.com/release-it/release-it/releases) - [Changelog](https://github.com/release-it/release-it/blob/main/CHANGELOG.md) - [Commits](https://github.com/release-it/release-it/compare/17.10.0...17.11.0) --- updated-dependencies: - dependency-name: release-it dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 105 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47c916f63..4fbfbcdb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1579,13 +1579,18 @@ acorn@^8.4.1, acorn@^8.9.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== -agent-base@^7.0.2, agent-base@^7.1.0, agent-base@^7.1.1: +agent-base@^7.1.0: version "7.1.1" resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz" integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== dependencies: debug "^4.3.4" +agent-base@^7.1.2: + version "7.1.3" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" + integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz" @@ -1991,10 +1996,10 @@ chalk-template@^1.1.0: dependencies: chalk "^5.2.0" -chalk@5.3.0, chalk@^5.2.0, chalk@^5.3.0: - version "5.3.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== +chalk@5.4.1, chalk@^5.2.0, chalk@^5.3.0: + version "5.4.1" + resolved "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" + integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== chalk@^2.4.2: version "2.4.2" @@ -2046,10 +2051,10 @@ ci-info@^3.2.0: resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== -ci-info@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz#65466f8b280fc019b9f50a5388115d17a63a44f2" - integrity sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg== +ci-info@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-4.1.0.tgz#92319d2fa29d2620180ea5afed31f589bc98cf83" + integrity sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A== cjs-module-lexer@^1.0.0: version "1.2.3" @@ -3129,12 +3134,12 @@ http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: agent-base "^7.1.0" debug "^4.3.4" -https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.5: - version "7.0.5" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" - integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== +https-proxy-agent@^7.0.6: + version "7.0.6" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" + integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== dependencies: - agent-base "^7.0.2" + agent-base "^7.1.2" debug "4" human-signals@^2.1.0: @@ -4429,10 +4434,10 @@ optionator@^0.9.3: prelude-ls "^1.2.1" type-check "^0.4.0" -ora@8.1.0: - version "8.1.0" - resolved "https://registry.npmjs.org/ora/-/ora-8.1.0.tgz#c3db2f9f83a2bec9e8ab71fe3b9ae234d65ca3a8" - integrity sha512-GQEkNkH/GHOhPFXcqZs3IDahXEQcQxsSjEkK4KvEEST4t7eNzoMjxTzef+EZ+JluDEV+Raoi3WQ2CflnRdSVnQ== +ora@8.1.1: + version "8.1.1" + resolved "https://registry.npmjs.org/ora/-/ora-8.1.1.tgz#8efc8865e44c87e4b55468a47e80a03e678b0e54" + integrity sha512-YWielGi1XzG1UTvOaCFaNgEnuhZVMSHYkW/FQ7UX8O26PtlpdM84c0f7wLPlkvx2RfiQmnzd61d/MGxmpQeJPw== dependencies: chalk "^5.3.0" cli-cursor "^5.0.0" @@ -4512,19 +4517,19 @@ p-try@^2.0.0: resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -pac-proxy-agent@^7.0.1: - version "7.0.2" - resolved "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz#0fb02496bd9fb8ae7eb11cfd98386daaac442f58" - integrity sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg== +pac-proxy-agent@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz#da7c3b5c4cccc6655aaafb701ae140fb23f15df2" + integrity sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw== dependencies: "@tootallnate/quickjs-emscripten" "^0.23.0" - agent-base "^7.0.2" + agent-base "^7.1.2" debug "^4.3.4" get-uri "^6.0.1" http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.5" + https-proxy-agent "^7.0.6" pac-resolver "^7.0.1" - socks-proxy-agent "^8.0.4" + socks-proxy-agent "^8.0.5" pac-resolver@^7.0.1: version "7.0.1" @@ -4759,19 +4764,19 @@ protocols@^2.0.0, protocols@^2.0.1: resolved "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz" integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q== -proxy-agent@6.4.0: - version "6.4.0" - resolved "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz#b4e2dd51dee2b377748aef8d45604c2d7608652d" - integrity sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ== +proxy-agent@6.5.0: + version "6.5.0" + resolved "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz#9e49acba8e4ee234aacb539f89ed9c23d02f232d" + integrity sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A== dependencies: - agent-base "^7.0.2" + agent-base "^7.1.2" debug "^4.3.4" http-proxy-agent "^7.0.1" - https-proxy-agent "^7.0.3" + https-proxy-agent "^7.0.6" lru-cache "^7.14.1" - pac-proxy-agent "^7.0.1" + pac-proxy-agent "^7.1.0" proxy-from-env "^1.1.0" - socks-proxy-agent "^8.0.2" + socks-proxy-agent "^8.0.5" proxy-from-env@^1.1.0: version "1.1.0" @@ -4858,15 +4863,15 @@ registry-url@^6.0.1: rc "1.2.8" release-it@^17.6.0: - version "17.10.0" - resolved "https://registry.npmjs.org/release-it/-/release-it-17.10.0.tgz#be44422de7b8d752a97e96da898fc6f2ad7d45d5" - integrity sha512-00cXYEl7RFD5NnjXpwaH9JFjpwe8w3NcfUd4XPxrKQkszp1xppPo42zK9eSbxStKyPA5CVk2KmKPDPDiAKVJTA== + version "17.11.0" + resolved "https://registry.npmjs.org/release-it/-/release-it-17.11.0.tgz#4cb858194f45fdc1966b8a53209efff887d1994e" + integrity sha512-qQGgfMbUZ3/vpXUPmngsgjFObOLjlkwtiozHUYen9fo9AEGciXjG1ZpGr+FNmuBT8R7TOSY+x/s84wOCRKJjbA== dependencies: "@iarna/toml" "2.2.5" "@octokit/rest" "20.1.1" async-retry "1.3.3" - chalk "5.3.0" - ci-info "^4.0.0" + chalk "5.4.1" + ci-info "^4.1.0" cosmiconfig "9.0.0" execa "8.0.0" git-url-parse "14.0.0" @@ -4877,14 +4882,14 @@ release-it@^17.6.0: mime-types "2.1.35" new-github-release-url "2.0.0" open "10.1.0" - ora "8.1.0" + ora "8.1.1" os-name "5.1.0" - proxy-agent "6.4.0" + proxy-agent "6.5.0" semver "7.6.3" shelljs "0.8.5" update-notifier "7.3.1" url-join "5.0.0" - wildcard-match "5.1.3" + wildcard-match "5.1.4" yargs-parser "21.1.1" repeat-string@^1.6.1: @@ -5090,12 +5095,12 @@ snake-case@^3.0.4: dot-case "^3.0.4" tslib "^2.0.3" -socks-proxy-agent@^8.0.2, socks-proxy-agent@^8.0.4: - version "8.0.4" - resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz#9071dca17af95f483300316f4b063578fa0db08c" - integrity sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw== +socks-proxy-agent@^8.0.5: + version "8.0.5" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz#b9cdb4e7e998509d7659d689ce7697ac21645bee" + integrity sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw== dependencies: - agent-base "^7.1.1" + agent-base "^7.1.2" debug "^4.3.4" socks "^2.8.3" @@ -5569,10 +5574,10 @@ widest-line@^5.0.0: dependencies: string-width "^7.0.0" -wildcard-match@5.1.3: - version "5.1.3" - resolved "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.3.tgz#7420e57a17307afed9e51eee36aa1dcc1b73ce11" - integrity sha512-a95hPUk+BNzSGLntNXYxsjz2Hooi5oL7xOfJR6CKwSsSALh7vUNuTlzsrZowtYy38JNduYFRVhFv19ocqNOZlg== +wildcard-match@5.1.4: + version "5.1.4" + resolved "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.4.tgz#26428c802f20743ebae255e4e9526ae81ddf1816" + integrity sha512-wldeCaczs8XXq7hj+5d/F38JE2r7EXgb6WQDM84RVwxy81T/sxB5e9+uZLK9Q9oNz1mlvjut+QtvgaOQFPVq/g== windows-release@^5.0.1: version "5.1.1" From 069a5a23a2fa2b6d62866d3178c5ba0af88fa607 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:25:54 +0400 Subject: [PATCH 16/29] chore(deps-dev): bump knip from 5.41.0 to 5.41.1 (#1232) Bumps [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) from 5.41.0 to 5.41.1. - [Release notes](https://github.com/webpro-nl/knip/releases) - [Changelog](https://github.com/webpro-nl/knip/blob/main/packages/knip/.release-it.json) - [Commits](https://github.com/webpro-nl/knip/commits/5.41.1/packages/knip) --- updated-dependencies: - dependency-name: knip dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4fbfbcdb5..68198260e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4014,9 +4014,9 @@ kleur@^3.0.3: integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== knip@^5.24.1: - version "5.41.0" - resolved "https://registry.npmjs.org/knip/-/knip-5.41.0.tgz#c186d27df55d10fe38ce69ed66fcb0c7a44bae1a" - integrity sha512-W8omBs+jhC/P/A3kC0xdEGrhYVmsmWafUVz0wzQjYfoaK0YNEBPPLptUeqwQl6ihYVqzb/X0zs50gY9Akw1Bww== + version "5.41.1" + resolved "https://registry.npmjs.org/knip/-/knip-5.41.1.tgz#b6e27186d38e6bccd2ef8346294e78d13322f1cd" + integrity sha512-yNpCCe2REU7U3VRvMASnXSEtfEC2HmOoDW9Vp9teQ9FktJYnuagvSZD3xWq8Ru7sPABkmvbC5TVWuMzIaeADNA== dependencies: "@nodelib/fs.walk" "1.2.8" "@snyk/github-codeowners" "1.1.0" From 50868f536ce9050544fe5b8a0f7a2266badbc3d8 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:32:23 +0100 Subject: [PATCH 17/29] chore(docs): mark latest features as not released yet (#1239) And adjust the RELEASE.md with the inverse commands to remove such notes upon the release --- RELEASE.md | 5 ++++- cspell.json | 3 ++- docs/src/content/docs/book/exit-codes.mdx | 8 ++++---- docs/src/content/docs/book/functions.mdx | 2 +- docs/src/content/docs/book/maps.mdx | 4 ++-- docs/src/content/docs/book/message-mode.mdx | 2 +- docs/src/content/docs/book/statements.mdx | 2 +- docs/src/content/docs/book/structs-and-messages.mdx | 2 +- docs/src/content/docs/zh-cn/book/functions.mdx | 2 +- 9 files changed, 17 insertions(+), 13 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 03c168641..7bb7437be 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,6 +2,10 @@ - [ ] Improve the changelog for `vX.Y.Z`: grammar, wording, polishing - [ ] Make sure there are no open issues for the [vX.Y.Z milestone](https://github.com/tact-lang/tact/issues?q=is%3Aopen+is%3Aissue+milestone%3AvX.Y.Z) (except for the current one, of course) +- [ ] Remove "(not released yet)" from docs: + - [ ] `cd docs` — important as to not change the texts elsewhere, such as in code comments + - [ ] `regex='([sS]ince Tact \d\.\d) \(not released yet\)'; rg "$regex" -r '$1'` (or similar with `grep`) — to preview the changes + - [ ] `regex='([sS]ince Tact \d\.\d) \(not released yet\)'; rg "$regex" -l | xargs sd "$regex" '$1'` (or similar with `grep` and `sed`) — to apply the changes - [ ] Bump Tact version in: - [ ] [`package.json`](./package.json) file - [ ] [CHANGELOG.md](./CHANGELOG.md): `Unreleased` -> `vX.Y.Z` @@ -16,7 +20,6 @@ $ git checkout vX.Y.Z $ yarn all && npm publish ``` -- [ ] Update [tact-docs](https://github.com/tact-lang/tact-docs) with the most recent Tact features (tracked in: ) - [ ] Request or perform the plugins/parsers/tools updates and releases: - [ ] (tracked in: ) - [ ] (tracked in: ) diff --git a/cspell.json b/cspell.json index da482d34d..361166021 100644 --- a/cspell.json +++ b/cspell.json @@ -126,7 +126,8 @@ "ignoreRegExpList": [ "\\b[xB]\\{[a-fA-F0-9]*_?\\}", // binary literals in Fift-asm "\\b0[xX][a-fA-F0-9_]*\\b", // hexadecimal numbers - "\\b(?:address|crc32|cell|slice|rawSlice)\\(\".+\"\\)" // some comptime functions + "\\b(?:address|crc32|cell|slice|rawSlice)\\(\".+\"\\)", // some comptime functions + "ince Tact " // regex in RELEASE.md ], "flagWords": [], "ignorePaths": [ diff --git a/docs/src/content/docs/book/exit-codes.mdx b/docs/src/content/docs/book/exit-codes.mdx index 69d8e4fb9..41aa9c586 100644 --- a/docs/src/content/docs/book/exit-codes.mdx +++ b/docs/src/content/docs/book/exit-codes.mdx @@ -62,8 +62,8 @@ Exit code | Origin | Brief description [$133$](#133) | Tact compiler ([Compute phase][c]) | Contract stopped. Reserved, but never thrown. [$134$](#134) | Tact compiler ([Compute phase][c]) | Invalid argument. [$135$](#135) | Tact compiler ([Compute phase][c]) | Code of a contract was not found. -~~[$136$](#136)~~ | ~~Tact compiler ([Compute phase][c])~~ | ~~Invalid address.~~ Removed since Tact 1.6 -~~[$137$](#137)~~ | ~~Tact compiler ([Compute phase][c])~~ | ~~Masterchain support is not enabled for this contract.~~ Removed since Tact 1.6 +~~[$136$](#136)~~ | ~~Tact compiler ([Compute phase][c])~~ | ~~Invalid address.~~ Removed since Tact 1.6 (not released yet) +~~[$137$](#137)~~ | ~~Tact compiler ([Compute phase][c])~~ | ~~Masterchain support is not enabled for this contract.~~ Removed since Tact 1.6 (not released yet) :::note @@ -625,7 +625,7 @@ If the code of the contract doesn't match the one saved in TypeScript wrappers, ### 136: Invalid address {#136} -

+

A value of type [`Address{:tact}`][p] is valid in Tact when: @@ -648,7 +648,7 @@ try { ### 137: Masterchain support is not enabled for this contract {#137} -

+

Prior to removal, any attempts to point to masterchain (ID $-1$) or otherwise interact with it without enabling masterchain support were throwing an exception with exit code $137$: `Masterchain support is not enabled for this contract`. diff --git a/docs/src/content/docs/book/functions.mdx b/docs/src/content/docs/book/functions.mdx index e2f3d27a6..208a3d355 100644 --- a/docs/src/content/docs/book/functions.mdx +++ b/docs/src/content/docs/book/functions.mdx @@ -150,7 +150,7 @@ contract Treasure { ### Explicit resolution of method ID collisions -

+

Like other functions in TON contracts, getters have their _unique_ associated function selectors, which are $19$-bit signed integer identifiers commonly called _method IDs_. diff --git a/docs/src/content/docs/book/maps.mdx b/docs/src/content/docs/book/maps.mdx index 574efa07a..c6a5528f7 100644 --- a/docs/src/content/docs/book/maps.mdx +++ b/docs/src/content/docs/book/maps.mdx @@ -98,7 +98,7 @@ if (gotButUnsure != null) { ### Replace values, `.replace()` {#replace} -

+

To replace the value under a key, if such a key exists, use the `.replace(){:tact}` [method](/book/functions#extension-function). It returns `true{:tact}` on successful replacement and `false{:tact}` otherwise. @@ -140,7 +140,7 @@ replaced2; // false ### Replace and get old value, `.replaceGet()` {#replaceget} -

+

Like [`.replace()`](#replace), but instead of returning a [`Bool{:tact}`](/book/types#booleans) it returns the old (pre-replacement) value on successful replacement and [`null{:tact}`](/book/optionals) otherwise. diff --git a/docs/src/content/docs/book/message-mode.mdx b/docs/src/content/docs/book/message-mode.mdx index bc846f9ae..b3478f9c6 100644 --- a/docs/src/content/docs/book/message-mode.mdx +++ b/docs/src/content/docs/book/message-mode.mdx @@ -13,7 +13,7 @@ It's possible to use raw [`Int{:tact}`][int] values and manually provide them fo Mode value | Constant name | Description ---------: | :---------------------------- | ----------- -$0$ | `SendDefaultMode{:tact}` | Ordinary message (default). +$0$ | `SendDefaultMode{:tact}` | Ordinary message (default). $64$ | `SendRemainingValue{:tact}` | Carry all the remaining value of the inbound message in addition to the value initially indicated in the new message. $128$ | `SendRemainingBalance{:tact}` | Carry all the remaining balance of the current smart contract instead of the value originally indicated in the message. diff --git a/docs/src/content/docs/book/statements.mdx b/docs/src/content/docs/book/statements.mdx index dd8c1f67b..915912cf4 100644 --- a/docs/src/content/docs/book/statements.mdx +++ b/docs/src/content/docs/book/statements.mdx @@ -100,7 +100,7 @@ value += 5; // augmented assignment (one of the many, see below) ## Destructuring assignment -

+

The destructuring assignment is a concise way to unpack [Structs][s] and [Messages][m] into distinct variables. It mirrors the [instantiation syntax](/book/expressions#instantiation), but instead of creating a new [Struct][s] or [Message][m] it binds every field or some of the fields to their respective variables. diff --git a/docs/src/content/docs/book/structs-and-messages.mdx b/docs/src/content/docs/book/structs-and-messages.mdx index 37a9294ec..e173c3337 100644 --- a/docs/src/content/docs/book/structs-and-messages.mdx +++ b/docs/src/content/docs/book/structs-and-messages.mdx @@ -118,7 +118,7 @@ message(0x7362d09c) TokenNotification { This is useful for cases where you want to handle certain opcodes of a given smart contract, such as [Jetton standard](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md). The short-list of opcodes this contract is able to process is [given here in FunC](https://github.com/ton-blockchain/token-contract/blob/main/ft/op-codes.fc). They serve as an interface to the smart contract. - A message opcode can be any [compile-time](/ref/core-comptime) expression that evaluates to a positive $32$-bit integer, so the following is also valid: + A message opcode can be any [compile-time](/ref/core-comptime) expression that evaluates to a positive $32$-bit integer, so the following is also valid: ```tact // This Message overwrites its unique id (opcode) with 898001897, diff --git a/docs/src/content/docs/zh-cn/book/functions.mdx b/docs/src/content/docs/zh-cn/book/functions.mdx index 8abd57b11..c35b4ccb8 100644 --- a/docs/src/content/docs/zh-cn/book/functions.mdx +++ b/docs/src/content/docs/zh-cn/book/functions.mdx @@ -139,7 +139,7 @@ contract Treasure { ``` ### 明确解决方法 ID 碰撞问题 -

+

与 TVM 合约中的其他函数一样,getters 也有其*独特*的相关函数选择器,即一些整数 ID(称为*方法 ID*)。 其中一些整数是为内部目的保留的,例如 -4, -3, -2, -1, 0 是保留 ID,而 From fb34be43cf2b485e3e8413249eaa1e7c33f00ac1 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:34:04 +0100 Subject: [PATCH 18/29] fix(docs): move serialization section in `/book/maps` higher (#1238) And correct the description of `.asCell()` --- docs/src/content/docs/book/maps.mdx | 43 +++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/docs/src/content/docs/book/maps.mdx b/docs/src/content/docs/book/maps.mdx index c6a5528f7..4183465de 100644 --- a/docs/src/content/docs/book/maps.mdx +++ b/docs/src/content/docs/book/maps.mdx @@ -31,6 +31,24 @@ Allowed value types: * [Struct](/book/structs-and-messages#structs) * [Message](/book/structs-and-messages#messages) +## Serialization + +It's possible to do [integer serialization](/book/integers#common-serialization-types) of map keys, values or both to [preserve space and reduce storage costs](/book/integers#serialization): + +```tact +struct SerializedMapInside { + // Both keys and values here would be serialized as 8-bit unsigned integers, + // thus preserving the space and reducing storage costs: + countersButCompact: map; +} +``` + +:::note + + Read more about serialization in Tact: [Compatibility with FunC](/book/func#convert-serialization). + +::: + ## Operations ### Declare, `emptyMap()` {#emptymap} @@ -313,7 +331,9 @@ There, both maps are formed manually and both contain the same key-value pair. I ### Convert to a `Cell`, `.asCell()` {#ascell} -Use `.asCell(){:tact}` [method](/book/functions#extension-function) on maps to convert all their values to a [`Cell{:tact}`][cell] type. Be mindful, that [`Cell{:tact}`][cell] type is able to store up to 1023 bits, so converting larger maps to the Cell will result in error. +On [TVM][tvm], maps are represented as a [`Cell{:tact}`][cell] type and it's possible to construct and parse them directly. However, doing so is highly error-prone and quite messy, which is why Tact provides maps as a standalone composite type with many of the helper methods mentioned above. + +To cast maps back to the underlying [`Cell{:tact}`][cell] type, use the `.asCell(){:tact}` [method](/book/functions#extension-function). Since maps are initialized to `null{:tact}`, calling `.asCell(){:tact}` on a map with no values assigned will return `null{:tact}` and **not** an empty [`Cell{:tact}`][cell]. As an example, this method is useful for sending small maps directly in the body of the reply: @@ -335,7 +355,7 @@ contract Example { // Internal message receiver, which responds to empty messages receive() { // Here we're converting the map to a Cell and making a reply with it - self.reply(self.fizz.asCell()); + self.reply(self.fizz.asCell()!!); // explicitly asserting that the map isn't null } } ``` @@ -429,24 +449,6 @@ It's often useful to set an upper-bound restriction on such maps, so that you [d ::: -## Serialization - -It's possible to do [integer serialization](/book/integers#common-serialization-types) of map keys, values or both to [preserve space and reduce storage costs](/book/integers#serialization): - -```tact -struct SerializedMapInside { - // Both keys and values here would be serialized as 8-bit unsigned integers, - // thus preserving the space and reducing storage costs: - countersButCompact: map; -} -``` - -:::note - - Read about other serialization options: [Compatibility with FunC](/book/func#convert-serialization). - -::: - ## Limits and drawbacks While maps can be convenient to work with on a small scale, they cause a number of issues if the number of items is unbounded and map can significantly grow in size: @@ -492,3 +494,4 @@ If you still need a large map or an unbound (infinitely large) map, it's better [cell]: /book/cells#cells [hashmap]: https://docs.ton.org/develop/data-formats/tl-b-types#hashmap +[tvm]: https://docs.ton.org/learn/tvm-instructions/tvm-overview From c2214d70b682359821c4ba1c31c95b1328f9fdb9 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:36:45 +0100 Subject: [PATCH 19/29] feat(docs): mention the limit of max number of messages that can be sent during action phase (#1237) --- CHANGELOG.md | 1 + docs/src/content/docs/book/exit-codes.mdx | 6 ++++ docs/src/content/docs/book/send.mdx | 34 +++++++++++++-------- docs/src/content/docs/ref/core-advanced.mdx | 4 +++ docs/src/content/docs/ref/core-common.mdx | 6 +++- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7b920a2..384b03545 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a link to the article by CertiK to Security best practices page: PR [#1185](https://github.com/tact-lang/tact/pull/1185) - Added a note on `dump()` being computationally expensive: PR [#1189](https://github.com/tact-lang/tact/pull/1189) - Fixed links in Chinese translation: PR [#1206](https://github.com/tact-lang/tact/pull/1206) +- Added a note on 255 being the maximum number of messages that can be sent during action phase: PR [#1237](https://github.com/tact-lang/tact/pull/1237) ### Release contributors diff --git a/docs/src/content/docs/book/exit-codes.mdx b/docs/src/content/docs/book/exit-codes.mdx index 41aa9c586..d00c141b5 100644 --- a/docs/src/content/docs/book/exit-codes.mdx +++ b/docs/src/content/docs/book/exit-codes.mdx @@ -502,6 +502,12 @@ When processing the message, TON Blockchain tries to pack it according to the [r If there would not be enough funds to process all the cells in a message, the message is too large or its Merkle depth is too big, an error with exit code $40$ is thrown: `Cannot process a message`. +:::note + + If the [optional flag +2](/book/message-mode#optional-flags) is set, this error won't be thrown and the given message won't be sent. + +::: + ### 41: Library reference is null {#41} If the library reference was required during library change action, but it was null, an error with exit code $41$ is thrown: `Library reference is null`. diff --git a/docs/src/content/docs/book/send.mdx b/docs/src/content/docs/book/send.mdx index 9c2283da7..b6ba343e4 100644 --- a/docs/src/content/docs/book/send.mdx +++ b/docs/src/content/docs/book/send.mdx @@ -57,11 +57,16 @@ send(SendParameters{ }); ``` -The [optional flag](/book/message-mode#optional-flags) `SendIgnoreErrors{:tact}` means that even when an error occurs during message sending next messages would be sent anyway. **No error during the sending phase would revert a transaction.** +The [optional flag](/book/message-mode#optional-flags) `SendIgnoreErrors{:tact}` means that if an error occurs during [message send](#outbound-message-processing), it will be ignored and the given message will be skipped. Message-related [action phase][phases] [exit codes](/book/exit-codes) that might be thrown without the `SendIgnoreErrors{:tact}` set are: + +* $36$: [`Invalid destination address in outbound message`](/book/exit-codes#36) +* $37$: [`Not enough Toncoin`](/book/exit-codes#37) +* $39$: [`Outbound message doesn't fit into a cell`](/book/exit-codes#39) +* $40$: [`Cannot process a message`](/book/exit-codes#40) ## Send typed message -To send a binary typed message you can use the following code: +To send a typed message you can use the following code: ```tact let recipient: Address = address("..."); @@ -98,7 +103,7 @@ send(SendParameters{ Each transaction on TON Blockchain consists of [multiple phases][phases]. Outbound messages are evaluated in [compute phase][compute], but are **not** sent in that phase. Instead, they're queued in order of appearance for the [action phase][phases], where all actions listed in [compute phase][compute], like outbound messages or [reserve requests](/ref/core-advanced#nativereserve), are executed. -As all the values are computed in [compute phase][compute], all the fees computed by the end of it, and exceptions do not revert the transaction during [action phase][phases], outbound message sends can fail without bounce due to unsufficient [action fees](https://docs.ton.org/develop/howto/fees-low-level#action-fee) or [forward fees][fwdfee]. +As all the values are computed in [compute phase][compute], all the fees computed by the end of it, and exceptions do not revert the transaction during [action phase][phases], outbound message sends can fail without bounce due to insufficient [action fees](https://docs.ton.org/develop/howto/fees-low-level#action-fee) or [forward fees][fwdfee]. Consider the following example: @@ -132,17 +137,22 @@ There, the second message won't actually be sent: * When the second message is processed, contract tries to send $\mathrm{R}$ [nanoToncoins](/book/integers#nanotoncoin), but fails to do so because there is already a smaller amount left. -:::note +## Message sending limits + +In total, there could be no more than $255$ actions queued for execution, which means that the maximum allowed number of messages sent per transaction is $255$. + +Attempts to queue more throw an exception with an [exit code 33](/book/exit-codes#33) during [action phase][phases]: `Action list is too long`. + +## Message sending functions - Read more about all message sending functions in the Reference: - * [`send(){:tact}`](/ref/core-common#send) - * [`emit(){:tact}`](/ref/core-common#emit) - * [`self.notify(){:tact}`](/ref/core-base#self-notify) - * [`self.reply(){:tact}`](/ref/core-base#self-reply) - * [`self.forward(){:tact}`](/ref/core-base#self-forward) - * [`nativeSendMessage(){:tact}`](/ref/core-advanced#nativesendmessage) +Read more about all message sending functions in the Reference: -::: +* [`send(){:tact}`](/ref/core-common#send) +* [`emit(){:tact}`](/ref/core-common#emit) +* [`self.notify(){:tact}`](/ref/core-base#self-notify) +* [`self.reply(){:tact}`](/ref/core-base#self-reply) +* [`self.forward(){:tact}`](/ref/core-base#self-forward) +* [`nativeSendMessage(){:tact}`](/ref/core-advanced#nativesendmessage) [p]: /book/types#primitive-types [int]: /book/integers diff --git a/docs/src/content/docs/ref/core-advanced.mdx b/docs/src/content/docs/ref/core-advanced.mdx index 02531ef29..79fdc270c 100644 --- a/docs/src/content/docs/ref/core-advanced.mdx +++ b/docs/src/content/docs/ref/core-advanced.mdx @@ -434,6 +434,8 @@ fun nativeSendMessage(cell: Cell, mode: Int); [Queues the message](/book/send#outbound-message-processing) to be sent by specifying the complete `cell` and the [message `mode`](/book/message-mode). +Attempts to queue more than $255$ messages throw an exception with an [exit code 33](/book/exit-codes#33): `Action list is too long`. + :::note Prefer using a much more common and user-friendly [`send(){:tact}`](/ref/core-common#send) function unless you have a complex logic that can't be expressed otherwise. @@ -466,6 +468,8 @@ It's possible to use raw [`Int{:tact}`][int] values and manually provide them fo Currently, `amount` must be a non-negative integer, and `mode` must be in the range $0..31$, inclusive. + Additionally, attempts to queue more than $255$ reservations in one transaction throw an exception with an [exit code 33](/book/exit-codes#33): `Action list is too long`. + ::: ### Base modes {#nativereserve-base-modes} diff --git a/docs/src/content/docs/ref/core-common.mdx b/docs/src/content/docs/ref/core-common.mdx index 4afcbf27e..5444ece78 100644 --- a/docs/src/content/docs/ref/core-common.mdx +++ b/docs/src/content/docs/ref/core-common.mdx @@ -37,7 +37,7 @@ let iNeedADolla: Int = myBalance(); :::caution - Beware, that [all message sending functions](/book/send) of Tact can change the _actual_ contract's balance, but they _won't_ update the value returned by this function. + Beware, that [all message sending functions](/book/send#message-sending-functions) of Tact can change the _actual_ contract's balance, but they _won't_ update the value returned by this function. ::: @@ -202,6 +202,8 @@ fun send(params: SendParameters); [Queues the message](/book/send#outbound-message-processing) to be sent using a [`SendParameters{:tact}`](/book/send) [Struct](/book/structs-and-messages#structs). +Attempts to queue more than $255$ messages throw an exception with an [exit code 33](/book/exit-codes#33): `Action list is too long`. + Usage example: ```tact @@ -228,6 +230,8 @@ fun emit(body: Cell); [Queues the message](/book/send#outbound-message-processing) `body` to be sent to the outer world with the purpose of logging and analyzing it later off-chain. The message does not have a recipient and is gas-efficient compared to using any other message sending functions of Tact. +Attempts to queue more than $255$ messages throw an exception with an [exit code 33](/book/exit-codes#33): `Action list is too long`. + Usage example: ```tact From a1f03c18f8b7e03f8404093c17c32fbefc30e70e Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:38:20 +0100 Subject: [PATCH 20/29] test: arrangements of Structs in `asm` functions (#1240) --- src/test/e2e-emulated/asm-functions.spec.ts | 37 +++++++++++++- .../e2e-emulated/contracts/asm-functions.tact | 51 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/src/test/e2e-emulated/asm-functions.spec.ts b/src/test/e2e-emulated/asm-functions.spec.ts index c67084b51..81c63f613 100644 --- a/src/test/e2e-emulated/asm-functions.spec.ts +++ b/src/test/e2e-emulated/asm-functions.spec.ts @@ -1,4 +1,4 @@ -import { toNano } from "@ton/core"; +import { beginCell, toNano } from "@ton/core"; import { Blockchain, SandboxContract, TreasuryContract } from "@ton/sandbox"; import { AsmFunctionsTester as TestContract } from "./contracts/output/asm-functions_AsmFunctionsTester"; import "@ton/test-utils"; @@ -32,8 +32,43 @@ describe("asm functions", () => { it("should implement asm functions correctly", async () => { expect(await contract.getTestAsmStoreDict()).toEqual(true); expect(await contract.getTestAsmLoadCoins()).toEqual(true); + expect(await contract.getTestAsmLoadCoinsMut()).toEqual(true); + expect( + await contract.getTestAsmLoadCoinsMutRuntime( + beginCell().storeCoins(42n).endCell(), + ), + ).toEqual(42n); expect(await contract.getTestAsmLoadInt()).toEqual(true); expect(await contract.getTestAsmDebugStr()).toEqual(true); expect(await contract.getTestAsmCreateUseWord()).toEqual(true); + + // Struct arrangements + expect(await contract.getTestAsmSecondToLast()).toEqual(true); + expect( + await contract.getTestAsmSecondToLastRuntime( + { $$type: "Two", a: 1n, b: 2n }, + { $$type: "Two", a: 3n, b: 4n }, + ), + ).toEqual(3n); + expect(await contract.getTestAsmFirst()).toEqual(true); + expect( + await contract.getTestAsmFirstRuntime( + { + $$type: "TwoInTwo", + a: { $$type: "Two", a: 1n, b: 2n }, + b: { $$type: "Two", a: 3n, b: 4n }, + }, + { + $$type: "TwoInTwo", + a: { $$type: "Two", a: 5n, b: 6n }, + b: { $$type: "Two", a: 7n, b: 8n }, + }, + { + $$type: "TwoInTwo", + a: { $$type: "Two", a: 9n, b: 10n }, + b: { $$type: "Two", a: 11n, b: 12n }, + }, + ), + ).toEqual(1n); }); }); diff --git a/src/test/e2e-emulated/contracts/asm-functions.tact b/src/test/e2e-emulated/contracts/asm-functions.tact index 698c1ae2f..9360e7e32 100644 --- a/src/test/e2e-emulated/contracts/asm-functions.tact +++ b/src/test/e2e-emulated/contracts/asm-functions.tact @@ -18,6 +18,19 @@ contract AsmFunctionsTester { return s.asmLoadCoins().val == 42; } + get fun testAsmLoadCoinsMut(): Bool { + let s = beginCell().storeCoins(42).asSlice(); + return s.asmLoadCoinsMut() == 42 && s.empty(); + } + + // asmLoadCoinsMut(), but with data supplied at runtime + get fun testAsmLoadCoinsMutRuntime(c: Cell): Int { + let s = c.asSlice(); + let res = s.asmLoadCoinsMut(); + s.endParse(); // like .empty(), but throws on failure + return res; + } + get fun testAsmLoadInt(): Bool { let s = beginCell().storeInt(42, 7).asSlice(); return s.asmLoadInt(7).val == 42; @@ -31,6 +44,28 @@ contract AsmFunctionsTester { get fun testAsmCreateUseWord(): Bool { return asmCreateUseWord(6) == 7; } + + get fun testAsmSecondToLast(): Bool { + return asmSecondToLast(Two{ a: 1, b: 2 }, Two{ a: 3, b: 4 }) == 3; + } + + // asmSecondToLast(), but with data supplied at runtime + get fun testAsmSecondToLastRuntime(s1: Two, s2: Two): Int { + return asmSecondToLast(s1, s2); + } + + get fun testAsmFirst(): Bool { + return asmFirst( + TwoInTwo{ a: Two{ a: 1, b: 2}, b: Two{ a: 3, b: 4 } }, + TwoInTwo{ a: Two{ a: 5, b: 6}, b: Two{ a: 7, b: 8 } }, + TwoInTwo{ a: Two{ a: 9, b: 10}, b: Two{ a: 11, b: 12 } }, + ) == 1; + } + + // asmFirst(), but with data supplied at runtime + get fun testAsmFirstRuntime(s1: TwoInTwo, s2: TwoInTwo, s3: TwoInTwo): Int { + return asmFirst(s1, s2, s3); + } } // Functions to test @@ -41,8 +76,14 @@ asm extends fun asmLoadMapIntInt(self: Slice): MapIntIntSlice { LDDICT } asm extends fun asmLoadCoins(self: Slice): IntSlice { LDVARUINT16 } +asm(-> 1 0) extends mutates fun asmLoadCoinsMut(self: Slice): Int { LDVARUINT16 } + asm(self len -> 1 0) extends fun asmLoadInt(self: Slice, len: Int): SliceInt { LDIX } +asm(b a) fun asmSecondToLast(a: Two, b: Two): Int { DROP DROP DROP } + +asm(a c b) fun asmFirst(a: TwoInTwo, b: TwoInTwo, c: TwoInTwo): Int { DROP2 DROP2 DROP2 DROP2 DROP2 DROP } + asm fun asmDebugStr() { "Works!" DEBUGSTR } asm fun asmCreateUseWord(x: Int): Int { @@ -67,3 +108,13 @@ struct SliceInt { rem: Slice; val: Int; } + +struct Two { + a: Int; + b: Int; +} + +struct TwoInTwo { + a: Two; + b: Two; +} From 616d1bdfaca8a3040978488776939ef15b325c5f Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Tue, 24 Dec 2024 14:05:24 +0400 Subject: [PATCH 21/29] feat(gas): do not store self-code in dictionary of child contract codes (#1213) This reduces gas consumption for Jettons --- CHANGELOG.md | 1 + src/benchmarks/benchmarks.spec.ts | 8 +- src/bindings/writeTypescript.ts | 12 +-- src/generator/writeProgram.ts | 2 +- src/generator/writers/writeContract.ts | 95 ++++++++++++++++-------- src/generator/writers/writeExpression.ts | 5 +- src/packaging/fileFormat.ts | 2 +- src/pipeline/build.ts | 8 +- src/test/e2e-emulated/stdlib.spec.ts | 2 +- 9 files changed, 87 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 384b03545..443a323e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Do not automatically validate all addresses when receiving/sending messages or using address manipulating functions: PR [#1207](https://github.com/tact-lang/tact/pull/1207) - Remove `enabledMasterchain` compiler config option from `tact.config.json`: PR [#1207](https://github.com/tact-lang/tact/pull/1207) - Remove `org.ton.chain.any.v0` interface: PR [#1207](https://github.com/tact-lang/tact/pull/1207) +- To reduce fees, Tact no longer stores the parent contract code in the system cell that holds all the child contract codes used in `initOf`. Instead, the `MYCODE` instruction is used: PR [#1213](https://github.com/tact-lang/tact/pull/1213) ### Fixed diff --git a/src/benchmarks/benchmarks.spec.ts b/src/benchmarks/benchmarks.spec.ts index 6a9a80cd0..6e4075284 100644 --- a/src/benchmarks/benchmarks.spec.ts +++ b/src/benchmarks/benchmarks.spec.ts @@ -33,11 +33,11 @@ describe("benchmarks", () => { .description as TransactionDescriptionGeneric ).computePhase as TransactionComputeVm ).gasUsed; - expect(gasUsed).toMatchInlineSnapshot(`3146n`); + expect(gasUsed).toMatchInlineSnapshot(`3018n`); // Verify code size const codeSize = functions.init!.code.toBoc().length; - expect(codeSize).toMatchInlineSnapshot(`241`); + expect(codeSize).toMatchInlineSnapshot(`233`); }); it("benchmark functions (inline)", async () => { @@ -57,10 +57,10 @@ describe("benchmarks", () => { .description as TransactionDescriptionGeneric ).computePhase as TransactionComputeVm ).gasUsed; - expect(gasUsed).toMatchInlineSnapshot(`3015n`); + expect(gasUsed).toMatchInlineSnapshot(`2887n`); // Verify code size const codeSize = functionsInline.init!.code.toBoc().length; - expect(codeSize).toMatchInlineSnapshot(`234`); + expect(codeSize).toMatchInlineSnapshot(`226`); }); }); diff --git a/src/bindings/writeTypescript.ts b/src/bindings/writeTypescript.ts index 5d1bee611..b179f9bf0 100644 --- a/src/bindings/writeTypescript.ts +++ b/src/bindings/writeTypescript.ts @@ -45,7 +45,7 @@ export function writeTypescript( abi: ContractABI, init?: { code: string; - system: string; + system: string | null; args: ABIArgument[]; prefix?: | { @@ -171,11 +171,13 @@ export function writeTypescript( w.inIndent(() => { // Code references w.append(`const __code = Cell.fromBase64('${init.code}');`); - w.append(`const __system = Cell.fromBase64('${init.system}');`); - - // Stack w.append("let builder = beginCell();"); - w.append(`builder.storeRef(__system);`); + + if (init.system !== null) { + w.append(`const __system = Cell.fromBase64('${init.system}');`); + w.append(`builder.storeRef(__system);`); + } + if (init.prefix) { w.append( `builder.storeUint(${init.prefix.value}, ${init.prefix.bits});`, diff --git a/src/generator/writeProgram.ts b/src/generator/writeProgram.ts index 51acceea6..7523c8385 100644 --- a/src/generator/writeProgram.ts +++ b/src/generator/writeProgram.ts @@ -96,7 +96,7 @@ export async function writeProgram( const stdlibHeader = trimIndent(` global (int, slice, int, slice) __tact_context; global slice __tact_context_sender; - global cell __tact_context_sys; + global cell __tact_child_contract_codes; global int __tact_randomized; `); diff --git a/src/generator/writers/writeContract.ts b/src/generator/writers/writeContract.ts index 14264c06a..b205e8c3b 100644 --- a/src/generator/writers/writeContract.ts +++ b/src/generator/writers/writeContract.ts @@ -35,7 +35,10 @@ export function writeStorageOps( ctx.append(`slice $sc = get_data().begin_parse();`); // Load context - ctx.append(`__tact_context_sys = $sc~load_ref();`); + if (type.dependsOn.length > 0) { + ctx.append(`__tact_child_contract_codes = $sc~load_ref();`); + } + ctx.append(`int $loaded = $sc~load_int(1);`); // Load data @@ -78,7 +81,9 @@ export function writeStorageOps( ctx.append(`builder b = begin_cell();`); // Persist system cell - ctx.append(`b = b.store_ref(__tact_context_sys);`); + if (type.dependsOn.length > 0) { + ctx.append(`b = b.store_ref(__tact_child_contract_codes);`); + } // Persist deployment flag ctx.append(`b = b.store_int(true, 1);`); @@ -156,12 +161,9 @@ export function writeInit( }); ctx.fun(ops.contractInitChild(t.name, ctx), () => { - const args = [ - `cell sys'`, - ...init.params.map( - (v) => resolveFuncType(v.type, ctx) + " " + funcIdOf(v.name), - ), - ]; + const args = init.params.map( + (v) => resolveFuncType(v.type, ctx) + " " + funcIdOf(v.name), + ); const sig = `(cell, cell) ${ops.contractInitChild(t.name, ctx)}(${args.join(", ")})`; ctx.signature(sig); if (enabledInline(ctx.ctx)) { @@ -169,33 +171,62 @@ export function writeInit( } ctx.context("type:" + t.name + "$init"); ctx.body(() => { - ctx.write(` - slice sc' = sys'.begin_parse(); - cell source = sc'~load_dict(); - cell contracts = new_dict(); - - ;; Contract Code: ${t.name} - cell mine = ${ctx.used(`__tact_dict_get_code`)}(source, ${t.uid}); - contracts = ${ctx.used(`__tact_dict_set_code`)}(contracts, ${t.uid}, mine); - `); - - // Copy contracts code - for (const c of t.dependsOn) { + ctx.append(";; Build init code cell"); + ctx.append(); + if (t.name === ctx.name) { + // The contract wants to deploy its copy + ctx.write(` + ;; Contract Code: ${t.name} + cell init_code = my_code(); + `); + ctx.append(); + ctx.append(";; Build init data cell"); ctx.append(); + ctx.append("builder b = begin_cell();"); + if (t.dependsOn.length > 0) { + ctx.append("b = b.store_ref(__tact_child_contract_codes);"); + } + } else { + ctx.write(` + slice sc' = __tact_child_contract_codes.begin_parse(); + cell source = sc'~load_dict(); + `); ctx.write(` - ;; Contract Code: ${c.name} - cell code_${c.uid} = __tact_dict_get_code(source, ${c.uid}); - contracts = ${ctx.used(`__tact_dict_set_code`)}(contracts, ${c.uid}, code_${c.uid}); - `); + ;; Contract Code: ${t.name} + cell init_code = ${ctx.used("__tact_dict_get_code")}(source, ${t.uid}); + `); + ctx.append(); + ctx.append(";; Build init data cell"); + if (t.dependsOn.length > 0) { + ctx.write(` + cell contracts = new_dict(); + `); + } + // Copy contracts code + for (const c of t.dependsOn) { + ctx.append(); + ctx.append(`;; Contract Code: ${c.name}`); + if (c.name === ctx.name) { + ctx.append( + `contracts = ${ctx.used("__tact_dict_set_code")}(contracts, ${c.uid}, my_code());`, + ); + } else { + ctx.write(` + cell code_${c.uid} = ${ctx.used("__tact_dict_get_code")}(source, ${c.uid}); + contracts = ${ctx.used("__tact_dict_set_code")}(contracts, ${c.uid}, code_${c.uid}); + `); + } + } + ctx.append(); + ctx.append("builder b = begin_cell();"); + if (t.dependsOn.length > 0) { + ctx.append( + `b = b.store_ref(begin_cell().store_dict(contracts).end_cell());`, + ); + } } - // Build cell - ctx.append(); - ctx.append(`;; Build cell`); - ctx.append(`builder b = begin_cell();`); - ctx.append( - `b = b.store_ref(begin_cell().store_dict(contracts).end_cell());`, - ); + // store initialization bit and contract variables ctx.append(`b = b.store_int(false, 1);`); const args = t.init!.params.length > 0 @@ -211,7 +242,7 @@ export function writeInit( ctx.append( `b = ${ops.writer(funcInitIdOf(t.name), ctx)}(${args});`, ); - ctx.append(`return (mine, b.end_cell());`); + ctx.append(`return (init_code, b.end_cell());`); }); }); } diff --git a/src/generator/writers/writeExpression.ts b/src/generator/writers/writeExpression.ts index 819047865..cc5340e3d 100644 --- a/src/generator/writers/writeExpression.ts +++ b/src/generator/writers/writeExpression.ts @@ -672,7 +672,10 @@ export function writeExpression(f: AstExpression, wCtx: WriterContext): string { if (f.kind === "init_of") { const type = getType(wCtx.ctx, f.contract); - return `${ops.contractInitChild(idText(f.contract), wCtx)}(${["__tact_context_sys", ...f.args.map((a, i) => writeCastedExpression(a, type.init!.params[i]!.type, wCtx))].join(", ")})`; + const initArgs = f.args.map((a, i) => + writeCastedExpression(a, type.init!.params[i]!.type, wCtx), + ); + return `${ops.contractInitChild(idText(f.contract), wCtx)}(${initArgs.join(", ")})`; } // diff --git a/src/packaging/fileFormat.ts b/src/packaging/fileFormat.ts index dc976a3bb..90b3d0a57 100644 --- a/src/packaging/fileFormat.ts +++ b/src/packaging/fileFormat.ts @@ -49,7 +49,7 @@ const initFormat = z.object({ }), z.object({ kind: z.literal("system-cell"), - system: z.string(), + system: z.string().nullable(), }), ]), }); diff --git a/src/pipeline/build.ts b/src/pipeline/build.ts index 0188a7068..fc1d8dd1a 100644 --- a/src/pipeline/build.ts +++ b/src/pipeline/build.ts @@ -262,7 +262,6 @@ export async function build(args: { Dictionary.Values.Cell(), ); const ct = getType(ctx, contract); - depends.set(ct.uid, Cell.fromBoc(built[ct.name]!.codeBoc)[0]!); // Mine for (const c of ct.dependsOn) { const cd = built[c.name]; if (!cd) { @@ -273,7 +272,10 @@ export async function build(args: { } depends.set(c.uid, Cell.fromBoc(cd.codeBoc)[0]!); } - const systemCell = beginCell().storeDict(depends).endCell(); + const systemCell = + ct.dependsOn.length > 0 + ? beginCell().storeDict(depends).endCell() + : null; // Collect sources const sources: Record = {}; @@ -309,7 +311,7 @@ export async function build(args: { }, deployment: { kind: "system-cell", - system: systemCell.toBoc().toString("base64"), + system: systemCell?.toBoc().toString("base64") ?? null, }, }, sources, diff --git a/src/test/e2e-emulated/stdlib.spec.ts b/src/test/e2e-emulated/stdlib.spec.ts index 440d82c13..8a39ca4fc 100644 --- a/src/test/e2e-emulated/stdlib.spec.ts +++ b/src/test/e2e-emulated/stdlib.spec.ts @@ -56,7 +56,7 @@ describe("stdlib", () => { .toString(), ).toBe(beginCell().storeBit(true).endCell().toString()); - expect(await contract.getTvm_2023_07Upgrade()).toEqual(1355n); + expect(await contract.getTvm_2023_07Upgrade()).toEqual(1289n); // gas consumed expect(await contract.getTvm_2024_04Upgrade()).toEqual(82009144n); expect( From e5ece837d54c5cf6bea4e631106766b225bf7048 Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:39:12 +0400 Subject: [PATCH 22/29] fix(build): generate grammar before testing (#1244) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7191fd01..59de8b843 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "clean": "rm -fr dist", "cleanall": "rm -fr dist node_modules", "build": "tsc && node --no-warnings=ExperimentalWarning -r ts-node/register ./scripts/copy-files", - "test": "jest", + "test": "yarn gen:grammar && jest", "coverage": "cross-env COVERAGE=true jest", "release": "yarn clean && yarn build && yarn coverage && yarn release-it --npm.yarn1", "type": "tsc --noEmit", From 02779e2155a4e689333633accb1004998ea42770 Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:40:59 +0400 Subject: [PATCH 23/29] chore(docs): Typescript styleguide (#1249) --- STYLEGUIDE.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++ cspell.json | 5 +++ 2 files changed, 122 insertions(+) create mode 100644 STYLEGUIDE.md diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md new file mode 100644 index 000000000..7f36f241d --- /dev/null +++ b/STYLEGUIDE.md @@ -0,0 +1,117 @@ +# Styleguide + +Due to stringent security and correctness requirements we have to use a subset of TypeScript features that are known to be _less unsound_. + +## Do + +Prefer the most simple and basic language features. + +- Variables `const x = f()` +- Functions `(x: T) => x`, `f(x)` +- Objects `{ foo: 'bar' }`, `x.foo`, `const { foo } = x;` +- Statements `if`, `for`, `return` +- Aliases `type F = { foo: T }` +- Simple types `number`, `string`, `boolean`, `undefined` +- Literal types `1`, `"hello"` +- Unions of literal types `1 | 2 | 3` +- Tagged unions `{ kind: 'A', a: number } | { kind: 'B' }` + +## Don't + +### Don't explicitly break type system + +- **Don't use `as`**, except `as const`. It was meant for gradually typing legacy code, not for production use in TS-native projects. Often `x as T` actually was meant to be `const y: T = x;` or `x satisfies T`. +- **Don't use `any`.** Its actual meaning is "completely disregard type errors here". Prefer `unknown` or `never`. +- **Don't use guard types `x is T`.** These are just `as` in disguise. Might be used in very simple cases, such as ADT boilerplate. +- **Don't use overloading**. It's almost the same as intersection types, and intersection types are broken. +- **Don't use `@ts-ignore`.** It's a worse version of `as` that can take TS compiler into an arbitrary incorrect state. +- **Don't use `x!` operator.** It does no checks at runtime, and is essentially `x as NotNull`. +- **Don't pick into values that are generic** `(x: T) => typeof x === 'number'`. Properly designed languages do not allow this. + +Workarounds for bugs in compiler will sometimes require an `as` or `any`. In this case the workaround should be small and generic, separated into its own file, and annotated with reference to TypeScript issue. + +For example, `["a", "b"].includes(x)` doesn't narrow `x` to `'a' | 'b'`. Instead of multiple `x as ('a' | 'b')` over the whole codebase we can define a wrapper once in `util.ts`, thoroughly test and review it, and keep it in containment this way. + +```typescript +// `extends string` is usually a bad idea, but `key is K` is an even worse idea +export const includes = ( + keys: readonly K[], + key: string, +): key is K => { + // we have to do this, otherwise next line will complain that `key` isn't `K` + const keys1: readonly string[] = keys; + return keys1.includes(key); +}; +``` + +### Don't use mutability unless required + +- **Don't use `let`.** Most likely it should be a separate function where each assignment is a `return`. +- **Never use `var`.** They're hoisted up to the function or module scope. `for (var i = 0; i < n; ++i) a.push(() => i)` creates an array of functions referencing the same value of `i === n`. +- **Never use `let` in tests.** `jest` execution order is hard to understand, and most likely it will lead to flaky tests. +- **Never use `let` global variables.** These break tree-shaking, make code untestable, make behavior dependent on module initialization order. +- **Don't assign to function arguments** `(x) => { x = 1; }` +- **Don't use `for (let ...)` loops.** Prefer built-in array methods. +- **All object fields must be `readonly`**: `{ readonly foo: string }`. +- **Tag fields on tagged unions absolutely have to be readonly.** By assigning into a tag field of a `A | B` union, we can narrow it to an `A` type while it will have `B` (or some arbitrary combination of `A` and `B`) at runtime. +- **Arrays should be readonly**: `readonly string[]` +- **Tuples should be readonly**: `readonly [string, number]` +- **Prefer freezing highly reused objects** with `Object.freeze`. +- **Avoid `void` type.** + +### Don't use untagged unions + +- **Don't use untagged non-literal unions** `{ a: 1 } | { b: 2 }`. These will require an `in`-condition for narrowing to select either of branches. +- **Don't use `in`.** TypeScript has no distinction between open and closed object types. There might be no field in an object type, but there will be one at runtime. Narrowing for `in` operators is also buggy in other ways, and doesn't properly apply to either of its arguments. + +### Don't use JS object "features" + +- **Don't use optional fields** `foo?: Bar`. Every `?` doubles number of cases that should be tested. Eventually some combination of non-defined and undefined fields will be non-semantic. +- _**Don't use optional fields**_. In JS there is a distinction between field that is not defined and a field that is `undefined` (sic). `'a' in {} === false`, `'a' in { a: undefined } === true`. TypeScript doesn't handle this properly in its type system. +- **Don't use `Proxy`**. These break type safety, are incorrectly handled in debuggers, lead to very unexpected heisenbugs. +- **Don't use `get` and `set`**. See `Proxy` above. +- **Don't use `...` with objects**. It will require intersection types or inheritance to type. Prefer aggregation: `{ ...a, b }` → `{ a, b }`. +- **Don't use `interface ... extends`**. There is no way to safely distinguish objects supporting parent and child interfaces at runtime. + - Except where it's required to untie type recursion. For example `type Foo = A` would only work as `interface Foo extends A {}` + +### Don't use JS function "features" + +- **Don't use optional parameters** `(x?: number) => {}`. TypeScript has a quirk that allows passing function with less arguments to parameter that requires more. Eventually this leads to passing unexpected values to optional parameters. Prefer decomposing the function into two, where one takes full set of parameters, and the other one is a simpler version that takes less. +- **Don't use default parameters** `(x = 1) => {}`. See reasoning above. +- **Don't use `...rest` parameters**. TypeScript doesn't have "mapped tuple types", so typing these will be problematic. In most cases passing an array would suffice, and would only take two more characters to type. +- **Don't use `arguments`**. This is a worse version of `...rest` that isn't even an array. +- **Don't pass functions directly** to built-in functions `.map(foo)`. A good example of why this is a bad idea: `["10", "10", "10"].map(parseInt)`. Prefer `.map(x => foo(x))`. + +### Don't use OOP + +- **Don't use methods**. Methods don't store reference to `this` in their closure, and take it from object _syntactically_, i.e. `x.f()` would use `x` as `this`. It means `const { f } = x; f();` will be a runtime error, and TypeScript would emit no error here at compile time. +- **Don't use inheritance**. Overriding is allowed in JS, Liskov substitution is not guaranteed. +- **Don't use `class`**. In TS `private` is only a type system feature, and all the private fields are globally accessible at runtime. Worse, created objects have part of their description in `prototype`, and can't be worked with as regular objects. If class is converted to regular function, all the fields are properly private, accessing them requires no `this.` prefix, and in most frequent case there is only one exposed method that can be returned directly. + +### Don't use funny types + +- **Don't use conditional types**. These lack any theory behind them, and were meant to type legacy JS code. +- **Don't use `Omit`, `Pick`, `Exclude` and `Extract`**. These are conditional types in disguise. +- **Don't use mapped object types** `{ [K in keyof T]: ... }`. These lack any theory behind them, don't have introducing syntax, and are buggy. +- **Don't use index types** `T["foo"]`. They disregard variance at their use site, and most likely will pin types in another library/module with both lower and upper bounds, thus they're very detrimental to modularity. Most likely type of `foo` field should be defined separately. +- **Don't use indexed types** `{ [k: string]: number }`. It's `Record`. The only valid case is to avoid type recursion quirks in TS: `type Json = null | boolean | number | string | Json[] | { [k: string]: Json }` would emit error with `Record` +- **Don't define bounds on generic parameters** ` string>`. Type inference is broken here, and in many cases will force TS to infer type of bound instead of expected type. +- **Don't use intersection types** `A & B`. They are so broken it's hard to even count them as intersection types. +- **Don't use `Object`, `object`, `{}`, `Function`**. There's barely a case when common supertypes of objects and functions are even needed. + +### Don't use arcane language "features" + +- **Don't use `export default`**. It breaks IDE features such as renaming, and also has complex semantics. +- **Don't use `while`** loops. Every iteration must have at least an explicit "fuel" check. `while` _always_ eventually leads to infinite loops. +- **Don't use `for (... in ...)`**. It requires `hasOwnProperty` check. Prefer `Object.entries`, `Object.keys` or `Object.values`. +- **Don't define `toString` and `toJSON`** on objects. These obfuscate results of `console.log`, make objects different depending on the way they're logged (`util.inspect` wouldn't use them). +- **Don't use `JSON.parse` and `JSON.stringify`** without `zod`. Both functions have very broken types: `JSON.stringify(undefined)`. + +### Other considerations + +- **Beware of `${}`** in template strings. Any inlining succeeds, and there won't be any compile-time errors even if it's a function `${(x: number) => x}`. +- **Avoid `null`**. `typeof null === 'object'`, and there is `undefined` anyway. +- **Avoid exceptions**. Exceptions are untyped. +- **Avoid tuples**. TS gives them minimal distinction from arrays, and type system is broken around them. Occasionally for performance reasons tuples might be a better option than objects. +- **Avoid `enum`**. It's equivalent to unions since 5.0, except generates boilerplate JS code. A version that doesn't generate extraneous code, `const enum`, is not properly supported by `babel`. +- **Avoid iterators**. They're untypable unless fixed in JS standard. Prefer generators. Prefer iterating with `for (... of ...)`. diff --git a/cspell.json b/cspell.json index 361166021..761007fc5 100644 --- a/cspell.json +++ b/cspell.json @@ -52,6 +52,7 @@ "getsimpleforwardfee", "gettest", "Héctor", + "heisenbugs", "infixl", "infixr", "initof", @@ -66,6 +67,7 @@ "Korshakov", "Laika", "langle", + "Liskov", "lparen", "lvalue", "lvalues", @@ -107,7 +109,9 @@ "Ston", "struct", "structs", + "styleguide", "subtyping", + "supertypes", "Tarjan", "testdata", "Topup", @@ -118,6 +122,7 @@ "uintptr", "uninit", "unixfs", + "untypable", "varuint", "workchain", "xffff", From 402c86dc2c751229afe64eb409424c39ac66fa9d Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Wed, 25 Dec 2024 11:39:16 +0400 Subject: [PATCH 24/29] chore(docs): more TypeScript styleguide (#1250) --- STYLEGUIDE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 7f36f241d..8b64e26bc 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -56,6 +56,8 @@ export const includes = ( - **Tag fields on tagged unions absolutely have to be readonly.** By assigning into a tag field of a `A | B` union, we can narrow it to an `A` type while it will have `B` (or some arbitrary combination of `A` and `B`) at runtime. - **Arrays should be readonly**: `readonly string[]` - **Tuples should be readonly**: `readonly [string, number]` +- **`Set` and `Map` should be readonly**: `env: ReadonlyMap` +- **Clone arrays before `.sort()`, `.reverse()`, `.splice()`**: `[...arr].sort()` - **Prefer freezing highly reused objects** with `Object.freeze`. - **Avoid `void` type.** @@ -73,6 +75,7 @@ export const includes = ( - **Don't use `...` with objects**. It will require intersection types or inheritance to type. Prefer aggregation: `{ ...a, b }` → `{ a, b }`. - **Don't use `interface ... extends`**. There is no way to safely distinguish objects supporting parent and child interfaces at runtime. - Except where it's required to untie type recursion. For example `type Foo = A` would only work as `interface Foo extends A {}` +- **Don't use objects as `Map`s**. Objects have a set of quirks: numeric keys get listed before string keys, key order is not guaranteed, keys can be inherited from `Object.prototype`, `__proto__` key can be used for prototype pollution exploits. Unless very high performance of hashmap is needed, or an object is statically defined, use `Map`. ### Don't use JS function "features" From 136665eb7c9060077bbffcf27e50246dd7e6d403 Mon Sep 17 00:00:00 2001 From: Daniil Sedov Date: Wed, 25 Dec 2024 11:24:00 +0300 Subject: [PATCH 25/29] feat/fix: add `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer formats and fix `coins` in `foreach` (#1186) * fix: implement `foreach` for coins and varints * split map tests into two because we have exceeded the 255 usable stack items limit and started getting the following error `fatal: Too deep stack` --- CHANGELOG.md | 2 + cspell.json | 3 + src/abi/map.ts | 16 + src/bindings/typescript/serializers.ts | 87 +- .../writeSerialization.spec.ts.snap | 12256 +++++++++++----- src/generator/writers/writeFunction.ts | 32 +- src/generator/writers/writeSerialization.ts | 18 +- src/generator/writers/writeStdlib.ts | 118 +- src/imports/stdlib.ts | 654 +- src/storage/allocator.ts | 21 +- src/storage/operation.ts | 2 +- .../e2e-emulated/contracts/map-traverse.tact | 72 + src/test/e2e-emulated/contracts/maps1.tact | 1516 ++ .../contracts/{maps.tact => maps2.tact} | 568 +- src/test/e2e-emulated/contracts/structs.tact | 26 + src/test/e2e-emulated/map-traverse.spec.ts | 4 + .../{map.spec.ts => map1.spec.ts} | 410 +- src/test/e2e-emulated/map2.spec.ts | 1818 +++ src/test/e2e-emulated/structs.spec.ts | 13 + .../resolveDescriptors.spec.ts.snap | 2774 ++++ src/types/resolveABITypeRef.ts | 4 + src/types/resolveSignatures.ts | 4 + src/types/test/map-value-as-varint.tact | 24 + src/types/test/map-value-as-varuint.tact | 24 + stdlib/std/cells.tact | 8 + stdlib/stdlib.fc | 10 + tact.config.json | 9 +- 27 files changed, 15284 insertions(+), 5209 deletions(-) create mode 100644 src/test/e2e-emulated/contracts/maps1.tact rename src/test/e2e-emulated/contracts/{maps.tact => maps2.tact} (68%) rename src/test/e2e-emulated/{map.spec.ts => map1.spec.ts} (85%) create mode 100644 src/test/e2e-emulated/map2.spec.ts create mode 100644 src/types/test/map-value-as-varint.tact create mode 100644 src/types/test/map-value-as-varuint.tact diff --git a/CHANGELOG.md b/CHANGELOG.md index 443a323e4..18a355440 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) - Utility for logging errors in code that was supposed to be unreachable: PR [#991](https://github.com/tact-lang/tact/pull/991) - Ability to specify a compile-time message opcode expression: PR [#1188](https://github.com/tact-lang/tact/pull/1188) +- The `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer serialization types: PR [#1186](https://github.com/tact-lang/tact/pull/1186) ### Changed @@ -38,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Type checking for `foreach` loops in trait methods: PR [#1017](https://github.com/tact-lang/tact/pull/1017) - The `sha256()` function no longer throws on statically known strings of any length: PR [#907](https://github.com/tact-lang/tact/pull/907) - TypeScript wrappers generation for messages with single quote: PR [#1106](https://github.com/tact-lang/tact/pull/1106) +- `foreach` loops now properly handle `as coins` map value serialization type: PR [#1186](https://github.com/tact-lang/tact/pull/1186) ### Docs diff --git a/cspell.json b/cspell.json index 761007fc5..650ee7101 100644 --- a/cspell.json +++ b/cspell.json @@ -124,6 +124,9 @@ "unixfs", "untypable", "varuint", + "varint", + "storer", + "Ints", "workchain", "xffff", "привет" diff --git a/src/abi/map.ts b/src/abi/map.ts index 0a8c0ea3a..2c0332b1f 100644 --- a/src/abi/map.ts +++ b/src/abi/map.ts @@ -164,6 +164,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_set_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_set_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_set_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_set_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; @@ -234,6 +238,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_get_${kind}_${vKind}`); return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_get_${kind}_${vKind}`); + return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]})`; } ctx.used(`__tact_dict_get_${kind}_${vKind}`); return `__tact_dict_get_${kind}_${vKind}(${resolved[0]}, ${bits}, ${resolved[1]}, ${vBits})`; @@ -583,6 +591,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_replace_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_replace_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_replace_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replace_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; @@ -665,6 +677,10 @@ export const MapFunctions: Map = new Map([ vKind = "coins"; ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; + } else if (self.valueAs?.startsWith("var")) { + vKind = self.valueAs; + ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); + return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]})`; } ctx.used(`__tact_dict_replaceget_${kind}_${vKind}`); return `${resolved[0]}~__tact_dict_replaceget_${kind}_${vKind}(${bits}, ${resolved[1]}, ${resolved[2]}, ${vBits})`; diff --git a/src/bindings/typescript/serializers.ts b/src/bindings/typescript/serializers.ts index 2f23a8583..268ae6474 100644 --- a/src/bindings/typescript/serializers.ts +++ b/src/bindings/typescript/serializers.ts @@ -192,6 +192,77 @@ const coinsSerializer: Serializer<{ optional: boolean }> = { }, }; +const varIntSerializer: Serializer<{ + format: "varint16" | "varint32" | "varuint16" | "varuint32"; + optional: boolean; +}> = { + tsType(v) { + if (v.optional) { + return "bigint | null"; + } else { + return "bigint"; + } + }, + tsLoad(v, slice, field, w) { + const loader = + v.format === "varint16" || v.format === "varint32" + ? "loadVarIntBig" + : "loadVarUintBig"; + const length = + v.format === "varint16" || v.format === "varuint16" ? 2 : 4; + if (v.optional) { + w.append( + `let ${field} = ${slice}.loadBit() ? ${slice}.${loader}(${length}) : null;`, + ); + } else { + w.append(`let ${field} = ${slice}.${loader}(${length});`); + } + }, + tsLoadTuple(v, reader, field, w) { + if (v.optional) { + w.append(`let ${field} = ${reader}.readBigNumberOpt();`); + } else { + w.append(`let ${field} = ${reader}.readBigNumber();`); + } + }, + tsStore(v, builder, field, w) { + const storer = + v.format === "varint16" || v.format === "varint32" + ? "storeVarInt" + : "storeVarUint"; + const length = + v.format === "varint16" || v.format === "varuint16" ? 2 : 4; + if (v.optional) { + w.append( + `if (${field} !== null && ${field} !== undefined) { ${builder}.storeBit(true).${storer}(${field}, ${length}); } else { ${builder}.storeBit(false); }`, + ); + } else { + w.append(`${builder}.${storer}(${field}, ${length});`); + } + }, + tsStoreTuple(v, to, field, w) { + w.append(`${to}.writeNumber(${field});`); + }, + abiMatcher(src) { + if (src.kind === "simple") { + if (src.type === "int" || src.type === "uint") { + if ( + src.format === "varint16" || + src.format === "varint32" || + src.format === "varuint16" || + src.format === "varuint32" + ) { + return { + format: src.format, + optional: src.optional ? src.optional : false, + }; + } + } + } + return null; + }, +}; + const boolSerializer: Serializer<{ optional: boolean }> = { tsType(v) { if (v.optional) { @@ -621,6 +692,7 @@ type MapSerializerDescrKey = type MapSerializerDescrValue = | { kind: "int" | "uint"; bits: number } | { kind: "varuint"; length: number } + | { kind: "varint"; length: number } | { kind: "boolean" } | { kind: "address" } | { kind: "cell" } @@ -669,6 +741,9 @@ function getValueParser(src: MapSerializerDescrValue) { case "varuint": { return `Dictionary.Values.BigVarUint(${src.length})`; } + case "varint": { + return `Dictionary.Values.BigVarInt(${src.length})`; + } case "address": { return "Dictionary.Values.Address()"; } @@ -732,6 +807,10 @@ const map: Serializer = { src.valueFormat === undefined ) { value = { kind: "int", bits: 257 }; + } else if (src.valueFormat === "varint16") { + value = { kind: "varint", length: 4 }; + } else if (src.valueFormat === "varint32") { + value = { kind: "varint", length: 5 }; } } if (src.value === "uint") { @@ -744,6 +823,10 @@ const map: Serializer = { value = { kind: "uint", bits: 256 }; } else if (src.valueFormat === "coins") { value = { kind: "varuint", length: 4 }; + } else if (src.valueFormat === "varuint16") { + value = { kind: "varuint", length: 4 }; + } else if (src.valueFormat === "varuint32") { + value = { kind: "varuint", length: 5 }; } } if (src.value === "address") { @@ -813,7 +896,8 @@ const map: Serializer = { } } break; - case "varuint": { + case "varuint": + case "varint": { valueT = `bigint`; break; } @@ -869,6 +953,7 @@ export const serializers: Serializer[] = [ intSerializer, uintSerializer, coinsSerializer, + varIntSerializer, boolSerializer, addressSerializer, cellSerializer, diff --git a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap index 10b4a432c..9ce27496c 100644 --- a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap +++ b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap @@ -2344,9 +2344,9 @@ if (ok) { }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_varint16(); } else { return null(); }", @@ -2354,18 +2354,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_slice", - "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_varint16", + "signature": "int __tact_dict_get_slice_varint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -2373,18 +2375,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_slice", - "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", + "name": "__tact_dict_min_slice_varint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -2392,56 +2396,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_slice", - "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_varint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varint16(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set(d, kl, k, v), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_slice", - "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_slice_varint16", + "signature": "(cell, ()) __tact_dict_set_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace?(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_slice", - "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -2449,18 +2459,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_varint32(); } else { return null(); }", @@ -2468,18 +2480,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_int", - "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_slice_varint32", + "signature": "int __tact_dict_get_slice_varint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -2487,18 +2501,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_int", - "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_slice_varint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varint32(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -2506,56 +2522,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_int", - "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_slice_varint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varint32(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_int", - "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_slice_varint32", + "signature": "(cell, ()) __tact_dict_set_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_int", - "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_varint32()); } else { return (d, null()); }", @@ -2563,18 +2585,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_int", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_varuint16(); } else { return null(); }", @@ -2582,18 +2606,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_uint", - "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_slice_varuint16", + "signature": "int __tact_dict_get_slice_varuint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -2601,18 +2627,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_uint", - "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -2620,56 +2648,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_uint", - "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint16(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_uint", - "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_slice_varuint16", + "signature": "(cell, ()) __tact_dict_set_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_varuint16()); } else { return (d, null()); }", @@ -2677,18 +2711,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_varuint32(); } else { return null(); }", @@ -2696,18 +2732,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_varuint32", + "signature": "int __tact_dict_get_slice_varuint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -2715,18 +2753,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "name": "__tact_dict_min_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint32(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -2734,56 +2774,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint32(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (udict_set_ref(d, kl, k, v), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_slice_varuint32", + "signature": "(cell, ()) __tact_dict_set_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return udict_replace_ref?(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varuint32()); } else { return (d, null()); }", @@ -2791,18 +2837,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r; } else { return null(); }", @@ -2814,14 +2862,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_coins", - "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_slice", + "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -2833,14 +2881,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_coins", - "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + "name": "__tact_dict_min_uint_slice", + "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -2852,8 +2900,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_coins", - "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_slice", + "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", }, { "code": { @@ -2861,7 +2909,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (udict_set(d, kl, k, v), ()); }", "kind": "generic", }, @@ -2871,8 +2919,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_coins", - "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_uint_slice", + "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { @@ -2880,7 +2928,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return udict_replace?(d, kl, k, v); }", "kind": "generic", }, @@ -2890,14 +2938,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_coins", - "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_uint_slice", + "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); if (ok) { - return (d, old~load_coins()); + return (d, old); } else { return (d, null()); }", @@ -2909,14 +2957,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_uint_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_int(vl); } else { return null(); }", @@ -2928,14 +2976,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_slice", - "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_int", + "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -2947,14 +2995,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_slice", - "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", + "name": "__tact_dict_min_uint_int", + "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -2966,16 +3014,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_slice", - "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_int", + "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); }", "kind": "generic", }, @@ -2985,16 +3033,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_slice", - "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_uint_int", + "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); }", "kind": "generic", }, @@ -3004,14 +3052,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_slice", - "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_uint_int", + "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_int(vl)); } else { return (d, null()); }", @@ -3023,14 +3071,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_uint_int", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_uint(vl); } else { return null(); }", @@ -3042,14 +3090,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_int", - "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_uint_uint", + "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -3061,14 +3109,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_int", - "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_uint", + "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -3080,16 +3128,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_int", - "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_uint_uint", + "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, @@ -3099,16 +3147,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_int", - "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_uint_uint", + "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); }", "kind": "generic", }, @@ -3118,14 +3166,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_int", - "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_uint(vl)); } else { return (d, null()); }", @@ -3137,14 +3185,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_int", - "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get_ref?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r; } else { return null(); }", @@ -3156,14 +3204,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_uint", - "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -3175,14 +3223,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_uint", - "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_ref(), flag); } else { return (null(), null(), flag); }", @@ -3194,16 +3242,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_uint", - "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (udict_set_ref(d, kl, k, v), ()); }", "kind": "generic", }, @@ -3213,16 +3261,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_uint", - "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return udict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, @@ -3232,14 +3280,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -3251,14 +3299,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -3270,14 +3318,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -3289,14 +3337,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -3308,16 +3356,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -3327,16 +3375,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -3346,14 +3394,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -3365,14 +3413,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_varint16(); } else { return null(); }", @@ -3384,14 +3432,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_coins", - "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_varint16", + "signature": "int __tact_dict_get_uint_varint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -3403,14 +3451,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_coins", - "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + "name": "__tact_dict_min_uint_varint16", + "signature": "(int, int, int) __tact_dict_min_uint_varint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -3422,16 +3470,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_coins", - "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_varint16", + "signature": "(int, int, int) __tact_dict_next_uint_varint16(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, @@ -3441,16 +3489,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_coins", - "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_uint_varint16", + "signature": "(cell, ()) __tact_dict_set_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, @@ -3460,14 +3508,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_coins", - "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -3479,30 +3527,36 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -return ok;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_exists_slice", - "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_varint32", + "signature": "int __tact_dict_get_uint_varint32(cell d, int kl, int k)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -3511,13 +3565,17 @@ return ok;", "flags": Set { "inline", }, - "name": "__tact_dict_exists_uint", - "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", + "name": "__tact_dict_min_uint_varint32", + "signature": "(int, int, int) __tact_dict_min_uint_varint32(cell d, int kl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -3526,939 +3584,1100 @@ return ok;", "flags": Set { "inline", }, - "name": "__tact_dict_exists_int", - "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", + "name": "__tact_dict_next_uint_varint32", + "signature": "(int, int, int) __tact_dict_next_uint_varint32(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -build_0 = build_0.store_int(v'a, 257); -build_0 = build_0.store_int(v'b, 257); -build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); -build_0 = build_0.store_int(v'd, 1); -build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); -var build_1 = begin_cell(); -build_1 = build_1.store_int(v'f, 257); -build_1 = build_1.store_int(v'g, 257); -build_0 = store_ref(build_0, build_1.end_cell()); -return build_0;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$A$_store", - "signature": "builder $A$_store(builder build_0, (int, int, int, int, int, int, int) v)", - }, - { - "code": { - "code": "return $A$_store(begin_cell(), v).end_cell();", - "kind": "generic", - }, - "comment": null, - "context": "type:A", - "depends": Set { - "$A$_store", - }, "flags": Set { "inline", }, - "name": "$A$_store_cell", - "signature": "cell $A$_store_cell((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_uint_varint32", + "signature": "(cell, ()) __tact_dict_set_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_a", - "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_b", - "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_c", - "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_uint_varuint16", + "signature": "int __tact_dict_get_uint_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_d", - "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_uint_varuint16", + "signature": "(int, int, int) __tact_dict_min_uint_varuint16(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_e", - "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_uint_varuint16", + "signature": "(int, int, int) __tact_dict_next_uint_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_f", - "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_uint_varuint16", + "signature": "(cell, ()) __tact_dict_set_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_get_g", - "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$A$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_not_null", - "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", + "name": "__tact_dict_get_uint_varuint32", + "signature": "int __tact_dict_get_uint_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_as_optional", - "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_uint_varuint32", + "signature": "(int, int, int) __tact_dict_min_uint_varuint32(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_tuple", - "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_next_uint_varuint32", + "signature": "(int, int, int) __tact_dict_next_uint_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_to_tuple($A$_not_null(v)); ", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_to_tuple", - "$A$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_opt_tuple", - "signature": "tuple $A$_to_opt_tuple(tuple v)", + "name": "__tact_dict_set_uint_varuint32", + "signature": "(cell, ()) __tact_dict_set_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", + "name": "__tact_dict_replace_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_as_optional($A$_from_tuple(v));", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_as_optional", - "$A$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_from_opt_tuple", - "signature": "tuple $A$_from_opt_tuple(tuple v)", + "name": "__tact_dict_replaceget_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_external", - "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_get_int_slice", + "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", }, { "code": { - "code": "var loaded = $A$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value, flag); } else { - return (loaded); + return (null(), null(), flag); }", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$A$_to_opt_external", - "signature": "tuple $A$_to_opt_external(tuple v)", + "name": "__tact_dict_min_int_slice", + "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_a", - "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_int_slice", + "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_b", - "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_int_slice", + "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_c", - "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_int_slice", + "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_d", - "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_int_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_e", - "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_int_int", + "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_f", - "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_int_int", + "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_get_g", - "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_int_int", + "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", + "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$B$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_int", + "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_not_null", - "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", + "name": "__tact_dict_replace_int_int", + "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_as_optional", - "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_int_int", + "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_create_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_tuple", - "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_get_int_uint", + "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_to_tuple($B$_not_null(v)); ", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "$B$_to_tuple", - "$B$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_opt_tuple", - "signature": "tuple $B$_to_opt_tuple(tuple v)", + "name": "__tact_dict_min_int_uint", + "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "__tact_tuple_destroy_7", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", + "name": "__tact_dict_next_int_uint", + "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_as_optional($B$_from_tuple(v));", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "$B$_as_optional", - "$B$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_from_opt_tuple", - "signature": "tuple $B$_from_opt_tuple(tuple v)", + "name": "__tact_dict_set_int_uint", + "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_external", - "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var loaded = $B$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); } else { - return (loaded); + return (d, null()); }", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set { - "$B$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$B$_to_opt_external", - "signature": "tuple $B$_to_opt_external(tuple v)", + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'a;", + "code": "var (r, ok) = idict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_a", - "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'b;", + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_b", - "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'c;", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_c", - "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'd;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_ref(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_d", - "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'e;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_ref?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_e", - "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'f;", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_f", - "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'g;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_g", - "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'h;", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_h", - "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$C$_tensor_cast", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_not_null", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_as_optional", - "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_tuple", - "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_to_tuple($C$_not_null(v)); ", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_tuple", - "$C$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_tuple", - "signature": "tuple $C$_to_opt_tuple(tuple v)", + "name": "__tact_dict_get_int_varint16", + "signature": "int __tact_dict_get_int_varint16(cell d, int kl, int k)", }, { "code": { - "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_tuple", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", + "name": "__tact_dict_min_int_varint16", + "signature": "(int, int, int) __tact_dict_min_int_varint16(cell d, int kl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_as_optional($C$_from_tuple(v));", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_as_optional", - "$C$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_opt_tuple", - "signature": "tuple $C$_from_opt_tuple(tuple v)", + "name": "__tact_dict_next_int_varint16", + "signature": "(int, int, int) __tact_dict_next_int_varint16(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_external", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_set_int_varint16", + "signature": "(cell, ()) __tact_dict_set_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var loaded = $C$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); } else { - return (loaded); + return idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_external", - "signature": "tuple $C$_to_opt_external(tuple v)", + "name": "__tact_dict_replace_int_varint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var v'a = sc_0~load_int(257); -var v'b = sc_0~load_int(257); -var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); -var v'd = sc_0~load_int(1); -var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); -slice sc_1 = sc_0~load_ref().begin_parse(); -var v'f = sc_1~load_int(257); -var v'g = sc_1~load_int(257); -return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$A$_load", - "signature": "(slice, ((int, int, int, int, int, int, int))) $A$_load(slice sc_0)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var r = sc_0~$A$_load(); -sc_0.end_parse(); -return r;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set { - "$A$_load", + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "$A$_load_not_mut", - "signature": "((int, int, int, int, int, int, int)) $A$_load_not_mut(slice sc_0)", + "name": "__tact_dict_get_int_varint32", + "signature": "int __tact_dict_get_int_varint32(cell d, int kl, int k)", }, -] -`; - -exports[`writeSerialization should write serializer for B 1`] = ` -[ { "code": { - "kind": "skip", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_set", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varint32", + "signature": "(int, int, int) __tact_dict_min_int_varint32(cell d, int kl)", }, { "code": { - "kind": "skip", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_nop", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varint32", + "signature": "(int, int, int) __tact_dict_next_int_varint32(cell d, int kl, int pivot)", }, { "code": { - "kind": "skip", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_str_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varint32", + "signature": "(cell, ()) __tact_dict_set_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "kind": "skip", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_slice_to_str", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "kind": "skip", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_address_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "slice raw = cs~load_msg_addr(); -return (cs, raw);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -4467,17 +4686,16 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address", - "signature": "(slice, slice) __tact_load_address(slice cs)", + "name": "__tact_dict_get_int_varuint16", + "signature": "int __tact_dict_get_int_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "if (cs.preload_uint(2) != 0) { - slice raw = cs~load_msg_addr(); - return (cs, raw); + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); } else { - cs~skip_bits(2); - return (cs, null()); + return (null(), null(), flag); }", "kind": "generic", }, @@ -4487,12 +4705,17 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address_opt", - "signature": "(slice, slice) __tact_load_address_opt(slice cs)", + "name": "__tact_dict_min_int_varuint16", + "signature": "(int, int, int) __tact_dict_min_int_varuint16(cell d, int kl)", }, { "code": { - "code": "return b.store_slice(address);", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -4501,39 +4724,36 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_store_address", - "signature": "builder __tact_store_address(builder b, slice address)", + "name": "__tact_dict_next_int_varuint16", + "signature": "(int, int, int) __tact_dict_next_int_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "if (null?(address)) { - b = b.store_uint(0, 2); - return b; + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); } else { - return __tact_store_address(b, address); + return (idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_store_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_store_address_opt", - "signature": "builder __tact_store_address_opt(builder b, slice address)", + "name": "__tact_dict_set_int_varuint16", + "signature": "(cell, ()) __tact_dict_set_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(2, 2); -b = b.store_uint(0, 1); -b = b.store_int(chain, 8); -b = b.store_uint(hash, 256); -var addr = b.end_cell().begin_parse(); -return addr;", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, @@ -4542,1342 +4762,1486 @@ return addr;", "flags": Set { "inline", }, - "name": "__tact_create_address", - "signature": "slice __tact_create_address(int chain, int hash)", + "name": "__tact_dict_replace_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(0, 2); -b = b.store_uint(3, 2); -b = b.store_uint(0, 1); -b = b.store_ref(code); -b = b.store_ref(data); -var hash = cell_hash(b.end_cell()); -return __tact_create_address(chain, hash);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_create_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_compute_contract_address", - "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + "name": "__tact_dict_replaceget_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "throw_if(128, null?(x)); return x;", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", "inline", }, - "name": "__tact_not_null", - "signature": "forall X -> X __tact_not_null(X x)", + "name": "__tact_dict_get_int_varuint32", + "signature": "int __tact_dict_get_int_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "DICTDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete", - "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varuint32", + "signature": "(int, int, int) __tact_dict_min_int_varuint32(cell d, int kl)", }, { "code": { - "code": "DICTIDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_int", - "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varuint32", + "signature": "(int, int, int) __tact_dict_next_int_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "DICTUDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_uint", - "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varuint32", + "signature": "(cell, ()) __tact_dict_set_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTSETREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_set_ref", - "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTREPLACEREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replace_ref", - "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTREPLACEGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replaceget_ref", - "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_slice", + "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", }, { "code": { - "code": "DICTGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = udict_get?(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get", - "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_uint", + "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", }, { "code": { - "code": "DICTDELGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = idict_get?(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_get", - "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_int", + "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", }, { "code": { - "code": "DICTDELGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +build_0 = build_0.store_int(v'a, 257); +build_0 = build_0.store_int(v'b, 257); +build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); +build_0 = build_0.store_int(v'd, 1); +build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); +var build_1 = begin_cell(); +build_1 = build_1.store_int(v'f, 257); +build_1 = build_1.store_int(v'g, 257); +build_0 = store_ref(build_0, build_1.end_cell()); +return build_0;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set {}, - "name": "__tact_dict_delete_get_ref", - "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", + "name": "$A$_store", + "signature": "builder $A$_store(builder build_0, (int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "return $A$_store(begin_cell(), v).end_cell();", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get_ref", - "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", + "context": "type:A", + "depends": Set { + "$A$_store", + }, + "flags": Set { + "inline", + }, + "name": "$A$_store_cell", + "signature": "cell $A$_store_cell((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTMIN NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min", - "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "$A$_get_a", + "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTMINREF NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min_ref", - "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "$A$_get_b", + "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "DICTGETNEXT NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(pivot dict key_len -> 1 0 2)", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_next", - "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", + "flags": Set { + "inline", + }, + "name": "$A$_get_c", + "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); -if (flag) { - return (key, value~load_ref(), flag); -} else { - return (null(), null(), flag); -}", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set { - "__tact_dict_next", + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_dict_next_ref", - "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + "name": "$A$_get_d", + "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug", - "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", + "name": "$A$_get_e", + "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_str", - "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", + "name": "$A$_get_f", + "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "if (value) { - __tact_debug_str("true", debug_print_1, debug_print_2); -} else { - __tact_debug_str("false", debug_print_1, debug_print_2); -}", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set { - "__tact_debug_str", - }, + "context": "type:A", + "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_bool", - "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", + "name": "$A$_get_g", + "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "SDSUBSTR", + "code": "NOP", "kind": "asm", "shuffle": "", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_preload_offset", - "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", + "flags": Set {}, + "name": "$A$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "slice new_data = begin_cell() - .store_slice(data) - .store_slice("0000"s) -.end_cell().begin_parse(); -int reg = 0; -while (~ new_data.slice_data_empty?()) { - int byte = new_data~load_uint(8); - int mask = 0x80; - while (mask > 0) { - reg <<= 1; - if (byte & mask) { - reg += 1; - } - mask >>= 1; - if (reg > 0xffff) { - reg &= 0xffff; - reg ^= 0x1021; - } - } -} -(int q, int r) = divmod(reg, 256); -return begin_cell() - .store_uint(q, 8) - .store_uint(r, 8) -.end_cell().begin_parse();", + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, "flags": Set { - "inline_ref", + "inline", }, - "name": "__tact_crc16", - "signature": "(slice) __tact_crc16(slice data)", + "name": "$A$_not_null", + "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", }, { "code": { - "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; -builder res = begin_cell(); - -while (data.slice_bits() >= 24) { - (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); - - int n = (bs1 << 16) | (bs2 << 8) | bs3; - - res = res - .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); -} - -return res.end_cell().begin_parse();", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set { - "__tact_preload_offset", + "__tact_tuple_create_7", }, - "flags": Set {}, - "name": "__tact_base64_encode", - "signature": "(slice) __tact_base64_encode(slice data)", + "flags": Set { + "inline", + }, + "name": "$A$_as_optional", + "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "(int wc, int hash) = address.parse_std_addr(); - -slice user_friendly_address = begin_cell() - .store_slice("11"s) - .store_uint((wc + 0x100) % 0x100, 8) - .store_uint(hash, 256) -.end_cell().begin_parse(); - -slice checksum = __tact_crc16(user_friendly_address); -slice user_friendly_address_with_checksum = begin_cell() - .store_slice(user_friendly_address) - .store_slice(checksum) -.end_cell().begin_parse(); - -return __tact_base64_encode(user_friendly_address_with_checksum);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set { - "__tact_crc16", - "__tact_base64_encode", + "__tact_tuple_create_7", }, - "flags": Set {}, - "name": "__tact_address_to_user_friendly", - "signature": "(slice) __tact_address_to_user_friendly(slice address)", + "flags": Set { + "inline", + }, + "name": "$A$_to_tuple", + "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", + "code": "if (null?(v)) { return null(); } +return $A$_to_tuple($A$_not_null(v)); ", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set { - "__tact_debug_str", - "__tact_address_to_user_friendly", + "$A$_to_tuple", + "$A$_not_null", }, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_address", - "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", + "name": "$A$_to_opt_tuple", + "signature": "tuple $A$_to_opt_tuple(tuple v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", - "kind": "asm", - "shuffle": "", + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_stack", - "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", + "name": "$A$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", }, { "code": { - "code": "return __tact_context;", + "code": "if (null?(v)) { return null(); } +return $A$_as_optional($A$_from_tuple(v));", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "$A$_as_optional", + "$A$_from_tuple", + }, "flags": Set { "inline", }, - "name": "__tact_context_get", - "signature": "(int, slice, int, slice) __tact_context_get()", + "name": "$A$_from_opt_tuple", + "signature": "tuple $A$_from_opt_tuple(tuple v)", }, { "code": { - "code": "return __tact_context_sender;", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_context_get_sender", - "signature": "slice __tact_context_get_sender()", + "name": "$A$_to_external", + "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "if (null?(__tact_randomized)) { - randomize_lt(); - __tact_randomized = true; + "code": "var loaded = $A$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); }", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "$A$_to_opt_tuple", + }, "flags": Set { - "impure", "inline", }, - "name": "__tact_prepare_random", - "signature": "() __tact_prepare_random()", + "name": "$A$_to_opt_external", + "signature": "tuple $A$_to_opt_external(tuple v)", }, { "code": { - "code": "return b.store_int(v, 1);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_store_bool", - "signature": "builder __tact_store_bool(builder b, int v)", + "name": "$B$_get_a", + "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, - "flags": Set {}, - "name": "__tact_to_tuple", - "signature": "forall X -> tuple __tact_to_tuple(X x)", - }, - { - "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "flags": Set { + "inline", }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_from_tuple", - "signature": "forall X -> X __tact_from_tuple(tuple x)", + "name": "$B$_get_b", + "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return equal_slices_bits(a, b);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits", - "signature": "int __tact_slice_eq_bits(slice a, slice b)", + "name": "$B$_get_c", + "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable_one", - "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", + "name": "$B$_get_d", + "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable", - "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", + "name": "$B$_get_e", + "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); -while (flag) { - (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); - ifnot (flag_b) { - return 0; - } - ifnot (value.slice_hash() == value_b.slice_hash()) { - return 0; - } - (key, value, flag) = __tact_dict_next(a, kl, key); -} -return null?(b);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set { - "__tact_dict_min", - "__tact_dict_delete_get", - "__tact_dict_next", - }, + "context": "type:B", + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_eq", - "signature": "int __tact_dict_eq(cell a, cell b, int kl)", + "name": "$B$_get_f", + "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a == b);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable_one", - "signature": "int __tact_int_eq_nullable_one(int a, int b)", + "name": "$B$_get_g", + "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a != b);", - "kind": "generic", + "code": "NOP", + "kind": "asm", + "shuffle": "", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_int_neq_nullable_one", - "signature": "int __tact_int_neq_nullable_one(int a, int b)", + "flags": Set {}, + "name": "$B$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable", - "signature": "int __tact_int_eq_nullable(int a, int b)", + "name": "$B$_not_null", + "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, "flags": Set { "inline", }, - "name": "__tact_int_neq_nullable", - "signature": "int __tact_int_neq_nullable(int a, int b)", + "name": "$B$_as_optional", + "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", }, { "code": { - "code": "return (a.cell_hash() == b.cell_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, "flags": Set { "inline", }, - "name": "__tact_cell_eq", - "signature": "int __tact_cell_eq(cell a, cell b)", + "name": "$B$_to_tuple", + "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "return (a.cell_hash() != b.cell_hash());", + "code": "if (null?(v)) { return null(); } +return $B$_to_tuple($B$_not_null(v)); ", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "$B$_to_tuple", + "$B$_not_null", + }, "flags": Set { "inline", }, - "name": "__tact_cell_neq", - "signature": "int __tact_cell_neq(cell a, cell b)", + "name": "$B$_to_opt_tuple", + "signature": "tuple $B$_to_opt_tuple(tuple v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable_one", - "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", + "name": "$B$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", + "code": "if (null?(v)) { return null(); } +return $B$_as_optional($B$_from_tuple(v));", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "$B$_as_optional", + "$B$_from_tuple", + }, "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable_one", - "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", + "name": "$B$_from_opt_tuple", + "signature": "tuple $B$_from_opt_tuple(tuple v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:B", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable", - "signature": "int __tact_cell_eq_nullable(cell a, cell b)", + "name": "$B$_to_external", + "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", + "code": "var loaded = $B$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:B", + "depends": Set { + "$B$_to_opt_tuple", + }, "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable", - "signature": "int __tact_cell_neq_nullable(cell a, cell b)", + "name": "$B$_to_opt_external", + "signature": "tuple $B$_to_opt_external(tuple v)", }, { "code": { - "code": "return (a.slice_hash() == b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'a;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq", - "signature": "int __tact_slice_eq(slice a, slice b)", + "name": "$C$_get_a", + "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return (a.slice_hash() != b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'b;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_neq", - "signature": "int __tact_slice_neq(slice a, slice b)", + "name": "$C$_get_b", + "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'c;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable_one", - "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", + "name": "$C$_get_c", + "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'd;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable_one", - "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", + "name": "$C$_get_d", + "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'e;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable", - "signature": "int __tact_slice_eq_nullable(slice a, slice b)", + "name": "$C$_get_e", + "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'f;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable", - "signature": "int __tact_slice_neq_nullable(slice a, slice b)", + "name": "$C$_get_f", + "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return udict_set_ref(dict, 16, id, code);", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'g;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_code", - "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", + "name": "$C$_get_g", + "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "var (data, ok) = udict_get_ref?(dict, 16, id); -throw_unless(135, ok); -return data;", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'h;", "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_code", - "signature": "cell __tact_dict_get_code(cell dict, int id)", + "name": "$C$_get_h", + "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "NIL", + "code": "NOP", "kind": "asm", "shuffle": "", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_0", - "signature": "tuple __tact_tuple_create_0()", + "name": "$C$_tensor_cast", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "return ();", + "code": "throw_if(128, null?(v)); +var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, "flags": Set { "inline", }, - "name": "__tact_tuple_destroy_0", - "signature": "() __tact_tuple_destroy_0()", + "name": "$C$_not_null", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", }, { "code": { - "code": "1 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_1", - "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_as_optional", + "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", }, { "code": { - "code": "1 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_1", - "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_tuple", + "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", }, { "code": { - "code": "2 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { return null(); } +return $C$_to_tuple($C$_not_null(v)); ", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_2", - "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", + "context": "type:C", + "depends": Set { + "$C$_to_tuple", + "$C$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_tuple", + "signature": "tuple $C$_to_opt_tuple(tuple v)", }, { "code": { - "code": "2 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_2", - "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_tuple", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", }, { "code": { - "code": "3 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { return null(); } +return $C$_as_optional($C$_from_tuple(v));", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_3", - "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", + "context": "type:C", + "depends": Set { + "$C$_as_optional", + "$C$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_opt_tuple", + "signature": "tuple $C$_from_opt_tuple(tuple v)", }, { "code": { - "code": "3 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:C", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_3", - "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", + "flags": Set { + "inline", + }, + "name": "$C$_to_external", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", }, { "code": { - "code": "4 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var loaded = $C$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_4", - "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", + "context": "type:C", + "depends": Set { + "$C$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_external", + "signature": "tuple $C$_to_opt_external(tuple v)", }, { "code": { - "code": "4 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var v'a = sc_0~load_int(257); +var v'b = sc_0~load_int(257); +var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); +var v'd = sc_0~load_int(1); +var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); +slice sc_1 = sc_0~load_ref().begin_parse(); +var v'f = sc_1~load_int(257); +var v'g = sc_1~load_int(257); +return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "kind": "generic", }, "comment": null, - "context": "stdlib", + "context": "type:A", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_4", - "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", + "name": "$A$_load", + "signature": "(slice, ((int, int, int, int, int, int, int))) $A$_load(slice sc_0)", }, { "code": { - "code": "5 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var r = sc_0~$A$_load(); +sc_0.end_parse(); +return r;", + "kind": "generic", }, "comment": null, - "context": "stdlib", - "depends": Set {}, + "context": "type:A", + "depends": Set { + "$A$_load", + }, "flags": Set {}, - "name": "__tact_tuple_create_5", - "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", + "name": "$A$_load_not_mut", + "signature": "((int, int, int, int, int, int, int)) $A$_load_not_mut(slice sc_0)", }, +] +`; + +exports[`writeSerialization should write serializer for B 1`] = ` +[ { "code": { - "code": "5 UNTUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_5", - "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", + "name": "__tact_set", + "signature": "", }, { "code": { - "code": "6 TUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", + "name": "__tact_nop", + "signature": "", }, { "code": { - "code": "6 UNTUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", + "name": "__tact_str_to_slice", + "signature": "", }, { "code": { - "code": "7 TUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", + "name": "__tact_slice_to_str", + "signature": "", }, { "code": { - "code": "7 UNTUPLE", - "kind": "asm", - "shuffle": "", + "kind": "skip", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", + "name": "__tact_address_to_slice", + "signature": "", }, { "code": { - "code": "8 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "slice raw = cs~load_msg_addr(); +return (cs, raw);", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", + "flags": Set { + "inline", + }, + "name": "__tact_load_address", + "signature": "(slice, slice) __tact_load_address(slice cs)", }, { "code": { - "code": "8 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (cs.preload_uint(2) != 0) { + slice raw = cs~load_msg_addr(); + return (cs, raw); +} else { + cs~skip_bits(2); + return (cs, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_load_address_opt", + "signature": "(slice, slice) __tact_load_address_opt(slice cs)", }, { "code": { - "code": "9 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "return b.store_slice(address);", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", + "flags": Set { + "inline", + }, + "name": "__tact_store_address", + "signature": "builder __tact_store_address(builder b, slice address)", }, { "code": { - "code": "9 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(address)) { + b = b.store_uint(0, 2); + return b; +} else { + return __tact_store_address(b, address); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", + "depends": Set { + "__tact_store_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_store_address_opt", + "signature": "builder __tact_store_address_opt(builder b, slice address)", }, { "code": { - "code": "10 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var b = begin_cell(); +b = b.store_uint(2, 2); +b = b.store_uint(0, 1); +b = b.store_int(chain, 8); +b = b.store_uint(hash, 256); +var addr = b.end_cell().begin_parse(); +return addr;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", + "flags": Set { + "inline", + }, + "name": "__tact_create_address", + "signature": "slice __tact_create_address(int chain, int hash)", }, { "code": { - "code": "10 UNTUPLE", + "code": "var b = begin_cell(); +b = b.store_uint(0, 2); +b = b.store_uint(3, 2); +b = b.store_uint(0, 1); +b = b.store_ref(code); +b = b.store_ref(data); +var hash = cell_hash(b.end_cell()); +return __tact_create_address(chain, hash);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_create_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_compute_contract_address", + "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + }, + { + "code": { + "code": "throw_if(128, null?(x)); return x;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + "inline", + }, + "name": "__tact_not_null", + "signature": "forall X -> X __tact_not_null(X x)", + }, + { + "code": { + "code": "DICTDEL", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", + "name": "__tact_dict_delete", + "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", }, { "code": { - "code": "11 TUPLE", + "code": "DICTIDEL", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", + "name": "__tact_dict_delete_int", + "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", }, { "code": { - "code": "11 UNTUPLE", + "code": "DICTUDEL", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", + "name": "__tact_dict_delete_uint", + "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", }, { "code": { - "code": "12 TUPLE", + "code": "DICTSETREF", "kind": "asm", - "shuffle": "", + "shuffle": "(value index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", + "name": "__tact_dict_set_ref", + "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", }, { "code": { - "code": "12 UNTUPLE", + "code": "DICTREPLACEREF", "kind": "asm", - "shuffle": "", + "shuffle": "(value index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", + "name": "__tact_dict_replace_ref", + "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", }, { "code": { - "code": "13 TUPLE", + "code": "DICTREPLACEGETREF NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(value index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_13", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", + "name": "__tact_dict_replaceget_ref", + "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", }, { "code": { - "code": "13 UNTUPLE", + "code": "DICTGET NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_13", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __tact_tuple_destroy_13(tuple v)", + "name": "__tact_dict_get", + "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", }, { "code": { - "code": "14 TUPLE", + "code": "DICTDELGET NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", + "name": "__tact_dict_delete_get", + "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", }, { "code": { - "code": "14 UNTUPLE", + "code": "DICTDELGETREF NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", + "name": "__tact_dict_delete_get_ref", + "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", }, { "code": { - "code": "15 TUPLE", + "code": "DICTGETREF NULLSWAPIFNOT", "kind": "asm", - "shuffle": "", + "shuffle": "(index dict key_len)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_create_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", + "name": "__tact_dict_get_ref", + "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", }, { "code": { - "code": "15 UNTUPLE", + "code": "DICTMIN NULLSWAPIFNOT2", "kind": "asm", - "shuffle": "", + "shuffle": "(dict key_len -> 1 0 2)", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", + "name": "__tact_dict_min", + "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", }, { "code": { - "code": "return tpush(tpush(empty_tuple(), b), null());", - "kind": "generic", + "code": "DICTMINREF NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(dict key_len -> 1 0 2)", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", + "flags": Set {}, + "name": "__tact_dict_min_ref", + "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + }, + { + "code": { + "code": "DICTGETNEXT NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(pivot dict key_len -> 1 0 2)", }, - "name": "__tact_string_builder_start", - "signature": "tuple __tact_string_builder_start(builder b)", + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_next", + "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", + "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_string_builder_start", + "__tact_dict_next", + }, + "flags": Set {}, + "name": "__tact_dict_next_ref", + "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", + "kind": "asm", + "shuffle": "", }, + "comment": null, + "context": "stdlib", + "depends": Set {}, "flags": Set { - "inline", + "impure", }, - "name": "__tact_string_builder_start_comment", - "signature": "tuple __tact_string_builder_start_comment()", + "name": "__tact_debug", + "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", - "kind": "generic", + "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { - "inline", + "impure", }, - "name": "__tact_string_builder_start_tail_string", - "signature": "tuple __tact_string_builder_start_tail_string()", + "name": "__tact_debug_str", + "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell());", + "code": "if (value) { + __tact_debug_str("true", debug_print_1, debug_print_2); +} else { + __tact_debug_str("false", debug_print_1, debug_print_2); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_string_builder_start", + "__tact_debug_str", }, "flags": Set { - "inline", + "impure", }, - "name": "__tact_string_builder_start_string", - "signature": "tuple __tact_string_builder_start_string()", + "name": "__tact_debug_bool", + "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "(builder b, tuple tail) = uncons(builders); -cell c = b.end_cell(); -while(~ null?(tail)) { - (b, tail) = uncons(tail); - c = b.store_ref(c).end_cell(); -} -return c;", - "kind": "generic", + "code": "SDSUBSTR", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", @@ -5885,222 +6249,140 @@ return c;", "flags": Set { "inline", }, - "name": "__tact_string_builder_end", - "signature": "cell __tact_string_builder_end(tuple builders)", + "name": "__tact_preload_offset", + "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", }, { "code": { - "code": "return __tact_string_builder_end(builders).begin_parse();", + "code": "slice new_data = begin_cell() + .store_slice(data) + .store_slice("0000"s) +.end_cell().begin_parse(); +int reg = 0; +while (~ new_data.slice_data_empty?()) { + int byte = new_data~load_uint(8); + int mask = 0x80; + while (mask > 0) { + reg <<= 1; + if (byte & mask) { + reg += 1; + } + mask >>= 1; + if (reg > 0xffff) { + reg &= 0xffff; + reg ^= 0x1021; + } + } +} +(int q, int r) = divmod(reg, 256); +return begin_cell() + .store_uint(q, 8) + .store_uint(r, 8) +.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_end", - }, + "depends": Set {}, "flags": Set { - "inline", + "inline_ref", }, - "name": "__tact_string_builder_end_slice", - "signature": "slice __tact_string_builder_end_slice(tuple builders)", + "name": "__tact_crc16", + "signature": "(slice) __tact_crc16(slice data)", }, { "code": { - "code": "int sliceRefs = slice_refs(sc); -int sliceBits = slice_bits(sc); - -while((sliceBits > 0) | (sliceRefs > 0)) { - - ;; Load the current builder - (builder b, tuple tail) = uncons(builders); - int remBytes = 127 - (builder_bits(b) / 8); - int exBytes = sliceBits / 8; + "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; +builder res = begin_cell(); - ;; Append bits - int amount = min(remBytes, exBytes); - if (amount > 0) { - slice read = sc~load_bits(amount * 8); - b = b.store_slice(read); - } +while (data.slice_bits() >= 24) { + (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); - ;; Update builders - builders = cons(b, tail); + int n = (bs1 << 16) | (bs2 << 8) | bs3; - ;; Check if we need to add a new cell and continue - if (exBytes - amount > 0) { - var bb = begin_cell(); - builders = cons(bb, builders); - sliceBits = (exBytes - amount) * 8; - } elseif (sliceRefs > 0) { - sc = sc~load_ref().begin_parse(); - sliceRefs = slice_refs(sc); - sliceBits = slice_bits(sc); - } else { - sliceBits = 0; - sliceRefs = 0; - } + res = res + .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); } -return ((builders), ());", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_string_builder_append", - "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", - }, - { - "code": { - "code": "builders~__tact_string_builder_append(sc); -return builders;", +return res.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_string_builder_append", + "__tact_preload_offset", }, "flags": Set {}, - "name": "__tact_string_builder_append_not_mut", - "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + "name": "__tact_base64_encode", + "signature": "(slice) __tact_base64_encode(slice data)", }, { "code": { - "code": "var b = begin_cell(); -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} + "code": "(int wc, int hash) = address.parse_std_addr(); -if (src < 1000000000000000000000000000000) { - int len = 0; - int value = 0; - int mult = 1; - do { - (src, int res) = src.divmod(10); - value = value + (res + 48) * mult; - mult = mult * 256; - len = len + 1; - } until (src == 0); +slice user_friendly_address = begin_cell() + .store_slice("11"s) + .store_uint((wc + 0x100) % 0x100, 8) + .store_uint(hash, 256) +.end_cell().begin_parse(); - b = b.store_uint(value, len * 8); -} else { - tuple t = empty_tuple(); - int len = 0; - do { - int digit = src % 10; - t~tpush(digit); - len = len + 1; - src = src / 10; - } until (src == 0); +slice checksum = __tact_crc16(user_friendly_address); +slice user_friendly_address_with_checksum = begin_cell() + .store_slice(user_friendly_address) + .store_slice(checksum) +.end_cell().begin_parse(); - int c = len - 1; - repeat(len) { - int v = t.at(c); - b = b.store_uint(v + 48, 8); - c = c - 1; - } -} -return b.end_cell().begin_parse();", +return __tact_base64_encode(user_friendly_address_with_checksum);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_crc16", + "__tact_base64_encode", + }, "flags": Set {}, - "name": "__tact_int_to_string", - "signature": "slice __tact_int_to_string(int src)", + "name": "__tact_address_to_user_friendly", + "signature": "(slice) __tact_address_to_user_friendly(slice address)", }, { "code": { - "code": "throw_if(134, (digits <= 0) | (digits > 77)); -builder b = begin_cell(); - -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} - -;; Process rem part -int skip = true; -int len = 0; -int rem = 0; -tuple t = empty_tuple(); -repeat(digits) { - (src, rem) = src.divmod(10); - if ( ~ ( skip & ( rem == 0 ) ) ) { - skip = false; - t~tpush(rem + 48); - len = len + 1; - } -} - -;; Process dot -if (~ skip) { - t~tpush(46); - len = len + 1; -} - -;; Main -do { - (src, rem) = src.divmod(10); - t~tpush(rem + 48); - len = len + 1; -} until (src == 0); - -;; Assemble -int c = len - 1; -repeat(len) { - int v = t.at(c); - b = b.store_uint(v, 8); - c = c - 1; -} - -;; Result -return b.end_cell().begin_parse();", + "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_float_to_string", - "signature": "slice __tact_float_to_string(int src, int digits)", + "depends": Set { + "__tact_debug_str", + "__tact_address_to_user_friendly", + }, + "flags": Set { + "impure", + }, + "name": "__tact_debug_address", + "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "throw_unless(5, num > 0); -throw_unless(5, base > 1); -if (num < base) { - return 0; -} -int result = 0; -while (num >= base) { - num /= base; - result += 1; -} -return result;", - "kind": "generic", + "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "inline", + "impure", }, - "name": "__tact_log", - "signature": "int __tact_log(int num, int base)", + "name": "__tact_debug_stack", + "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", }, { "code": { - "code": "throw_unless(5, exp >= 0); -int result = 1; -repeat (exp) { - result *= base; -} -return result;", + "code": "return __tact_context;", "kind": "generic", }, "comment": null, @@ -6109,1196 +6391,840 @@ return result;", "flags": Set { "inline", }, - "name": "__tact_pow", - "signature": "int __tact_pow(int base, int exp)", + "name": "__tact_context_get", + "signature": "(int, slice, int, slice) __tact_context_get()", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", + "code": "return __tact_context_sender;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_slice", - "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", + "name": "__tact_context_get_sender", + "signature": "slice __tact_context_get_sender()", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); + "code": "if (null?(__tact_randomized)) { + randomize_lt(); + __tact_randomized = true; }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { + "impure", "inline", }, - "name": "__tact_dict_min_slice_slice", - "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", + "name": "__tact_prepare_random", + "signature": "() __tact_prepare_random()", }, { "code": { - "code": "return __tact_dict_next(d, kl, pivot);", + "code": "return b.store_int(v, 1);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_slice", - "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", + "name": "__tact_store_bool", + "signature": "builder __tact_store_bool(builder b, int v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); -}", - "kind": "generic", + "code": "NOP", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_slice_slice", - "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_to_tuple", + "signature": "forall X -> tuple __tact_to_tuple(X x)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); -}", - "kind": "generic", + "code": "NOP", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_slice_slice", - "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_from_tuple", + "signature": "forall X -> X __tact_from_tuple(tuple x)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", + "code": "return equal_slices_bits(a, b);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_slice_eq_bits", + "signature": "int __tact_slice_eq_bits(slice a, slice b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r~load_int(vl); -} else { - return null(); -}", + "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_int", - "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", + "name": "__tact_slice_eq_bits_nullable_one", + "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_int", - "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", + "name": "__tact_slice_eq_bits_nullable", + "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); +while (flag) { + (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); + ifnot (flag_b) { + return 0; + } + ifnot (value.slice_hash() == value_b.slice_hash()) { + return 0; + } + (key, value, flag) = __tact_dict_next(a, kl, key); +} +return null?(b);", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { + "__tact_dict_min", + "__tact_dict_delete_get", "__tact_dict_next", }, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_int", - "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_eq", + "signature": "int __tact_dict_eq(cell a, cell b, int kl)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); -}", + "code": "return (null?(a)) ? (false) : (a == b);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_int", - "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_int_eq_nullable_one", + "signature": "int __tact_int_eq_nullable_one(int a, int b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); -}", + "code": "return (null?(a)) ? (true) : (a != b);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_int", - "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_int_neq_nullable_one", + "signature": "int __tact_int_neq_nullable_one(int a, int b)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_int(vl)); -} else { - return (d, null()); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_int", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_int_eq_nullable", + "signature": "int __tact_int_eq_nullable(int a, int b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r~load_uint(vl); -} else { - return null(); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_uint", - "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", + "name": "__tact_int_neq_nullable", + "signature": "int __tact_int_neq_nullable(int a, int b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.cell_hash() == b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_uint", - "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", + "name": "__tact_cell_eq", + "signature": "int __tact_cell_eq(cell a, cell b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.cell_hash() != b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_uint", - "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + "name": "__tact_cell_neq", + "signature": "int __tact_cell_neq(cell a, cell b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); -}", + "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_uint", - "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_cell_eq_nullable_one", + "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); -}", + "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_uint", - "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_cell_neq_nullable_one", + "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_uint(vl)); -} else { - return (d, null()); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_cell_eq_nullable", + "signature": "int __tact_cell_eq_nullable(cell a, cell b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_cell", - "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + "name": "__tact_cell_neq_nullable", + "signature": "int __tact_cell_neq_nullable(cell a, cell b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.slice_hash() == b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_cell", - "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + "name": "__tact_slice_eq", + "signature": "int __tact_slice_eq(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_ref(), flag); -} else { - return (null(), null(), flag); -}", + "code": "return (a.slice_hash() != b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_cell", - "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + "name": "__tact_slice_neq", + "signature": "int __tact_slice_neq(slice a, slice b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return __tact_dict_set_ref(d, kl, k, v); -}", + "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_set_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_cell", - "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_slice_eq_nullable_one", + "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return __tact_dict_replace_ref(d, kl, k, v); -}", + "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_replace_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_cell", - "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_slice_neq_nullable_one", + "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get_ref", - "__tact_dict_replaceget_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_slice_eq_nullable", + "signature": "int __tact_slice_eq_nullable(slice a, slice b)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -if (ok) { - return r~load_coins(); -} else { - return null(); -}", + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_coins", - "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + "name": "__tact_slice_neq_nullable", + "signature": "int __tact_slice_neq_nullable(slice a, slice b)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", + "code": "return udict_set_ref(dict, 16, id, code);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_coins", - "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + "name": "__tact_dict_set_code", + "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", + "code": "var (data, ok) = udict_get_ref?(dict, 16, id); +throw_unless(135, ok); +return data;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_coins", - "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + "name": "__tact_dict_get_code", + "signature": "cell __tact_dict_get_code(cell dict, int id)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, ()); -} else { - return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); -}", - "kind": "generic", + "code": "NIL", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_slice_coins", - "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_0", + "signature": "tuple __tact_tuple_create_0()", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); - return (r, (ok)); -} else { - return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); -}", + "code": "return ();", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_coins", - "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_tuple_destroy_0", + "signature": "() __tact_tuple_destroy_0()", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); -if (ok) { - return (d, old~load_coins()); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "1 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_slice_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_1", + "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", - "kind": "generic", + "code": "1 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_slice", - "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + "flags": Set {}, + "name": "__tact_tuple_destroy_1", + "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "2 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_slice", - "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", + "flags": Set {}, + "name": "__tact_tuple_create_2", + "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "2 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_slice", - "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", + "flags": Set {}, + "name": "__tact_tuple_destroy_2", + "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set(d, kl, k, v), ()); -}", - "kind": "generic", + "code": "3 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_slice", - "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_tuple_create_3", + "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace?(d, kl, k, v); -}", - "kind": "generic", + "code": "3 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_slice", - "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_tuple_destroy_3", + "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "4 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_tuple_create_4", + "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r~load_int(vl); -} else { - return null(); -}", - "kind": "generic", + "code": "4 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_int", - "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_4", + "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "5 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_int", - "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_5", + "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "5 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_int", - "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_5", + "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); -}", - "kind": "generic", + "code": "6 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_int", - "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); -}", - "kind": "generic", + "code": "6 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_int", - "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_int(vl)); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "7 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_int", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r~load_uint(vl); -} else { - return null(); -}", - "kind": "generic", + "code": "7 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_uint", - "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "8 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_uint", - "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "8 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_uint", - "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); -}", - "kind": "generic", + "code": "9 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_uint", - "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); -}", - "kind": "generic", + "code": "9 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_destroy_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_uint(vl)); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "10 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "flags": Set {}, + "name": "__tact_tuple_create_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", - "kind": "generic", + "code": "10 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "flags": Set {}, + "name": "__tact_tuple_destroy_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "11 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "flags": Set {}, + "name": "__tact_tuple_create_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_ref(), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "11 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "flags": Set {}, + "name": "__tact_tuple_destroy_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_ref(d, kl, k, v), ()); -}", - "kind": "generic", + "code": "12 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "flags": Set {}, + "name": "__tact_tuple_create_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_ref?(d, kl, k, v); -}", - "kind": "generic", + "code": "12 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "flags": Set {}, + "name": "__tact_tuple_destroy_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", - "kind": "generic", + "code": "13 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "flags": Set {}, + "name": "__tact_tuple_create_13", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -if (ok) { - return r~load_coins(); -} else { - return null(); -}", - "kind": "generic", + "code": "13 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_get_uint_coins", - "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + "flags": Set {}, + "name": "__tact_tuple_destroy_13", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __tact_tuple_destroy_13(tuple v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "14 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_uint_coins", - "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + "flags": Set {}, + "name": "__tact_tuple_create_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_coins(), flag); -} else { - return (null(), null(), flag); -}", - "kind": "generic", + "code": "14 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_uint_coins", - "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + "flags": Set {}, + "name": "__tact_tuple_destroy_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, ()); -} else { - return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); -}", - "kind": "generic", + "code": "15 TUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_set_uint_coins", - "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + "flags": Set {}, + "name": "__tact_tuple_create_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); - return (r, (ok)); -} else { - return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); -}", - "kind": "generic", + "code": "15 UNTUPLE", + "kind": "asm", + "shuffle": "", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replace_uint_coins", - "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + "flags": Set {}, + "name": "__tact_tuple_destroy_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); -if (ok) { - return (d, old~load_coins()); -} else { - return (d, null()); -}", + "code": "return tpush(tpush(empty_tuple(), b), null());", "kind": "generic", }, "comment": null, @@ -7307,74 +7233,66 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_string_builder_start", + "signature": "tuple __tact_string_builder_start(builder b)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -if (ok) { - return r; -} else { - return null(); -}", + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_start", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_slice", - "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", + "name": "__tact_string_builder_start_comment", + "signature": "tuple __tact_string_builder_start_comment()", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_start", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_slice", - "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", + "name": "__tact_string_builder_start_tail_string", + "signature": "tuple __tact_string_builder_start_tail_string()", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); -if (flag) { - return (key, value, flag); -} else { - return (null(), null(), flag); -}", + "code": "return __tact_string_builder_start(begin_cell());", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_start", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_slice", - "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", + "name": "__tact_string_builder_start_string", + "signature": "tuple __tact_string_builder_start_string()", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, ()); -} else { - return (idict_set(d, kl, k, v), ()); -}", + "code": "(builder b, tuple tail) = uncons(builders); +cell c = b.end_cell(); +while(~ null?(tail)) { + (b, tail) = uncons(tail); + c = b.store_ref(c).end_cell(); +} +return c;", "kind": "generic", }, "comment": null, @@ -7383,112 +7301,203 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_slice", - "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_string_builder_end", + "signature": "cell __tact_string_builder_end(tuple builders)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, (ok)); -} else { - return idict_replace?(d, kl, k, v); -}", + "code": "return __tact_string_builder_end(builders).begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_string_builder_end", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_slice", - "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_string_builder_end_slice", + "signature": "slice __tact_string_builder_end_slice(tuple builders)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); -if (ok) { - return (d, old); -} else { - return (d, null()); -}", + "code": "int sliceRefs = slice_refs(sc); +int sliceBits = slice_bits(sc); + +while((sliceBits > 0) | (sliceRefs > 0)) { + + ;; Load the current builder + (builder b, tuple tail) = uncons(builders); + int remBytes = 127 - (builder_bits(b) / 8); + int exBytes = sliceBits / 8; + + ;; Append bits + int amount = min(remBytes, exBytes); + if (amount > 0) { + slice read = sc~load_bits(amount * 8); + b = b.store_slice(read); + } + + ;; Update builders + builders = cons(b, tail); + + ;; Check if we need to add a new cell and continue + if (exBytes - amount > 0) { + var bb = begin_cell(); + builders = cons(bb, builders); + sliceBits = (exBytes - amount) * 8; + } elseif (sliceRefs > 0) { + sc = sc~load_ref().begin_parse(); + sliceRefs = slice_refs(sc); + sliceBits = slice_bits(sc); + } else { + sliceBits = 0; + sliceRefs = 0; + } +} + +return ((builders), ());", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_int_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", + "flags": Set {}, + "name": "__tact_string_builder_append", + "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -if (ok) { - return r~load_int(vl); -} else { - return null(); -}", + "code": "builders~__tact_string_builder_append(sc); +return builders;", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, - "flags": Set { - "inline", + "depends": Set { + "__tact_string_builder_append", }, - "name": "__tact_dict_get_int_int", - "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); -if (flag) { - return (key, value~load_int(vl), flag); + "code": "var b = begin_cell(); +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +if (src < 1000000000000000000000000000000) { + int len = 0; + int value = 0; + int mult = 1; + do { + (src, int res) = src.divmod(10); + value = value + (res + 48) * mult; + mult = mult * 256; + len = len + 1; + } until (src == 0); + + b = b.store_uint(value, len * 8); } else { - return (null(), null(), flag); -}", + tuple t = empty_tuple(); + int len = 0; + do { + int digit = src % 10; + t~tpush(digit); + len = len + 1; + src = src / 10; + } until (src == 0); + + int c = len - 1; + repeat(len) { + int v = t.at(c); + b = b.store_uint(v + 48, 8); + c = c - 1; + } +} +return b.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_min_int_int", - "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", + "flags": Set {}, + "name": "__tact_int_to_string", + "signature": "slice __tact_int_to_string(int src)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_int(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "throw_if(134, (digits <= 0) | (digits > 77)); +builder b = begin_cell(); + +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +;; Process rem part +int skip = true; +int len = 0; +int rem = 0; +tuple t = empty_tuple(); +repeat(digits) { + (src, rem) = src.divmod(10); + if ( ~ ( skip & ( rem == 0 ) ) ) { + skip = false; + t~tpush(rem + 48); + len = len + 1; + } +} + +;; Process dot +if (~ skip) { + t~tpush(46); + len = len + 1; +} + +;; Main +do { + (src, rem) = src.divmod(10); + t~tpush(rem + 48); + len = len + 1; +} until (src == 0); + +;; Assemble +int c = len - 1; +repeat(len) { + int v = t.at(c); + b = b.store_uint(v, 8); + c = c - 1; +} + +;; Result +return b.end_cell().begin_parse();", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_next_int_int", - "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", + "flags": Set {}, + "name": "__tact_float_to_string", + "signature": "slice __tact_float_to_string(int src, int digits)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, ()); -} else { - return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); -}", + "code": "throw_unless(5, num > 0); +throw_unless(5, base > 1); +if (num < base) { + return 0; +} +int result = 0; +while (num >= base) { + num /= base; + result += 1; +} +return result;", "kind": "generic", }, "comment": null, @@ -7497,17 +7506,17 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_int", - "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_log", + "signature": "int __tact_log(int num, int base)", }, { "code": { - "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); - return (r, (ok)); -} else { - return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); -}", + "code": "throw_unless(5, exp >= 0); +int result = 1; +repeat (exp) { + result *= base; +} +return result;", "kind": "generic", }, "comment": null, @@ -7516,33 +7525,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_int", - "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", - }, - { - "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); -if (ok) { - return (d, old~load_int(vl)); -} else { - return (d, null()); -}", - "kind": "generic", - }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set { - "inline", - }, - "name": "__tact_dict_replaceget_int_int", - "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_pow", + "signature": "int __tact_pow(int base, int exp)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_uint(vl); + return r; } else { return null(); }", @@ -7550,18 +7540,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_uint", - "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_slice_slice", + "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -7569,75 +7561,78 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_uint", - "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_slice_slice", + "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); -if (flag) { - return (key, value~load_uint(vl), flag); -} else { - return (null(), null(), flag); -}", + "code": "return __tact_dict_next(d, kl, pivot);", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_uint", - "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_slice_slice", + "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_int_uint", - "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_slice_slice", + "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_slice_slice", + "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old); } else { return (d, null()); }", @@ -7645,18 +7640,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_slice_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r; + return r~load_int(vl); } else { return null(); }", @@ -7664,18 +7661,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_int", + "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -7683,18 +7682,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_slice_int", + "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -7702,56 +7703,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_int", + "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_slice_int", + "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_slice_int", + "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_int(vl)); } else { return (d, null()); }", @@ -7759,18 +7766,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_slice_int", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_uint(vl); } else { return null(); }", @@ -7778,18 +7787,20 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_get_int_coins", - "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_slice_uint", + "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min?(d, kl); + "code": "var (key, value, flag) = __tact_dict_min(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -7797,18 +7808,20 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "__tact_dict_min_int_coins", - "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + "name": "__tact_dict_min_slice_uint", + "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -7816,56 +7829,62 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_next_int_coins", - "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_slice_uint", + "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_set_int_coins", - "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_slice_uint", + "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = idict_delete?(d, kl, k); + var (r, ok) = __tact_dict_delete(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_coins", - "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_slice_uint", + "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_uint(vl)); } else { return (d, null()); }", @@ -7873,990 +7892,1200 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_slice_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); -return ok;", + "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set { - "__tact_dict_get", + "__tact_dict_get_ref", }, "flags": Set { "inline", }, - "name": "__tact_dict_exists_slice", - "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", + "name": "__tact_dict_get_slice_cell", + "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_min_ref", + }, "flags": Set { "inline", }, - "name": "__tact_dict_exists_uint", - "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", + "name": "__tact_dict_min_slice_cell", + "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", }, { "code": { - "code": "var (r, ok) = idict_get?(d, kl, k); -return ok;", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set {}, + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "__tact_dict_exists_int", - "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", - }, - { - "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -build_0 = build_0.store_int(v'a, 257); -build_0 = build_0.store_int(v'b, 257); -build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); -build_0 = build_0.store_int(v'd, 1); -build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); -var build_1 = begin_cell(); -build_1 = build_1.store_int(v'f, 257); -build_1 = build_1.store_int(v'g, 257); -build_0 = store_ref(build_0, build_1.end_cell()); -return build_0;", - "kind": "generic", - }, - "comment": null, - "context": "type:B", - "depends": Set {}, - "flags": Set {}, - "name": "$B$_store", - "signature": "builder $B$_store(builder build_0, (int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_slice_cell", + "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", }, { "code": { - "code": "return $B$_store(begin_cell(), v).end_cell();", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return __tact_dict_set_ref(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_store", + "__tact_dict_delete", + "__tact_dict_set_ref", }, "flags": Set { "inline", }, - "name": "$B$_store_cell", - "signature": "cell $B$_store_cell((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_slice_cell", + "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return __tact_dict_replace_ref(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + "__tact_dict_replace_ref", + }, "flags": Set { "inline", }, - "name": "$A$_get_a", - "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_cell", + "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get_ref", + "__tact_dict_replaceget_ref", + }, "flags": Set { "inline", }, - "name": "$A$_get_b", - "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_slice_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "$A$_get_c", - "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "$A$_get_d", - "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "$A$_get_e", - "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$A$_get_f", - "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$A$_get_g", - "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", - }, - { - "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", - }, - "comment": null, - "context": "type:A", - "depends": Set {}, - "flags": Set {}, - "name": "$A$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_delete_get", }, "flags": Set { "inline", }, - "name": "$A$_not_null", - "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "$A$_as_optional", - "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_slice_varint16", + "signature": "int __tact_dict_get_slice_varint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_min", }, "flags": Set { "inline", }, - "name": "$A$_to_tuple", - "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_min_slice_varint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varint16(cell d, int kl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_to_tuple($A$_not_null(v)); ", - "kind": "generic", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "$A$_to_tuple", - "$A$_not_null", + "__tact_dict_next", }, "flags": Set { "inline", }, - "name": "$A$_to_opt_tuple", - "signature": "tuple $A$_to_opt_tuple(tuple v)", + "name": "__tact_dict_next_slice_varint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varint16(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$A$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", + "name": "__tact_dict_set_slice_varint16", + "signature": "(cell, ()) __tact_dict_set_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $A$_as_optional($A$_from_tuple(v));", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "$A$_as_optional", - "$A$_from_tuple", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$A$_from_opt_tuple", - "signature": "tuple $A$_from_opt_tuple(tuple v)", + "name": "__tact_dict_replace_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:A", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "$A$_to_external", - "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_replaceget_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var loaded = $A$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint32(); } else { - return (loaded); + return null(); }", "kind": "generic", }, "comment": null, - "context": "type:A", + "context": "stdlib", "depends": Set { - "$A$_to_opt_tuple", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "$A$_to_opt_external", - "signature": "tuple $A$_to_opt_external(tuple v)", + "name": "__tact_dict_get_slice_varint32", + "signature": "int __tact_dict_get_slice_varint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'a;", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "$B$_get_a", - "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_slice_varint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varint32(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'b;", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, "flags": Set { "inline", }, - "name": "$B$_get_b", - "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_next_slice_varint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varint32(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'c;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$B$_get_c", - "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_set_slice_varint32", + "signature": "(cell, ()) __tact_dict_set_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'd;", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$B$_get_d", - "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'e;", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "$B$_get_e", - "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replaceget_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'f;", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, "flags": Set { "inline", }, - "name": "$B$_get_f", - "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_get_slice_varuint16", + "signature": "int __tact_dict_get_slice_varuint16(cell d, int kl, slice k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return v'g;", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, "flags": Set { "inline", }, - "name": "$B$_get_g", - "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_min_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint16(cell d, int kl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, - "flags": Set {}, - "name": "$B$_tensor_cast", - "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint16(cell d, int kl, slice pivot)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$B$_not_null", - "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", + "name": "__tact_dict_set_slice_varuint16", + "signature": "(cell, ()) __tact_dict_set_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$B$_as_optional", - "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", + "name": "__tact_dict_replace_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_create_7", + "__tact_dict_delete_get", }, "flags": Set { "inline", }, - "name": "$B$_to_tuple", - "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_replaceget_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint16(cell d, int kl, slice k, int v)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_to_tuple($B$_not_null(v)); ", + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_to_tuple", - "$B$_not_null", + "__tact_dict_get", }, "flags": Set { "inline", }, - "name": "$B$_to_opt_tuple", - "signature": "tuple $B$_to_opt_tuple(tuple v)", + "name": "__tact_dict_get_slice_varuint32", + "signature": "int __tact_dict_get_slice_varuint32(cell d, int kl, slice k)", }, { "code": { - "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "__tact_tuple_destroy_7", + "__tact_dict_min", }, "flags": Set { "inline", }, - "name": "$B$_from_tuple", - "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", + "name": "__tact_dict_min_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint32(cell d, int kl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $B$_as_optional($B$_from_tuple(v));", + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_as_optional", - "$B$_from_tuple", + "__tact_dict_next", }, "flags": Set { "inline", }, - "name": "$B$_from_opt_tuple", - "signature": "tuple $B$_from_opt_tuple(tuple v)", + "name": "__tact_dict_next_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint32(cell d, int kl, slice pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:B", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, "flags": Set { "inline", }, - "name": "$B$_to_external", - "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", + "name": "__tact_dict_set_slice_varuint32", + "signature": "(cell, ()) __tact_dict_set_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var loaded = $B$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); } else { - return (loaded); + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set { - "$B$_to_opt_tuple", + "__tact_dict_delete", }, "flags": Set { "inline", }, - "name": "$B$_to_opt_external", - "signature": "tuple $B$_to_opt_external(tuple v)", + "name": "__tact_dict_replace_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'a;", + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set {}, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, "flags": Set { "inline", }, - "name": "$C$_get_a", - "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replaceget_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint32(cell d, int kl, slice k, int v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'b;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_b", - "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_uint_slice", + "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'c;", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_c", - "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_min_uint_slice", + "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'd;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_d", - "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_next_uint_slice", + "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'e;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_e", - "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_set_uint_slice", + "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'f;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_f", - "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replace_uint_slice", + "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'g;", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_g", - "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_replaceget_uint_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return v'h;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_get_h", - "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_get_uint_int", + "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$C$_tensor_cast", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_int", + "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", }, { "code": { - "code": "throw_if(128, null?(v)); -var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); -return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_not_null", - "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", + "name": "__tact_dict_next_uint_int", + "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_as_optional", - "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", + "name": "__tact_dict_set_uint_int", + "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_create_8", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_tuple", - "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_replace_uint_int", + "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_to_tuple($C$_not_null(v)); ", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_tuple", - "$C$_not_null", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_tuple", - "signature": "tuple $C$_to_opt_tuple(tuple v)", + "name": "__tact_dict_replaceget_uint_int", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", - "kind": "generic", - }, - "comment": null, - "context": "type:C", - "depends": Set { - "__tact_tuple_destroy_8", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", + "kind": "generic", }, + "comment": null, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_tuple", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", + "name": "__tact_dict_get_uint_uint", + "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "if (null?(v)) { return null(); } -return $C$_as_optional($C$_from_tuple(v));", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_as_optional", - "$C$_from_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_from_opt_tuple", - "signature": "tuple $C$_from_opt_tuple(tuple v)", + "name": "__tact_dict_min_uint_uint", + "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; -return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, - "context": "type:C", + "context": "stdlib", "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_external", - "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", + "name": "__tact_dict_next_uint_uint", + "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var loaded = $C$_to_opt_tuple(v); -if (null?(loaded)) { - return null(); + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); } else { - return (loaded); + return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, "comment": null, - "context": "type:C", - "depends": Set { - "$C$_to_opt_tuple", - }, + "context": "stdlib", + "depends": Set {}, "flags": Set { "inline", }, - "name": "$C$_to_opt_external", - "signature": "tuple $C$_to_opt_external(tuple v)", + "name": "__tact_dict_set_uint_uint", + "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var v'a = sc_0~load_int(257); -var v'b = sc_0~load_int(257); -var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); -var v'd = sc_0~load_int(1); -var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); -slice sc_1 = sc_0~load_ref().begin_parse(); -var v'f = sc_1~load_int(257); -var v'g = sc_1~load_int(257); -return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, - "context": "type:B", + "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "$B$_load", - "signature": "(slice, ((int, int, int, int, int, int, int))) $B$_load(slice sc_0)", - }, - { - "code": { - "code": "var r = sc_0~$B$_load(); -sc_0.end_parse(); -return r;", - "kind": "generic", - }, - "comment": null, - "context": "type:B", - "depends": Set { - "$B$_load", + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "$B$_load_not_mut", - "signature": "((int, int, int, int, int, int, int)) $B$_load_not_mut(slice sc_0)", + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", }, -] -`; - -exports[`writeSerialization should write serializer for C 1`] = ` -[ { "code": { - "kind": "skip", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_set", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "kind": "skip", + "code": "var (r, ok) = udict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_nop", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", }, { "code": { - "kind": "skip", + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_str_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", }, { "code": { - "kind": "skip", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_slice_to_str", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", }, { "code": { - "kind": "skip", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_ref(d, kl, k, v), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_address_to_slice", - "signature": "", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "slice raw = cs~load_msg_addr(); -return (cs, raw);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_ref?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, @@ -8865,17 +9094,16 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address", - "signature": "(slice, slice) __tact_load_address(slice cs)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "if (cs.preload_uint(2) != 0) { - slice raw = cs~load_msg_addr(); - return (cs, raw); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); +if (ok) { + return (d, old); } else { - cs~skip_bits(2); - return (cs, null()); + return (d, null()); }", "kind": "generic", }, @@ -8885,12 +9113,17 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_load_address_opt", - "signature": "(slice, slice) __tact_load_address_opt(slice cs)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "return b.store_slice(address);", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -8899,39 +9132,36 @@ return (cs, raw);", "flags": Set { "inline", }, - "name": "__tact_store_address", - "signature": "builder __tact_store_address(builder b, slice address)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "if (null?(address)) { - b = b.store_uint(0, 2); - return b; + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); } else { - return __tact_store_address(b, address); + return (null(), null(), flag); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_store_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_store_address_opt", - "signature": "builder __tact_store_address_opt(builder b, slice address)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(2, 2); -b = b.store_uint(0, 1); -b = b.store_int(chain, 8); -b = b.store_uint(hash, 256); -var addr = b.end_cell().begin_parse(); -return addr;", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -8940,290 +9170,360 @@ return addr;", "flags": Set { "inline", }, - "name": "__tact_create_address", - "signature": "slice __tact_create_address(int chain, int hash)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { - "code": "var b = begin_cell(); -b = b.store_uint(0, 2); -b = b.store_uint(3, 2); -b = b.store_uint(0, 1); -b = b.store_ref(code); -b = b.store_ref(data); -var hash = cell_hash(b.end_cell()); -return __tact_create_address(chain, hash);", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_create_address", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_compute_contract_address", - "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "throw_if(128, null?(x)); return x;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", "inline", }, - "name": "__tact_not_null", - "signature": "forall X -> X __tact_not_null(X x)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete", - "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", - }, - { - "code": { - "code": "DICTIDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "flags": Set { + "inline", }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_int", - "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTUDEL", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_uint", - "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_varint16", + "signature": "int __tact_dict_get_uint_varint16(cell d, int kl, int k)", }, { "code": { - "code": "DICTSETREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_set_ref", - "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_varint16", + "signature": "(int, int, int) __tact_dict_min_uint_varint16(cell d, int kl)", }, { "code": { - "code": "DICTREPLACEREF", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replace_ref", - "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_varint16", + "signature": "(int, int, int) __tact_dict_next_uint_varint16(cell d, int kl, int pivot)", }, { "code": { - "code": "DICTREPLACEGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(value index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_replaceget_ref", - "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_varint16", + "signature": "(cell, ()) __tact_dict_set_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get", - "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTDELGET NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_get", - "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTDELGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_delete_get_ref", - "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_varint32", + "signature": "int __tact_dict_get_uint_varint32(cell d, int kl, int k)", }, { "code": { - "code": "DICTGETREF NULLSWAPIFNOT", - "kind": "asm", - "shuffle": "(index dict key_len)", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_get_ref", - "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_varint32", + "signature": "(int, int, int) __tact_dict_min_uint_varint32(cell d, int kl)", }, { "code": { - "code": "DICTMIN NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min", - "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_varint32", + "signature": "(int, int, int) __tact_dict_next_uint_varint32(cell d, int kl, int pivot)", }, { "code": { - "code": "DICTMINREF NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(dict key_len -> 1 0 2)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_min_ref", - "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_varint32", + "signature": "(cell, ()) __tact_dict_set_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "DICTGETNEXT NULLSWAPIFNOT2", - "kind": "asm", - "shuffle": "(pivot dict key_len -> 1 0 2)", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_dict_next", - "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); -if (flag) { - return (key, value~load_ref(), flag); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); } else { - return (null(), null(), flag); + return (d, null()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_dict_next_ref", - "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + "name": "__tact_dict_replaceget_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug", - "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_get_uint_varuint16", + "signature": "int __tact_dict_get_uint_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_str", - "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_min_uint_varuint16", + "signature": "(int, int, int) __tact_dict_min_uint_varuint16(cell d, int kl)", }, { "code": { - "code": "if (value) { - __tact_debug_str("true", debug_print_1, debug_print_2); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); } else { - __tact_debug_str("false", debug_print_1, debug_print_2); + return (null(), null(), flag); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_debug_str", - }, + "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_bool", - "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_next_uint_varuint16", + "signature": "(int, int, int) __tact_dict_next_uint_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "SDSUBSTR", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", @@ -9231,140 +9531,112 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_preload_offset", - "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", + "name": "__tact_dict_set_uint_varuint16", + "signature": "(cell, ()) __tact_dict_set_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "slice new_data = begin_cell() - .store_slice(data) - .store_slice("0000"s) -.end_cell().begin_parse(); -int reg = 0; -while (~ new_data.slice_data_empty?()) { - int byte = new_data~load_uint(8); - int mask = 0x80; - while (mask > 0) { - reg <<= 1; - if (byte & mask) { - reg += 1; - } - mask >>= 1; - if (reg > 0xffff) { - reg &= 0xffff; - reg ^= 0x1021; - } - } -} -(int q, int r) = divmod(reg, 256); -return begin_cell() - .store_uint(q, 8) - .store_uint(r, 8) -.end_cell().begin_parse();", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "inline_ref", + "inline", }, - "name": "__tact_crc16", - "signature": "(slice) __tact_crc16(slice data)", + "name": "__tact_dict_replace_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; -builder res = begin_cell(); - -while (data.slice_bits() >= 24) { - (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); - - int n = (bs1 << 16) | (bs2 << 8) | bs3; - - res = res - .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) - .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); -} - -return res.end_cell().begin_parse();", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_preload_offset", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_base64_encode", - "signature": "(slice) __tact_base64_encode(slice data)", + "name": "__tact_dict_replaceget_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "(int wc, int hash) = address.parse_std_addr(); - -slice user_friendly_address = begin_cell() - .store_slice("11"s) - .store_uint((wc + 0x100) % 0x100, 8) - .store_uint(hash, 256) -.end_cell().begin_parse(); - -slice checksum = __tact_crc16(user_friendly_address); -slice user_friendly_address_with_checksum = begin_cell() - .store_slice(user_friendly_address) - .store_slice(checksum) -.end_cell().begin_parse(); - -return __tact_base64_encode(user_friendly_address_with_checksum);", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_crc16", - "__tact_base64_encode", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_address_to_user_friendly", - "signature": "(slice) __tact_address_to_user_friendly(slice address)", + "name": "__tact_dict_get_uint_varuint32", + "signature": "int __tact_dict_get_uint_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_debug_str", - "__tact_address_to_user_friendly", - }, + "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_address", - "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_min_uint_varuint32", + "signature": "(int, int, int) __tact_dict_min_uint_varuint32(cell d, int kl)", }, { "code": { - "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", + "inline", }, - "name": "__tact_debug_stack", - "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", + "name": "__tact_dict_next_uint_varuint32", + "signature": "(int, int, int) __tact_dict_next_uint_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "return __tact_context;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", "kind": "generic", }, "comment": null, @@ -9373,12 +9645,17 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_context_get", - "signature": "(int, slice, int, slice) __tact_context_get()", + "name": "__tact_dict_set_uint_varuint32", + "signature": "(cell, ()) __tact_dict_set_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "return __tact_context_sender;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", "kind": "generic", }, "comment": null, @@ -9387,14 +9664,16 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_context_get_sender", - "signature": "slice __tact_context_get_sender()", + "name": "__tact_dict_replace_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "if (null?(__tact_randomized)) { - randomize_lt(); - __tact_randomized = true; + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); }", "kind": "generic", }, @@ -9402,15 +9681,19 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "context": "stdlib", "depends": Set {}, "flags": Set { - "impure", "inline", }, - "name": "__tact_prepare_random", - "signature": "() __tact_prepare_random()", + "name": "__tact_dict_replaceget_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "return b.store_int(v, 1);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9419,38 +9702,36 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_store_bool", - "signature": "builder __tact_store_bool(builder b, int v)", + "name": "__tact_dict_get_int_slice", + "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", }, { "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_to_tuple", - "signature": "forall X -> tuple __tact_to_tuple(X x)", - }, - { - "code": { - "code": "NOP", - "kind": "asm", - "shuffle": "", + "flags": Set { + "inline", }, - "comment": null, - "context": "stdlib", - "depends": Set {}, - "flags": Set {}, - "name": "__tact_from_tuple", - "signature": "forall X -> X __tact_from_tuple(tuple x)", + "name": "__tact_dict_min_int_slice", + "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", }, { "code": { - "code": "return equal_slices_bits(a, b);", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9459,12 +9740,17 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits", - "signature": "int __tact_slice_eq_bits(slice a, slice b)", + "name": "__tact_dict_next_int_slice", + "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, @@ -9473,14 +9759,17 @@ return __tact_base64_encode(user_friendly_address_with_checksum);", "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable_one", - "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", + "name": "__tact_dict_set_int_slice", + "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, @@ -9489,41 +9778,36 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_slice_eq_bits_nullable", - "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", + "name": "__tact_dict_replace_int_slice", + "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); -while (flag) { - (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); - ifnot (flag_b) { - return 0; - } - ifnot (value.slice_hash() == value_b.slice_hash()) { - return 0; - } - (key, value, flag) = __tact_dict_next(a, kl, key); -} -return null?(b);", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - "__tact_dict_delete_get", - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_eq", - "signature": "int __tact_dict_eq(cell a, cell b, int kl)", + "name": "__tact_dict_replaceget_int_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a == b);", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9532,12 +9816,17 @@ return null?(b);", "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable_one", - "signature": "int __tact_int_eq_nullable_one(int a, int b)", + "name": "__tact_dict_get_int_int", + "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a != b);", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9546,14 +9835,17 @@ return null?(b);", "flags": Set { "inline", }, - "name": "__tact_int_neq_nullable_one", - "signature": "int __tact_int_neq_nullable_one(int a, int b)", + "name": "__tact_dict_min_int_int", + "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9562,14 +9854,17 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_int_eq_nullable", - "signature": "int __tact_int_eq_nullable(int a, int b)", + "name": "__tact_dict_next_int_int", + "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", "kind": "generic", }, "comment": null, @@ -9578,12 +9873,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_int_neq_nullable", - "signature": "int __tact_int_neq_nullable(int a, int b)", + "name": "__tact_dict_set_int_int", + "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.cell_hash() == b.cell_hash());", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, @@ -9592,12 +9892,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_eq", - "signature": "int __tact_cell_eq(cell a, cell b)", + "name": "__tact_dict_replace_int_int", + "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.cell_hash() != b.cell_hash());", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -9606,12 +9911,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_neq", - "signature": "int __tact_cell_neq(cell a, cell b)", + "name": "__tact_dict_replaceget_int_int", + "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9620,12 +9930,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable_one", - "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", + "name": "__tact_dict_get_int_uint", + "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9634,14 +9949,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable_one", - "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", + "name": "__tact_dict_min_int_uint", + "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9650,14 +9968,17 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_cell_eq_nullable", - "signature": "int __tact_cell_eq_nullable(cell a, cell b)", + "name": "__tact_dict_next_int_uint", + "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", "kind": "generic", }, "comment": null, @@ -9666,12 +9987,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_cell_neq_nullable", - "signature": "int __tact_cell_neq_nullable(cell a, cell b)", + "name": "__tact_dict_set_int_uint", + "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.slice_hash() == b.slice_hash());", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, @@ -9680,12 +10006,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_eq", - "signature": "int __tact_slice_eq(slice a, slice b)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (a.slice_hash() != b.slice_hash());", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -9694,12 +10025,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_neq", - "signature": "int __tact_slice_neq(slice a, slice b)", + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", + "code": "var (r, ok) = idict_get_ref?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", "kind": "generic", }, "comment": null, @@ -9708,12 +10044,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable_one", - "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", }, { "code": { - "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9722,14 +10063,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable_one", - "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9738,14 +10082,17 @@ return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nul "flags": Set { "inline", }, - "name": "__tact_slice_eq_nullable", - "signature": "int __tact_slice_eq_nullable(slice a, slice b)", + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", }, { "code": { - "code": "var a_is_null = null?(a); -var b_is_null = null?(b); -return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_ref(d, kl, k, v), ()); +}", "kind": "generic", }, "comment": null, @@ -9754,12 +10101,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_slice_neq_nullable", - "signature": "int __tact_slice_neq_nullable(slice a, slice b)", + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "return udict_set_ref(dict, 16, id, code);", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_ref?(d, kl, k, v); +}", "kind": "generic", }, "comment": null, @@ -9768,14 +10120,17 @@ return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_nu "flags": Set { "inline", }, - "name": "__tact_dict_set_code", - "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (data, ok) = udict_get_ref?(dict, 16, id); -throw_unless(135, ok); -return data;", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -9784,25 +10139,36 @@ return data;", "flags": Set { "inline", }, - "name": "__tact_dict_get_code", - "signature": "cell __tact_dict_get_code(cell dict, int id)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "NIL", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_0", - "signature": "tuple __tact_tuple_create_0()", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { - "code": "return ();", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, @@ -9811,402 +10177,4406 @@ return data;", "flags": Set { "inline", }, - "name": "__tact_tuple_destroy_0", - "signature": "() __tact_tuple_destroy_0()", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { - "code": "1 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_1", - "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { - "code": "1 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_1", - "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "2 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_2", - "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "2 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_2", - "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "3 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_3", - "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varint16", + "signature": "int __tact_dict_get_int_varint16(cell d, int kl, int k)", }, { "code": { - "code": "3 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_3", - "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varint16", + "signature": "(int, int, int) __tact_dict_min_int_varint16(cell d, int kl)", }, { "code": { - "code": "4 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_4", - "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varint16", + "signature": "(int, int, int) __tact_dict_next_int_varint16(cell d, int kl, int pivot)", }, { "code": { - "code": "4 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_4", - "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varint16", + "signature": "(cell, ()) __tact_dict_set_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "5 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_5", - "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "5 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_5", - "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "6 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varint32", + "signature": "int __tact_dict_get_int_varint32(cell d, int kl, int k)", }, { "code": { - "code": "6 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_6", - "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varint32", + "signature": "(int, int, int) __tact_dict_min_int_varint32(cell d, int kl)", }, { "code": { - "code": "7 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varint32", + "signature": "(int, int, int) __tact_dict_next_int_varint32(cell d, int kl, int pivot)", }, { "code": { - "code": "7 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_7", - "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varint32", + "signature": "(cell, ()) __tact_dict_set_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "8 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "8 UNTUPLE", - "kind": "asm", - "shuffle": "", - }, + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_8", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "9 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varuint16", + "signature": "int __tact_dict_get_int_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "9 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_9", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varuint16", + "signature": "(int, int, int) __tact_dict_min_int_varuint16(cell d, int kl)", }, { "code": { - "code": "10 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varuint16", + "signature": "(int, int, int) __tact_dict_next_int_varuint16(cell d, int kl, int pivot)", }, { "code": { - "code": "10 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_10", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varuint16", + "signature": "(cell, ()) __tact_dict_set_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "11 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "11 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_11", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "12 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (r, ok) = idict_get?(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_int_varuint32", + "signature": "int __tact_dict_get_int_varuint32(cell d, int kl, int k)", }, { "code": { - "code": "12 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_min?(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_12", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_int_varuint32", + "signature": "(int, int, int) __tact_dict_min_int_varuint32(cell d, int kl)", }, { "code": { - "code": "13 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_13", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_int_varuint32", + "signature": "(int, int, int) __tact_dict_next_int_varuint32(cell d, int kl, int pivot)", }, { "code": { - "code": "13 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); +} else { + return (idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_int_varuint32", + "signature": "(cell, ()) __tact_dict_set_int_varuint32(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, (ok)); +} else { + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint32(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint32(cell d, int kl, int k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +return ok;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_slice", + "signature": "int __tact_dict_exists_slice(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (r, ok) = udict_get?(d, kl, k); +return ok;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_uint", + "signature": "int __tact_dict_exists_uint(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (r, ok) = idict_get?(d, kl, k); +return ok;", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_exists_int", + "signature": "int __tact_dict_exists_int(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +build_0 = build_0.store_int(v'a, 257); +build_0 = build_0.store_int(v'b, 257); +build_0 = ~ null?(v'c) ? build_0.store_int(true, 1).store_int(v'c, 257) : build_0.store_int(false, 1); +build_0 = build_0.store_int(v'd, 1); +build_0 = ~ null?(v'e) ? build_0.store_int(true, 1).store_int(v'e, 1) : build_0.store_int(false, 1); +var build_1 = begin_cell(); +build_1 = build_1.store_int(v'f, 257); +build_1 = build_1.store_int(v'g, 257); +build_0 = store_ref(build_0, build_1.end_cell()); +return build_0;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, "flags": Set {}, - "name": "__tact_tuple_destroy_13", + "name": "$B$_store", + "signature": "builder $B$_store(builder build_0, (int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "return $B$_store(begin_cell(), v).end_cell();", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_store", + }, + "flags": Set { + "inline", + }, + "name": "$B$_store_cell", + "signature": "cell $B$_store_cell((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_a", + "signature": "_ $A$_get_a((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_b", + "signature": "_ $A$_get_b((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_c", + "signature": "_ $A$_get_c((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_d", + "signature": "_ $A$_get_d((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_e", + "signature": "_ $A$_get_e((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_f", + "signature": "_ $A$_get_f((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_get_g", + "signature": "_ $A$_get_g((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set {}, + "name": "$A$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $A$_tensor_cast((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_not_null", + "signature": "((int, int, int, int, int, int, int)) $A$_not_null(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_as_optional", + "signature": "tuple $A$_as_optional((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_to_tuple", + "signature": "tuple $A$_to_tuple(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $A$_to_tuple($A$_not_null(v)); ", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "$A$_to_tuple", + "$A$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$A$_to_opt_tuple", + "signature": "tuple $A$_to_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$A$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $A$_from_tuple(tuple v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $A$_as_optional($A$_from_tuple(v));", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "$A$_as_optional", + "$A$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$A$_from_opt_tuple", + "signature": "tuple $A$_from_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$A$_to_external", + "signature": "(int, int, int, int, int, int, int) $A$_to_external(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "var loaded = $A$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", + }, + "comment": null, + "context": "type:A", + "depends": Set { + "$A$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$A$_to_opt_external", + "signature": "tuple $A$_to_opt_external(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'a;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_a", + "signature": "_ $B$_get_a((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'b;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_b", + "signature": "_ $B$_get_b((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'c;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_c", + "signature": "_ $B$_get_c((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'd;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_d", + "signature": "_ $B$_get_d((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'e;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_e", + "signature": "_ $B$_get_e((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'f;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_f", + "signature": "_ $B$_get_f((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return v'g;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_get_g", + "signature": "_ $B$_get_g((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set {}, + "name": "$B$_tensor_cast", + "signature": "((int, int, int, int, int, int, int)) $B$_tensor_cast((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "throw_if(128, null?(v)); +var (int vvv'a, int vvv'b, int vvv'c, int vvv'd, int vvv'e, int vvv'f, int vvv'g) = __tact_tuple_destroy_7(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_not_null", + "signature": "((int, int, int, int, int, int, int)) $B$_not_null(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_as_optional", + "signature": "tuple $B$_as_optional((int, int, int, int, int, int, int) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return __tact_tuple_create_7(v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_create_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_to_tuple", + "signature": "tuple $B$_to_tuple(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $B$_to_tuple($B$_not_null(v)); ", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_to_tuple", + "$B$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$B$_to_opt_tuple", + "signature": "tuple $B$_to_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (int v'a, int v'b, int v'c, int v'd, int v'e, int v'f, int v'g) = __tact_tuple_destroy_7(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "__tact_tuple_destroy_7", + }, + "flags": Set { + "inline", + }, + "name": "$B$_from_tuple", + "signature": "(int, int, int, int, int, int, int) $B$_from_tuple(tuple v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $B$_as_optional($B$_from_tuple(v));", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_as_optional", + "$B$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$B$_from_opt_tuple", + "signature": "tuple $B$_from_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g);", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$B$_to_external", + "signature": "(int, int, int, int, int, int, int) $B$_to_external(((int, int, int, int, int, int, int)) v)", + }, + { + "code": { + "code": "var loaded = $B$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$B$_to_opt_external", + "signature": "tuple $B$_to_opt_external(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'a;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_a", + "signature": "_ $C$_get_a((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'b;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_b", + "signature": "_ $C$_get_b((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'c;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_c", + "signature": "_ $C$_get_c((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'd;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_d", + "signature": "_ $C$_get_d((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'e;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_e", + "signature": "_ $C$_get_e((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'f;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_f", + "signature": "_ $C$_get_f((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'g;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_g", + "signature": "_ $C$_get_g((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return v'h;", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_get_h", + "signature": "_ $C$_get_h((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set {}, + "name": "$C$_tensor_cast", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_tensor_cast((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "throw_if(128, null?(v)); +var (cell vvv'a, cell vvv'b, slice vvv'c, slice vvv'd, int vvv'e, int vvv'f, int vvv'g, slice vvv'h) = __tact_tuple_destroy_8(v); +return (vvv'a, vvv'b, vvv'c, vvv'd, vvv'e, vvv'f, vvv'g, vvv'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_not_null", + "signature": "((cell, cell, slice, slice, int, int, int, slice)) $C$_not_null(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_as_optional", + "signature": "tuple $C$_as_optional((cell, cell, slice, slice, int, int, int, slice) v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return __tact_tuple_create_8(v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_create_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_tuple", + "signature": "tuple $C$_to_tuple(((cell, cell, slice, slice, int, int, int, slice)) v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $C$_to_tuple($C$_not_null(v)); ", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "$C$_to_tuple", + "$C$_not_null", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_tuple", + "signature": "tuple $C$_to_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (cell v'a, cell v'b, slice v'c, slice v'd, int v'e, int v'f, int v'g, slice v'h) = __tact_tuple_destroy_8(v); +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "__tact_tuple_destroy_8", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_tuple", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_from_tuple(tuple v)", + }, + { + "code": { + "code": "if (null?(v)) { return null(); } +return $C$_as_optional($C$_from_tuple(v));", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "$C$_as_optional", + "$C$_from_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_from_opt_tuple", + "signature": "tuple $C$_from_opt_tuple(tuple v)", + }, + { + "code": { + "code": "var (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h) = v; +return (v'a, v'b, v'c, v'd, v'e, v'f, v'g, v'h);", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "$C$_to_external", + "signature": "(cell, cell, slice, slice, int, int, int, slice) $C$_to_external(((cell, cell, slice, slice, int, int, int, slice)) v)", + }, + { + "code": { + "code": "var loaded = $C$_to_opt_tuple(v); +if (null?(loaded)) { + return null(); +} else { + return (loaded); +}", + "kind": "generic", + }, + "comment": null, + "context": "type:C", + "depends": Set { + "$C$_to_opt_tuple", + }, + "flags": Set { + "inline", + }, + "name": "$C$_to_opt_external", + "signature": "tuple $C$_to_opt_external(tuple v)", + }, + { + "code": { + "code": "var v'a = sc_0~load_int(257); +var v'b = sc_0~load_int(257); +var v'c = sc_0~load_int(1) ? sc_0~load_int(257) : null(); +var v'd = sc_0~load_int(1); +var v'e = sc_0~load_int(1) ? sc_0~load_int(1) : null(); +slice sc_1 = sc_0~load_ref().begin_parse(); +var v'f = sc_1~load_int(257); +var v'g = sc_1~load_int(257); +return (sc_0, (v'a, v'b, v'c, v'd, v'e, v'f, v'g));", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set {}, + "flags": Set {}, + "name": "$B$_load", + "signature": "(slice, ((int, int, int, int, int, int, int))) $B$_load(slice sc_0)", + }, + { + "code": { + "code": "var r = sc_0~$B$_load(); +sc_0.end_parse(); +return r;", + "kind": "generic", + }, + "comment": null, + "context": "type:B", + "depends": Set { + "$B$_load", + }, + "flags": Set {}, + "name": "$B$_load_not_mut", + "signature": "((int, int, int, int, int, int, int)) $B$_load_not_mut(slice sc_0)", + }, +] +`; + +exports[`writeSerialization should write serializer for C 1`] = ` +[ + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_set", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_nop", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_str_to_slice", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_slice_to_str", + "signature": "", + }, + { + "code": { + "kind": "skip", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_address_to_slice", + "signature": "", + }, + { + "code": { + "code": "slice raw = cs~load_msg_addr(); +return (cs, raw);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_load_address", + "signature": "(slice, slice) __tact_load_address(slice cs)", + }, + { + "code": { + "code": "if (cs.preload_uint(2) != 0) { + slice raw = cs~load_msg_addr(); + return (cs, raw); +} else { + cs~skip_bits(2); + return (cs, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_load_address_opt", + "signature": "(slice, slice) __tact_load_address_opt(slice cs)", + }, + { + "code": { + "code": "return b.store_slice(address);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_store_address", + "signature": "builder __tact_store_address(builder b, slice address)", + }, + { + "code": { + "code": "if (null?(address)) { + b = b.store_uint(0, 2); + return b; +} else { + return __tact_store_address(b, address); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_store_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_store_address_opt", + "signature": "builder __tact_store_address_opt(builder b, slice address)", + }, + { + "code": { + "code": "var b = begin_cell(); +b = b.store_uint(2, 2); +b = b.store_uint(0, 1); +b = b.store_int(chain, 8); +b = b.store_uint(hash, 256); +var addr = b.end_cell().begin_parse(); +return addr;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_create_address", + "signature": "slice __tact_create_address(int chain, int hash)", + }, + { + "code": { + "code": "var b = begin_cell(); +b = b.store_uint(0, 2); +b = b.store_uint(3, 2); +b = b.store_uint(0, 1); +b = b.store_ref(code); +b = b.store_ref(data); +var hash = cell_hash(b.end_cell()); +return __tact_create_address(chain, hash);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_create_address", + }, + "flags": Set { + "inline", + }, + "name": "__tact_compute_contract_address", + "signature": "slice __tact_compute_contract_address(int chain, cell code, cell data)", + }, + { + "code": { + "code": "throw_if(128, null?(x)); return x;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + "inline", + }, + "name": "__tact_not_null", + "signature": "forall X -> X __tact_not_null(X x)", + }, + { + "code": { + "code": "DICTDEL", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete", + "signature": "(cell, int) __tact_dict_delete(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTIDEL", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_int", + "signature": "(cell, int) __tact_dict_delete_int(cell dict, int key_len, int index)", + }, + { + "code": { + "code": "DICTUDEL", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_uint", + "signature": "(cell, int) __tact_dict_delete_uint(cell dict, int key_len, int index)", + }, + { + "code": { + "code": "DICTSETREF", + "kind": "asm", + "shuffle": "(value index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_set_ref", + "signature": "((cell), ()) __tact_dict_set_ref(cell dict, int key_len, slice index, cell value)", + }, + { + "code": { + "code": "DICTREPLACEREF", + "kind": "asm", + "shuffle": "(value index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_replace_ref", + "signature": "((cell), (int)) __tact_dict_replace_ref(cell dict, int key_len, slice index, cell value)", + }, + { + "code": { + "code": "DICTREPLACEGETREF NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(value index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_replaceget_ref", + "signature": "((cell), (cell, int)) __tact_dict_replaceget_ref(cell dict, int key_len, slice index, cell value)", + }, + { + "code": { + "code": "DICTGET NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_get", + "signature": "(slice, int) __tact_dict_get(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTDELGET NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_get", + "signature": "(cell, (slice, int)) __tact_dict_delete_get(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTDELGETREF NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_delete_get_ref", + "signature": "(cell, (cell, int)) __tact_dict_delete_get_ref(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTGETREF NULLSWAPIFNOT", + "kind": "asm", + "shuffle": "(index dict key_len)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_get_ref", + "signature": "(cell, int) __tact_dict_get_ref(cell dict, int key_len, slice index)", + }, + { + "code": { + "code": "DICTMIN NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(dict key_len -> 1 0 2)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_min", + "signature": "(slice, slice, int) __tact_dict_min(cell dict, int key_len)", + }, + { + "code": { + "code": "DICTMINREF NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(dict key_len -> 1 0 2)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_min_ref", + "signature": "(slice, cell, int) __tact_dict_min_ref(cell dict, int key_len)", + }, + { + "code": { + "code": "DICTGETNEXT NULLSWAPIFNOT2", + "kind": "asm", + "shuffle": "(pivot dict key_len -> 1 0 2)", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_dict_next", + "signature": "(slice, slice, int) __tact_dict_next(cell dict, int key_len, slice pivot)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(dict, key_len, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set {}, + "name": "__tact_dict_next_ref", + "signature": "(slice, cell, int) __tact_dict_next_ref(cell dict, int key_len, slice pivot)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP s0 DUMP DROP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + }, + "name": "__tact_debug", + "signature": "forall X -> () __tact_debug(X value, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP STRDUMP DROP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + }, + "name": "__tact_debug_str", + "signature": "() __tact_debug_str(slice value, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "if (value) { + __tact_debug_str("true", debug_print_1, debug_print_2); +} else { + __tact_debug_str("false", debug_print_1, debug_print_2); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_debug_str", + }, + "flags": Set { + "impure", + }, + "name": "__tact_debug_bool", + "signature": "() __tact_debug_bool(int value, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "SDSUBSTR", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_preload_offset", + "signature": "(slice) __tact_preload_offset(slice s, int offset, int bits)", + }, + { + "code": { + "code": "slice new_data = begin_cell() + .store_slice(data) + .store_slice("0000"s) +.end_cell().begin_parse(); +int reg = 0; +while (~ new_data.slice_data_empty?()) { + int byte = new_data~load_uint(8); + int mask = 0x80; + while (mask > 0) { + reg <<= 1; + if (byte & mask) { + reg += 1; + } + mask >>= 1; + if (reg > 0xffff) { + reg &= 0xffff; + reg ^= 0x1021; + } + } +} +(int q, int r) = divmod(reg, 256); +return begin_cell() + .store_uint(q, 8) + .store_uint(r, 8) +.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline_ref", + }, + "name": "__tact_crc16", + "signature": "(slice) __tact_crc16(slice data)", + }, + { + "code": { + "code": "slice chars = "4142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392D5F"s; +builder res = begin_cell(); + +while (data.slice_bits() >= 24) { + (int bs1, int bs2, int bs3) = (data~load_uint(8), data~load_uint(8), data~load_uint(8)); + + int n = (bs1 << 16) | (bs2 << 8) | bs3; + + res = res + .store_slice(__tact_preload_offset(chars, ((n >> 18) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 12) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n >> 6) & 63) * 8, 8)) + .store_slice(__tact_preload_offset(chars, ((n ) & 63) * 8, 8)); +} + +return res.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_preload_offset", + }, + "flags": Set {}, + "name": "__tact_base64_encode", + "signature": "(slice) __tact_base64_encode(slice data)", + }, + { + "code": { + "code": "(int wc, int hash) = address.parse_std_addr(); + +slice user_friendly_address = begin_cell() + .store_slice("11"s) + .store_uint((wc + 0x100) % 0x100, 8) + .store_uint(hash, 256) +.end_cell().begin_parse(); + +slice checksum = __tact_crc16(user_friendly_address); +slice user_friendly_address_with_checksum = begin_cell() + .store_slice(user_friendly_address) + .store_slice(checksum) +.end_cell().begin_parse(); + +return __tact_base64_encode(user_friendly_address_with_checksum);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_crc16", + "__tact_base64_encode", + }, + "flags": Set {}, + "name": "__tact_address_to_user_friendly", + "signature": "(slice) __tact_address_to_user_friendly(slice address)", + }, + { + "code": { + "code": "__tact_debug_str(__tact_address_to_user_friendly(address), debug_print_1, debug_print_2);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_debug_str", + "__tact_address_to_user_friendly", + }, + "flags": Set { + "impure", + }, + "name": "__tact_debug_address", + "signature": "() __tact_debug_address(slice address, slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "STRDUMP DROP STRDUMP DROP DUMPSTK", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + }, + "name": "__tact_debug_stack", + "signature": "() __tact_debug_stack(slice debug_print_1, slice debug_print_2)", + }, + { + "code": { + "code": "return __tact_context;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_context_get", + "signature": "(int, slice, int, slice) __tact_context_get()", + }, + { + "code": { + "code": "return __tact_context_sender;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_context_get_sender", + "signature": "slice __tact_context_get_sender()", + }, + { + "code": { + "code": "if (null?(__tact_randomized)) { + randomize_lt(); + __tact_randomized = true; +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "impure", + "inline", + }, + "name": "__tact_prepare_random", + "signature": "() __tact_prepare_random()", + }, + { + "code": { + "code": "return b.store_int(v, 1);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_store_bool", + "signature": "builder __tact_store_bool(builder b, int v)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_to_tuple", + "signature": "forall X -> tuple __tact_to_tuple(X x)", + }, + { + "code": { + "code": "NOP", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_from_tuple", + "signature": "forall X -> X __tact_from_tuple(tuple x)", + }, + { + "code": { + "code": "return equal_slices_bits(a, b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_bits", + "signature": "int __tact_slice_eq_bits(slice a, slice b)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (equal_slices_bits(a, b));", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_bits_nullable_one", + "signature": "int __tact_slice_eq_bits_nullable_one(slice a, slice b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( equal_slices_bits(a, b) ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_bits_nullable", + "signature": "int __tact_slice_eq_bits_nullable(slice a, slice b)", + }, + { + "code": { + "code": "(slice key, slice value, int flag) = __tact_dict_min(a, kl); +while (flag) { + (slice value_b, int flag_b) = b~__tact_dict_delete_get(kl, key); + ifnot (flag_b) { + return 0; + } + ifnot (value.slice_hash() == value_b.slice_hash()) { + return 0; + } + (key, value, flag) = __tact_dict_next(a, kl, key); +} +return null?(b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + "__tact_dict_delete_get", + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_eq", + "signature": "int __tact_dict_eq(cell a, cell b, int kl)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (a == b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_eq_nullable_one", + "signature": "int __tact_int_eq_nullable_one(int a, int b)", + }, + { + "code": { + "code": "return (null?(a)) ? (true) : (a != b);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_neq_nullable_one", + "signature": "int __tact_int_neq_nullable_one(int a, int b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a == b ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_eq_nullable", + "signature": "int __tact_int_eq_nullable(int a, int b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a != b ) : ( true ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_int_neq_nullable", + "signature": "int __tact_int_neq_nullable(int a, int b)", + }, + { + "code": { + "code": "return (a.cell_hash() == b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_eq", + "signature": "int __tact_cell_eq(cell a, cell b)", + }, + { + "code": { + "code": "return (a.cell_hash() != b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_neq", + "signature": "int __tact_cell_neq(cell a, cell b)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (a.cell_hash() == b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_eq_nullable_one", + "signature": "int __tact_cell_eq_nullable_one(cell a, cell b)", + }, + { + "code": { + "code": "return (null?(a)) ? (true) : (a.cell_hash() != b.cell_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_neq_nullable_one", + "signature": "int __tact_cell_neq_nullable_one(cell a, cell b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() == b.cell_hash() ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_eq_nullable", + "signature": "int __tact_cell_eq_nullable(cell a, cell b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.cell_hash() != b.cell_hash() ) : ( true ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_cell_neq_nullable", + "signature": "int __tact_cell_neq_nullable(cell a, cell b)", + }, + { + "code": { + "code": "return (a.slice_hash() == b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq", + "signature": "int __tact_slice_eq(slice a, slice b)", + }, + { + "code": { + "code": "return (a.slice_hash() != b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_neq", + "signature": "int __tact_slice_neq(slice a, slice b)", + }, + { + "code": { + "code": "return (null?(a)) ? (false) : (a.slice_hash() == b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_nullable_one", + "signature": "int __tact_slice_eq_nullable_one(slice a, slice b)", + }, + { + "code": { + "code": "return (null?(a)) ? (true) : (a.slice_hash() != b.slice_hash());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_neq_nullable_one", + "signature": "int __tact_slice_neq_nullable_one(slice a, slice b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( true ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() == b.slice_hash() ) : ( false ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_eq_nullable", + "signature": "int __tact_slice_eq_nullable(slice a, slice b)", + }, + { + "code": { + "code": "var a_is_null = null?(a); +var b_is_null = null?(b); +return ( a_is_null & b_is_null ) ? ( false ) : ( ( ( ~ a_is_null ) & ( ~ b_is_null ) ) ? ( a.slice_hash() != b.slice_hash() ) : ( true ) );", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_slice_neq_nullable", + "signature": "int __tact_slice_neq_nullable(slice a, slice b)", + }, + { + "code": { + "code": "return udict_set_ref(dict, 16, id, code);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_code", + "signature": "cell __tact_dict_set_code(cell dict, int id, cell code)", + }, + { + "code": { + "code": "var (data, ok) = udict_get_ref?(dict, 16, id); +throw_unless(135, ok); +return data;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_code", + "signature": "cell __tact_dict_get_code(cell dict, int id)", + }, + { + "code": { + "code": "NIL", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_0", + "signature": "tuple __tact_tuple_create_0()", + }, + { + "code": { + "code": "return ();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_tuple_destroy_0", + "signature": "() __tact_tuple_destroy_0()", + }, + { + "code": { + "code": "1 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_1", + "signature": "forall X0 -> tuple __tact_tuple_create_1((X0) v)", + }, + { + "code": { + "code": "1 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_1", + "signature": "forall X0 -> (X0) __tact_tuple_destroy_1(tuple v)", + }, + { + "code": { + "code": "2 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_2", + "signature": "forall X0, X1 -> tuple __tact_tuple_create_2((X0, X1) v)", + }, + { + "code": { + "code": "2 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_2", + "signature": "forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v)", + }, + { + "code": { + "code": "3 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_3", + "signature": "forall X0, X1, X2 -> tuple __tact_tuple_create_3((X0, X1, X2) v)", + }, + { + "code": { + "code": "3 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_3", + "signature": "forall X0, X1, X2 -> (X0, X1, X2) __tact_tuple_destroy_3(tuple v)", + }, + { + "code": { + "code": "4 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_4", + "signature": "forall X0, X1, X2, X3 -> tuple __tact_tuple_create_4((X0, X1, X2, X3) v)", + }, + { + "code": { + "code": "4 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_4", + "signature": "forall X0, X1, X2, X3 -> (X0, X1, X2, X3) __tact_tuple_destroy_4(tuple v)", + }, + { + "code": { + "code": "5 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_5", + "signature": "forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v)", + }, + { + "code": { + "code": "5 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_5", + "signature": "forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v)", + }, + { + "code": { + "code": "6 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v)", + }, + { + "code": { + "code": "6 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_6", + "signature": "forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v)", + }, + { + "code": { + "code": "7 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> tuple __tact_tuple_create_7((X0, X1, X2, X3, X4, X5, X6) v)", + }, + { + "code": { + "code": "7 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_7", + "signature": "forall X0, X1, X2, X3, X4, X5, X6 -> (X0, X1, X2, X3, X4, X5, X6) __tact_tuple_destroy_7(tuple v)", + }, + { + "code": { + "code": "8 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> tuple __tact_tuple_create_8((X0, X1, X2, X3, X4, X5, X6, X7) v)", + }, + { + "code": { + "code": "8 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_8", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7 -> (X0, X1, X2, X3, X4, X5, X6, X7) __tact_tuple_destroy_8(tuple v)", + }, + { + "code": { + "code": "9 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> tuple __tact_tuple_create_9((X0, X1, X2, X3, X4, X5, X6, X7, X8) v)", + }, + { + "code": { + "code": "9 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_9", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8) __tact_tuple_destroy_9(tuple v)", + }, + { + "code": { + "code": "10 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> tuple __tact_tuple_create_10((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) v)", + }, + { + "code": { + "code": "10 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_10", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __tact_tuple_destroy_10(tuple v)", + }, + { + "code": { + "code": "11 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> tuple __tact_tuple_create_11((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) v)", + }, + { + "code": { + "code": "11 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_11", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __tact_tuple_destroy_11(tuple v)", + }, + { + "code": { + "code": "12 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> tuple __tact_tuple_create_12((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) v)", + }, + { + "code": { + "code": "12 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_12", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __tact_tuple_destroy_12(tuple v)", + }, + { + "code": { + "code": "13 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_13", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> tuple __tact_tuple_create_13((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) v)", + }, + { + "code": { + "code": "13 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_13", "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __tact_tuple_destroy_13(tuple v)", }, { "code": { - "code": "14 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "14 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", + }, + { + "code": { + "code": "14 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_14", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", + }, + { + "code": { + "code": "15 TUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_create_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", + }, + { + "code": { + "code": "15 UNTUPLE", + "kind": "asm", + "shuffle": "", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_tuple_destroy_15", + "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", + }, + { + "code": { + "code": "return tpush(tpush(empty_tuple(), b), null());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start", + "signature": "tuple __tact_string_builder_start(builder b)", + }, + { + "code": { + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_start", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start_comment", + "signature": "tuple __tact_string_builder_start_comment()", + }, + { + "code": { + "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_start", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start_tail_string", + "signature": "tuple __tact_string_builder_start_tail_string()", + }, + { + "code": { + "code": "return __tact_string_builder_start(begin_cell());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_start", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_start_string", + "signature": "tuple __tact_string_builder_start_string()", + }, + { + "code": { + "code": "(builder b, tuple tail) = uncons(builders); +cell c = b.end_cell(); +while(~ null?(tail)) { + (b, tail) = uncons(tail); + c = b.store_ref(c).end_cell(); +} +return c;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_end", + "signature": "cell __tact_string_builder_end(tuple builders)", + }, + { + "code": { + "code": "return __tact_string_builder_end(builders).begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_end", + }, + "flags": Set { + "inline", + }, + "name": "__tact_string_builder_end_slice", + "signature": "slice __tact_string_builder_end_slice(tuple builders)", + }, + { + "code": { + "code": "int sliceRefs = slice_refs(sc); +int sliceBits = slice_bits(sc); + +while((sliceBits > 0) | (sliceRefs > 0)) { + + ;; Load the current builder + (builder b, tuple tail) = uncons(builders); + int remBytes = 127 - (builder_bits(b) / 8); + int exBytes = sliceBits / 8; + + ;; Append bits + int amount = min(remBytes, exBytes); + if (amount > 0) { + slice read = sc~load_bits(amount * 8); + b = b.store_slice(read); + } + + ;; Update builders + builders = cons(b, tail); + + ;; Check if we need to add a new cell and continue + if (exBytes - amount > 0) { + var bb = begin_cell(); + builders = cons(bb, builders); + sliceBits = (exBytes - amount) * 8; + } elseif (sliceRefs > 0) { + sc = sc~load_ref().begin_parse(); + sliceRefs = slice_refs(sc); + sliceBits = slice_bits(sc); + } else { + sliceBits = 0; + sliceRefs = 0; + } +} + +return ((builders), ());", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_string_builder_append", + "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", + }, + { + "code": { + "code": "builders~__tact_string_builder_append(sc); +return builders;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_append", + }, + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + }, + { + "code": { + "code": "var b = begin_cell(); +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +if (src < 1000000000000000000000000000000) { + int len = 0; + int value = 0; + int mult = 1; + do { + (src, int res) = src.divmod(10); + value = value + (res + 48) * mult; + mult = mult * 256; + len = len + 1; + } until (src == 0); + + b = b.store_uint(value, len * 8); +} else { + tuple t = empty_tuple(); + int len = 0; + do { + int digit = src % 10; + t~tpush(digit); + len = len + 1; + src = src / 10; + } until (src == 0); + + int c = len - 1; + repeat(len) { + int v = t.at(c); + b = b.store_uint(v + 48, 8); + c = c - 1; + } +} +return b.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_int_to_string", + "signature": "slice __tact_int_to_string(int src)", + }, + { + "code": { + "code": "throw_if(134, (digits <= 0) | (digits > 77)); +builder b = begin_cell(); + +if (src < 0) { + b = b.store_uint(45, 8); + src = - src; +} + +;; Process rem part +int skip = true; +int len = 0; +int rem = 0; +tuple t = empty_tuple(); +repeat(digits) { + (src, rem) = src.divmod(10); + if ( ~ ( skip & ( rem == 0 ) ) ) { + skip = false; + t~tpush(rem + 48); + len = len + 1; + } +} + +;; Process dot +if (~ skip) { + t~tpush(46); + len = len + 1; +} + +;; Main +do { + (src, rem) = src.divmod(10); + t~tpush(rem + 48); + len = len + 1; +} until (src == 0); + +;; Assemble +int c = len - 1; +repeat(len) { + int v = t.at(c); + b = b.store_uint(v, 8); + c = c - 1; +} + +;; Result +return b.end_cell().begin_parse();", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set {}, + "name": "__tact_float_to_string", + "signature": "slice __tact_float_to_string(int src, int digits)", + }, + { + "code": { + "code": "throw_unless(5, num > 0); +throw_unless(5, base > 1); +if (num < base) { + return 0; +} +int result = 0; +while (num >= base) { + num /= base; + result += 1; +} +return result;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_log", + "signature": "int __tact_log(int num, int base)", + }, + { + "code": { + "code": "throw_unless(5, exp >= 0); +int result = 1; +repeat (exp) { + result *= base; +} +return result;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_pow", + "signature": "int __tact_pow(int base, int exp)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_slice", + "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_slice", + "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", + }, + { + "code": { + "code": "return __tact_dict_next(d, kl, pivot);", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_slice", + "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_slice", + "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_slice", + "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_int", + "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_int", + "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_int", + "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_int", + "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_int", + "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_int", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_uint", + "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_uint", + "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_uint", + "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_uint", + "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_uint", + "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_cell", + "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_cell", + "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_cell", + "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return __tact_dict_set_ref(d, kl, k, v); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + "__tact_dict_set_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_cell", + "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return __tact_dict_replace_ref(d, kl, k, v); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + "__tact_dict_replace_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_cell", + "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get_ref", + "__tact_dict_replaceget_ref", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_coins(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_coins", + "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_coins", + "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_coins(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_coins", + "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_coins", + "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_coins", + "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_coins()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint16(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varint16", + "signature": "int __tact_dict_get_slice_varint16(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varint16(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varint16(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varint16", + "signature": "(cell, ()) __tact_dict_set_slice_varint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint16()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varint32(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varint32", + "signature": "int __tact_dict_get_slice_varint32(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varint32(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varint32(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varint32", + "signature": "(cell, ()) __tact_dict_set_slice_varint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint16(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varuint16", + "signature": "int __tact_dict_get_slice_varuint16(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint16(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint16(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varuint16", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint16(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varuint16", + "signature": "(cell, ()) __tact_dict_set_slice_varuint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint16()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint16(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = __tact_dict_get(d, kl, k); +if (ok) { + return r~load_varuint32(); +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_slice_varuint32", + "signature": "int __tact_dict_get_slice_varuint32(cell d, int kl, slice k)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_min(d, kl); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_min", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_min_slice_varuint32(cell d, int kl)", + }, + { + "code": { + "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); +if (flag) { + return (key, value~load_varuint32(), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_next", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_slice_varuint32", + "signature": "(slice, int, int) __tact_dict_next_slice_varuint32(cell d, int kl, slice pivot)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); +} else { + return (dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_slice_varuint32", + "signature": "(cell, ()) __tact_dict_set_slice_varuint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, (ok)); +} else { + return dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_slice_varuint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); +if (ok) { + return (d, old~load_varuint32()); +} else { + return (d, null()); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_dict_delete_get", + }, + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_slice_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_slice_varuint32(cell d, int kl, slice k, int v)", + }, + { + "code": { + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r; +} else { + return null(); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_get_uint_slice", + "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> tuple __tact_tuple_create_14((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_slice", + "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", }, { "code": { - "code": "14 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value, flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_14", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __tact_tuple_destroy_14(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_slice", + "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", }, { "code": { - "code": "15 TUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set(d, kl, k, v), ()); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_create_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> tuple __tact_tuple_create_15((X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_slice", + "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "15 UNTUPLE", - "kind": "asm", - "shuffle": "", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace?(d, kl, k, v); +}", + "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_tuple_destroy_15", - "signature": "forall X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14 -> (X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __tact_tuple_destroy_15(tuple v)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replace_uint_slice", + "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "return tpush(tpush(empty_tuple(), b), null());", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); +if (ok) { + return (d, old); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -10215,66 +14585,74 @@ return data;", "flags": Set { "inline", }, - "name": "__tact_string_builder_start", - "signature": "tuple __tact_string_builder_start(builder b)", + "name": "__tact_dict_replaceget_uint_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 32));", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_int(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_start_comment", - "signature": "tuple __tact_string_builder_start_comment()", + "name": "__tact_dict_get_uint_int", + "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell().store_uint(0, 8));", + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_start_tail_string", - "signature": "tuple __tact_string_builder_start_tail_string()", + "name": "__tact_dict_min_uint_int", + "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", }, { "code": { - "code": "return __tact_string_builder_start(begin_cell());", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_int(vl), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_start", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_start_string", - "signature": "tuple __tact_string_builder_start_string()", + "name": "__tact_dict_next_uint_int", + "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "(builder b, tuple tail) = uncons(builders); -cell c = b.end_cell(); -while(~ null?(tail)) { - (b, tail) = uncons(tail); - c = b.store_ref(c).end_cell(); -} -return c;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); +}", "kind": "generic", }, "comment": null, @@ -10283,203 +14661,131 @@ return c;", "flags": Set { "inline", }, - "name": "__tact_string_builder_end", - "signature": "cell __tact_string_builder_end(tuple builders)", + "name": "__tact_dict_set_uint_int", + "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "return __tact_string_builder_end(builders).begin_parse();", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_end", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_string_builder_end_slice", - "signature": "slice __tact_string_builder_end_slice(tuple builders)", + "name": "__tact_dict_replace_uint_int", + "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "int sliceRefs = slice_refs(sc); -int sliceBits = slice_bits(sc); - -while((sliceBits > 0) | (sliceRefs > 0)) { - - ;; Load the current builder - (builder b, tuple tail) = uncons(builders); - int remBytes = 127 - (builder_bits(b) / 8); - int exBytes = sliceBits / 8; - - ;; Append bits - int amount = min(remBytes, exBytes); - if (amount > 0) { - slice read = sc~load_bits(amount * 8); - b = b.store_slice(read); - } - - ;; Update builders - builders = cons(b, tail); - - ;; Check if we need to add a new cell and continue - if (exBytes - amount > 0) { - var bb = begin_cell(); - builders = cons(bb, builders); - sliceBits = (exBytes - amount) * 8; - } elseif (sliceRefs > 0) { - sc = sc~load_ref().begin_parse(); - sliceRefs = slice_refs(sc); - sliceBits = slice_bits(sc); - } else { - sliceBits = 0; - sliceRefs = 0; - } -} - -return ((builders), ());", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_int(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_string_builder_append", - "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_replaceget_uint_int", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "builders~__tact_string_builder_append(sc); -return builders;", + "code": "var (r, ok) = udict_get?(d, kl, k); +if (ok) { + return r~load_uint(vl); +} else { + return null(); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_string_builder_append", + "depends": Set {}, + "flags": Set { + "inline", }, - "flags": Set {}, - "name": "__tact_string_builder_append_not_mut", - "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + "name": "__tact_dict_get_uint_uint", + "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var b = begin_cell(); -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} - -if (src < 1000000000000000000000000000000) { - int len = 0; - int value = 0; - int mult = 1; - do { - (src, int res) = src.divmod(10); - value = value + (res + 48) * mult; - mult = mult * 256; - len = len + 1; - } until (src == 0); - - b = b.store_uint(value, len * 8); + "code": "var (key, value, flag) = udict_get_min?(d, kl); +if (flag) { + return (key, value~load_uint(vl), flag); +} else { + return (null(), null(), flag); +}", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set {}, + "flags": Set { + "inline", + }, + "name": "__tact_dict_min_uint_uint", + "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + }, + { + "code": { + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_uint(vl), flag); } else { - tuple t = empty_tuple(); - int len = 0; - do { - int digit = src % 10; - t~tpush(digit); - len = len + 1; - src = src / 10; - } until (src == 0); - - int c = len - 1; - repeat(len) { - int v = t.at(c); - b = b.store_uint(v + 48, 8); - c = c - 1; - } -} -return b.end_cell().begin_parse();", + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_int_to_string", - "signature": "slice __tact_int_to_string(int src)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_next_uint_uint", + "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", }, { "code": { - "code": "throw_if(134, (digits <= 0) | (digits > 77)); -builder b = begin_cell(); - -if (src < 0) { - b = b.store_uint(45, 8); - src = - src; -} - -;; Process rem part -int skip = true; -int len = 0; -int rem = 0; -tuple t = empty_tuple(); -repeat(digits) { - (src, rem) = src.divmod(10); - if ( ~ ( skip & ( rem == 0 ) ) ) { - skip = false; - t~tpush(rem + 48); - len = len + 1; - } -} - -;; Process dot -if (~ skip) { - t~tpush(46); - len = len + 1; -} - -;; Main -do { - (src, rem) = src.divmod(10); - t~tpush(rem + 48); - len = len + 1; -} until (src == 0); - -;; Assemble -int c = len - 1; -repeat(len) { - int v = t.at(c); - b = b.store_uint(v, 8); - c = c - 1; -} - -;; Result -return b.end_cell().begin_parse();", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, ()); +} else { + return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); +}", "kind": "generic", }, "comment": null, "context": "stdlib", "depends": Set {}, - "flags": Set {}, - "name": "__tact_float_to_string", - "signature": "slice __tact_float_to_string(int src, int digits)", + "flags": Set { + "inline", + }, + "name": "__tact_dict_set_uint_uint", + "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "throw_unless(5, num > 0); -throw_unless(5, base > 1); -if (num < base) { - return 0; -} -int result = 0; -while (num >= base) { - num /= base; - result += 1; -} -return result;", + "code": "if (null?(v)) { + var (r, ok) = udict_delete?(d, kl, k); + return (r, (ok)); +} else { + return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); +}", "kind": "generic", }, "comment": null, @@ -10488,17 +14794,17 @@ return result;", "flags": Set { "inline", }, - "name": "__tact_log", - "signature": "int __tact_log(int num, int base)", + "name": "__tact_dict_replace_uint_uint", + "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "throw_unless(5, exp >= 0); -int result = 1; -repeat (exp) { - result *= base; -} -return result;", + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); +if (ok) { + return (d, old~load_uint(vl)); +} else { + return (d, null()); +}", "kind": "generic", }, "comment": null, @@ -10507,12 +14813,12 @@ return result;", "flags": Set { "inline", }, - "name": "__tact_pow", - "signature": "int __tact_pow(int base, int exp)", + "name": "__tact_dict_replaceget_uint_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get_ref?(d, kl, k); if (ok) { return r; } else { @@ -10522,18 +14828,16 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_slice", - "signature": "slice __tact_dict_get_slice_slice(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_cell", + "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); if (flag) { return (key, value, flag); } else { @@ -10543,76 +14847,73 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_slice", - "signature": "(slice, slice, int) __tact_dict_min_slice_slice(cell d, int kl)", + "name": "__tact_dict_min_uint_cell", + "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", }, { "code": { - "code": "return __tact_dict_next(d, kl, pivot);", + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); +if (flag) { + return (key, value~load_ref(), flag); +} else { + return (null(), null(), flag); +}", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_slice", - "signature": "(slice, slice, int) __tact_dict_next_slice_slice(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_uint_cell", + "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_slice(v)), ()); + return (udict_set_ref(d, kl, k, v), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_slice", - "signature": "(cell, ()) __tact_dict_set_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_dict_set_uint_cell", + "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_slice(v)); + return udict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_slice", - "signature": "(cell, (int)) __tact_dict_replace_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_dict_replace_uint_cell", + "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_slice(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); if (ok) { return (d, old); } else { @@ -10622,20 +14923,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_slice_slice(cell d, int kl, slice k, slice v)", + "name": "__tact_dict_replaceget_uint_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_coins(); } else { return null(); }", @@ -10643,20 +14942,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_int", - "signature": "int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl)", + "name": "__tact_dict_get_uint_coins", + "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -10664,20 +14961,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_int", - "signature": "(slice, int, int) __tact_dict_min_slice_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_coins", + "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -10685,62 +14980,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_int", - "signature": "(slice, int, int) __tact_dict_next_slice_int(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_next_uint_coins", + "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_int", - "signature": "(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_set_uint_coins", + "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_int", - "signature": "(cell, (int)) __tact_dict_replace_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replace_uint_coins", + "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -10748,20 +15037,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_int", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_int(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_varint16(); } else { return null(); }", @@ -10769,20 +15056,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_uint", - "signature": "int __tact_dict_get_slice_uint(cell d, int kl, slice k, int vl)", + "name": "__tact_dict_get_uint_varint16", + "signature": "int __tact_dict_get_uint_varint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -10790,20 +15075,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_uint", - "signature": "(slice, int, int) __tact_dict_min_slice_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_uint_varint16", + "signature": "(int, int, int) __tact_dict_min_uint_varint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -10811,62 +15094,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_uint", - "signature": "(slice, int, int) __tact_dict_next_slice_uint(cell d, int kl, slice pivot, int vl)", + "name": "__tact_dict_next_uint_varint16", + "signature": "(int, int, int) __tact_dict_next_uint_varint16(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_uint", - "signature": "(cell, ()) __tact_dict_set_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_set_uint_varint16", + "signature": "(cell, ()) __tact_dict_set_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_uint", - "signature": "(cell, (int)) __tact_dict_replace_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replace_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -10874,20 +15151,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_uint(cell d, int kl, slice k, int v, int vl)", + "name": "__tact_dict_replaceget_uint_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get_ref(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_varint32(); } else { return null(); }", @@ -10895,20 +15170,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_cell", - "signature": "cell __tact_dict_get_slice_cell(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_varint32", + "signature": "int __tact_dict_get_uint_varint32(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min_ref(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -10916,20 +15189,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_cell", - "signature": "(slice, cell, int) __tact_dict_min_slice_cell(cell d, int kl)", + "name": "__tact_dict_min_uint_varint32", + "signature": "(int, int, int) __tact_dict_min_uint_varint32(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -10937,64 +15208,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_cell", - "signature": "(slice, cell, int) __tact_dict_next_slice_cell(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_uint_varint32", + "signature": "(int, int, int) __tact_dict_next_uint_varint32(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return __tact_dict_set_ref(d, kl, k, v); + return (udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_set_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_cell", - "signature": "(cell, ()) __tact_dict_set_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_set_uint_varint32", + "signature": "(cell, ()) __tact_dict_set_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return __tact_dict_replace_ref(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - "__tact_dict_replace_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_cell", - "signature": "(cell, (int)) __tact_dict_replace_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_replace_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get_ref(kl, k) : d~__tact_dict_replaceget_ref(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varint32()); } else { return (d, null()); }", @@ -11002,21 +15265,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get_ref", - "__tact_dict_replaceget_ref", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_slice_cell(cell d, int kl, slice k, cell v)", + "name": "__tact_dict_replaceget_uint_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = __tact_dict_get(d, kl, k); + "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_varuint16(); } else { return null(); }", @@ -11024,20 +15284,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_get_slice_coins", - "signature": "int __tact_dict_get_slice_coins(cell d, int kl, slice k)", + "name": "__tact_dict_get_uint_varuint16", + "signature": "int __tact_dict_get_uint_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_min(d, kl); + "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -11045,20 +15303,18 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_min", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_min_slice_coins", - "signature": "(slice, int, int) __tact_dict_min_slice_coins(cell d, int kl)", + "name": "__tact_dict_min_uint_varuint16", + "signature": "(int, int, int) __tact_dict_min_uint_varuint16(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = __tact_dict_next(d, kl, pivot); + "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -11066,62 +15322,56 @@ if (flag) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_next", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_next_slice_coins", - "signature": "(slice, int, int) __tact_dict_next_slice_coins(cell d, int kl, slice pivot)", + "name": "__tact_dict_next_uint_varuint16", + "signature": "(int, int, int) __tact_dict_next_uint_varuint16(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_set_slice_coins", - "signature": "(cell, ()) __tact_dict_set_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_dict_set_uint_varuint16", + "signature": "(cell, ()) __tact_dict_set_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = __tact_dict_delete(d, kl, k); + var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return dict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); }", "kind": "generic", }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replace_slice_coins", - "signature": "(cell, (int)) __tact_dict_replace_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_dict_replace_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~__tact_dict_delete_get(kl, k) : d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_varuint16()); } else { return (d, null()); }", @@ -11129,20 +15379,18 @@ if (ok) { }, "comment": null, "context": "stdlib", - "depends": Set { - "__tact_dict_delete_get", - }, + "depends": Set {}, "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_slice_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_slice_coins(cell d, int kl, slice k, int v)", + "name": "__tact_dict_replaceget_uint_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint16(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = udict_get?(d, kl, k); if (ok) { - return r; + return r~load_varuint32(); } else { return null(); }", @@ -11154,14 +15402,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_slice", - "signature": "slice __tact_dict_get_uint_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_uint_varuint32", + "signature": "int __tact_dict_get_uint_varuint32(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = udict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -11173,14 +15421,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_slice", - "signature": "(int, slice, int) __tact_dict_min_uint_slice(cell d, int kl)", + "name": "__tact_dict_min_uint_varuint32", + "signature": "(int, int, int) __tact_dict_min_uint_varuint32(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -11192,8 +15440,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_slice", - "signature": "(int, slice, int) __tact_dict_next_uint_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_uint_varuint32", + "signature": "(int, int, int) __tact_dict_next_uint_varuint32(cell d, int kl, int pivot)", }, { "code": { @@ -11201,7 +15449,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set(d, kl, k, v), ()); + return (udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); }", "kind": "generic", }, @@ -11211,8 +15459,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_slice", - "signature": "(cell, ()) __tact_dict_set_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_uint_varuint32", + "signature": "(cell, ()) __tact_dict_set_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { @@ -11220,7 +15468,7 @@ if (flag) { var (r, ok) = udict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace?(d, kl, k, v); + return udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, @@ -11230,14 +15478,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_slice", - "signature": "(cell, (int)) __tact_dict_replace_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varuint32()); } else { return (d, null()); }", @@ -11249,14 +15497,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_uint_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_uint_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_uint_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r; } else { return null(); }", @@ -11268,14 +15516,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_int", - "signature": "int __tact_dict_get_uint_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_slice", + "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -11287,14 +15535,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_int", - "signature": "(int, int, int) __tact_dict_min_uint_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_slice", + "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -11306,16 +15554,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_int", - "signature": "(int, int, int) __tact_dict_next_uint_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_slice", + "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (idict_set(d, kl, k, v), ()); }", "kind": "generic", }, @@ -11325,16 +15573,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_int", - "signature": "(cell, ()) __tact_dict_set_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_slice", + "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return idict_replace?(d, kl, k, v); }", "kind": "generic", }, @@ -11344,14 +15592,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_int", - "signature": "(cell, (int)) __tact_dict_replace_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_slice", + "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); if (ok) { - return (d, old~load_int(vl)); + return (d, old); } else { return (d, null()); }", @@ -11363,14 +15611,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_int", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_slice", + "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_int(vl); } else { return null(); }", @@ -11382,14 +15630,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_uint", - "signature": "int __tact_dict_get_uint_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_int", + "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -11401,14 +15649,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_uint", - "signature": "(int, int, int) __tact_dict_min_uint_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_int", + "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_int(vl), flag); } else { return (null(), null(), flag); }", @@ -11420,16 +15668,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_uint", - "signature": "(int, int, int) __tact_dict_next_uint_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_int", + "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); }", "kind": "generic", }, @@ -11439,16 +15687,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_uint", - "signature": "(cell, ()) __tact_dict_set_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_int", + "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); }", "kind": "generic", }, @@ -11458,14 +15706,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_uint", - "signature": "(cell, (int)) __tact_dict_replace_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_int", + "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_int(vl)); } else { return (d, null()); }", @@ -11477,14 +15725,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_int", + "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = udict_get_ref?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_uint(vl); } else { return null(); }", @@ -11496,14 +15744,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_cell", - "signature": "cell __tact_dict_get_uint_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_int_uint", + "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -11515,14 +15763,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_cell", - "signature": "(int, cell, int) __tact_dict_min_uint_cell(cell d, int kl)", + "name": "__tact_dict_min_int_uint", + "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_uint(vl), flag); } else { return (null(), null(), flag); }", @@ -11534,16 +15782,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_cell", - "signature": "(int, cell, int) __tact_dict_next_uint_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_uint", + "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_ref(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); }", "kind": "generic", }, @@ -11553,16 +15801,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_cell", - "signature": "(cell, ()) __tact_dict_set_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_int_uint", + "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_ref?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); }", "kind": "generic", }, @@ -11572,14 +15820,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_cell", - "signature": "(cell, (int)) __tact_dict_replace_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_int_uint", + "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get_ref?(kl, k) : d~udict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_uint(vl)); } else { return (d, null()); }", @@ -11591,14 +15839,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_uint_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_int_uint", + "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", }, { "code": { - "code": "var (r, ok) = udict_get?(d, kl, k); + "code": "var (r, ok) = idict_get_ref?(d, kl, k); if (ok) { - return r~load_coins(); + return r; } else { return null(); }", @@ -11610,14 +15858,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_uint_coins", - "signature": "int __tact_dict_get_uint_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_int_cell", + "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = udict_get_min?(d, kl); + "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value, flag); } else { return (null(), null(), flag); }", @@ -11629,14 +15877,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_uint_coins", - "signature": "(int, int, int) __tact_dict_min_uint_coins(cell d, int kl)", + "name": "__tact_dict_min_int_cell", + "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", }, { "code": { - "code": "var (key, value, flag) = udict_get_next?(d, kl, pivot); + "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_ref(), flag); } else { return (null(), null(), flag); }", @@ -11648,16 +15896,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_uint_coins", - "signature": "(int, int, int) __tact_dict_next_uint_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_cell", + "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (idict_set_ref(d, kl, k, v), ()); }", "kind": "generic", }, @@ -11667,16 +15915,16 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_uint_coins", - "signature": "(cell, ()) __tact_dict_set_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_int_cell", + "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "if (null?(v)) { - var (r, ok) = udict_delete?(d, kl, k); + var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return udict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return idict_replace_ref?(d, kl, k, v); }", "kind": "generic", }, @@ -11686,14 +15934,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_uint_coins", - "signature": "(cell, (int)) __tact_dict_replace_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_int_cell", + "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~udict_delete_get?(kl, k) : d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); if (ok) { - return (d, old~load_coins()); + return (d, old); } else { return (d, null()); }", @@ -11705,14 +15953,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_uint_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_uint_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_int_cell", + "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_coins(); } else { return null(); }", @@ -11724,14 +15972,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_slice", - "signature": "slice __tact_dict_get_int_slice(cell d, int kl, int k)", + "name": "__tact_dict_get_int_coins", + "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -11743,14 +15991,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_slice", - "signature": "(int, slice, int) __tact_dict_min_int_slice(cell d, int kl)", + "name": "__tact_dict_min_int_coins", + "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value, flag); + return (key, value~load_coins(), flag); } else { return (null(), null(), flag); }", @@ -11762,8 +16010,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_slice", - "signature": "(int, slice, int) __tact_dict_next_int_slice(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_coins", + "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", }, { "code": { @@ -11771,7 +16019,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); }", "kind": "generic", }, @@ -11781,8 +16029,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_slice", - "signature": "(cell, ()) __tact_dict_set_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_set_int_coins", + "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", }, { "code": { @@ -11790,7 +16038,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); }", "kind": "generic", }, @@ -11800,14 +16048,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_slice", - "signature": "(cell, (int)) __tact_dict_replace_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replace_int_coins", + "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_coins()); } else { return (d, null()); }", @@ -11819,14 +16067,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_slice", - "signature": "(cell, (slice)) __tact_dict_replaceget_int_slice(cell d, int kl, int k, slice v)", + "name": "__tact_dict_replaceget_int_coins", + "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_int(vl); + return r~load_varint16(); } else { return null(); }", @@ -11838,14 +16086,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_int", - "signature": "int __tact_dict_get_int_int(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_varint16", + "signature": "int __tact_dict_get_int_varint16(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -11857,14 +16105,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_int", - "signature": "(int, int, int) __tact_dict_min_int_int(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_varint16", + "signature": "(int, int, int) __tact_dict_min_int_varint16(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_int(vl), flag); + return (key, value~load_varint16(), flag); } else { return (null(), null(), flag); }", @@ -11876,8 +16124,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_int", - "signature": "(int, int, int) __tact_dict_next_int_int(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_varint16", + "signature": "(int, int, int) __tact_dict_next_int_varint16(cell d, int kl, int pivot)", }, { "code": { @@ -11885,7 +16133,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ()); }", "kind": "generic", }, @@ -11895,8 +16143,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_int", - "signature": "(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_varint16", + "signature": "(cell, ()) __tact_dict_set_int_varint16(cell d, int kl, int k, int v)", }, { "code": { @@ -11904,7 +16152,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl)); + return idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v)); }", "kind": "generic", }, @@ -11914,14 +16162,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_int", - "signature": "(cell, (int)) __tact_dict_replace_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_varint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_int(vl)); + return (d, old~load_varint16()); } else { return (d, null()); }", @@ -11933,14 +16181,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_int", - "signature": "(cell, (int)) __tact_dict_replaceget_int_int(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_varint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint16(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_uint(vl); + return r~load_varint32(); } else { return null(); }", @@ -11952,14 +16200,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_uint", - "signature": "int __tact_dict_get_int_uint(cell d, int kl, int k, int vl)", + "name": "__tact_dict_get_int_varint32", + "signature": "int __tact_dict_get_int_varint32(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -11971,14 +16219,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_uint", - "signature": "(int, int, int) __tact_dict_min_int_uint(cell d, int kl, int vl)", + "name": "__tact_dict_min_int_varint32", + "signature": "(int, int, int) __tact_dict_min_int_varint32(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_uint(vl), flag); + return (key, value~load_varint32(), flag); } else { return (null(), null(), flag); }", @@ -11990,8 +16238,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_uint", - "signature": "(int, int, int) __tact_dict_next_int_uint(cell d, int kl, int pivot, int vl)", + "name": "__tact_dict_next_int_varint32", + "signature": "(int, int, int) __tact_dict_next_int_varint32(cell d, int kl, int pivot)", }, { "code": { @@ -11999,7 +16247,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ()); }", "kind": "generic", }, @@ -12009,8 +16257,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_uint", - "signature": "(cell, ()) __tact_dict_set_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_set_int_varint32", + "signature": "(cell, ()) __tact_dict_set_int_varint32(cell d, int kl, int k, int v)", }, { "code": { @@ -12018,7 +16266,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl)); + return idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v)); }", "kind": "generic", }, @@ -12028,14 +16276,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_uint", - "signature": "(cell, (int)) __tact_dict_replace_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replace_int_varint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_uint(vl)); + return (d, old~load_varint32()); } else { return (d, null()); }", @@ -12047,14 +16295,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_uint", - "signature": "(cell, (int)) __tact_dict_replaceget_int_uint(cell d, int kl, int k, int v, int vl)", + "name": "__tact_dict_replaceget_int_varint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (r, ok) = idict_get_ref?(d, kl, k); + "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r; + return r~load_varuint16(); } else { return null(); }", @@ -12066,14 +16314,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_cell", - "signature": "cell __tact_dict_get_int_cell(cell d, int kl, int k)", + "name": "__tact_dict_get_int_varuint16", + "signature": "int __tact_dict_get_int_varuint16(cell d, int kl, int k)", }, { "code": { - "code": "var (key, value, flag) = idict_get_min_ref?(d, kl); + "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value, flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -12085,14 +16333,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_cell", - "signature": "(int, cell, int) __tact_dict_min_int_cell(cell d, int kl)", + "name": "__tact_dict_min_int_varuint16", + "signature": "(int, int, int) __tact_dict_min_int_varuint16(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_ref(), flag); + return (key, value~load_varuint16(), flag); } else { return (null(), null(), flag); }", @@ -12104,8 +16352,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_cell", - "signature": "(int, cell, int) __tact_dict_next_int_cell(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_varuint16", + "signature": "(int, int, int) __tact_dict_next_int_varuint16(cell d, int kl, int pivot)", }, { "code": { @@ -12113,7 +16361,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_ref(d, kl, k, v), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ()); }", "kind": "generic", }, @@ -12123,8 +16371,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_cell", - "signature": "(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_set_int_varuint16", + "signature": "(cell, ()) __tact_dict_set_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { @@ -12132,7 +16380,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_ref?(d, kl, k, v); + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v)); }", "kind": "generic", }, @@ -12142,14 +16390,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_cell", - "signature": "(cell, (int)) __tact_dict_replace_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replace_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get_ref?(kl, k) : d~idict_replaceget_ref?(kl, k, v); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse()); if (ok) { - return (d, old); + return (d, old~load_varuint16()); } else { return (d, null()); }", @@ -12161,14 +16409,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_cell", - "signature": "(cell, (cell)) __tact_dict_replaceget_int_cell(cell d, int kl, int k, cell v)", + "name": "__tact_dict_replaceget_int_varuint16", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint16(cell d, int kl, int k, int v)", }, { "code": { "code": "var (r, ok) = idict_get?(d, kl, k); if (ok) { - return r~load_coins(); + return r~load_varuint32(); } else { return null(); }", @@ -12180,14 +16428,14 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_get_int_coins", - "signature": "int __tact_dict_get_int_coins(cell d, int kl, int k)", + "name": "__tact_dict_get_int_varuint32", + "signature": "int __tact_dict_get_int_varuint32(cell d, int kl, int k)", }, { "code": { "code": "var (key, value, flag) = idict_get_min?(d, kl); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -12199,14 +16447,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_min_int_coins", - "signature": "(int, int, int) __tact_dict_min_int_coins(cell d, int kl)", + "name": "__tact_dict_min_int_varuint32", + "signature": "(int, int, int) __tact_dict_min_int_varuint32(cell d, int kl)", }, { "code": { "code": "var (key, value, flag) = idict_get_next?(d, kl, pivot); if (flag) { - return (key, value~load_coins(), flag); + return (key, value~load_varuint32(), flag); } else { return (null(), null(), flag); }", @@ -12218,8 +16466,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_next_int_coins", - "signature": "(int, int, int) __tact_dict_next_int_coins(cell d, int kl, int pivot)", + "name": "__tact_dict_next_int_varuint32", + "signature": "(int, int, int) __tact_dict_next_int_varuint32(cell d, int kl, int pivot)", }, { "code": { @@ -12227,7 +16475,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, ()); } else { - return (idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ()); + return (idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ()); }", "kind": "generic", }, @@ -12237,8 +16485,8 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_set_int_coins", - "signature": "(cell, ()) __tact_dict_set_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_set_int_varuint32", + "signature": "(cell, ()) __tact_dict_set_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { @@ -12246,7 +16494,7 @@ if (flag) { var (r, ok) = idict_delete?(d, kl, k); return (r, (ok)); } else { - return idict_replace_builder?(d, kl, k, begin_cell().store_coins(v)); + return idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v)); }", "kind": "generic", }, @@ -12256,14 +16504,14 @@ if (flag) { "flags": Set { "inline", }, - "name": "__tact_dict_replace_int_coins", - "signature": "(cell, (int)) __tact_dict_replace_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replace_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replace_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { - "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse()); + "code": "var (old, ok) = null?(v) ? d~idict_delete_get?(kl, k) : d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse()); if (ok) { - return (d, old~load_coins()); + return (d, old~load_varuint32()); } else { return (d, null()); }", @@ -12275,8 +16523,8 @@ if (ok) { "flags": Set { "inline", }, - "name": "__tact_dict_replaceget_int_coins", - "signature": "(cell, (int)) __tact_dict_replaceget_int_coins(cell d, int kl, int k, int v)", + "name": "__tact_dict_replaceget_int_varuint32", + "signature": "(cell, (int)) __tact_dict_replaceget_int_varuint32(cell d, int kl, int k, int v)", }, { "code": { diff --git a/src/generator/writers/writeFunction.ts b/src/generator/writers/writeFunction.ts index a5536b642..5c24f63ed 100644 --- a/src/generator/writers/writeFunction.ts +++ b/src/generator/writers/writeFunction.ts @@ -285,17 +285,23 @@ export function writeStatement( kind = "uint"; } if (t.value === "Int") { - let vBits = 257; + let vBits = ", 257"; let vKind = "int"; if (t.valueAs?.startsWith("int")) { - vBits = parseInt(t.valueAs.slice(3), 10); + vBits = `, ${parseInt(t.valueAs.slice(3), 10)}`; } else if (t.valueAs?.startsWith("uint")) { - vBits = parseInt(t.valueAs.slice(4), 10); + vBits = `, ${parseInt(t.valueAs.slice(4), 10)}`; vKind = "uint"; + } else if (t.valueAs?.startsWith("coins")) { + vBits = ""; + vKind = "coins"; + } else if (t.valueAs?.startsWith("var")) { + vBits = ""; + vKind = t.valueAs; } ctx.append( - `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_${kind}_${vKind}`)}(${path}, ${bits}, ${vBits});`, + `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_${kind}_${vKind}`)}(${path}, ${bits}${vBits});`, ); ctx.append(`while (${flag}) {`); ctx.inIndent(() => { @@ -303,7 +309,7 @@ export function writeStatement( writeStatement(s, self, returns, ctx); } ctx.append( - `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_${kind}_${vKind}`)}(${path}, ${bits}, ${key}, ${vBits});`, + `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_${kind}_${vKind}`)}(${path}, ${bits}, ${key}${vBits});`, ); }); ctx.append(`}`); @@ -373,16 +379,22 @@ export function writeStatement( // Handle address key if (t.key === "Address") { if (t.value === "Int") { - let vBits = 257; + let vBits = ", 257"; let vKind = "int"; if (t.valueAs?.startsWith("int")) { - vBits = parseInt(t.valueAs.slice(3), 10); + vBits = `, ${parseInt(t.valueAs.slice(3), 10)}`; } else if (t.valueAs?.startsWith("uint")) { - vBits = parseInt(t.valueAs.slice(4), 10); + vBits = `, ${parseInt(t.valueAs.slice(4), 10)}`; vKind = "uint"; + } else if (t.valueAs?.startsWith("coins")) { + vBits = ""; + vKind = "coins"; + } else if (t.valueAs?.startsWith("var")) { + vBits = ""; + vKind = t.valueAs; } ctx.append( - `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_slice_${vKind}`)}(${path}, 267, ${vBits});`, + `var (${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_min_slice_${vKind}`)}(${path}, 267${vBits});`, ); ctx.append(`while (${flag}) {`); ctx.inIndent(() => { @@ -390,7 +402,7 @@ export function writeStatement( writeStatement(s, self, returns, ctx); } ctx.append( - `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_slice_${vKind}`)}(${path}, 267, ${key}, ${vBits});`, + `(${key}, ${value}, ${flag}) = ${ctx.used(`__tact_dict_next_slice_${vKind}`)}(${path}, 267, ${key}${vBits});`, ); }); ctx.append(`}`); diff --git a/src/generator/writers/writeSerialization.ts b/src/generator/writers/writeSerialization.ts index a51bfba09..a9b593a80 100644 --- a/src/generator/writers/writeSerialization.ts +++ b/src/generator/writers/writeSerialization.ts @@ -143,14 +143,17 @@ function writeSerializerField( } return; } - case "coins": { + case "varint16": + case "varuint16": + case "varint32": + case "varuint32": { if (op.optional) { ctx.append( - `build_${gen} = ~ null?(${fieldName}) ? build_${gen}.store_int(true, 1).store_coins(${fieldName}) : build_${gen}.store_int(false, 1);`, + `build_${gen} = ~ null?(${fieldName}) ? build_${gen}.store_int(true, 1).store_${op.kind}(${fieldName}) : build_${gen}.store_int(false, 1);`, ); } else { ctx.append( - `build_${gen} = build_${gen}.store_coins(${fieldName});`, + `build_${gen} = build_${gen}.store_${op.kind}(${fieldName});`, ); } return; @@ -489,13 +492,16 @@ function writeFieldParser( } return; } - case "coins": { + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": { if (op.optional) { ctx.append( - `${varName} = sc_${gen}~load_int(1) ? sc_${gen}~load_coins() : null();`, + `${varName} = sc_${gen}~load_int(1) ? sc_${gen}~load_${op.kind}() : null();`, ); } else { - ctx.append(`${varName} = sc_${gen}~load_coins();`); + ctx.append(`${varName} = sc_${gen}~load_${op.kind}();`); } return; } diff --git a/src/generator/writers/writeStdlib.ts b/src/generator/writers/writeStdlib.ts index 13e06f807..0872ff474 100644 --- a/src/generator/writers/writeStdlib.ts +++ b/src/generator/writers/writeStdlib.ts @@ -1122,7 +1122,17 @@ export function writeStdlib(ctx: WriterContext): void { const keyTypes = ["slice", "uint", "int"] as const; type KeyType = (typeof keyTypes)[number]; -const valTypes = ["slice", "int", "uint", "cell", "coins"] as const; +const valTypes = [ + "slice", + "int", + "uint", + "cell", + "coins", + "varint16", + "varint32", + "varuint16", + "varuint32", +] as const; type ValType = (typeof valTypes)[number]; function getSignatureKeyType(key: KeyType): KeyType { @@ -1130,7 +1140,7 @@ function getSignatureKeyType(key: KeyType): KeyType { } function getSignatureValueType(value: ValType): ValType { - return value === "uint" || value === "coins" ? "int" : value; + return value === "slice" || value === "cell" ? value : "int"; } function genTactDictGet( @@ -1162,6 +1172,14 @@ function genTactDictGet( return "r~load_int(vl)"; case "coins": return "r~load_coins()"; + case "varint16": + return "r~load_varint16()"; + case "varint32": + return "r~load_varint32()"; + case "varuint16": + return "r~load_varuint16()"; + case "varuint32": + return "r~load_varuint32()"; } }; const valBitsArg = () => { @@ -1169,6 +1187,10 @@ function genTactDictGet( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1233,6 +1255,10 @@ function genTactDictSet( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1254,12 +1280,24 @@ function genTactDictSet( .on("int", "int")(() => "(idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())") .on("int", "uint")(() => "(idict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())") .on("int", "coins")(() => "(idict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())") + .on("int", "varint16")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ())") + .on("int", "varint32")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ())") + .on("int", "varuint16")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ())") + .on("int", "varuint32")(() => "(idict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ())") .on("uint", "int")(() => "(udict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())") .on("uint", "uint")(() => "(udict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())") .on("uint", "coins")(() => "(udict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())") + .on("uint", "varint16")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ())") + .on("uint", "varint32")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ())") + .on("uint", "varuint16")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ())") + .on("uint", "varuint32")(() => "(udict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ())") .on("slice", "int")(() => "(dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ())") .on("slice", "uint")(() => "(dict_set_builder(d, kl, k, begin_cell().store_uint(v, vl)), ())") .on("slice", "coins")(() => "(dict_set_builder(d, kl, k, begin_cell().store_coins(v)), ())") + .on("slice", "varint16")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varint16(v)), ())") + .on("slice", "varint32")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varint32(v)), ())") + .on("slice", "varuint16")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varuint16(v)), ())") + .on("slice", "varuint32")(() => "(dict_set_builder(d, kl, k, begin_cell().store_varuint32(v)), ())") .on("int", "cell")(() => "(idict_set_ref(d, kl, k, v), ())") .on("uint", "cell")(() => "(udict_set_ref(d, kl, k, v), ())") .on("int", "slice")(() => "(idict_set(d, kl, k, v), ())") @@ -1298,6 +1336,10 @@ function genTactDictGetMin( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1309,14 +1351,26 @@ function genTactDictGetMin( .on("int", "int")(() => "idict_get_min?") .on("int", "uint")(() => "idict_get_min?") .on("int", "coins")(() => "idict_get_min?") + .on("int", "varint16")(() => "idict_get_min?") + .on("int", "varint32")(() => "idict_get_min?") + .on("int", "varuint16")(() => "idict_get_min?") + .on("int", "varuint32")(() => "idict_get_min?") .on("int", "slice")(() => "idict_get_min?") .on("uint", "int")(() => "udict_get_min?") .on("uint", "uint")(() => "udict_get_min?") .on("uint", "coins")(() => "udict_get_min?") + .on("uint", "varint16")(() => "udict_get_min?") + .on("uint", "varint32")(() => "udict_get_min?") + .on("uint", "varuint16")(() => "udict_get_min?") + .on("uint", "varuint32")(() => "udict_get_min?") .on("uint", "slice")(() => "udict_get_min?") .on("slice", "int")(() => ctx.used("__tact_dict_min")) .on("slice", "uint")(() => ctx.used("__tact_dict_min")) .on("slice", "coins")(() => ctx.used("__tact_dict_min")) + .on("slice", "varint16")(() => ctx.used("__tact_dict_min")) + .on("slice", "varint32")(() => ctx.used("__tact_dict_min")) + .on("slice", "varuint16")(() => ctx.used("__tact_dict_min")) + .on("slice", "varuint32")(() => ctx.used("__tact_dict_min")) .on("slice", "slice")(() => ctx.used("__tact_dict_min")) .on("int", "cell")(() => "idict_get_min_ref?") .on("uint", "cell")(() => "udict_get_min_ref?") @@ -1330,6 +1384,14 @@ function genTactDictGetMin( return "value~load_uint(vl)"; case "coins": return "value~load_coins()"; + case "varint16": + return "value~load_varint16()"; + case "varint32": + return "value~load_varint32()"; + case "varuint16": + return "value~load_varuint16()"; + case "varuint32": + return "value~load_varuint32()"; case "slice": case "cell": return "value"; @@ -1366,6 +1428,10 @@ function genTactDictGetNext( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1390,6 +1456,14 @@ function genTactDictGetNext( return "value~load_uint(vl)"; case "coins": return "value~load_coins()"; + case "varint16": + return "value~load_varint16()"; + case "varint32": + return "value~load_varint32()"; + case "varuint16": + return "value~load_varuint16()"; + case "varuint32": + return "value~load_varuint32()"; case "slice": return "value"; case "cell": @@ -1433,6 +1507,10 @@ function genTactDictReplace( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1454,12 +1532,24 @@ function genTactDictReplace( .on("int", "int")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))") .on("int", "uint")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))") .on("int", "coins")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_coins(v))") + .on("int", "varint16")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varint16(v))") + .on("int", "varint32")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varint32(v))") + .on("int", "varuint16")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v))") + .on("int", "varuint32")(() => "idict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v))") .on("uint", "int")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))") .on("uint", "uint")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))") .on("uint", "coins")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_coins(v))") + .on("uint", "varint16")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varint16(v))") + .on("uint", "varint32")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varint32(v))") + .on("uint", "varuint16")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v))") + .on("uint", "varuint32")(() => "udict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v))") .on("slice", "int")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_int(v, vl))") .on("slice", "uint")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_uint(v, vl))") .on("slice", "coins")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_coins(v))") + .on("slice", "varint16")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varint16(v))") + .on("slice", "varint32")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varint32(v))") + .on("slice", "varuint16")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varuint16(v))") + .on("slice", "varuint32")(() => "dict_replace_builder?(d, kl, k, begin_cell().store_varuint32(v))") .on("int", "cell")(() => "idict_replace_ref?(d, kl, k, v)") .on("uint", "cell")(() => "udict_replace_ref?(d, kl, k, v)") .on("int", "slice")(() => "idict_replace?(d, kl, k, v)") @@ -1498,6 +1588,10 @@ function genTactDictReplaceGet( case "slice": case "cell": case "coins": + case "varint16": + case "varint32": + case "varuint16": + case "varuint32": return ""; case "uint": case "int": @@ -1520,12 +1614,24 @@ function genTactDictReplaceGet( .on("int", "int")(() => "d~idict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())") .on("int", "uint")(() => "d~idict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())") .on("int", "coins")(() => "d~idict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())") + .on("int", "varint16")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse())") + .on("int", "varint32")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse())") + .on("int", "varuint16")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse())") + .on("int", "varuint32")(() => "d~idict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse())") .on("uint", "int")(() => "d~udict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())") .on("uint", "uint")(() => "d~udict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())") .on("uint", "coins")(() => "d~udict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())") + .on("uint", "varint16")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse())") + .on("uint", "varint32")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse())") + .on("uint", "varuint16")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse())") + .on("uint", "varuint32")(() => "d~udict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse())") .on("slice", "int")(() => "d~dict_replaceget?(kl, k, begin_cell().store_int(v, vl).end_cell().begin_parse())") .on("slice", "uint")(() => "d~dict_replaceget?(kl, k, begin_cell().store_uint(v, vl).end_cell().begin_parse())") .on("slice", "coins")(() => "d~dict_replaceget?(kl, k, begin_cell().store_coins(v).end_cell().begin_parse())") + .on("slice", "varint16")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varint16(v).end_cell().begin_parse())") + .on("slice", "varint32")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varint32(v).end_cell().begin_parse())") + .on("slice", "varuint16")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varuint16(v).end_cell().begin_parse())") + .on("slice", "varuint32")(() => "d~dict_replaceget?(kl, k, begin_cell().store_varuint32(v).end_cell().begin_parse())") .on("int", "cell")(() => "d~idict_replaceget_ref?(kl, k, v)") .on("uint", "cell")(() => "d~udict_replaceget_ref?(kl, k, v)") .on("int", "slice")(() => "d~idict_replaceget?(kl, k, v)") @@ -1544,6 +1650,14 @@ function genTactDictReplaceGet( return "old~load_int(vl)"; case "coins": return "old~load_coins()"; + case "varint16": + return "old~load_varint16()"; + case "varint32": + return "old~load_varint32()"; + case "varuint16": + return "old~load_varuint16()"; + case "varuint32": + return "old~load_varuint32()"; } }; ctx.fun(`__tact_dict_replaceget_${key}_${value}`, () => { diff --git a/src/imports/stdlib.ts b/src/imports/stdlib.ts index f38b5ce7c..27563ec77 100644 --- a/src/imports/stdlib.ts +++ b/src/imports/stdlib.ts @@ -133,64 +133,67 @@ files['std/cells.tact'] = 'PSBiLnN0b3JlQml0KHRydWUpOyAgLy8gd3JpdGVzIDEKLy8vICAgICBsZXQgYnV6ejogQnVpbGRlciA9IGIuc3RvcmVCaXQoZmFsc2UpOyAvLyB3cml0ZXMgMAovLy8g' + 'fQovLy8gYGBgCi8vLwovLy8gU2VlOiBodHRwczovL2RvY3MudGFjdC1sYW5nLm9yZy9yZWYvY29yZS1jZWxscyNidWlsZGVyc3RvcmViaXQKLy8vCkBuYW1lKF9fdGFj' + 'dF9zdG9yZV9ib29sKQpleHRlbmRzIG5hdGl2ZSBzdG9yZUJpdChzZWxmOiBCdWlsZGVyLCB2YWx1ZTogQm9vbCk6IEJ1aWxkZXI7Cgphc20gZXh0ZW5kcyBmdW4gc3Rv' + - 'cmVDb2lucyhzZWxmOiBCdWlsZGVyLCB2YWx1ZTogSW50KTogQnVpbGRlciB7IFNUVkFSVUlOVDE2IH0KCmFzbShjZWxsIHNlbGYpIGV4dGVuZHMgZnVuIHN0b3JlUmVm' + - 'KHNlbGY6IEJ1aWxkZXIsIGNlbGw6IENlbGwpOiBCdWlsZGVyIHsgU1RSRUYgfQoKYXNtIGV4dGVuZHMgZnVuIHN0b3JlU2xpY2Uoc2VsZjogQnVpbGRlciwgY2VsbDog' + - 'U2xpY2UpOiBCdWlsZGVyIHsgU1RTTElDRVIgfQoKLy8vIEV4dGVuc2lvbiBmdW5jdGlvbiBmb3IgdGhlIGBCdWlsZGVyYC4gQXZhaWxhYmxlIHNpbmNlIFRhY3QgMS41' + - 'LjAuCi8vLwovLy8gQXBwZW5kcyBhbGwgZGF0YSBmcm9tIGEgYEJ1aWxkZXJgIGBjZWxsYCB0byB0aGUgY29weSBvZiB0aGUgYEJ1aWxkZXJgLiBSZXR1cm5zIHRoYXQg' + - 'Y29weS4KLy8vCi8vLyBgYGB0YWN0Ci8vLyBmdW4gZXhhbXBsZSgpIHsKLy8vICAgICBsZXQgYjogQnVpbGRlciA9IGJlZ2luQ2VsbCgpLnN0b3JlQ29pbnMoNDIpOwov' + - 'Ly8gICAgIGxldCBmaXp6OiBCdWlsZGVyID0gYmVnaW5DZWxsKCkuc3RvcmVCdWlsZGVyKGIpOwovLy8gICAgIGIuZW5kQ2VsbCgpID09IGZpenouZW5kQ2VsbCgpOyAv' + - 'LyB0cnVlCi8vLyB9Ci8vLyBgYGAKLy8vCi8vLyBTZWU6IGh0dHBzOi8vZG9jcy50YWN0LWxhbmcub3JnL3JlZi9jb3JlLWNlbGxzI2J1aWxkZXJzdG9yZWJ1aWxkZXIK' + - 'Ly8vCmFzbSBleHRlbmRzIGZ1biBzdG9yZUJ1aWxkZXIoc2VsZjogQnVpbGRlciwgY2VsbDogQnVpbGRlcik6IEJ1aWxkZXIgeyBTVEJSIH0KCkBuYW1lKF9fdGFjdF9z' + - 'dG9yZV9hZGRyZXNzKQpleHRlbmRzIG5hdGl2ZSBzdG9yZUFkZHJlc3Moc2VsZjogQnVpbGRlciwgYWRkcmVzczogQWRkcmVzcyk6IEJ1aWxkZXI7CgovLy8gRXh0ZW5z' + - 'aW9uIGZ1bmN0aW9uIGZvciB0aGUgYEJ1aWxkZXJgLiBBdmFpbGFibGUgc2luY2UgVGFjdCAxLjUuMC4KLy8vCi8vLyBJZiB0aGUgYGNlbGxgIGlzIG5vdCBgbnVsbGAs' + - 'IHN0b3JlcyAxIGFzIGEgc2luZ2xlIGJpdCBhbmQgdGhlbiByZWZlcmVuY2UgYGNlbGxgIGludG8gdGhlIGNvcHkgb2YgdGhlIGBCdWlsZGVyYC4gUmV0dXJucyB0aGF0' + - 'IGNvcHkuCi8vLwovLy8gSWYgdGhlIGBjZWxsYCBpcyBgbnVsbGAsIG9ubHkgc3RvcmVzIDAgYXMgYSBzaW5nbGUgYml0IGludG8gdGhlIGNvcHkgb2YgdGhlIGBCdWls' + - 'ZGVyYC4gUmV0dXJucyB0aGF0IGNvcHkuCi8vLwovLy8gQXMgYSBzaW5nbGUgYENlbGxgIGNhbiBzdG9yZSB1cCB0byA0IHJlZmVyZW5jZXMsIGF0dGVtcHRzIHRvIHN0' + - 'b3JlIG1vcmUgdGhyb3cgYW4gZXhjZXB0aW9uIHdpdGggZXhpdCBjb2RlIDg6IGBDZWxsIG92ZXJmbG93YC4KLy8vCi8vLyBgYGB0YWN0Ci8vLyBmdW4gZXhhbXBsZSgp' + - 'IHsKLy8vICAgICBsZXQgYjogQnVpbGRlciA9IGJlZ2luQ2VsbCgpOwovLy8gICAgIGxldCBmaXp6OiBCdWlsZGVyID0gYgovLy8gICAgICAgICAuc3RvcmVNYXliZVJl' + - 'ZihlbXB0eUNlbGwoKSkgLy8gMSwgdGhlbiBlbXB0eSBjZWxsCi8vLyAgICAgICAgIC5zdG9yZU1heWJlUmVmKG51bGwpOyAgICAgICAvLyAwCi8vLyB9Ci8vLyBgYGAK' + - 'Ly8vCi8vLyBTZWU6IGh0dHBzOi8vZG9jcy50YWN0LWxhbmcub3JnL3JlZi9jb3JlLWNlbGxzI2J1aWxkZXJzdG9yZW1heWJlcmVmCi8vLwphc20oY2VsbCBzZWxmKSBl' + - 'eHRlbmRzIGZ1biBzdG9yZU1heWJlUmVmKHNlbGY6IEJ1aWxkZXIsIGNlbGw6IENlbGw/KTogQnVpbGRlciB7IFNUT1BUUkVGIH0KCmFzbSBleHRlbmRzIGZ1biBlbmRD' + - 'ZWxsKHNlbGY6IEJ1aWxkZXIpOiBDZWxsIHsgRU5EQyB9Cgphc20gZXh0ZW5kcyBmdW4gcmVmcyhzZWxmOiBCdWlsZGVyKTogSW50IHsgQlJFRlMgfQoKYXNtIGV4dGVu' + - 'ZHMgZnVuIGJpdHMoc2VsZjogQnVpbGRlcik6IEludCB7IEJCSVRTIH0KCi8vCi8vIFNsaWNlCi8vCgphc20gZXh0ZW5kcyBmdW4gYmVnaW5QYXJzZShzZWxmOiBDZWxs' + - 'KTogU2xpY2UgeyBDVE9TIH0KCmFzbSgtPiAxIDApIGV4dGVuZHMgbXV0YXRlcyBmdW4gbG9hZFJlZihzZWxmOiBTbGljZSk6IENlbGwgeyBMRFJFRiB9CgovLy8gRXh0' + - 'ZW5zaW9uIGZ1bmN0aW9uIGZvciB0aGUgYFNsaWNlYC4gQXZhaWxhYmxlIHNpbmNlIFRhY3QgMS41LjAuCi8vLwovLy8gUHJlbG9hZHMgdGhlIG5leHQgcmVmZXJlbmNl' + - 'IGZyb20gdGhlIGBTbGljZWAgYXMgYSBgQ2VsbGAuIERvZXNuJ3QgbW9kaWZ5IHRoZSBvcmlnaW5hbCBgU2xpY2VgLgovLy8KLy8vIEF0dGVtcHRzIHRvIHByZWxvYWQg' + - 'c3VjaCByZWZlcmVuY2UgYENlbGxgIHdoZW4gYFNsaWNlYCBkb2Vzbid0IGNvbnRhaW4gaXQgdGhyb3cgYW4gZXhjZXB0aW9uIHdpdGggZXhpdCBjb2RlIDg6IGBDZWxs' + - 'IG92ZXJmbG93YC4KLy8vCi8vLyBBdHRlbXB0cyB0byBwcmVsb2FkIG1vcmUgZGF0YSB0aGFuIGBTbGljZWAgY29udGFpbnMgdGhyb3cgYW4gZXhjZXB0aW9uIHdpdGgg' + - 'ZXhpdCBjb2RlIDk6IGBDZWxsIHVuZGVyZmxvd2AuCi8vLwovLy8gYGBgdGFjdAovLy8gZnVuIGV4YW1wbGVzKCkgewovLy8gICAgIGxldCBzMTogU2xpY2UgPSBiZWdp' + - 'bkNlbGwoKS5zdG9yZVJlZihlbXB0eUNlbGwoKSkuYXNTbGljZSgpOwovLy8gICAgIGxldCBmaXp6OiBDZWxsID0gczEucHJlbG9hZFJlZigpOyAvLyBkaWRuJ3QgbW9k' + - 'aWZ5IHMxCi8vLwovLy8gICAgIGxldCBzMjogU2xpY2UgPSBiZWdpbkNlbGwoKQovLy8gICAgICAgICAuc3RvcmVSZWYoZW1wdHlDZWxsKCkpCi8vLyAgICAgICAgIC5z' + - 'dG9yZVJlZihzMS5hc0NlbGwoKSkKLy8vICAgICAgICAgLmFzU2xpY2UoKTsKLy8vICAgICBsZXQgcmVmMTogQ2VsbCA9IHMyLnByZWxvYWRSZWYoKTsKLy8vICAgICBs' + - 'ZXQgcmVmMjogQ2VsbCA9IHMyLnByZWxvYWRSZWYoKTsKLy8vICAgICByZWYxID09IHJlZjI7IC8vIHRydWUKLy8vIH0KLy8vIGBgYAovLy8KLy8vIFNlZToKLy8vICog' + - 'aHR0cHM6Ly9kb2NzLnRhY3QtbGFuZy5vcmcvcmVmL2NvcmUtY2VsbHMjc2xpY2VwcmVsb2FkcmVmCi8vLyAqIGh0dHBzOi8vZG9jcy50YWN0LWxhbmcub3JnL2Jvb2sv' + - 'ZXhpdC1jb2RlcwovLy8KYXNtIGV4dGVuZHMgZnVuIHByZWxvYWRSZWYoc2VsZjogU2xpY2UpOiBDZWxsIHsgUExEUkVGIH0KCi8vIHNwZWNpYWwgdHJlYXRtZW50IGlu' + - 'IEZ1bmMgY29tcGlsZXIsIHNvIG5vdCByZXBsYWNlZCB3aXRoIGFzbSAiTERTTElDRVgiCkBuYW1lKGxvYWRfYml0cykKZXh0ZW5kcyBtdXRhdGVzIG5hdGl2ZSBsb2Fk' + - 'Qml0cyhzZWxmOiBTbGljZSwgbDogSW50KTogU2xpY2U7CgovLyBzcGVjaWFsIHRyZWF0bWVudCBpbiBGdW5jIGNvbXBpbGVyLCBzbyBub3QgcmVwbGFjZWQgd2l0aCBh' + - 'c20gIlBMRFNMSUNFWCIKQG5hbWUocHJlbG9hZF9iaXRzKQpleHRlbmRzIG5hdGl2ZSBwcmVsb2FkQml0cyhzZWxmOiBTbGljZSwgbDogSW50KTogU2xpY2U7CgovLyBz' + - 'cGVjaWFsIHRyZWF0bWVudCBpbiBGdW5jIGNvbXBpbGVyLCBzbyBub3QgcmVwbGFjZWQgd2l0aCBhc20gIkxESVgiCkBuYW1lKGxvYWRfaW50KQpleHRlbmRzIG11dGF0' + - 'ZXMgbmF0aXZlIGxvYWRJbnQoc2VsZjogU2xpY2UsIGw6IEludCk6IEludDsKCi8vIHNwZWNpYWwgdHJlYXRtZW50IGluIEZ1bmMgY29tcGlsZXIsIHNvIG5vdCByZXBs' + - 'YWNlZCB3aXRoIGFzbSAiUExESVgiCkBuYW1lKHByZWxvYWRfaW50KQpleHRlbmRzIG5hdGl2ZSBwcmVsb2FkSW50KHNlbGY6IFNsaWNlLCBsOiBJbnQpOiBJbnQ7Cgov' + - 'LyBzcGVjaWFsIHRyZWF0bWVudCBpbiBGdW5jIGNvbXBpbGVyLCBzbyBub3QgcmVwbGFjZWQgd2l0aCBhc20gIkxEVVgiCkBuYW1lKGxvYWRfdWludCkKZXh0ZW5kcyBt' + - 'dXRhdGVzIG5hdGl2ZSBsb2FkVWludChzZWxmOiBTbGljZSwgbDogSW50KTogSW50OwoKLy8gc3BlY2lhbCB0cmVhdG1lbnQgaW4gRnVuYyBjb21waWxlciwgc28gbm90' + - 'IHJlcGxhY2VkIHdpdGggYXNtICJQTERVWCIKQG5hbWUocHJlbG9hZF91aW50KQpleHRlbmRzIG5hdGl2ZSBwcmVsb2FkVWludChzZWxmOiBTbGljZSwgbDogSW50KTog' + - 'SW50OwoKYXNtKC0+IDEgMCkgZXh0ZW5kcyBtdXRhdGVzIGZ1biBsb2FkQm9vbChzZWxmOiBTbGljZSk6IEJvb2wgeyAxIExESSB9CgovLy8gRXh0ZW5zaW9uIG11dGF0' + - 'aW9uIGZ1bmN0aW9uIGZvciB0aGUgYFNsaWNlYC4gQWxpYXMgdG8gYFNsaWNlLmxvYWRCb29sKClgLiBBdmFpbGFibGUgc2luY2UgVGFjdCAxLjUuMC4KLy8vCi8vLyBg' + - 'YGB0YWN0Ci8vLyBmdW4gZXhhbXBsZSgpIHsKLy8vICAgICBsZXQgczogU2xpY2UgPSBiZWdpbkNlbGwoKS5zdG9yZUJvb2wodHJ1ZSkuYXNTbGljZSgpOwovLy8gICAg' + - 'IGxldCBmaXp6OiBCb29sID0gcy5sb2FkQml0KCk7IC8vIHRydWUKLy8vIH0KLy8vIGBgYAovLy8KLy8vIFNlZTogaHR0cHM6Ly9kb2NzLnRhY3QtbGFuZy5vcmcvcmVm' + - 'L2NvcmUtY2VsbHMjc2xpY2Vsb2FkYml0Ci8vLwphc20oLT4gMSAwKSBleHRlbmRzIG11dGF0ZXMgZnVuIGxvYWRCaXQoc2VsZjogU2xpY2UpOiBCb29sIHsgMSBMREkg' + - 'fQoKYXNtKCAtPiAxIDApIGV4dGVuZHMgbXV0YXRlcyBmdW4gbG9hZENvaW5zKHNlbGY6IFNsaWNlKTogSW50IHsgTERWQVJVSU5UMTYgfQoKQG5hbWUoX190YWN0X2xv' + - 'YWRfYWRkcmVzcykKZXh0ZW5kcyBtdXRhdGVzIG5hdGl2ZSBsb2FkQWRkcmVzcyhzZWxmOiBTbGljZSk6IEFkZHJlc3M7Cgphc20gZXh0ZW5kcyBtdXRhdGVzIGZ1biBz' + - 'a2lwQml0cyhzZWxmOiBTbGljZSwgbDogSW50KSB7IFNEU0tJUEZJUlNUIH0KCmFzbSBleHRlbmRzIGZ1biBlbmRQYXJzZShzZWxmOiBTbGljZSkgeyBFTkRTIH0KCi8v' + - 'Ci8vIFNsaWNlIHNpemUKLy8KCmFzbSBleHRlbmRzIGZ1biByZWZzKHNlbGY6IFNsaWNlKTogSW50IHsgU1JFRlMgfQoKYXNtIGV4dGVuZHMgZnVuIGJpdHMoc2VsZjog' + - 'U2xpY2UpOiBJbnQgeyBTQklUUyB9Cgphc20gZXh0ZW5kcyBmdW4gZW1wdHkoc2VsZjogU2xpY2UpOiBCb29sIHsgU0VNUFRZIH0KCmFzbSBleHRlbmRzIGZ1biBkYXRh' + - 'RW1wdHkoc2VsZjogU2xpY2UpOiBCb29sIHsgU0RFTVBUWSB9Cgphc20gZXh0ZW5kcyBmdW4gcmVmc0VtcHR5KHNlbGY6IFNsaWNlKTogQm9vbCB7IFNSRU1QVFkgfQoK' + - 'Ly8KLy8gQ29udmVyc2lvbnMKLy8KCmlubGluZSBleHRlbmRzIGZ1biBhc1NsaWNlKHNlbGY6IEJ1aWxkZXIpOiBTbGljZSB7CiAgICByZXR1cm4gc2VsZi5lbmRDZWxs' + - 'KCkuYmVnaW5QYXJzZSgpOwp9CgppbmxpbmUgZXh0ZW5kcyBmdW4gYXNTbGljZShzZWxmOiBDZWxsKTogU2xpY2UgewogICAgcmV0dXJuIHNlbGYuYmVnaW5QYXJzZSgp' + - 'Owp9CgppbmxpbmUgZXh0ZW5kcyBmdW4gYXNDZWxsKHNlbGY6IFNsaWNlKTogQ2VsbCB7CiAgICByZXR1cm4gYmVnaW5DZWxsKCkKICAgICAgICAuc3RvcmVTbGljZShz' + - 'ZWxmKQogICAgICAgIC5lbmRDZWxsKCk7Cn0KCmlubGluZSBleHRlbmRzIGZ1biBhc0NlbGwoc2VsZjogQnVpbGRlcik6IENlbGwgewogICAgcmV0dXJuIHNlbGYuZW5k' + - 'Q2VsbCgpOwp9CgppbmxpbmUgZnVuIGVtcHR5Q2VsbCgpOiBDZWxsIHsKICAgIHJldHVybiBiZWdpbkNlbGwoKS5lbmRDZWxsKCk7Cn0KCmlubGluZSBmdW4gZW1wdHlT' + - 'bGljZSgpOiBTbGljZSB7CiAgICByZXR1cm4gZW1wdHlDZWxsKCkuYXNTbGljZSgpOwp9Cg=='; + 'cmVDb2lucyhzZWxmOiBCdWlsZGVyLCB2YWx1ZTogSW50KTogQnVpbGRlciB7IFNUVkFSVUlOVDE2IH0KCmFzbSBleHRlbmRzIGZ1biBzdG9yZVZhckludDE2KHNlbGY6' + + 'IEJ1aWxkZXIsIHZhbHVlOiBJbnQpOiBCdWlsZGVyIHsgU1RWQVJJTlQxNiB9Cgphc20gZXh0ZW5kcyBmdW4gc3RvcmVWYXJJbnQzMihzZWxmOiBCdWlsZGVyLCB2YWx1' + + 'ZTogSW50KTogQnVpbGRlciB7IFNUVkFSSU5UMzIgfQoKYXNtIGV4dGVuZHMgZnVuIHN0b3JlVmFyVWludDE2KHNlbGY6IEJ1aWxkZXIsIHZhbHVlOiBJbnQpOiBCdWls' + + 'ZGVyIHsgU1RWQVJVSU5UMTYgfQoKYXNtIGV4dGVuZHMgZnVuIHN0b3JlVmFyVWludDMyKHNlbGY6IEJ1aWxkZXIsIHZhbHVlOiBJbnQpOiBCdWlsZGVyIHsgU1RWQVJV' + + 'SU5UMzIgfQoKYXNtKGNlbGwgc2VsZikgZXh0ZW5kcyBmdW4gc3RvcmVSZWYoc2VsZjogQnVpbGRlciwgY2VsbDogQ2VsbCk6IEJ1aWxkZXIgeyBTVFJFRiB9Cgphc20g' + + 'ZXh0ZW5kcyBmdW4gc3RvcmVTbGljZShzZWxmOiBCdWlsZGVyLCBjZWxsOiBTbGljZSk6IEJ1aWxkZXIgeyBTVFNMSUNFUiB9CgovLy8gRXh0ZW5zaW9uIGZ1bmN0aW9u' + + 'IGZvciB0aGUgYEJ1aWxkZXJgLiBBdmFpbGFibGUgc2luY2UgVGFjdCAxLjUuMC4KLy8vCi8vLyBBcHBlbmRzIGFsbCBkYXRhIGZyb20gYSBgQnVpbGRlcmAgYGNlbGxg' + + 'IHRvIHRoZSBjb3B5IG9mIHRoZSBgQnVpbGRlcmAuIFJldHVybnMgdGhhdCBjb3B5LgovLy8KLy8vIGBgYHRhY3QKLy8vIGZ1biBleGFtcGxlKCkgewovLy8gICAgIGxl' + + 'dCBiOiBCdWlsZGVyID0gYmVnaW5DZWxsKCkuc3RvcmVDb2lucyg0Mik7Ci8vLyAgICAgbGV0IGZpeno6IEJ1aWxkZXIgPSBiZWdpbkNlbGwoKS5zdG9yZUJ1aWxkZXIo' + + 'Yik7Ci8vLyAgICAgYi5lbmRDZWxsKCkgPT0gZml6ei5lbmRDZWxsKCk7IC8vIHRydWUKLy8vIH0KLy8vIGBgYAovLy8KLy8vIFNlZTogaHR0cHM6Ly9kb2NzLnRhY3Qt' + + 'bGFuZy5vcmcvcmVmL2NvcmUtY2VsbHMjYnVpbGRlcnN0b3JlYnVpbGRlcgovLy8KYXNtIGV4dGVuZHMgZnVuIHN0b3JlQnVpbGRlcihzZWxmOiBCdWlsZGVyLCBjZWxs' + + 'OiBCdWlsZGVyKTogQnVpbGRlciB7IFNUQlIgfQoKQG5hbWUoX190YWN0X3N0b3JlX2FkZHJlc3MpCmV4dGVuZHMgbmF0aXZlIHN0b3JlQWRkcmVzcyhzZWxmOiBCdWls' + + 'ZGVyLCBhZGRyZXNzOiBBZGRyZXNzKTogQnVpbGRlcjsKCi8vLyBFeHRlbnNpb24gZnVuY3Rpb24gZm9yIHRoZSBgQnVpbGRlcmAuIEF2YWlsYWJsZSBzaW5jZSBUYWN0' + + 'IDEuNS4wLgovLy8KLy8vIElmIHRoZSBgY2VsbGAgaXMgbm90IGBudWxsYCwgc3RvcmVzIDEgYXMgYSBzaW5nbGUgYml0IGFuZCB0aGVuIHJlZmVyZW5jZSBgY2VsbGAg' + + 'aW50byB0aGUgY29weSBvZiB0aGUgYEJ1aWxkZXJgLiBSZXR1cm5zIHRoYXQgY29weS4KLy8vCi8vLyBJZiB0aGUgYGNlbGxgIGlzIGBudWxsYCwgb25seSBzdG9yZXMg' + + 'MCBhcyBhIHNpbmdsZSBiaXQgaW50byB0aGUgY29weSBvZiB0aGUgYEJ1aWxkZXJgLiBSZXR1cm5zIHRoYXQgY29weS4KLy8vCi8vLyBBcyBhIHNpbmdsZSBgQ2VsbGAg' + + 'Y2FuIHN0b3JlIHVwIHRvIDQgcmVmZXJlbmNlcywgYXR0ZW1wdHMgdG8gc3RvcmUgbW9yZSB0aHJvdyBhbiBleGNlcHRpb24gd2l0aCBleGl0IGNvZGUgODogYENlbGwg' + + 'b3ZlcmZsb3dgLgovLy8KLy8vIGBgYHRhY3QKLy8vIGZ1biBleGFtcGxlKCkgewovLy8gICAgIGxldCBiOiBCdWlsZGVyID0gYmVnaW5DZWxsKCk7Ci8vLyAgICAgbGV0' + + 'IGZpeno6IEJ1aWxkZXIgPSBiCi8vLyAgICAgICAgIC5zdG9yZU1heWJlUmVmKGVtcHR5Q2VsbCgpKSAvLyAxLCB0aGVuIGVtcHR5IGNlbGwKLy8vICAgICAgICAgLnN0' + + 'b3JlTWF5YmVSZWYobnVsbCk7ICAgICAgIC8vIDAKLy8vIH0KLy8vIGBgYAovLy8KLy8vIFNlZTogaHR0cHM6Ly9kb2NzLnRhY3QtbGFuZy5vcmcvcmVmL2NvcmUtY2Vs' + + 'bHMjYnVpbGRlcnN0b3JlbWF5YmVyZWYKLy8vCmFzbShjZWxsIHNlbGYpIGV4dGVuZHMgZnVuIHN0b3JlTWF5YmVSZWYoc2VsZjogQnVpbGRlciwgY2VsbDogQ2VsbD8p' + + 'OiBCdWlsZGVyIHsgU1RPUFRSRUYgfQoKYXNtIGV4dGVuZHMgZnVuIGVuZENlbGwoc2VsZjogQnVpbGRlcik6IENlbGwgeyBFTkRDIH0KCmFzbSBleHRlbmRzIGZ1biBy' + + 'ZWZzKHNlbGY6IEJ1aWxkZXIpOiBJbnQgeyBCUkVGUyB9Cgphc20gZXh0ZW5kcyBmdW4gYml0cyhzZWxmOiBCdWlsZGVyKTogSW50IHsgQkJJVFMgfQoKLy8KLy8gU2xp' + + 'Y2UKLy8KCmFzbSBleHRlbmRzIGZ1biBiZWdpblBhcnNlKHNlbGY6IENlbGwpOiBTbGljZSB7IENUT1MgfQoKYXNtKC0+IDEgMCkgZXh0ZW5kcyBtdXRhdGVzIGZ1biBs' + + 'b2FkUmVmKHNlbGY6IFNsaWNlKTogQ2VsbCB7IExEUkVGIH0KCi8vLyBFeHRlbnNpb24gZnVuY3Rpb24gZm9yIHRoZSBgU2xpY2VgLiBBdmFpbGFibGUgc2luY2UgVGFj' + + 'dCAxLjUuMC4KLy8vCi8vLyBQcmVsb2FkcyB0aGUgbmV4dCByZWZlcmVuY2UgZnJvbSB0aGUgYFNsaWNlYCBhcyBhIGBDZWxsYC4gRG9lc24ndCBtb2RpZnkgdGhlIG9y' + + 'aWdpbmFsIGBTbGljZWAuCi8vLwovLy8gQXR0ZW1wdHMgdG8gcHJlbG9hZCBzdWNoIHJlZmVyZW5jZSBgQ2VsbGAgd2hlbiBgU2xpY2VgIGRvZXNuJ3QgY29udGFpbiBp' + + 'dCB0aHJvdyBhbiBleGNlcHRpb24gd2l0aCBleGl0IGNvZGUgODogYENlbGwgb3ZlcmZsb3dgLgovLy8KLy8vIEF0dGVtcHRzIHRvIHByZWxvYWQgbW9yZSBkYXRhIHRo' + + 'YW4gYFNsaWNlYCBjb250YWlucyB0aHJvdyBhbiBleGNlcHRpb24gd2l0aCBleGl0IGNvZGUgOTogYENlbGwgdW5kZXJmbG93YC4KLy8vCi8vLyBgYGB0YWN0Ci8vLyBm' + + 'dW4gZXhhbXBsZXMoKSB7Ci8vLyAgICAgbGV0IHMxOiBTbGljZSA9IGJlZ2luQ2VsbCgpLnN0b3JlUmVmKGVtcHR5Q2VsbCgpKS5hc1NsaWNlKCk7Ci8vLyAgICAgbGV0' + + 'IGZpeno6IENlbGwgPSBzMS5wcmVsb2FkUmVmKCk7IC8vIGRpZG4ndCBtb2RpZnkgczEKLy8vCi8vLyAgICAgbGV0IHMyOiBTbGljZSA9IGJlZ2luQ2VsbCgpCi8vLyAg' + + 'ICAgICAgIC5zdG9yZVJlZihlbXB0eUNlbGwoKSkKLy8vICAgICAgICAgLnN0b3JlUmVmKHMxLmFzQ2VsbCgpKQovLy8gICAgICAgICAuYXNTbGljZSgpOwovLy8gICAg' + + 'IGxldCByZWYxOiBDZWxsID0gczIucHJlbG9hZFJlZigpOwovLy8gICAgIGxldCByZWYyOiBDZWxsID0gczIucHJlbG9hZFJlZigpOwovLy8gICAgIHJlZjEgPT0gcmVm' + + 'MjsgLy8gdHJ1ZQovLy8gfQovLy8gYGBgCi8vLwovLy8gU2VlOgovLy8gKiBodHRwczovL2RvY3MudGFjdC1sYW5nLm9yZy9yZWYvY29yZS1jZWxscyNzbGljZXByZWxv' + + 'YWRyZWYKLy8vICogaHR0cHM6Ly9kb2NzLnRhY3QtbGFuZy5vcmcvYm9vay9leGl0LWNvZGVzCi8vLwphc20gZXh0ZW5kcyBmdW4gcHJlbG9hZFJlZihzZWxmOiBTbGlj' + + 'ZSk6IENlbGwgeyBQTERSRUYgfQoKLy8gc3BlY2lhbCB0cmVhdG1lbnQgaW4gRnVuYyBjb21waWxlciwgc28gbm90IHJlcGxhY2VkIHdpdGggYXNtICJMRFNMSUNFWCIK' + + 'QG5hbWUobG9hZF9iaXRzKQpleHRlbmRzIG11dGF0ZXMgbmF0aXZlIGxvYWRCaXRzKHNlbGY6IFNsaWNlLCBsOiBJbnQpOiBTbGljZTsKCi8vIHNwZWNpYWwgdHJlYXRt' + + 'ZW50IGluIEZ1bmMgY29tcGlsZXIsIHNvIG5vdCByZXBsYWNlZCB3aXRoIGFzbSAiUExEU0xJQ0VYIgpAbmFtZShwcmVsb2FkX2JpdHMpCmV4dGVuZHMgbmF0aXZlIHBy' + + 'ZWxvYWRCaXRzKHNlbGY6IFNsaWNlLCBsOiBJbnQpOiBTbGljZTsKCi8vIHNwZWNpYWwgdHJlYXRtZW50IGluIEZ1bmMgY29tcGlsZXIsIHNvIG5vdCByZXBsYWNlZCB3' + + 'aXRoIGFzbSAiTERJWCIKQG5hbWUobG9hZF9pbnQpCmV4dGVuZHMgbXV0YXRlcyBuYXRpdmUgbG9hZEludChzZWxmOiBTbGljZSwgbDogSW50KTogSW50OwoKLy8gc3Bl' + + 'Y2lhbCB0cmVhdG1lbnQgaW4gRnVuYyBjb21waWxlciwgc28gbm90IHJlcGxhY2VkIHdpdGggYXNtICJQTERJWCIKQG5hbWUocHJlbG9hZF9pbnQpCmV4dGVuZHMgbmF0' + + 'aXZlIHByZWxvYWRJbnQoc2VsZjogU2xpY2UsIGw6IEludCk6IEludDsKCi8vIHNwZWNpYWwgdHJlYXRtZW50IGluIEZ1bmMgY29tcGlsZXIsIHNvIG5vdCByZXBsYWNl' + + 'ZCB3aXRoIGFzbSAiTERVWCIKQG5hbWUobG9hZF91aW50KQpleHRlbmRzIG11dGF0ZXMgbmF0aXZlIGxvYWRVaW50KHNlbGY6IFNsaWNlLCBsOiBJbnQpOiBJbnQ7Cgov' + + 'LyBzcGVjaWFsIHRyZWF0bWVudCBpbiBGdW5jIGNvbXBpbGVyLCBzbyBub3QgcmVwbGFjZWQgd2l0aCBhc20gIlBMRFVYIgpAbmFtZShwcmVsb2FkX3VpbnQpCmV4dGVu' + + 'ZHMgbmF0aXZlIHByZWxvYWRVaW50KHNlbGY6IFNsaWNlLCBsOiBJbnQpOiBJbnQ7Cgphc20oLT4gMSAwKSBleHRlbmRzIG11dGF0ZXMgZnVuIGxvYWRCb29sKHNlbGY6' + + 'IFNsaWNlKTogQm9vbCB7IDEgTERJIH0KCi8vLyBFeHRlbnNpb24gbXV0YXRpb24gZnVuY3Rpb24gZm9yIHRoZSBgU2xpY2VgLiBBbGlhcyB0byBgU2xpY2UubG9hZEJv' + + 'b2woKWAuIEF2YWlsYWJsZSBzaW5jZSBUYWN0IDEuNS4wLgovLy8KLy8vIGBgYHRhY3QKLy8vIGZ1biBleGFtcGxlKCkgewovLy8gICAgIGxldCBzOiBTbGljZSA9IGJl' + + 'Z2luQ2VsbCgpLnN0b3JlQm9vbCh0cnVlKS5hc1NsaWNlKCk7Ci8vLyAgICAgbGV0IGZpeno6IEJvb2wgPSBzLmxvYWRCaXQoKTsgLy8gdHJ1ZQovLy8gfQovLy8gYGBg' + + 'Ci8vLwovLy8gU2VlOiBodHRwczovL2RvY3MudGFjdC1sYW5nLm9yZy9yZWYvY29yZS1jZWxscyNzbGljZWxvYWRiaXQKLy8vCmFzbSgtPiAxIDApIGV4dGVuZHMgbXV0' + + 'YXRlcyBmdW4gbG9hZEJpdChzZWxmOiBTbGljZSk6IEJvb2wgeyAxIExESSB9Cgphc20oIC0+IDEgMCkgZXh0ZW5kcyBtdXRhdGVzIGZ1biBsb2FkQ29pbnMoc2VsZjog' + + 'U2xpY2UpOiBJbnQgeyBMRFZBUlVJTlQxNiB9CgpAbmFtZShfX3RhY3RfbG9hZF9hZGRyZXNzKQpleHRlbmRzIG11dGF0ZXMgbmF0aXZlIGxvYWRBZGRyZXNzKHNlbGY6' + + 'IFNsaWNlKTogQWRkcmVzczsKCmFzbSBleHRlbmRzIG11dGF0ZXMgZnVuIHNraXBCaXRzKHNlbGY6IFNsaWNlLCBsOiBJbnQpIHsgU0RTS0lQRklSU1QgfQoKYXNtIGV4' + + 'dGVuZHMgZnVuIGVuZFBhcnNlKHNlbGY6IFNsaWNlKSB7IEVORFMgfQoKLy8KLy8gU2xpY2Ugc2l6ZQovLwoKYXNtIGV4dGVuZHMgZnVuIHJlZnMoc2VsZjogU2xpY2Up' + + 'OiBJbnQgeyBTUkVGUyB9Cgphc20gZXh0ZW5kcyBmdW4gYml0cyhzZWxmOiBTbGljZSk6IEludCB7IFNCSVRTIH0KCmFzbSBleHRlbmRzIGZ1biBlbXB0eShzZWxmOiBT' + + 'bGljZSk6IEJvb2wgeyBTRU1QVFkgfQoKYXNtIGV4dGVuZHMgZnVuIGRhdGFFbXB0eShzZWxmOiBTbGljZSk6IEJvb2wgeyBTREVNUFRZIH0KCmFzbSBleHRlbmRzIGZ1' + + 'biByZWZzRW1wdHkoc2VsZjogU2xpY2UpOiBCb29sIHsgU1JFTVBUWSB9CgovLwovLyBDb252ZXJzaW9ucwovLwoKaW5saW5lIGV4dGVuZHMgZnVuIGFzU2xpY2Uoc2Vs' + + 'ZjogQnVpbGRlcik6IFNsaWNlIHsKICAgIHJldHVybiBzZWxmLmVuZENlbGwoKS5iZWdpblBhcnNlKCk7Cn0KCmlubGluZSBleHRlbmRzIGZ1biBhc1NsaWNlKHNlbGY6' + + 'IENlbGwpOiBTbGljZSB7CiAgICByZXR1cm4gc2VsZi5iZWdpblBhcnNlKCk7Cn0KCmlubGluZSBleHRlbmRzIGZ1biBhc0NlbGwoc2VsZjogU2xpY2UpOiBDZWxsIHsK' + + 'ICAgIHJldHVybiBiZWdpbkNlbGwoKQogICAgICAgIC5zdG9yZVNsaWNlKHNlbGYpCiAgICAgICAgLmVuZENlbGwoKTsKfQoKaW5saW5lIGV4dGVuZHMgZnVuIGFzQ2Vs' + + 'bChzZWxmOiBCdWlsZGVyKTogQ2VsbCB7CiAgICByZXR1cm4gc2VsZi5lbmRDZWxsKCk7Cn0KCmlubGluZSBmdW4gZW1wdHlDZWxsKCk6IENlbGwgewogICAgcmV0dXJu' + + 'IGJlZ2luQ2VsbCgpLmVuZENlbGwoKTsKfQoKaW5saW5lIGZ1biBlbXB0eVNsaWNlKCk6IFNsaWNlIHsKICAgIHJldHVybiBlbXB0eUNlbGwoKS5hc1NsaWNlKCk7Cn0K'; files['std/config.tact'] = 'YXNtIGZ1biBnZXRDb25maWdQYXJhbShpZDogSW50KTogQ2VsbD8geyBDT05GSUdPUFRQQVJBTSB9Cg=='; files['std/context.tact'] = @@ -573,271 +576,276 @@ files['stdlib.fc'] = 'MCkgIkxEU0xJQ0VYIjsKCjs7OyBQcmVsb2FkcyB0aGUgZmlyc3QgYDAg4omkIGxlbiDiiaQgMTAyM2AgYml0cyBmcm9tIHNsaWNlIFtzXSBpbnRvIGEgc2VwYXJhdGUg' + 'YHNsaWNlIHMnJ2AuCjs7IHNsaWNlIHByZWxvYWRfYml0cyhzbGljZSBzLCBpbnQgbGVuKSBhc20gIlBMRFNMSUNFWCI7Cgo7OzsgTG9hZHMgc2VyaWFsaXplZCBhbW91' + 'bnQgb2YgVG9uQ29pbnMgKGFueSB1bnNpZ25lZCBpbnRlZ2VyIHVwIHRvIGAyXjEyMCAtIDFgKS4KKHNsaWNlLCBpbnQpIGxvYWRfZ3JhbXMoc2xpY2UgcykgYXNtKC0+' + - 'IDEgMCkgIkxER1JBTVMiOwooc2xpY2UsIGludCkgbG9hZF9jb2lucyhzbGljZSBzKSBhc20oLT4gMSAwKSAiTERWQVJVSU5UMTYiOwoKOzs7IFJldHVybnMgYWxsIGJ1' + - 'dCB0aGUgZmlyc3QgYDAg4omkIGxlbiDiiaQgMTAyM2AgYml0cyBvZiBgc2xpY2VgIFtzXS4Kc2xpY2Ugc2tpcF9iaXRzKHNsaWNlIHMsIGludCBsZW4pIGFzbSAiU0RT' + - 'S0lQRklSU1QiOwooc2xpY2UsICgpKSB+c2tpcF9iaXRzKHNsaWNlIHMsIGludCBsZW4pIGFzbSAiU0RTS0lQRklSU1QiOwoKOzs7IFJldHVybnMgdGhlIGZpcnN0IGAw' + - 'IOKJpCBsZW4g4omkIDEwMjNgIGJpdHMgb2YgYHNsaWNlYCBbc10uCnNsaWNlIGZpcnN0X2JpdHMoc2xpY2UgcywgaW50IGxlbikgYXNtICJTRENVVEZJUlNUIjsKCjs7' + - 'OyBSZXR1cm5zIGFsbCBidXQgdGhlIGxhc3QgYDAg4omkIGxlbiDiiaQgMTAyM2AgYml0cyBvZiBgc2xpY2VgIFtzXS4Kc2xpY2Ugc2tpcF9sYXN0X2JpdHMoc2xpY2Ug' + - 'cywgaW50IGxlbikgYXNtICJTRFNLSVBMQVNUIjsKKHNsaWNlLCAoKSkgfnNraXBfbGFzdF9iaXRzKHNsaWNlIHMsIGludCBsZW4pIGFzbSAiU0RTS0lQTEFTVCI7Cgo7' + - 'OzsgUmV0dXJucyB0aGUgbGFzdCBgMCDiiaQgbGVuIOKJpCAxMDIzYCBiaXRzIG9mIGBzbGljZWAgW3NdLgpzbGljZSBzbGljZV9sYXN0KHNsaWNlIHMsIGludCBsZW4p' + - 'IGFzbSAiU0RDVVRMQVNUIjsKCjs7OyBMb2FkcyBhIGRpY3Rpb25hcnkgYERgIChIYXNoTWFwRSkgZnJvbSBgc2xpY2VgIFtzXS4KOzs7IChyZXR1cm5zIGBudWxsYCBp' + - 'ZiBgbm90aGluZ2AgY29uc3RydWN0b3IgaXMgdXNlZCkuCihzbGljZSwgY2VsbCkgbG9hZF9kaWN0KHNsaWNlIHMpIGFzbSgtPiAxIDApICJMRERJQ1QiOwoKOzs7IFBy' + - 'ZWxvYWRzIGEgZGljdGlvbmFyeSBgRGAgZnJvbSBgc2xpY2VgIFtzXS4KY2VsbCBwcmVsb2FkX2RpY3Qoc2xpY2UgcykgYXNtICJQTERESUNUIjsKCjs7OyBMb2FkcyBh' + - 'IGRpY3Rpb25hcnkgYXMgW2xvYWRfZGljdF0sIGJ1dCByZXR1cm5zIG9ubHkgdGhlIHJlbWFpbmRlciBvZiB0aGUgc2xpY2UuCnNsaWNlIHNraXBfZGljdChzbGljZSBz' + - 'KSBhc20gIlNLSVBESUNUIjsKKHNsaWNlLCAoKSkgfnNraXBfZGljdChzbGljZSBzKSBhc20gIlNLSVBESUNUIjsKCjs7OyBMb2FkcyAoTWF5YmUgXkNlbGwpIGZyb20g' + - 'YHNsaWNlYCBbc10uCjs7OyBJbiBvdGhlciB3b3JkcyBsb2FkcyAxIGJpdCBhbmQgaWYgaXQgaXMgdHJ1ZQo7OzsgbG9hZHMgZmlyc3QgcmVmIGFuZCByZXR1cm4gaXQg' + - 'd2l0aCBzbGljZSByZW1haW5kZXIKOzs7IG90aGVyd2lzZSByZXR1cm5zIGBudWxsYCBhbmQgc2xpY2UgcmVtYWluZGVyCihzbGljZSwgY2VsbCkgbG9hZF9tYXliZV9y' + - 'ZWYoc2xpY2UgcykgYXNtKC0+IDEgMCkgIkxET1BUUkVGIjsKCjs7OyBQcmVsb2FkcyAoTWF5YmUgXkNlbGwpIGZyb20gYHNsaWNlYCBbc10uCmNlbGwgcHJlbG9hZF9t' + - 'YXliZV9yZWYoc2xpY2UgcykgYXNtICJQTERPUFRSRUYiOwoKCjs7OyBSZXR1cm5zIHRoZSBkZXB0aCBvZiBgY2VsbGAgW2NdLgo7OzsgSWYgW2NdIGhhcyBubyByZWZl' + - 'cmVuY2VzLCB0aGVuIHJldHVybiBgMGA7Cjs7OyBvdGhlcndpc2UgdGhlIHJldHVybmVkIHZhbHVlIGlzIG9uZSBwbHVzIHRoZSBtYXhpbXVtIG9mIGRlcHRocyBvZiBj' + - 'ZWxscyByZWZlcnJlZCB0byBmcm9tIFtjXS4KOzs7IElmIFtjXSBpcyBhIGBudWxsYCBpbnN0ZWFkIG9mIGEgY2VsbCwgcmV0dXJucyB6ZXJvLgppbnQgY2VsbF9kZXB0' + - 'aChjZWxsIGMpIGFzbSAiQ0RFUFRIIjsKCgp7LQogICMgU2xpY2Ugc2l6ZSBwcmltaXRpdmVzCi19Cgo7OzsgUmV0dXJucyB0aGUgbnVtYmVyIG9mIHJlZmVyZW5jZXMg' + - 'aW4gYHNsaWNlYCBbc10uCmludCBzbGljZV9yZWZzKHNsaWNlIHMpIGFzbSAiU1JFRlMiOwoKOzs7IFJldHVybnMgdGhlIG51bWJlciBvZiBkYXRhIGJpdHMgaW4gYHNs' + - 'aWNlYCBbc10uCmludCBzbGljZV9iaXRzKHNsaWNlIHMpIGFzbSAiU0JJVFMiOwoKOzs7IFJldHVybnMgYm90aCB0aGUgbnVtYmVyIG9mIGRhdGEgYml0cyBhbmQgdGhl' + - 'IG51bWJlciBvZiByZWZlcmVuY2VzIGluIGBzbGljZWAgW3NdLgooaW50LCBpbnQpIHNsaWNlX2JpdHNfcmVmcyhzbGljZSBzKSBhc20gIlNCSVRSRUZTIjsKCjs7OyBD' + - 'aGVja3Mgd2hldGhlciBhIGBzbGljZWAgW3NdIGlzIGVtcHR5IChpLmUuLCBjb250YWlucyBubyBiaXRzIG9mIGRhdGEgYW5kIG5vIGNlbGwgcmVmZXJlbmNlcykuCmlu' + - 'dCBzbGljZV9lbXB0eT8oc2xpY2UgcykgYXNtICJTRU1QVFkiOwoKOzs7IENoZWNrcyB3aGV0aGVyIGBzbGljZWAgW3NdIGhhcyBubyBiaXRzIG9mIGRhdGEuCmludCBz' + - 'bGljZV9kYXRhX2VtcHR5PyhzbGljZSBzKSBhc20gIlNERU1QVFkiOwoKOzs7IENoZWNrcyB3aGV0aGVyIGBzbGljZWAgW3NdIGhhcyBubyByZWZlcmVuY2VzLgppbnQg' + - 'c2xpY2VfcmVmc19lbXB0eT8oc2xpY2UgcykgYXNtICJTUkVNUFRZIjsKCjs7OyBSZXR1cm5zIHRoZSBkZXB0aCBvZiBgc2xpY2VgIFtzXS4KOzs7IElmIFtzXSBoYXMg' + - 'bm8gcmVmZXJlbmNlcywgdGhlbiByZXR1cm5zIGAwYDsKOzs7IG90aGVyd2lzZSB0aGUgcmV0dXJuZWQgdmFsdWUgaXMgb25lIHBsdXMgdGhlIG1heGltdW0gb2YgZGVw' + - 'dGhzIG9mIGNlbGxzIHJlZmVycmVkIHRvIGZyb20gW3NdLgppbnQgc2xpY2VfZGVwdGgoc2xpY2UgcykgYXNtICJTREVQVEgiOwoKey0KICAjIEJ1aWxkZXIgc2l6ZSBw' + - 'cmltaXRpdmVzCi19Cgo7OzsgUmV0dXJucyB0aGUgbnVtYmVyIG9mIGNlbGwgcmVmZXJlbmNlcyBhbHJlYWR5IHN0b3JlZCBpbiBgYnVpbGRlcmAgW2JdCmludCBidWls' + - 'ZGVyX3JlZnMoYnVpbGRlciBiKSBhc20gIkJSRUZTIjsKCjs7OyBSZXR1cm5zIHRoZSBudW1iZXIgb2YgZGF0YSBiaXRzIGFscmVhZHkgc3RvcmVkIGluIGBidWlsZGVy' + - 'YCBbYl0uCmludCBidWlsZGVyX2JpdHMoYnVpbGRlciBiKSBhc20gIkJCSVRTIjsKCjs7OyBSZXR1cm5zIHRoZSBkZXB0aCBvZiBgYnVpbGRlcmAgW2JdLgo7OzsgSWYg' + - 'bm8gY2VsbCByZWZlcmVuY2VzIGFyZSBzdG9yZWQgaW4gW2JdLCB0aGVuIHJldHVybnMgMDsKOzs7IG90aGVyd2lzZSB0aGUgcmV0dXJuZWQgdmFsdWUgaXMgb25lIHBs' + - 'dXMgdGhlIG1heGltdW0gb2YgZGVwdGhzIG9mIGNlbGxzIHJlZmVycmVkIHRvIGZyb20gW2JdLgppbnQgYnVpbGRlcl9kZXB0aChidWlsZGVyIGIpIGFzbSAiQkRFUFRI' + - 'IjsKCnstCiAgIyBCdWlsZGVyIHByaW1pdGl2ZXMKICBJdCBpcyBzYWlkIHRoYXQgYSBwcmltaXRpdmUgX3N0b3Jlc18gYSB2YWx1ZSBgeGAgaW50byBhIGJ1aWxkZXIg' + - 'YGJgCiAgaWYgaXQgcmV0dXJucyBhIG1vZGlmaWVkIHZlcnNpb24gb2YgdGhlIGJ1aWxkZXIgYGInYCB3aXRoIHRoZSB2YWx1ZSBgeGAgc3RvcmVkIGF0IHRoZSBlbmQg' + - 'b2YgaXQuCiAgSXQgY2FuIGJlIHVzZWQgYXMgW25vbi1tb2RpZnlpbmcgbWV0aG9kXShodHRwczovL3Rvbi5vcmcvZG9jcy8jL2Z1bmMvc3RhdGVtZW50cz9pZD1ub24t' + - 'bW9kaWZ5aW5nLW1ldGhvZHMpLgoKICBBbGwgdGhlIHByaW1pdGl2ZXMgYmVsb3cgZmlyc3QgY2hlY2sgd2hldGhlciB0aGVyZSBpcyBlbm91Z2ggc3BhY2UgaW4gdGhl' + - 'IGBidWlsZGVyYCwKICBhbmQgb25seSB0aGVuIGNoZWNrIHRoZSByYW5nZSBvZiB0aGUgdmFsdWUgYmVpbmcgc2VyaWFsaXplZC4KLX0KCjs7OyBDcmVhdGVzIGEgbmV3' + - 'IGVtcHR5IGBidWlsZGVyYC4KYnVpbGRlciBiZWdpbl9jZWxsKCkgYXNtICJORVdDIjsKCjs7OyBDb252ZXJ0cyBhIGBidWlsZGVyYCBpbnRvIGFuIG9yZGluYXJ5IGBj' + - 'ZWxsYC4KY2VsbCBlbmRfY2VsbChidWlsZGVyIGIpIGFzbSAiRU5EQyI7Cgo7OzsgU3RvcmVzIGEgcmVmZXJlbmNlIHRvIGBjZWxsYCBbY10gaW50byBgYnVpbGRlcmAg' + - 'W2JdLgpidWlsZGVyIHN0b3JlX3JlZihidWlsZGVyIGIsIGNlbGwgYykgYXNtKGMgYikgIlNUUkVGIjsKCjs7OyBTdG9yZXMgYW4gdW5zaWduZWQgW2xlbl0tYml0IGlu' + - 'dGVnZXIgYHhgIGludG8gYGJgIGZvciBgMCDiiaQgbGVuIOKJpCAyNTZgLgo7OyBidWlsZGVyIHN0b3JlX3VpbnQoYnVpbGRlciBiLCBpbnQgeCwgaW50IGxlbikgYXNt' + - 'KHggYiBsZW4pICJTVFVYIjsKCjs7OyBTdG9yZXMgYSBzaWduZWQgW2xlbl0tYml0IGludGVnZXIgYHhgIGludG8gYGJgIGZvcmAgMCDiiaQgbGVuIOKJpCAyNTdgLgo7' + - 'OyBidWlsZGVyIHN0b3JlX2ludChidWlsZGVyIGIsIGludCB4LCBpbnQgbGVuKSBhc20oeCBiIGxlbikgIlNUSVgiOwoKCjs7OyBTdG9yZXMgYHNsaWNlYCBbc10gaW50' + - 'byBgYnVpbGRlcmAgW2JdCmJ1aWxkZXIgc3RvcmVfc2xpY2UoYnVpbGRlciBiLCBzbGljZSBzKSBhc20gIlNUU0xJQ0VSIjsKCjs7OyBTdG9yZXMgKHNlcmlhbGl6ZXMp' + - 'IGFuIGludGVnZXIgW3hdIGluIHRoZSByYW5nZSBgMC4uMl4xMjAg4oiSIDFgIGludG8gYGJ1aWxkZXJgIFtiXS4KOzs7IFRoZSBzZXJpYWxpemF0aW9uIG9mIFt4XSBj' + - 'b25zaXN0cyBvZiBhIDQtYml0IHVuc2lnbmVkIGJpZy1lbmRpYW4gaW50ZWdlciBgbGAsCjs7OyB3aGljaCBpcyB0aGUgc21hbGxlc3QgaW50ZWdlciBgbCDiiaUgMGAs' + - 'IHN1Y2ggdGhhdCBgeCA8IDJeOGxgLAo7OzsgZm9sbG93ZWQgYnkgYW4gYDhsYC1iaXQgdW5zaWduZWQgYmlnLWVuZGlhbiByZXByZXNlbnRhdGlvbiBvZiBbeF0uCjs7' + - 'OyBJZiBbeF0gZG9lcyBub3QgYmVsb25nIHRvIHRoZSBzdXBwb3J0ZWQgcmFuZ2UsIGEgcmFuZ2UgY2hlY2sgZXhjZXB0aW9uIGlzIHRocm93bi4KOzs7Cjs7OyBTdG9y' + - 'ZSBhbW91bnRzIG9mIFRvbkNvaW5zIHRvIHRoZSBidWlsZGVyIGFzIFZhclVJbnRlZ2VyIDE2CmJ1aWxkZXIgc3RvcmVfZ3JhbXMoYnVpbGRlciBiLCBpbnQgeCkgYXNt' + - 'ICJTVEdSQU1TIjsKYnVpbGRlciBzdG9yZV9jb2lucyhidWlsZGVyIGIsIGludCB4KSBhc20gIlNUVkFSVUlOVDE2IjsKCjs7OyBTdG9yZXMgZGljdGlvbmFyeSBgRGAg' + - 'cmVwcmVzZW50ZWQgYnkgYGNlbGxgIFtjXSBvciBgbnVsbGAgaW50byBgYnVpbGRlcmAgW2JdLgo7OzsgSW4gb3RoZXIgd29yZHMsIHN0b3JlcyBhIGAxYC1iaXQgYW5k' + - 'IGEgcmVmZXJlbmNlIHRvIFtjXSBpZiBbY10gaXMgbm90IGBudWxsYCBhbmQgYDBgLWJpdCBvdGhlcndpc2UuCmJ1aWxkZXIgc3RvcmVfZGljdChidWlsZGVyIGIsIGNl' + - 'bGwgYykgYXNtKGMgYikgIlNURElDVCI7Cgo7OzsgU3RvcmVzIChNYXliZSBeQ2VsbCkgdG8gYnVpbGRlcjoKOzs7IGlmIGNlbGwgaXMgbnVsbCBzdG9yZSAxIHplcm8g' + - 'Yml0Cjs7OyBvdGhlcndpc2Ugc3RvcmUgMSB0cnVlIGJpdCBhbmQgcmVmIHRvIGNlbGwKYnVpbGRlciBzdG9yZV9tYXliZV9yZWYoYnVpbGRlciBiLCBjZWxsIGMpIGFz' + - 'bShjIGIpICJTVE9QVFJFRiI7CgoKey0KICAjIEFkZHJlc3MgbWFuaXB1bGF0aW9uIHByaW1pdGl2ZXMKICBUaGUgYWRkcmVzcyBtYW5pcHVsYXRpb24gcHJpbWl0aXZl' + - 'cyBsaXN0ZWQgYmVsb3cgc2VyaWFsaXplIGFuZCBkZXNlcmlhbGl6ZSB2YWx1ZXMgYWNjb3JkaW5nIHRvIHRoZSBmb2xsb3dpbmcgVEwtQiBzY2hlbWU6CiAgYGBgVEwt' + - 'QgogIGFkZHJfbm9uZSQwMCA9IE1zZ0FkZHJlc3NFeHQ7CiAgYWRkcl9leHRlcm4kMDEgbGVuOigjIyA4KSBleHRlcm5hbF9hZGRyZXNzOihiaXRzIGxlbikKICAgICAg' + - 'ICAgICAgICAgPSBNc2dBZGRyZXNzRXh0OwogIGFueWNhc3RfaW5mbyRfIGRlcHRoOigjPD0gMzApIHsgZGVwdGggPj0gMSB9CiAgICByZXdyaXRlX3BmeDooYml0cyBk' + - 'ZXB0aCkgPSBBbnljYXN0OwogIGFkZHJfc3RkJDEwIGFueWNhc3Q6KE1heWJlIEFueWNhc3QpCiAgICB3b3JrY2hhaW5faWQ6aW50OCBhZGRyZXNzOmJpdHMyNTYgPSBN' + - 'c2dBZGRyZXNzSW50OwogIGFkZHJfdmFyJDExIGFueWNhc3Q6KE1heWJlIEFueWNhc3QpIGFkZHJfbGVuOigjIyA5KQogICAgd29ya2NoYWluX2lkOmludDMyIGFkZHJl' + - 'c3M6KGJpdHMgYWRkcl9sZW4pID0gTXNnQWRkcmVzc0ludDsKICBfIF86TXNnQWRkcmVzc0ludCA9IE1zZ0FkZHJlc3M7CiAgXyBfOk1zZ0FkZHJlc3NFeHQgPSBNc2dB' + - 'ZGRyZXNzOwoKICBpbnRfbXNnX2luZm8kMCBpaHJfZGlzYWJsZWQ6Qm9vbCBib3VuY2U6Qm9vbCBib3VuY2VkOkJvb2wKICAgIHNyYzpNc2dBZGRyZXNzIGRlc3Q6TXNn' + - 'QWRkcmVzc0ludAogICAgdmFsdWU6Q3VycmVuY3lDb2xsZWN0aW9uIGlocl9mZWU6R3JhbXMgZndkX2ZlZTpHcmFtcwogICAgY3JlYXRlZF9sdDp1aW50NjQgY3JlYXRl' + - 'ZF9hdDp1aW50MzIgPSBDb21tb25Nc2dJbmZvUmVsYXhlZDsKICBleHRfb3V0X21zZ19pbmZvJDExIHNyYzpNc2dBZGRyZXNzIGRlc3Q6TXNnQWRkcmVzc0V4dAogICAg' + - 'Y3JlYXRlZF9sdDp1aW50NjQgY3JlYXRlZF9hdDp1aW50MzIgPSBDb21tb25Nc2dJbmZvUmVsYXhlZDsKICBgYGAKICBBIGRlc2VyaWFsaXplZCBgTXNnQWRkcmVzc2Ag' + - 'aXMgcmVwcmVzZW50ZWQgYnkgYSB0dXBsZSBgdGAgYXMgZm9sbG93czoKCiAgLSBgYWRkcl9ub25lYCBpcyByZXByZXNlbnRlZCBieSBgdCA9ICgwKWAsCiAgICBpLmUu' + - 'LCBhIHR1cGxlIGNvbnRhaW5pbmcgZXhhY3RseSBvbmUgaW50ZWdlciBlcXVhbCB0byB6ZXJvLgogIC0gYGFkZHJfZXh0ZXJuYCBpcyByZXByZXNlbnRlZCBieSBgdCA9' + - 'ICgxLCBzKWAsCiAgICB3aGVyZSBzbGljZSBgc2AgY29udGFpbnMgdGhlIGZpZWxkIGBleHRlcm5hbF9hZGRyZXNzYC4gSW4gb3RoZXIgd29yZHMsIGAKICAgIHRgIGlz' + - 'IGEgcGFpciAoYSB0dXBsZSBjb25zaXN0aW5nIG9mIHR3byBlbnRyaWVzKSwgY29udGFpbmluZyBhbiBpbnRlZ2VyIGVxdWFsIHRvIG9uZSBhbmQgc2xpY2UgYHNgLgog' + - 'IC0gYGFkZHJfc3RkYCBpcyByZXByZXNlbnRlZCBieSBgdCA9ICgyLCB1LCB4LCBzKWAsCiAgICB3aGVyZSBgdWAgaXMgZWl0aGVyIGEgYG51bGxgIChpZiBgYW55Y2Fz' + - 'dGAgaXMgYWJzZW50KSBvciBhIHNsaWNlIGBzJ2AgY29udGFpbmluZyBgcmV3cml0ZV9wZnhgIChpZiBhbnljYXN0IGlzIHByZXNlbnQpLgogICAgTmV4dCwgaW50ZWdl' + - 'ciBgeGAgaXMgdGhlIGB3b3JrY2hhaW5faWRgLCBhbmQgc2xpY2UgYHNgIGNvbnRhaW5zIHRoZSBhZGRyZXNzLgogIC0gYGFkZHJfdmFyYCBpcyByZXByZXNlbnRlZCBi' + - 'eSBgdCA9ICgzLCB1LCB4LCBzKWAsCiAgICB3aGVyZSBgdWAsIGB4YCwgYW5kIGBzYCBoYXZlIHRoZSBzYW1lIG1lYW5pbmcgYXMgZm9yIGBhZGRyX3N0ZGAuCi19Cgo7' + - 'OzsgTG9hZHMgZnJvbSBzbGljZSBbc10gdGhlIG9ubHkgcHJlZml4IHRoYXQgaXMgYSB2YWxpZCBgTXNnQWRkcmVzc2AsCjs7OyBhbmQgcmV0dXJucyBib3RoIHRoaXMg' + - 'cHJlZml4IGBzJ2AgYW5kIHRoZSByZW1haW5kZXIgYHMnJ2Agb2YgW3NdIGFzIHNsaWNlcy4KKHNsaWNlLCBzbGljZSkgbG9hZF9tc2dfYWRkcihzbGljZSBzKSBhc20o' + - 'LT4gMSAwKSAiTERNU0dBRERSIjsKCjs7OyBEZWNvbXBvc2VzIHNsaWNlIFtzXSBjb250YWluaW5nIGEgdmFsaWQgYE1zZ0FkZHJlc3NgIGludG8gYSBgdHVwbGUgdGAg' + - 'd2l0aCBzZXBhcmF0ZSBmaWVsZHMgb2YgdGhpcyBgTXNnQWRkcmVzc2AuCjs7OyBJZiBbc10gaXMgbm90IGEgdmFsaWQgYE1zZ0FkZHJlc3NgLCBhIGNlbGwgZGVzZXJp' + - 'YWxpemF0aW9uIGV4Y2VwdGlvbiBpcyB0aHJvd24uCnR1cGxlIHBhcnNlX2FkZHIoc2xpY2UgcykgYXNtICJQQVJTRU1TR0FERFIiOwoKOzs7IFBhcnNlcyBzbGljZSBb' + - 'c10gY29udGFpbmluZyBhIHZhbGlkIGBNc2dBZGRyZXNzSW50YCAodXN1YWxseSBhIGBtc2dfYWRkcl9zdGRgKSwKOzs7IGFwcGxpZXMgcmV3cml0aW5nIGZyb20gdGhl' + - 'IGFueWNhc3QgKGlmIHByZXNlbnQpIHRvIHRoZSBzYW1lLWxlbmd0aCBwcmVmaXggb2YgdGhlIGFkZHJlc3MsCjs7OyBhbmQgcmV0dXJucyBib3RoIHRoZSB3b3JrY2hh' + - 'aW4gYW5kIHRoZSAyNTYtYml0IGFkZHJlc3MgYXMgaW50ZWdlcnMuCjs7OyBJZiB0aGUgYWRkcmVzcyBpcyBub3QgMjU2LWJpdCwgb3IgaWYgW3NdIGlzIG5vdCBhIHZh' + - 'bGlkIHNlcmlhbGl6YXRpb24gb2YgYE1zZ0FkZHJlc3NJbnRgLAo7OzsgdGhyb3dzIGEgY2VsbCBkZXNlcmlhbGl6YXRpb24gZXhjZXB0aW9uLgooaW50LCBpbnQpIHBh' + - 'cnNlX3N0ZF9hZGRyKHNsaWNlIHMpIGFzbSAiUkVXUklURVNUREFERFIiOwoKOzs7IEEgdmFyaWFudCBvZiBbcGFyc2Vfc3RkX2FkZHJdIHRoYXQgcmV0dXJucyB0aGUg' + - 'KHJld3JpdHRlbikgYWRkcmVzcyBhcyBhIHNsaWNlIFtzXSwKOzs7IGV2ZW4gaWYgaXQgaXMgbm90IGV4YWN0bHkgMjU2IGJpdCBsb25nIChyZXByZXNlbnRlZCBieSBh' + - 'IGBtc2dfYWRkcl92YXJgKS4KKGludCwgc2xpY2UpIHBhcnNlX3Zhcl9hZGRyKHNsaWNlIHMpIGFzbSAiUkVXUklURVZBUkFERFIiOwoKey0KICAjIERpY3Rpb25hcnkg' + - 'cHJpbWl0aXZlcwotfQoKCjs7OyBTZXRzIHRoZSB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggW2tleV9sZW5dLWJpdCBrZXkgc2lnbmVkIGluZGV4IGluIGRpY3Rpb25hcnkg' + - 'W2RpY3RdIHRvIFt2YWx1ZV0gKGNlbGwpLAo7OzsgYW5kIHJldHVybnMgdGhlIHJlc3VsdGluZyBkaWN0aW9uYXJ5LgpjZWxsIGlkaWN0X3NldF9yZWYoY2VsbCBkaWN0' + - 'LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElTRVRSRUYiOwooY2VsbCwgKCkpIH5p' + - 'ZGljdF9zZXRfcmVmKGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJ' + - 'U0VUUkVGIjsKCjs7OyBTZXRzIHRoZSB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggW2tleV9sZW5dLWJpdCBrZXkgdW5zaWduZWQgaW5kZXggaW4gZGljdGlvbmFyeSBbZGlj' + - 'dF0gdG8gW3ZhbHVlXSAoY2VsbCksCjs7OyBhbmQgcmV0dXJucyB0aGUgcmVzdWx0aW5nIGRpY3Rpb25hcnkuCmNlbGwgdWRpY3Rfc2V0X3JlZihjZWxsIGRpY3QsIGlu' + - 'dCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVVNFVFJFRiI7CihjZWxsLCAoKSkgfnVkaWN0' + - 'X3NldF9yZWYoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVTRVRS' + - 'RUYiOwoKY2VsbCBpZGljdF9nZXRfcmVmKGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCkgYXNtKGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJR0VUT1BU' + - 'UkVGIjsKKGNlbGwsIGludCkgaWRpY3RfZ2V0X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlfbGVuKSAiRElD' + - 'VElHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGludCkgdWRpY3RfZ2V0X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5k' + - 'ZXggZGljdCBrZXlfbGVuKSAiRElDVFVHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGNlbGwpIGlkaWN0X3NldF9nZXRfcmVmKGNlbGwgZGljdCwgaW50IGtl' + - 'eV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJU0VUR0VUT1BUUkVGIjsKKGNlbGwsIGNlbGwpIHVk' + - 'aWN0X3NldF9nZXRfcmVmKGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJ' + - 'Q1RVU0VUR0VUT1BUUkVGIjsKKGNlbGwsIGludCkgaWRpY3RfZGVsZXRlPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShpbmRleCBkaWN0IGtl' + - 'eV9sZW4pICJESUNUSURFTCI7CihjZWxsLCBpbnQpIHVkaWN0X2RlbGV0ZT8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBr' + - 'ZXlfbGVuKSAiRElDVFVERUwiOwooc2xpY2UsIGludCkgaWRpY3RfZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShpbmRleCBkaWN0IGtl' + - 'eV9sZW4pICJESUNUSUdFVCIgIk5VTExTV0FQSUZOT1QiOwooc2xpY2UsIGludCkgdWRpY3RfZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFz' + - 'bShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVUdFVCIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgc2xpY2UsIGludCkgaWRpY3RfZGVsZXRlX2dldD8oY2VsbCBkaWN0' + - 'LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElERUxHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIHNsaWNlLCBp' + - 'bnQpIHVkaWN0X2RlbGV0ZV9nZXQ/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCkgYXNtKGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVREVMR0VUIiAi' + - 'TlVMTFNXQVBJRk5PVCI7CihjZWxsLCAoc2xpY2UsIGludCkpIH5pZGljdF9kZWxldGVfZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShp' + - 'bmRleCBkaWN0IGtleV9sZW4pICJESUNUSURFTEdFVCIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKHNsaWNlLCBpbnQpKSB+dWRpY3RfZGVsZXRlX2dldD8oY2VsbCBk' + - 'aWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVERUxHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGNlbGws' + - 'IGludCkgaWRpY3RfZGVsZXRlX2dldF9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCkgYXNtKGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJREVM' + - 'R0VUUkVGIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCBjZWxsLCBpbnQpIHVkaWN0X2RlbGV0ZV9nZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5k' + - 'ZXgpIGFzbShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVURFTEdFVFJFRiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKGNlbGwsIGludCkpIH5pZGljdF9kZWxldGVf' + - 'Z2V0X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElERUxHRVRSRUYiICJOVUxMU1dBUElG' + - 'Tk9UIjsKKGNlbGwsIChjZWxsLCBpbnQpKSB+dWRpY3RfZGVsZXRlX2dldF9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCkgYXNtKGluZGV4IGRp' + - 'Y3Qga2V5X2xlbikgIkRJQ1RVREVMR0VUUkVGIiAiTlVMTFNXQVBJRk5PVCI7CmNlbGwgdWRpY3Rfc2V0KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwg' + - 'c2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVVNFVCI7CihjZWxsLCAoKSkgfnVkaWN0X3NldChjZWxsIGRpY3QsIGludCBrZXlf' + - 'bGVuLCBpbnQgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVTRVQiOwpjZWxsIGlkaWN0X3NldChjZWxsIGRpY3Qs' + - 'IGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElTRVQiOwooY2VsbCwgKCkpIH5pZGlj' + - 'dF9zZXQoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJU0VUIjsK' + - 'Y2VsbCBkaWN0X3NldChjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGljZSBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJE' + - 'SUNUU0VUIjsKKGNlbGwsICgpKSB+ZGljdF9zZXQoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXgg' + - 'ZGljdCBrZXlfbGVuKSAiRElDVFNFVCI7CihjZWxsLCBpbnQpIHVkaWN0X2FkZD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBzbGljZSB2YWx1ZSkg' + - 'YXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVQUREIjsKKGNlbGwsIGludCkgdWRpY3RfcmVwbGFjZT8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50' + - 'IGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVUkVQTEFDRSI7CihjZWxsLCBpbnQpIHVkaWN0X3JlcGxhY2VfcmVm' + - 'PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVVJFUExBQ0VSRUYi' + - 'OwooY2VsbCwgc2xpY2UsIGludCkgdWRpY3RfcmVwbGFjZWdldD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVl' + - 'IGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVUkVQTEFDRUdFVCIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgY2VsbCwgaW50KSB1ZGljdF9yZXBsYWNlZ2V0X3JlZj8o' + - 'Y2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVSRVBMQUNFR0VUUkVG' + - 'IiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCAoc2xpY2UsIGludCkpIH51ZGljdF9yZXBsYWNlZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNs' + - 'aWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVSRVBMQUNFR0VUIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCAoY2VsbCwgaW50KSkg' + - 'fnVkaWN0X3JlcGxhY2VnZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9s' + - 'ZW4pICJESUNUVVJFUExBQ0VHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGludCkgaWRpY3RfYWRkPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5k' + - 'ZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElBREQiOwooY2VsbCwgaW50KSBpZGljdF9yZXBsYWNlPyhjZWxsIGRpY3Qs' + - 'IGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElSRVBMQUNFIjsKKGNlbGwsIGludCkg' + - 'aWRpY3RfcmVwbGFjZV9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikg' + - 'IkRJQ1RJUkVQTEFDRVJFRiI7CihjZWxsLCBzbGljZSwgaW50KSBpZGljdF9yZXBsYWNlZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNsaWNl' + - 'IHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElSRVBMQUNFR0VUIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCBjZWxsLCBpbnQpIGlkaWN0' + - 'X3JlcGxhY2VnZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJE' + - 'SUNUSVJFUExBQ0VHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChzbGljZSwgaW50KSkgfmlkaWN0X3JlcGxhY2VnZXQ/KGNlbGwgZGljdCwgaW50IGtleV9s' + - 'ZW4sIGludCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVJFUExBQ0VHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNl' + - 'bGwsIChjZWxsLCBpbnQpKSB+aWRpY3RfcmVwbGFjZWdldF9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVl' + - 'IGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJUkVQTEFDRUdFVFJFRiIgIk5VTExTV0FQSUZOT1QiOwpjZWxsIHVkaWN0X3NldF9idWlsZGVyKGNlbGwgZGljdCwgaW50' + - 'IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVU0VUQiI7CihjZWxsLCAoKSkgfnVkaWN0' + - 'X3NldF9idWlsZGVyKGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJ' + - 'Q1RVU0VUQiI7CmNlbGwgaWRpY3Rfc2V0X2J1aWxkZXIoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5k' + - 'ZXggZGljdCBrZXlfbGVuKSAiRElDVElTRVRCIjsKKGNlbGwsICgpKSB+aWRpY3Rfc2V0X2J1aWxkZXIoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBi' + - 'dWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElTRVRCIjsKY2VsbCBkaWN0X3NldF9idWlsZGVyKGNlbGwgZGljdCwgaW50IGtl' + - 'eV9sZW4sIHNsaWNlIGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFNFVEIiOwooY2VsbCwgKCkpIH5kaWN0X3Nl' + - 'dF9idWlsZGVyKGNlbGwgZGljdCwgaW50IGtleV9sZW4sIHNsaWNlIGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElD' + - 'VFNFVEIiOwooY2VsbCwgaW50KSBkaWN0X3JlcGxhY2VfYnVpbGRlcj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFz' + - 'bSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUUkVQTEFDRUIiOwooY2VsbCwgYnVpbGRlciwgaW50KSBkaWN0X3JlcGxhY2VnZXRfYnVpbGRlcj8oY2VsbCBk' + - 'aWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUUkVQTEFDRUdFVEIiICJO' + - 'VUxMU1dBUElGTk9UIjsKKGNlbGwsIHNsaWNlLCBpbnQpIGRpY3RfcmVwbGFjZWdldD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIHNsaWNlIHZh' + - 'bHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFJFUExBQ0VHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChidWlsZGVyLCBpbnQpKSB+ZGlj' + - 'dF9yZXBsYWNlZ2V0X2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIHNsaWNlIGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBr' + - 'ZXlfbGVuKSAiRElDVFJFUExBQ0VHRVRCIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCAoc2xpY2UsIGludCkpIH5kaWN0X3JlcGxhY2VnZXQ/KGNlbGwgZGljdCwgaW50' + - 'IGtleV9sZW4sIHNsaWNlIGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RSRVBMQUNFR0VUIiAiTlVMTFNXQVBJRk5P' + - 'VCI7CihjZWxsLCBpbnQpIHVkaWN0X2FkZF9idWlsZGVyPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBp' + - 'bmRleCBkaWN0IGtleV9sZW4pICJESUNUVUFEREIiOwooY2VsbCwgaW50KSB1ZGljdF9yZXBsYWNlX2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBp' + - 'bmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVUkVQTEFDRUIiOwooY2VsbCwgYnVpbGRlciwgaW50KSB1ZGljdF9y' + - 'ZXBsYWNlZ2V0X2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xl' + - 'bikgIkRJQ1RVUkVQTEFDRUdFVEIiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChidWlsZGVyLCBpbnQpKSB+dWRpY3RfcmVwbGFjZWdldF9idWlsZGVyPyhjZWxsIGRp' + - 'Y3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVVJFUExBQ0VHRVRCIiAiTlVM' + - 'TFNXQVBJRk5PVCI7CihjZWxsLCBpbnQpIGlkaWN0X2FkZF9idWlsZGVyPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFz' + - 'bSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSUFEREIiOwooY2VsbCwgaW50KSBpZGljdF9yZXBsYWNlX2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9s' + - 'ZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJUkVQTEFDRUIiOwooY2VsbCwgYnVpbGRlciwgaW50' + - 'KSBpZGljdF9yZXBsYWNlZ2V0X2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRp' + - 'Y3Qga2V5X2xlbikgIkRJQ1RJUkVQTEFDRUdFVEIiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChidWlsZGVyLCBpbnQpKSB+aWRpY3RfcmVwbGFjZWdldF9idWlsZGVy' + - 'PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVJFUExBQ0VH' + - 'RVRCIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCBpbnQsIHNsaWNlLCBpbnQpIHVkaWN0X2RlbGV0ZV9nZXRfbWluKGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgt' + - 'PiAwIDIgMSAzKSAiRElDVFVSRU1NSU4iICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCAoaW50LCBzbGljZSwgaW50KSkgfnVkaWN0OjpkZWxldGVfZ2V0X21pbihjZWxs' + - 'IGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykgIkRJQ1RVUkVNTUlOIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwgaW50LCBzbGljZSwgaW50KSBpZGlj' + - 'dF9kZWxldGVfZ2V0X21pbihjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykgIkRJQ1RJUkVNTUlOIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwg' + - 'KGludCwgc2xpY2UsIGludCkpIH5pZGljdDo6ZGVsZXRlX2dldF9taW4oY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtKC0+IDAgMiAxIDMpICJESUNUSVJFTU1JTiIg' + - 'Ik5VTExTV0FQSUZOT1QyIjsKKGNlbGwsIHNsaWNlLCBzbGljZSwgaW50KSBkaWN0X2RlbGV0ZV9nZXRfbWluKGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAw' + - 'IDIgMSAzKSAiRElDVFJFTU1JTiIgIk5VTExTV0FQSUZOT1QyIjsKKGNlbGwsIChzbGljZSwgc2xpY2UsIGludCkpIH5kaWN0OjpkZWxldGVfZ2V0X21pbihjZWxsIGRp' + - 'Y3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykgIkRJQ1RSRU1NSU4iICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCBpbnQsIHNsaWNlLCBpbnQpIHVkaWN0X2Rl' + - 'bGV0ZV9nZXRfbWF4KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElDVFVSRU1NQVgiICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCAoaW50' + - 'LCBzbGljZSwgaW50KSkgfnVkaWN0OjpkZWxldGVfZ2V0X21heChjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykgIkRJQ1RVUkVNTUFYIiAiTlVM' + - 'TFNXQVBJRk5PVDIiOwooY2VsbCwgaW50LCBzbGljZSwgaW50KSBpZGljdF9kZWxldGVfZ2V0X21heChjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEg' + - 'MykgIkRJQ1RJUkVNTUFYIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwgKGludCwgc2xpY2UsIGludCkpIH5pZGljdDo6ZGVsZXRlX2dldF9tYXgoY2VsbCBkaWN0LCBp' + - 'bnQga2V5X2xlbikgYXNtKC0+IDAgMiAxIDMpICJESUNUSVJFTU1BWCIgIk5VTExTV0FQSUZOT1QyIjsKKGNlbGwsIHNsaWNlLCBzbGljZSwgaW50KSBkaWN0X2RlbGV0' + - 'ZV9nZXRfbWF4KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElDVFJFTU1BWCIgIk5VTExTV0FQSUZOT1QyIjsKKGNlbGwsIChzbGljZSwg' + - 'c2xpY2UsIGludCkpIH5kaWN0OjpkZWxldGVfZ2V0X21heChjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykgIkRJQ1RSRU1NQVgiICJOVUxMU1dB' + - 'UElGTk9UMiI7CihpbnQsIHNsaWNlLCBpbnQpIHVkaWN0X2dldF9taW4/KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSAoLT4gMSAwIDIpICJESUNUVU1JTiIgIk5V' + - 'TExTV0FQSUZOT1QyIjsKKGludCwgc2xpY2UsIGludCkgdWRpY3RfZ2V0X21heD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtICgtPiAxIDAgMikgIkRJQ1RVTUFY' + - 'IiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBjZWxsLCBpbnQpIHVkaWN0X2dldF9taW5fcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20gKC0+IDEgMCAyKSAi' + - 'RElDVFVNSU5SRUYiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIGNlbGwsIGludCkgdWRpY3RfZ2V0X21heF9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSAo' + - 'LT4gMSAwIDIpICJESUNUVU1BWFJFRiIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgc2xpY2UsIGludCkgaWRpY3RfZ2V0X21pbj8oY2VsbCBkaWN0LCBpbnQga2V5X2xl' + - 'bikgYXNtICgtPiAxIDAgMikgIkRJQ1RJTUlOIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSBpZGljdF9nZXRfbWF4PyhjZWxsIGRpY3QsIGludCBr' + - 'ZXlfbGVuKSBhc20gKC0+IDEgMCAyKSAiRElDVElNQVgiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIGNlbGwsIGludCkgaWRpY3RfZ2V0X21pbl9yZWY/KGNlbGwgZGlj' + - 'dCwgaW50IGtleV9sZW4pIGFzbSAoLT4gMSAwIDIpICJESUNUSU1JTlJFRiIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgY2VsbCwgaW50KSBpZGljdF9nZXRfbWF4X3Jl' + - 'Zj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtICgtPiAxIDAgMikgIkRJQ1RJTUFYUkVGIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSB1ZGlj' + - 'dF9nZXRfbmV4dD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IHBpdm90KSBhc20ocGl2b3QgZGljdCBrZXlfbGVuIC0+IDEgMCAyKSAiRElDVFVHRVRORVhUIiAi' + - 'TlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSB1ZGljdF9nZXRfbmV4dGVxPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgcGl2b3QpIGFzbShwaXZv' + - 'dCBkaWN0IGtleV9sZW4gLT4gMSAwIDIpICJESUNUVUdFVE5FWFRFUSIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgc2xpY2UsIGludCkgdWRpY3RfZ2V0X3ByZXY/KGNl' + - 'bGwgZGljdCwgaW50IGtleV9sZW4sIGludCBwaXZvdCkgYXNtKHBpdm90IGRpY3Qga2V5X2xlbiAtPiAxIDAgMikgIkRJQ1RVR0VUUFJFViIgIk5VTExTV0FQSUZOT1Qy' + - 'IjsKKGludCwgc2xpY2UsIGludCkgdWRpY3RfZ2V0X3ByZXZlcT8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IHBpdm90KSBhc20ocGl2b3QgZGljdCBrZXlfbGVu' + - 'IC0+IDEgMCAyKSAiRElDVFVHRVRQUkVWRVEiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNsaWNlLCBpbnQpIGlkaWN0X2dldF9uZXh0PyhjZWxsIGRpY3QsIGludCBr' + - 'ZXlfbGVuLCBpbnQgcGl2b3QpIGFzbShwaXZvdCBkaWN0IGtleV9sZW4gLT4gMSAwIDIpICJESUNUSUdFVE5FWFQiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNsaWNl' + - 'LCBpbnQpIGlkaWN0X2dldF9uZXh0ZXE/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBwaXZvdCkgYXNtKHBpdm90IGRpY3Qga2V5X2xlbiAtPiAxIDAgMikgIkRJ' + - 'Q1RJR0VUTkVYVEVRIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSBpZGljdF9nZXRfcHJldj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IHBp' + - 'dm90KSBhc20ocGl2b3QgZGljdCBrZXlfbGVuIC0+IDEgMCAyKSAiRElDVElHRVRQUkVWIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSBpZGljdF9n' + - 'ZXRfcHJldmVxPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgcGl2b3QpIGFzbShwaXZvdCBkaWN0IGtleV9sZW4gLT4gMSAwIDIpICJESUNUSUdFVFBSRVZFUSIg' + - 'Ik5VTExTV0FQSUZOT1QyIjsKCjs7OyBDcmVhdGVzIGFuIGVtcHR5IGRpY3Rpb25hcnksIHdoaWNoIGlzIGFjdHVhbGx5IGEgbnVsbCB2YWx1ZS4gRXF1aXZhbGVudCB0' + - 'byBQVVNITlVMTApjZWxsIG5ld19kaWN0KCkgYXNtICJORVdESUNUIjsKOzs7IENoZWNrcyB3aGV0aGVyIGEgZGljdGlvbmFyeSBpcyBlbXB0eS4gRXF1aXZhbGVudCB0' + - 'byBjZWxsX251bGw/LgppbnQgZGljdF9lbXB0eT8oY2VsbCBjKSBhc20gIkRJQ1RFTVBUWSI7CgoKey0gUHJlZml4IGRpY3Rpb25hcnkgcHJpbWl0aXZlcyAtfQooc2xp' + - 'Y2UsIHNsaWNlLCBzbGljZSwgaW50KSBwZnhkaWN0X2dldD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2Uga2V5KSBhc20oa2V5IGRpY3Qga2V5X2xlbikgIlBG' + - 'WERJQ1RHRVRRIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwgaW50KSBwZnhkaWN0X3NldD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2Uga2V5LCBzbGljZSB2' + - 'YWx1ZSkgYXNtKHZhbHVlIGtleSBkaWN0IGtleV9sZW4pICJQRlhESUNUU0VUIjsKKGNlbGwsIGludCkgcGZ4ZGljdF9kZWxldGU/KGNlbGwgZGljdCwgaW50IGtleV9s' + - 'ZW4sIHNsaWNlIGtleSkgYXNtKGtleSBkaWN0IGtleV9sZW4pICJQRlhESUNUREVMIjsKCjs7OyBSZXR1cm5zIHRoZSB2YWx1ZSBvZiB0aGUgZ2xvYmFsIGNvbmZpZ3Vy' + - 'YXRpb24gcGFyYW1ldGVyIHdpdGggaW50ZWdlciBpbmRleCBgaWAgYXMgYSBgY2VsbGAgb3IgYG51bGxgIHZhbHVlLgpjZWxsIGNvbmZpZ19wYXJhbShpbnQgeCkgYXNt' + - 'ICJDT05GSUdPUFRQQVJBTSI7Cjs7OyBDaGVja3Mgd2hldGhlciBjIGlzIGEgbnVsbC4gTm90ZSwgdGhhdCBGdW5DIGFsc28gaGFzIHBvbHltb3JwaGljIG51bGw/IGJ1' + - 'aWx0LWluLgppbnQgY2VsbF9udWxsPyhjZWxsIGMpIGFzbSAiSVNOVUxMIjsKCjs7OyBDcmVhdGVzIGFuIG91dHB1dCBhY3Rpb24gd2hpY2ggd291bGQgcmVzZXJ2ZSBl' + - 'eGFjdGx5IGFtb3VudCBuYW5vdG9uY29pbnMgKGlmIG1vZGUgPSAwKSwgYXQgbW9zdCBhbW91bnQgbmFub3RvbmNvaW5zIChpZiBtb2RlID0gMiksIG9yIGFsbCBidXQg' + - 'YW1vdW50IG5hbm90b25jb2lucyAoaWYgbW9kZSA9IDEgb3IgbW9kZSA9IDMpLCBmcm9tIHRoZSByZW1haW5pbmcgYmFsYW5jZSBvZiB0aGUgYWNjb3VudC4gSXQgaXMg' + - 'cm91Z2hseSBlcXVpdmFsZW50IHRvIGNyZWF0aW5nIGFuIG91dGJvdW5kIG1lc3NhZ2UgY2FycnlpbmcgYW1vdW50IG5hbm90b25jb2lucyAob3IgYiDiiJIgYW1vdW50' + - 'IG5hbm90b25jb2lucywgd2hlcmUgYiBpcyB0aGUgcmVtYWluaW5nIGJhbGFuY2UpIHRvIG9uZXNlbGYsIHNvIHRoYXQgdGhlIHN1YnNlcXVlbnQgb3V0cHV0IGFjdGlv' + - 'bnMgd291bGQgbm90IGJlIGFibGUgdG8gc3BlbmQgbW9yZSBtb25leSB0aGFuIHRoZSByZW1haW5kZXIuIEJpdCArMiBpbiBtb2RlIG1lYW5zIHRoYXQgdGhlIGV4dGVy' + - 'bmFsIGFjdGlvbiBkb2VzIG5vdCBmYWlsIGlmIHRoZSBzcGVjaWZpZWQgYW1vdW50IGNhbm5vdCBiZSByZXNlcnZlZDsgaW5zdGVhZCwgYWxsIHJlbWFpbmluZyBiYWxh' + - 'bmNlIGlzIHJlc2VydmVkLiBCaXQgKzggaW4gbW9kZSBtZWFucyBgYW1vdW50IDwtIC1hbW91bnRgIGJlZm9yZSBwZXJmb3JtaW5nIGFueSBmdXJ0aGVyIGFjdGlvbnMu' + - 'IEJpdCArNCBpbiBtb2RlIG1lYW5zIHRoYXQgYW1vdW50IGlzIGluY3JlYXNlZCBieSB0aGUgb3JpZ2luYWwgYmFsYW5jZSBvZiB0aGUgY3VycmVudCBhY2NvdW50IChi' + - 'ZWZvcmUgdGhlIGNvbXB1dGUgcGhhc2UpLCBpbmNsdWRpbmcgYWxsIGV4dHJhIGN1cnJlbmNpZXMsIGJlZm9yZSBwZXJmb3JtaW5nIGFueSBvdGhlciBjaGVja3MgYW5k' + - 'IGFjdGlvbnMuIEN1cnJlbnRseSwgYW1vdW50IG11c3QgYmUgYSBub24tbmVnYXRpdmUgaW50ZWdlciwgYW5kIG1vZGUgbXVzdCBiZSBpbiB0aGUgcmFuZ2UgMC4uMTUu' + - 'CigpIHJhd19yZXNlcnZlKGludCBhbW91bnQsIGludCBtb2RlKSBpbXB1cmUgYXNtICJSQVdSRVNFUlZFIjsKOzs7IFNpbWlsYXIgdG8gcmF3X3Jlc2VydmUsIGJ1dCBh' + - 'bHNvIGFjY2VwdHMgYSBkaWN0aW9uYXJ5IGV4dHJhX2Ftb3VudCAocmVwcmVzZW50ZWQgYnkgYSBjZWxsIG9yIG51bGwpIHdpdGggZXh0cmEgY3VycmVuY2llcy4gSW4g' + - 'dGhpcyB3YXkgY3VycmVuY2llcyBvdGhlciB0aGFuIFRvbkNvaW4gY2FuIGJlIHJlc2VydmVkLgooKSByYXdfcmVzZXJ2ZV9leHRyYShpbnQgYW1vdW50LCBjZWxsIGV4' + - 'dHJhX2Ftb3VudCwgaW50IG1vZGUpIGltcHVyZSBhc20gIlJBV1JFU0VSVkVYIjsKOzs7IFNlbmRzIGEgcmF3IG1lc3NhZ2UgY29udGFpbmVkIGluIG1zZywgd2hpY2gg' + - 'c2hvdWxkIGNvbnRhaW4gYSBjb3JyZWN0bHkgc2VyaWFsaXplZCBvYmplY3QgTWVzc2FnZSBYLCB3aXRoIHRoZSBvbmx5IGV4Y2VwdGlvbiB0aGF0IHRoZSBzb3VyY2Ug' + - 'YWRkcmVzcyBpcyBhbGxvd2VkIHRvIGhhdmUgZHVtbXkgdmFsdWUgYWRkcl9ub25lICh0byBiZSBhdXRvbWF0aWNhbGx5IHJlcGxhY2VkIHdpdGggdGhlIGN1cnJlbnQg' + - 'c21hcnQgY29udHJhY3QgYWRkcmVzcyksIGFuZCBpaHJfZmVlLCBmd2RfZmVlLCBjcmVhdGVkX2x0IGFuZCBjcmVhdGVkX2F0IGZpZWxkcyBjYW4gaGF2ZSBhcmJpdHJh' + - 'cnkgdmFsdWVzICh0byBiZSByZXdyaXR0ZW4gd2l0aCBjb3JyZWN0IHZhbHVlcyBkdXJpbmcgdGhlIGFjdGlvbiBwaGFzZSBvZiB0aGUgY3VycmVudCB0cmFuc2FjdGlv' + - 'bikuIEludGVnZXIgcGFyYW1ldGVyIG1vZGUgY29udGFpbnMgdGhlIGZsYWdzLiBDdXJyZW50bHkgbW9kZSA9IDAgaXMgdXNlZCBmb3Igb3JkaW5hcnkgbWVzc2FnZXM7' + - 'IG1vZGUgPSAxMjggaXMgdXNlZCBmb3IgbWVzc2FnZXMgdGhhdCBhcmUgdG8gY2FycnkgYWxsIHRoZSByZW1haW5pbmcgYmFsYW5jZSBvZiB0aGUgY3VycmVudCBzbWFy' + - 'dCBjb250cmFjdCAoaW5zdGVhZCBvZiB0aGUgdmFsdWUgb3JpZ2luYWxseSBpbmRpY2F0ZWQgaW4gdGhlIG1lc3NhZ2UpOyBtb2RlID0gNjQgaXMgdXNlZCBmb3IgbWVz' + - 'c2FnZXMgdGhhdCBjYXJyeSBhbGwgdGhlIHJlbWFpbmluZyB2YWx1ZSBvZiB0aGUgaW5ib3VuZCBtZXNzYWdlIGluIGFkZGl0aW9uIHRvIHRoZSB2YWx1ZSBpbml0aWFs' + - 'bHkgaW5kaWNhdGVkIGluIHRoZSBuZXcgbWVzc2FnZSAoaWYgYml0IDAgaXMgbm90IHNldCwgdGhlIGdhcyBmZWVzIGFyZSBkZWR1Y3RlZCBmcm9tIHRoaXMgYW1vdW50' + - 'KTsgbW9kZScgPSBtb2RlICsgMSBtZWFucyB0aGF0IHRoZSBzZW5kZXIgd2FudHMgdG8gcGF5IHRyYW5zZmVyIGZlZXMgc2VwYXJhdGVseTsgbW9kZScgPSBtb2RlICsg' + - 'MiBtZWFucyB0aGF0IGFueSBlcnJvcnMgYXJpc2luZyB3aGlsZSBwcm9jZXNzaW5nIHRoaXMgbWVzc2FnZSBkdXJpbmcgdGhlIGFjdGlvbiBwaGFzZSBzaG91bGQgYmUg' + - 'aWdub3JlZC4gRmluYWxseSwgbW9kZScgPSBtb2RlICsgMzIgbWVhbnMgdGhhdCB0aGUgY3VycmVudCBhY2NvdW50IG11c3QgYmUgZGVzdHJveWVkIGlmIGl0cyByZXN1' + - 'bHRpbmcgYmFsYW5jZSBpcyB6ZXJvLiBUaGlzIGZsYWcgaXMgdXN1YWxseSBlbXBsb3llZCB0b2dldGhlciB3aXRoICsxMjguCigpIHNlbmRfcmF3X21lc3NhZ2UoY2Vs' + - 'bCBtc2csIGludCBtb2RlKSBpbXB1cmUgYXNtICJTRU5EUkFXTVNHIjsKOzs7IENyZWF0ZXMgYW4gb3V0cHV0IGFjdGlvbiB0aGF0IHdvdWxkIGNoYW5nZSB0aGlzIHNt' + - 'YXJ0IGNvbnRyYWN0IGNvZGUgdG8gdGhhdCBnaXZlbiBieSBjZWxsIG5ld19jb2RlLiBOb3RpY2UgdGhhdCB0aGlzIGNoYW5nZSB3aWxsIHRha2UgZWZmZWN0IG9ubHkg' + - 'YWZ0ZXIgdGhlIHN1Y2Nlc3NmdWwgdGVybWluYXRpb24gb2YgdGhlIGN1cnJlbnQgcnVuIG9mIHRoZSBzbWFydCBjb250cmFjdAooKSBzZXRfY29kZShjZWxsIG5ld19j' + - 'b2RlKSBpbXB1cmUgYXNtICJTRVRDT0RFIjsKCjs7OyBHZW5lcmF0ZXMgYSBuZXcgcHNldWRvLXJhbmRvbSB1bnNpZ25lZCAyNTYtYml0IGludGVnZXIgeC4gVGhlIGFs' + - 'Z29yaXRobSBpcyBhcyBmb2xsb3dzOiBpZiByIGlzIHRoZSBvbGQgdmFsdWUgb2YgdGhlIHJhbmRvbSBzZWVkLCBjb25zaWRlcmVkIGFzIGEgMzItYnl0ZSBhcnJheSAo' + - 'YnkgY29uc3RydWN0aW5nIHRoZSBiaWctZW5kaWFuIHJlcHJlc2VudGF0aW9uIG9mIGFuIHVuc2lnbmVkIDI1Ni1iaXQgaW50ZWdlciksIHRoZW4gaXRzIHNoYTUxMihy' + - 'KSBpcyBjb21wdXRlZDsgdGhlIGZpcnN0IDMyIGJ5dGVzIG9mIHRoaXMgaGFzaCBhcmUgc3RvcmVkIGFzIHRoZSBuZXcgdmFsdWUgcicgb2YgdGhlIHJhbmRvbSBzZWVk' + - 'LCBhbmQgdGhlIHJlbWFpbmluZyAzMiBieXRlcyBhcmUgcmV0dXJuZWQgYXMgdGhlIG5leHQgcmFuZG9tIHZhbHVlIHguCmludCByYW5kb20oKSBpbXB1cmUgYXNtICJS' + - 'QU5EVTI1NiI7Cjs7OyBHZW5lcmF0ZXMgYSBuZXcgcHNldWRvLXJhbmRvbSBpbnRlZ2VyIHogaW4gdGhlIHJhbmdlIDAuLnJhbmdl4oiSMSAob3IgcmFuZ2UuLuKIkjEs' + - 'IGlmIHJhbmdlIDwgMCkuIE1vcmUgcHJlY2lzZWx5LCBhbiB1bnNpZ25lZCByYW5kb20gdmFsdWUgeCBpcyBnZW5lcmF0ZWQgYXMgaW4gcmFuZG9tOyB0aGVuIHogOj0g' + - 'eCAqIHJhbmdlIC8gMl4yNTYgaXMgY29tcHV0ZWQuCmludCByYW5kKGludCByYW5nZSkgaW1wdXJlIGFzbSAiUkFORCI7Cjs7OyBSZXR1cm5zIHRoZSBjdXJyZW50IHJh' + - 'bmRvbSBzZWVkIGFzIGFuIHVuc2lnbmVkIDI1Ni1iaXQgSW50ZWdlci4KaW50IGdldF9zZWVkKCkgaW1wdXJlIGFzbSAiUkFORFNFRUQiOwo7OzsgU2V0cyB0aGUgcmFu' + - 'ZG9tIHNlZWQgdG8gdW5zaWduZWQgMjU2LWJpdCBzZWVkLgooKSBzZXRfc2VlZChpbnQgeCkgaW1wdXJlIGFzbSAiU0VUUkFORCI7Cjs7OyBNaXhlcyB1bnNpZ25lZCAy' + - 'NTYtYml0IGludGVnZXIgeCBpbnRvIHRoZSByYW5kb20gc2VlZCByIGJ5IHNldHRpbmcgdGhlIHJhbmRvbSBzZWVkIHRvIHNoYTI1NiBvZiB0aGUgY29uY2F0ZW5hdGlv' + - 'biBvZiB0d28gMzItYnl0ZSBzdHJpbmdzOiB0aGUgZmlyc3Qgd2l0aCB0aGUgYmlnLWVuZGlhbiByZXByZXNlbnRhdGlvbiBvZiB0aGUgb2xkIHNlZWQgciwgYW5kIHRo' + - 'ZSBzZWNvbmQgd2l0aCB0aGUgYmlnLWVuZGlhbiByZXByZXNlbnRhdGlvbiBvZiB4LgooKSByYW5kb21pemUoaW50IHgpIGltcHVyZSBhc20gIkFERFJBTkQiOwo7Ozsg' + - 'RXF1aXZhbGVudCB0byByYW5kb21pemUoY3VyX2x0KCkpOy4KKCkgcmFuZG9taXplX2x0KCkgaW1wdXJlIGFzbSAiTFRJTUUiICJBRERSQU5EIjsKCjs7OyBDaGVja3Mg' + - 'd2hldGhlciB0aGUgZGF0YSBwYXJ0cyBvZiB0d28gc2xpY2VzIGNvaW5zaWRlCmludCBlcXVhbF9zbGljZXNfYml0cyhzbGljZSBhLCBzbGljZSBiKSBhc20gIlNERVEi' + - 'Owo7OzsgQ2hlY2tzIHdoZXRoZXIgYiBpcyBhIG51bGwuIE5vdGUsIHRoYXQgRnVuQyBhbHNvIGhhcyBwb2x5bW9ycGhpYyBudWxsPyBidWlsdC1pbi4KaW50IGJ1aWxk' + - 'ZXJfbnVsbD8oYnVpbGRlciBiKSBhc20gIklTTlVMTCI7Cjs7OyBDb25jYXRlbmF0ZXMgdHdvIGJ1aWxkZXJzCmJ1aWxkZXIgc3RvcmVfYnVpbGRlcihidWlsZGVyIHRv' + - 'LCBidWlsZGVyIGZyb20pIGFzbSAiU1RCUiI7Cgo7OyBDVVNUT006Cgo7OyBUVk0gVVBHUkFERSAyMDIzLTA3IGh0dHBzOi8vZG9jcy50b24ub3JnL2xlYXJuL3R2bS1p' + - 'bnN0cnVjdGlvbnMvdHZtLXVwZ3JhZGUtMjAyMy0wNwo7OyBJbiBtYWlubmV0IHNpbmNlIDIwIERlYyAyMDIzIGh0dHBzOi8vdC5tZS90b25ibG9ja2NoYWluLzIyNgoK' + - 'Ozs7IFJldHJpZXZlcyBjb2RlIG9mIHNtYXJ0LWNvbnRyYWN0IGZyb20gYzcKY2VsbCBteV9jb2RlKCkgYXNtICJNWUNPREUiOwo='; + 'IDEgMCkgIkxER1JBTVMiOwooc2xpY2UsIGludCkgbG9hZF9jb2lucyhzbGljZSBzKSBhc20oLT4gMSAwKSAiTERWQVJVSU5UMTYiOwoKKHNsaWNlLCBpbnQpIGxvYWRf' + + 'dmFyaW50MTYoc2xpY2UgcykgYXNtKC0+IDEgMCkgIkxEVkFSSU5UMTYiOwooc2xpY2UsIGludCkgbG9hZF92YXJpbnQzMihzbGljZSBzKSBhc20oLT4gMSAwKSAiTERW' + + 'QVJJTlQzMiI7CihzbGljZSwgaW50KSBsb2FkX3ZhcnVpbnQxNihzbGljZSBzKSBhc20oLT4gMSAwKSAiTERWQVJVSU5UMTYiOwooc2xpY2UsIGludCkgbG9hZF92YXJ1' + + 'aW50MzIoc2xpY2UgcykgYXNtKC0+IDEgMCkgIkxEVkFSVUlOVDMyIjsKCjs7OyBSZXR1cm5zIGFsbCBidXQgdGhlIGZpcnN0IGAwIOKJpCBsZW4g4omkIDEwMjNgIGJp' + + 'dHMgb2YgYHNsaWNlYCBbc10uCnNsaWNlIHNraXBfYml0cyhzbGljZSBzLCBpbnQgbGVuKSBhc20gIlNEU0tJUEZJUlNUIjsKKHNsaWNlLCAoKSkgfnNraXBfYml0cyhz' + + 'bGljZSBzLCBpbnQgbGVuKSBhc20gIlNEU0tJUEZJUlNUIjsKCjs7OyBSZXR1cm5zIHRoZSBmaXJzdCBgMCDiiaQgbGVuIOKJpCAxMDIzYCBiaXRzIG9mIGBzbGljZWAg' + + 'W3NdLgpzbGljZSBmaXJzdF9iaXRzKHNsaWNlIHMsIGludCBsZW4pIGFzbSAiU0RDVVRGSVJTVCI7Cgo7OzsgUmV0dXJucyBhbGwgYnV0IHRoZSBsYXN0IGAwIOKJpCBs' + + 'ZW4g4omkIDEwMjNgIGJpdHMgb2YgYHNsaWNlYCBbc10uCnNsaWNlIHNraXBfbGFzdF9iaXRzKHNsaWNlIHMsIGludCBsZW4pIGFzbSAiU0RTS0lQTEFTVCI7CihzbGlj' + + 'ZSwgKCkpIH5za2lwX2xhc3RfYml0cyhzbGljZSBzLCBpbnQgbGVuKSBhc20gIlNEU0tJUExBU1QiOwoKOzs7IFJldHVybnMgdGhlIGxhc3QgYDAg4omkIGxlbiDiiaQg' + + 'MTAyM2AgYml0cyBvZiBgc2xpY2VgIFtzXS4Kc2xpY2Ugc2xpY2VfbGFzdChzbGljZSBzLCBpbnQgbGVuKSBhc20gIlNEQ1VUTEFTVCI7Cgo7OzsgTG9hZHMgYSBkaWN0' + + 'aW9uYXJ5IGBEYCAoSGFzaE1hcEUpIGZyb20gYHNsaWNlYCBbc10uCjs7OyAocmV0dXJucyBgbnVsbGAgaWYgYG5vdGhpbmdgIGNvbnN0cnVjdG9yIGlzIHVzZWQpLgoo' + + 'c2xpY2UsIGNlbGwpIGxvYWRfZGljdChzbGljZSBzKSBhc20oLT4gMSAwKSAiTERESUNUIjsKCjs7OyBQcmVsb2FkcyBhIGRpY3Rpb25hcnkgYERgIGZyb20gYHNsaWNl' + + 'YCBbc10uCmNlbGwgcHJlbG9hZF9kaWN0KHNsaWNlIHMpIGFzbSAiUExERElDVCI7Cgo7OzsgTG9hZHMgYSBkaWN0aW9uYXJ5IGFzIFtsb2FkX2RpY3RdLCBidXQgcmV0' + + 'dXJucyBvbmx5IHRoZSByZW1haW5kZXIgb2YgdGhlIHNsaWNlLgpzbGljZSBza2lwX2RpY3Qoc2xpY2UgcykgYXNtICJTS0lQRElDVCI7CihzbGljZSwgKCkpIH5za2lw' + + 'X2RpY3Qoc2xpY2UgcykgYXNtICJTS0lQRElDVCI7Cgo7OzsgTG9hZHMgKE1heWJlIF5DZWxsKSBmcm9tIGBzbGljZWAgW3NdLgo7OzsgSW4gb3RoZXIgd29yZHMgbG9h' + + 'ZHMgMSBiaXQgYW5kIGlmIGl0IGlzIHRydWUKOzs7IGxvYWRzIGZpcnN0IHJlZiBhbmQgcmV0dXJuIGl0IHdpdGggc2xpY2UgcmVtYWluZGVyCjs7OyBvdGhlcndpc2Ug' + + 'cmV0dXJucyBgbnVsbGAgYW5kIHNsaWNlIHJlbWFpbmRlcgooc2xpY2UsIGNlbGwpIGxvYWRfbWF5YmVfcmVmKHNsaWNlIHMpIGFzbSgtPiAxIDApICJMRE9QVFJFRiI7' + + 'Cgo7OzsgUHJlbG9hZHMgKE1heWJlIF5DZWxsKSBmcm9tIGBzbGljZWAgW3NdLgpjZWxsIHByZWxvYWRfbWF5YmVfcmVmKHNsaWNlIHMpIGFzbSAiUExET1BUUkVGIjsK' + + 'Cgo7OzsgUmV0dXJucyB0aGUgZGVwdGggb2YgYGNlbGxgIFtjXS4KOzs7IElmIFtjXSBoYXMgbm8gcmVmZXJlbmNlcywgdGhlbiByZXR1cm4gYDBgOwo7Ozsgb3RoZXJ3' + + 'aXNlIHRoZSByZXR1cm5lZCB2YWx1ZSBpcyBvbmUgcGx1cyB0aGUgbWF4aW11bSBvZiBkZXB0aHMgb2YgY2VsbHMgcmVmZXJyZWQgdG8gZnJvbSBbY10uCjs7OyBJZiBb' + + 'Y10gaXMgYSBgbnVsbGAgaW5zdGVhZCBvZiBhIGNlbGwsIHJldHVybnMgemVyby4KaW50IGNlbGxfZGVwdGgoY2VsbCBjKSBhc20gIkNERVBUSCI7CgoKey0KICAjIFNs' + + 'aWNlIHNpemUgcHJpbWl0aXZlcwotfQoKOzs7IFJldHVybnMgdGhlIG51bWJlciBvZiByZWZlcmVuY2VzIGluIGBzbGljZWAgW3NdLgppbnQgc2xpY2VfcmVmcyhzbGlj' + + 'ZSBzKSBhc20gIlNSRUZTIjsKCjs7OyBSZXR1cm5zIHRoZSBudW1iZXIgb2YgZGF0YSBiaXRzIGluIGBzbGljZWAgW3NdLgppbnQgc2xpY2VfYml0cyhzbGljZSBzKSBh' + + 'c20gIlNCSVRTIjsKCjs7OyBSZXR1cm5zIGJvdGggdGhlIG51bWJlciBvZiBkYXRhIGJpdHMgYW5kIHRoZSBudW1iZXIgb2YgcmVmZXJlbmNlcyBpbiBgc2xpY2VgIFtz' + + 'XS4KKGludCwgaW50KSBzbGljZV9iaXRzX3JlZnMoc2xpY2UgcykgYXNtICJTQklUUkVGUyI7Cgo7OzsgQ2hlY2tzIHdoZXRoZXIgYSBgc2xpY2VgIFtzXSBpcyBlbXB0' + + 'eSAoaS5lLiwgY29udGFpbnMgbm8gYml0cyBvZiBkYXRhIGFuZCBubyBjZWxsIHJlZmVyZW5jZXMpLgppbnQgc2xpY2VfZW1wdHk/KHNsaWNlIHMpIGFzbSAiU0VNUFRZ' + + 'IjsKCjs7OyBDaGVja3Mgd2hldGhlciBgc2xpY2VgIFtzXSBoYXMgbm8gYml0cyBvZiBkYXRhLgppbnQgc2xpY2VfZGF0YV9lbXB0eT8oc2xpY2UgcykgYXNtICJTREVN' + + 'UFRZIjsKCjs7OyBDaGVja3Mgd2hldGhlciBgc2xpY2VgIFtzXSBoYXMgbm8gcmVmZXJlbmNlcy4KaW50IHNsaWNlX3JlZnNfZW1wdHk/KHNsaWNlIHMpIGFzbSAiU1JF' + + 'TVBUWSI7Cgo7OzsgUmV0dXJucyB0aGUgZGVwdGggb2YgYHNsaWNlYCBbc10uCjs7OyBJZiBbc10gaGFzIG5vIHJlZmVyZW5jZXMsIHRoZW4gcmV0dXJucyBgMGA7Cjs7' + + 'OyBvdGhlcndpc2UgdGhlIHJldHVybmVkIHZhbHVlIGlzIG9uZSBwbHVzIHRoZSBtYXhpbXVtIG9mIGRlcHRocyBvZiBjZWxscyByZWZlcnJlZCB0byBmcm9tIFtzXS4K' + + 'aW50IHNsaWNlX2RlcHRoKHNsaWNlIHMpIGFzbSAiU0RFUFRIIjsKCnstCiAgIyBCdWlsZGVyIHNpemUgcHJpbWl0aXZlcwotfQoKOzs7IFJldHVybnMgdGhlIG51bWJl' + + 'ciBvZiBjZWxsIHJlZmVyZW5jZXMgYWxyZWFkeSBzdG9yZWQgaW4gYGJ1aWxkZXJgIFtiXQppbnQgYnVpbGRlcl9yZWZzKGJ1aWxkZXIgYikgYXNtICJCUkVGUyI7Cgo7' + + 'OzsgUmV0dXJucyB0aGUgbnVtYmVyIG9mIGRhdGEgYml0cyBhbHJlYWR5IHN0b3JlZCBpbiBgYnVpbGRlcmAgW2JdLgppbnQgYnVpbGRlcl9iaXRzKGJ1aWxkZXIgYikg' + + 'YXNtICJCQklUUyI7Cgo7OzsgUmV0dXJucyB0aGUgZGVwdGggb2YgYGJ1aWxkZXJgIFtiXS4KOzs7IElmIG5vIGNlbGwgcmVmZXJlbmNlcyBhcmUgc3RvcmVkIGluIFti' + + 'XSwgdGhlbiByZXR1cm5zIDA7Cjs7OyBvdGhlcndpc2UgdGhlIHJldHVybmVkIHZhbHVlIGlzIG9uZSBwbHVzIHRoZSBtYXhpbXVtIG9mIGRlcHRocyBvZiBjZWxscyBy' + + 'ZWZlcnJlZCB0byBmcm9tIFtiXS4KaW50IGJ1aWxkZXJfZGVwdGgoYnVpbGRlciBiKSBhc20gIkJERVBUSCI7Cgp7LQogICMgQnVpbGRlciBwcmltaXRpdmVzCiAgSXQg' + + 'aXMgc2FpZCB0aGF0IGEgcHJpbWl0aXZlIF9zdG9yZXNfIGEgdmFsdWUgYHhgIGludG8gYSBidWlsZGVyIGBiYAogIGlmIGl0IHJldHVybnMgYSBtb2RpZmllZCB2ZXJz' + + 'aW9uIG9mIHRoZSBidWlsZGVyIGBiJ2Agd2l0aCB0aGUgdmFsdWUgYHhgIHN0b3JlZCBhdCB0aGUgZW5kIG9mIGl0LgogIEl0IGNhbiBiZSB1c2VkIGFzIFtub24tbW9k' + + 'aWZ5aW5nIG1ldGhvZF0oaHR0cHM6Ly90b24ub3JnL2RvY3MvIy9mdW5jL3N0YXRlbWVudHM/aWQ9bm9uLW1vZGlmeWluZy1tZXRob2RzKS4KCiAgQWxsIHRoZSBwcmlt' + + 'aXRpdmVzIGJlbG93IGZpcnN0IGNoZWNrIHdoZXRoZXIgdGhlcmUgaXMgZW5vdWdoIHNwYWNlIGluIHRoZSBgYnVpbGRlcmAsCiAgYW5kIG9ubHkgdGhlbiBjaGVjayB0' + + 'aGUgcmFuZ2Ugb2YgdGhlIHZhbHVlIGJlaW5nIHNlcmlhbGl6ZWQuCi19Cgo7OzsgQ3JlYXRlcyBhIG5ldyBlbXB0eSBgYnVpbGRlcmAuCmJ1aWxkZXIgYmVnaW5fY2Vs' + + 'bCgpIGFzbSAiTkVXQyI7Cgo7OzsgQ29udmVydHMgYSBgYnVpbGRlcmAgaW50byBhbiBvcmRpbmFyeSBgY2VsbGAuCmNlbGwgZW5kX2NlbGwoYnVpbGRlciBiKSBhc20g' + + 'IkVOREMiOwoKOzs7IFN0b3JlcyBhIHJlZmVyZW5jZSB0byBgY2VsbGAgW2NdIGludG8gYGJ1aWxkZXJgIFtiXS4KYnVpbGRlciBzdG9yZV9yZWYoYnVpbGRlciBiLCBj' + + 'ZWxsIGMpIGFzbShjIGIpICJTVFJFRiI7Cgo7OzsgU3RvcmVzIGFuIHVuc2lnbmVkIFtsZW5dLWJpdCBpbnRlZ2VyIGB4YCBpbnRvIGBiYCBmb3IgYDAg4omkIGxlbiDi' + + 'iaQgMjU2YC4KOzsgYnVpbGRlciBzdG9yZV91aW50KGJ1aWxkZXIgYiwgaW50IHgsIGludCBsZW4pIGFzbSh4IGIgbGVuKSAiU1RVWCI7Cgo7OzsgU3RvcmVzIGEgc2ln' + + 'bmVkIFtsZW5dLWJpdCBpbnRlZ2VyIGB4YCBpbnRvIGBiYCBmb3JgIDAg4omkIGxlbiDiiaQgMjU3YC4KOzsgYnVpbGRlciBzdG9yZV9pbnQoYnVpbGRlciBiLCBpbnQg' + + 'eCwgaW50IGxlbikgYXNtKHggYiBsZW4pICJTVElYIjsKCgo7OzsgU3RvcmVzIGBzbGljZWAgW3NdIGludG8gYGJ1aWxkZXJgIFtiXQpidWlsZGVyIHN0b3JlX3NsaWNl' + + 'KGJ1aWxkZXIgYiwgc2xpY2UgcykgYXNtICJTVFNMSUNFUiI7Cgo7OzsgU3RvcmVzIChzZXJpYWxpemVzKSBhbiBpbnRlZ2VyIFt4XSBpbiB0aGUgcmFuZ2UgYDAuLjJe' + + 'MTIwIOKIkiAxYCBpbnRvIGBidWlsZGVyYCBbYl0uCjs7OyBUaGUgc2VyaWFsaXphdGlvbiBvZiBbeF0gY29uc2lzdHMgb2YgYSA0LWJpdCB1bnNpZ25lZCBiaWctZW5k' + + 'aWFuIGludGVnZXIgYGxgLAo7Ozsgd2hpY2ggaXMgdGhlIHNtYWxsZXN0IGludGVnZXIgYGwg4omlIDBgLCBzdWNoIHRoYXQgYHggPCAyXjhsYCwKOzs7IGZvbGxvd2Vk' + + 'IGJ5IGFuIGA4bGAtYml0IHVuc2lnbmVkIGJpZy1lbmRpYW4gcmVwcmVzZW50YXRpb24gb2YgW3hdLgo7OzsgSWYgW3hdIGRvZXMgbm90IGJlbG9uZyB0byB0aGUgc3Vw' + + 'cG9ydGVkIHJhbmdlLCBhIHJhbmdlIGNoZWNrIGV4Y2VwdGlvbiBpcyB0aHJvd24uCjs7Owo7OzsgU3RvcmUgYW1vdW50cyBvZiBUb25Db2lucyB0byB0aGUgYnVpbGRl' + + 'ciBhcyBWYXJVSW50ZWdlciAxNgpidWlsZGVyIHN0b3JlX2dyYW1zKGJ1aWxkZXIgYiwgaW50IHgpIGFzbSAiU1RHUkFNUyI7CmJ1aWxkZXIgc3RvcmVfY29pbnMoYnVp' + + 'bGRlciBiLCBpbnQgeCkgYXNtICJTVFZBUlVJTlQxNiI7CgpidWlsZGVyIHN0b3JlX3ZhcmludDE2KGJ1aWxkZXIgYiwgaW50IHgpIGFzbSAiU1RWQVJJTlQxNiI7CmJ1' + + 'aWxkZXIgc3RvcmVfdmFyaW50MzIoYnVpbGRlciBiLCBpbnQgeCkgYXNtICJTVFZBUklOVDMyIjsKYnVpbGRlciBzdG9yZV92YXJ1aW50MTYoYnVpbGRlciBiLCBpbnQg' + + 'eCkgYXNtICJTVFZBUlVJTlQxNiI7CmJ1aWxkZXIgc3RvcmVfdmFydWludDMyKGJ1aWxkZXIgYiwgaW50IHgpIGFzbSAiU1RWQVJVSU5UMzIiOwoKOzs7IFN0b3JlcyBk' + + 'aWN0aW9uYXJ5IGBEYCByZXByZXNlbnRlZCBieSBgY2VsbGAgW2NdIG9yIGBudWxsYCBpbnRvIGBidWlsZGVyYCBbYl0uCjs7OyBJbiBvdGhlciB3b3Jkcywgc3RvcmVz' + + 'IGEgYDFgLWJpdCBhbmQgYSByZWZlcmVuY2UgdG8gW2NdIGlmIFtjXSBpcyBub3QgYG51bGxgIGFuZCBgMGAtYml0IG90aGVyd2lzZS4KYnVpbGRlciBzdG9yZV9kaWN0' + + 'KGJ1aWxkZXIgYiwgY2VsbCBjKSBhc20oYyBiKSAiU1RESUNUIjsKCjs7OyBTdG9yZXMgKE1heWJlIF5DZWxsKSB0byBidWlsZGVyOgo7OzsgaWYgY2VsbCBpcyBudWxs' + + 'IHN0b3JlIDEgemVybyBiaXQKOzs7IG90aGVyd2lzZSBzdG9yZSAxIHRydWUgYml0IGFuZCByZWYgdG8gY2VsbApidWlsZGVyIHN0b3JlX21heWJlX3JlZihidWlsZGVy' + + 'IGIsIGNlbGwgYykgYXNtKGMgYikgIlNUT1BUUkVGIjsKCgp7LQogICMgQWRkcmVzcyBtYW5pcHVsYXRpb24gcHJpbWl0aXZlcwogIFRoZSBhZGRyZXNzIG1hbmlwdWxh' + + 'dGlvbiBwcmltaXRpdmVzIGxpc3RlZCBiZWxvdyBzZXJpYWxpemUgYW5kIGRlc2VyaWFsaXplIHZhbHVlcyBhY2NvcmRpbmcgdG8gdGhlIGZvbGxvd2luZyBUTC1CIHNj' + + 'aGVtZToKICBgYGBUTC1CCiAgYWRkcl9ub25lJDAwID0gTXNnQWRkcmVzc0V4dDsKICBhZGRyX2V4dGVybiQwMSBsZW46KCMjIDgpIGV4dGVybmFsX2FkZHJlc3M6KGJp' + + 'dHMgbGVuKQogICAgICAgICAgICAgICA9IE1zZ0FkZHJlc3NFeHQ7CiAgYW55Y2FzdF9pbmZvJF8gZGVwdGg6KCM8PSAzMCkgeyBkZXB0aCA+PSAxIH0KICAgIHJld3Jp' + + 'dGVfcGZ4OihiaXRzIGRlcHRoKSA9IEFueWNhc3Q7CiAgYWRkcl9zdGQkMTAgYW55Y2FzdDooTWF5YmUgQW55Y2FzdCkKICAgIHdvcmtjaGFpbl9pZDppbnQ4IGFkZHJl' + + 'c3M6Yml0czI1NiA9IE1zZ0FkZHJlc3NJbnQ7CiAgYWRkcl92YXIkMTEgYW55Y2FzdDooTWF5YmUgQW55Y2FzdCkgYWRkcl9sZW46KCMjIDkpCiAgICB3b3JrY2hhaW5f' + + 'aWQ6aW50MzIgYWRkcmVzczooYml0cyBhZGRyX2xlbikgPSBNc2dBZGRyZXNzSW50OwogIF8gXzpNc2dBZGRyZXNzSW50ID0gTXNnQWRkcmVzczsKICBfIF86TXNnQWRk' + + 'cmVzc0V4dCA9IE1zZ0FkZHJlc3M7CgogIGludF9tc2dfaW5mbyQwIGlocl9kaXNhYmxlZDpCb29sIGJvdW5jZTpCb29sIGJvdW5jZWQ6Qm9vbAogICAgc3JjOk1zZ0Fk' + + 'ZHJlc3MgZGVzdDpNc2dBZGRyZXNzSW50CiAgICB2YWx1ZTpDdXJyZW5jeUNvbGxlY3Rpb24gaWhyX2ZlZTpHcmFtcyBmd2RfZmVlOkdyYW1zCiAgICBjcmVhdGVkX2x0' + + 'OnVpbnQ2NCBjcmVhdGVkX2F0OnVpbnQzMiA9IENvbW1vbk1zZ0luZm9SZWxheGVkOwogIGV4dF9vdXRfbXNnX2luZm8kMTEgc3JjOk1zZ0FkZHJlc3MgZGVzdDpNc2dB' + + 'ZGRyZXNzRXh0CiAgICBjcmVhdGVkX2x0OnVpbnQ2NCBjcmVhdGVkX2F0OnVpbnQzMiA9IENvbW1vbk1zZ0luZm9SZWxheGVkOwogIGBgYAogIEEgZGVzZXJpYWxpemVk' + + 'IGBNc2dBZGRyZXNzYCBpcyByZXByZXNlbnRlZCBieSBhIHR1cGxlIGB0YCBhcyBmb2xsb3dzOgoKICAtIGBhZGRyX25vbmVgIGlzIHJlcHJlc2VudGVkIGJ5IGB0ID0g' + + 'KDApYCwKICAgIGkuZS4sIGEgdHVwbGUgY29udGFpbmluZyBleGFjdGx5IG9uZSBpbnRlZ2VyIGVxdWFsIHRvIHplcm8uCiAgLSBgYWRkcl9leHRlcm5gIGlzIHJlcHJl' + + 'c2VudGVkIGJ5IGB0ID0gKDEsIHMpYCwKICAgIHdoZXJlIHNsaWNlIGBzYCBjb250YWlucyB0aGUgZmllbGQgYGV4dGVybmFsX2FkZHJlc3NgLiBJbiBvdGhlciB3b3Jk' + + 'cywgYAogICAgdGAgaXMgYSBwYWlyIChhIHR1cGxlIGNvbnNpc3Rpbmcgb2YgdHdvIGVudHJpZXMpLCBjb250YWluaW5nIGFuIGludGVnZXIgZXF1YWwgdG8gb25lIGFu' + + 'ZCBzbGljZSBgc2AuCiAgLSBgYWRkcl9zdGRgIGlzIHJlcHJlc2VudGVkIGJ5IGB0ID0gKDIsIHUsIHgsIHMpYCwKICAgIHdoZXJlIGB1YCBpcyBlaXRoZXIgYSBgbnVs' + + 'bGAgKGlmIGBhbnljYXN0YCBpcyBhYnNlbnQpIG9yIGEgc2xpY2UgYHMnYCBjb250YWluaW5nIGByZXdyaXRlX3BmeGAgKGlmIGFueWNhc3QgaXMgcHJlc2VudCkuCiAg' + + 'ICBOZXh0LCBpbnRlZ2VyIGB4YCBpcyB0aGUgYHdvcmtjaGFpbl9pZGAsIGFuZCBzbGljZSBgc2AgY29udGFpbnMgdGhlIGFkZHJlc3MuCiAgLSBgYWRkcl92YXJgIGlz' + + 'IHJlcHJlc2VudGVkIGJ5IGB0ID0gKDMsIHUsIHgsIHMpYCwKICAgIHdoZXJlIGB1YCwgYHhgLCBhbmQgYHNgIGhhdmUgdGhlIHNhbWUgbWVhbmluZyBhcyBmb3IgYGFk' + + 'ZHJfc3RkYC4KLX0KCjs7OyBMb2FkcyBmcm9tIHNsaWNlIFtzXSB0aGUgb25seSBwcmVmaXggdGhhdCBpcyBhIHZhbGlkIGBNc2dBZGRyZXNzYCwKOzs7IGFuZCByZXR1' + + 'cm5zIGJvdGggdGhpcyBwcmVmaXggYHMnYCBhbmQgdGhlIHJlbWFpbmRlciBgcycnYCBvZiBbc10gYXMgc2xpY2VzLgooc2xpY2UsIHNsaWNlKSBsb2FkX21zZ19hZGRy' + + 'KHNsaWNlIHMpIGFzbSgtPiAxIDApICJMRE1TR0FERFIiOwoKOzs7IERlY29tcG9zZXMgc2xpY2UgW3NdIGNvbnRhaW5pbmcgYSB2YWxpZCBgTXNnQWRkcmVzc2AgaW50' + + 'byBhIGB0dXBsZSB0YCB3aXRoIHNlcGFyYXRlIGZpZWxkcyBvZiB0aGlzIGBNc2dBZGRyZXNzYC4KOzs7IElmIFtzXSBpcyBub3QgYSB2YWxpZCBgTXNnQWRkcmVzc2As' + + 'IGEgY2VsbCBkZXNlcmlhbGl6YXRpb24gZXhjZXB0aW9uIGlzIHRocm93bi4KdHVwbGUgcGFyc2VfYWRkcihzbGljZSBzKSBhc20gIlBBUlNFTVNHQUREUiI7Cgo7Ozsg' + + 'UGFyc2VzIHNsaWNlIFtzXSBjb250YWluaW5nIGEgdmFsaWQgYE1zZ0FkZHJlc3NJbnRgICh1c3VhbGx5IGEgYG1zZ19hZGRyX3N0ZGApLAo7OzsgYXBwbGllcyByZXdy' + + 'aXRpbmcgZnJvbSB0aGUgYW55Y2FzdCAoaWYgcHJlc2VudCkgdG8gdGhlIHNhbWUtbGVuZ3RoIHByZWZpeCBvZiB0aGUgYWRkcmVzcywKOzs7IGFuZCByZXR1cm5zIGJv' + + 'dGggdGhlIHdvcmtjaGFpbiBhbmQgdGhlIDI1Ni1iaXQgYWRkcmVzcyBhcyBpbnRlZ2Vycy4KOzs7IElmIHRoZSBhZGRyZXNzIGlzIG5vdCAyNTYtYml0LCBvciBpZiBb' + + 'c10gaXMgbm90IGEgdmFsaWQgc2VyaWFsaXphdGlvbiBvZiBgTXNnQWRkcmVzc0ludGAsCjs7OyB0aHJvd3MgYSBjZWxsIGRlc2VyaWFsaXphdGlvbiBleGNlcHRpb24u' + + 'CihpbnQsIGludCkgcGFyc2Vfc3RkX2FkZHIoc2xpY2UgcykgYXNtICJSRVdSSVRFU1REQUREUiI7Cgo7OzsgQSB2YXJpYW50IG9mIFtwYXJzZV9zdGRfYWRkcl0gdGhh' + + 'dCByZXR1cm5zIHRoZSAocmV3cml0dGVuKSBhZGRyZXNzIGFzIGEgc2xpY2UgW3NdLAo7OzsgZXZlbiBpZiBpdCBpcyBub3QgZXhhY3RseSAyNTYgYml0IGxvbmcgKHJl' + + 'cHJlc2VudGVkIGJ5IGEgYG1zZ19hZGRyX3ZhcmApLgooaW50LCBzbGljZSkgcGFyc2VfdmFyX2FkZHIoc2xpY2UgcykgYXNtICJSRVdSSVRFVkFSQUREUiI7Cgp7LQog' + + 'ICMgRGljdGlvbmFyeSBwcmltaXRpdmVzCi19CgoKOzs7IFNldHMgdGhlIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBba2V5X2xlbl0tYml0IGtleSBzaWduZWQgaW5kZXgg' + + 'aW4gZGljdGlvbmFyeSBbZGljdF0gdG8gW3ZhbHVlXSAoY2VsbCksCjs7OyBhbmQgcmV0dXJucyB0aGUgcmVzdWx0aW5nIGRpY3Rpb25hcnkuCmNlbGwgaWRpY3Rfc2V0' + + 'X3JlZihjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVNFVFJFRiI7' + + 'CihjZWxsLCAoKSkgfmlkaWN0X3NldF9yZWYoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBr' + + 'ZXlfbGVuKSAiRElDVElTRVRSRUYiOwoKOzs7IFNldHMgdGhlIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBba2V5X2xlbl0tYml0IGtleSB1bnNpZ25lZCBpbmRleCBpbiBk' + + 'aWN0aW9uYXJ5IFtkaWN0XSB0byBbdmFsdWVdIChjZWxsKSwKOzs7IGFuZCByZXR1cm5zIHRoZSByZXN1bHRpbmcgZGljdGlvbmFyeS4KY2VsbCB1ZGljdF9zZXRfcmVm' + + 'KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVU0VUUkVGIjsKKGNl' + + 'bGwsICgpKSB+dWRpY3Rfc2V0X3JlZihjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9s' + + 'ZW4pICJESUNUVVNFVFJFRiI7CgpjZWxsIGlkaWN0X2dldF9yZWYoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlfbGVu' + + 'KSAiRElDVElHRVRPUFRSRUYiOwooY2VsbCwgaW50KSBpZGljdF9nZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShpbmRleCBkaWN0' + + 'IGtleV9sZW4pICJESUNUSUdFVFJFRiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgaW50KSB1ZGljdF9nZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQg' + + 'aW5kZXgpIGFzbShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVUdFVFJFRiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgY2VsbCkgaWRpY3Rfc2V0X2dldF9yZWYoY2Vs' + + 'bCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElTRVRHRVRPUFRSRUYiOwoo' + + 'Y2VsbCwgY2VsbCkgdWRpY3Rfc2V0X2dldF9yZWYoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGlj' + + 'dCBrZXlfbGVuKSAiRElDVFVTRVRHRVRPUFRSRUYiOwooY2VsbCwgaW50KSBpZGljdF9kZWxldGU/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCkgYXNt' + + 'KGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJREVMIjsKKGNlbGwsIGludCkgdWRpY3RfZGVsZXRlPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFz' + + 'bShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVURFTCI7CihzbGljZSwgaW50KSBpZGljdF9nZXQ/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCkgYXNt' + + 'KGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJR0VUIiAiTlVMTFNXQVBJRk5PVCI7CihzbGljZSwgaW50KSB1ZGljdF9nZXQ/KGNlbGwgZGljdCwgaW50IGtleV9sZW4s' + + 'IGludCBpbmRleCkgYXNtKGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVR0VUIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCBzbGljZSwgaW50KSBpZGljdF9kZWxldGVf' + + 'Z2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSURFTEdFVCIgIk5VTExTV0FQSUZOT1QiOwoo' + + 'Y2VsbCwgc2xpY2UsIGludCkgdWRpY3RfZGVsZXRlX2dldD8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlfbGVuKSAi' + + 'RElDVFVERUxHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChzbGljZSwgaW50KSkgfmlkaWN0X2RlbGV0ZV9nZXQ/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGlu' + + 'dCBpbmRleCkgYXNtKGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJREVMR0VUIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCAoc2xpY2UsIGludCkpIH51ZGljdF9kZWxl' + + 'dGVfZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVURFTEdFVCIgIk5VTExTV0FQSUZOT1Qi' + + 'OwooY2VsbCwgY2VsbCwgaW50KSBpZGljdF9kZWxldGVfZ2V0X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4KSBhc20oaW5kZXggZGljdCBrZXlf' + + 'bGVuKSAiRElDVElERUxHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGNlbGwsIGludCkgdWRpY3RfZGVsZXRlX2dldF9yZWY/KGNlbGwgZGljdCwgaW50IGtl' + + 'eV9sZW4sIGludCBpbmRleCkgYXNtKGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVREVMR0VUUkVGIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCAoY2VsbCwgaW50KSkg' + + 'fmlkaWN0X2RlbGV0ZV9nZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgpIGFzbShpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSURFTEdFVFJF' + + 'RiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKGNlbGwsIGludCkpIH51ZGljdF9kZWxldGVfZ2V0X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4' + + 'KSBhc20oaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVERUxHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKY2VsbCB1ZGljdF9zZXQoY2VsbCBkaWN0LCBpbnQga2V5X2xl' + + 'biwgaW50IGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVU0VUIjsKKGNlbGwsICgpKSB+dWRpY3Rfc2V0KGNlbGwg' + + 'ZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVVNFVCI7CmNlbGwgaWRpY3Rf' + + 'c2V0KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVNFVCI7Cihj' + + 'ZWxsLCAoKSkgfmlkaWN0X3NldChjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVu' + + 'KSAiRElDVElTRVQiOwpjZWxsIGRpY3Rfc2V0KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIHNsaWNlIGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRp' + + 'Y3Qga2V5X2xlbikgIkRJQ1RTRVQiOwooY2VsbCwgKCkpIH5kaWN0X3NldChjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGljZSBpbmRleCwgc2xpY2UgdmFsdWUpIGFz' + + 'bSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUU0VUIjsKKGNlbGwsIGludCkgdWRpY3RfYWRkPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgs' + + 'IHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVBREQiOwooY2VsbCwgaW50KSB1ZGljdF9yZXBsYWNlPyhjZWxsIGRpY3QsIGlu' + + 'dCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVSRVBMQUNFIjsKKGNlbGwsIGludCkgdWRp' + + 'Y3RfcmVwbGFjZV9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJ' + + 'Q1RVUkVQTEFDRVJFRiI7CihjZWxsLCBzbGljZSwgaW50KSB1ZGljdF9yZXBsYWNlZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIHNsaWNlIHZh' + + 'bHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVSRVBMQUNFR0VUIiAiTlVMTFNXQVBJRk5PVCI7CihjZWxsLCBjZWxsLCBpbnQpIHVkaWN0X3Jl' + + 'cGxhY2VnZXRfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGNlbGwgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNU' + + 'VVJFUExBQ0VHRVRSRUYiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChzbGljZSwgaW50KSkgfnVkaWN0X3JlcGxhY2VnZXQ/KGNlbGwgZGljdCwgaW50IGtleV9sZW4s' + + 'IGludCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUVVJFUExBQ0VHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNlbGws' + + 'IChjZWxsLCBpbnQpKSB+dWRpY3RfcmVwbGFjZWdldF9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGlu' + + 'ZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVUkVQTEFDRUdFVFJFRiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgaW50KSBpZGljdF9hZGQ/KGNlbGwgZGljdCwgaW50IGtl' + + 'eV9sZW4sIGludCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSUFERCI7CihjZWxsLCBpbnQpIGlkaWN0X3JlcGxh' + + 'Y2U/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVJFUExBQ0Ui' + + 'OwooY2VsbCwgaW50KSBpZGljdF9yZXBsYWNlX3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZhbHVlKSBhc20odmFsdWUgaW5kZXgg' + + 'ZGljdCBrZXlfbGVuKSAiRElDVElSRVBMQUNFUkVGIjsKKGNlbGwsIHNsaWNlLCBpbnQpIGlkaWN0X3JlcGxhY2VnZXQ/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGlu' + + 'dCBpbmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVJFUExBQ0VHRVQiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGNl' + + 'bGwsIGludCkgaWRpY3RfcmVwbGFjZWdldF9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgY2VsbCB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRp' + + 'Y3Qga2V5X2xlbikgIkRJQ1RJUkVQTEFDRUdFVFJFRiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKHNsaWNlLCBpbnQpKSB+aWRpY3RfcmVwbGFjZWdldD8oY2VsbCBk' + + 'aWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBzbGljZSB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJUkVQTEFDRUdFVCIgIk5VTExT' + + 'V0FQSUZOT1QiOwooY2VsbCwgKGNlbGwsIGludCkpIH5pZGljdF9yZXBsYWNlZ2V0X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBjZWxsIHZh' + + 'bHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElSRVBMQUNFR0VUUkVGIiAiTlVMTFNXQVBJRk5PVCI7CmNlbGwgdWRpY3Rfc2V0X2J1aWxkZXIo' + + 'Y2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVTRVRCIjsKKGNl' + + 'bGwsICgpKSB+dWRpY3Rfc2V0X2J1aWxkZXIoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGlj' + + 'dCBrZXlfbGVuKSAiRElDVFVTRVRCIjsKY2VsbCBpZGljdF9zZXRfYnVpbGRlcihjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgaW5kZXgsIGJ1aWxkZXIgdmFsdWUp' + + 'IGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVNFVEIiOwooY2VsbCwgKCkpIH5pZGljdF9zZXRfYnVpbGRlcihjZWxsIGRpY3QsIGludCBrZXlfbGVu' + + 'LCBpbnQgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUSVNFVEIiOwpjZWxsIGRpY3Rfc2V0X2J1aWxkZXIoY2Vs' + + 'bCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUU0VUQiI7CihjZWxs' + + 'LCAoKSkgfmRpY3Rfc2V0X2J1aWxkZXIoY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0' + + 'IGtleV9sZW4pICJESUNUU0VUQiI7CihjZWxsLCBpbnQpIGRpY3RfcmVwbGFjZV9idWlsZGVyPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGljZSBpbmRleCwgYnVp' + + 'bGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RSRVBMQUNFQiI7CihjZWxsLCBidWlsZGVyLCBpbnQpIGRpY3RfcmVwbGFjZWdldF9i' + + 'dWlsZGVyPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGljZSBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RS' + + 'RVBMQUNFR0VUQiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgc2xpY2UsIGludCkgZGljdF9yZXBsYWNlZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGljZSBp' + + 'bmRleCwgc2xpY2UgdmFsdWUpIGFzbSh2YWx1ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUUkVQTEFDRUdFVCIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKGJ1aWxk' + + 'ZXIsIGludCkpIH5kaWN0X3JlcGxhY2VnZXRfYnVpbGRlcj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIGJ1aWxkZXIgdmFsdWUpIGFzbSh2YWx1' + + 'ZSBpbmRleCBkaWN0IGtleV9sZW4pICJESUNUUkVQTEFDRUdFVEIiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIChzbGljZSwgaW50KSkgfmRpY3RfcmVwbGFjZWdldD8o' + + 'Y2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgc2xpY2UgaW5kZXgsIHNsaWNlIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFJFUExBQ0VHRVQi' + + 'ICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGludCkgdWRpY3RfYWRkX2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1' + + 'ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVQUREQiI7CihjZWxsLCBpbnQpIHVkaWN0X3JlcGxhY2VfYnVpbGRlcj8oY2VsbCBkaWN0LCBpbnQg' + + 'a2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVFVSRVBMQUNFQiI7CihjZWxsLCBidWlsZGVy' + + 'LCBpbnQpIHVkaWN0X3JlcGxhY2VnZXRfYnVpbGRlcj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5k' + + 'ZXggZGljdCBrZXlfbGVuKSAiRElDVFVSRVBMQUNFR0VUQiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKGJ1aWxkZXIsIGludCkpIH51ZGljdF9yZXBsYWNlZ2V0X2J1' + + 'aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RVUkVQ' + + 'TEFDRUdFVEIiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGludCkgaWRpY3RfYWRkX2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVp' + + 'bGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikgIkRJQ1RJQUREQiI7CihjZWxsLCBpbnQpIGlkaWN0X3JlcGxhY2VfYnVpbGRlcj8oY2VsbCBk' + + 'aWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20odmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElSRVBMQUNFQiI7CihjZWxs' + + 'LCBidWlsZGVyLCBpbnQpIGlkaWN0X3JlcGxhY2VnZXRfYnVpbGRlcj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IGluZGV4LCBidWlsZGVyIHZhbHVlKSBhc20o' + + 'dmFsdWUgaW5kZXggZGljdCBrZXlfbGVuKSAiRElDVElSRVBMQUNFR0VUQiIgIk5VTExTV0FQSUZOT1QiOwooY2VsbCwgKGJ1aWxkZXIsIGludCkpIH5pZGljdF9yZXBs' + + 'YWNlZ2V0X2J1aWxkZXI/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBpbmRleCwgYnVpbGRlciB2YWx1ZSkgYXNtKHZhbHVlIGluZGV4IGRpY3Qga2V5X2xlbikg' + + 'IkRJQ1RJUkVQTEFDRUdFVEIiICJOVUxMU1dBUElGTk9UIjsKKGNlbGwsIGludCwgc2xpY2UsIGludCkgdWRpY3RfZGVsZXRlX2dldF9taW4oY2VsbCBkaWN0LCBpbnQg' + + 'a2V5X2xlbikgYXNtKC0+IDAgMiAxIDMpICJESUNUVVJFTU1JTiIgIk5VTExTV0FQSUZOT1QyIjsKKGNlbGwsIChpbnQsIHNsaWNlLCBpbnQpKSB+dWRpY3Q6OmRlbGV0' + + 'ZV9nZXRfbWluKGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElDVFVSRU1NSU4iICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCBpbnQsIHNs' + + 'aWNlLCBpbnQpIGlkaWN0X2RlbGV0ZV9nZXRfbWluKGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElDVElSRU1NSU4iICJOVUxMU1dBUElG' + + 'Tk9UMiI7CihjZWxsLCAoaW50LCBzbGljZSwgaW50KSkgfmlkaWN0OjpkZWxldGVfZ2V0X21pbihjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykg' + + 'IkRJQ1RJUkVNTUlOIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwgc2xpY2UsIHNsaWNlLCBpbnQpIGRpY3RfZGVsZXRlX2dldF9taW4oY2VsbCBkaWN0LCBpbnQga2V5' + + 'X2xlbikgYXNtKC0+IDAgMiAxIDMpICJESUNUUkVNTUlOIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwgKHNsaWNlLCBzbGljZSwgaW50KSkgfmRpY3Q6OmRlbGV0ZV9n' + + 'ZXRfbWluKGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElDVFJFTU1JTiIgIk5VTExTV0FQSUZOT1QyIjsKKGNlbGwsIGludCwgc2xpY2Us' + + 'IGludCkgdWRpY3RfZGVsZXRlX2dldF9tYXgoY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtKC0+IDAgMiAxIDMpICJESUNUVVJFTU1BWCIgIk5VTExTV0FQSUZOT1Qy' + + 'IjsKKGNlbGwsIChpbnQsIHNsaWNlLCBpbnQpKSB+dWRpY3Q6OmRlbGV0ZV9nZXRfbWF4KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElD' + + 'VFVSRU1NQVgiICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCBpbnQsIHNsaWNlLCBpbnQpIGlkaWN0X2RlbGV0ZV9nZXRfbWF4KGNlbGwgZGljdCwgaW50IGtleV9sZW4p' + + 'IGFzbSgtPiAwIDIgMSAzKSAiRElDVElSRU1NQVgiICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCAoaW50LCBzbGljZSwgaW50KSkgfmlkaWN0OjpkZWxldGVfZ2V0X21h' + + 'eChjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20oLT4gMCAyIDEgMykgIkRJQ1RJUkVNTUFYIiAiTlVMTFNXQVBJRk5PVDIiOwooY2VsbCwgc2xpY2UsIHNsaWNlLCBp' + + 'bnQpIGRpY3RfZGVsZXRlX2dldF9tYXgoY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtKC0+IDAgMiAxIDMpICJESUNUUkVNTUFYIiAiTlVMTFNXQVBJRk5PVDIiOwoo' + + 'Y2VsbCwgKHNsaWNlLCBzbGljZSwgaW50KSkgfmRpY3Q6OmRlbGV0ZV9nZXRfbWF4KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSgtPiAwIDIgMSAzKSAiRElDVFJF' + + 'TU1BWCIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgc2xpY2UsIGludCkgdWRpY3RfZ2V0X21pbj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtICgtPiAxIDAgMikg' + + 'IkRJQ1RVTUlOIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSB1ZGljdF9nZXRfbWF4PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20gKC0+IDEg' + + 'MCAyKSAiRElDVFVNQVgiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIGNlbGwsIGludCkgdWRpY3RfZ2V0X21pbl9yZWY/KGNlbGwgZGljdCwgaW50IGtleV9sZW4pIGFz' + + 'bSAoLT4gMSAwIDIpICJESUNUVU1JTlJFRiIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgY2VsbCwgaW50KSB1ZGljdF9nZXRfbWF4X3JlZj8oY2VsbCBkaWN0LCBpbnQg' + + 'a2V5X2xlbikgYXNtICgtPiAxIDAgMikgIkRJQ1RVTUFYUkVGIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSBpZGljdF9nZXRfbWluPyhjZWxsIGRp' + + 'Y3QsIGludCBrZXlfbGVuKSBhc20gKC0+IDEgMCAyKSAiRElDVElNSU4iICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNsaWNlLCBpbnQpIGlkaWN0X2dldF9tYXg/KGNl' + + 'bGwgZGljdCwgaW50IGtleV9sZW4pIGFzbSAoLT4gMSAwIDIpICJESUNUSU1BWCIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgY2VsbCwgaW50KSBpZGljdF9nZXRfbWlu' + + 'X3JlZj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbikgYXNtICgtPiAxIDAgMikgIkRJQ1RJTUlOUkVGIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBjZWxsLCBpbnQpIGlk' + + 'aWN0X2dldF9tYXhfcmVmPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuKSBhc20gKC0+IDEgMCAyKSAiRElDVElNQVhSRUYiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNs' + + 'aWNlLCBpbnQpIHVkaWN0X2dldF9uZXh0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgcGl2b3QpIGFzbShwaXZvdCBkaWN0IGtleV9sZW4gLT4gMSAwIDIpICJE' + + 'SUNUVUdFVE5FWFQiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNsaWNlLCBpbnQpIHVkaWN0X2dldF9uZXh0ZXE/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBw' + + 'aXZvdCkgYXNtKHBpdm90IGRpY3Qga2V5X2xlbiAtPiAxIDAgMikgIkRJQ1RVR0VUTkVYVEVRIiAiTlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSB1ZGlj' + + 'dF9nZXRfcHJldj8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IHBpdm90KSBhc20ocGl2b3QgZGljdCBrZXlfbGVuIC0+IDEgMCAyKSAiRElDVFVHRVRQUkVWIiAi' + + 'TlVMTFNXQVBJRk5PVDIiOwooaW50LCBzbGljZSwgaW50KSB1ZGljdF9nZXRfcHJldmVxPyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBpbnQgcGl2b3QpIGFzbShwaXZv' + + 'dCBkaWN0IGtleV9sZW4gLT4gMSAwIDIpICJESUNUVUdFVFBSRVZFUSIgIk5VTExTV0FQSUZOT1QyIjsKKGludCwgc2xpY2UsIGludCkgaWRpY3RfZ2V0X25leHQ/KGNl' + + 'bGwgZGljdCwgaW50IGtleV9sZW4sIGludCBwaXZvdCkgYXNtKHBpdm90IGRpY3Qga2V5X2xlbiAtPiAxIDAgMikgIkRJQ1RJR0VUTkVYVCIgIk5VTExTV0FQSUZOT1Qy' + + 'IjsKKGludCwgc2xpY2UsIGludCkgaWRpY3RfZ2V0X25leHRlcT8oY2VsbCBkaWN0LCBpbnQga2V5X2xlbiwgaW50IHBpdm90KSBhc20ocGl2b3QgZGljdCBrZXlfbGVu' + + 'IC0+IDEgMCAyKSAiRElDVElHRVRORVhURVEiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNsaWNlLCBpbnQpIGlkaWN0X2dldF9wcmV2PyhjZWxsIGRpY3QsIGludCBr' + + 'ZXlfbGVuLCBpbnQgcGl2b3QpIGFzbShwaXZvdCBkaWN0IGtleV9sZW4gLT4gMSAwIDIpICJESUNUSUdFVFBSRVYiICJOVUxMU1dBUElGTk9UMiI7CihpbnQsIHNsaWNl' + + 'LCBpbnQpIGlkaWN0X2dldF9wcmV2ZXE/KGNlbGwgZGljdCwgaW50IGtleV9sZW4sIGludCBwaXZvdCkgYXNtKHBpdm90IGRpY3Qga2V5X2xlbiAtPiAxIDAgMikgIkRJ' + + 'Q1RJR0VUUFJFVkVRIiAiTlVMTFNXQVBJRk5PVDIiOwoKOzs7IENyZWF0ZXMgYW4gZW1wdHkgZGljdGlvbmFyeSwgd2hpY2ggaXMgYWN0dWFsbHkgYSBudWxsIHZhbHVl' + + 'LiBFcXVpdmFsZW50IHRvIFBVU0hOVUxMCmNlbGwgbmV3X2RpY3QoKSBhc20gIk5FV0RJQ1QiOwo7OzsgQ2hlY2tzIHdoZXRoZXIgYSBkaWN0aW9uYXJ5IGlzIGVtcHR5' + + 'LiBFcXVpdmFsZW50IHRvIGNlbGxfbnVsbD8uCmludCBkaWN0X2VtcHR5PyhjZWxsIGMpIGFzbSAiRElDVEVNUFRZIjsKCgp7LSBQcmVmaXggZGljdGlvbmFyeSBwcmlt' + + 'aXRpdmVzIC19CihzbGljZSwgc2xpY2UsIHNsaWNlLCBpbnQpIHBmeGRpY3RfZ2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGljZSBrZXkpIGFzbShrZXkgZGlj' + + 'dCBrZXlfbGVuKSAiUEZYRElDVEdFVFEiICJOVUxMU1dBUElGTk9UMiI7CihjZWxsLCBpbnQpIHBmeGRpY3Rfc2V0PyhjZWxsIGRpY3QsIGludCBrZXlfbGVuLCBzbGlj' + + 'ZSBrZXksIHNsaWNlIHZhbHVlKSBhc20odmFsdWUga2V5IGRpY3Qga2V5X2xlbikgIlBGWERJQ1RTRVQiOwooY2VsbCwgaW50KSBwZnhkaWN0X2RlbGV0ZT8oY2VsbCBk' + + 'aWN0LCBpbnQga2V5X2xlbiwgc2xpY2Uga2V5KSBhc20oa2V5IGRpY3Qga2V5X2xlbikgIlBGWERJQ1RERUwiOwoKOzs7IFJldHVybnMgdGhlIHZhbHVlIG9mIHRoZSBn' + + 'bG9iYWwgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXIgd2l0aCBpbnRlZ2VyIGluZGV4IGBpYCBhcyBhIGBjZWxsYCBvciBgbnVsbGAgdmFsdWUuCmNlbGwgY29uZmlnX3Bh' + + 'cmFtKGludCB4KSBhc20gIkNPTkZJR09QVFBBUkFNIjsKOzs7IENoZWNrcyB3aGV0aGVyIGMgaXMgYSBudWxsLiBOb3RlLCB0aGF0IEZ1bkMgYWxzbyBoYXMgcG9seW1v' + + 'cnBoaWMgbnVsbD8gYnVpbHQtaW4uCmludCBjZWxsX251bGw/KGNlbGwgYykgYXNtICJJU05VTEwiOwoKOzs7IENyZWF0ZXMgYW4gb3V0cHV0IGFjdGlvbiB3aGljaCB3' + + 'b3VsZCByZXNlcnZlIGV4YWN0bHkgYW1vdW50IG5hbm90b25jb2lucyAoaWYgbW9kZSA9IDApLCBhdCBtb3N0IGFtb3VudCBuYW5vdG9uY29pbnMgKGlmIG1vZGUgPSAy' + + 'KSwgb3IgYWxsIGJ1dCBhbW91bnQgbmFub3RvbmNvaW5zIChpZiBtb2RlID0gMSBvciBtb2RlID0gMyksIGZyb20gdGhlIHJlbWFpbmluZyBiYWxhbmNlIG9mIHRoZSBh' + + 'Y2NvdW50LiBJdCBpcyByb3VnaGx5IGVxdWl2YWxlbnQgdG8gY3JlYXRpbmcgYW4gb3V0Ym91bmQgbWVzc2FnZSBjYXJyeWluZyBhbW91bnQgbmFub3RvbmNvaW5zIChv' + + 'ciBiIOKIkiBhbW91bnQgbmFub3RvbmNvaW5zLCB3aGVyZSBiIGlzIHRoZSByZW1haW5pbmcgYmFsYW5jZSkgdG8gb25lc2VsZiwgc28gdGhhdCB0aGUgc3Vic2VxdWVu' + + 'dCBvdXRwdXQgYWN0aW9ucyB3b3VsZCBub3QgYmUgYWJsZSB0byBzcGVuZCBtb3JlIG1vbmV5IHRoYW4gdGhlIHJlbWFpbmRlci4gQml0ICsyIGluIG1vZGUgbWVhbnMg' + + 'dGhhdCB0aGUgZXh0ZXJuYWwgYWN0aW9uIGRvZXMgbm90IGZhaWwgaWYgdGhlIHNwZWNpZmllZCBhbW91bnQgY2Fubm90IGJlIHJlc2VydmVkOyBpbnN0ZWFkLCBhbGwg' + + 'cmVtYWluaW5nIGJhbGFuY2UgaXMgcmVzZXJ2ZWQuIEJpdCArOCBpbiBtb2RlIG1lYW5zIGBhbW91bnQgPC0gLWFtb3VudGAgYmVmb3JlIHBlcmZvcm1pbmcgYW55IGZ1' + + 'cnRoZXIgYWN0aW9ucy4gQml0ICs0IGluIG1vZGUgbWVhbnMgdGhhdCBhbW91bnQgaXMgaW5jcmVhc2VkIGJ5IHRoZSBvcmlnaW5hbCBiYWxhbmNlIG9mIHRoZSBjdXJy' + + 'ZW50IGFjY291bnQgKGJlZm9yZSB0aGUgY29tcHV0ZSBwaGFzZSksIGluY2x1ZGluZyBhbGwgZXh0cmEgY3VycmVuY2llcywgYmVmb3JlIHBlcmZvcm1pbmcgYW55IG90' + + 'aGVyIGNoZWNrcyBhbmQgYWN0aW9ucy4gQ3VycmVudGx5LCBhbW91bnQgbXVzdCBiZSBhIG5vbi1uZWdhdGl2ZSBpbnRlZ2VyLCBhbmQgbW9kZSBtdXN0IGJlIGluIHRo' + + 'ZSByYW5nZSAwLi4xNS4KKCkgcmF3X3Jlc2VydmUoaW50IGFtb3VudCwgaW50IG1vZGUpIGltcHVyZSBhc20gIlJBV1JFU0VSVkUiOwo7OzsgU2ltaWxhciB0byByYXdf' + + 'cmVzZXJ2ZSwgYnV0IGFsc28gYWNjZXB0cyBhIGRpY3Rpb25hcnkgZXh0cmFfYW1vdW50IChyZXByZXNlbnRlZCBieSBhIGNlbGwgb3IgbnVsbCkgd2l0aCBleHRyYSBj' + + 'dXJyZW5jaWVzLiBJbiB0aGlzIHdheSBjdXJyZW5jaWVzIG90aGVyIHRoYW4gVG9uQ29pbiBjYW4gYmUgcmVzZXJ2ZWQuCigpIHJhd19yZXNlcnZlX2V4dHJhKGludCBh' + + 'bW91bnQsIGNlbGwgZXh0cmFfYW1vdW50LCBpbnQgbW9kZSkgaW1wdXJlIGFzbSAiUkFXUkVTRVJWRVgiOwo7OzsgU2VuZHMgYSByYXcgbWVzc2FnZSBjb250YWluZWQg' + + 'aW4gbXNnLCB3aGljaCBzaG91bGQgY29udGFpbiBhIGNvcnJlY3RseSBzZXJpYWxpemVkIG9iamVjdCBNZXNzYWdlIFgsIHdpdGggdGhlIG9ubHkgZXhjZXB0aW9uIHRo' + + 'YXQgdGhlIHNvdXJjZSBhZGRyZXNzIGlzIGFsbG93ZWQgdG8gaGF2ZSBkdW1teSB2YWx1ZSBhZGRyX25vbmUgKHRvIGJlIGF1dG9tYXRpY2FsbHkgcmVwbGFjZWQgd2l0' + + 'aCB0aGUgY3VycmVudCBzbWFydCBjb250cmFjdCBhZGRyZXNzKSwgYW5kIGlocl9mZWUsIGZ3ZF9mZWUsIGNyZWF0ZWRfbHQgYW5kIGNyZWF0ZWRfYXQgZmllbGRzIGNh' + + 'biBoYXZlIGFyYml0cmFyeSB2YWx1ZXMgKHRvIGJlIHJld3JpdHRlbiB3aXRoIGNvcnJlY3QgdmFsdWVzIGR1cmluZyB0aGUgYWN0aW9uIHBoYXNlIG9mIHRoZSBjdXJy' + + 'ZW50IHRyYW5zYWN0aW9uKS4gSW50ZWdlciBwYXJhbWV0ZXIgbW9kZSBjb250YWlucyB0aGUgZmxhZ3MuIEN1cnJlbnRseSBtb2RlID0gMCBpcyB1c2VkIGZvciBvcmRp' + + 'bmFyeSBtZXNzYWdlczsgbW9kZSA9IDEyOCBpcyB1c2VkIGZvciBtZXNzYWdlcyB0aGF0IGFyZSB0byBjYXJyeSBhbGwgdGhlIHJlbWFpbmluZyBiYWxhbmNlIG9mIHRo' + + 'ZSBjdXJyZW50IHNtYXJ0IGNvbnRyYWN0IChpbnN0ZWFkIG9mIHRoZSB2YWx1ZSBvcmlnaW5hbGx5IGluZGljYXRlZCBpbiB0aGUgbWVzc2FnZSk7IG1vZGUgPSA2NCBp' + + 'cyB1c2VkIGZvciBtZXNzYWdlcyB0aGF0IGNhcnJ5IGFsbCB0aGUgcmVtYWluaW5nIHZhbHVlIG9mIHRoZSBpbmJvdW5kIG1lc3NhZ2UgaW4gYWRkaXRpb24gdG8gdGhl' + + 'IHZhbHVlIGluaXRpYWxseSBpbmRpY2F0ZWQgaW4gdGhlIG5ldyBtZXNzYWdlIChpZiBiaXQgMCBpcyBub3Qgc2V0LCB0aGUgZ2FzIGZlZXMgYXJlIGRlZHVjdGVkIGZy' + + 'b20gdGhpcyBhbW91bnQpOyBtb2RlJyA9IG1vZGUgKyAxIG1lYW5zIHRoYXQgdGhlIHNlbmRlciB3YW50cyB0byBwYXkgdHJhbnNmZXIgZmVlcyBzZXBhcmF0ZWx5OyBt' + + 'b2RlJyA9IG1vZGUgKyAyIG1lYW5zIHRoYXQgYW55IGVycm9ycyBhcmlzaW5nIHdoaWxlIHByb2Nlc3NpbmcgdGhpcyBtZXNzYWdlIGR1cmluZyB0aGUgYWN0aW9uIHBo' + + 'YXNlIHNob3VsZCBiZSBpZ25vcmVkLiBGaW5hbGx5LCBtb2RlJyA9IG1vZGUgKyAzMiBtZWFucyB0aGF0IHRoZSBjdXJyZW50IGFjY291bnQgbXVzdCBiZSBkZXN0cm95' + + 'ZWQgaWYgaXRzIHJlc3VsdGluZyBiYWxhbmNlIGlzIHplcm8uIFRoaXMgZmxhZyBpcyB1c3VhbGx5IGVtcGxveWVkIHRvZ2V0aGVyIHdpdGggKzEyOC4KKCkgc2VuZF9y' + + 'YXdfbWVzc2FnZShjZWxsIG1zZywgaW50IG1vZGUpIGltcHVyZSBhc20gIlNFTkRSQVdNU0ciOwo7OzsgQ3JlYXRlcyBhbiBvdXRwdXQgYWN0aW9uIHRoYXQgd291bGQg' + + 'Y2hhbmdlIHRoaXMgc21hcnQgY29udHJhY3QgY29kZSB0byB0aGF0IGdpdmVuIGJ5IGNlbGwgbmV3X2NvZGUuIE5vdGljZSB0aGF0IHRoaXMgY2hhbmdlIHdpbGwgdGFr' + + 'ZSBlZmZlY3Qgb25seSBhZnRlciB0aGUgc3VjY2Vzc2Z1bCB0ZXJtaW5hdGlvbiBvZiB0aGUgY3VycmVudCBydW4gb2YgdGhlIHNtYXJ0IGNvbnRyYWN0CigpIHNldF9j' + + 'b2RlKGNlbGwgbmV3X2NvZGUpIGltcHVyZSBhc20gIlNFVENPREUiOwoKOzs7IEdlbmVyYXRlcyBhIG5ldyBwc2V1ZG8tcmFuZG9tIHVuc2lnbmVkIDI1Ni1iaXQgaW50' + + 'ZWdlciB4LiBUaGUgYWxnb3JpdGhtIGlzIGFzIGZvbGxvd3M6IGlmIHIgaXMgdGhlIG9sZCB2YWx1ZSBvZiB0aGUgcmFuZG9tIHNlZWQsIGNvbnNpZGVyZWQgYXMgYSAz' + + 'Mi1ieXRlIGFycmF5IChieSBjb25zdHJ1Y3RpbmcgdGhlIGJpZy1lbmRpYW4gcmVwcmVzZW50YXRpb24gb2YgYW4gdW5zaWduZWQgMjU2LWJpdCBpbnRlZ2VyKSwgdGhl' + + 'biBpdHMgc2hhNTEyKHIpIGlzIGNvbXB1dGVkOyB0aGUgZmlyc3QgMzIgYnl0ZXMgb2YgdGhpcyBoYXNoIGFyZSBzdG9yZWQgYXMgdGhlIG5ldyB2YWx1ZSByJyBvZiB0' + + 'aGUgcmFuZG9tIHNlZWQsIGFuZCB0aGUgcmVtYWluaW5nIDMyIGJ5dGVzIGFyZSByZXR1cm5lZCBhcyB0aGUgbmV4dCByYW5kb20gdmFsdWUgeC4KaW50IHJhbmRvbSgp' + + 'IGltcHVyZSBhc20gIlJBTkRVMjU2IjsKOzs7IEdlbmVyYXRlcyBhIG5ldyBwc2V1ZG8tcmFuZG9tIGludGVnZXIgeiBpbiB0aGUgcmFuZ2UgMC4ucmFuZ2XiiJIxIChv' + + 'ciByYW5nZS4u4oiSMSwgaWYgcmFuZ2UgPCAwKS4gTW9yZSBwcmVjaXNlbHksIGFuIHVuc2lnbmVkIHJhbmRvbSB2YWx1ZSB4IGlzIGdlbmVyYXRlZCBhcyBpbiByYW5k' + + 'b207IHRoZW4geiA6PSB4ICogcmFuZ2UgLyAyXjI1NiBpcyBjb21wdXRlZC4KaW50IHJhbmQoaW50IHJhbmdlKSBpbXB1cmUgYXNtICJSQU5EIjsKOzs7IFJldHVybnMg' + + 'dGhlIGN1cnJlbnQgcmFuZG9tIHNlZWQgYXMgYW4gdW5zaWduZWQgMjU2LWJpdCBJbnRlZ2VyLgppbnQgZ2V0X3NlZWQoKSBpbXB1cmUgYXNtICJSQU5EU0VFRCI7Cjs7' + + 'OyBTZXRzIHRoZSByYW5kb20gc2VlZCB0byB1bnNpZ25lZCAyNTYtYml0IHNlZWQuCigpIHNldF9zZWVkKGludCB4KSBpbXB1cmUgYXNtICJTRVRSQU5EIjsKOzs7IE1p' + + 'eGVzIHVuc2lnbmVkIDI1Ni1iaXQgaW50ZWdlciB4IGludG8gdGhlIHJhbmRvbSBzZWVkIHIgYnkgc2V0dGluZyB0aGUgcmFuZG9tIHNlZWQgdG8gc2hhMjU2IG9mIHRo' + + 'ZSBjb25jYXRlbmF0aW9uIG9mIHR3byAzMi1ieXRlIHN0cmluZ3M6IHRoZSBmaXJzdCB3aXRoIHRoZSBiaWctZW5kaWFuIHJlcHJlc2VudGF0aW9uIG9mIHRoZSBvbGQg' + + 'c2VlZCByLCBhbmQgdGhlIHNlY29uZCB3aXRoIHRoZSBiaWctZW5kaWFuIHJlcHJlc2VudGF0aW9uIG9mIHguCigpIHJhbmRvbWl6ZShpbnQgeCkgaW1wdXJlIGFzbSAi' + + 'QUREUkFORCI7Cjs7OyBFcXVpdmFsZW50IHRvIHJhbmRvbWl6ZShjdXJfbHQoKSk7LgooKSByYW5kb21pemVfbHQoKSBpbXB1cmUgYXNtICJMVElNRSIgIkFERFJBTkQi' + + 'OwoKOzs7IENoZWNrcyB3aGV0aGVyIHRoZSBkYXRhIHBhcnRzIG9mIHR3byBzbGljZXMgY29pbnNpZGUKaW50IGVxdWFsX3NsaWNlc19iaXRzKHNsaWNlIGEsIHNsaWNl' + + 'IGIpIGFzbSAiU0RFUSI7Cjs7OyBDaGVja3Mgd2hldGhlciBiIGlzIGEgbnVsbC4gTm90ZSwgdGhhdCBGdW5DIGFsc28gaGFzIHBvbHltb3JwaGljIG51bGw/IGJ1aWx0' + + 'LWluLgppbnQgYnVpbGRlcl9udWxsPyhidWlsZGVyIGIpIGFzbSAiSVNOVUxMIjsKOzs7IENvbmNhdGVuYXRlcyB0d28gYnVpbGRlcnMKYnVpbGRlciBzdG9yZV9idWls' + + 'ZGVyKGJ1aWxkZXIgdG8sIGJ1aWxkZXIgZnJvbSkgYXNtICJTVEJSIjsKCjs7IENVU1RPTToKCjs7IFRWTSBVUEdSQURFIDIwMjMtMDcgaHR0cHM6Ly9kb2NzLnRvbi5v' + + 'cmcvbGVhcm4vdHZtLWluc3RydWN0aW9ucy90dm0tdXBncmFkZS0yMDIzLTA3Cjs7IEluIG1haW5uZXQgc2luY2UgMjAgRGVjIDIwMjMgaHR0cHM6Ly90Lm1lL3RvbmJs' + + 'b2NrY2hhaW4vMjI2Cgo7OzsgUmV0cmlldmVzIGNvZGUgb2Ygc21hcnQtY29udHJhY3QgZnJvbSBjNwpjZWxsIG15X2NvZGUoKSBhc20gIk1ZQ09ERSI7Cg=='; files['stdlib.tact'] = 'aW1wb3J0ICIuL3N0ZC9wcmltaXRpdmVzIjsKaW1wb3J0ICIuL3N0ZC9jZWxscyI7CmltcG9ydCAiLi9zdGQvY3J5cHRvIjsKaW1wb3J0ICIuL3N0ZC90ZXh0IjsKaW1w' + 'b3J0ICIuL3N0ZC9tYXRoIjsKaW1wb3J0ICIuL3N0ZC9jb250cmFjdCI7CmltcG9ydCAiLi9zdGQvZGVidWciOwppbXBvcnQgIi4vc3RkL2NvbnRleHQiOwppbXBvcnQg' + diff --git a/src/storage/allocator.ts b/src/storage/allocator.ts index 27ab63d54..d12374389 100644 --- a/src/storage/allocator.ts +++ b/src/storage/allocator.ts @@ -18,9 +18,14 @@ function getOperationSize(src: AllocationOperationType): { case "uint": { return { bits: src.bits + (src.optional ? 1 : 0), refs: 0 }; } - case "coins": { + case "varint16": + case "varuint16": { return { bits: 124 + (src.optional ? 1 : 0), refs: 0 }; } + case "varint32": + case "varuint32": { + return { bits: 253 + (src.optional ? 1 : 0), refs: 0 }; + } case "boolean": { return { bits: 1 + (src.optional ? 1 : 0), refs: 0 }; } @@ -86,6 +91,12 @@ export function getAllocationOperationFromField( optional: src.optional ? src.optional : false, }; } + if (src.format === "varint16" || src.format === "varint32") { + return { + kind: src.format, + optional: src.optional ? src.optional : false, + }; + } if (src.format !== null && src.format !== undefined) { throwInternalCompilerError( `Unsupported int format: ${src.format}`, @@ -112,7 +123,13 @@ export function getAllocationOperationFromField( } if (src.format === "coins") { return { - kind: "coins", + kind: "varuint16", + optional: src.optional ? src.optional : false, + }; + } + if (src.format === "varuint16" || src.format === "varuint32") { + return { + kind: src.format, optional: src.optional ? src.optional : false, }; } diff --git a/src/storage/operation.ts b/src/storage/operation.ts index 7b18fb466..95849dfdc 100644 --- a/src/storage/operation.ts +++ b/src/storage/operation.ts @@ -23,7 +23,7 @@ export type AllocationOperationType = optional: boolean; } | { - kind: "coins"; + kind: "varint16" | "varint32" | "varuint16" | "varuint32"; optional: boolean; } | { diff --git a/src/test/e2e-emulated/contracts/map-traverse.tact b/src/test/e2e-emulated/contracts/map-traverse.tact index d0ddefd86..270a25e25 100644 --- a/src/test/e2e-emulated/contracts/map-traverse.tact +++ b/src/test/e2e-emulated/contracts/map-traverse.tact @@ -41,6 +41,40 @@ contract MapTraverseTestContract { return sum1 + sum2; } + get fun test_int_coins(): Int { + let m: map = emptyMap(); + m.set(1, 100); + m.set(2, 200); + m.set(3, 300); + m.set(4, 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + sum1 += k; + sum2 += v; + } + + return sum1 + sum2; + } + + get fun test_int_varint16(): Int { + let m: map = emptyMap(); + m.set(1, 100); + m.set(2, 200); + m.set(3, 300); + m.set(4, 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + sum1 += k; + sum2 += v; + } + + return sum1 + sum2; + } + get fun test_int_bool(): Int { let m: map = emptyMap(); m.set(1, true); @@ -143,6 +177,44 @@ contract MapTraverseTestContract { return sum1 + sum2; } + get fun test_address_coins(): Int { + let m: map = emptyMap(); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873), 100); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76874), 200); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76875), 300); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76876), 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + let s: Slice = beginCell().storeAddress(k).endCell().beginParse(); + s.skipBits(264); + sum1 += s.loadUint(3); + sum2 += v; + } + + return sum1 + sum2; + } + + get fun test_address_varint16(): Int { + let m: map = emptyMap(); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873), 100); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76874), 200); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76875), 300); + m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76876), 400); + + let sum1: Int = 0; + let sum2: Int = 0; + foreach (k, v in m) { + let s: Slice = beginCell().storeAddress(k).endCell().beginParse(); + s.skipBits(264); + sum1 += s.loadUint(3); + sum2 += v; + } + + return sum1 + sum2; + } + get fun test_address_bool(): Int { let m: map = emptyMap(); m.set(newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873), true); diff --git a/src/test/e2e-emulated/contracts/maps1.tact b/src/test/e2e-emulated/contracts/maps1.tact new file mode 100644 index 000000000..69b2b3aee --- /dev/null +++ b/src/test/e2e-emulated/contracts/maps1.tact @@ -0,0 +1,1516 @@ +// struct with over 1023 bits so that it is serialized as multiple cells +struct SomeStruct { + int: Int; + bool: Bool; + address: Address; + a: Int; + b: Int; +} + +// =============================== +// Structs For Getters +// =============================== + +struct GetAllMapsResult { + // Integer Key Maps + int_varint16: Int?; + int_varint32: Int?; + int_varuint16: Int?; + int_varuint32: Int?; + int_bool: Bool?; + int_cell: Cell?; + int_address: Address?; + int_struct: SomeStruct?; + + int8_varint16: Int?; + int8_varint32: Int?; + int8_varuint16: Int?; + int8_varuint32: Int?; + int8_bool: Bool?; + int8_cell: Cell?; + int8_address: Address?; + int8_struct: SomeStruct?; + + int42_varint16: Int?; + int42_varint32: Int?; + int42_varuint16: Int?; + int42_varuint32: Int?; + int42_bool: Bool?; + int42_cell: Cell?; + int42_address: Address?; + int42_struct: SomeStruct?; + + int256_varint16: Int?; + int256_varint32: Int?; + int256_varuint16: Int?; + int256_varuint32: Int?; + int256_bool: Bool?; + int256_cell: Cell?; + int256_address: Address?; + int256_struct: SomeStruct?; + + uint8_varint16: Int?; + uint8_varint32: Int?; + uint8_varuint16: Int?; + uint8_varuint32: Int?; + uint8_bool: Bool?; + uint8_cell: Cell?; + uint8_address: Address?; + uint8_struct: SomeStruct?; + + uint42_varint16: Int?; + uint42_varint32: Int?; + uint42_varuint16: Int?; + uint42_varuint32: Int?; + uint42_bool: Bool?; + uint42_cell: Cell?; + uint42_address: Address?; + uint42_struct: SomeStruct?; + + uint256_varint16: Int?; + uint256_varint32: Int?; + uint256_varuint16: Int?; + uint256_varuint32: Int?; + uint256_bool: Bool?; + uint256_cell: Cell?; + uint256_address: Address?; + uint256_struct: SomeStruct?; + + // Address Key Maps + address_varint16: Int?; + address_varint32: Int?; + address_varuint16: Int?; + address_varuint32: Int?; + address_bool: Bool?; + address_cell: Cell?; + address_address: Address?; + address_struct: SomeStruct?; +} + +struct ReplaceAllMapsResult { + // Integer Key Maps + int_varint16: Bool; + int_varint32: Bool; + int_varuint16: Bool; + int_varuint32: Bool; + int_bool: Bool; + int_cell: Bool; + int_address: Bool; + int_struct: Bool; + + int8_varint16: Bool; + int8_varint32: Bool; + int8_varuint16: Bool; + int8_varuint32: Bool; + int8_bool: Bool; + int8_cell: Bool; + int8_address: Bool; + int8_struct: Bool; + + int42_varint16: Bool; + int42_varint32: Bool; + int42_varuint16: Bool; + int42_varuint32: Bool; + int42_bool: Bool; + int42_cell: Bool; + int42_address: Bool; + int42_struct: Bool; + + int256_varint16: Bool; + int256_varint32: Bool; + int256_varuint16: Bool; + int256_varuint32: Bool; + int256_bool: Bool; + int256_cell: Bool; + int256_address: Bool; + int256_struct: Bool; + + uint8_varint16: Bool; + uint8_varint32: Bool; + uint8_varuint16: Bool; + uint8_varuint32: Bool; + uint8_bool: Bool; + uint8_cell: Bool; + uint8_address: Bool; + uint8_struct: Bool; + + uint42_varint16: Bool; + uint42_varint32: Bool; + uint42_varuint16: Bool; + uint42_varuint32: Bool; + uint42_bool: Bool; + uint42_cell: Bool; + uint42_address: Bool; + uint42_struct: Bool; + + uint256_varint16: Bool; + uint256_varint32: Bool; + uint256_varuint16: Bool; + uint256_varuint32: Bool; + uint256_bool: Bool; + uint256_cell: Bool; + uint256_address: Bool; + uint256_struct: Bool; + + // Address Key Maps + address_varint16: Bool; + address_varint32: Bool; + address_varuint16: Bool; + address_varuint32: Bool; + address_bool: Bool; + address_cell: Bool; + address_address: Bool; + address_struct: Bool; +} + +struct ReplaceGetAllMapsResult { + // Integer Key Maps + int_varint16: Int?; + int_varint32: Int?; + int_varuint16: Int?; + int_varuint32: Int?; + int_bool: Bool?; + int_cell: Cell?; + int_address: Address?; + int_struct: SomeStruct?; + + int8_varint16: Int?; + int8_varint32: Int?; + int8_varuint16: Int?; + int8_varuint32: Int?; + int8_bool: Bool?; + int8_cell: Cell?; + int8_address: Address?; + int8_struct: SomeStruct?; + + int42_varint16: Int?; + int42_varint32: Int?; + int42_varuint16: Int?; + int42_varuint32: Int?; + int42_bool: Bool?; + int42_cell: Cell?; + int42_address: Address?; + int42_struct: SomeStruct?; + + int256_varint16: Int?; + int256_varint32: Int?; + int256_varuint16: Int?; + int256_varuint32: Int?; + int256_bool: Bool?; + int256_cell: Cell?; + int256_address: Address?; + int256_struct: SomeStruct?; + + uint8_varint16: Int?; + uint8_varint32: Int?; + uint8_varuint16: Int?; + uint8_varuint32: Int?; + uint8_bool: Bool?; + uint8_cell: Cell?; + uint8_address: Address?; + uint8_struct: SomeStruct?; + + uint42_varint16: Int?; + uint42_varint32: Int?; + uint42_varuint16: Int?; + uint42_varuint32: Int?; + uint42_bool: Bool?; + uint42_cell: Cell?; + uint42_address: Address?; + uint42_struct: SomeStruct?; + + uint256_varint16: Int?; + uint256_varint32: Int?; + uint256_varuint16: Int?; + uint256_varuint32: Int?; + uint256_bool: Bool?; + uint256_cell: Cell?; + uint256_address: Address?; + uint256_struct: SomeStruct?; + + // Address Key Maps + address_varint16: Int?; + address_varint32: Int?; + address_varuint16: Int?; + address_varuint32: Int?; + address_bool: Bool?; + address_cell: Cell?; + address_address: Address?; + address_struct: SomeStruct?; +} + +struct ExistsAllMapsResult { + // Integer Key Maps + int_varint16: Bool; + int_varint32: Bool; + int_varuint16: Bool; + int_varuint32: Bool; + int_bool: Bool; + int_cell: Bool; + int_address: Bool; + int_struct: Bool; + + int8_varint16: Bool; + int8_varint32: Bool; + int8_varuint16: Bool; + int8_varuint32: Bool; + int8_bool: Bool; + int8_cell: Bool; + int8_address: Bool; + int8_struct: Bool; + + int42_varint16: Bool; + int42_varint32: Bool; + int42_varuint16: Bool; + int42_varuint32: Bool; + int42_bool: Bool; + int42_cell: Bool; + int42_address: Bool; + int42_struct: Bool; + + int256_varint16: Bool; + int256_varint32: Bool; + int256_varuint16: Bool; + int256_varuint32: Bool; + int256_bool: Bool; + int256_cell: Bool; + int256_address: Bool; + int256_struct: Bool; + + uint8_varint16: Bool; + uint8_varint32: Bool; + uint8_varuint16: Bool; + uint8_varuint32: Bool; + uint8_bool: Bool; + uint8_cell: Bool; + uint8_address: Bool; + uint8_struct: Bool; + + uint42_varint16: Bool; + uint42_varint32: Bool; + uint42_varuint16: Bool; + uint42_varuint32: Bool; + uint42_bool: Bool; + uint42_cell: Bool; + uint42_address: Bool; + uint42_struct: Bool; + + uint256_varint16: Bool; + uint256_varint32: Bool; + uint256_varuint16: Bool; + uint256_varuint32: Bool; + uint256_bool: Bool; + uint256_cell: Bool; + uint256_address: Bool; + uint256_struct: Bool; + + // Address Key Maps + address_varint16: Bool; + address_varint32: Bool; + address_varuint16: Bool; + address_varuint32: Bool; + address_bool: Bool; + address_cell: Bool; + address_address: Bool; + address_struct: Bool; +} + +struct IsEmptyAllMapsResult { + // Integer Key Maps + int_varint16: Bool; + int_varint32: Bool; + int_varuint16: Bool; + int_varuint32: Bool; + int_bool: Bool; + int_cell: Bool; + int_address: Bool; + int_struct: Bool; + + int8_varint16: Bool; + int8_varint32: Bool; + int8_varuint16: Bool; + int8_varuint32: Bool; + int8_bool: Bool; + int8_cell: Bool; + int8_address: Bool; + int8_struct: Bool; + + int42_varint16: Bool; + int42_varint32: Bool; + int42_varuint16: Bool; + int42_varuint32: Bool; + int42_bool: Bool; + int42_cell: Bool; + int42_address: Bool; + int42_struct: Bool; + + int256_varint16: Bool; + int256_varint32: Bool; + int256_varuint16: Bool; + int256_varuint32: Bool; + int256_bool: Bool; + int256_cell: Bool; + int256_address: Bool; + int256_struct: Bool; + + uint8_varint16: Bool; + uint8_varint32: Bool; + uint8_varuint16: Bool; + uint8_varuint32: Bool; + uint8_bool: Bool; + uint8_cell: Bool; + uint8_address: Bool; + uint8_struct: Bool; + + uint42_varint16: Bool; + uint42_varint32: Bool; + uint42_varuint16: Bool; + uint42_varuint32: Bool; + uint42_bool: Bool; + uint42_cell: Bool; + uint42_address: Bool; + uint42_struct: Bool; + + uint256_varint16: Bool; + uint256_varint32: Bool; + uint256_varuint16: Bool; + uint256_varuint32: Bool; + uint256_bool: Bool; + uint256_cell: Bool; + uint256_address: Bool; + uint256_struct: Bool; + + // Address Key Maps + address_varint16: Bool; + address_varint32: Bool; + address_varuint16: Bool; + address_varuint32: Bool; + address_bool: Bool; + address_cell: Bool; + address_address: Bool; + address_struct: Bool; +} + +struct AsCellAllMapsResult { + // Integer Key Maps + int_varint16: Cell?; + int_varint32: Cell?; + int_varuint16: Cell?; + int_varuint32: Cell?; + int_bool: Cell?; + int_cell: Cell?; + int_address: Cell?; + int_struct: Cell?; + + int8_varint16: Cell?; + int8_varint32: Cell?; + int8_varuint16: Cell?; + int8_varuint32: Cell?; + int8_bool: Cell?; + int8_cell: Cell?; + int8_address: Cell?; + int8_struct: Cell?; + + int42_varint16: Cell?; + int42_varint32: Cell?; + int42_varuint16: Cell?; + int42_varuint32: Cell?; + int42_bool: Cell?; + int42_cell: Cell?; + int42_address: Cell?; + int42_struct: Cell?; + + int256_varint16: Cell?; + int256_varint32: Cell?; + int256_varuint16: Cell?; + int256_varuint32: Cell?; + int256_bool: Cell?; + int256_cell: Cell?; + int256_address: Cell?; + int256_struct: Cell?; + + uint8_varint16: Cell?; + uint8_varint32: Cell?; + uint8_varuint16: Cell?; + uint8_varuint32: Cell?; + uint8_bool: Cell?; + uint8_cell: Cell?; + uint8_address: Cell?; + uint8_struct: Cell?; + + uint42_varint16: Cell?; + uint42_varint32: Cell?; + uint42_varuint16: Cell?; + uint42_varuint32: Cell?; + uint42_bool: Cell?; + uint42_cell: Cell?; + uint42_address: Cell?; + uint42_struct: Cell?; + + uint256_varint16: Cell?; + uint256_varint32: Cell?; + uint256_varuint16: Cell?; + uint256_varuint32: Cell?; + uint256_bool: Cell?; + uint256_cell: Cell?; + uint256_address: Cell?; + uint256_struct: Cell?; + + // Address Key Maps + address_varint16: Cell?; + address_varint32: Cell?; + address_varuint16: Cell?; + address_varuint32: Cell?; + address_bool: Cell?; + address_cell: Cell?; + address_address: Cell?; + address_struct: Cell?; +} + +// =============================== +// Messages For Operations +// =============================== + +message SetAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; + + // Value fields + valueVarint16: Int?; + valueVarint32: Int?; + valueVaruint16: Int?; + valueVaruint32: Int?; + valueBool: Bool?; + valueCell: Cell?; + valueAddress: Address?; + valueStruct: SomeStruct?; +} + +message DelAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; +} + +message ReplaceAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; + + // Value fields + valueVarint16: Int?; + valueVarint32: Int?; + valueVaruint16: Int?; + valueVaruint32: Int?; + valueBool: Bool?; + valueCell: Cell?; + valueAddress: Address?; + valueStruct: SomeStruct?; +} + +message ReplaceGetAllMaps { + // Key fields + keyInt: Int; + keyInt8: Int; + keyInt42: Int; + keyInt256: Int; + keyUint8: Int; + keyUint42: Int; + keyUint256: Int; + keyAddress: Address; + + // Value fields + valueVarint16: Int?; + valueVarint32: Int?; + valueVaruint16: Int?; + valueVaruint32: Int?; + valueBool: Bool?; + valueCell: Cell?; + valueAddress: Address?; + valueStruct: SomeStruct?; +} + +message CheckNullReference { + +} + +// =============================== +// Test Contract +// =============================== + +contract MapTestContract { + receive() {} + + // =============================== + // Integer (`Int`) Key Maps + // =============================== + + int_varint16: map; + int_varint32: map; + int_varuint16: map; + int_varuint32: map; + int_bool: map; + int_cell: map; + int_address: map; + int_struct: map; + + // =============================== + // Integer (`Int as int8`) Key Maps + // =============================== + + int8_varint16: map; + int8_varint32: map; + int8_varuint16: map; + int8_varuint32: map; + int8_bool: map; + int8_cell: map; + int8_address: map; + int8_struct: map; + + // =============================== + // Integer (`Int as int42`) Key Maps + // =============================== + + int42_varint16: map; + int42_varint32: map; + int42_varuint16: map; + int42_varuint32: map; + int42_bool: map; + int42_cell: map; + int42_address: map; + int42_struct: map; + + // =============================== + // Integer (`Int as int256`) Key Maps + // =============================== + + int256_varint16: map; + int256_varint32: map; + int256_varuint16: map; + int256_varuint32: map; + int256_bool: map; + int256_cell: map; + int256_address: map; + int256_struct: map; + + // =============================== + // Unsigned Integer (`Int as uint8`) Key Maps + // =============================== + + uint8_varint16: map; + uint8_varint32: map; + uint8_varuint16: map; + uint8_varuint32: map; + uint8_bool: map; + uint8_cell: map; + uint8_address: map; + uint8_struct: map; + + // =============================== + // Unsigned Integer (`Int as uint42`) Key Maps + // =============================== + + uint42_varint16: map; + uint42_varint32: map; + uint42_varuint16: map; + uint42_varuint32: map; + uint42_bool: map; + uint42_cell: map; + uint42_address: map; + uint42_struct: map; + + // =============================== + // Unsigned Integer (`Int as uint256`) Key Maps + // =============================== + + uint256_varint16: map; + uint256_varint32: map; + uint256_varuint16: map; + uint256_varuint32: map; + uint256_bool: map; + uint256_cell: map; + uint256_address: map; + uint256_struct: map; + + // =============================== + // Address Key Maps + // =============================== + + address_varint16: map; + address_varint32: map; + address_varuint16: map; + address_varuint32: map; + address_bool: map; + address_cell: map; + address_address: map; + address_struct: map; + + // =============================== + // Receivers For Operations + // =============================== + + receive(msg: SetAllMaps) { + // Integer Key Maps + self.int_varint16.set(msg.keyInt, msg.valueVarint16); + self.int_varint32.set(msg.keyInt, msg.valueVarint32); + self.int_varuint16.set(msg.keyInt, msg.valueVaruint16); + self.int_varuint32.set(msg.keyInt, msg.valueVaruint32); + self.int_bool.set(msg.keyInt, msg.valueBool); + self.int_cell.set(msg.keyInt, msg.valueCell); + self.int_address.set(msg.keyInt, msg.valueAddress); + self.int_struct.set(msg.keyInt, msg.valueStruct); + + self.int8_varint16.set(msg.keyInt8, msg.valueVarint16); + self.int8_varint32.set(msg.keyInt8, msg.valueVarint32); + self.int8_varuint16.set(msg.keyInt8, msg.valueVaruint16); + self.int8_varuint32.set(msg.keyInt8, msg.valueVaruint32); + self.int8_bool.set(msg.keyInt8, msg.valueBool); + self.int8_cell.set(msg.keyInt8, msg.valueCell); + self.int8_address.set(msg.keyInt8, msg.valueAddress); + self.int8_struct.set(msg.keyInt8, msg.valueStruct); + + self.int42_varint16.set(msg.keyInt42, msg.valueVarint16); + self.int42_varint32.set(msg.keyInt42, msg.valueVarint32); + self.int42_varuint16.set(msg.keyInt42, msg.valueVaruint16); + self.int42_varuint32.set(msg.keyInt42, msg.valueVaruint32); + self.int42_bool.set(msg.keyInt42, msg.valueBool); + self.int42_cell.set(msg.keyInt42, msg.valueCell); + self.int42_address.set(msg.keyInt42, msg.valueAddress); + self.int42_struct.set(msg.keyInt42, msg.valueStruct); + + self.int256_varint16.set(msg.keyInt256, msg.valueVarint16); + self.int256_varint32.set(msg.keyInt256, msg.valueVarint32); + self.int256_varuint16.set(msg.keyInt256, msg.valueVaruint16); + self.int256_varuint32.set(msg.keyInt256, msg.valueVaruint32); + self.int256_bool.set(msg.keyInt256, msg.valueBool); + self.int256_cell.set(msg.keyInt256, msg.valueCell); + self.int256_address.set(msg.keyInt256, msg.valueAddress); + self.int256_struct.set(msg.keyInt256, msg.valueStruct); + + self.uint8_varint16.set(msg.keyUint8, msg.valueVarint16); + self.uint8_varint32.set(msg.keyUint8, msg.valueVarint32); + self.uint8_varuint16.set(msg.keyUint8, msg.valueVaruint16); + self.uint8_varuint32.set(msg.keyUint8, msg.valueVaruint32); + self.uint8_bool.set(msg.keyUint8, msg.valueBool); + self.uint8_cell.set(msg.keyUint8, msg.valueCell); + self.uint8_address.set(msg.keyUint8, msg.valueAddress); + self.uint8_struct.set(msg.keyUint8, msg.valueStruct); + + self.uint42_varint16.set(msg.keyUint42, msg.valueVarint16); + self.uint42_varint32.set(msg.keyUint42, msg.valueVarint32); + self.uint42_varuint16.set(msg.keyUint42, msg.valueVaruint16); + self.uint42_varuint32.set(msg.keyUint42, msg.valueVaruint32); + self.uint42_bool.set(msg.keyUint42, msg.valueBool); + self.uint42_cell.set(msg.keyUint42, msg.valueCell); + self.uint42_address.set(msg.keyUint42, msg.valueAddress); + self.uint42_struct.set(msg.keyUint42, msg.valueStruct); + + self.uint256_varint16.set(msg.keyUint256, msg.valueVarint16); + self.uint256_varint32.set(msg.keyUint256, msg.valueVarint32); + self.uint256_varuint16.set(msg.keyUint256, msg.valueVaruint16); + self.uint256_varuint32.set(msg.keyUint256, msg.valueVaruint32); + self.uint256_bool.set(msg.keyUint256, msg.valueBool); + self.uint256_cell.set(msg.keyUint256, msg.valueCell); + self.uint256_address.set(msg.keyUint256, msg.valueAddress); + self.uint256_struct.set(msg.keyUint256, msg.valueStruct); + + // Address Key Maps + self.address_varint16.set(msg.keyAddress, msg.valueVarint16); + self.address_varint32.set(msg.keyAddress, msg.valueVarint32); + self.address_varuint16.set(msg.keyAddress, msg.valueVaruint16); + self.address_varuint32.set(msg.keyAddress, msg.valueVaruint32); + self.address_bool.set(msg.keyAddress, msg.valueBool); + self.address_cell.set(msg.keyAddress, msg.valueCell); + self.address_address.set(msg.keyAddress, msg.valueAddress); + self.address_struct.set(msg.keyAddress, msg.valueStruct); + } + + receive(msg: DelAllMaps) { + // Integer Key Maps + self.int_varint16.del(msg.keyInt); + self.int_varint32.del(msg.keyInt); + self.int_varuint16.del(msg.keyInt); + self.int_varuint32.del(msg.keyInt); + self.int_bool.del(msg.keyInt); + self.int_cell.del(msg.keyInt); + self.int_address.del(msg.keyInt); + self.int_struct.del(msg.keyInt); + + self.int8_varint16.del(msg.keyInt8); + self.int8_varint32.del(msg.keyInt8); + self.int8_varuint16.del(msg.keyInt8); + self.int8_varuint32.del(msg.keyInt8); + self.int8_bool.del(msg.keyInt8); + self.int8_cell.del(msg.keyInt8); + self.int8_address.del(msg.keyInt8); + self.int8_struct.del(msg.keyInt8); + + self.int42_varint16.del(msg.keyInt42); + self.int42_varint32.del(msg.keyInt42); + self.int42_varuint16.del(msg.keyInt42); + self.int42_varuint32.del(msg.keyInt42); + self.int42_bool.del(msg.keyInt42); + self.int42_cell.del(msg.keyInt42); + self.int42_address.del(msg.keyInt42); + self.int42_struct.del(msg.keyInt42); + + self.int256_varint16.del(msg.keyInt256); + self.int256_varint32.del(msg.keyInt256); + self.int256_varuint16.del(msg.keyInt256); + self.int256_varuint32.del(msg.keyInt256); + self.int256_bool.del(msg.keyInt256); + self.int256_cell.del(msg.keyInt256); + self.int256_address.del(msg.keyInt256); + self.int256_struct.del(msg.keyInt256); + + self.uint8_varint16.del(msg.keyUint8); + self.uint8_varint32.del(msg.keyUint8); + self.uint8_varuint16.del(msg.keyUint8); + self.uint8_varuint32.del(msg.keyUint8); + self.uint8_bool.del(msg.keyUint8); + self.uint8_cell.del(msg.keyUint8); + self.uint8_address.del(msg.keyUint8); + self.uint8_struct.del(msg.keyUint8); + + self.uint42_varint16.del(msg.keyUint42); + self.uint42_varint32.del(msg.keyUint42); + self.uint42_varuint16.del(msg.keyUint42); + self.uint42_varuint32.del(msg.keyUint42); + self.uint42_bool.del(msg.keyUint42); + self.uint42_cell.del(msg.keyUint42); + self.uint42_address.del(msg.keyUint42); + self.uint42_struct.del(msg.keyUint42); + + self.uint256_varint16.del(msg.keyUint256); + self.uint256_varint32.del(msg.keyUint256); + self.uint256_varuint16.del(msg.keyUint256); + self.uint256_varuint32.del(msg.keyUint256); + self.uint256_bool.del(msg.keyUint256); + self.uint256_cell.del(msg.keyUint256); + self.uint256_address.del(msg.keyUint256); + self.uint256_struct.del(msg.keyUint256); + + // Address Key Maps + self.address_varint16.del(msg.keyAddress); + self.address_varint32.del(msg.keyAddress); + self.address_varuint16.del(msg.keyAddress); + self.address_varuint32.del(msg.keyAddress); + self.address_bool.del(msg.keyAddress); + self.address_cell.del(msg.keyAddress); + self.address_address.del(msg.keyAddress); + self.address_struct.del(msg.keyAddress); + } + + receive(msg: ReplaceAllMaps) { + // Replace operations analogous to coins, now including varint16, varint32, varuint16, varuint32 + self.int_varint16.replace(msg.keyInt, msg.valueVarint16); + self.int_varint32.replace(msg.keyInt, msg.valueVarint32); + self.int_varuint16.replace(msg.keyInt, msg.valueVaruint16); + self.int_varuint32.replace(msg.keyInt, msg.valueVaruint32); + self.int_bool.replace(msg.keyInt, msg.valueBool); + self.int_cell.replace(msg.keyInt, msg.valueCell); + self.int_address.replace(msg.keyInt, msg.valueAddress); + self.int_struct.replace(msg.keyInt, msg.valueStruct); + + self.int8_varint16.replace(msg.keyInt8, msg.valueVarint16); + self.int8_varint32.replace(msg.keyInt8, msg.valueVarint32); + self.int8_varuint16.replace(msg.keyInt8, msg.valueVaruint16); + self.int8_varuint32.replace(msg.keyInt8, msg.valueVaruint32); + self.int8_bool.replace(msg.keyInt8, msg.valueBool); + self.int8_cell.replace(msg.keyInt8, msg.valueCell); + self.int8_address.replace(msg.keyInt8, msg.valueAddress); + self.int8_struct.replace(msg.keyInt8, msg.valueStruct); + + self.int42_varint16.replace(msg.keyInt42, msg.valueVarint16); + self.int42_varint32.replace(msg.keyInt42, msg.valueVarint32); + self.int42_varuint16.replace(msg.keyInt42, msg.valueVaruint16); + self.int42_varuint32.replace(msg.keyInt42, msg.valueVaruint32); + self.int42_bool.replace(msg.keyInt42, msg.valueBool); + self.int42_cell.replace(msg.keyInt42, msg.valueCell); + self.int42_address.replace(msg.keyInt42, msg.valueAddress); + self.int42_struct.replace(msg.keyInt42, msg.valueStruct); + + self.int256_varint16.replace(msg.keyInt256, msg.valueVarint16); + self.int256_varint32.replace(msg.keyInt256, msg.valueVarint32); + self.int256_varuint16.replace(msg.keyInt256, msg.valueVaruint16); + self.int256_varuint32.replace(msg.keyInt256, msg.valueVaruint32); + self.int256_bool.replace(msg.keyInt256, msg.valueBool); + self.int256_cell.replace(msg.keyInt256, msg.valueCell); + self.int256_address.replace(msg.keyInt256, msg.valueAddress); + self.int256_struct.replace(msg.keyInt256, msg.valueStruct); + + self.uint8_varint16.replace(msg.keyUint8, msg.valueVarint16); + self.uint8_varint32.replace(msg.keyUint8, msg.valueVarint32); + self.uint8_varuint16.replace(msg.keyUint8, msg.valueVaruint16); + self.uint8_varuint32.replace(msg.keyUint8, msg.valueVaruint32); + self.uint8_bool.replace(msg.keyUint8, msg.valueBool); + self.uint8_cell.replace(msg.keyUint8, msg.valueCell); + self.uint8_address.replace(msg.keyUint8, msg.valueAddress); + self.uint8_struct.replace(msg.keyUint8, msg.valueStruct); + + self.uint42_varint16.replace(msg.keyUint42, msg.valueVarint16); + self.uint42_varint32.replace(msg.keyUint42, msg.valueVarint32); + self.uint42_varuint16.replace(msg.keyUint42, msg.valueVaruint16); + self.uint42_varuint32.replace(msg.keyUint42, msg.valueVaruint32); + self.uint42_bool.replace(msg.keyUint42, msg.valueBool); + self.uint42_cell.replace(msg.keyUint42, msg.valueCell); + self.uint42_address.replace(msg.keyUint42, msg.valueAddress); + self.uint42_struct.replace(msg.keyUint42, msg.valueStruct); + + self.uint256_varint16.replace(msg.keyUint256, msg.valueVarint16); + self.uint256_varint32.replace(msg.keyUint256, msg.valueVarint32); + self.uint256_varuint16.replace(msg.keyUint256, msg.valueVaruint16); + self.uint256_varuint32.replace(msg.keyUint256, msg.valueVaruint32); + self.uint256_bool.replace(msg.keyUint256, msg.valueBool); + self.uint256_cell.replace(msg.keyUint256, msg.valueCell); + self.uint256_address.replace(msg.keyUint256, msg.valueAddress); + self.uint256_struct.replace(msg.keyUint256, msg.valueStruct); + + // Address Key Maps + self.address_varint16.replace(msg.keyAddress, msg.valueVarint16); + self.address_varint32.replace(msg.keyAddress, msg.valueVarint32); + self.address_varuint16.replace(msg.keyAddress, msg.valueVaruint16); + self.address_varuint32.replace(msg.keyAddress, msg.valueVaruint32); + self.address_bool.replace(msg.keyAddress, msg.valueBool); + self.address_cell.replace(msg.keyAddress, msg.valueCell); + self.address_address.replace(msg.keyAddress, msg.valueAddress); + self.address_struct.replace(msg.keyAddress, msg.valueStruct); + } + + receive(msg: ReplaceGetAllMaps) { + // Similar to above, but calling replaceGet + self.int_varint16.replaceGet(msg.keyInt, msg.valueVarint16); + self.int_varint32.replaceGet(msg.keyInt, msg.valueVarint32); + self.int_varuint16.replaceGet(msg.keyInt, msg.valueVaruint16); + self.int_varuint32.replaceGet(msg.keyInt, msg.valueVaruint32); + self.int_bool.replaceGet(msg.keyInt, msg.valueBool); + self.int_cell.replaceGet(msg.keyInt, msg.valueCell); + self.int_address.replaceGet(msg.keyInt, msg.valueAddress); + self.int_struct.replaceGet(msg.keyInt, msg.valueStruct); + + self.int8_varint16.replaceGet(msg.keyInt8, msg.valueVarint16); + self.int8_varint32.replaceGet(msg.keyInt8, msg.valueVarint32); + self.int8_varuint16.replaceGet(msg.keyInt8, msg.valueVaruint16); + self.int8_varuint32.replaceGet(msg.keyInt8, msg.valueVaruint32); + self.int8_bool.replaceGet(msg.keyInt8, msg.valueBool); + self.int8_cell.replaceGet(msg.keyInt8, msg.valueCell); + self.int8_address.replaceGet(msg.keyInt8, msg.valueAddress); + self.int8_struct.replaceGet(msg.keyInt8, msg.valueStruct); + + self.int42_varint16.replaceGet(msg.keyInt42, msg.valueVarint16); + self.int42_varint32.replaceGet(msg.keyInt42, msg.valueVarint32); + self.int42_varuint16.replaceGet(msg.keyInt42, msg.valueVaruint16); + self.int42_varuint32.replaceGet(msg.keyInt42, msg.valueVaruint32); + self.int42_bool.replaceGet(msg.keyInt42, msg.valueBool); + self.int42_cell.replaceGet(msg.keyInt42, msg.valueCell); + self.int42_address.replaceGet(msg.keyInt42, msg.valueAddress); + self.int42_struct.replaceGet(msg.keyInt42, msg.valueStruct); + + self.int256_varint16.replaceGet(msg.keyInt256, msg.valueVarint16); + self.int256_varint32.replaceGet(msg.keyInt256, msg.valueVarint32); + self.int256_varuint16.replaceGet(msg.keyInt256, msg.valueVaruint16); + self.int256_varuint32.replaceGet(msg.keyInt256, msg.valueVaruint32); + self.int256_bool.replaceGet(msg.keyInt256, msg.valueBool); + self.int256_cell.replaceGet(msg.keyInt256, msg.valueCell); + self.int256_address.replaceGet(msg.keyInt256, msg.valueAddress); + self.int256_struct.replaceGet(msg.keyInt256, msg.valueStruct); + + self.uint8_varint16.replaceGet(msg.keyUint8, msg.valueVarint16); + self.uint8_varint32.replaceGet(msg.keyUint8, msg.valueVarint32); + self.uint8_varuint16.replaceGet(msg.keyUint8, msg.valueVaruint16); + self.uint8_varuint32.replaceGet(msg.keyUint8, msg.valueVaruint32); + self.uint8_bool.replaceGet(msg.keyUint8, msg.valueBool); + self.uint8_cell.replaceGet(msg.keyUint8, msg.valueCell); + self.uint8_address.replaceGet(msg.keyUint8, msg.valueAddress); + self.uint8_struct.replaceGet(msg.keyUint8, msg.valueStruct); + + self.uint42_varint16.replaceGet(msg.keyUint42, msg.valueVarint16); + self.uint42_varint32.replaceGet(msg.keyUint42, msg.valueVarint32); + self.uint42_varuint16.replaceGet(msg.keyUint42, msg.valueVaruint16); + self.uint42_varuint32.replaceGet(msg.keyUint42, msg.valueVaruint32); + self.uint42_bool.replaceGet(msg.keyUint42, msg.valueBool); + self.uint42_cell.replaceGet(msg.keyUint42, msg.valueCell); + self.uint42_address.replaceGet(msg.keyUint42, msg.valueAddress); + self.uint42_struct.replaceGet(msg.keyUint42, msg.valueStruct); + + self.uint256_varint16.replaceGet(msg.keyUint256, msg.valueVarint16); + self.uint256_varint32.replaceGet(msg.keyUint256, msg.valueVarint32); + self.uint256_varuint16.replaceGet(msg.keyUint256, msg.valueVaruint16); + self.uint256_varuint32.replaceGet(msg.keyUint256, msg.valueVaruint32); + self.uint256_bool.replaceGet(msg.keyUint256, msg.valueBool); + self.uint256_cell.replaceGet(msg.keyUint256, msg.valueCell); + self.uint256_address.replaceGet(msg.keyUint256, msg.valueAddress); + self.uint256_struct.replaceGet(msg.keyUint256, msg.valueStruct); + + // Address Key Maps + self.address_varint16.replaceGet(msg.keyAddress, msg.valueVarint16); + self.address_varint32.replaceGet(msg.keyAddress, msg.valueVarint32); + self.address_varuint16.replaceGet(msg.keyAddress, msg.valueVaruint16); + self.address_varuint32.replaceGet(msg.keyAddress, msg.valueVaruint32); + self.address_bool.replaceGet(msg.keyAddress, msg.valueBool); + self.address_cell.replaceGet(msg.keyAddress, msg.valueCell); + self.address_address.replaceGet(msg.keyAddress, msg.valueAddress); + self.address_struct.replaceGet(msg.keyAddress, msg.valueStruct); + } + + // =============================== + // Getters + // =============================== + + get fun allMaps(): MapTestContract { + return self; + } + + get fun getAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address + ): GetAllMapsResult { + return GetAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.get(keyInt), + int_varint32: self.int_varint32.get(keyInt), + int_varuint16: self.int_varuint16.get(keyInt), + int_varuint32: self.int_varuint32.get(keyInt), + int_bool: self.int_bool.get(keyInt), + int_cell: self.int_cell.get(keyInt), + int_address: self.int_address.get(keyInt), + int_struct: self.int_struct.get(keyInt), + + int8_varint16: self.int8_varint16.get(keyInt8), + int8_varint32: self.int8_varint32.get(keyInt8), + int8_varuint16: self.int8_varuint16.get(keyInt8), + int8_varuint32: self.int8_varuint32.get(keyInt8), + int8_bool: self.int8_bool.get(keyInt8), + int8_cell: self.int8_cell.get(keyInt8), + int8_address: self.int8_address.get(keyInt8), + int8_struct: self.int8_struct.get(keyInt8), + + int42_varint16: self.int42_varint16.get(keyInt42), + int42_varint32: self.int42_varint32.get(keyInt42), + int42_varuint16: self.int42_varuint16.get(keyInt42), + int42_varuint32: self.int42_varuint32.get(keyInt42), + int42_bool: self.int42_bool.get(keyInt42), + int42_cell: self.int42_cell.get(keyInt42), + int42_address: self.int42_address.get(keyInt42), + int42_struct: self.int42_struct.get(keyInt42), + + int256_varint16: self.int256_varint16.get(keyInt256), + int256_varint32: self.int256_varint32.get(keyInt256), + int256_varuint16: self.int256_varuint16.get(keyInt256), + int256_varuint32: self.int256_varuint32.get(keyInt256), + int256_bool: self.int256_bool.get(keyInt256), + int256_cell: self.int256_cell.get(keyInt256), + int256_address: self.int256_address.get(keyInt256), + int256_struct: self.int256_struct.get(keyInt256), + + uint8_varint16: self.uint8_varint16.get(keyUint8), + uint8_varint32: self.uint8_varint32.get(keyUint8), + uint8_varuint16: self.uint8_varuint16.get(keyUint8), + uint8_varuint32: self.uint8_varuint32.get(keyUint8), + uint8_bool: self.uint8_bool.get(keyUint8), + uint8_cell: self.uint8_cell.get(keyUint8), + uint8_address: self.uint8_address.get(keyUint8), + uint8_struct: self.uint8_struct.get(keyUint8), + + uint42_varint16: self.uint42_varint16.get(keyUint42), + uint42_varint32: self.uint42_varint32.get(keyUint42), + uint42_varuint16: self.uint42_varuint16.get(keyUint42), + uint42_varuint32: self.uint42_varuint32.get(keyUint42), + uint42_bool: self.uint42_bool.get(keyUint42), + uint42_cell: self.uint42_cell.get(keyUint42), + uint42_address: self.uint42_address.get(keyUint42), + uint42_struct: self.uint42_struct.get(keyUint42), + + uint256_varint16: self.uint256_varint16.get(keyUint256), + uint256_varint32: self.uint256_varint32.get(keyUint256), + uint256_varuint16: self.uint256_varuint16.get(keyUint256), + uint256_varuint32: self.uint256_varuint32.get(keyUint256), + uint256_bool: self.uint256_bool.get(keyUint256), + uint256_cell: self.uint256_cell.get(keyUint256), + uint256_address: self.uint256_address.get(keyUint256), + uint256_struct: self.uint256_struct.get(keyUint256), + + // Address Key Maps + address_varint16: self.address_varint16.get(keyAddress), + address_varint32: self.address_varint32.get(keyAddress), + address_varuint16: self.address_varuint16.get(keyAddress), + address_varuint32: self.address_varuint32.get(keyAddress), + address_bool: self.address_bool.get(keyAddress), + address_cell: self.address_cell.get(keyAddress), + address_address: self.address_address.get(keyAddress), + address_struct: self.address_struct.get(keyAddress) + }; + } + + get fun replaceAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address, + valueVarint16: Int, + valueVarint32: Int, + valueVaruint16: Int, + valueVaruint32: Int, + valueBool: Bool, + valueCell: Cell, + valueAddress: Address, + valueStruct: SomeStruct + ): ReplaceAllMapsResult { + return ReplaceAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.replace(keyInt, valueVarint16), + int_varint32: self.int_varint32.replace(keyInt, valueVarint32), + int_varuint16: self.int_varuint16.replace(keyInt, valueVaruint16), + int_varuint32: self.int_varuint32.replace(keyInt, valueVaruint32), + int_bool: self.int_bool.replace(keyInt, valueBool), + int_cell: self.int_cell.replace(keyInt, valueCell), + int_address: self.int_address.replace(keyInt, valueAddress), + int_struct: self.int_struct.replace(keyInt, valueStruct), + + int8_varint16: self.int8_varint16.replace(keyInt8, valueVarint16), + int8_varint32: self.int8_varint32.replace(keyInt8, valueVarint32), + int8_varuint16: self.int8_varuint16.replace(keyInt8, valueVaruint16), + int8_varuint32: self.int8_varuint32.replace(keyInt8, valueVaruint32), + int8_bool: self.int8_bool.replace(keyInt8, valueBool), + int8_cell: self.int8_cell.replace(keyInt8, valueCell), + int8_address: self.int8_address.replace(keyInt8, valueAddress), + int8_struct: self.int8_struct.replace(keyInt8, valueStruct), + + int42_varint16: self.int42_varint16.replace(keyInt42, valueVarint16), + int42_varint32: self.int42_varint32.replace(keyInt42, valueVarint32), + int42_varuint16: self.int42_varuint16.replace(keyInt42, valueVaruint16), + int42_varuint32: self.int42_varuint32.replace(keyInt42, valueVaruint32), + int42_bool: self.int42_bool.replace(keyInt42, valueBool), + int42_cell: self.int42_cell.replace(keyInt42, valueCell), + int42_address: self.int42_address.replace(keyInt42, valueAddress), + int42_struct: self.int42_struct.replace(keyInt42, valueStruct), + + int256_varint16: self.int256_varint16.replace(keyInt256, valueVarint16), + int256_varint32: self.int256_varint32.replace(keyInt256, valueVarint32), + int256_varuint16: self.int256_varuint16.replace(keyInt256, valueVaruint16), + int256_varuint32: self.int256_varuint32.replace(keyInt256, valueVaruint32), + int256_bool: self.int256_bool.replace(keyInt256, valueBool), + int256_cell: self.int256_cell.replace(keyInt256, valueCell), + int256_address: self.int256_address.replace(keyInt256, valueAddress), + int256_struct: self.int256_struct.replace(keyInt256, valueStruct), + + uint8_varint16: self.uint8_varint16.replace(keyUint8, valueVarint16), + uint8_varint32: self.uint8_varint32.replace(keyUint8, valueVarint32), + uint8_varuint16: self.uint8_varuint16.replace(keyUint8, valueVaruint16), + uint8_varuint32: self.uint8_varuint32.replace(keyUint8, valueVaruint32), + uint8_bool: self.uint8_bool.replace(keyUint8, valueBool), + uint8_cell: self.uint8_cell.replace(keyUint8, valueCell), + uint8_address: self.uint8_address.replace(keyUint8, valueAddress), + uint8_struct: self.uint8_struct.replace(keyUint8, valueStruct), + + uint42_varint16: self.uint42_varint16.replace(keyUint42, valueVarint16), + uint42_varint32: self.uint42_varint32.replace(keyUint42, valueVarint32), + uint42_varuint16: self.uint42_varuint16.replace(keyUint42, valueVaruint16), + uint42_varuint32: self.uint42_varuint32.replace(keyUint42, valueVaruint32), + uint42_bool: self.uint42_bool.replace(keyUint42, valueBool), + uint42_cell: self.uint42_cell.replace(keyUint42, valueCell), + uint42_address: self.uint42_address.replace(keyUint42, valueAddress), + uint42_struct: self.uint42_struct.replace(keyUint42, valueStruct), + + uint256_varint16: self.uint256_varint16.replace(keyUint256, valueVarint16), + uint256_varint32: self.uint256_varint32.replace(keyUint256, valueVarint32), + uint256_varuint16: self.uint256_varuint16.replace(keyUint256, valueVaruint16), + uint256_varuint32: self.uint256_varuint32.replace(keyUint256, valueVaruint32), + uint256_bool: self.uint256_bool.replace(keyUint256, valueBool), + uint256_cell: self.uint256_cell.replace(keyUint256, valueCell), + uint256_address: self.uint256_address.replace(keyUint256, valueAddress), + uint256_struct: self.uint256_struct.replace(keyUint256, valueStruct), + + // Address Key Maps + address_varint16: self.address_varint16.replace(keyAddress, valueVarint16), + address_varint32: self.address_varint32.replace(keyAddress, valueVarint32), + address_varuint16: self.address_varuint16.replace(keyAddress, valueVaruint16), + address_varuint32: self.address_varuint32.replace(keyAddress, valueVaruint32), + address_bool: self.address_bool.replace(keyAddress, valueBool), + address_cell: self.address_cell.replace(keyAddress, valueCell), + address_address: self.address_address.replace(keyAddress, valueAddress), + address_struct: self.address_struct.replace(keyAddress, valueStruct) + }; + } + + get fun replaceGetAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address, + valueVarint16: Int, + valueVarint32: Int, + valueVaruint16: Int, + valueVaruint32: Int, + valueBool: Bool, + valueCell: Cell, + valueAddress: Address, + valueStruct: SomeStruct + ): ReplaceGetAllMapsResult { + return ReplaceGetAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.replaceGet(keyInt, valueVarint16), + int_varint32: self.int_varint32.replaceGet(keyInt, valueVarint32), + int_varuint16: self.int_varuint16.replaceGet(keyInt, valueVaruint16), + int_varuint32: self.int_varuint32.replaceGet(keyInt, valueVaruint32), + int_bool: self.int_bool.replaceGet(keyInt, valueBool), + int_cell: self.int_cell.replaceGet(keyInt, valueCell), + int_address: self.int_address.replaceGet(keyInt, valueAddress), + int_struct: self.int_struct.replaceGet(keyInt, valueStruct), + + int8_varint16: self.int8_varint16.replaceGet(keyInt8, valueVarint16), + int8_varint32: self.int8_varint32.replaceGet(keyInt8, valueVarint32), + int8_varuint16: self.int8_varuint16.replaceGet(keyInt8, valueVaruint16), + int8_varuint32: self.int8_varuint32.replaceGet(keyInt8, valueVaruint32), + int8_bool: self.int8_bool.replaceGet(keyInt8, valueBool), + int8_cell: self.int8_cell.replaceGet(keyInt8, valueCell), + int8_address: self.int8_address.replaceGet(keyInt8, valueAddress), + int8_struct: self.int8_struct.replaceGet(keyInt8, valueStruct), + + int42_varint16: self.int42_varint16.replaceGet(keyInt42, valueVarint16), + int42_varint32: self.int42_varint32.replaceGet(keyInt42, valueVarint32), + int42_varuint16: self.int42_varuint16.replaceGet(keyInt42, valueVaruint16), + int42_varuint32: self.int42_varuint32.replaceGet(keyInt42, valueVaruint32), + int42_bool: self.int42_bool.replaceGet(keyInt42, valueBool), + int42_cell: self.int42_cell.replaceGet(keyInt42, valueCell), + int42_address: self.int42_address.replaceGet(keyInt42, valueAddress), + int42_struct: self.int42_struct.replaceGet(keyInt42, valueStruct), + + int256_varint16: self.int256_varint16.replaceGet(keyInt256, valueVarint16), + int256_varint32: self.int256_varint32.replaceGet(keyInt256, valueVarint32), + int256_varuint16: self.int256_varuint16.replaceGet(keyInt256, valueVaruint16), + int256_varuint32: self.int256_varuint32.replaceGet(keyInt256, valueVaruint32), + int256_bool: self.int256_bool.replaceGet(keyInt256, valueBool), + int256_cell: self.int256_cell.replaceGet(keyInt256, valueCell), + int256_address: self.int256_address.replaceGet(keyInt256, valueAddress), + int256_struct: self.int256_struct.replaceGet(keyInt256, valueStruct), + + uint8_varint16: self.uint8_varint16.replaceGet(keyUint8, valueVarint16), + uint8_varint32: self.uint8_varint32.replaceGet(keyUint8, valueVarint32), + uint8_varuint16: self.uint8_varuint16.replaceGet(keyUint8, valueVaruint16), + uint8_varuint32: self.uint8_varuint32.replaceGet(keyUint8, valueVaruint32), + uint8_bool: self.uint8_bool.replaceGet(keyUint8, valueBool), + uint8_cell: self.uint8_cell.replaceGet(keyUint8, valueCell), + uint8_address: self.uint8_address.replaceGet(keyUint8, valueAddress), + uint8_struct: self.uint8_struct.replaceGet(keyUint8, valueStruct), + + uint42_varint16: self.uint42_varint16.replaceGet(keyUint42, valueVarint16), + uint42_varint32: self.uint42_varint32.replaceGet(keyUint42, valueVarint32), + uint42_varuint16: self.uint42_varuint16.replaceGet(keyUint42, valueVaruint16), + uint42_varuint32: self.uint42_varuint32.replaceGet(keyUint42, valueVaruint32), + uint42_bool: self.uint42_bool.replaceGet(keyUint42, valueBool), + uint42_cell: self.uint42_cell.replaceGet(keyUint42, valueCell), + uint42_address: self.uint42_address.replaceGet(keyUint42, valueAddress), + uint42_struct: self.uint42_struct.replaceGet(keyUint42, valueStruct), + + uint256_varint16: self.uint256_varint16.replaceGet(keyUint256, valueVarint16), + uint256_varint32: self.uint256_varint32.replaceGet(keyUint256, valueVarint32), + uint256_varuint16: self.uint256_varuint16.replaceGet(keyUint256, valueVaruint16), + uint256_varuint32: self.uint256_varuint32.replaceGet(keyUint256, valueVaruint32), + uint256_bool: self.uint256_bool.replaceGet(keyUint256, valueBool), + uint256_cell: self.uint256_cell.replaceGet(keyUint256, valueCell), + uint256_address: self.uint256_address.replaceGet(keyUint256, valueAddress), + uint256_struct: self.uint256_struct.replaceGet(keyUint256, valueStruct), + + // Address Key Maps + address_varint16: self.address_varint16.replaceGet(keyAddress, valueVarint16), + address_varint32: self.address_varint32.replaceGet(keyAddress, valueVarint32), + address_varuint16: self.address_varuint16.replaceGet(keyAddress, valueVaruint16), + address_varuint32: self.address_varuint32.replaceGet(keyAddress, valueVaruint32), + address_bool: self.address_bool.replaceGet(keyAddress, valueBool), + address_cell: self.address_cell.replaceGet(keyAddress, valueCell), + address_address: self.address_address.replaceGet(keyAddress, valueAddress), + address_struct: self.address_struct.replaceGet(keyAddress, valueStruct) + }; + } + + get fun existsAllMaps( + keyInt: Int, + keyInt8: Int, + keyInt42: Int, + keyInt256: Int, + keyUint8: Int, + keyUint42: Int, + keyUint256: Int, + keyAddress: Address + ): ExistsAllMapsResult { + return ExistsAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.exists(keyInt), + int_varint32: self.int_varint32.exists(keyInt), + int_varuint16: self.int_varuint16.exists(keyInt), + int_varuint32: self.int_varuint32.exists(keyInt), + int_bool: self.int_bool.exists(keyInt), + int_cell: self.int_cell.exists(keyInt), + int_address: self.int_address.exists(keyInt), + int_struct: self.int_struct.exists(keyInt), + + int8_varint16: self.int8_varint16.exists(keyInt8), + int8_varint32: self.int8_varint32.exists(keyInt8), + int8_varuint16: self.int8_varuint16.exists(keyInt8), + int8_varuint32: self.int8_varuint32.exists(keyInt8), + int8_bool: self.int8_bool.exists(keyInt8), + int8_cell: self.int8_cell.exists(keyInt8), + int8_address: self.int8_address.exists(keyInt8), + int8_struct: self.int8_struct.exists(keyInt8), + + int42_varint16: self.int42_varint16.exists(keyInt42), + int42_varint32: self.int42_varint32.exists(keyInt42), + int42_varuint16: self.int42_varuint16.exists(keyInt42), + int42_varuint32: self.int42_varuint32.exists(keyInt42), + int42_bool: self.int42_bool.exists(keyInt42), + int42_cell: self.int42_cell.exists(keyInt42), + int42_address: self.int42_address.exists(keyInt42), + int42_struct: self.int42_struct.exists(keyInt42), + + int256_varint16: self.int256_varint16.exists(keyInt256), + int256_varint32: self.int256_varint32.exists(keyInt256), + int256_varuint16: self.int256_varuint16.exists(keyInt256), + int256_varuint32: self.int256_varuint32.exists(keyInt256), + int256_bool: self.int256_bool.exists(keyInt256), + int256_cell: self.int256_cell.exists(keyInt256), + int256_address: self.int256_address.exists(keyInt256), + int256_struct: self.int256_struct.exists(keyInt256), + + uint8_varint16: self.uint8_varint16.exists(keyUint8), + uint8_varint32: self.uint8_varint32.exists(keyUint8), + uint8_varuint16: self.uint8_varuint16.exists(keyUint8), + uint8_varuint32: self.uint8_varuint32.exists(keyUint8), + uint8_bool: self.uint8_bool.exists(keyUint8), + uint8_cell: self.uint8_cell.exists(keyUint8), + uint8_address: self.uint8_address.exists(keyUint8), + uint8_struct: self.uint8_struct.exists(keyUint8), + + uint42_varint16: self.uint42_varint16.exists(keyUint42), + uint42_varint32: self.uint42_varint32.exists(keyUint42), + uint42_varuint16: self.uint42_varuint16.exists(keyUint42), + uint42_varuint32: self.uint42_varuint32.exists(keyUint42), + uint42_bool: self.uint42_bool.exists(keyUint42), + uint42_cell: self.uint42_cell.exists(keyUint42), + uint42_address: self.uint42_address.exists(keyUint42), + uint42_struct: self.uint42_struct.exists(keyUint42), + + uint256_varint16: self.uint256_varint16.exists(keyUint256), + uint256_varint32: self.uint256_varint32.exists(keyUint256), + uint256_varuint16: self.uint256_varuint16.exists(keyUint256), + uint256_varuint32: self.uint256_varuint32.exists(keyUint256), + uint256_bool: self.uint256_bool.exists(keyUint256), + uint256_cell: self.uint256_cell.exists(keyUint256), + uint256_address: self.uint256_address.exists(keyUint256), + uint256_struct: self.uint256_struct.exists(keyUint256), + + // Address Key Maps + address_varint16: self.address_varint16.exists(keyAddress), + address_varint32: self.address_varint32.exists(keyAddress), + address_varuint16: self.address_varuint16.exists(keyAddress), + address_varuint32: self.address_varuint32.exists(keyAddress), + address_bool: self.address_bool.exists(keyAddress), + address_cell: self.address_cell.exists(keyAddress), + address_address: self.address_address.exists(keyAddress), + address_struct: self.address_struct.exists(keyAddress) + }; + } + + get fun isEmptyAllMaps(): IsEmptyAllMapsResult { + return IsEmptyAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.isEmpty(), + int_varint32: self.int_varint32.isEmpty(), + int_varuint16: self.int_varuint16.isEmpty(), + int_varuint32: self.int_varuint32.isEmpty(), + int_bool: self.int_bool.isEmpty(), + int_cell: self.int_cell.isEmpty(), + int_address: self.int_address.isEmpty(), + int_struct: self.int_struct.isEmpty(), + + int8_varint16: self.int8_varint16.isEmpty(), + int8_varint32: self.int8_varint32.isEmpty(), + int8_varuint16: self.int8_varuint16.isEmpty(), + int8_varuint32: self.int8_varuint32.isEmpty(), + int8_bool: self.int8_bool.isEmpty(), + int8_cell: self.int8_cell.isEmpty(), + int8_address: self.int8_address.isEmpty(), + int8_struct: self.int8_struct.isEmpty(), + + int42_varint16: self.int42_varint16.isEmpty(), + int42_varint32: self.int42_varint32.isEmpty(), + int42_varuint16: self.int42_varuint16.isEmpty(), + int42_varuint32: self.int42_varuint32.isEmpty(), + int42_bool: self.int42_bool.isEmpty(), + int42_cell: self.int42_cell.isEmpty(), + int42_address: self.int42_address.isEmpty(), + int42_struct: self.int42_struct.isEmpty(), + + int256_varint16: self.int256_varint16.isEmpty(), + int256_varint32: self.int256_varint32.isEmpty(), + int256_varuint16: self.int256_varuint16.isEmpty(), + int256_varuint32: self.int256_varuint32.isEmpty(), + int256_bool: self.int256_bool.isEmpty(), + int256_cell: self.int256_cell.isEmpty(), + int256_address: self.int256_address.isEmpty(), + int256_struct: self.int256_struct.isEmpty(), + + uint8_varint16: self.uint8_varint16.isEmpty(), + uint8_varint32: self.uint8_varint32.isEmpty(), + uint8_varuint16: self.uint8_varuint16.isEmpty(), + uint8_varuint32: self.uint8_varuint32.isEmpty(), + uint8_bool: self.uint8_bool.isEmpty(), + uint8_cell: self.uint8_cell.isEmpty(), + uint8_address: self.uint8_address.isEmpty(), + uint8_struct: self.uint8_struct.isEmpty(), + + uint42_varint16: self.uint42_varint16.isEmpty(), + uint42_varint32: self.uint42_varint32.isEmpty(), + uint42_varuint16: self.uint42_varuint16.isEmpty(), + uint42_varuint32: self.uint42_varuint32.isEmpty(), + uint42_bool: self.uint42_bool.isEmpty(), + uint42_cell: self.uint42_cell.isEmpty(), + uint42_address: self.uint42_address.isEmpty(), + uint42_struct: self.uint42_struct.isEmpty(), + + uint256_varint16: self.uint256_varint16.isEmpty(), + uint256_varint32: self.uint256_varint32.isEmpty(), + uint256_varuint16: self.uint256_varuint16.isEmpty(), + uint256_varuint32: self.uint256_varuint32.isEmpty(), + uint256_bool: self.uint256_bool.isEmpty(), + uint256_cell: self.uint256_cell.isEmpty(), + uint256_address: self.uint256_address.isEmpty(), + uint256_struct: self.uint256_struct.isEmpty(), + + // Address Key Maps + address_varint16: self.address_varint16.isEmpty(), + address_varint32: self.address_varint32.isEmpty(), + address_varuint16: self.address_varuint16.isEmpty(), + address_varuint32: self.address_varuint32.isEmpty(), + address_bool: self.address_bool.isEmpty(), + address_cell: self.address_cell.isEmpty(), + address_address: self.address_address.isEmpty(), + address_struct: self.address_struct.isEmpty() + }; + } + + get fun asCellAllMaps(): AsCellAllMapsResult { + return AsCellAllMapsResult { + // Integer Key Maps + int_varint16: self.int_varint16.asCell(), + int_varint32: self.int_varint32.asCell(), + int_varuint16: self.int_varuint16.asCell(), + int_varuint32: self.int_varuint32.asCell(), + int_bool: self.int_bool.asCell(), + int_cell: self.int_cell.asCell(), + int_address: self.int_address.asCell(), + int_struct: self.int_struct.asCell(), + + int8_varint16: self.int8_varint16.asCell(), + int8_varint32: self.int8_varint32.asCell(), + int8_varuint16: self.int8_varuint16.asCell(), + int8_varuint32: self.int8_varuint32.asCell(), + int8_bool: self.int8_bool.asCell(), + int8_cell: self.int8_cell.asCell(), + int8_address: self.int8_address.asCell(), + int8_struct: self.int8_struct.asCell(), + + int42_varint16: self.int42_varint16.asCell(), + int42_varint32: self.int42_varint32.asCell(), + int42_varuint16: self.int42_varuint16.asCell(), + int42_varuint32: self.int42_varuint32.asCell(), + int42_bool: self.int42_bool.asCell(), + int42_cell: self.int42_cell.asCell(), + int42_address: self.int42_address.asCell(), + int42_struct: self.int42_struct.asCell(), + + int256_varint16: self.int256_varint16.asCell(), + int256_varint32: self.int256_varint32.asCell(), + int256_varuint16: self.int256_varuint16.asCell(), + int256_varuint32: self.int256_varuint32.asCell(), + int256_bool: self.int256_bool.asCell(), + int256_cell: self.int256_cell.asCell(), + int256_address: self.int256_address.asCell(), + int256_struct: self.int256_struct.asCell(), + + uint8_varint16: self.uint8_varint16.asCell(), + uint8_varint32: self.uint8_varint32.asCell(), + uint8_varuint16: self.uint8_varuint16.asCell(), + uint8_varuint32: self.uint8_varuint32.asCell(), + uint8_bool: self.uint8_bool.asCell(), + uint8_cell: self.uint8_cell.asCell(), + uint8_address: self.uint8_address.asCell(), + uint8_struct: self.uint8_struct.asCell(), + + uint42_varint16: self.uint42_varint16.asCell(), + uint42_varint32: self.uint42_varint32.asCell(), + uint42_varuint16: self.uint42_varuint16.asCell(), + uint42_varuint32: self.uint42_varuint32.asCell(), + uint42_bool: self.uint42_bool.asCell(), + uint42_cell: self.uint42_cell.asCell(), + uint42_address: self.uint42_address.asCell(), + uint42_struct: self.uint42_struct.asCell(), + + uint256_varint16: self.uint256_varint16.asCell(), + uint256_varint32: self.uint256_varint32.asCell(), + uint256_varuint16: self.uint256_varuint16.asCell(), + uint256_varuint32: self.uint256_varuint32.asCell(), + uint256_bool: self.uint256_bool.asCell(), + uint256_cell: self.uint256_cell.asCell(), + uint256_address: self.uint256_address.asCell(), + uint256_struct: self.uint256_struct.asCell(), + + // Address Key Maps + address_varint16: self.address_varint16.asCell(), + address_varint32: self.address_varint32.asCell(), + address_varuint16: self.address_varuint16.asCell(), + address_varuint32: self.address_varuint32.asCell(), + address_bool: self.address_bool.asCell(), + address_cell: self.address_cell.asCell(), + address_address: self.address_address.asCell(), + address_struct: self.address_struct.asCell() + }; + } + + // + // Edge Cases + // + + get fun checkNullReference(): Int { + let m: map = emptyMap(); + return m.get(0)!!; + } + + receive(msg: CheckNullReference) { + let m: map = emptyMap(); + m.get(0)!!; + } +} diff --git a/src/test/e2e-emulated/contracts/maps.tact b/src/test/e2e-emulated/contracts/maps2.tact similarity index 68% rename from src/test/e2e-emulated/contracts/maps.tact rename to src/test/e2e-emulated/contracts/maps2.tact index 2fb55bddc..e14b918e9 100644 --- a/src/test/e2e-emulated/contracts/maps.tact +++ b/src/test/e2e-emulated/contracts/maps2.tact @@ -21,10 +21,6 @@ struct GetAllMapsResult { int_uint42: Int?; int_uint256: Int?; int_coins: Int?; - int_bool: Bool?; - int_cell: Cell?; - int_address: Address?; - int_struct: SomeStruct?; int8_int: Int?; int8_int8: Int?; @@ -34,10 +30,6 @@ struct GetAllMapsResult { int8_uint42: Int?; int8_uint256: Int?; int8_coins: Int?; - int8_bool: Bool?; - int8_cell: Cell?; - int8_address: Address?; - int8_struct: SomeStruct?; int42_int: Int?; int42_int8: Int?; @@ -47,10 +39,6 @@ struct GetAllMapsResult { int42_uint42: Int?; int42_uint256: Int?; int42_coins: Int?; - int42_bool: Bool?; - int42_cell: Cell?; - int42_address: Address?; - int42_struct: SomeStruct?; int256_int: Int?; int256_int8: Int?; @@ -60,10 +48,6 @@ struct GetAllMapsResult { int256_uint42: Int?; int256_uint256: Int?; int256_coins: Int?; - int256_bool: Bool?; - int256_cell: Cell?; - int256_address: Address?; - int256_struct: SomeStruct?; uint8_int: Int?; uint8_int8: Int?; @@ -73,10 +57,6 @@ struct GetAllMapsResult { uint8_uint42: Int?; uint8_uint256: Int?; uint8_coins: Int?; - uint8_bool: Bool?; - uint8_cell: Cell?; - uint8_address: Address?; - uint8_struct: SomeStruct?; uint42_int: Int?; uint42_int8: Int?; @@ -86,10 +66,6 @@ struct GetAllMapsResult { uint42_uint42: Int?; uint42_uint256: Int?; uint42_coins: Int?; - uint42_bool: Bool?; - uint42_cell: Cell?; - uint42_address: Address?; - uint42_struct: SomeStruct?; uint256_int: Int?; uint256_int8: Int?; @@ -99,10 +75,6 @@ struct GetAllMapsResult { uint256_uint42: Int?; uint256_uint256: Int?; uint256_coins: Int?; - uint256_bool: Bool?; - uint256_cell: Cell?; - uint256_address: Address?; - uint256_struct: SomeStruct?; // Address Key Maps address_int: Int?; @@ -113,10 +85,6 @@ struct GetAllMapsResult { address_uint42: Int?; address_uint256: Int?; address_coins: Int?; - address_bool: Bool?; - address_cell: Cell?; - address_address: Address?; - address_struct: SomeStruct?; } struct ReplaceAllMapsResult { @@ -129,10 +97,6 @@ struct ReplaceAllMapsResult { int_uint42: Bool; int_uint256: Bool; int_coins: Bool; - int_bool: Bool; - int_cell: Bool; - int_address: Bool; - int_struct: Bool; int8_int: Bool; int8_int8: Bool; @@ -142,10 +106,6 @@ struct ReplaceAllMapsResult { int8_uint42: Bool; int8_uint256: Bool; int8_coins: Bool; - int8_bool: Bool; - int8_cell: Bool; - int8_address: Bool; - int8_struct: Bool; int42_int: Bool; int42_int8: Bool; @@ -155,10 +115,6 @@ struct ReplaceAllMapsResult { int42_uint42: Bool; int42_uint256: Bool; int42_coins: Bool; - int42_bool: Bool; - int42_cell: Bool; - int42_address: Bool; - int42_struct: Bool; int256_int: Bool; int256_int8: Bool; @@ -168,10 +124,6 @@ struct ReplaceAllMapsResult { int256_uint42: Bool; int256_uint256: Bool; int256_coins: Bool; - int256_bool: Bool; - int256_cell: Bool; - int256_address: Bool; - int256_struct: Bool; uint8_int: Bool; uint8_int8: Bool; @@ -181,10 +133,6 @@ struct ReplaceAllMapsResult { uint8_uint42: Bool; uint8_uint256: Bool; uint8_coins: Bool; - uint8_bool: Bool; - uint8_cell: Bool; - uint8_address: Bool; - uint8_struct: Bool; uint42_int: Bool; uint42_int8: Bool; @@ -194,10 +142,6 @@ struct ReplaceAllMapsResult { uint42_uint42: Bool; uint42_uint256: Bool; uint42_coins: Bool; - uint42_bool: Bool; - uint42_cell: Bool; - uint42_address: Bool; - uint42_struct: Bool; uint256_int: Bool; uint256_int8: Bool; @@ -207,10 +151,6 @@ struct ReplaceAllMapsResult { uint256_uint42: Bool; uint256_uint256: Bool; uint256_coins: Bool; - uint256_bool: Bool; - uint256_cell: Bool; - uint256_address: Bool; - uint256_struct: Bool; // Address Key Maps address_int: Bool; @@ -221,10 +161,6 @@ struct ReplaceAllMapsResult { address_uint42: Bool; address_uint256: Bool; address_coins: Bool; - address_bool: Bool; - address_cell: Bool; - address_address: Bool; - address_struct: Bool; } struct ReplaceGetAllMapsResult { @@ -237,10 +173,6 @@ struct ReplaceGetAllMapsResult { int_uint42: Int?; int_uint256: Int?; int_coins: Int?; - int_bool: Bool?; - int_cell: Cell?; - int_address: Address?; - int_struct: SomeStruct?; int8_int: Int?; int8_int8: Int?; @@ -250,10 +182,6 @@ struct ReplaceGetAllMapsResult { int8_uint42: Int?; int8_uint256: Int?; int8_coins: Int?; - int8_bool: Bool?; - int8_cell: Cell?; - int8_address: Address?; - int8_struct: SomeStruct?; int42_int: Int?; int42_int8: Int?; @@ -263,10 +191,6 @@ struct ReplaceGetAllMapsResult { int42_uint42: Int?; int42_uint256: Int?; int42_coins: Int?; - int42_bool: Bool?; - int42_cell: Cell?; - int42_address: Address?; - int42_struct: SomeStruct?; int256_int: Int?; int256_int8: Int?; @@ -276,10 +200,6 @@ struct ReplaceGetAllMapsResult { int256_uint42: Int?; int256_uint256: Int?; int256_coins: Int?; - int256_bool: Bool?; - int256_cell: Cell?; - int256_address: Address?; - int256_struct: SomeStruct?; uint8_int: Int?; uint8_int8: Int?; @@ -289,10 +209,6 @@ struct ReplaceGetAllMapsResult { uint8_uint42: Int?; uint8_uint256: Int?; uint8_coins: Int?; - uint8_bool: Bool?; - uint8_cell: Cell?; - uint8_address: Address?; - uint8_struct: SomeStruct?; uint42_int: Int?; uint42_int8: Int?; @@ -302,10 +218,6 @@ struct ReplaceGetAllMapsResult { uint42_uint42: Int?; uint42_uint256: Int?; uint42_coins: Int?; - uint42_bool: Bool?; - uint42_cell: Cell?; - uint42_address: Address?; - uint42_struct: SomeStruct?; uint256_int: Int?; uint256_int8: Int?; @@ -315,10 +227,6 @@ struct ReplaceGetAllMapsResult { uint256_uint42: Int?; uint256_uint256: Int?; uint256_coins: Int?; - uint256_bool: Bool?; - uint256_cell: Cell?; - uint256_address: Address?; - uint256_struct: SomeStruct?; // Address Key Maps address_int: Int?; @@ -329,10 +237,6 @@ struct ReplaceGetAllMapsResult { address_uint42: Int?; address_uint256: Int?; address_coins: Int?; - address_bool: Bool?; - address_cell: Cell?; - address_address: Address?; - address_struct: SomeStruct?; } struct ExistsAllMapsResult { @@ -345,10 +249,6 @@ struct ExistsAllMapsResult { int_uint42: Bool; int_uint256: Bool; int_coins: Bool; - int_bool: Bool; - int_cell: Bool; - int_address: Bool; - int_struct: Bool; int8_int: Bool; int8_int8: Bool; @@ -358,10 +258,6 @@ struct ExistsAllMapsResult { int8_uint42: Bool; int8_uint256: Bool; int8_coins: Bool; - int8_bool: Bool; - int8_cell: Bool; - int8_address: Bool; - int8_struct: Bool; int42_int: Bool; int42_int8: Bool; @@ -371,10 +267,6 @@ struct ExistsAllMapsResult { int42_uint42: Bool; int42_uint256: Bool; int42_coins: Bool; - int42_bool: Bool; - int42_cell: Bool; - int42_address: Bool; - int42_struct: Bool; int256_int: Bool; int256_int8: Bool; @@ -384,10 +276,6 @@ struct ExistsAllMapsResult { int256_uint42: Bool; int256_uint256: Bool; int256_coins: Bool; - int256_bool: Bool; - int256_cell: Bool; - int256_address: Bool; - int256_struct: Bool; uint8_int: Bool; uint8_int8: Bool; @@ -397,10 +285,6 @@ struct ExistsAllMapsResult { uint8_uint42: Bool; uint8_uint256: Bool; uint8_coins: Bool; - uint8_bool: Bool; - uint8_cell: Bool; - uint8_address: Bool; - uint8_struct: Bool; uint42_int: Bool; uint42_int8: Bool; @@ -410,10 +294,6 @@ struct ExistsAllMapsResult { uint42_uint42: Bool; uint42_uint256: Bool; uint42_coins: Bool; - uint42_bool: Bool; - uint42_cell: Bool; - uint42_address: Bool; - uint42_struct: Bool; uint256_int: Bool; uint256_int8: Bool; @@ -423,10 +303,6 @@ struct ExistsAllMapsResult { uint256_uint42: Bool; uint256_uint256: Bool; uint256_coins: Bool; - uint256_bool: Bool; - uint256_cell: Bool; - uint256_address: Bool; - uint256_struct: Bool; // Address Key Maps address_int: Bool; @@ -437,10 +313,6 @@ struct ExistsAllMapsResult { address_uint42: Bool; address_uint256: Bool; address_coins: Bool; - address_bool: Bool; - address_cell: Bool; - address_address: Bool; - address_struct: Bool; } struct IsEmptyAllMapsResult { @@ -453,10 +325,6 @@ struct IsEmptyAllMapsResult { int_uint42: Bool; int_uint256: Bool; int_coins: Bool; - int_bool: Bool; - int_cell: Bool; - int_address: Bool; - int_struct: Bool; int8_int: Bool; int8_int8: Bool; @@ -466,10 +334,6 @@ struct IsEmptyAllMapsResult { int8_uint42: Bool; int8_uint256: Bool; int8_coins: Bool; - int8_bool: Bool; - int8_cell: Bool; - int8_address: Bool; - int8_struct: Bool; int42_int: Bool; int42_int8: Bool; @@ -479,10 +343,6 @@ struct IsEmptyAllMapsResult { int42_uint42: Bool; int42_uint256: Bool; int42_coins: Bool; - int42_bool: Bool; - int42_cell: Bool; - int42_address: Bool; - int42_struct: Bool; int256_int: Bool; int256_int8: Bool; @@ -492,10 +352,6 @@ struct IsEmptyAllMapsResult { int256_uint42: Bool; int256_uint256: Bool; int256_coins: Bool; - int256_bool: Bool; - int256_cell: Bool; - int256_address: Bool; - int256_struct: Bool; uint8_int: Bool; uint8_int8: Bool; @@ -505,10 +361,6 @@ struct IsEmptyAllMapsResult { uint8_uint42: Bool; uint8_uint256: Bool; uint8_coins: Bool; - uint8_bool: Bool; - uint8_cell: Bool; - uint8_address: Bool; - uint8_struct: Bool; uint42_int: Bool; uint42_int8: Bool; @@ -518,10 +370,6 @@ struct IsEmptyAllMapsResult { uint42_uint42: Bool; uint42_uint256: Bool; uint42_coins: Bool; - uint42_bool: Bool; - uint42_cell: Bool; - uint42_address: Bool; - uint42_struct: Bool; uint256_int: Bool; uint256_int8: Bool; @@ -531,10 +379,6 @@ struct IsEmptyAllMapsResult { uint256_uint42: Bool; uint256_uint256: Bool; uint256_coins: Bool; - uint256_bool: Bool; - uint256_cell: Bool; - uint256_address: Bool; - uint256_struct: Bool; // Address Key Maps address_int: Bool; @@ -545,10 +389,6 @@ struct IsEmptyAllMapsResult { address_uint42: Bool; address_uint256: Bool; address_coins: Bool; - address_bool: Bool; - address_cell: Bool; - address_address: Bool; - address_struct: Bool; } struct AsCellAllMapsResult { @@ -561,10 +401,6 @@ struct AsCellAllMapsResult { int_uint42: Cell?; int_uint256: Cell?; int_coins: Cell?; - int_bool: Cell?; - int_cell: Cell?; - int_address: Cell?; - int_struct: Cell?; int8_int: Cell?; int8_int8: Cell?; @@ -574,10 +410,6 @@ struct AsCellAllMapsResult { int8_uint42: Cell?; int8_uint256: Cell?; int8_coins: Cell?; - int8_bool: Cell?; - int8_cell: Cell?; - int8_address: Cell?; - int8_struct: Cell?; int42_int: Cell?; int42_int8: Cell?; @@ -587,10 +419,6 @@ struct AsCellAllMapsResult { int42_uint42: Cell?; int42_uint256: Cell?; int42_coins: Cell?; - int42_bool: Cell?; - int42_cell: Cell?; - int42_address: Cell?; - int42_struct: Cell?; int256_int: Cell?; int256_int8: Cell?; @@ -600,10 +428,6 @@ struct AsCellAllMapsResult { int256_uint42: Cell?; int256_uint256: Cell?; int256_coins: Cell?; - int256_bool: Cell?; - int256_cell: Cell?; - int256_address: Cell?; - int256_struct: Cell?; uint8_int: Cell?; uint8_int8: Cell?; @@ -613,10 +437,6 @@ struct AsCellAllMapsResult { uint8_uint42: Cell?; uint8_uint256: Cell?; uint8_coins: Cell?; - uint8_bool: Cell?; - uint8_cell: Cell?; - uint8_address: Cell?; - uint8_struct: Cell?; uint42_int: Cell?; uint42_int8: Cell?; @@ -626,10 +446,6 @@ struct AsCellAllMapsResult { uint42_uint42: Cell?; uint42_uint256: Cell?; uint42_coins: Cell?; - uint42_bool: Cell?; - uint42_cell: Cell?; - uint42_address: Cell?; - uint42_struct: Cell?; uint256_int: Cell?; uint256_int8: Cell?; @@ -639,10 +455,6 @@ struct AsCellAllMapsResult { uint256_uint42: Cell?; uint256_uint256: Cell?; uint256_coins: Cell?; - uint256_bool: Cell?; - uint256_cell: Cell?; - uint256_address: Cell?; - uint256_struct: Cell?; // Address Key Maps address_int: Cell?; @@ -653,10 +465,6 @@ struct AsCellAllMapsResult { address_uint42: Cell?; address_uint256: Cell?; address_coins: Cell?; - address_bool: Cell?; - address_cell: Cell?; - address_address: Cell?; - address_struct: Cell?; } // =============================== @@ -683,10 +491,6 @@ message SetAllMaps { valueUint42: Int?; valueUint256: Int?; valueCoins: Int?; - valueBool: Bool?; - valueCell: Cell?; - valueAddress: Address?; - valueStruct: SomeStruct?; } message DelAllMaps { @@ -721,10 +525,6 @@ message ReplaceAllMaps { valueUint42: Int?; valueUint256: Int?; valueCoins: Int?; - valueBool: Bool?; - valueCell: Cell?; - valueAddress: Address?; - valueStruct: SomeStruct?; } message ReplaceGetAllMaps { @@ -747,10 +547,6 @@ message ReplaceGetAllMaps { valueUint42: Int?; valueUint256: Int?; valueCoins: Int?; - valueBool: Bool?; - valueCell: Cell?; - valueAddress: Address?; - valueStruct: SomeStruct?; } message CheckNullReference { @@ -776,10 +572,6 @@ contract MapTestContract { int_uint42: map; int_uint256: map; int_coins: map; - int_bool: map; - int_cell: map; - int_address: map; - int_struct: map; // =============================== // Integer (`Int as int8`) Key Maps @@ -793,10 +585,6 @@ contract MapTestContract { int8_uint42: map; int8_uint256: map; int8_coins: map; - int8_bool: map; - int8_cell: map; - int8_address: map; - int8_struct: map; // =============================== // Integer (`Int as int42`) Key Maps @@ -810,10 +598,6 @@ contract MapTestContract { int42_uint42: map; int42_uint256: map; int42_coins: map; - int42_bool: map; - int42_cell: map; - int42_address: map; - int42_struct: map; // =============================== // Integer (`Int as int256`) Key Maps @@ -827,10 +611,6 @@ contract MapTestContract { int256_uint42: map; int256_uint256: map; int256_coins: map; - int256_bool: map; - int256_cell: map; - int256_address: map; - int256_struct: map; // =============================== // Unsigned Integer (`Int as uint8`) Key Maps @@ -844,10 +624,6 @@ contract MapTestContract { uint8_uint42: map; uint8_uint256: map; uint8_coins: map; - uint8_bool: map; - uint8_cell: map; - uint8_address: map; - uint8_struct: map; // =============================== // Unsigned Integer (`Int as uint42`) Key Maps @@ -861,10 +637,6 @@ contract MapTestContract { uint42_uint42: map; uint42_uint256: map; uint42_coins: map; - uint42_bool: map; - uint42_cell: map; - uint42_address: map; - uint42_struct: map; // =============================== // Unsigned Integer (`Int as uint256`) Key Maps @@ -878,10 +650,6 @@ contract MapTestContract { uint256_uint42: map; uint256_uint256: map; uint256_coins: map; - uint256_bool: map; - uint256_cell: map; - uint256_address: map; - uint256_struct: map; // =============================== // Address Key Maps @@ -895,10 +663,6 @@ contract MapTestContract { address_uint42: map; address_uint256: map; address_coins: map; - address_bool: map; - address_cell: map; - address_address: map; - address_struct: map; // =============================== // Receivers For Operations @@ -914,10 +678,6 @@ contract MapTestContract { self.int_uint42.set(msg.keyInt, msg.valueUint42); self.int_uint256.set(msg.keyInt, msg.valueUint256); self.int_coins.set(msg.keyInt, msg.valueCoins); - self.int_bool.set(msg.keyInt, msg.valueBool); - self.int_cell.set(msg.keyInt, msg.valueCell); - self.int_address.set(msg.keyInt, msg.valueAddress); - self.int_struct.set(msg.keyInt, msg.valueStruct); self.int8_int.set(msg.keyInt8, msg.valueInt); self.int8_int8.set(msg.keyInt8, msg.valueInt8); @@ -927,10 +687,6 @@ contract MapTestContract { self.int8_uint42.set(msg.keyInt8, msg.valueUint42); self.int8_uint256.set(msg.keyInt8, msg.valueUint256); self.int8_coins.set(msg.keyInt8, msg.valueCoins); - self.int8_bool.set(msg.keyInt8, msg.valueBool); - self.int8_cell.set(msg.keyInt8, msg.valueCell); - self.int8_address.set(msg.keyInt8, msg.valueAddress); - self.int8_struct.set(msg.keyInt8, msg.valueStruct); self.int42_int.set(msg.keyInt42, msg.valueInt); self.int42_int8.set(msg.keyInt42, msg.valueInt8); @@ -940,10 +696,6 @@ contract MapTestContract { self.int42_uint42.set(msg.keyInt42, msg.valueUint42); self.int42_uint256.set(msg.keyInt42, msg.valueUint256); self.int42_coins.set(msg.keyInt42, msg.valueCoins); - self.int42_bool.set(msg.keyInt42, msg.valueBool); - self.int42_cell.set(msg.keyInt42, msg.valueCell); - self.int42_address.set(msg.keyInt42, msg.valueAddress); - self.int42_struct.set(msg.keyInt42, msg.valueStruct); self.int256_int.set(msg.keyInt256, msg.valueInt); self.int256_int8.set(msg.keyInt256, msg.valueInt8); @@ -953,10 +705,6 @@ contract MapTestContract { self.int256_uint42.set(msg.keyInt256, msg.valueUint42); self.int256_uint256.set(msg.keyInt256, msg.valueUint256); self.int256_coins.set(msg.keyInt256, msg.valueCoins); - self.int256_bool.set(msg.keyInt256, msg.valueBool); - self.int256_cell.set(msg.keyInt256, msg.valueCell); - self.int256_address.set(msg.keyInt256, msg.valueAddress); - self.int256_struct.set(msg.keyInt256, msg.valueStruct); self.uint8_int.set(msg.keyUint8, msg.valueInt); self.uint8_int8.set(msg.keyUint8, msg.valueInt8); @@ -966,10 +714,6 @@ contract MapTestContract { self.uint8_uint42.set(msg.keyUint8, msg.valueUint42); self.uint8_uint256.set(msg.keyUint8, msg.valueUint256); self.uint8_coins.set(msg.keyUint8, msg.valueCoins); - self.uint8_bool.set(msg.keyUint8, msg.valueBool); - self.uint8_cell.set(msg.keyUint8, msg.valueCell); - self.uint8_address.set(msg.keyUint8, msg.valueAddress); - self.uint8_struct.set(msg.keyUint8, msg.valueStruct); self.uint42_int.set(msg.keyUint42, msg.valueInt); self.uint42_int8.set(msg.keyUint42, msg.valueInt8); @@ -979,10 +723,6 @@ contract MapTestContract { self.uint42_uint42.set(msg.keyUint42, msg.valueUint42); self.uint42_uint256.set(msg.keyUint42, msg.valueUint256); self.uint42_coins.set(msg.keyUint42, msg.valueCoins); - self.uint42_bool.set(msg.keyUint42, msg.valueBool); - self.uint42_cell.set(msg.keyUint42, msg.valueCell); - self.uint42_address.set(msg.keyUint42, msg.valueAddress); - self.uint42_struct.set(msg.keyUint42, msg.valueStruct); self.uint256_int.set(msg.keyUint256, msg.valueInt); self.uint256_int8.set(msg.keyUint256, msg.valueInt8); @@ -992,10 +732,6 @@ contract MapTestContract { self.uint256_uint42.set(msg.keyUint256, msg.valueUint42); self.uint256_uint256.set(msg.keyUint256, msg.valueUint256); self.uint256_coins.set(msg.keyUint256, msg.valueCoins); - self.uint256_bool.set(msg.keyUint256, msg.valueBool); - self.uint256_cell.set(msg.keyUint256, msg.valueCell); - self.uint256_address.set(msg.keyUint256, msg.valueAddress); - self.uint256_struct.set(msg.keyUint256, msg.valueStruct); // Address Key Maps self.address_int.set(msg.keyAddress, msg.valueInt); @@ -1006,10 +742,6 @@ contract MapTestContract { self.address_uint42.set(msg.keyAddress, msg.valueUint42); self.address_uint256.set(msg.keyAddress, msg.valueUint256); self.address_coins.set(msg.keyAddress, msg.valueCoins); - self.address_bool.set(msg.keyAddress, msg.valueBool); - self.address_cell.set(msg.keyAddress, msg.valueCell); - self.address_address.set(msg.keyAddress, msg.valueAddress); - self.address_struct.set(msg.keyAddress, msg.valueStruct); } receive(msg: DelAllMaps) { @@ -1022,10 +754,6 @@ contract MapTestContract { self.int_uint42.del(msg.keyInt); self.int_uint256.del(msg.keyInt); self.int_coins.del(msg.keyInt); - self.int_bool.del(msg.keyInt); - self.int_cell.del(msg.keyInt); - self.int_address.del(msg.keyInt); - self.int_struct.del(msg.keyInt); self.int8_int.del(msg.keyInt8); self.int8_int8.del(msg.keyInt8); @@ -1035,10 +763,6 @@ contract MapTestContract { self.int8_uint42.del(msg.keyInt8); self.int8_uint256.del(msg.keyInt8); self.int8_coins.del(msg.keyInt8); - self.int8_bool.del(msg.keyInt8); - self.int8_cell.del(msg.keyInt8); - self.int8_address.del(msg.keyInt8); - self.int8_struct.del(msg.keyInt8); self.int42_int.del(msg.keyInt42); self.int42_int8.del(msg.keyInt42); @@ -1048,10 +772,6 @@ contract MapTestContract { self.int42_uint42.del(msg.keyInt42); self.int42_uint256.del(msg.keyInt42); self.int42_coins.del(msg.keyInt42); - self.int42_bool.del(msg.keyInt42); - self.int42_cell.del(msg.keyInt42); - self.int42_address.del(msg.keyInt42); - self.int42_struct.del(msg.keyInt42); self.int256_int.del(msg.keyInt256); self.int256_int8.del(msg.keyInt256); @@ -1061,10 +781,6 @@ contract MapTestContract { self.int256_uint42.del(msg.keyInt256); self.int256_uint256.del(msg.keyInt256); self.int256_coins.del(msg.keyInt256); - self.int256_bool.del(msg.keyInt256); - self.int256_cell.del(msg.keyInt256); - self.int256_address.del(msg.keyInt256); - self.int256_struct.del(msg.keyInt256); self.uint8_int.del(msg.keyUint8); self.uint8_int8.del(msg.keyUint8); @@ -1074,10 +790,6 @@ contract MapTestContract { self.uint8_uint42.del(msg.keyUint8); self.uint8_uint256.del(msg.keyUint8); self.uint8_coins.del(msg.keyUint8); - self.uint8_bool.del(msg.keyUint8); - self.uint8_cell.del(msg.keyUint8); - self.uint8_address.del(msg.keyUint8); - self.uint8_struct.del(msg.keyUint8); self.uint42_int.del(msg.keyUint42); self.uint42_int8.del(msg.keyUint42); @@ -1087,10 +799,6 @@ contract MapTestContract { self.uint42_uint42.del(msg.keyUint42); self.uint42_uint256.del(msg.keyUint42); self.uint42_coins.del(msg.keyUint42); - self.uint42_bool.del(msg.keyUint42); - self.uint42_cell.del(msg.keyUint42); - self.uint42_address.del(msg.keyUint42); - self.uint42_struct.del(msg.keyUint42); self.uint256_int.del(msg.keyUint256); self.uint256_int8.del(msg.keyUint256); @@ -1100,10 +808,6 @@ contract MapTestContract { self.uint256_uint42.del(msg.keyUint256); self.uint256_uint256.del(msg.keyUint256); self.uint256_coins.del(msg.keyUint256); - self.uint256_bool.del(msg.keyUint256); - self.uint256_cell.del(msg.keyUint256); - self.uint256_address.del(msg.keyUint256); - self.uint256_struct.del(msg.keyUint256); // Address Key Maps self.address_int.del(msg.keyAddress); @@ -1114,14 +818,10 @@ contract MapTestContract { self.address_uint42.del(msg.keyAddress); self.address_uint256.del(msg.keyAddress); self.address_coins.del(msg.keyAddress); - self.address_bool.del(msg.keyAddress); - self.address_cell.del(msg.keyAddress); - self.address_address.del(msg.keyAddress); - self.address_struct.del(msg.keyAddress); } receive(msg: ReplaceAllMaps) { - // Integer Key Maps + // Replace operations analogous to coins, now including varint16, varint32, varuint16, varuint32 self.int_int.replace(msg.keyInt, msg.valueInt); self.int_int8.replace(msg.keyInt, msg.valueInt8); self.int_int42.replace(msg.keyInt, msg.valueInt42); @@ -1130,10 +830,6 @@ contract MapTestContract { self.int_uint42.replace(msg.keyInt, msg.valueUint42); self.int_uint256.replace(msg.keyInt, msg.valueUint256); self.int_coins.replace(msg.keyInt, msg.valueCoins); - self.int_bool.replace(msg.keyInt, msg.valueBool); - self.int_cell.replace(msg.keyInt, msg.valueCell); - self.int_address.replace(msg.keyInt, msg.valueAddress); - self.int_struct.replace(msg.keyInt, msg.valueStruct); self.int8_int.replace(msg.keyInt8, msg.valueInt); self.int8_int8.replace(msg.keyInt8, msg.valueInt8); @@ -1143,10 +839,6 @@ contract MapTestContract { self.int8_uint42.replace(msg.keyInt8, msg.valueUint42); self.int8_uint256.replace(msg.keyInt8, msg.valueUint256); self.int8_coins.replace(msg.keyInt8, msg.valueCoins); - self.int8_bool.replace(msg.keyInt8, msg.valueBool); - self.int8_cell.replace(msg.keyInt8, msg.valueCell); - self.int8_address.replace(msg.keyInt8, msg.valueAddress); - self.int8_struct.replace(msg.keyInt8, msg.valueStruct); self.int42_int.replace(msg.keyInt42, msg.valueInt); self.int42_int8.replace(msg.keyInt42, msg.valueInt8); @@ -1156,10 +848,6 @@ contract MapTestContract { self.int42_uint42.replace(msg.keyInt42, msg.valueUint42); self.int42_uint256.replace(msg.keyInt42, msg.valueUint256); self.int42_coins.replace(msg.keyInt42, msg.valueCoins); - self.int42_bool.replace(msg.keyInt42, msg.valueBool); - self.int42_cell.replace(msg.keyInt42, msg.valueCell); - self.int42_address.replace(msg.keyInt42, msg.valueAddress); - self.int42_struct.replace(msg.keyInt42, msg.valueStruct); self.int256_int.replace(msg.keyInt256, msg.valueInt); self.int256_int8.replace(msg.keyInt256, msg.valueInt8); @@ -1169,10 +857,6 @@ contract MapTestContract { self.int256_uint42.replace(msg.keyInt256, msg.valueUint42); self.int256_uint256.replace(msg.keyInt256, msg.valueUint256); self.int256_coins.replace(msg.keyInt256, msg.valueCoins); - self.int256_bool.replace(msg.keyInt256, msg.valueBool); - self.int256_cell.replace(msg.keyInt256, msg.valueCell); - self.int256_address.replace(msg.keyInt256, msg.valueAddress); - self.int256_struct.replace(msg.keyInt256, msg.valueStruct); self.uint8_int.replace(msg.keyUint8, msg.valueInt); self.uint8_int8.replace(msg.keyUint8, msg.valueInt8); @@ -1182,10 +866,6 @@ contract MapTestContract { self.uint8_uint42.replace(msg.keyUint8, msg.valueUint42); self.uint8_uint256.replace(msg.keyUint8, msg.valueUint256); self.uint8_coins.replace(msg.keyUint8, msg.valueCoins); - self.uint8_bool.replace(msg.keyUint8, msg.valueBool); - self.uint8_cell.replace(msg.keyUint8, msg.valueCell); - self.uint8_address.replace(msg.keyUint8, msg.valueAddress); - self.uint8_struct.replace(msg.keyUint8, msg.valueStruct); self.uint42_int.replace(msg.keyUint42, msg.valueInt); self.uint42_int8.replace(msg.keyUint42, msg.valueInt8); @@ -1195,10 +875,6 @@ contract MapTestContract { self.uint42_uint42.replace(msg.keyUint42, msg.valueUint42); self.uint42_uint256.replace(msg.keyUint42, msg.valueUint256); self.uint42_coins.replace(msg.keyUint42, msg.valueCoins); - self.uint42_bool.replace(msg.keyUint42, msg.valueBool); - self.uint42_cell.replace(msg.keyUint42, msg.valueCell); - self.uint42_address.replace(msg.keyUint42, msg.valueAddress); - self.uint42_struct.replace(msg.keyUint42, msg.valueStruct); self.uint256_int.replace(msg.keyUint256, msg.valueInt); self.uint256_int8.replace(msg.keyUint256, msg.valueInt8); @@ -1208,10 +884,6 @@ contract MapTestContract { self.uint256_uint42.replace(msg.keyUint256, msg.valueUint42); self.uint256_uint256.replace(msg.keyUint256, msg.valueUint256); self.uint256_coins.replace(msg.keyUint256, msg.valueCoins); - self.uint256_bool.replace(msg.keyUint256, msg.valueBool); - self.uint256_cell.replace(msg.keyUint256, msg.valueCell); - self.uint256_address.replace(msg.keyUint256, msg.valueAddress); - self.uint256_struct.replace(msg.keyUint256, msg.valueStruct); // Address Key Maps self.address_int.replace(msg.keyAddress, msg.valueInt); @@ -1222,14 +894,10 @@ contract MapTestContract { self.address_uint42.replace(msg.keyAddress, msg.valueUint42); self.address_uint256.replace(msg.keyAddress, msg.valueUint256); self.address_coins.replace(msg.keyAddress, msg.valueCoins); - self.address_bool.replace(msg.keyAddress, msg.valueBool); - self.address_cell.replace(msg.keyAddress, msg.valueCell); - self.address_address.replace(msg.keyAddress, msg.valueAddress); - self.address_struct.replace(msg.keyAddress, msg.valueStruct); } receive(msg: ReplaceGetAllMaps) { - // Integer Key Maps + // Similar to above, but calling replaceGet self.int_int.replaceGet(msg.keyInt, msg.valueInt); self.int_int8.replaceGet(msg.keyInt, msg.valueInt8); self.int_int42.replaceGet(msg.keyInt, msg.valueInt42); @@ -1238,10 +906,6 @@ contract MapTestContract { self.int_uint42.replaceGet(msg.keyInt, msg.valueUint42); self.int_uint256.replaceGet(msg.keyInt, msg.valueUint256); self.int_coins.replaceGet(msg.keyInt, msg.valueCoins); - self.int_bool.replaceGet(msg.keyInt, msg.valueBool); - self.int_cell.replaceGet(msg.keyInt, msg.valueCell); - self.int_address.replaceGet(msg.keyInt, msg.valueAddress); - self.int_struct.replaceGet(msg.keyInt, msg.valueStruct); self.int8_int.replaceGet(msg.keyInt8, msg.valueInt); self.int8_int8.replaceGet(msg.keyInt8, msg.valueInt8); @@ -1251,10 +915,6 @@ contract MapTestContract { self.int8_uint42.replaceGet(msg.keyInt8, msg.valueUint42); self.int8_uint256.replaceGet(msg.keyInt8, msg.valueUint256); self.int8_coins.replaceGet(msg.keyInt8, msg.valueCoins); - self.int8_bool.replaceGet(msg.keyInt8, msg.valueBool); - self.int8_cell.replaceGet(msg.keyInt8, msg.valueCell); - self.int8_address.replaceGet(msg.keyInt8, msg.valueAddress); - self.int8_struct.replaceGet(msg.keyInt8, msg.valueStruct); self.int42_int.replaceGet(msg.keyInt42, msg.valueInt); self.int42_int8.replaceGet(msg.keyInt42, msg.valueInt8); @@ -1264,10 +924,6 @@ contract MapTestContract { self.int42_uint42.replaceGet(msg.keyInt42, msg.valueUint42); self.int42_uint256.replaceGet(msg.keyInt42, msg.valueUint256); self.int42_coins.replaceGet(msg.keyInt42, msg.valueCoins); - self.int42_bool.replaceGet(msg.keyInt42, msg.valueBool); - self.int42_cell.replaceGet(msg.keyInt42, msg.valueCell); - self.int42_address.replaceGet(msg.keyInt42, msg.valueAddress); - self.int42_struct.replaceGet(msg.keyInt42, msg.valueStruct); self.int256_int.replaceGet(msg.keyInt256, msg.valueInt); self.int256_int8.replaceGet(msg.keyInt256, msg.valueInt8); @@ -1277,10 +933,6 @@ contract MapTestContract { self.int256_uint42.replaceGet(msg.keyInt256, msg.valueUint42); self.int256_uint256.replaceGet(msg.keyInt256, msg.valueUint256); self.int256_coins.replaceGet(msg.keyInt256, msg.valueCoins); - self.int256_bool.replaceGet(msg.keyInt256, msg.valueBool); - self.int256_cell.replaceGet(msg.keyInt256, msg.valueCell); - self.int256_address.replaceGet(msg.keyInt256, msg.valueAddress); - self.int256_struct.replaceGet(msg.keyInt256, msg.valueStruct); self.uint8_int.replaceGet(msg.keyUint8, msg.valueInt); self.uint8_int8.replaceGet(msg.keyUint8, msg.valueInt8); @@ -1290,10 +942,6 @@ contract MapTestContract { self.uint8_uint42.replaceGet(msg.keyUint8, msg.valueUint42); self.uint8_uint256.replaceGet(msg.keyUint8, msg.valueUint256); self.uint8_coins.replaceGet(msg.keyUint8, msg.valueCoins); - self.uint8_bool.replaceGet(msg.keyUint8, msg.valueBool); - self.uint8_cell.replaceGet(msg.keyUint8, msg.valueCell); - self.uint8_address.replaceGet(msg.keyUint8, msg.valueAddress); - self.uint8_struct.replaceGet(msg.keyUint8, msg.valueStruct); self.uint42_int.replaceGet(msg.keyUint42, msg.valueInt); self.uint42_int8.replaceGet(msg.keyUint42, msg.valueInt8); @@ -1303,10 +951,6 @@ contract MapTestContract { self.uint42_uint42.replaceGet(msg.keyUint42, msg.valueUint42); self.uint42_uint256.replaceGet(msg.keyUint42, msg.valueUint256); self.uint42_coins.replaceGet(msg.keyUint42, msg.valueCoins); - self.uint42_bool.replaceGet(msg.keyUint42, msg.valueBool); - self.uint42_cell.replaceGet(msg.keyUint42, msg.valueCell); - self.uint42_address.replaceGet(msg.keyUint42, msg.valueAddress); - self.uint42_struct.replaceGet(msg.keyUint42, msg.valueStruct); self.uint256_int.replaceGet(msg.keyUint256, msg.valueInt); self.uint256_int8.replaceGet(msg.keyUint256, msg.valueInt8); @@ -1316,10 +960,6 @@ contract MapTestContract { self.uint256_uint42.replaceGet(msg.keyUint256, msg.valueUint42); self.uint256_uint256.replaceGet(msg.keyUint256, msg.valueUint256); self.uint256_coins.replaceGet(msg.keyUint256, msg.valueCoins); - self.uint256_bool.replaceGet(msg.keyUint256, msg.valueBool); - self.uint256_cell.replaceGet(msg.keyUint256, msg.valueCell); - self.uint256_address.replaceGet(msg.keyUint256, msg.valueAddress); - self.uint256_struct.replaceGet(msg.keyUint256, msg.valueStruct); // Address Key Maps self.address_int.replaceGet(msg.keyAddress, msg.valueInt); @@ -1330,10 +970,6 @@ contract MapTestContract { self.address_uint42.replaceGet(msg.keyAddress, msg.valueUint42); self.address_uint256.replaceGet(msg.keyAddress, msg.valueUint256); self.address_coins.replaceGet(msg.keyAddress, msg.valueCoins); - self.address_bool.replaceGet(msg.keyAddress, msg.valueBool); - self.address_cell.replaceGet(msg.keyAddress, msg.valueCell); - self.address_address.replaceGet(msg.keyAddress, msg.valueAddress); - self.address_struct.replaceGet(msg.keyAddress, msg.valueStruct); } // =============================== @@ -1364,10 +1000,6 @@ contract MapTestContract { int_uint42: self.int_uint42.get(keyInt), int_uint256: self.int_uint256.get(keyInt), int_coins: self.int_coins.get(keyInt), - int_bool: self.int_bool.get(keyInt), - int_cell: self.int_cell.get(keyInt), - int_address: self.int_address.get(keyInt), - int_struct: self.int_struct.get(keyInt), int8_int: self.int8_int.get(keyInt8), int8_int8: self.int8_int8.get(keyInt8), @@ -1377,10 +1009,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.get(keyInt8), int8_uint256: self.int8_uint256.get(keyInt8), int8_coins: self.int8_coins.get(keyInt8), - int8_bool: self.int8_bool.get(keyInt8), - int8_cell: self.int8_cell.get(keyInt8), - int8_address: self.int8_address.get(keyInt8), - int8_struct: self.int8_struct.get(keyInt8), int42_int: self.int42_int.get(keyInt42), int42_int8: self.int42_int8.get(keyInt42), @@ -1390,10 +1018,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.get(keyInt42), int42_uint256: self.int42_uint256.get(keyInt42), int42_coins: self.int42_coins.get(keyInt42), - int42_bool: self.int42_bool.get(keyInt42), - int42_cell: self.int42_cell.get(keyInt42), - int42_address: self.int42_address.get(keyInt42), - int42_struct: self.int42_struct.get(keyInt42), int256_int: self.int256_int.get(keyInt256), int256_int8: self.int256_int8.get(keyInt256), @@ -1403,10 +1027,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.get(keyInt256), int256_uint256: self.int256_uint256.get(keyInt256), int256_coins: self.int256_coins.get(keyInt256), - int256_bool: self.int256_bool.get(keyInt256), - int256_cell: self.int256_cell.get(keyInt256), - int256_address: self.int256_address.get(keyInt256), - int256_struct: self.int256_struct.get(keyInt256), uint8_int: self.uint8_int.get(keyUint8), uint8_int8: self.uint8_int8.get(keyUint8), @@ -1416,10 +1036,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.get(keyUint8), uint8_uint256: self.uint8_uint256.get(keyUint8), uint8_coins: self.uint8_coins.get(keyUint8), - uint8_bool: self.uint8_bool.get(keyUint8), - uint8_cell: self.uint8_cell.get(keyUint8), - uint8_address: self.uint8_address.get(keyUint8), - uint8_struct: self.uint8_struct.get(keyUint8), uint42_int: self.uint42_int.get(keyUint42), uint42_int8: self.uint42_int8.get(keyUint42), @@ -1429,10 +1045,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.get(keyUint42), uint42_uint256: self.uint42_uint256.get(keyUint42), uint42_coins: self.uint42_coins.get(keyUint42), - uint42_bool: self.uint42_bool.get(keyUint42), - uint42_cell: self.uint42_cell.get(keyUint42), - uint42_address: self.uint42_address.get(keyUint42), - uint42_struct: self.uint42_struct.get(keyUint42), uint256_int: self.uint256_int.get(keyUint256), uint256_int8: self.uint256_int8.get(keyUint256), @@ -1442,10 +1054,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.get(keyUint256), uint256_uint256: self.uint256_uint256.get(keyUint256), uint256_coins: self.uint256_coins.get(keyUint256), - uint256_bool: self.uint256_bool.get(keyUint256), - uint256_cell: self.uint256_cell.get(keyUint256), - uint256_address: self.uint256_address.get(keyUint256), - uint256_struct: self.uint256_struct.get(keyUint256), // Address Key Maps address_int: self.address_int.get(keyAddress), @@ -1456,10 +1064,6 @@ contract MapTestContract { address_uint42: self.address_uint42.get(keyAddress), address_uint256: self.address_uint256.get(keyAddress), address_coins: self.address_coins.get(keyAddress), - address_bool: self.address_bool.get(keyAddress), - address_cell: self.address_cell.get(keyAddress), - address_address: self.address_address.get(keyAddress), - address_struct: self.address_struct.get(keyAddress) }; } @@ -1480,10 +1084,6 @@ contract MapTestContract { valueUint42: Int, valueUint256: Int, valueCoins: Int, - valueBool: Bool, - valueCell: Cell, - valueAddress: Address, - valueStruct: SomeStruct ): ReplaceAllMapsResult { return ReplaceAllMapsResult { // Integer Key Maps @@ -1495,10 +1095,6 @@ contract MapTestContract { int_uint42: self.int_uint42.replace(keyInt, valueUint42), int_uint256: self.int_uint256.replace(keyInt, valueUint256), int_coins: self.int_coins.replace(keyInt, valueCoins), - int_bool: self.int_bool.replace(keyInt, valueBool), - int_cell: self.int_cell.replace(keyInt, valueCell), - int_address: self.int_address.replace(keyInt, valueAddress), - int_struct: self.int_struct.replace(keyInt, valueStruct), int8_int: self.int8_int.replace(keyInt8, valueInt), int8_int8: self.int8_int8.replace(keyInt8, valueInt8), @@ -1508,10 +1104,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.replace(keyInt8, valueUint42), int8_uint256: self.int8_uint256.replace(keyInt8, valueUint256), int8_coins: self.int8_coins.replace(keyInt8, valueCoins), - int8_bool: self.int8_bool.replace(keyInt8, valueBool), - int8_cell: self.int8_cell.replace(keyInt8, valueCell), - int8_address: self.int8_address.replace(keyInt8, valueAddress), - int8_struct: self.int8_struct.replace(keyInt8, valueStruct), int42_int: self.int42_int.replace(keyInt42, valueInt), int42_int8: self.int42_int8.replace(keyInt42, valueInt8), @@ -1521,10 +1113,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.replace(keyInt42, valueUint42), int42_uint256: self.int42_uint256.replace(keyInt42, valueUint256), int42_coins: self.int42_coins.replace(keyInt42, valueCoins), - int42_bool: self.int42_bool.replace(keyInt42, valueBool), - int42_cell: self.int42_cell.replace(keyInt42, valueCell), - int42_address: self.int42_address.replace(keyInt42, valueAddress), - int42_struct: self.int42_struct.replace(keyInt42, valueStruct), int256_int: self.int256_int.replace(keyInt256, valueInt), int256_int8: self.int256_int8.replace(keyInt256, valueInt8), @@ -1534,10 +1122,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.replace(keyInt256, valueUint42), int256_uint256: self.int256_uint256.replace(keyInt256, valueUint256), int256_coins: self.int256_coins.replace(keyInt256, valueCoins), - int256_bool: self.int256_bool.replace(keyInt256, valueBool), - int256_cell: self.int256_cell.replace(keyInt256, valueCell), - int256_address: self.int256_address.replace(keyInt256, valueAddress), - int256_struct: self.int256_struct.replace(keyInt256, valueStruct), uint8_int: self.uint8_int.replace(keyUint8, valueInt), uint8_int8: self.uint8_int8.replace(keyUint8, valueInt8), @@ -1547,10 +1131,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.replace(keyUint8, valueUint42), uint8_uint256: self.uint8_uint256.replace(keyUint8, valueUint256), uint8_coins: self.uint8_coins.replace(keyUint8, valueCoins), - uint8_bool: self.uint8_bool.replace(keyUint8, valueBool), - uint8_cell: self.uint8_cell.replace(keyUint8, valueCell), - uint8_address: self.uint8_address.replace(keyUint8, valueAddress), - uint8_struct: self.uint8_struct.replace(keyUint8, valueStruct), uint42_int: self.uint42_int.replace(keyUint42, valueInt), uint42_int8: self.uint42_int8.replace(keyUint42, valueInt8), @@ -1560,10 +1140,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.replace(keyUint42, valueUint42), uint42_uint256: self.uint42_uint256.replace(keyUint42, valueUint256), uint42_coins: self.uint42_coins.replace(keyUint42, valueCoins), - uint42_bool: self.uint42_bool.replace(keyUint42, valueBool), - uint42_cell: self.uint42_cell.replace(keyUint42, valueCell), - uint42_address: self.uint42_address.replace(keyUint42, valueAddress), - uint42_struct: self.uint42_struct.replace(keyUint42, valueStruct), uint256_int: self.uint256_int.replace(keyUint256, valueInt), uint256_int8: self.uint256_int8.replace(keyUint256, valueInt8), @@ -1573,10 +1149,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.replace(keyUint256, valueUint42), uint256_uint256: self.uint256_uint256.replace(keyUint256, valueUint256), uint256_coins: self.uint256_coins.replace(keyUint256, valueCoins), - uint256_bool: self.uint256_bool.replace(keyUint256, valueBool), - uint256_cell: self.uint256_cell.replace(keyUint256, valueCell), - uint256_address: self.uint256_address.replace(keyUint256, valueAddress), - uint256_struct: self.uint256_struct.replace(keyUint256, valueStruct), // Address Key Maps address_int: self.address_int.replace(keyAddress, valueInt), @@ -1587,10 +1159,6 @@ contract MapTestContract { address_uint42: self.address_uint42.replace(keyAddress, valueUint42), address_uint256: self.address_uint256.replace(keyAddress, valueUint256), address_coins: self.address_coins.replace(keyAddress, valueCoins), - address_bool: self.address_bool.replace(keyAddress, valueBool), - address_cell: self.address_cell.replace(keyAddress, valueCell), - address_address: self.address_address.replace(keyAddress, valueAddress), - address_struct: self.address_struct.replace(keyAddress, valueStruct) }; } @@ -1611,10 +1179,6 @@ contract MapTestContract { valueUint42: Int, valueUint256: Int, valueCoins: Int, - valueBool: Bool, - valueCell: Cell, - valueAddress: Address, - valueStruct: SomeStruct ): ReplaceGetAllMapsResult { return ReplaceGetAllMapsResult { // Integer Key Maps @@ -1626,10 +1190,6 @@ contract MapTestContract { int_uint42: self.int_uint42.replaceGet(keyInt, valueUint42), int_uint256: self.int_uint256.replaceGet(keyInt, valueUint256), int_coins: self.int_coins.replaceGet(keyInt, valueCoins), - int_bool: self.int_bool.replaceGet(keyInt, valueBool), - int_cell: self.int_cell.replaceGet(keyInt, valueCell), - int_address: self.int_address.replaceGet(keyInt, valueAddress), - int_struct: self.int_struct.replaceGet(keyInt, valueStruct), int8_int: self.int8_int.replaceGet(keyInt8, valueInt), int8_int8: self.int8_int8.replaceGet(keyInt8, valueInt8), @@ -1639,10 +1199,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.replaceGet(keyInt8, valueUint42), int8_uint256: self.int8_uint256.replaceGet(keyInt8, valueUint256), int8_coins: self.int8_coins.replaceGet(keyInt8, valueCoins), - int8_bool: self.int8_bool.replaceGet(keyInt8, valueBool), - int8_cell: self.int8_cell.replaceGet(keyInt8, valueCell), - int8_address: self.int8_address.replaceGet(keyInt8, valueAddress), - int8_struct: self.int8_struct.replaceGet(keyInt8, valueStruct), int42_int: self.int42_int.replaceGet(keyInt42, valueInt), int42_int8: self.int42_int8.replaceGet(keyInt42, valueInt8), @@ -1652,10 +1208,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.replaceGet(keyInt42, valueUint42), int42_uint256: self.int42_uint256.replaceGet(keyInt42, valueUint256), int42_coins: self.int42_coins.replaceGet(keyInt42, valueCoins), - int42_bool: self.int42_bool.replaceGet(keyInt42, valueBool), - int42_cell: self.int42_cell.replaceGet(keyInt42, valueCell), - int42_address: self.int42_address.replaceGet(keyInt42, valueAddress), - int42_struct: self.int42_struct.replaceGet(keyInt42, valueStruct), int256_int: self.int256_int.replaceGet(keyInt256, valueInt), int256_int8: self.int256_int8.replaceGet(keyInt256, valueInt8), @@ -1665,10 +1217,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.replaceGet(keyInt256, valueUint42), int256_uint256: self.int256_uint256.replaceGet(keyInt256, valueUint256), int256_coins: self.int256_coins.replaceGet(keyInt256, valueCoins), - int256_bool: self.int256_bool.replaceGet(keyInt256, valueBool), - int256_cell: self.int256_cell.replaceGet(keyInt256, valueCell), - int256_address: self.int256_address.replaceGet(keyInt256, valueAddress), - int256_struct: self.int256_struct.replaceGet(keyInt256, valueStruct), uint8_int: self.uint8_int.replaceGet(keyUint8, valueInt), uint8_int8: self.uint8_int8.replaceGet(keyUint8, valueInt8), @@ -1678,10 +1226,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.replaceGet(keyUint8, valueUint42), uint8_uint256: self.uint8_uint256.replaceGet(keyUint8, valueUint256), uint8_coins: self.uint8_coins.replaceGet(keyUint8, valueCoins), - uint8_bool: self.uint8_bool.replaceGet(keyUint8, valueBool), - uint8_cell: self.uint8_cell.replaceGet(keyUint8, valueCell), - uint8_address: self.uint8_address.replaceGet(keyUint8, valueAddress), - uint8_struct: self.uint8_struct.replaceGet(keyUint8, valueStruct), uint42_int: self.uint42_int.replaceGet(keyUint42, valueInt), uint42_int8: self.uint42_int8.replaceGet(keyUint42, valueInt8), @@ -1691,10 +1235,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.replaceGet(keyUint42, valueUint42), uint42_uint256: self.uint42_uint256.replaceGet(keyUint42, valueUint256), uint42_coins: self.uint42_coins.replaceGet(keyUint42, valueCoins), - uint42_bool: self.uint42_bool.replaceGet(keyUint42, valueBool), - uint42_cell: self.uint42_cell.replaceGet(keyUint42, valueCell), - uint42_address: self.uint42_address.replaceGet(keyUint42, valueAddress), - uint42_struct: self.uint42_struct.replaceGet(keyUint42, valueStruct), uint256_int: self.uint256_int.replaceGet(keyUint256, valueInt), uint256_int8: self.uint256_int8.replaceGet(keyUint256, valueInt8), @@ -1704,10 +1244,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.replaceGet(keyUint256, valueUint42), uint256_uint256: self.uint256_uint256.replaceGet(keyUint256, valueUint256), uint256_coins: self.uint256_coins.replaceGet(keyUint256, valueCoins), - uint256_bool: self.uint256_bool.replaceGet(keyUint256, valueBool), - uint256_cell: self.uint256_cell.replaceGet(keyUint256, valueCell), - uint256_address: self.uint256_address.replaceGet(keyUint256, valueAddress), - uint256_struct: self.uint256_struct.replaceGet(keyUint256, valueStruct), // Address Key Maps address_int: self.address_int.replaceGet(keyAddress, valueInt), @@ -1718,10 +1254,6 @@ contract MapTestContract { address_uint42: self.address_uint42.replaceGet(keyAddress, valueUint42), address_uint256: self.address_uint256.replaceGet(keyAddress, valueUint256), address_coins: self.address_coins.replaceGet(keyAddress, valueCoins), - address_bool: self.address_bool.replaceGet(keyAddress, valueBool), - address_cell: self.address_cell.replaceGet(keyAddress, valueCell), - address_address: self.address_address.replaceGet(keyAddress, valueAddress), - address_struct: self.address_struct.replaceGet(keyAddress, valueStruct) }; } @@ -1745,10 +1277,6 @@ contract MapTestContract { int_uint42: self.int_uint42.exists(keyInt), int_uint256: self.int_uint256.exists(keyInt), int_coins: self.int_coins.exists(keyInt), - int_bool: self.int_bool.exists(keyInt), - int_cell: self.int_cell.exists(keyInt), - int_address: self.int_address.exists(keyInt), - int_struct: self.int_struct.exists(keyInt), int8_int: self.int8_int.exists(keyInt8), int8_int8: self.int8_int8.exists(keyInt8), @@ -1758,10 +1286,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.exists(keyInt8), int8_uint256: self.int8_uint256.exists(keyInt8), int8_coins: self.int8_coins.exists(keyInt8), - int8_bool: self.int8_bool.exists(keyInt8), - int8_cell: self.int8_cell.exists(keyInt8), - int8_address: self.int8_address.exists(keyInt8), - int8_struct: self.int8_struct.exists(keyInt8), int42_int: self.int42_int.exists(keyInt42), int42_int8: self.int42_int8.exists(keyInt42), @@ -1771,10 +1295,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.exists(keyInt42), int42_uint256: self.int42_uint256.exists(keyInt42), int42_coins: self.int42_coins.exists(keyInt42), - int42_bool: self.int42_bool.exists(keyInt42), - int42_cell: self.int42_cell.exists(keyInt42), - int42_address: self.int42_address.exists(keyInt42), - int42_struct: self.int42_struct.exists(keyInt42), int256_int: self.int256_int.exists(keyInt256), int256_int8: self.int256_int8.exists(keyInt256), @@ -1784,10 +1304,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.exists(keyInt256), int256_uint256: self.int256_uint256.exists(keyInt256), int256_coins: self.int256_coins.exists(keyInt256), - int256_bool: self.int256_bool.exists(keyInt256), - int256_cell: self.int256_cell.exists(keyInt256), - int256_address: self.int256_address.exists(keyInt256), - int256_struct: self.int256_struct.exists(keyInt256), uint8_int: self.uint8_int.exists(keyUint8), uint8_int8: self.uint8_int8.exists(keyUint8), @@ -1797,10 +1313,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.exists(keyUint8), uint8_uint256: self.uint8_uint256.exists(keyUint8), uint8_coins: self.uint8_coins.exists(keyUint8), - uint8_bool: self.uint8_bool.exists(keyUint8), - uint8_cell: self.uint8_cell.exists(keyUint8), - uint8_address: self.uint8_address.exists(keyUint8), - uint8_struct: self.uint8_struct.exists(keyUint8), uint42_int: self.uint42_int.exists(keyUint42), uint42_int8: self.uint42_int8.exists(keyUint42), @@ -1810,10 +1322,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.exists(keyUint42), uint42_uint256: self.uint42_uint256.exists(keyUint42), uint42_coins: self.uint42_coins.exists(keyUint42), - uint42_bool: self.uint42_bool.exists(keyUint42), - uint42_cell: self.uint42_cell.exists(keyUint42), - uint42_address: self.uint42_address.exists(keyUint42), - uint42_struct: self.uint42_struct.exists(keyUint42), uint256_int: self.uint256_int.exists(keyUint256), uint256_int8: self.uint256_int8.exists(keyUint256), @@ -1823,10 +1331,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.exists(keyUint256), uint256_uint256: self.uint256_uint256.exists(keyUint256), uint256_coins: self.uint256_coins.exists(keyUint256), - uint256_bool: self.uint256_bool.exists(keyUint256), - uint256_cell: self.uint256_cell.exists(keyUint256), - uint256_address: self.uint256_address.exists(keyUint256), - uint256_struct: self.uint256_struct.exists(keyUint256), // Address Key Maps address_int: self.address_int.exists(keyAddress), @@ -1837,10 +1341,6 @@ contract MapTestContract { address_uint42: self.address_uint42.exists(keyAddress), address_uint256: self.address_uint256.exists(keyAddress), address_coins: self.address_coins.exists(keyAddress), - address_bool: self.address_bool.exists(keyAddress), - address_cell: self.address_cell.exists(keyAddress), - address_address: self.address_address.exists(keyAddress), - address_struct: self.address_struct.exists(keyAddress) }; } @@ -1855,10 +1355,6 @@ contract MapTestContract { int_uint42: self.int_uint42.isEmpty(), int_uint256: self.int_uint256.isEmpty(), int_coins: self.int_coins.isEmpty(), - int_bool: self.int_bool.isEmpty(), - int_cell: self.int_cell.isEmpty(), - int_address: self.int_address.isEmpty(), - int_struct: self.int_struct.isEmpty(), int8_int: self.int8_int.isEmpty(), int8_int8: self.int8_int8.isEmpty(), @@ -1868,10 +1364,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.isEmpty(), int8_uint256: self.int8_uint256.isEmpty(), int8_coins: self.int8_coins.isEmpty(), - int8_bool: self.int8_bool.isEmpty(), - int8_cell: self.int8_cell.isEmpty(), - int8_address: self.int8_address.isEmpty(), - int8_struct: self.int8_struct.isEmpty(), int42_int: self.int42_int.isEmpty(), int42_int8: self.int42_int8.isEmpty(), @@ -1881,10 +1373,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.isEmpty(), int42_uint256: self.int42_uint256.isEmpty(), int42_coins: self.int42_coins.isEmpty(), - int42_bool: self.int42_bool.isEmpty(), - int42_cell: self.int42_cell.isEmpty(), - int42_address: self.int42_address.isEmpty(), - int42_struct: self.int42_struct.isEmpty(), int256_int: self.int256_int.isEmpty(), int256_int8: self.int256_int8.isEmpty(), @@ -1894,10 +1382,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.isEmpty(), int256_uint256: self.int256_uint256.isEmpty(), int256_coins: self.int256_coins.isEmpty(), - int256_bool: self.int256_bool.isEmpty(), - int256_cell: self.int256_cell.isEmpty(), - int256_address: self.int256_address.isEmpty(), - int256_struct: self.int256_struct.isEmpty(), uint8_int: self.uint8_int.isEmpty(), uint8_int8: self.uint8_int8.isEmpty(), @@ -1907,10 +1391,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.isEmpty(), uint8_uint256: self.uint8_uint256.isEmpty(), uint8_coins: self.uint8_coins.isEmpty(), - uint8_bool: self.uint8_bool.isEmpty(), - uint8_cell: self.uint8_cell.isEmpty(), - uint8_address: self.uint8_address.isEmpty(), - uint8_struct: self.uint8_struct.isEmpty(), uint42_int: self.uint42_int.isEmpty(), uint42_int8: self.uint42_int8.isEmpty(), @@ -1920,10 +1400,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.isEmpty(), uint42_uint256: self.uint42_uint256.isEmpty(), uint42_coins: self.uint42_coins.isEmpty(), - uint42_bool: self.uint42_bool.isEmpty(), - uint42_cell: self.uint42_cell.isEmpty(), - uint42_address: self.uint42_address.isEmpty(), - uint42_struct: self.uint42_struct.isEmpty(), uint256_int: self.uint256_int.isEmpty(), uint256_int8: self.uint256_int8.isEmpty(), @@ -1933,10 +1409,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.isEmpty(), uint256_uint256: self.uint256_uint256.isEmpty(), uint256_coins: self.uint256_coins.isEmpty(), - uint256_bool: self.uint256_bool.isEmpty(), - uint256_cell: self.uint256_cell.isEmpty(), - uint256_address: self.uint256_address.isEmpty(), - uint256_struct: self.uint256_struct.isEmpty(), // Address Key Maps address_int: self.address_int.isEmpty(), @@ -1947,10 +1419,6 @@ contract MapTestContract { address_uint42: self.address_uint42.isEmpty(), address_uint256: self.address_uint256.isEmpty(), address_coins: self.address_coins.isEmpty(), - address_bool: self.address_bool.isEmpty(), - address_cell: self.address_cell.isEmpty(), - address_address: self.address_address.isEmpty(), - address_struct: self.address_struct.isEmpty() }; } @@ -1965,10 +1433,6 @@ contract MapTestContract { int_uint42: self.int_uint42.asCell(), int_uint256: self.int_uint256.asCell(), int_coins: self.int_coins.asCell(), - int_bool: self.int_bool.asCell(), - int_cell: self.int_cell.asCell(), - int_address: self.int_address.asCell(), - int_struct: self.int_struct.asCell(), int8_int: self.int8_int.asCell(), int8_int8: self.int8_int8.asCell(), @@ -1978,10 +1442,6 @@ contract MapTestContract { int8_uint42: self.int8_uint42.asCell(), int8_uint256: self.int8_uint256.asCell(), int8_coins: self.int8_coins.asCell(), - int8_bool: self.int8_bool.asCell(), - int8_cell: self.int8_cell.asCell(), - int8_address: self.int8_address.asCell(), - int8_struct: self.int8_struct.asCell(), int42_int: self.int42_int.asCell(), int42_int8: self.int42_int8.asCell(), @@ -1991,10 +1451,6 @@ contract MapTestContract { int42_uint42: self.int42_uint42.asCell(), int42_uint256: self.int42_uint256.asCell(), int42_coins: self.int42_coins.asCell(), - int42_bool: self.int42_bool.asCell(), - int42_cell: self.int42_cell.asCell(), - int42_address: self.int42_address.asCell(), - int42_struct: self.int42_struct.asCell(), int256_int: self.int256_int.asCell(), int256_int8: self.int256_int8.asCell(), @@ -2004,10 +1460,6 @@ contract MapTestContract { int256_uint42: self.int256_uint42.asCell(), int256_uint256: self.int256_uint256.asCell(), int256_coins: self.int256_coins.asCell(), - int256_bool: self.int256_bool.asCell(), - int256_cell: self.int256_cell.asCell(), - int256_address: self.int256_address.asCell(), - int256_struct: self.int256_struct.asCell(), uint8_int: self.uint8_int.asCell(), uint8_int8: self.uint8_int8.asCell(), @@ -2017,10 +1469,6 @@ contract MapTestContract { uint8_uint42: self.uint8_uint42.asCell(), uint8_uint256: self.uint8_uint256.asCell(), uint8_coins: self.uint8_coins.asCell(), - uint8_bool: self.uint8_bool.asCell(), - uint8_cell: self.uint8_cell.asCell(), - uint8_address: self.uint8_address.asCell(), - uint8_struct: self.uint8_struct.asCell(), uint42_int: self.uint42_int.asCell(), uint42_int8: self.uint42_int8.asCell(), @@ -2030,10 +1478,6 @@ contract MapTestContract { uint42_uint42: self.uint42_uint42.asCell(), uint42_uint256: self.uint42_uint256.asCell(), uint42_coins: self.uint42_coins.asCell(), - uint42_bool: self.uint42_bool.asCell(), - uint42_cell: self.uint42_cell.asCell(), - uint42_address: self.uint42_address.asCell(), - uint42_struct: self.uint42_struct.asCell(), uint256_int: self.uint256_int.asCell(), uint256_int8: self.uint256_int8.asCell(), @@ -2043,10 +1487,6 @@ contract MapTestContract { uint256_uint42: self.uint256_uint42.asCell(), uint256_uint256: self.uint256_uint256.asCell(), uint256_coins: self.uint256_coins.asCell(), - uint256_bool: self.uint256_bool.asCell(), - uint256_cell: self.uint256_cell.asCell(), - uint256_address: self.uint256_address.asCell(), - uint256_struct: self.uint256_struct.asCell(), // Address Key Maps address_int: self.address_int.asCell(), @@ -2057,10 +1497,6 @@ contract MapTestContract { address_uint42: self.address_uint42.asCell(), address_uint256: self.address_uint256.asCell(), address_coins: self.address_coins.asCell(), - address_bool: self.address_bool.asCell(), - address_cell: self.address_cell.asCell(), - address_address: self.address_address.asCell(), - address_struct: self.address_struct.asCell() }; } diff --git a/src/test/e2e-emulated/contracts/structs.tact b/src/test/e2e-emulated/contracts/structs.tact index af10237e5..75f538ff6 100644 --- a/src/test/e2e-emulated/contracts/structs.tact +++ b/src/test/e2e-emulated/contracts/structs.tact @@ -35,6 +35,13 @@ struct Coin { second: Int as uint32; } +struct VarIntegers { + a: Int as varint16; + b: Int as varint32; + c: Int as varuint16; + d: Int as varuint32; +} + struct IntFields { i1: Int as int1; i2: Int as int2; @@ -57,6 +64,10 @@ fun directParse(payload: Cell): Coin { return Coin.fromCell(payload); } +fun directParseVarIntegers(payload: Cell): VarIntegers { + return VarIntegers.fromCell(payload); +} + struct LongStruct15 { x1: Int; x2: Int; @@ -484,6 +495,21 @@ contract StructsTester { dump(coin.second); } + receive("exampleVarIntegers") { + let varInts = directParseVarIntegers( + beginCell() + .storeVarInt16(1) + .storeVarInt32(2) + .storeVarUint16(3) + .storeVarUint32(4) + .endCell() + ); + dump(varInts.a); + dump(varInts.b); + dump(varInts.c); + dump(varInts.d); + } + get fun longStruct15Test(): LongStruct15 { let s = LongStruct15 { x1: 1, diff --git a/src/test/e2e-emulated/map-traverse.spec.ts b/src/test/e2e-emulated/map-traverse.spec.ts index 14e139ad3..a2338dba8 100644 --- a/src/test/e2e-emulated/map-traverse.spec.ts +++ b/src/test/e2e-emulated/map-traverse.spec.ts @@ -34,12 +34,16 @@ describe("map-traversal", () => { it("should implement map traversal correctly", async () => { // Check methods expect(await contract.getTestIntInt()).toEqual(1010n); + expect(await contract.getTestIntCoins()).toEqual(1010n); + expect(await contract.getTestIntVarint16()).toEqual(1010n); expect(await contract.getTestIntBool()).toEqual(12n); expect(await contract.getTestIntCell()).toEqual(1010n); expect(await contract.getTestIntAddress()).toEqual(28n); expect(await contract.getTestIntStruct()).toEqual(1010n); expect(await contract.getTestAddressInt()).toEqual(1018n); + expect(await contract.getTestAddressCoins()).toEqual(1018n); + expect(await contract.getTestAddressVarint16()).toEqual(1018n); expect(await contract.getTestAddressBool()).toEqual(20n); expect(await contract.getTestAddressCell()).toEqual(1018n); expect(await contract.getTestAddressAddress()).toEqual(26n); diff --git a/src/test/e2e-emulated/map.spec.ts b/src/test/e2e-emulated/map1.spec.ts similarity index 85% rename from src/test/e2e-emulated/map.spec.ts rename to src/test/e2e-emulated/map1.spec.ts index 245196f1e..d7a0d600e 100644 --- a/src/test/e2e-emulated/map.spec.ts +++ b/src/test/e2e-emulated/map1.spec.ts @@ -9,7 +9,7 @@ import { SomeStruct, ReplaceAllMaps, ReplaceGetAllMaps, -} from "./contracts/output/maps_MapTestContract"; +} from "./contracts/output/maps1_MapTestContract"; import { Blockchain, SandboxContract, TreasuryContract } from "@ton/sandbox"; import { Address, beginCell, Cell, Dictionary, toNano } from "@ton/core"; import "@ton/test-utils"; @@ -58,14 +58,10 @@ type TestKeys = { }; type TestValues = { - valueInt: bigint; - valueInt8: bigint; - valueInt42: bigint; - valueInt256: bigint; - valueUint8: bigint; - valueUint42: bigint; - valueUint256: bigint; - valueCoins: bigint; + valueVarint16: bigint; + valueVarint32: bigint; + valueVaruint16: bigint; + valueVaruint32: bigint; valueBool: boolean; valueCell: Cell; valueAddress: Address; @@ -99,14 +95,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address0"), }, values: { - valueInt: 999n, - valueInt8: -128n, - valueInt42: 123_456n, - valueInt256: 789n, - valueUint8: 255n, - valueUint42: 123_456_789n, - valueUint256: 999_999_999_999n, - valueCoins: 100_000_000n, + valueVarint16: 123n, + valueVarint32: 123_456n, + valueVaruint16: 255n, + valueVaruint32: 123_456_789n, valueBool: true, valueCell: beginCell().storeUint(42, 32).endCell(), valueAddress: randomAddress(0, "address"), @@ -132,14 +124,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address1"), }, values: { - valueInt: 2n ** 31n - 1n, // Max 32-bit signed int - valueInt8: 127n, // Max 8-bit signed int - valueInt42: 2n ** 41n - 1n, // Max 42-bit signed int - valueInt256: 2n ** 255n - 1n, // Max 256-bit signed int - valueUint8: 0n, // Min unsigned int - valueUint42: 0n, // Min unsigned int - valueUint256: 0n, // Min unsigned int - valueCoins: 0n, + valueVarint16: -(2n ** 118n), // Min VarInt16 + valueVarint32: -(2n ** 246n), // Min VarInt32 + valueVaruint16: 2n ** 120n - 1n, // Max VarUint16 + valueVaruint32: 2n ** 248n - 1n, // Max VarUint32 valueBool: false, valueCell: beginCell() .storeUint(2n ** 32n - 1n, 32) @@ -167,14 +155,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address2"), }, values: { - valueInt: 1n, - valueInt8: -1n, - valueInt42: -1n, - valueInt256: 1n, - valueUint8: 1n, - valueUint42: 1n, - valueUint256: 1n, - valueCoins: 1n, + valueVarint16: -1n, + valueVarint32: -1n, + valueVaruint16: 1n, + valueVaruint32: 1n, valueBool: false, valueCell: beginCell().storeUint(0, 32).endCell(), valueAddress: randomAddress(0, "address"), @@ -200,14 +184,10 @@ const testCases: TestCase[] = [ keyAddress: randomAddress(0, "address3"), }, values: { - valueInt: -1n, - valueInt8: -127n, // Near min but not quite - valueInt42: 2n ** 40n, // Large power of 2 - valueInt256: -(2n ** 254n), // Large negative power of 2 - valueUint8: 128n, // Middle value - valueUint42: 2n ** 41n, // Large power of 2 - valueUint256: 2n ** 255n, // Large power of 2 - valueCoins: 2n ** 120n - 1n, + valueVarint16: 2n ** 41n, + valueVarint32: -(2n ** 123n), + valueVaruint16: 2n ** 41n, + valueVaruint32: 2n ** 123n, valueBool: true, valueCell: beginCell() .storeUint(2n ** 31n, 32) @@ -228,23 +208,10 @@ const testCases: TestCase[] = [ // Define all 88 map configurations const mapConfigs: MapConfig[] = [ // int_* Maps - { mapName: "int_int", key: "keyInt", value: "valueInt" }, - { - mapName: "int_int8", - key: "keyInt", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int_int42", key: "keyInt", value: "valueInt42" }, - { mapName: "int_int256", key: "keyInt", value: "valueInt256" }, - { - mapName: "int_uint8", - key: "keyInt", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int_uint42", key: "keyInt", value: "valueUint42" }, - { mapName: "int_uint256", key: "keyInt", value: "valueUint256" }, + { mapName: "int_varint16", key: "keyInt", value: "valueVarint16" }, + { mapName: "int_varint32", key: "keyInt", value: "valueVarint32" }, + { mapName: "int_varuint16", key: "keyInt", value: "valueVaruint16" }, + { mapName: "int_varuint32", key: "keyInt", value: "valueVaruint32" }, { mapName: "int_bool", key: "keyInt", value: "valueBool" }, { mapName: "int_cell", key: "keyInt", value: "valueCell" }, { mapName: "int_address", key: "keyInt", value: "valueAddress" }, @@ -252,47 +219,27 @@ const mapConfigs: MapConfig[] = [ // int8_* Maps { - mapName: "int8_int", - key: "keyInt8", - value: "valueInt", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "int8_int8", - key: "keyInt8", - value: "valueInt8", - keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), - }, - { - mapName: "int8_int42", - key: "keyInt8", - value: "valueInt42", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "int8_int256", + mapName: "int8_varint16", key: "keyInt8", - value: "valueInt256", + value: "valueVarint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "int8_uint8", + mapName: "int8_varint32", key: "keyInt8", - value: "valueUint8", + value: "valueVarint32", keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), }, { - mapName: "int8_uint42", + mapName: "int8_varuint16", key: "keyInt8", - value: "valueUint42", + value: "valueVaruint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "int8_uint256", + mapName: "int8_varuint32", key: "keyInt8", - value: "valueUint256", + value: "valueVaruint32", keyTransform: (k: bigint) => Number(k), }, { @@ -321,46 +268,20 @@ const mapConfigs: MapConfig[] = [ }, // int42_* Maps - { mapName: "int42_int", key: "keyInt42", value: "valueInt" }, - { - mapName: "int42_int8", - key: "keyInt42", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int42_int42", key: "keyInt42", value: "valueInt42" }, - { mapName: "int42_int256", key: "keyInt42", value: "valueInt256" }, - { - mapName: "int42_uint8", - key: "keyInt42", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int42_uint42", key: "keyInt42", value: "valueUint42" }, - { mapName: "int42_uint256", key: "keyInt42", value: "valueUint256" }, + { mapName: "int42_varint16", key: "keyInt42", value: "valueVarint16" }, + { mapName: "int42_varint32", key: "keyInt42", value: "valueVarint32" }, + { mapName: "int42_varuint16", key: "keyInt42", value: "valueVaruint16" }, + { mapName: "int42_varuint32", key: "keyInt42", value: "valueVaruint32" }, { mapName: "int42_bool", key: "keyInt42", value: "valueBool" }, { mapName: "int42_cell", key: "keyInt42", value: "valueCell" }, { mapName: "int42_address", key: "keyInt42", value: "valueAddress" }, { mapName: "int42_struct", key: "keyInt42", value: "valueStruct" }, // int256_* Maps - { mapName: "int256_int", key: "keyInt256", value: "valueInt" }, - { - mapName: "int256_int8", - key: "keyInt256", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int256_int42", key: "keyInt256", value: "valueInt42" }, - { mapName: "int256_int256", key: "keyInt256", value: "valueInt256" }, - { - mapName: "int256_uint8", - key: "keyInt256", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "int256_uint42", key: "keyInt256", value: "valueUint42" }, - { mapName: "int256_uint256", key: "keyInt256", value: "valueUint256" }, + { mapName: "int256_varint16", key: "keyInt256", value: "valueVarint16" }, + { mapName: "int256_varint32", key: "keyInt256", value: "valueVarint32" }, + { mapName: "int256_varuint16", key: "keyInt256", value: "valueVaruint16" }, + { mapName: "int256_varuint32", key: "keyInt256", value: "valueVaruint32" }, { mapName: "int256_bool", key: "keyInt256", value: "valueBool" }, { mapName: "int256_cell", key: "keyInt256", value: "valueCell" }, { mapName: "int256_address", key: "keyInt256", value: "valueAddress" }, @@ -368,47 +289,27 @@ const mapConfigs: MapConfig[] = [ // uint8_* Maps { - mapName: "uint8_int", - key: "keyUint8", - value: "valueInt", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "uint8_int8", - key: "keyUint8", - value: "valueInt8", - keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), - }, - { - mapName: "uint8_int42", - key: "keyUint8", - value: "valueInt42", - keyTransform: (k: bigint) => Number(k), - }, - { - mapName: "uint8_int256", + mapName: "uint8_varint16", key: "keyUint8", - value: "valueInt256", + value: "valueVarint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "uint8_uint8", + mapName: "uint8_varint32", key: "keyUint8", - value: "valueUint8", + value: "valueVarint32", keyTransform: (k: bigint) => Number(k), - valueTransform: (v: bigint) => Number(v), }, { - mapName: "uint8_uint42", + mapName: "uint8_varuint16", key: "keyUint8", - value: "valueUint42", + value: "valueVaruint16", keyTransform: (k: bigint) => Number(k), }, { - mapName: "uint8_uint256", + mapName: "uint8_varuint32", key: "keyUint8", - value: "valueUint256", + value: "valueVaruint32", keyTransform: (k: bigint) => Number(k), }, { @@ -437,69 +338,46 @@ const mapConfigs: MapConfig[] = [ }, // uint42_* Maps - { mapName: "uint42_int", key: "keyUint42", value: "valueInt" }, - { - mapName: "uint42_int8", - key: "keyUint42", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "uint42_int42", key: "keyUint42", value: "valueInt42" }, - { mapName: "uint42_int256", key: "keyUint42", value: "valueInt256" }, - { - mapName: "uint42_uint8", - key: "keyUint42", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), - }, - { mapName: "uint42_uint42", key: "keyUint42", value: "valueUint42" }, - { mapName: "uint42_uint256", key: "keyUint42", value: "valueUint256" }, + { mapName: "uint42_varint16", key: "keyUint42", value: "valueVarint16" }, + { mapName: "uint42_varint32", key: "keyUint42", value: "valueVarint32" }, + { mapName: "uint42_varuint16", key: "keyUint42", value: "valueVaruint16" }, + { mapName: "uint42_varuint32", key: "keyUint42", value: "valueVaruint32" }, { mapName: "uint42_bool", key: "keyUint42", value: "valueBool" }, { mapName: "uint42_cell", key: "keyUint42", value: "valueCell" }, { mapName: "uint42_address", key: "keyUint42", value: "valueAddress" }, { mapName: "uint42_struct", key: "keyUint42", value: "valueStruct" }, // uint256_* Maps - { mapName: "uint256_int", key: "keyUint256", value: "valueInt" }, + { mapName: "uint256_varint16", key: "keyUint256", value: "valueVarint16" }, + { mapName: "uint256_varint32", key: "keyUint256", value: "valueVarint32" }, { - mapName: "uint256_int8", + mapName: "uint256_varuint16", key: "keyUint256", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint16", }, - { mapName: "uint256_int42", key: "keyUint256", value: "valueInt42" }, - { mapName: "uint256_int256", key: "keyUint256", value: "valueInt256" }, { - mapName: "uint256_uint8", + mapName: "uint256_varuint32", key: "keyUint256", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint32", }, - { mapName: "uint256_uint42", key: "keyUint256", value: "valueUint42" }, - { mapName: "uint256_uint256", key: "keyUint256", value: "valueUint256" }, { mapName: "uint256_bool", key: "keyUint256", value: "valueBool" }, { mapName: "uint256_cell", key: "keyUint256", value: "valueCell" }, { mapName: "uint256_address", key: "keyUint256", value: "valueAddress" }, { mapName: "uint256_struct", key: "keyUint256", value: "valueStruct" }, // address_* Maps - { mapName: "address_int", key: "keyAddress", value: "valueInt" }, + { mapName: "address_varint16", key: "keyAddress", value: "valueVarint16" }, + { mapName: "address_varint32", key: "keyAddress", value: "valueVarint32" }, { - mapName: "address_int8", + mapName: "address_varuint16", key: "keyAddress", - value: "valueInt8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint16", }, - { mapName: "address_int42", key: "keyAddress", value: "valueInt42" }, - { mapName: "address_int256", key: "keyAddress", value: "valueInt256" }, { - mapName: "address_uint8", + mapName: "address_varuint32", key: "keyAddress", - value: "valueUint8", - valueTransform: (v: bigint) => Number(v), + value: "valueVaruint32", }, - { mapName: "address_uint42", key: "keyAddress", value: "valueUint42" }, - { mapName: "address_uint256", key: "keyAddress", value: "valueUint256" }, { mapName: "address_bool", key: "keyAddress", value: "valueBool" }, { mapName: "address_cell", key: "keyAddress", value: "valueCell" }, { mapName: "address_address", key: "keyAddress", value: "valueAddress" }, @@ -589,14 +467,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -679,14 +553,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -767,14 +637,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -863,14 +729,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1506,14 +1368,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1581,14 +1439,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1611,7 +1465,7 @@ describe("MapTestContract", () => { } }); - it("asCell: should correctly serialize and deserialize maps", async () => { + it.only("asCell: should correctly serialize and deserialize maps", async () => { for (const { keys, values } of testCases) { // Set values for the current test case const setMessage: SetAllMaps = { @@ -1676,14 +1530,10 @@ describe("MapTestContract", () => { const clearMessage: SetAllMaps = { $$type: "SetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1769,14 +1619,10 @@ describe("MapTestContract", () => { const clearMessage: ReplaceAllMaps = { $$type: "ReplaceAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -1836,14 +1682,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, @@ -1880,14 +1722,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, @@ -1974,14 +1812,10 @@ describe("MapTestContract", () => { const clearMessage: ReplaceGetAllMaps = { $$type: "ReplaceGetAllMaps", ...keys, - valueInt: null, - valueInt8: null, - valueInt42: null, - valueInt256: null, - valueUint8: null, - valueUint42: null, - valueUint256: null, - valueCoins: null, + valueVarint16: null, + valueVarint32: null, + valueVaruint16: null, + valueVaruint32: null, valueBool: null, valueCell: null, valueAddress: null, @@ -2041,14 +1875,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, @@ -2086,14 +1916,10 @@ describe("MapTestContract", () => { keys.keyUint42, keys.keyUint256, keys.keyAddress, - values.valueInt, - values.valueInt8, - values.valueInt42, - values.valueInt256, - values.valueUint8, - values.valueUint42, - values.valueUint256, - values.valueCoins, + values.valueVarint16, + values.valueVarint32, + values.valueVaruint16, + values.valueVaruint32, values.valueBool, values.valueCell, values.valueAddress, diff --git a/src/test/e2e-emulated/map2.spec.ts b/src/test/e2e-emulated/map2.spec.ts new file mode 100644 index 000000000..c5375a3d6 --- /dev/null +++ b/src/test/e2e-emulated/map2.spec.ts @@ -0,0 +1,1818 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +import { randomAddress } from "../utils/randomAddress"; +import { + MapTestContract, + MapTestContract$Data, + SetAllMaps, + DelAllMaps, + ReplaceAllMaps, + ReplaceGetAllMaps, +} from "./contracts/output/maps2_MapTestContract"; +import { Blockchain, SandboxContract, TreasuryContract } from "@ton/sandbox"; +import { Address, beginCell, Dictionary, toNano } from "@ton/core"; +import "@ton/test-utils"; + +// Type definitions for keys and values to make them type-safe +type TestKeys = { + keyInt: bigint; + keyInt8: bigint; + keyInt42: bigint; + keyInt256: bigint; + keyUint8: bigint; + keyUint42: bigint; + keyUint256: bigint; + keyAddress: Address; +}; + +type TestValues = { + valueInt: bigint; + valueInt8: bigint; + valueInt42: bigint; + valueInt256: bigint; + valueUint8: bigint; + valueUint42: bigint; + valueUint256: bigint; + valueCoins: bigint; +}; + +// Configuration for all maps +type MapConfig = { + mapName: keyof MapTestContract$Data; + key: keyof TestKeys; + value: keyof TestValues; + keyTransform?: (key: any) => any; + valueTransform?: (value: any) => any; +}; + +type TestCase = { + keys: TestKeys; + values: TestValues; +}; + +const testCases: TestCase[] = [ + { + keys: { + keyInt: 123n, + keyInt8: -10n, + keyInt42: 42n, + keyInt256: 456n, + keyUint8: 200n, + keyUint42: 500_000n, + keyUint256: 1_000_000_000_000n, + keyAddress: randomAddress(0, "address0"), + }, + values: { + valueInt: 999n, + valueInt8: -128n, + valueInt42: 123_456n, + valueInt256: 789n, + valueUint8: 255n, + valueUint42: 123_456_789n, + valueUint256: 999_999_999_999n, + valueCoins: 100_000_000n, + }, + }, + { + keys: { + keyInt: -(2n ** 31n), // Min 32-bit signed int + keyInt8: -128n, // Min 8-bit signed int + keyInt42: -(2n ** 41n), // Min 42-bit signed int + keyInt256: -(2n ** 255n), // Min 256-bit signed int + keyUint8: 255n, // Max 8-bit unsigned int + keyUint42: 2n ** 42n - 1n, // Max 42-bit unsigned int + keyUint256: 2n ** 256n - 1n, // Max 256-bit unsigned int + keyAddress: randomAddress(0, "address1"), + }, + values: { + valueInt: 2n ** 31n - 1n, // Max 32-bit signed int + valueInt8: 127n, // Max 8-bit signed int + valueInt42: 2n ** 41n - 1n, // Max 42-bit signed int + valueInt256: 2n ** 255n - 1n, // Max 256-bit signed int + valueUint8: 0n, // Min unsigned int + valueUint42: 0n, // Min unsigned int + valueUint256: 0n, // Min unsigned int + valueCoins: 0n, + }, + }, + { + keys: { + keyInt: 0n, + keyInt8: 0n, + keyInt42: 0n, + keyInt256: 0n, + keyUint8: 0n, + keyUint42: 0n, + keyUint256: 0n, + keyAddress: randomAddress(0, "address2"), + }, + values: { + valueInt: 1n, + valueInt8: -1n, + valueInt42: -1n, + valueInt256: 1n, + valueUint8: 1n, + valueUint42: 1n, + valueUint256: 1n, + valueCoins: 1n, + }, + }, + { + keys: { + keyInt: 1n, + keyInt8: -1n, + keyInt42: 424n, + keyInt256: 2n ** 128n, // Large but not maximum value + keyUint8: 128n, // Middle value + keyUint42: 2n ** 41n, // Large power of 2 + keyUint256: 2n ** 128n, // Large power of 2 + keyAddress: randomAddress(0, "address3"), + }, + values: { + valueInt: -1n, + valueInt8: -127n, // Near min but not quite + valueInt42: 2n ** 40n, // Large power of 2 + valueInt256: -(2n ** 254n), // Large negative power of 2 + valueUint8: 128n, // Middle value + valueUint42: 2n ** 41n, // Large power of 2 + valueUint256: 2n ** 255n, // Large power of 2 + valueCoins: 2n ** 120n - 1n, + }, + }, +]; + +// Define all 88 map configurations +const mapConfigs: MapConfig[] = [ + // int_* Maps + { mapName: "int_int", key: "keyInt", value: "valueInt" }, + { + mapName: "int_int8", + key: "keyInt", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int_int42", key: "keyInt", value: "valueInt42" }, + { mapName: "int_int256", key: "keyInt", value: "valueInt256" }, + { + mapName: "int_uint8", + key: "keyInt", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int_uint42", key: "keyInt", value: "valueUint42" }, + { mapName: "int_uint256", key: "keyInt", value: "valueUint256" }, + { mapName: "int_coins", key: "keyInt", value: "valueCoins" }, + + // int8_* Maps + { + mapName: "int8_int", + key: "keyInt8", + value: "valueInt", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_int8", + key: "keyInt8", + value: "valueInt8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "int8_int42", + key: "keyInt8", + value: "valueInt42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_int256", + key: "keyInt8", + value: "valueInt256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_uint8", + key: "keyInt8", + value: "valueUint8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "int8_uint42", + key: "keyInt8", + value: "valueUint42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_uint256", + key: "keyInt8", + value: "valueUint256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "int8_coins", + key: "keyInt8", + value: "valueCoins", + keyTransform: (k: bigint) => Number(k), + }, + + // int42_* Maps + { mapName: "int42_int", key: "keyInt42", value: "valueInt" }, + { + mapName: "int42_int8", + key: "keyInt42", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int42_int42", key: "keyInt42", value: "valueInt42" }, + { mapName: "int42_int256", key: "keyInt42", value: "valueInt256" }, + { + mapName: "int42_uint8", + key: "keyInt42", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int42_uint42", key: "keyInt42", value: "valueUint42" }, + { mapName: "int42_uint256", key: "keyInt42", value: "valueUint256" }, + { mapName: "int42_coins", key: "keyInt42", value: "valueCoins" }, + + // int256_* Maps + { mapName: "int256_int", key: "keyInt256", value: "valueInt" }, + { + mapName: "int256_int8", + key: "keyInt256", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int256_int42", key: "keyInt256", value: "valueInt42" }, + { mapName: "int256_int256", key: "keyInt256", value: "valueInt256" }, + { + mapName: "int256_uint8", + key: "keyInt256", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "int256_uint42", key: "keyInt256", value: "valueUint42" }, + { mapName: "int256_uint256", key: "keyInt256", value: "valueUint256" }, + { mapName: "int256_coins", key: "keyInt256", value: "valueCoins" }, + + // uint8_* Maps + { + mapName: "uint8_int", + key: "keyUint8", + value: "valueInt", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_int8", + key: "keyUint8", + value: "valueInt8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "uint8_int42", + key: "keyUint8", + value: "valueInt42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_int256", + key: "keyUint8", + value: "valueInt256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_uint8", + key: "keyUint8", + value: "valueUint8", + keyTransform: (k: bigint) => Number(k), + valueTransform: (v: bigint) => Number(v), + }, + { + mapName: "uint8_uint42", + key: "keyUint8", + value: "valueUint42", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_uint256", + key: "keyUint8", + value: "valueUint256", + keyTransform: (k: bigint) => Number(k), + }, + { + mapName: "uint8_coins", + key: "keyUint8", + value: "valueCoins", + keyTransform: (k: bigint) => Number(k), + }, + + // uint42_* Maps + { mapName: "uint42_int", key: "keyUint42", value: "valueInt" }, + { + mapName: "uint42_int8", + key: "keyUint42", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint42_int42", key: "keyUint42", value: "valueInt42" }, + { mapName: "uint42_int256", key: "keyUint42", value: "valueInt256" }, + { + mapName: "uint42_uint8", + key: "keyUint42", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint42_uint42", key: "keyUint42", value: "valueUint42" }, + { mapName: "uint42_uint256", key: "keyUint42", value: "valueUint256" }, + { mapName: "uint42_coins", key: "keyUint42", value: "valueCoins" }, + + // uint256_* Maps + { mapName: "uint256_int", key: "keyUint256", value: "valueInt" }, + { + mapName: "uint256_int8", + key: "keyUint256", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint256_int42", key: "keyUint256", value: "valueInt42" }, + { mapName: "uint256_int256", key: "keyUint256", value: "valueInt256" }, + { + mapName: "uint256_uint8", + key: "keyUint256", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "uint256_uint42", key: "keyUint256", value: "valueUint42" }, + { mapName: "uint256_uint256", key: "keyUint256", value: "valueUint256" }, + { mapName: "uint256_coins", key: "keyUint256", value: "valueCoins" }, + + // address_* Maps + { mapName: "address_int", key: "keyAddress", value: "valueInt" }, + { + mapName: "address_int8", + key: "keyAddress", + value: "valueInt8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "address_int42", key: "keyAddress", value: "valueInt42" }, + { mapName: "address_int256", key: "keyAddress", value: "valueInt256" }, + { + mapName: "address_uint8", + key: "keyAddress", + value: "valueUint8", + valueTransform: (v: bigint) => Number(v), + }, + { mapName: "address_uint42", key: "keyAddress", value: "valueUint42" }, + { mapName: "address_uint256", key: "keyAddress", value: "valueUint256" }, + { mapName: "address_coins", key: "keyAddress", value: "valueCoins" }, +]; + +describe("MapTestContract", () => { + let blockchain: Blockchain; + let treasury: SandboxContract; + let contract: SandboxContract; + + beforeEach(async () => { + // Initialize the blockchain and contracts + blockchain = await Blockchain.create(); + blockchain.verbosity.print = false; + treasury = await blockchain.treasury("treasury"); + contract = blockchain.openContract(await MapTestContract.fromInit()); + + // Fund the contract with some TONs + await contract.send( + treasury.getSender(), + { value: toNano("10") }, + null, + ); + + // Check that all maps are empty initially + const maps = await contract.getAllMaps(); + for (const [_mapName, map] of Object.entries(maps)) { + if (map instanceof Dictionary) { + expect(map.size).toBe(0); + } + } + }); + + it("set: should set and clear values", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + + // Retrieve all maps again to ensure they are empty + const clearedMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = clearedMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("set: should set multiple values", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + for (const { keys, values } of testCases) { + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(testCases.length); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + for (const { keys } of testCases) { + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + + // Retrieve all maps again to ensure they are empty + const clearedMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = clearedMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("set: should overwrite values", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + + // Retrieve all maps again to ensure they are empty + const clearedMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = clearedMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("get: should get values after setting them and nulls after clearing", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ + mapName, + key: _key, + value, + keyTransform: _keyTransform, + valueTransform, + }) => { + let expectedValue = values[value]; + let actualValue = getResponse[mapName]; + + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }, + ); + + // Clear all maps by setting values to null + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + + // Call the .get operation on all maps again + const clearedGetResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const actualValue = clearedGetResponse[mapName]; + expect(actualValue).toBeNull(); + }); + } + }); + + it("get: should return null for all maps when no values are set", async () => { + for (const { keys } of testCases) { + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and assert that all values are null + mapConfigs.forEach(({ mapName }) => { + const actualValue = getResponse[mapName]; + expect(actualValue).toBeNull(); + }); + } + }); + + it("get: should retrieve multiple values after setting them", async () => { + // Set multiple values + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Now retrieve values for each test case + for (const { keys, values } of testCases) { + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ + mapName, + key: _key, + value, + keyTransform: _keyTransform, + valueTransform, + }) => { + let expectedValue = values[value]; + let actualValue = getResponse[mapName]; + + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + }); + + it("get: should retrieve updated values after overwriting", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .get operation on all maps + const getResponse = await contract.getGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ + mapName, + key: _key, + value, + keyTransform: _keyTransform, + valueTransform, + }) => { + let expectedValue = values[value]; + let actualValue = getResponse[mapName]; + + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + } + }); + + it("get: should return null for non-existent keys", async () => { + // First, set some keys + for (const { keys, values } of testCases.slice(0, -1)) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Now, attempt to get values for keys that have not been set + const nonExistentKeys = testCases[testCases.length - 1]!.keys; + + const getResponse = await contract.getGetAllMaps( + nonExistentKeys.keyInt, + nonExistentKeys.keyInt8, + nonExistentKeys.keyInt42, + nonExistentKeys.keyInt256, + nonExistentKeys.keyUint8, + nonExistentKeys.keyUint42, + nonExistentKeys.keyUint256, + nonExistentKeys.keyAddress, + ); + + // Iterate over mapConfigs and assert that values are null + mapConfigs.forEach(({ mapName }) => { + const actualValue = getResponse[mapName]; + expect(actualValue).toBeNull(); + }); + }); + + it("del: should delete values", async () => { + for (const { keys, values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Retrieve all maps using `allMaps` getter to ensure they are set + const allMapsBeforeDel = await contract.getAllMaps(); + + // Iterate over mapConfigs and verify all maps have one entry + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMapsBeforeDel[mapName] as Dictionary< + any, + any + >; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + + // Send the del operation + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...keys, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Retrieve all maps using `allMaps` getter to ensure they are deleted + const allMapsAfterDel = await contract.getAllMaps(); + + // Iterate over mapConfigs and assert maps are empty + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("del: should delete multiple values", async () => { + // Set multiple values + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Check that all maps are set + const allMapsBeforeDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsBeforeDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length); + }); + + // Delete them + for (const { keys } of testCases) { + const delMessage: DelAllMaps = { $$type: "DelAllMaps", ...keys }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + } + + // Ensure maps are empty + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("del: should not affect other keys when deleting", async () => { + // Set multiple values + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Delete only the first test case's keys + const keysToDelete = testCases[0]!.keys; + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...keysToDelete, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Check that only the deleted keys are removed + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length - 1); + }); + + // Verify other keys are unaffected + for (const { keys, values } of testCases.slice(1)) { + const getResponse = await contract.getAllMaps(); + + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = getResponse[mapName] as Dictionary; + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + }); + + it("del: should do nothing when deleting non-existent keys", async () => { + // Set values except for the last test case + for (const { keys, values } of testCases.slice(0, -1)) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Ensure existing data is unaffected + const allMapsBeforeDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsBeforeDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length - 1); + }); + + // Attempt to delete non-existent keys + const nonExistentKeys = testCases[testCases.length - 1]!.keys; + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...nonExistentKeys, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Ensure existing data is unaffected + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary; + expect(map.size).toBe(testCases.length - 1); + }); + + // Verify that the existing values are still there + for (const { keys, values } of testCases.slice(0, -1)) { + const allMaps = await contract.getAllMaps(); + + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + }); + + it("del: should handle delete after overwriting", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Set values + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Delete values + const delMessage: DelAllMaps = { + $$type: "DelAllMaps", + ...keys, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + delMessage, + ); + + // Ensure maps are empty + const allMapsAfterDel = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMapsAfterDel[mapName] as Dictionary< + any, + any + >; + expect(map.size).toBe(0); + }); + } + } + }); + + it("exists: should return 'true' for existing keys and 'false' for non-existent keys", async () => { + // Set values for all test cases + for (const { keys, values } of testCases.slice(0, -1)) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + // Check that all keys exist + for (const { keys } of testCases.slice(0, -1)) { + const existsResponse = await contract.getExistsAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + Object.values(existsResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(true); + } + }); + } + + // Check that non-existent keys do not exist + const nonExistentKeys = testCases[testCases.length - 1]!.keys; + const nonExistentResponse = await contract.getExistsAllMaps( + nonExistentKeys.keyInt, + nonExistentKeys.keyInt8, + nonExistentKeys.keyInt42, + nonExistentKeys.keyInt256, + nonExistentKeys.keyUint8, + nonExistentKeys.keyUint42, + nonExistentKeys.keyUint256, + nonExistentKeys.keyAddress, + ); + + Object.values(nonExistentResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(false); + } + }); + }); + + it("exists: should still return 'true' after overwriting", async () => { + for (const { keys } of testCases) { + for (const { values } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .exists operation on all maps + const existsResponse = await contract.getExistsAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + Object.values(existsResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(true); + } + }); + } + } + }); + + it("exists: should return 'false' for all keys after clearing all maps", async () => { + for (const { keys, values } of testCases) { + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + } + + for (const { keys } of testCases) { + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + + for (const { keys } of testCases) { + const existsResponse = await contract.getExistsAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + ); + + Object.values(existsResponse).forEach((exists) => { + if (typeof exists === "boolean") { + expect(exists).toBe(false); + } + }); + } + }); + + it("isEmpty: should return 'true' for empty maps and 'false' for non-empty maps", async () => { + for (const { keys, values } of testCases) { + // Check that all maps are empty initially + const initialIsEmptyResponse = await contract.getIsEmptyAllMaps(); + Object.values(initialIsEmptyResponse).forEach((isEmpty) => { + if (typeof isEmpty === "boolean") { + expect(isEmpty).toBe(true); + } + }); + + // Set values for the current test case + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Check that all maps are non-empty + const nonEmptyIsEmptyResponse = await contract.getIsEmptyAllMaps(); + Object.values(nonEmptyIsEmptyResponse).forEach((isEmpty) => { + if (typeof isEmpty === "boolean") { + expect(isEmpty).toBe(false); + } + }); + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + + // Check that all maps are empty again + const emptyIsEmptyResponse = await contract.getIsEmptyAllMaps(); + Object.values(emptyIsEmptyResponse).forEach((isEmpty) => { + if (typeof isEmpty === "boolean") { + expect(isEmpty).toBe(true); + } + }); + } + }); + + it("asCell: should correctly serialize and deserialize maps", async () => { + for (const { keys, values } of testCases) { + // Set values for the current test case + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Serialize all maps to a Cell + const cellResponse = await contract.getAsCellAllMaps(); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + + // Serialize the map from allMaps to a Cell to compare with the response + const serializedMap = beginCell() + .storeDictDirect(map) + .endCell(); + + expect(cellResponse[mapName]).toEqualCell(serializedMap); + }, + ); + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + } + }); + + it("replace: should replace values and clear them", async () => { + for (const { keys } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...testCases[0]!.values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + for (const { values } of testCases) { + // Send the replace operation + const replaceMessage: ReplaceAllMaps = { + $$type: "ReplaceAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: ReplaceAllMaps = { + $$type: "ReplaceAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + } + + // Check that all maps are empty again + const allMaps = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("replace: should not replace values when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Send the replace operation + const replaceMessage: ReplaceAllMaps = { + $$type: "ReplaceAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Check that all maps are still empty + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("replace: should return 'true' when replacing values and 'false' when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Call the .replace operation on all maps + const replaceResult = await contract.getReplaceAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are 'false' + Object.values(replaceResult).forEach((result) => { + if (typeof result === "boolean") { + expect(result).toBe(false); + } + }); + + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .replace operation on all maps + const replaceResultAfterSet = await contract.getReplaceAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are 'true' + Object.values(replaceResultAfterSet).forEach((result) => { + if (typeof result === "boolean") { + expect(result).toBe(true); + } + }); + } + }); + + it("replaceGet: should replace values and clear them", async () => { + for (const { keys } of testCases) { + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...testCases[0]!.values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + for (const { values } of testCases) { + // Send the replace operation + const replaceGetMessage: ReplaceGetAllMaps = { + $$type: "ReplaceGetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceGetMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Iterate over mapConfigs and perform assertions + mapConfigs.forEach( + ({ mapName, key, value, keyTransform, valueTransform }) => { + const map = allMaps[mapName] as Dictionary; + + expect(map.size).toBe(1); + + let mapKey = keys[key]; + if (keyTransform) { + mapKey = keyTransform(mapKey); + } + + let expectedValue = values[value]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + } + + const actualValue = map.get(mapKey); + + expect(actualValue).toEqual(expectedValue); + }, + ); + } + + // Clear all maps + for (const { keys } of testCases) { + const clearMessage: ReplaceGetAllMaps = { + $$type: "ReplaceGetAllMaps", + ...keys, + valueInt: null, + valueInt8: null, + valueInt42: null, + valueInt256: null, + valueUint8: null, + valueUint42: null, + valueUint256: null, + valueCoins: null, + }; + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + clearMessage, + ); + } + } + + // Check that all maps are empty again + const allMaps = await contract.getAllMaps(); + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + }); + + it("replaceGet: should not replace values when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Send the replace operation + const replaceGetMessage: ReplaceGetAllMaps = { + $$type: "ReplaceGetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + replaceGetMessage, + ); + + // Retrieve all maps using `allMaps` getter + const allMaps = await contract.getAllMaps(); + + // Check that all maps are still empty + mapConfigs.forEach(({ mapName }) => { + const map = allMaps[mapName] as Dictionary; + expect(map.size).toBe(0); + }); + } + }); + + it("replaceGet: should return old values when replaced and null when keys do not exist", async () => { + for (const { keys, values } of testCases) { + // Call the .replace operation on all maps + const replaceGetResult = await contract.getReplaceGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are 'null' + Object.values(replaceGetResult).forEach((result) => { + if (result !== "ReplaceGetAllMapsResult") { + expect(result).toBeNull(); + } + }); + + // Send the set operation + const setMessage: SetAllMaps = { + $$type: "SetAllMaps", + ...keys, + ...values, + }; + + await contract.send( + treasury.getSender(), + { value: toNano("1") }, + setMessage, + ); + + // Call the .replace operation on all maps + const replaceGetResultAfterSet = + await contract.getReplaceGetAllMaps( + keys.keyInt, + keys.keyInt8, + keys.keyInt42, + keys.keyInt256, + keys.keyUint8, + keys.keyUint42, + keys.keyUint256, + keys.keyAddress, + values.valueInt, + values.valueInt8, + values.valueInt42, + values.valueInt256, + values.valueUint8, + values.valueUint42, + values.valueUint256, + values.valueCoins, + ); + + // Check that all return values are equal to the old values + mapConfigs.forEach(({ mapName, value, valueTransform }) => { + let expectedValue = values[value]; + let actualValue = replaceGetResultAfterSet[mapName]; + if (valueTransform) { + expectedValue = valueTransform(expectedValue); + actualValue = valueTransform(actualValue); + } + + expect(actualValue).toEqual(expectedValue); + }); + } + }); + + it("checkNullReference: should throw an error in getter when accessing a null reference", async () => { + await expect(contract.getCheckNullReference()).rejects.toThrow(); + }); + + it("checkNullReference: should throw an error in receiver when accessing a null reference", async () => { + const result = await contract.send( + treasury.getSender(), + { value: toNano("1") }, + { + $$type: "CheckNullReference", + }, + ); + + expect(result.transactions).toHaveLength(3); + expect(result.transactions).toHaveTransaction({ + on: contract.address, + success: false, + exitCode: 128, + }); + }); +}); diff --git a/src/test/e2e-emulated/structs.spec.ts b/src/test/e2e-emulated/structs.spec.ts index 2ffd4fdc0..55531b616 100644 --- a/src/test/e2e-emulated/structs.spec.ts +++ b/src/test/e2e-emulated/structs.spec.ts @@ -270,6 +270,19 @@ describe("structs", () => { exitCode: 9, }); + { + const sendResult = await contract.send( + treasure.getSender(), + { value: toNano("10") }, + "exampleVarIntegers", + ); + expect(sendResult.transactions).toHaveTransaction({ + from: treasure.address, + to: contract.address, + success: true, + }); + } + expect(await contract.getLongStruct15Test()).toMatchSnapshot(); expect(await contract.getLongStruct16Test()).toMatchSnapshot(); expect(await contract.getLongStruct32Test()).toMatchSnapshot(); diff --git a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap index dc4bb74f7..98f09ba25 100644 --- a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap +++ b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap @@ -9079,6 +9079,2780 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 2`] = `[]`; +exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1`] = ` +[ + { + "ast": { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "primitive_type_decl", + "name": "Int", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 38154, + }, + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + { + "ast": { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + ], + "id": 92, + "kind": "contract", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "name": { + "id": 5, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [ + { + "abi": { + "name": "m1", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "int", + "valueFormat": "varint16", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 0, + "loc": m1: map, + "name": "m1", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varint16", + }, + }, + { + "abi": { + "name": "m2", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "int", + "valueFormat": "varint32", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 1, + "loc": m2: map, + "name": "m2", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varint32", + }, + }, + ], + "functions": Map { + "test1" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varint16, + "text": "varint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test1", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + "test2" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varint32, + "text": "varint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test2", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + }, + "header": null, + "init": { + "ast": { + "id": 94, + "kind": "contract_init", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "params": [], + "statements": [], + }, + "params": [], + }, + "interfaces": [], + "kind": "contract", + "name": "Main", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [ + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + ], + "uid": 51099, + }, +] +`; + +exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 2`] = `[]`; + +exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint 1`] = ` +[ + { + "ast": { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "primitive_type_decl", + "name": "Int", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 38154, + }, + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + { + "ast": { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + ], + "id": 92, + "kind": "contract", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "name": { + "id": 5, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [ + { + "abi": { + "name": "m1", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "uint", + "valueFormat": "varuint16", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 11, + "initializer": null, + "kind": "field_decl", + "loc": m1: map, + "name": { + "id": 6, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 10, + "keyStorageType": null, + "keyType": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 9, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 0, + "loc": m1: map, + "name": "m1", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varuint16", + }, + }, + { + "abi": { + "name": "m2", + "type": { + "key": "int", + "keyFormat": undefined, + "kind": "dict", + "value": "uint", + "valueFormat": "varuint32", + }, + }, + "as": null, + "ast": { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": m2: map, + "name": { + "id": 12, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 16, + "keyStorageType": null, + "keyType": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 15, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + "default": undefined, + "index": 1, + "loc": m2: map, + "name": "m2", + "type": { + "key": "Int", + "keyAs": null, + "kind": "map", + "value": "Int", + "valueAs": "varuint32", + }, + }, + ], + "functions": Map { + "test1" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 54, + "kind": "function_def", + "loc": get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + }, + "name": { + "id": 18, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 25, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 26, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 27, + "kind": "statement_let", + "loc": let m1: map = emptyMap();, + "name": { + "id": 20, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "type": { + "id": 24, + "keyStorageType": null, + "keyType": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 23, + "kind": "id", + "loc": varuint16, + "text": "varuint16", + }, + "valueType": { + "id": 22, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 30, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 31, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 32, + "kind": "method_call", + "loc": m1.set(1, 2), + "method": { + "id": 29, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 28, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "id": 33, + "kind": "statement_expression", + "loc": m1.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 38, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 39, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 40, + "kind": "method_call", + "loc": self.m1.set(1, 2), + "method": { + "id": 37, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 34, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 35, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 36, + "kind": "field_access", + "loc": self.m1, + }, + }, + "id": 41, + "kind": "statement_expression", + "loc": self.m1.set(1, 2);, + }, + { + "expression": { + "id": 52, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 44, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 45, + "kind": "method_call", + "loc": m1.get(1), + "method": { + "id": 43, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 42, + "kind": "id", + "loc": m1, + "text": "m1", + }, + }, + "loc": m1.get(1) + self.m1.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 50, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 51, + "kind": "method_call", + "loc": self.m1.get(1), + "method": { + "id": 49, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 46, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 47, + "kind": "id", + "loc": m1, + "text": "m1", + }, + "id": 48, + "kind": "field_access", + "loc": self.m1, + }, + }, + }, + "id": 53, + "kind": "statement_return", + "loc": return m1.get(1) + self.m1.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test1", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + "test2" => { + "ast": { + "attributes": [ + { + "kind": "function_attribute", + "loc": get, + "methodId": null, + "type": "get", + }, + ], + "id": 91, + "kind": "function_def", + "loc": get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + }, + "name": { + "id": 55, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 62, + "kind": "id", + "loc": emptyMap, + "text": "emptyMap", + }, + "id": 63, + "kind": "static_call", + "loc": emptyMap(), + }, + "id": 64, + "kind": "statement_let", + "loc": let m2: map = emptyMap();, + "name": { + "id": 57, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "type": { + "id": 61, + "keyStorageType": null, + "keyType": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": { + "id": 60, + "kind": "id", + "loc": varuint32, + "text": "varuint32", + }, + "valueType": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 67, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 68, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 69, + "kind": "method_call", + "loc": m2.set(1, 2), + "method": { + "id": 66, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "id": 65, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "id": 70, + "kind": "statement_expression", + "loc": m2.set(1, 2);, + }, + { + "expression": { + "args": [ + { + "base": 10, + "id": 75, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 76, + "kind": "number", + "loc": 2, + "value": 2n, + }, + ], + "id": 77, + "kind": "method_call", + "loc": self.m2.set(1, 2), + "method": { + "id": 74, + "kind": "id", + "loc": set, + "text": "set", + }, + "self": { + "aggregate": { + "id": 71, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 72, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 73, + "kind": "field_access", + "loc": self.m2, + }, + }, + "id": 78, + "kind": "statement_expression", + "loc": self.m2.set(1, 2);, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "args": [ + { + "base": 10, + "id": 81, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 82, + "kind": "method_call", + "loc": m2.get(1), + "method": { + "id": 80, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "id": 79, + "kind": "id", + "loc": m2, + "text": "m2", + }, + }, + "loc": m2.get(1) + self.m2.get(1), + "op": "+", + "right": { + "args": [ + { + "base": 10, + "id": 87, + "kind": "number", + "loc": 1, + "value": 1n, + }, + ], + "id": 88, + "kind": "method_call", + "loc": self.m2.get(1), + "method": { + "id": 86, + "kind": "id", + "loc": get, + "text": "get", + }, + "self": { + "aggregate": { + "id": 83, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 84, + "kind": "id", + "loc": m2, + "text": "m2", + }, + "id": 85, + "kind": "field_access", + "loc": self.m2, + }, + }, + }, + "id": 90, + "kind": "statement_return", + "loc": return m2.get(1) + self.m2.get(1);, + }, + ], + }, + "isAbstract": false, + "isGetter": true, + "isInline": false, + "isMutating": true, + "isOverride": false, + "isVirtual": false, + "methodId": null, + "name": "test2", + "origin": "user", + "params": [], + "returns": { + "kind": "ref", + "name": "Int", + "optional": false, + }, + "self": { + "kind": "ref", + "name": "Main", + "optional": false, + }, + }, + }, + "header": null, + "init": { + "ast": { + "id": 94, + "kind": "contract_init", + "loc": contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +}, + "params": [], + "statements": [], + }, + "params": [], + }, + "interfaces": [], + "kind": "contract", + "name": "Main", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [ + { + "ast": { + "attributes": [], + "declarations": [], + "id": 4, + "kind": "trait", + "loc": trait BaseTrait { + +}, + "name": { + "id": 3, + "kind": "id", + "loc": BaseTrait, + "text": "BaseTrait", + }, + "traits": [], + }, + "constants": [], + "dependsOn": [], + "fields": [], + "functions": Map {}, + "header": null, + "init": null, + "interfaces": [], + "kind": "trait", + "name": "BaseTrait", + "origin": "user", + "partialFieldCount": 0, + "receivers": [], + "signature": null, + "tlb": null, + "traits": [], + "uid": 1020, + }, + ], + "uid": 51099, + }, +] +`; + +exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint 2`] = `[]`; + exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1`] = ` [ { diff --git a/src/types/resolveABITypeRef.ts b/src/types/resolveABITypeRef.ts index 098f3fdfa..b343e421f 100644 --- a/src/types/resolveABITypeRef.ts +++ b/src/types/resolveABITypeRef.ts @@ -45,6 +45,10 @@ const intFormats: FormatDef = { ...intOptions, int257: { type: "int", format: 257 }, coins: { type: "uint", format: "coins" }, + varint16: { type: "int", format: "varint16" }, + varint32: { type: "int", format: "varint32" }, + varuint16: { type: "uint", format: "varuint16" }, + varuint32: { type: "uint", format: "varuint32" }, }; export const intMapFormats: FormatDef = { ...intFormats }; diff --git a/src/types/resolveSignatures.ts b/src/types/resolveSignatures.ts index 807c63300..e940bfe47 100644 --- a/src/types/resolveSignatures.ts +++ b/src/types/resolveSignatures.ts @@ -33,6 +33,8 @@ export function resolveSignatures(ctx: CompilerContext) { if (type === "int") { if (typeof format === "number") { return `int${format}`; + } else if (format === "varint16" || format === "varint32") { + return format; } else if (format !== null) { throwInternalCompilerError(`Unsupported int format: ${format}`); } @@ -42,6 +44,8 @@ export function resolveSignatures(ctx: CompilerContext) { return `uint${format}`; } else if (format === "coins") { return `coins`; + } else if (format === "varuint16" || format === "varuint32") { + return format; } else if (format !== null) { throwInternalCompilerError( `Unsupported uint format: ${format}`, diff --git a/src/types/test/map-value-as-varint.tact b/src/types/test/map-value-as-varint.tact new file mode 100644 index 000000000..fba54523e --- /dev/null +++ b/src/types/test/map-value-as-varint.tact @@ -0,0 +1,24 @@ +primitive Int; + +trait BaseTrait { + +} + +contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +} diff --git a/src/types/test/map-value-as-varuint.tact b/src/types/test/map-value-as-varuint.tact new file mode 100644 index 000000000..759dc4637 --- /dev/null +++ b/src/types/test/map-value-as-varuint.tact @@ -0,0 +1,24 @@ +primitive Int; + +trait BaseTrait { + +} + +contract Main { + m1: map; + m2: map; + + get fun test1(): Int { + let m1: map = emptyMap(); + m1.set(1, 2); + self.m1.set(1, 2); + return m1.get(1) + self.m1.get(1); + } + + get fun test2(): Int { + let m2: map = emptyMap(); + m2.set(1, 2); + self.m2.set(1, 2); + return m2.get(1) + self.m2.get(1); + } +} diff --git a/stdlib/std/cells.tact b/stdlib/std/cells.tact index 99c5b7443..2e6bf5dab 100644 --- a/stdlib/std/cells.tact +++ b/stdlib/std/cells.tact @@ -32,6 +32,14 @@ extends native storeBit(self: Builder, value: Bool): Builder; asm extends fun storeCoins(self: Builder, value: Int): Builder { STVARUINT16 } +asm extends fun storeVarInt16(self: Builder, value: Int): Builder { STVARINT16 } + +asm extends fun storeVarInt32(self: Builder, value: Int): Builder { STVARINT32 } + +asm extends fun storeVarUint16(self: Builder, value: Int): Builder { STVARUINT16 } + +asm extends fun storeVarUint32(self: Builder, value: Int): Builder { STVARUINT32 } + asm(cell self) extends fun storeRef(self: Builder, cell: Cell): Builder { STREF } asm extends fun storeSlice(self: Builder, cell: Slice): Builder { STSLICER } diff --git a/stdlib/stdlib.fc b/stdlib/stdlib.fc index 91d461649..1e41379c3 100644 --- a/stdlib/stdlib.fc +++ b/stdlib/stdlib.fc @@ -327,6 +327,11 @@ cell preload_ref(slice s) asm "PLDREF"; (slice, int) load_grams(slice s) asm(-> 1 0) "LDGRAMS"; (slice, int) load_coins(slice s) asm(-> 1 0) "LDVARUINT16"; +(slice, int) load_varint16(slice s) asm(-> 1 0) "LDVARINT16"; +(slice, int) load_varint32(slice s) asm(-> 1 0) "LDVARINT32"; +(slice, int) load_varuint16(slice s) asm(-> 1 0) "LDVARUINT16"; +(slice, int) load_varuint32(slice s) asm(-> 1 0) "LDVARUINT32"; + ;;; Returns all but the first `0 ≤ len ≤ 1023` bits of `slice` [s]. slice skip_bits(slice s, int len) asm "SDSKIPFIRST"; (slice, ()) ~skip_bits(slice s, int len) asm "SDSKIPFIRST"; @@ -450,6 +455,11 @@ builder store_slice(builder b, slice s) asm "STSLICER"; builder store_grams(builder b, int x) asm "STGRAMS"; builder store_coins(builder b, int x) asm "STVARUINT16"; +builder store_varint16(builder b, int x) asm "STVARINT16"; +builder store_varint32(builder b, int x) asm "STVARINT32"; +builder store_varuint16(builder b, int x) asm "STVARUINT16"; +builder store_varuint32(builder b, int x) asm "STVARUINT32"; + ;;; Stores dictionary `D` represented by `cell` [c] or `null` into `builder` [b]. ;;; In other words, stores a `1`-bit and a reference to [c] if [c] is not `null` and `0`-bit otherwise. builder store_dict(builder b, cell c) asm(c b) "STDICT"; diff --git a/tact.config.json b/tact.config.json index cad08c5fa..07bd8e4e2 100644 --- a/tact.config.json +++ b/tact.config.json @@ -80,8 +80,13 @@ "output": "./examples/output" }, { - "name": "maps", - "path": "./src/test/e2e-emulated/contracts/maps.tact", + "name": "maps1", + "path": "./src/test/e2e-emulated/contracts/maps1.tact", + "output": "./src/test/e2e-emulated/contracts/output" + }, + { + "name": "maps2", + "path": "./src/test/e2e-emulated/contracts/maps2.tact", "output": "./src/test/e2e-emulated/contracts/output" }, { From 911e7f049eccefce8770d7e4171e0eb7538bbf7b Mon Sep 17 00:00:00 2001 From: Anton Trunov Date: Thu, 26 Dec 2024 11:12:56 +0400 Subject: [PATCH 26/29] feat(cli): `unboc` utility to expose TVM disassembler via @tact-lang/opcode library (#1259) --- .github/workflows/tact.yml | 6 +++ CHANGELOG.md | 1 + bin/unboc.js | 76 ++++++++++++++++++++++++++++++++++++++ cspell.json | 1 + knip.json | 10 ++++- package.json | 3 +- tsconfig.eslint.json | 3 +- 7 files changed, 96 insertions(+), 4 deletions(-) create mode 100755 bin/unboc.js diff --git a/.github/workflows/tact.yml b/.github/workflows/tact.yml index 81c4eafe2..943c887d4 100644 --- a/.github/workflows/tact.yml +++ b/.github/workflows/tact.yml @@ -173,6 +173,12 @@ jobs: run: | tact -e '(1 + 2 * (pow(3,4) - 2) << 1 & 0x54 | 33 >> 1) * 2 + 2' + - name: CLI Test | Check TVM disassembler flag + if: runner.os != 'Windows' + run: | + tact bin/test/success.tact + unboc bin/test/success_HelloWorld.code.boc + - name: Test compatibility with tact-template run: | git clone https://github.com/tact-lang/tact-template.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 18a355440..1ab9fcc8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Utility for logging errors in code that was supposed to be unreachable: PR [#991](https://github.com/tact-lang/tact/pull/991) - Ability to specify a compile-time message opcode expression: PR [#1188](https://github.com/tact-lang/tact/pull/1188) - The `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer serialization types: PR [#1186](https://github.com/tact-lang/tact/pull/1186) +- `unboc`: a standalone CLI utility to expose Tact's TVM disassembler: PR [#1259](https://github.com/tact-lang/tact/pull/1259) ### Changed diff --git a/bin/unboc.js b/bin/unboc.js new file mode 100755 index 000000000..1b85b532a --- /dev/null +++ b/bin/unboc.js @@ -0,0 +1,76 @@ +#!/usr/bin/env node +/* eslint-disable @typescript-eslint/no-var-requires */ + +const meowModule = import("meow"); +const { decompileAll } = require("@tact-lang/opcode"); +const { readFileSync } = require("fs"); + +const unbocVersion = "0.0.1"; + +void meowModule.then( + /** @param meow {import('meow/build/index')} */ + (meow) => { + const cli = meow.default( + ` + Usage + $ unboc [...flags] BOC-FILE + + Flags + -v, --version Print unboc version and exit + -h, --help Display this text and exit + + Examples + $ unboc --version + ${unbocVersion}`, + { + importMeta: { + url: new URL("file://" + __dirname + __filename).toString(), + }, + description: `Command-line utility to disassemble a BoC (bag of cells) file with code and output TVM instructions to stdout`, + autoVersion: false, + flags: { + version: { shortFlag: "v", type: "boolean" }, + help: { shortFlag: "h", type: "boolean" }, + }, + allowUnknownFlags: false, + }, + ); + + // Show help regardless of other flags + if (cli.flags.help) { + cli.showHelp(0); + } + + // Show version regardless of other flags + if (cli.flags.version) { + console.log(unbocVersion); + process.exit(0); + } + + // Disallow specifying more than one boc file + if (cli.input.length > 1) { + console.error( + "Error: Only one BoC file can be specified at a time.", + ); + cli.showHelp(30); + } + + // Show help when all flags and inputs are empty + // Note, that version/help flags are already processed above and don't need to be mentioned here + if (cli.input.length === 0) { + cli.showHelp(0); + } + + // Main command + try { + const boc = readFileSync(cli.input.at(0)); + const disasmResult = decompileAll({ src: Buffer.from(boc) }); + console.log(disasmResult); + process.exit(0); + } catch (error) { + console.error(error.message); + // https://nodejs.org/docs/v20.12.1/api/process.html#exit-codes + process.exit(30); + } + }, +); diff --git a/cspell.json b/cspell.json index 650ee7101..87f925c8f 100644 --- a/cspell.json +++ b/cspell.json @@ -120,6 +120,7 @@ "Trunov", "typechecker", "uintptr", + "unboc", "uninit", "unixfs", "untypable", diff --git a/knip.json b/knip.json index 99d24972e..5d92b88d7 100644 --- a/knip.json +++ b/knip.json @@ -1,7 +1,13 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", - "entry": ["src/index.ts", "src/main.ts", "src/node.ts", "bin/tact.js"], - "project": ["src/**/*.ts", "bin/tact.js"], + "entry": [ + "src/index.ts", + "src/main.ts", + "src/node.ts", + "bin/tact.js", + "bin/unboc.js" + ], + "project": ["src/**/*.ts", "bin/tact.js", "bin/unboc.js"], "ignore": [ "src/grammar/ast.ts", "src/prettyPrinter.ts", diff --git a/package.json b/package.json index 59de8b843..5751fcbd3 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ ], "main": "./dist/main.js", "bin": { - "tact": "bin/tact.js" + "tact": "bin/tact.js", + "unboc": "bin/unboc.js" }, "dependencies": { "@tact-lang/opcode": "^0.0.16", diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 3213e3cea..50fff32bc 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -9,7 +9,8 @@ "examples/", "scripts/", "./jest.config.js", - "bin/tact.js" + "bin/tact.js", + "bin/unboc.js" ], "exclude": ["**/*.bind.ts", "src/test/**/output/**/*"] } From c34758da9eec69779ccda2794dcfbc2704392e8b Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:16:37 +0100 Subject: [PATCH 27/29] feat(docs): onchain metadata creation for NFTs and Jettons (#1236) --- CHANGELOG.md | 1 + docs/src/content/docs/cookbook/jettons.mdx | 47 +++++++++++ docs/src/content/docs/cookbook/nfts.mdx | 92 ++++++++++++++++++++++ 3 files changed, 140 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ab9fcc8f..7a26a1c71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a note on `dump()` being computationally expensive: PR [#1189](https://github.com/tact-lang/tact/pull/1189) - Fixed links in Chinese translation: PR [#1206](https://github.com/tact-lang/tact/pull/1206) - Added a note on 255 being the maximum number of messages that can be sent during action phase: PR [#1237](https://github.com/tact-lang/tact/pull/1237) +- Added onchain metadata creation for NFTs and Jettons to the cookbook: PR [#1236](https://github.com/tact-lang/tact/pull/1236) ### Release contributors diff --git a/docs/src/content/docs/cookbook/jettons.mdx b/docs/src/content/docs/cookbook/jettons.mdx index 329421f75..9ca6204ce 100644 --- a/docs/src/content/docs/cookbook/jettons.mdx +++ b/docs/src/content/docs/cookbook/jettons.mdx @@ -360,6 +360,53 @@ fun calculateJettonWalletAddress( } ``` +### Onchain metadata creation + +```tact +/// https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#jetton-metadata-example-offchain +fun composeJettonMetadata( + name: String, // full name + description: String, // text description of the Jetton + symbol: String, // "stock ticker" symbol without the $ prefix, like USDT or SCALE + image: String, // link to the image + // There could be other data, see: + // https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#jetton-metadata-attributes +): Cell { + let dict: map = emptyMap(); + dict.set(sha256("name"), name.asMetadataCell()); + dict.set(sha256("description"), description.asMetadataCell()); + dict.set(sha256("symbol"), symbol.asMetadataCell()); + dict.set(sha256("image"), image.asMetadataCell()); + + return beginCell() + .storeUint(0, 8) // a null byte prefix + .storeMaybeRef(dict.asCell()!!) // 1 as a single bit, then a reference + .endCell(); +} + +// Taking flight! +fun poorMansLaunchPad() { + let jettonMetadata = composeJettonMetadata( + "Best Jetton", + "A very descriptive description describing the jetton descriptively", + "JETTON", + "...link to ipfs or somewhere trusted...", + ); +} + +// Prefixes the String with a single null byte and converts it to a Cell +// The null byte prefix is used to express metadata in various standards, like NFT or Jetton +inline extends fun asMetadataCell(self: String): Cell { + return beginTailString().concat(self).toCell(); +} +``` + +:::note[Useful links:] + + [Token Data Standard in TEPs](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#jetton-metadata-attributes) + +::: + :::tip[Hey there!] Didn't find your favorite example of Jetton usage? Have cool implementations in mind? [Contributions are welcome!](https://github.com/tact-lang/tact/issues) diff --git a/docs/src/content/docs/cookbook/nfts.mdx b/docs/src/content/docs/cookbook/nfts.mdx index 613e83459..770d5dee3 100644 --- a/docs/src/content/docs/cookbook/nfts.mdx +++ b/docs/src/content/docs/cookbook/nfts.mdx @@ -323,6 +323,98 @@ contract Example { } ``` +## Onchain metadata creation + +### NFT Collection {#onchain-metadata-nft-collection} + +```tact +/// https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes +fun composeCollectionMetadata( + name: String, // full name + description: String, // text description of the NFT + image: String, // link to the image + // There could be other data, see: + // https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes +): Cell { + let dict: map = emptyMap(); + dict.set(sha256("name"), name.asMetadataCell()); + dict.set(sha256("description"), description.asMetadataCell()); + dict.set(sha256("image"), image.asMetadataCell()); + + return beginCell() + .storeUint(0, 8) // a null byte prefix + .storeMaybeRef(dict.asCell()!!) // 1 as a single bit, then a reference + .endCell(); +} + +// Taking flight! +fun poorMansLaunchPad() { + let collectionMetadata = composeCollectionMetadata( + "Best Collection", + "A very descriptive description describing the collection descriptively", + "...link to ipfs or somewhere trusted...", + ); +} + +// Prefixes the String with a single null byte and converts it to a Cell +// The null byte prefix is used to express metadata in various standards, like NFT or Jetton +inline extends fun asMetadataCell(self: String): Cell { + return beginTailString().concat(self).toCell(); +} +``` + +:::note[Useful links:] + + [Token Data Standard in TEPs](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes)\ + [Off-chain NFT metadata by GetGems](https://github.com/getgems-io/nft-contracts/blob/main/docs/metadata.md) + +::: + +### NFT Item {#onchain-metadata-nft-item} + +```tact +/// https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes +fun composeItemMetadata( + name: String, // full name + description: String, // text description of the NFT + image: String, // link to the image + // There could be other data, see: + // https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes +): Cell { + let dict: map = emptyMap(); + dict.set(sha256("name"), name.asMetadataCell()); + dict.set(sha256("description"), description.asMetadataCell()); + dict.set(sha256("image"), image.asMetadataCell()); + + return beginCell() + .storeUint(0, 8) // a null byte prefix + .storeMaybeRef(dict.asCell()!!) // 1 as a single bit, then a reference + .endCell(); +} + +// Taking flight! +fun poorMansLaunchPad() { + let itemMetadata = composeItemMetadata( + "Best Item", + "A very descriptive description describing the item descriptively", + "...link to ipfs or somewhere trusted...", + ); +} + +// Prefixes the String with a single null byte and converts it to a Cell +// The null byte prefix is used to express metadata in various standards, like NFT or Jetton +inline extends fun asMetadataCell(self: String): Cell { + return beginTailString().concat(self).toCell(); +} +``` + +:::note[Useful links:] + + [Token Data Standard in TEPs](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes)\ + [Off-chain NFT metadata by GetGems](https://github.com/getgems-io/nft-contracts/blob/main/docs/metadata.md) + +::: + :::tip[Hey there!] Didn't find your favorite example of a NFT communication? Have cool implementations in mind? [Contributions are welcome!](https://github.com/tact-lang/tact/issues) From 35f02fcefb5d7596abb3d2105c615fd7df728e7d Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:00:02 +0400 Subject: [PATCH 28/29] chore(docs): typescript styleguide additions (#1264) --- CONTRIBUTING.md | 4 ++++ STYLEGUIDE.md | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52f682eff..257c6cf74 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,10 @@ Updating a subset of the test snapshots can be done like so: yarn test -u spec-name-pattern1 spec-name-pattern2 ``` +## Code quality + +To pass review, code has to conform to our [styleguide](/STYLEGUIDE.md). + ## Linting To pass CI, one needs to have a warning-free build. To run all the lints described below execute the following command in your terminal: diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 8b64e26bc..aff09e7ee 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -1,4 +1,4 @@ -# Styleguide +# TypeScript Styleguide Due to stringent security and correctness requirements we have to use a subset of TypeScript features that are known to be _less unsound_. @@ -22,7 +22,7 @@ Prefer the most simple and basic language features. - **Don't use `as`**, except `as const`. It was meant for gradually typing legacy code, not for production use in TS-native projects. Often `x as T` actually was meant to be `const y: T = x;` or `x satisfies T`. - **Don't use `any`.** Its actual meaning is "completely disregard type errors here". Prefer `unknown` or `never`. -- **Don't use guard types `x is T`.** These are just `as` in disguise. Might be used in very simple cases, such as ADT boilerplate. +- **Don't use guard types `x is T`.** These are just `as` in disguise: `const foo = (x: 1 | 2): x is 1 => x === 2;`. Might be used in very simple cases, such as ADT boilerplate. - **Don't use overloading**. It's almost the same as intersection types, and intersection types are broken. - **Don't use `@ts-ignore`.** It's a worse version of `as` that can take TS compiler into an arbitrary incorrect state. - **Don't use `x!` operator.** It does no checks at runtime, and is essentially `x as NotNull`. @@ -68,10 +68,10 @@ export const includes = ( ### Don't use JS object "features" -- **Don't use optional fields** `foo?: Bar`. Every `?` doubles number of cases that should be tested. Eventually some combination of non-defined and undefined fields will be non-semantic. +- **Don't use optional fields** `foo?: Bar`. Every `?` doubles number of cases that should be tested. Eventually some combination of non-defined and undefined fields will be non-semantic. Prefer at least an explicit `foo: Bar | undefined`, or better create a type with descriptive name to make it a proper tagged union. - _**Don't use optional fields**_. In JS there is a distinction between field that is not defined and a field that is `undefined` (sic). `'a' in {} === false`, `'a' in { a: undefined } === true`. TypeScript doesn't handle this properly in its type system. - **Don't use `Proxy`**. These break type safety, are incorrectly handled in debuggers, lead to very unexpected heisenbugs. -- **Don't use `get` and `set`**. See `Proxy` above. +- **Don't use `get` and `set`**. See `Proxy` above. Use explicit `getFoo` and `setFoo` functions, or just avoid mutable state. - **Don't use `...` with objects**. It will require intersection types or inheritance to type. Prefer aggregation: `{ ...a, b }` → `{ a, b }`. - **Don't use `interface ... extends`**. There is no way to safely distinguish objects supporting parent and child interfaces at runtime. - Except where it's required to untie type recursion. For example `type Foo = A` would only work as `interface Foo extends A {}` @@ -112,9 +112,11 @@ export const includes = ( ### Other considerations +- **Avoid unnecessary switch**. Switch statements require extra considerations for unexpected passthrough, are bulky, and take an extra function to make exhaustive checks work. Unless use of `switch` can be somehow rationalized, prefer `makeVisitor` from `src/utils/tricks.ts`. +- **Avoid unnecessary bigint**. We have to work with `bigint`, because TVM supports ints of 257 bit length, but in rest of the code `bigint` would only cause issues with debugging it. - **Beware of `${}`** in template strings. Any inlining succeeds, and there won't be any compile-time errors even if it's a function `${(x: number) => x}`. - **Avoid `null`**. `typeof null === 'object'`, and there is `undefined` anyway. -- **Avoid exceptions**. Exceptions are untyped. +- **Avoid exceptions**. Exceptions are untyped. Pass error continuations explicitly `(onFooError: () => T) => T`. Example can be found in `src/grammar/parser-error.ts`. - **Avoid tuples**. TS gives them minimal distinction from arrays, and type system is broken around them. Occasionally for performance reasons tuples might be a better option than objects. - **Avoid `enum`**. It's equivalent to unions since 5.0, except generates boilerplate JS code. A version that doesn't generate extraneous code, `const enum`, is not properly supported by `babel`. - **Avoid iterators**. They're untypable unless fixed in JS standard. Prefer generators. Prefer iterating with `for (... of ...)`. From da4b8d82128cf4b6f9b04d93a93a9382407112c2 Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:56:12 +0400 Subject: [PATCH 29/29] refactor/fix/feat: new parser (#1258) Fixes some parsing bugs and improves error messages. --- .eslintignore | 1 + .prettierignore | 5 +- CHANGELOG.md | 1 + cspell.json | 5 + docs/src/content/docs/book/config.mdx | 29 + knip.json | 1 + package.json | 6 +- scripts/copy-files.ts | 2 +- src/check.ts | 3 +- src/config/parseConfig.ts | 4 + src/generator/writers/resolveFuncType.spec.ts | 5 +- src/generator/writers/writeExpression.spec.ts | 3 +- .../writers/writeSerialization.spec.ts | 3 +- src/grammar/ast-typed.ts | 596 + src/grammar/ast.ts | 45 +- src/grammar/grammar.spec.ts | 45 - src/grammar/grammar.ts | 1574 +-- .../next/__snapshots__/grammar.spec.ts.snap | 10913 ++++++++++++++++ src/grammar/next/grammar.gg | 342 + src/grammar/next/grammar.spec.ts | 29 + src/grammar/next/grammar.ts | 516 + src/grammar/next/index.ts | 1288 ++ src/grammar/parser-error.ts | 73 +- .../__snapshots__/grammar.spec.ts.snap | 10 - src/grammar/{ => prev}/grammar.ohm | 0 src/grammar/prev/grammar.spec.ts | 29 + src/grammar/prev/grammar.ts | 1566 +++ src/grammar/prev/parser-error.ts | 27 + src/grammar/prev/src-info.ts | 13 + src/grammar/src-info.ts | 15 +- src/grammar/test-asm/embed-asm-fif.tact | 1655 --- src/grammar/test-asm/embed-fift-fif.tact | 150 - .../test-asm/embed-other-libs-fif.tact | 1207 -- src/grammar/test-failed/items-asm-fun-6.tact | 3 - src/grammar/test/expr-equality.spec.ts | 3 +- src/grammar/test/expr-is-value.spec.ts | 3 +- src/imports/resolveImports.spec.ts | 3 +- src/interpreter.ts | 3 +- src/optimizer/test/partial-eval.spec.ts | 5 +- src/pipeline/build.ts | 4 +- .../resolveAllocation.spec.ts.snap | 10 +- src/storage/resolveAllocation.spec.ts | 3 +- src/test/compare.spec.ts | 3 +- src/test/prettyPrinter.spec.ts | 5 +- src/test/rename.spec.ts | 3 +- .../resolveDescriptors.spec.ts.snap | 876 +- src/types/resolveDescriptors.spec.ts | 5 +- src/types/resolveStatements.spec.ts | 5 +- src/utils/tricks.ts | 24 +- yarn.lock | 55 + 50 files changed, 16022 insertions(+), 5152 deletions(-) create mode 100644 src/grammar/ast-typed.ts delete mode 100644 src/grammar/grammar.spec.ts create mode 100644 src/grammar/next/__snapshots__/grammar.spec.ts.snap create mode 100644 src/grammar/next/grammar.gg create mode 100644 src/grammar/next/grammar.spec.ts create mode 100644 src/grammar/next/grammar.ts create mode 100644 src/grammar/next/index.ts rename src/grammar/{ => prev}/__snapshots__/grammar.spec.ts.snap (99%) rename src/grammar/{ => prev}/grammar.ohm (100%) create mode 100644 src/grammar/prev/grammar.spec.ts create mode 100644 src/grammar/prev/grammar.ts create mode 100644 src/grammar/prev/parser-error.ts create mode 100644 src/grammar/prev/src-info.ts delete mode 100644 src/grammar/test-asm/embed-asm-fif.tact delete mode 100644 src/grammar/test-asm/embed-fift-fif.tact delete mode 100644 src/grammar/test-asm/embed-other-libs-fif.tact delete mode 100644 src/grammar/test-failed/items-asm-fun-6.tact diff --git a/.eslintignore b/.eslintignore index ba91e95c6..1ee328705 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,6 +6,7 @@ src/test/**/output/ src/func/funcfiftlib.js **/grammar.ohm*.ts **/grammar.ohm*.js +src/grammar/next/grammar.ts jest.setup.js jest.teardown.js /docs diff --git a/.prettierignore b/.prettierignore index 22b7dfce4..7c95c4b4c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1,9 @@ /dist /src/func/funcfiftlib.js /src/func/funcfiftlib.wasm.js -/src/grammar/grammar.ohm-bundle.d.ts -/src/grammar/grammar.ohm-bundle.js +/src/grammar/prev/grammar.ohm-bundle.d.ts +/src/grammar/prev/grammar.ohm-bundle.js +src/grammar/next/grammar.ts /src/imports/stdlib.ts /grammar /docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a26a1c71..8a9378fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ability to specify a compile-time message opcode expression: PR [#1188](https://github.com/tact-lang/tact/pull/1188) - The `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer serialization types: PR [#1186](https://github.com/tact-lang/tact/pull/1186) - `unboc`: a standalone CLI utility to expose Tact's TVM disassembler: PR [#1259](https://github.com/tact-lang/tact/pull/1259) +- Added alternative parser: PR [#1258](https://github.com/tact-lang/tact/pull/1258) ### Changed diff --git a/cspell.json b/cspell.json index 87f925c8f..233921bb1 100644 --- a/cspell.json +++ b/cspell.json @@ -67,6 +67,7 @@ "Korshakov", "Laika", "langle", + "langtools", "Liskov", "lparen", "lvalue", @@ -87,6 +88,7 @@ "Novus", "Offchain", "Parens", + "pgen", "pinst", "POSIX", "postpack", @@ -117,6 +119,7 @@ "Topup", "Toncoin", "Toncoins", + "tonstudio", "Trunov", "typechecker", "uintptr", @@ -154,6 +157,8 @@ "src/grammar/test/items-asm-funs.tact", "src/grammar/test-asm/*.tact", "src/grammar/test-failed/funcid-*.tact", + "src/grammar/next/grammar.gg", + "src/grammar/next/grammar.ts", "src/imports/stdlib.ts", "/src/test/compilation-failed/const-eval-failed.spec.ts", "src/test/e2e-emulated/address.spec.ts", diff --git a/docs/src/content/docs/book/config.mdx b/docs/src/content/docs/book/config.mdx index 10c5ded51..0b3f1791d 100644 --- a/docs/src/content/docs/book/config.mdx +++ b/docs/src/content/docs/book/config.mdx @@ -248,6 +248,35 @@ If set to `true{:json}`, enables generation of a [getter](/book/contracts#getter ::: +#### `parser` {#options-parser} + +`"new"{:json}` by default. + +If set to `new{:json}`, Tact will compile with a new language parser. + +If set to `old{:json}`, Tact will compile with an old language parser. + +```json filename="tact.config.json" {8,14} +{ + "projects": [ + { + "name": "some_prefix", + "path": "./contract.tact", + "output": "./contract_output", + "options": { + "debug": true + } + }, + { + "name": "ContractUnderBlueprint", + "options": { + "debug": true + } + } + ] +} +``` + #### `experimental` {#options-experimental} Experimental options that might be removed in the future. Use with caution! diff --git a/knip.json b/knip.json index 5d92b88d7..34a0b0e6b 100644 --- a/knip.json +++ b/knip.json @@ -13,6 +13,7 @@ "src/prettyPrinter.ts", "src/error/display-to-json.ts", "src/grammar/src-info.ts", + "src/grammar/next/grammar.ts", ".github/workflows/tact*.yml" ], "ignoreDependencies": ["@tact-lang/ton-abi"] diff --git a/package.json b/package.json index 5751fcbd3..ff217b207 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "author": "Steve Korshakov ", "license": "MIT", "scripts": { - "gen:grammar": "ohm generateBundles --withTypes src/grammar/*.ohm", + "gen:grammar:old": "ohm generateBundles --withTypes src/grammar/prev/*.ohm", + "gen:grammar:new": "pgen src/grammar/next/grammar.gg -o src/grammar/next/grammar.ts", + "gen:grammar": "yarn gen:grammar:old && yarn gen:grammar:new", "gen:pack": "ts-node ./scripts/pack.ts", "gen:compiler": "ts-node ./scripts/prepare.ts", "gen": "yarn gen:grammar && yarn gen:pack && yarn gen:compiler", @@ -50,6 +52,7 @@ "@tact-lang/opcode": "^0.0.16", "@ton/core": "0.59.1", "@ton/crypto": "^3.2.0", + "@tonstudio/parser-runtime": "^0.0.1", "blockstore-core": "1.0.5", "change-case": "^4.1.2", "crc-32": "1.2.2", @@ -70,6 +73,7 @@ "@tact-lang/ton-jest": "^0.0.4", "@ton/sandbox": "^0.23.0", "@ton/test-utils": "^0.4.2", + "@tonstudio/pgen": "^0.0.1", "@types/glob": "^8.1.0", "@types/jest": "^29.5.12", "@types/json-bigint": "^1.0.4", diff --git a/scripts/copy-files.ts b/scripts/copy-files.ts index ae69bcd37..39fd923c3 100644 --- a/scripts/copy-files.ts +++ b/scripts/copy-files.ts @@ -11,7 +11,7 @@ const cp = async (fromGlob: string, toPath: string) => { const main = async () => { try { - await cp("./src/grammar/grammar.ohm*", "./dist/grammar/"); + await cp("./src/grammar/prev/grammar.ohm*", "./dist/grammar/prev/"); await cp("./src/func/funcfiftlib.*", "./dist/func/"); } catch (e) { console.error(e); diff --git a/src/check.ts b/src/check.ts index 27584a5e0..ce5a19253 100644 --- a/src/check.ts +++ b/src/check.ts @@ -5,6 +5,7 @@ import { getParser } from "./grammar"; import files from "./imports/stdlib"; import { createVirtualFileSystem, TactError, VirtualFileSystem } from "./main"; import { precompile } from "./pipeline/precompile"; +import { defaultParser } from "./grammar/grammar"; export type CheckResultItem = { type: "error" | "warning"; @@ -37,7 +38,7 @@ export function check(args: { ctx = featureEnable(ctx, "external"); // Enable external messages flag to avoid external-specific errors const ast = getAstFactory(); - const parser = getParser(ast); + const parser = getParser(ast, defaultParser); // Execute check const items: CheckResultItem[] = []; diff --git a/src/config/parseConfig.ts b/src/config/parseConfig.ts index 1aa303f45..ac798d23e 100644 --- a/src/config/parseConfig.ts +++ b/src/config/parseConfig.ts @@ -27,6 +27,10 @@ export const optionsSchema = z * Read more: https://docs.tact-lang.org/book/contracts#interfaces */ interfacesGetter: z.boolean().optional(), + /** + * If set to "new", uses new parser. If set to "old", uses legacy parser. Default is "old". + */ + parser: z.union([z.literal("new"), z.literal("old")]).optional(), /** * Experimental options that might be removed in the future. Use with caution! */ diff --git a/src/generator/writers/resolveFuncType.spec.ts b/src/generator/writers/resolveFuncType.spec.ts index e30743422..d41fca3c6 100644 --- a/src/generator/writers/resolveFuncType.spec.ts +++ b/src/generator/writers/resolveFuncType.spec.ts @@ -5,6 +5,7 @@ import { resolveFuncType } from "./resolveFuncType"; import { openContext } from "../../grammar/store"; import { CompilerContext } from "../../context"; import { getParser } from "../../grammar"; +import { defaultParser } from "../../grammar/grammar"; const primitiveCode = ` primitive Int; @@ -52,7 +53,7 @@ describe("resolveFuncType", () => { new CompilerContext(), [{ code: primitiveCode, path: "", origin: "user" }], [], - getParser(ast), + getParser(ast, defaultParser), ); ctx = resolveDescriptors(ctx, ast); const wCtx = new WriterContext(ctx, "Contract1"); @@ -121,7 +122,7 @@ describe("resolveFuncType", () => { new CompilerContext(), [{ code: primitiveCode, path: "", origin: "user" }], [], - getParser(ast), + getParser(ast, defaultParser), ); ctx = resolveDescriptors(ctx, ast); const wCtx = new WriterContext(ctx, "Contract1"); diff --git a/src/generator/writers/writeExpression.spec.ts b/src/generator/writers/writeExpression.spec.ts index 4409dc8db..2b12b8d95 100644 --- a/src/generator/writers/writeExpression.spec.ts +++ b/src/generator/writers/writeExpression.spec.ts @@ -9,6 +9,7 @@ import { resolveStatements } from "../../types/resolveStatements"; import { CompilerContext } from "../../context"; import { getParser } from "../../grammar"; import { getAstFactory } from "../../grammar/ast"; +import { defaultParser } from "../../grammar/grammar"; const code = ` @@ -75,7 +76,7 @@ describe("writeExpression", () => { new CompilerContext(), [{ code: code, path: "", origin: "user" }], [], - getParser(ast), + getParser(ast, defaultParser), ); ctx = resolveDescriptors(ctx, ast); ctx = resolveStatements(ctx); diff --git a/src/generator/writers/writeSerialization.spec.ts b/src/generator/writers/writeSerialization.spec.ts index 316c88160..11279ee7d 100644 --- a/src/generator/writers/writeSerialization.spec.ts +++ b/src/generator/writers/writeSerialization.spec.ts @@ -15,6 +15,7 @@ import { openContext } from "../../grammar/store"; import { writeAccessors } from "./writeAccessors"; import { getParser } from "../../grammar"; import { getAstFactory } from "../../grammar/ast"; +import { defaultParser } from "../../grammar/grammar"; const code = ` primitive Int; @@ -64,7 +65,7 @@ describe("writeSerialization", () => { new CompilerContext(), [{ code, path: "", origin: "user" }], [], - getParser(ast), + getParser(ast, defaultParser), ); ctx = resolveDescriptors(ctx, ast); ctx = resolveAllocations(ctx); diff --git a/src/grammar/ast-typed.ts b/src/grammar/ast-typed.ts new file mode 100644 index 000000000..d86aab280 --- /dev/null +++ b/src/grammar/ast-typed.ts @@ -0,0 +1,596 @@ +/** + * AST node constructors are not just constructors: they also generate ids + * We have this file so that the "current id" state would not be stored globally + */ + +import { Loc } from "@tonstudio/parser-runtime"; +import * as A from "./ast"; +import { SrcInfo } from "./src-info"; + +export const getAstSchema = ( + factory: A.FactoryAst, + toSrcInfo: (location: Loc) => SrcInfo, +) => { + const createNode = (src: Omit): T => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return factory.createNode(src as any) as T; + }; + + return { + Module: ( + imports: A.AstImport[], + items: A.AstModuleItem[], + ): A.AstModule => + createNode({ kind: "module", imports, items }), + Import: (path: A.AstString, loc: Loc): A.AstImport => + createNode({ + kind: "import", + path, + loc: toSrcInfo(loc), + }), + PrimitiveTypeDecl: (name: A.AstId, loc: Loc): A.AstPrimitiveTypeDecl => + createNode({ + kind: "primitive_type_decl", + name, + loc: toSrcInfo(loc), + }), + FunctionDef: ( + attributes: A.AstFunctionAttribute[], + name: A.AstId, + retType: A.AstType | null, + params: A.AstTypedParameter[], + statements: A.AstStatement[], + loc: Loc, + ): A.AstFunctionDef => + createNode({ + kind: "function_def", + attributes, + name, + return: retType, + params, + statements, + loc: toSrcInfo(loc), + }), + AsmFunctionDef: ( + shuffle: A.AstAsmShuffle, + attributes: A.AstFunctionAttribute[], + name: A.AstId, + retType: A.AstType | null, + params: A.AstTypedParameter[], + instructions: A.AstAsmInstruction[], + loc: Loc, + ): A.AstAsmFunctionDef => + createNode({ + kind: "asm_function_def", + shuffle, + attributes, + name, + return: retType, + params, + instructions, + loc: toSrcInfo(loc), + }), + FunctionDecl: ( + attributes: A.AstFunctionAttribute[], + name: A.AstId, + retType: A.AstType | null, + params: A.AstTypedParameter[], + loc: Loc, + ): A.AstFunctionDecl => + createNode({ + kind: "function_decl", + attributes, + name, + return: retType, + params, + loc: toSrcInfo(loc), + }), + NativeFunctionDecl: ( + attributes: A.AstFunctionAttribute[], + name: A.AstId, + nativeName: A.AstFuncId, + params: A.AstTypedParameter[], + retType: A.AstType | null, + loc: Loc, + ): A.AstNativeFunctionDecl => + createNode({ + kind: "native_function_decl", + attributes, + name, + nativeName, + params, + return: retType, + loc: toSrcInfo(loc), + }), + ConstantDef: ( + attributes: A.AstConstantAttribute[], + name: A.AstId, + type: A.AstType, + initializer: A.AstExpression, + loc: Loc, + ): A.AstConstantDef => + createNode({ + kind: "constant_def", + attributes, + name, + type, + initializer, + loc: toSrcInfo(loc), + }), + ConstantDecl: ( + attributes: A.AstConstantAttribute[], + name: A.AstId, + type: A.AstType, + loc: Loc, + ): A.AstConstantDecl => + createNode({ + kind: "constant_decl", + attributes, + name, + type, + loc: toSrcInfo(loc), + }), + StructDecl: ( + name: A.AstId, + fields: A.AstFieldDecl[], + loc: Loc, + ): A.AstStructDecl => + createNode({ + kind: "struct_decl", + name, + fields, + loc: toSrcInfo(loc), + }), + MessageDecl: ( + name: A.AstId, + opcode: A.AstExpression | null, + fields: A.AstFieldDecl[], + loc: Loc, + ): A.AstMessageDecl => + createNode({ + kind: "message_decl", + name, + opcode, + fields, + loc: toSrcInfo(loc), + }), + Contract: ( + name: A.AstId, + traits: A.AstId[], + attributes: A.AstContractAttribute[], + declarations: A.AstContractDeclaration[], + loc: Loc, + ): A.AstContract => + createNode({ + kind: "contract", + name, + traits, + attributes, + declarations, + loc: toSrcInfo(loc), + }), + Trait: ( + name: A.AstId, + traits: A.AstId[], + attributes: A.AstContractAttribute[], + declarations: A.AstTraitDeclaration[], + loc: Loc, + ): A.AstTrait => + createNode({ + kind: "trait", + name, + traits, + attributes, + declarations, + loc: toSrcInfo(loc), + }), + FieldDecl: ( + name: A.AstId, + type: A.AstType, + initializer: A.AstExpression | null, + as: A.AstId | null, + loc: Loc, + ): A.AstFieldDecl => + createNode({ + kind: "field_decl", + name, + type, + initializer, + as, + loc: toSrcInfo(loc), + }), + Receiver: ( + selector: A.AstReceiverKind, + statements: A.AstStatement[], + loc: Loc, + ): A.AstReceiver => + createNode({ + kind: "receiver", + selector, + statements, + loc: toSrcInfo(loc), + }), + ContractInit: ( + params: A.AstTypedParameter[], + statements: A.AstStatement[], + loc: Loc, + ): A.AstContractInit => + createNode({ + kind: "contract_init", + params, + statements, + loc: toSrcInfo(loc), + }), + StatementLet: ( + name: A.AstId, + type: A.AstType | null, + expression: A.AstExpression, + loc: Loc, + ): A.AstStatementLet => + createNode({ + kind: "statement_let", + name, + type, + expression, + loc: toSrcInfo(loc), + }), + StatementDestruct: ( + type: A.AstTypeId, + identifiers: Map, + ignoreUnspecifiedFields: boolean, + expression: A.AstExpression, + loc: Loc, + ): A.AstStatementDestruct => + createNode({ + kind: "statement_destruct", + type, + identifiers, + ignoreUnspecifiedFields, + expression, + loc: toSrcInfo(loc), + }), + StatementReturn: ( + expression: A.AstExpression | null, + loc: Loc, + ): A.AstStatementReturn => + createNode({ + kind: "statement_return", + expression, + loc: toSrcInfo(loc), + }), + StatementExpression: ( + expression: A.AstExpression, + loc: Loc, + ): A.AstStatementExpression => + createNode({ + kind: "statement_expression", + expression, + loc: toSrcInfo(loc), + }), + StatementAssign: ( + path: A.AstExpression, + expression: A.AstExpression, + loc: Loc, + ): A.AstStatementAssign => + createNode({ + kind: "statement_assign", + path, + expression, + loc: toSrcInfo(loc), + }), + StatementAugmentedAssign: ( + op: A.AstAugmentedAssignOperation, + path: A.AstExpression, + expression: A.AstExpression, + loc: Loc, + ): A.AstStatementAugmentedAssign => + createNode({ + kind: "statement_augmentedassign", + op, + path, + expression, + loc: toSrcInfo(loc), + }), + Condition: ( + condition: A.AstExpression, + trueStatements: A.AstStatement[], + falseStatements: A.AstStatement[] | null, + elseif: A.AstCondition | null, + loc: Loc, + ): A.AstCondition => + createNode({ + kind: "statement_condition", + condition, + trueStatements, + falseStatements, + elseif, + loc: toSrcInfo(loc), + }), + StatementWhile: ( + condition: A.AstExpression, + statements: A.AstStatement[], + loc: Loc, + ): A.AstStatementWhile => + createNode({ + kind: "statement_while", + condition, + statements, + loc: toSrcInfo(loc), + }), + StatementUntil: ( + condition: A.AstExpression, + statements: A.AstStatement[], + loc: Loc, + ): A.AstStatementUntil => + createNode({ + kind: "statement_until", + condition, + statements, + loc: toSrcInfo(loc), + }), + StatementRepeat: ( + iterations: A.AstExpression, + statements: A.AstStatement[], + loc: Loc, + ): A.AstStatementRepeat => + createNode({ + kind: "statement_repeat", + iterations, + statements, + loc: toSrcInfo(loc), + }), + StatementTry: ( + statements: A.AstStatement[], + loc: Loc, + ): A.AstStatementTry => + createNode({ + kind: "statement_try", + statements, + loc: toSrcInfo(loc), + }), + StatementTryCatch: ( + statements: A.AstStatement[], + catchName: A.AstId, + catchStatements: A.AstStatement[], + loc: Loc, + ): A.AstStatementTryCatch => + createNode({ + kind: "statement_try_catch", + statements, + catchName, + catchStatements, + loc: toSrcInfo(loc), + }), + StatementForEach: ( + keyName: A.AstId, + valueName: A.AstId, + map: A.AstExpression, + statements: A.AstStatement[], + loc: Loc, + ): A.AstStatementForEach => + createNode({ + kind: "statement_foreach", + keyName, + valueName, + map, + statements, + loc: toSrcInfo(loc), + }), + TypeId: (text: string, loc: Loc): A.AstTypeId => + createNode({ + kind: "type_id", + text, + loc: toSrcInfo(loc), + }), + OptionalType: (typeArg: A.AstType, loc: Loc): A.AstOptionalType => + createNode({ + kind: "optional_type", + typeArg, + loc: toSrcInfo(loc), + }), + MapType: ( + keyType: A.AstTypeId, + keyStorageType: A.AstId | null, + valueType: A.AstTypeId, + valueStorageType: A.AstId | null, + loc: Loc, + ): A.AstMapType => + createNode({ + kind: "map_type", + keyType, + keyStorageType, + valueType, + valueStorageType, + loc: toSrcInfo(loc), + }), + BouncedMessageType: ( + messageType: A.AstTypeId, + loc: Loc, + ): A.AstBouncedMessageType => + createNode({ + kind: "bounced_message_type", + messageType, + loc: toSrcInfo(loc), + }), + OpBinary: ( + op: A.AstBinaryOperation, + left: A.AstExpression, + right: A.AstExpression, + loc: Loc, + ): A.AstOpBinary => + createNode({ + kind: "op_binary", + op, + left, + right, + loc: toSrcInfo(loc), + }), + OpUnary: ( + op: A.AstUnaryOperation, + operand: A.AstExpression, + loc: Loc, + ): A.AstOpUnary => + createNode({ + kind: "op_unary", + op, + operand, + loc: toSrcInfo(loc), + }), + FieldAccess: ( + aggregate: A.AstExpression, + field: A.AstId, + loc: Loc, + ): A.AstFieldAccess => + createNode({ + kind: "field_access", + aggregate, + field, + loc: toSrcInfo(loc), + }), + MethodCall: ( + self: A.AstExpression, + method: A.AstId, + args: A.AstExpression[], + loc: Loc, + ): A.AstMethodCall => + createNode({ + kind: "method_call", + self, + method, + args, + loc: toSrcInfo(loc), + }), + StaticCall: ( + funcId: A.AstId, + args: A.AstExpression[], + loc: Loc, + ): A.AstStaticCall => + createNode({ + kind: "static_call", + function: funcId, + args, + loc: toSrcInfo(loc), + }), + StructInstance: ( + type: A.AstId, + args: A.AstStructFieldInitializer[], + loc: Loc, + ): A.AstStructInstance => + createNode({ + kind: "struct_instance", + type, + args, + loc: toSrcInfo(loc), + }), + StructFieldInitializer: ( + field: A.AstId, + initializer: A.AstExpression, + loc: Loc, + ): A.AstStructFieldInitializer => + createNode({ + kind: "struct_field_initializer", + field, + initializer, + loc: toSrcInfo(loc), + }), + InitOf: ( + contract: A.AstId, + args: A.AstExpression[], + loc: Loc, + ): A.AstInitOf => + createNode({ + kind: "init_of", + contract, + args, + loc: toSrcInfo(loc), + }), + Conditional: ( + condition: A.AstExpression, + thenBranch: A.AstExpression, + elseBranch: A.AstExpression, + loc: Loc, + ): A.AstConditional => + createNode({ + kind: "conditional", + condition, + thenBranch, + elseBranch, + loc: toSrcInfo(loc), + }), + Id: (text: string, loc: Loc): A.AstId => + createNode({ kind: "id", text, loc: toSrcInfo(loc) }), + FuncId: (text: string, loc: Loc): A.AstFuncId => + createNode({ + kind: "func_id", + text, + loc: toSrcInfo(loc), + }), + Null: (loc: Loc): A.AstNull => + createNode({ kind: "null", loc: toSrcInfo(loc) }), + String: (value: string, loc: Loc): A.AstString => + createNode({ + kind: "string", + value, + loc: toSrcInfo(loc), + }), + Boolean: (value: boolean, loc: Loc): A.AstBoolean => + createNode({ + kind: "boolean", + value, + loc: toSrcInfo(loc), + }), + Number: (base: A.AstNumberBase, value: bigint, loc: Loc): A.AstNumber => + createNode({ + kind: "number", + base, + value, + loc: toSrcInfo(loc), + }), + ContractAttribute: ( + name: A.AstString, + loc: Loc, + ): A.AstContractAttribute => + createNode({ + type: "interface", + name, + loc: toSrcInfo(loc), + }), + FunctionAttributeGet: ( + methodId: A.AstExpression | null, + loc: Loc, + ): A.AstFunctionAttributeGet => ({ + kind: "function_attribute", + type: "get", + methodId, + loc: toSrcInfo(loc), + }), + FunctionAttribute: ( + type: A.AstFunctionAttributeName, + loc: Loc, + ): A.AstFunctionAttributeRest => ({ + kind: "function_attribute", + type, + loc: toSrcInfo(loc), + }), + ConstantAttribute: ( + type: A.AstConstantAttributeName, + loc: Loc, + ): A.AstConstantAttribute => ({ type, loc: toSrcInfo(loc) }), + TypedParameter: ( + name: A.AstId, + type: A.AstType, + loc: Loc, + ): A.AstTypedParameter => + createNode({ + kind: "typed_parameter", + name, + type, + loc: toSrcInfo(loc), + }), + }; +}; + +/** + * List of all constructors for AST nodes + */ +export type AstSchema = ReturnType; diff --git a/src/grammar/ast.ts b/src/grammar/ast.ts index 58b9c5a3a..6c284068a 100644 --- a/src/grammar/ast.ts +++ b/src/grammar/ast.ts @@ -651,10 +651,12 @@ export type AstNull = { export type AstValue = AstNumber | AstBoolean | AstNull | AstString; -export type AstConstantAttribute = - | { type: "virtual"; loc: SrcInfo } - | { type: "override"; loc: SrcInfo } - | { type: "abstract"; loc: SrcInfo }; +export type AstConstantAttributeName = "virtual" | "override" | "abstract"; + +export type AstConstantAttribute = { + type: AstConstantAttributeName; + loc: SrcInfo; +}; export type AstContractAttribute = { type: "interface"; @@ -662,19 +664,30 @@ export type AstContractAttribute = { loc: SrcInfo; }; +export type AstFunctionAttributeGet = { + kind: "function_attribute"; + type: "get"; + methodId: AstExpression | null; + loc: SrcInfo; +}; + +export type AstFunctionAttributeName = + | "mutates" + | "extends" + | "virtual" + | "abstract" + | "override" + | "inline"; + +export type AstFunctionAttributeRest = { + kind: "function_attribute"; + type: AstFunctionAttributeName; + loc: SrcInfo; +}; + export type AstFunctionAttribute = - | { - kind: "function_attribute"; - type: "get"; - methodId: AstExpression | null; - loc: SrcInfo; - } - | { kind: "function_attribute"; type: "mutates"; loc: SrcInfo } - | { kind: "function_attribute"; type: "extends"; loc: SrcInfo } - | { kind: "function_attribute"; type: "virtual"; loc: SrcInfo } - | { kind: "function_attribute"; type: "abstract"; loc: SrcInfo } - | { kind: "function_attribute"; type: "override"; loc: SrcInfo } - | { kind: "function_attribute"; type: "inline"; loc: SrcInfo }; + | AstFunctionAttributeGet + | AstFunctionAttributeRest; export type AstTypedParameter = { kind: "typed_parameter"; diff --git a/src/grammar/grammar.spec.ts b/src/grammar/grammar.spec.ts deleted file mode 100644 index ee7d75f18..000000000 --- a/src/grammar/grammar.spec.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { AstModule, getAstFactory } from "./ast"; -import { loadCases } from "../utils/loadCases"; -import { getParser } from "./grammar"; -import { SrcInfo, isSrcInfo } from "./src-info"; - -expect.addSnapshotSerializer({ - test: (src) => isSrcInfo(src), - print: (src) => (src as SrcInfo).contents, -}); - -describe("grammar", () => { - // Test parsing of known Fift projects, wrapped in asm functions of Tact - for (const r of loadCases(__dirname + "/test-asm/")) { - it("should parse " + r.name, () => { - const ast = getAstFactory(); - const { parse } = getParser(ast); - const parsed: AstModule | undefined = parse( - r.code, - "", - "user", - ); - - // Don't produce snapshots - expect(parsed).toBeDefined(); - }); - } - - for (const r of loadCases(__dirname + "/test/")) { - it("should parse " + r.name, () => { - const ast = getAstFactory(); - const { parse } = getParser(ast); - expect(parse(r.code, "", "user")).toMatchSnapshot(); - }); - } - - for (const r of loadCases(__dirname + "/test-failed/")) { - it("should fail " + r.name, () => { - const ast = getAstFactory(); - const { parse } = getParser(ast); - expect(() => - parse(r.code, "", "user"), - ).toThrowErrorMatchingSnapshot(); - }); - } -}); diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index 29c65dfe4..747e7b11b 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -1,1564 +1,26 @@ -import { Node, IterationNode, NonterminalNode } from "ohm-js"; -import tactGrammar from "./grammar.ohm-bundle"; -import { throwInternalCompilerError } from "../errors"; -import { - AstAugmentedAssignOperation, - AstConstantAttribute, - AstContractAttribute, - AstExpression, - AstFunctionAttribute, - AstNode, - AstModule, - AstReceiverKind, - AstString, - AstType, - AstImport, - AstConstantDef, - AstNumberBase, - AstId, - FactoryAst, -} from "./ast"; -import { getSrcInfoFromOhm, ItemOrigin, SrcInfo } from "./src-info"; -import { parserErrorSchema, ParserErrors } from "./parser-error"; -import { displayToString } from "../error/display-to-string"; +import { getParser as getParserNext } from "./next"; -type Context = { - origin: ItemOrigin | null; - currentFile: string | null; - createNode: FactoryAst["createNode"] | null; - errorTypes: ParserErrors | null; -}; - -const defaultContext: Context = Object.freeze({ - createNode: null, - currentFile: null, - origin: null, - errorTypes: null, -}); - -let context: Context = defaultContext; - -const withContext = (ctx: Context, callback: () => T): T => { - try { - context = ctx; - return callback(); - } finally { - context = defaultContext; - } -}; - -function createRef(s: Node): SrcInfo { - if (context.origin === null) { - throwInternalCompilerError("Parser context was not initialized"); - } - - return getSrcInfoFromOhm(s.source, context.currentFile, context.origin); -} - -const createNode: FactoryAst["createNode"] = (...args) => { - if (context.createNode === null) { - throwInternalCompilerError("Parser context was not initialized"); - } - - return context.createNode(...args); -}; - -const err = () => { - if (context.errorTypes === null) { - throwInternalCompilerError("Parser context was not initialized"); - } - - return context.errorTypes; -}; - -// helper to unwrap optional grammar elements (marked with "?") -// ohm-js represents those essentially as lists (IterationNodes) -function unwrapOptNode( - optional: IterationNode, - f: (n: Node) => T, -): T | null { - const optNode = optional.children[0] as Node | undefined; - return optNode !== undefined ? f(optNode) : null; -} - -function checkVariableName(name: string, loc: SrcInfo) { - if (name.startsWith("__gen")) { - err().reservedVarPrefix("__gen")(loc); - } - if (name.startsWith("__tact")) { - err().reservedVarPrefix("__tact")(loc); - } -} - -const checkAttributes = - (kind: "constant" | "function") => - ( - isAbstract: boolean, - attributes: (AstConstantAttribute | AstFunctionAttribute)[], - loc: SrcInfo, - ) => { - const { duplicate, tooAbstract, notAbstract } = err()[kind]; - const k: Set = new Set(); - for (const a of attributes) { - if (k.has(a.type)) { - duplicate(a.type)(a.loc); - } - k.add(a.type); - } - if (isAbstract && !k.has("abstract")) { - notAbstract()(loc); - } - if (!isAbstract && k.has("abstract")) { - tooAbstract()(loc); - } - }; - -const checkConstAttributes = checkAttributes("constant"); - -const checkFunctionAttributes = checkAttributes("function"); - -const semantics = tactGrammar.createSemantics(); - -semantics.addOperation("astOfModule", { - Module(imports, items) { - return createNode({ - kind: "module", - imports: imports.children.map((item) => item.astOfImport()), - items: items.children.map((item) => item.astOfModuleItem()), - }); - }, -}); - -semantics.addOperation("astOfImport", { - Import(_importKwd, path, _semicolon) { - const pathAST = path.astOfExpression() as AstString; - if (pathAST.value.includes("\\")) { - err().importWithBackslash()(createRef(path)); - } - return createNode({ - kind: "import", - path: pathAST, - loc: createRef(this), - }); - }, -}); - -semantics.addOperation("astOfJustImports", { - JustImports(imports, _restOfInput) { - return imports.children.map((item) => item.astOfImport()); - }, -}); - -semantics.addOperation("astOfModuleItem", { - PrimitiveTypeDecl(_primitive_kwd, typeId, _semicolon) { - checkVariableName(typeId.sourceString, createRef(typeId)); - return createNode({ - kind: "primitive_type_decl", - name: typeId.astOfType(), - loc: createRef(this), - }); - }, - NativeFunctionDecl( - _name, - _lparen1, - funcId, - _rparen1, - funAttributes, - _nativeKwd, - tactId, - params, - _optColon, - optReturnType, - _semicolon, - ) { - checkVariableName(tactId.sourceString, createRef(tactId)); - return createNode({ - kind: "native_function_decl", - attributes: funAttributes.children.map((a) => - a.astOfFunctionAttributes(), - ), - name: tactId.astOfExpression(), - nativeName: funcId.astOfExpression(), - return: unwrapOptNode(optReturnType, (t) => t.astOfType()), - params: params.astsOfList(), - loc: createRef(this), - }); - }, - StructDecl_regular(_structKwd, typeId, _lbrace, fields, _rbrace) { - checkVariableName(typeId.sourceString, createRef(typeId)); - return createNode({ - kind: "struct_decl", - name: typeId.astOfType(), - fields: fields.astsOfList(), - loc: createRef(this), - }); - }, - StructDecl_message( - _messageKwd, - _optLparen, - optIntMsgId, - _optRparen, - typeId, - _lbrace, - fields, - _rbrace, - ) { - checkVariableName(typeId.sourceString, createRef(typeId)); - return createNode({ - kind: "message_decl", - name: typeId.astOfType(), - fields: fields.astsOfList(), - opcode: unwrapOptNode(optIntMsgId, (msgId) => - msgId.astOfExpression(), - ), - loc: createRef(this), - }); - }, - Contract( - attributes, - _contractKwd, - contractId, - _optWithKwd, - optInheritedTraits, - _lbrace, - contractItems, - _rbrace, - ) { - checkVariableName(contractId.sourceString, createRef(contractId)); - return createNode({ - kind: "contract", - name: contractId.astOfExpression(), - attributes: attributes.children.map((ca) => - ca.astOfContractAttributes(), - ), - declarations: contractItems.children.map((item) => - item.astOfItem(), - ), - traits: optInheritedTraits.children[0]?.astsOfList() ?? [], - loc: createRef(this), - }); - }, - Trait( - attributes, - _traitKwd, - traitId, - _optWithKwd, - optInheritedTraits, - _lbrace, - traitItems, - _rbrace, - ) { - checkVariableName(traitId.sourceString, createRef(traitId)); - return createNode({ - kind: "trait", - name: traitId.astOfExpression(), - attributes: attributes.children.map((ca) => - ca.astOfContractAttributes(), - ), - declarations: traitItems.children.map((item) => item.astOfItem()), - traits: optInheritedTraits.children[0]?.astsOfList() ?? [], - loc: createRef(this), - }); - }, - ModuleFunction(fun) { - return fun.astOfItem(); - }, - ModuleConstant(constant) { - const astConstDef: AstConstantDef = constant.astOfItem(); - if (astConstDef.attributes.length !== 0) { - err().topLevelConstantWithAttribute()( - astConstDef.attributes[0]!.loc, - ); - } - return astConstDef; - }, -}); - -// top-level (module-level), contract or trait items: -// constant declarations/definitions, functions, receivers, -// getters, etc. -semantics.addOperation("astOfItem", { - ConstantDefinition( - constAttributes, - _constKwd, - constId, - _colon, - constType, - _equals, - initExpr, - _semicolon, - ) { - const attributes = constAttributes.children.map((a) => - a.astOfConstAttribute(), - ) as AstConstantAttribute[]; - checkConstAttributes(false, attributes, createRef(this)); - return createNode({ - kind: "constant_def", - name: constId.astOfExpression(), - type: constType.astOfType(), - initializer: initExpr.astOfExpression(), - attributes, - loc: createRef(this), - }); - }, - ConstantDeclaration( - constAttributes, - _constKwd, - constId, - _colon, - constType, - _semicolon, - ) { - const attributes = constAttributes.children.map((a) => - a.astOfConstAttribute(), - ) as AstConstantAttribute[]; - checkConstAttributes(true, attributes, createRef(this)); - return createNode({ - kind: "constant_decl", - name: constId.astOfExpression(), - type: constType.astOfType(), - attributes, - loc: createRef(this), - }); - }, - StorageVar(fieldDecl, _semicolon) { - return fieldDecl.astOfDeclaration(); - }, - FunctionDefinition( - funAttributes, - _funKwd, - funId, - funParameters, - _optColon, - optReturnType, - _lbrace, - funBody, - _rbrace, - ) { - const attributes = funAttributes.children.map((a) => - a.astOfFunctionAttributes(), - ) as AstFunctionAttribute[]; - checkVariableName(funId.sourceString, createRef(funId)); - checkFunctionAttributes(false, attributes, createRef(this)); - return createNode({ - kind: "function_def", - attributes, - name: funId.astOfExpression(), - return: unwrapOptNode(optReturnType, (t) => t.astOfType()), - params: funParameters.astsOfList(), - statements: funBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - AsmFunction( - _asmKwd, - optAsmShuffle, - funAttributes, - _funKwd, - funId, - funParameters, - _optColon, - optReturnType, - _lbrace, - asmInstructions, - _rbrace, - ) { - const shuffle = optAsmShuffle.children[0]?.astsOfAsmShuffle() ?? { - args: [], - ret: [], - }; - const attributes = funAttributes.children.map((a) => - a.astOfFunctionAttributes(), - ) as AstFunctionAttribute[]; - checkVariableName(funId.sourceString, createRef(funId)); - checkFunctionAttributes(false, attributes, createRef(this)); - return createNode({ - kind: "asm_function_def", - shuffle, - attributes, - name: funId.astOfExpression(), - return: unwrapOptNode(optReturnType, (t) => t.astOfType()), - params: funParameters.astsOfList(), - instructions: asmInstructions.children.map((s) => - s.astOfAsmInstruction(), - ), - loc: createRef(this), - }); - }, - FunctionDeclaration( - funAttributes, - _funKwd, - funId, - funParameters, - _optColon, - optReturnType, - _semicolon, - ) { - const attributes = funAttributes.children.map((a) => - a.astOfFunctionAttributes(), - ) as AstFunctionAttribute[]; - checkVariableName(funId.sourceString, createRef(funId)); - checkFunctionAttributes(true, attributes, createRef(this)); - return createNode({ - kind: "function_decl", - attributes, - name: funId.astOfExpression(), - return: unwrapOptNode(optReturnType, (t) => t.astOfType()), - params: funParameters.astsOfList(), - loc: createRef(this), - }); - }, - ContractInit(_initKwd, initParameters, _lbrace, initBody, _rbrace) { - return createNode({ - kind: "contract_init", - params: initParameters.astsOfList(), - statements: initBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - Receiver_regular( - _receiveKwd, - _lparen, - optParameter, - _rparen, - _lbrace, - receiverBody, - _rbrace, - ) { - const optParam = optParameter.children[0] as Node | undefined; - const selector: AstReceiverKind = optParam - ? { - kind: "internal-simple", - param: optParam.astOfDeclaration(), - } - : { kind: "internal-fallback" }; - return createNode({ - kind: "receiver", - selector, - statements: receiverBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - Receiver_comment( - _receiveKwd, - _lparen, - comment, - _rparen, - _lbrace, - receiverBody, - _rbrace, - ) { - return createNode({ - kind: "receiver", - selector: { - kind: "internal-comment", - comment: comment.astOfExpression(), - }, - statements: receiverBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - Receiver_bounced( - _bouncedKwd, - _lparen, - parameter, - _rparen, - _lbrace, - receiverBody, - _rbrace, - ) { - return createNode({ - kind: "receiver", - selector: { kind: "bounce", param: parameter.astOfDeclaration() }, - statements: receiverBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - Receiver_externalRegular( - _externalKwd, - _lparen, - optParameter, - _rparen, - _lbrace, - receiverBody, - _rbrace, - ) { - const optParam = optParameter.children[0] as Node | undefined; - const selector: AstReceiverKind = optParam - ? { - kind: "external-simple", - param: optParam.astOfDeclaration(), - } - : { kind: "external-fallback" }; - return createNode({ - kind: "receiver", - selector, - statements: receiverBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - Receiver_externalComment( - _externalKwd, - _lparen, - comment, - _rparen, - _lbrace, - receiverBody, - _rbrace, - ) { - return createNode({ - kind: "receiver", - selector: { - kind: "external-comment", - comment: comment.astOfExpression(), - }, - statements: receiverBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, -}); +import { AstExpression, AstImport, AstModule, FactoryAst } from "./ast"; -// Beginnings of the possible future AST for Fift-asm -semantics.addOperation("astOfAsmInstruction", { - asmInstruction(word) { - return word.sourceString; - }, - AsmInstruction(instruction) { - return instruction.astOfAsmInstruction(); - }, - AsmInstruction_custom(instruction) { - return instruction.astOfAsmInstruction(); - }, - AsmInstruction_internal( - _leftBracket, - _ws1, - instructions, - _rightBracket, - _ws2, - ) { - return [ - "[", - instructions.children.map((s) => s.astOfAsmInstruction()).join(" "), - "]", - ].join(" "); - }, - AsmInstruction_list(_lbrace, _ws1, instructions, _rbrace, _ws2) { - return [ - "{", - instructions.children.map((s) => s.astOfAsmInstruction()).join(" "), - "}", - ].join(" "); - }, - AsmInstruction_listNoStateCheck( - _lbrace, - _ws1, - instructions, - _rbrace, - _ws2, - ) { - return [ - "({)", - instructions.children.map((s) => s.astOfAsmInstruction()).join(" "), - "(})", - ].join(" "); - }, - AsmInstruction_string( - startQuotationMarkWord, - string, - _endQuotationMark, - _ws, - ) { - return `${startQuotationMarkWord.sourceString}${string.sourceString}"`; - }, - AsmInstruction_tick(_singleQuote, _ws1, instruction) { - return `' ${instruction.sourceString}`; - }, - AsmInstruction_char(_word, _ws1, char, _ws2) { - return `char ${char.sourceString}`; - }, - AsmInstruction_hexLiteral(prefix, digits, optUnderscore, _rbrace, _ws) { - const length = digits.numChildren; - const underscore = unwrapOptNode(optUnderscore, (t) => t.sourceString); - if (length > 128) { - err().literalTooLong()(createRef(this)); - } - return `${prefix.sourceString}${digits.sourceString}${underscore ?? ""}}`; - }, - AsmInstruction_binLiteral(_prefix, digits, _rbrace, _ws) { - const length = digits.numChildren; - if (length > 128) { - err().literalTooLong()(createRef(this)); - } - return `b{${digits.sourceString}}`; - }, -}); +import { getParser as getParserPrev } from "./prev/grammar"; +import { ItemOrigin } from "./src-info"; -semantics.addOperation("astOfFunctionAttributes", { - FunctionAttribute_getter(_getKwd, _optLparen, optMethodId, _optRparen) { - return { - kind: "function_attribute", - type: "get", - methodId: unwrapOptNode(optMethodId, (e) => e.astOfExpression()), - loc: createRef(this), - }; - }, - FunctionAttribute_extends(_) { - return { - kind: "function_attribute", - type: "extends", - loc: createRef(this), - }; - }, - FunctionAttribute_mutates(_) { - return { - kind: "function_attribute", - type: "mutates", - loc: createRef(this), - }; - }, - FunctionAttribute_override(_) { - return { - kind: "function_attribute", - type: "override", - loc: createRef(this), - }; - }, - FunctionAttribute_inline(_) { - return { - kind: "function_attribute", - type: "inline", - loc: createRef(this), - }; - }, - FunctionAttribute_virtual(_) { - return { - kind: "function_attribute", - type: "virtual", - loc: createRef(this), - }; - }, - FunctionAttribute_abstract(_) { - return { - kind: "function_attribute", - type: "abstract", - loc: createRef(this), - }; - }, -}); - -semantics.addOperation<{ args: AstNode[]; ret: AstNode[] }>( - "astsOfAsmShuffle", - { - AsmShuffle(_lparen, argsShuffle, _optArrow, optRetShuffle, _rparen) { - return { - args: argsShuffle.children.map((id) => id.astOfExpression()), - ret: - optRetShuffle.children[0]?.children.map((num) => - num.astOfExpression(), - ) ?? [], - }; - }, - }, -); - -semantics.addOperation("astOfConstAttribute", { - ConstantAttribute_override(_) { - return { type: "override", loc: createRef(this) }; - }, - ConstantAttribute_virtual(_) { - return { type: "virtual", loc: createRef(this) }; - }, - ConstantAttribute_abstract(_) { - return { type: "abstract", loc: createRef(this) }; - }, -}); - -semantics.addOperation("astsOfList", { - InheritedTraits(traits, _optTrailingComma) { - return traits - .asIteration() - .children.map((id, _comma) => id.astOfExpression()); - }, - StructFields(fields, _optSemicolon) { - return fields - .asIteration() - .children.map((field, _semicolon) => field.astOfDeclaration()); - }, - Parameters(_lparen, params, optTrailingComma, _rparen) { - if ( - params.source.contents === "" && - optTrailingComma.sourceString === "," - ) { - err().extraneousComma()(createRef(optTrailingComma)); - } - return params.asIteration().children.map((p) => p.astOfDeclaration()); - }, - Arguments(_lparen, args, optTrailingComma, _rparen) { - if ( - args.source.contents === "" && - optTrailingComma.sourceString === "," - ) { - err().extraneousComma()(createRef(optTrailingComma)); - } - return args.asIteration().children.map((arg) => arg.astOfExpression()); - }, -}); - -semantics.addOperation("astOfContractAttributes", { - ContractAttribute_interface(_interface, _lparen, interfaceName, _rparen) { - return { - type: "interface", - name: interfaceName.astOfExpression(), - loc: createRef(this), - }; - }, -}); - -semantics.addOperation("astOfDeclaration", { - FieldDecl( - id, - _colon, - type, - _optAs, - optStorageType, - _optEq, - optInitializer, - ) { - return createNode({ - kind: "field_decl", - name: id.astOfExpression(), - type: type.astOfType() as AstType, - as: unwrapOptNode(optStorageType, (t) => t.astOfExpression()), - initializer: unwrapOptNode(optInitializer, (e) => - e.astOfExpression(), - ), - loc: createRef(this), - }); - }, - Parameter(id, _colon, type) { - checkVariableName(id.sourceString, createRef(id)); - return createNode({ - kind: "typed_parameter", - name: id.astOfExpression(), - type: type.astOfType(), - loc: createRef(this), - }); - }, - StructFieldInitializer_full(fieldId, _colon, initializer) { - return createNode({ - kind: "struct_field_initializer", - field: fieldId.astOfExpression(), - initializer: initializer.astOfExpression(), - loc: createRef(this), - }); - }, - StructFieldInitializer_punned(fieldId) { - return createNode({ - kind: "struct_field_initializer", - field: fieldId.astOfExpression(), - initializer: fieldId.astOfExpression(), - loc: createRef(this), - }); - }, -}); - -// Statements -semantics.addOperation("astOfStatement", { - // TODO: process StatementBlock - - StatementLet( - _letKwd, - id, - _optColon, - optType, - _equals, - expression, - _optSemicolonIfLastStmtInBlock, - ) { - checkVariableName(id.sourceString, createRef(id)); - - return createNode({ - kind: "statement_let", - name: id.astOfExpression(), - type: unwrapOptNode(optType, (t) => t.astOfType()), - expression: expression.astOfExpression(), - loc: createRef(this), - }); - }, - StatementReturn(_returnKwd, optExpression, _optSemicolonIfLastStmtInBlock) { - return createNode({ - kind: "statement_return", - expression: unwrapOptNode(optExpression, (e) => - e.astOfExpression(), - ), - loc: createRef(this), - }); - }, - StatementExpression(expression, _optSemicolonIfLastStmtInBlock) { - return createNode({ - kind: "statement_expression", - expression: expression.astOfExpression(), - loc: createRef(this), - }); - }, - StatementAssign( - lvalue, - operator, - expression, - _optSemicolonIfLastStmtInBlock, - ) { - if (operator.sourceString === "=") { - return createNode({ - kind: "statement_assign", - path: lvalue.astOfExpression(), - expression: expression.astOfExpression(), - loc: createRef(this), - }); - } else { - let op: AstAugmentedAssignOperation; - switch (operator.sourceString) { - case "+=": - op = "+"; - break; - case "-=": - op = "-"; - break; - case "*=": - op = "*"; - break; - case "/=": - op = "/"; - break; - case "%=": - op = "%"; - break; - case "|=": - op = "|"; - break; - case "&=": - op = "&"; - break; - case "^=": - op = "^"; - break; - case "||=": - op = "||"; - break; - case "&&=": - op = "&&"; - break; - case "<<=": - op = "<<"; - break; - case ">>=": - op = ">>"; - break; - default: - throwInternalCompilerError( - "Unreachable augmented assignment operator.", - ); - } - return createNode({ - kind: "statement_augmentedassign", - path: lvalue.astOfExpression(), - op, - expression: expression.astOfExpression(), - loc: createRef(this), - }); - } - }, - StatementCondition_noElse(_ifKwd, condition, _lbrace, thenBlock, _rbrace) { - return createNode({ - kind: "statement_condition", - condition: condition.astOfExpression(), - trueStatements: thenBlock.children.map((s) => s.astOfStatement()), - falseStatements: null, - elseif: null, - loc: createRef(this), - }); - }, - StatementCondition_withElse( - _ifKwd, - condition, - _lbraceThen, - thenBlock, - _rbraceThen, - _elseKwd, - _lbraceElse, - elseBlock, - _rbraceElse, - ) { - return createNode({ - kind: "statement_condition", - condition: condition.astOfExpression(), - trueStatements: thenBlock.children.map((s) => s.astOfStatement()), - falseStatements: elseBlock.children.map((s) => s.astOfStatement()), - elseif: null, - loc: createRef(this), - }); - }, - StatementCondition_withElseIf( - _ifKwd, - condition, - _lbraceThen, - thenBlock, - _rbraceThen, - _elseKwd, - elseifClause, - ) { - return createNode({ - kind: "statement_condition", - condition: condition.astOfExpression(), - trueStatements: thenBlock.children.map((s) => s.astOfStatement()), - falseStatements: null, - elseif: elseifClause.astOfStatement(), - loc: createRef(this), - }); - }, - StatementWhile( - _whileKwd, - _lparen, - condition, - _rparen, - _lbrace, - loopBody, - _rbrace, - ) { - return createNode({ - kind: "statement_while", - condition: condition.astOfExpression(), - statements: loopBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - StatementRepeat( - _repeatKwd, - _lparen, - iterations, - _rparen, - _lbrace, - loopBody, - _rbrace, - ) { - return createNode({ - kind: "statement_repeat", - iterations: iterations.astOfExpression(), - statements: loopBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - StatementUntil( - _doKwd, - _lbrace, - loopBody, - _rbrace, - _untilKwd, - _lparen, - condition, - _rparen, - _optSemicolonIfLastStmtInBlock, - ) { - return createNode({ - kind: "statement_until", - condition: condition.astOfExpression(), - statements: loopBody.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - StatementTry_noCatch(_tryKwd, _lbraceTry, tryBlock, _rbraceTry) { - return createNode({ - kind: "statement_try", - statements: tryBlock.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - StatementTry_withCatch( - _tryKwd, - _lbraceTry, - tryBlock, - _rbraceTry, - _catchKwd, - _lparen, - exitCodeId, - _rparen, - _lbraceCatch, - catchBlock, - _rbraceCatch, - ) { - return createNode({ - kind: "statement_try_catch", - statements: tryBlock.children.map((s) => s.astOfStatement()), - catchName: exitCodeId.astOfExpression(), - catchStatements: catchBlock.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - StatementForEach( - _foreachKwd, - _lparen, - keyId, - _comma, - valueId, - _inKwd, - mapId, - _rparen, - _lbrace, - foreachBlock, - _rbrace, - ) { - checkVariableName(keyId.sourceString, createRef(keyId)); - checkVariableName(valueId.sourceString, createRef(valueId)); - return createNode({ - kind: "statement_foreach", - keyName: keyId.astOfExpression(), - valueName: valueId.astOfExpression(), - map: mapId.astOfExpression(), - statements: foreachBlock.children.map((s) => s.astOfStatement()), - loc: createRef(this), - }); - }, - StatementDestruct( - _letKwd, - typeId, - _lparen, - identifiers, - endOfIdentifiers, - _rparen, - _equals, - expression, - _semicolon, - ) { - return createNode({ - kind: "statement_destruct", - type: typeId.astOfType(), - identifiers: identifiers - .asIteration() - .children.reduce((map, item) => { - const destructItem = item.astOfExpression(); - if (map.has(destructItem.field.text)) { - err().duplicateField(destructItem.field.text)( - destructItem.loc, - ); - } - map.set(destructItem.field.text, [ - destructItem.field, - destructItem.name, - ]); - return map; - }, new Map()), - ignoreUnspecifiedFields: - endOfIdentifiers.astOfExpression().ignoreUnspecifiedFields, - expression: expression.astOfExpression(), - loc: createRef(this), - }); - }, -}); - -semantics.addOperation("astOfType", { - typeId(firstTactTypeIdCharacter, restOfTactTypeId) { - return createNode({ - kind: "type_id", - text: - firstTactTypeIdCharacter.sourceString + - restOfTactTypeId.sourceString, - loc: createRef(this), - }); - }, - Type_optional(typeId, _questionMark) { - return createNode({ - kind: "optional_type", - typeArg: typeId.astOfType(), - loc: createRef(this), - }); - }, - Type_regular(typeId) { - return typeId.astOfType(); - }, - Type_map( - _mapKwd, - _langle, - keyTypeId, - _optAsKwdKey, - optKeyStorageType, - _comma, - valueTypeId, - _optAsKwdValue, - optValueStorageType, - _rangle, - ) { - return createNode({ - kind: "map_type", - keyType: keyTypeId.astOfType(), - keyStorageType: unwrapOptNode(optKeyStorageType, (t) => - t.astOfExpression(), - ), - valueType: valueTypeId.astOfType(), - valueStorageType: unwrapOptNode(optValueStorageType, (t) => - t.astOfExpression(), - ), - loc: createRef(this), - }); - }, - Type_bounced(_bouncedKwd, _langle, typeId, _rangle) { - return createNode({ - kind: "bounced_message_type", - messageType: typeId.astOfType(), - loc: createRef(this), - }); - }, -}); - -// handles binary, octal, decimal and hexadecimal integer literals -function bigintOfIntLiteral(litString: NonterminalNode): bigint { - return BigInt(litString.sourceString.replaceAll("_", "")); -} - -function baseOfIntLiteral(node: NonterminalNode): AstNumberBase { - const basePrefix = node.sourceString.slice(0, 2).toLowerCase(); - switch (basePrefix) { - case "0x": - return 16; - case "0o": - return 8; - case "0b": - return 2; - default: - return 10; - } -} - -function astOfNumber(node: Node): AstNode { - return createNode({ - kind: "number", - base: baseOfIntLiteral(node), - value: bigintOfIntLiteral(node), - loc: createRef(node), - }); -} - -// Expressions -semantics.addOperation("astOfExpression", { - // Literals - integerLiteral(_) { - // Parses dec, hex, and bin numbers - return astOfNumber(this); - }, - integerLiteralDec(_) { - return astOfNumber(this); - }, - integerLiteralHex(_0x, _digit, _1, _2) { - return astOfNumber(this); - }, - boolLiteral(boolValue) { - return createNode({ - kind: "boolean", - value: boolValue.sourceString === "true", - loc: createRef(this), - }); - }, - id(firstTactIdCharacter, restOfTactId) { - return createNode({ - kind: "id", - text: firstTactIdCharacter.sourceString + restOfTactId.sourceString, - loc: createRef(this), - }); - }, - funcId(firstFuncIdCharacter, restOfFuncId) { - return createNode({ - kind: "func_id", - text: firstFuncIdCharacter.sourceString + restOfFuncId.sourceString, - loc: createRef(this), - }); - }, - null(_nullKwd) { - return createNode({ kind: "null", loc: createRef(this) }); - }, - stringLiteral(_startQuotationMark, string, _endQuotationMark) { - return createNode({ - kind: "string", - value: string.sourceString, - loc: createRef(this), - }); - }, - DestructItem_punned(id) { - return createNode({ - kind: "destruct_mapping", - field: id.astOfExpression(), - name: id.astOfExpression(), - loc: createRef(this), - }); - }, - DestructItem_regular(idFrom, _colon, id) { - return createNode({ - kind: "destruct_mapping", - field: idFrom.astOfExpression(), - name: id.astOfExpression(), - loc: createRef(this), - }); - }, - EndOfIdentifiers_regular(_comma) { - return createNode({ - kind: "destruct_end", - ignoreUnspecifiedFields: false, - loc: createRef(this), - }); - }, - EndOfIdentifiers_ignoreUnspecifiedFields(_comma, _dotDot) { - return createNode({ - kind: "destruct_end", - ignoreUnspecifiedFields: true, - loc: createRef(this), - }); - }, - ExpressionAdd_add(left, _plus, right) { - return createNode({ - kind: "op_binary", - op: "+", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionAdd_sub(left, _minus, right) { - return createNode({ - kind: "op_binary", - op: "-", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionMul_div(left, _slash, right) { - return createNode({ - kind: "op_binary", - op: "/", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionMul_mul(left, _star, right) { - return createNode({ - kind: "op_binary", - op: "*", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionMul_rem(left, _percent, right) { - return createNode({ - kind: "op_binary", - op: "%", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionEquality_eq(left, _equalsEquals, right) { - return createNode({ - kind: "op_binary", - op: "==", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionEquality_not(left, _bangEquals, right) { - return createNode({ - kind: "op_binary", - op: "!=", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionCompare_gt(left, _rangle, right) { - return createNode({ - kind: "op_binary", - op: ">", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionCompare_gte(left, _rangleEquals, right) { - return createNode({ - kind: "op_binary", - op: ">=", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionCompare_lt(left, _langle, right) { - return createNode({ - kind: "op_binary", - op: "<", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionCompare_lte(left, _langleEquals, right) { - return createNode({ - kind: "op_binary", - op: "<=", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionOr_or(left, _pipePipe, right) { - return createNode({ - kind: "op_binary", - op: "||", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionAnd_and(left, _ampersandAmpersand, right) { - return createNode({ - kind: "op_binary", - op: "&&", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionBitwiseShift_shr(left, _rangleRangle, right) { - return createNode({ - kind: "op_binary", - op: ">>", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionBitwiseShift_shl(left, _langleLangle, right) { - return createNode({ - kind: "op_binary", - op: "<<", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionBitwiseAnd_bitwiseAnd(left, _ampersand, right) { - return createNode({ - kind: "op_binary", - op: "&", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionBitwiseOr_bitwiseOr(left, _pipe, right) { - return createNode({ - kind: "op_binary", - op: "|", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionBitwiseXor_bitwiseXor(left, _caret, right) { - return createNode({ - kind: "op_binary", - op: "^", - left: left.astOfExpression(), - right: right.astOfExpression(), - loc: createRef(this), - }); - }, - - // Unary - ExpressionUnary_plus(_plus, operand) { - return createNode({ - kind: "op_unary", - op: "+", - operand: operand.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionUnary_minus(_minus, operand) { - return createNode({ - kind: "op_unary", - op: "-", - operand: operand.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionUnary_not(_bang, operand) { - return createNode({ - kind: "op_unary", - op: "!", - operand: operand.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionUnary_bitwiseNot(_tilde, operand) { - return createNode({ - kind: "op_unary", - op: "~", - operand: operand.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionParens(_lparen, expression, _rparen) { - return expression.astOfExpression(); - }, - ExpressionUnboxNotNull(operand, _bangBang) { - return createNode({ - kind: "op_unary", - op: "!!", - operand: operand.astOfExpression(), - loc: createRef(this), - }); - }, - - ExpressionFieldAccess(source, _dot, fieldId) { - return createNode({ - kind: "field_access", - aggregate: source.astOfExpression(), - field: fieldId.astOfExpression(), - loc: createRef(this), - }); - }, - ExpressionMethodCall(source, _dot, methodId, methodArguments) { - return createNode({ - kind: "method_call", - self: source.astOfExpression(), - method: methodId.astOfExpression(), - args: methodArguments.astsOfList(), - loc: createRef(this), - }); - }, - ExpressionStaticCall(functionId, functionArguments) { - return createNode({ - kind: "static_call", - function: functionId.astOfExpression(), - args: functionArguments.astsOfList(), - loc: createRef(this), - }); - }, - ExpressionStructInstance( - typeId, - _lbrace, - structFields, - optTrailingComma, - _rbrace, - ) { - if ( - structFields.source.contents === "" && - optTrailingComma.sourceString === "," - ) { - err().extraneousComma()(createRef(optTrailingComma)); - } - - return createNode({ - kind: "struct_instance", - type: typeId.astOfType(), - args: structFields - .asIteration() - .children.map((d) => d.astOfDeclaration()), - loc: createRef(this), - }); - }, - ExpressionInitOf(_initOfKwd, contractId, initArguments) { - return createNode({ - kind: "init_of", - contract: contractId.astOfExpression(), - args: initArguments.astsOfList(), - loc: createRef(this), - }); - }, - - // Ternary conditional - ExpressionConditional_ternary( - condition, - _questionMark, - thenExpression, - _colon, - elseExpression, - ) { - return createNode({ - kind: "conditional", - condition: condition.astOfExpression(), - thenBranch: thenExpression.astOfExpression(), - elseBranch: elseExpression.astOfExpression(), - loc: createRef(this), - }); - }, -}); - -export const getParser = (ast: FactoryAst) => { - const errorTypes = parserErrorSchema(displayToString); - - function parse(src: string, path: string, origin: ItemOrigin): AstModule { - return withContext( - { - currentFile: path, - origin, - createNode: ast.createNode, - errorTypes, - }, - () => { - const matchResult = tactGrammar.match(src); - if (matchResult.failed()) { - errorTypes.generic(matchResult, path, origin); - } - return semantics(matchResult).astOfModule(); - }, - ); - } - - function parseExpression(sourceCode: string): AstExpression { - return withContext( - { - currentFile: null, - origin: "user", - createNode: ast.createNode, - errorTypes, - }, - () => { - const matchResult = tactGrammar.match(sourceCode, "Expression"); - if (matchResult.failed()) { - errorTypes.generic(matchResult, "", "user"); - } - return semantics(matchResult).astOfExpression(); - }, - ); - } - - function parseImports( +export type Parser = { + parse: (src: string, path: string, origin: ItemOrigin) => AstModule; + parseExpression: (sourceCode: string) => AstExpression; + parseImports: ( src: string, path: string, origin: ItemOrigin, - ): AstImport[] { - return withContext( - { - currentFile: path, - origin, - createNode: ast.createNode, - errorTypes, - }, - () => { - const matchResult = tactGrammar.match(src, "JustImports"); - if (matchResult.failed()) { - errorTypes.generic(matchResult, path, origin); - } - return semantics(matchResult).astOfJustImports(); - }, - ); - } - - return { - parse, - parseExpression, - parseImports, - }; + ) => AstImport[]; }; -export type Parser = ReturnType; +export const defaultParser = "new"; + +export const getParser = (ast: FactoryAst, version: "old" | "new"): Parser => { + if (version === "new") { + return getParserNext(ast); + } else { + return getParserPrev(ast); + } +}; diff --git a/src/grammar/next/__snapshots__/grammar.spec.ts.snap b/src/grammar/next/__snapshots__/grammar.spec.ts.snap new file mode 100644 index 000000000..bf4aeee2e --- /dev/null +++ b/src/grammar/next/__snapshots__/grammar.spec.ts.snap @@ -0,0 +1,10913 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`grammar should fail abstract-const-without-modifier 1`] = ` +":2:5: Abstract constant doesn't have abstract modifier +Line 2, col 5: + 1 | trait t { +> 2 | const c: Int; + ^~~~~~~~~~~~~ + 3 | } +" +`; + +exports[`grammar should fail const-abstract-abstract 1`] = ` +":4:10: Duplicate constant attribute "abstract" +Line 4, col 10: + 3 | +> 4 | abstract abstract const Foo: Int = 42; + ^~~~~~~~ + 5 | +" +`; + +exports[`grammar should fail const-override 1`] = ` +":4:1: Module-level constants do not support attributes +Line 4, col 1: + 3 | +> 4 | override const Foo: Int = 42; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 5 | +" +`; + +exports[`grammar should fail const-override-override 1`] = ` +":4:10: Duplicate constant attribute "override" +Line 4, col 10: + 3 | +> 4 | override override const Foo: Int = 42; + ^~~~~~~~ + 5 | +" +`; + +exports[`grammar should fail const-override-virtual 1`] = ` +":4:1: Module-level constants do not support attributes +Line 4, col 1: + 3 | +> 4 | override virtual const Foo: Int = 42; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 5 | +" +`; + +exports[`grammar should fail const-virtual 1`] = ` +":4:1: Module-level constants do not support attributes +Line 4, col 1: + 3 | +> 4 | virtual const Foo: Int = 42; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 5 | +" +`; + +exports[`grammar should fail const-virtual-override 1`] = ` +":4:1: Module-level constants do not support attributes +Line 4, col 1: + 3 | +> 4 | virtual override const Foo: Int = 42; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 5 | +" +`; + +exports[`grammar should fail const-virtual-virtual 1`] = ` +":4:9: Duplicate constant attribute "virtual" +Line 4, col 9: + 3 | +> 4 | virtual virtual const Foo: Int = 42; + ^~~~~~~ + 5 | +" +`; + +exports[`grammar should fail contract-const-abstract 1`] = ` +":5:3: Constant definition requires an initializer +Line 5, col 3: + 4 | contract TestContract { +> 5 | abstract const Foo: Int; + ^~~~~~~~~~~~~~~~~~~~~~~~ + 6 | } +" +`; + +exports[`grammar should fail contract-const-abstract-abstract 1`] = ` +":5:12: Duplicate constant attribute "abstract" +Line 5, col 12: + 4 | contract TestContract { +> 5 | abstract abstract const Foo: Int = 42; + ^~~~~~~~ + 6 | } +" +`; + +exports[`grammar should fail contract-const-abstract-with-initializer 1`] = ` +":5:3: Non-abstract constant has abstract modifier +Line 5, col 3: + 4 | contract TestContract { +> 5 | abstract const Foo: Int = 42; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 6 | } +" +`; + +exports[`grammar should fail contract-const-override-override 1`] = ` +":5:12: Duplicate constant attribute "override" +Line 5, col 12: + 4 | contract TestContract { +> 5 | override override const Foo: Int = 42; + ^~~~~~~~ + 6 | } +" +`; + +exports[`grammar should fail contract-const-virtual-virtual 1`] = ` +":5:11: Duplicate constant attribute "virtual" +Line 5, col 11: + 4 | contract TestContract { +> 5 | virtual virtual const Foo: Int = 42; + ^~~~~~~ + 6 | } +" +`; + +exports[`grammar should fail contract-empty-traits-list-with-keyword 1`] = ` +":1:20: Expected identifier +Line 1, col 20: +> 1 | contract Name with {} + ^ + 2 | +" +`; + +exports[`grammar should fail contract-getter-parens-no-method-id 1`] = ` +":2:9: Expected "!", "(", "+", "-", "0", "\\"", "false", "initOf", "null", "true", "~", capitalized identifier, digit, or identifier +Line 2, col 9: + 1 | contract Test { +> 2 | get() fun test(): Int { + ^ + 3 | return 0 +" +`; + +exports[`grammar should fail contract-init-trailing-comma-empty-params 1`] = ` +":2:10: Expected ")" or identifier +Line 2, col 10: + 1 | contract Name { +> 2 | init(,) {} + ^ + 3 | } +" +`; + +exports[`grammar should fail contract-trailing-comma-empty-traits-list 1`] = ` +":1:19: Expected identifier or not identifier character +Line 1, col 19: +> 1 | contract Name with, {} + ^ + 2 | +" +`; + +exports[`grammar should fail contract-with-imports 1`] = ` +":6:1: Expected "@interface", "@name", "abstract", "asm", "const", "contract", "extends", "fun", "get", "inline", "message", "mutates", "override", "primitive", "struct", "trait", or "virtual" +Line 6, col 1: + 5 | // all imports must be at the very top of the file +> 6 | import "@stdlib/not-allowed"; + ^ + 7 | +" +`; + +exports[`grammar should fail destructuring-duplicate-source-id 1`] = ` +":15:19: Duplicate field destructuring: "a" +Line 15, col 19: + 14 | let s = S{ a: 1, b: 2, c: 3 }; +> 15 | let S { a: x, a: y } = s; + ^~~~ + 16 | return x + y; +" +`; + +exports[`grammar should fail expr-fun-call-trailing-comma-no-args 1`] = ` +":6:14: Expected "!", "(", ")", "+", "-", "0", "\\"", "false", "initOf", "null", "true", "~", capitalized identifier, digit, or identifier +Line 6, col 14: + 5 | fun b(): Int { +> 6 | return a(,); + ^ + 7 | } +" +`; + +exports[`grammar should fail expr-method-call-trailing-comma-no-args 1`] = ` +":2:24: Expected "!", "(", ")", "+", "-", "0", "\\"", "false", "initOf", "null", "true", "~", capitalized identifier, digit, or identifier +Line 2, col 24: + 1 | fun another() { +> 2 | return 42.toString(,); + ^ + 3 | } +" +`; + +exports[`grammar should fail funcid-native-fun-arith-operator 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(/) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-assign-operator 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(^>>=) + ^~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-bitwise-operator 1`] = ` +":1:7: Expected FunC identifier +Line 1, col 7: +> 1 | @name(~) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-comma 1`] = ` +":1:19: Expected ")" +Line 1, col 19: +> 1 | @name(send_message,then_terminate) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-comparison-operator 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(<=>) + ^~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-control-keyword 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(elseifnot) + ^~~~~~~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-delimiter 1`] = ` +":1:7: Expected FunC identifier +Line 1, col 7: +> 1 | @name([) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-directive 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(#include) + ^~~~~~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-dot 1`] = ` +":1:10: Expected ")" +Line 1, col 10: +> 1 | @name(msg.sender) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-keyword 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(global) + ^~~~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-multiline-comments 1`] = ` +":1:7: Invalid FunC identifier +Line 1, col 7: +> 1 | @name({-aaa-}) + ^~~~~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-number 1`] = ` +":1:7: FunC identifier cannot be a number +Line 1, col 7: +> 1 | @name(123) + ^~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-number-decimal 1`] = ` +":1:7: FunC identifier cannot be a number +Line 1, col 7: +> 1 | @name(0) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-number-hexadecimal 1`] = ` +":1:7: FunC identifier cannot be a number +Line 1, col 7: +> 1 | @name(0x0) + ^~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-number-hexadecimal-2 1`] = ` +":1:7: FunC identifier cannot be a number +Line 1, col 7: +> 1 | @name(0xDEADBEEF) + ^~~~~~~~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-number-neg-decimal 1`] = ` +":1:7: FunC identifier cannot be a number +Line 1, col 7: +> 1 | @name(-1) + ^~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-number-neg-hexadecimal 1`] = ` +":1:7: FunC identifier cannot be a number +Line 1, col 7: +> 1 | @name(-0x0) + ^~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-only-underscore 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(_) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-parens 1`] = ` +":1:11: Expected ")" +Line 1, col 11: +> 1 | @name(take(first)Entry) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-semicolons 1`] = ` +":1:9: Expected ")" +Line 1, col 9: +> 1 | @name(pa;;in"\`aaa\`") + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-space 1`] = ` +":1:11: Expected ")" +Line 1, col 11: +> 1 | @name(foo foo) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-square-brackets 1`] = ` +":1:11: Expected ")" +Line 1, col 11: +> 1 | @name(take[some]entry) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-string 1`] = ` +":1:7: Invalid FunC identifier +Line 1, col 7: +> 1 | @name("not_a_string) + ^~~~~~~~~~~~~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-type-keyword 1`] = ` +":1:7: Reserved FunC identifier +Line 1, col 7: +> 1 | @name(->) + ^~ + 2 | native idTest(); +" +`; + +exports[`grammar should fail funcid-native-fun-unclosed-parens 1`] = ` +":1:9: Expected ")" +Line 1, col 9: +> 1 | @name(aa(bb) + ^ + 2 | native idTest(); +" +`; + +exports[`grammar should fail ident-cannot-be-if-reserved-word 1`] = ` +":2:9: Expected capitalized identifier or identifier +Line 2, col 9: + 1 | fun hello(): Int { +> 2 | let if: Int = 0; + ^ + 3 | } +" +`; + +exports[`grammar should fail ident-contract-cannot-start-with-__gen 1`] = ` +":1:10: Variable name cannot start with "__gen" +Line 1, col 10: +> 1 | contract __gen_a { + ^~~~~~~ + 2 | +" +`; + +exports[`grammar should fail ident-fun-cannot-start-with-__gen 1`] = ` +":1:5: Variable name cannot start with "__gen" +Line 1, col 5: +> 1 | fun __gen_hello(): Int { + ^~~~~~~~~~~ + 2 | +" +`; + +exports[`grammar should fail ident-fun-param-cannot-start-with-__gen 1`] = ` +":1:10: Variable name cannot start with "__gen" +Line 1, col 10: +> 1 | fun main(__gen: Int): Int { + ^~~~~ + 2 | return 0; +" +`; + +exports[`grammar should fail ident-fun-param-cannot-start-with-__tact 1`] = ` +":2:11: Variable name cannot start with "__tact" +Line 2, col 11: + 1 | contract A { +> 2 | fun b(__tact: Int) { + ^~~~~~ + 3 | +" +`; + +exports[`grammar should fail ident-init-param-cannot-start-with-__tact 1`] = ` +":2:10: Variable name cannot start with "__tact" +Line 2, col 10: + 1 | contract A { +> 2 | init(__tact: Int) { + ^~~~~~ + 3 | +" +`; + +exports[`grammar should fail ident-let-cannot-start-with-__gen 1`] = ` +":2:9: Variable name cannot start with "__gen" +Line 2, col 9: + 1 | fun hello(): Int { +> 2 | let __gen_a: Int = 0; + ^~~~~~~ + 3 | } +" +`; + +exports[`grammar should fail ident-let-cannot-start-with-__tact 1`] = ` +":2:9: Variable name cannot start with "__tact" +Line 2, col 9: + 1 | fun hello(): Int { +> 2 | let __tact_a: Int = 0; + ^~~~~~~~ + 3 | } +" +`; + +exports[`grammar should fail ident-struct-cannot-start-with-__gen 1`] = ` +":1:8: Expected capitalized identifier +Line 1, col 8: +> 1 | struct __genA { + ^ + 2 | a: Int; +" +`; + +exports[`grammar should fail item-fun-non-void-trailing-comma-no-params 1`] = ` +":1:14: Expected ")" or identifier +Line 1, col 14: +> 1 | fun function(,) : Int { + ^ + 2 | return 42; +" +`; + +exports[`grammar should fail item-fun-void-trailing-comma-no-params 1`] = ` +":1:14: Expected ")" or identifier +Line 1, col 14: +> 1 | fun function(,) {} + ^ + 2 | +" +`; + +exports[`grammar should fail item-fun-without-body 1`] = ` +":1:1: Abstract function doesn't have abstract modifier +Line 1, col 1: +> 1 | fun testFunc(): Int; + ^~~~~~~~~~~~~~~~~~~~ +" +`; + +exports[`grammar should fail item-native-fun-not-void-decl-trailing-comma-no-params 1`] = ` +":2:31: Expected ")" or identifier +Line 2, col 31: + 1 | @name(native_name_2) +> 2 | native testNativeFuncWithType(,): Int; + ^ +" +`; + +exports[`grammar should fail item-native-fun-void-decl-trailing-comma-no-params 1`] = ` +":2:23: Expected ")" or identifier +Line 2, col 23: + 1 | @name(native_name_1) +> 2 | native testNativeFunc(,); + ^ +" +`; + +exports[`grammar should fail items-asm-fun-1 1`] = ` +":1:5: Expected ")", "->", or identifier +Line 1, col 5: +> 1 | asm(1 0) extends fun loadCoins(self: Slice): Int { + ^ + 2 | LDVARUINT16 +" +`; + +exports[`grammar should fail items-asm-fun-2 1`] = ` +":1:9: Expected ")", "->", or identifier +Line 1, col 9: +> 1 | asm(c b 42) extends fun storeDict(b: Builder, c: Cell) { + ^ + 2 | STDICT +" +`; + +exports[`grammar should fail items-asm-fun-3 1`] = ` +":1:14: Expected digit +Line 1, col 14: +> 1 | asm(s len -> len 1 0) extends fun loadInt(self: Slice, len: Int): Int { + ^ + 2 | LDIX +" +`; + +exports[`grammar should fail items-asm-fun-4 1`] = ` +":1:7: Expected digit +Line 1, col 7: +> 1 | asm(->) extends fun loadInt(self: Slice, len: Int): Int { + ^ + 2 | LDIX +" +`; + +exports[`grammar should fail items-asm-fun-5 1`] = ` +":3:5: Expected "@interface", "@name", "abstract", "asm", "const", "contract", "extends", "fun", "get", "inline", "message", "mutates", "override", "primitive", "struct", "trait", or "virtual" +Line 3, col 5: + 2 | { INC } : } +> 3 | 5 } + ^ + 4 | } +" +`; + +exports[`grammar should fail literal-dec-trailing-underscore 1`] = ` +":2:16: Expected digit +Line 2, col 16: + 1 | fun test_fun(): Int { +> 2 | return 123_; + ^ + 3 | } +" +`; + +exports[`grammar should fail literal-double-underscore 1`] = ` +":2:20: Expected digit +Line 2, col 20: + 1 | fun test_fun(): Int { +> 2 | return 123_123__123; + ^ + 3 | } +" +`; + +exports[`grammar should fail literal-hex-trailing-underscore 1`] = ` +":2:18: Expected hexadecimal digit +Line 2, col 18: + 1 | fun test_fun(): Int { +> 2 | return 0x123_; + ^ + 3 | } +" +`; + +exports[`grammar should fail literal-no-underscore-after-0b 1`] = ` +":2:14: Expected "0" or "1" +Line 2, col 14: + 1 | fun test_fun(): Int { +> 2 | return 0b_00101010; + ^ + 3 | } +" +`; + +exports[`grammar should fail literal-no-underscores-if-leading-zero 1`] = ` +":2:12: Numbers with leading zeroes cannot use underscores for JS compatibility +Line 2, col 12: + 1 | fun test_fun(): Int { +> 2 | return 012_3; + ^~~~~ + 3 | } +" +`; + +exports[`grammar should fail literal-non-binary-digits 1`] = ` +":2:15: Expected "!!", "!=", "%", "&", "&&", "(", "*", "+", "-", ".", "/", "0", "1", ";", "<", "<<", "<=", "==", ">", ">=", ">>", "?", "^", "_", "|", "||", or "}" +Line 2, col 15: + 1 | fun test_fun(): Int { +> 2 | return 0b123; + ^ + 3 | } +" +`; + +exports[`grammar should fail literal-underscore-after-leading-zero 1`] = ` +":2:12: Numbers with leading zeroes cannot use underscores for JS compatibility +Line 2, col 12: + 1 | fun test_fun(): Int { +> 2 | return 0_123; + ^~~~~ + 3 | } +" +`; + +exports[`grammar should fail struct-double-semicolon 1`] = ` +":2:19: Expected "}" or identifier +Line 2, col 19: + 1 | // too many semicolons +> 2 | struct A { x: Int;; } + ^ + 3 | +" +`; + +exports[`grammar should fail struct-missing-semicolon-between-fields 1`] = ` +":2:19: Expected ";", "=", "?", "as", or "}" +Line 2, col 19: + 1 | // missing ; between fields +> 2 | struct B { x: Int y: Int } + ^ + 3 | +" +`; + +exports[`grammar should fail struct-missing-semicolon-between-fields-with-initializer 1`] = ` +":2:24: Expected "!!", "!=", "%", "&", "&&", "(", "*", "+", "-", ".", "/", ";", "<", "<<", "<=", "==", ">", ">=", ">>", "?", "^", "|", "||", or "}" +Line 2, col 24: + 1 | // missing ; between fields +> 2 | struct B { x: Int = 42 y: Int } + ^ + 3 | +" +`; + +exports[`grammar should fail trait-const-abstract-with-initializer 1`] = ` +":5:3: Non-abstract constant has abstract modifier +Line 5, col 3: + 4 | trait TestContract { +> 5 | abstract const Foo: Int = 42; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 6 | } +" +`; + +exports[`grammar should fail trait-empty-traits-list-with-keyword 1`] = ` +":1:17: Expected identifier +Line 1, col 17: +> 1 | trait Name with {} + ^ + 2 | +" +`; + +exports[`grammar should fail trait-fun-non-void-trailing-comma-no-params 1`] = ` +":2:39: Expected ")" or identifier +Line 2, col 39: + 1 | trait Test { +> 2 | abstract fun testAbstractWithType(,): Int; + ^ + 3 | } +" +`; + +exports[`grammar should fail trait-fun-void-trailing-comma-no-params 1`] = ` +":2:31: Expected ")" or identifier +Line 2, col 31: + 1 | trait Test { +> 2 | abstract fun testAbstract(,); + ^ + 3 | } +" +`; + +exports[`grammar should fail trait-trailing-comma-empty-traits-list 1`] = ` +":1:16: Expected identifier or not identifier character +Line 1, col 16: +> 1 | trait Name with, {} + ^ + 2 | +" +`; + +exports[`grammar should fail type-ident-msg-should-be-capitalized 1`] = ` +":1:14: Expected capitalized identifier +Line 1, col 14: +> 1 | message(123) foo { + ^ + 2 | signature: Slice; +" +`; + +exports[`grammar should fail type-ident-struct-should-be-capitalized 1`] = ` +":1:8: Expected capitalized identifier +Line 1, col 8: +> 1 | struct lowercaseIdForType { + ^ + 2 | a: Int; +" +`; + +exports[`grammar should parse abstract-const 1`] = ` +{ + "id": 6, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "attributes": [ + { + "loc": abstract, + "type": "abstract", + }, + ], + "id": 4, + "kind": "constant_decl", + "loc": abstract const c: Int;, + "name": { + "id": 2, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 5, + "kind": "trait", + "loc": trait t { + abstract const c: Int; +}, + "name": { + "id": 1, + "kind": "id", + "loc": t, + "text": "t", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse case-35 1`] = ` +{ + "id": 7, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "id": 5, + "kind": "receiver", + "loc": external() { + acceptMessage(); + }, + "selector": { + "kind": "external-fallback", + }, + "statements": [ + { + "expression": { + "args": [], + "function": { + "id": 2, + "kind": "id", + "loc": acceptMessage, + "text": "acceptMessage", + }, + "id": 3, + "kind": "static_call", + "loc": acceptMessage(), + }, + "id": 4, + "kind": "statement_expression", + "loc": acceptMessage();, + }, + ], + }, + ], + "id": 6, + "kind": "contract", + "loc": contract ReceiveTestContract { + external() { + acceptMessage(); + } +}, + "name": { + "id": 1, + "kind": "id", + "loc": ReceiveTestContract, + "text": "ReceiveTestContract", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-getter-with-method-id 1`] = ` +{ + "id": 17, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "attributes": [ + { + "kind": "function_attribute", + "loc": get(crc32("crc32") + 42 & 0x3ffff | 0x4000), + "methodId": { + "id": 12, + "kind": "op_binary", + "left": { + "id": 10, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "op_binary", + "left": { + "args": [ + { + "id": 5, + "kind": "string", + "loc": "crc32", + "value": "crc32", + }, + ], + "function": { + "id": 4, + "kind": "id", + "loc": crc32, + "text": "crc32", + }, + "id": 6, + "kind": "static_call", + "loc": crc32("crc32"), + }, + "loc": crc32("crc32") + 42, + "op": "+", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 42, + "value": 42n, + }, + }, + "loc": crc32("crc32") + 42 & 0x3ffff, + "op": "&", + "right": { + "base": 16, + "id": 9, + "kind": "number", + "loc": 0x3ffff, + "value": 262143n, + }, + }, + "loc": crc32("crc32") + 42 & 0x3ffff | 0x4000, + "op": "|", + "right": { + "base": 16, + "id": 11, + "kind": "number", + "loc": 0x4000, + "value": 16384n, + }, + }, + "type": "get", + }, + ], + "id": 15, + "kind": "function_def", + "loc": get(crc32("crc32") + 42 & 0x3ffff | 0x4000) fun test(): Int { + return 0 + }, + "name": { + "id": 2, + "kind": "id", + "loc": test, + "text": "test", + }, + "params": [], + "return": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 13, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "id": 14, + "kind": "statement_return", + "loc": return 0, + }, + ], + }, + ], + "id": 16, + "kind": "contract", + "loc": contract Test { + get(crc32("crc32") + 42 & 0x3ffff | 0x4000) fun test(): Int { + return 0 + } +}, + "name": { + "id": 1, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-optional-semicolon-for-last-const-def 1`] = ` +{ + "id": 7, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "attributes": [], + "id": 5, + "initializer": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "kind": "constant_def", + "loc": const foo: Int = 42, + "name": { + "id": 2, + "kind": "id", + "loc": foo, + "text": "foo", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 6, + "kind": "contract", + "loc": contract Test { const foo: Int = 42 }, + "name": { + "id": 1, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-optional-semicolon-for-last-storage-var 1`] = ` +{ + "id": 8, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 6, + "initializer": null, + "kind": "field_decl", + "loc": m: map, + "name": { + "id": 2, + "kind": "id", + "loc": m, + "text": "m", + }, + "type": { + "id": 5, + "keyStorageType": null, + "keyType": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": null, + "valueType": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "id": 7, + "kind": "contract", + "loc": contract Test { m: map }, + "name": { + "id": 1, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-with-const-override 1`] = ` +{ + "id": 7, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "attributes": [ + { + "loc": override, + "type": "override", + }, + ], + "id": 5, + "initializer": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "kind": "constant_def", + "loc": override const Test: Int = 0;, + "name": { + "id": 2, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 6, + "kind": "contract", + "loc": contract Contract { + override const Test: Int = 0; +}, + "name": { + "id": 1, + "kind": "id", + "loc": Contract, + "text": "Contract", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-with-imports 1`] = ` +{ + "id": 6, + "imports": [ + { + "id": 2, + "kind": "import", + "loc": import "@stdlib/deploy";, + "path": { + "id": 1, + "kind": "string", + "loc": "@stdlib/deploy", + "value": "@stdlib/deploy", + }, + }, + ], + "items": [ + { + "attributes": [], + "declarations": [], + "id": 5, + "kind": "contract", + "loc": contract Test with Deploy { }, + "name": { + "id": 3, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "traits": [ + { + "id": 4, + "kind": "id", + "loc": Deploy, + "text": "Deploy", + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-with-init 1`] = ` +{ + "id": 26, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 4, + "initializer": null, + "kind": "field_decl", + "loc": a: Int, + "name": { + "id": 2, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 7, + "initializer": null, + "kind": "field_decl", + "loc": b: Int, + "name": { + "id": 5, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 6, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 24, + "kind": "contract_init", + "loc": init(a: Int, b: Int) { + self.a = a; + self.b = b; + }, + "params": [ + { + "id": 10, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 8, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 9, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 13, + "kind": "typed_parameter", + "loc": b: Int, + "name": { + "id": 11, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 12, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "statements": [ + { + "expression": { + "id": 17, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 18, + "kind": "statement_assign", + "loc": self.a = a;, + "path": { + "aggregate": { + "id": 14, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 15, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 16, + "kind": "field_access", + "loc": self.a, + }, + }, + { + "expression": { + "id": 22, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 23, + "kind": "statement_assign", + "loc": self.b = b;, + "path": { + "aggregate": { + "id": 19, + "kind": "id", + "loc": self, + "text": "self", + }, + "field": { + "id": 20, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 21, + "kind": "field_access", + "loc": self.b, + }, + }, + ], + }, + ], + "id": 25, + "kind": "contract", + "loc": contract Sample { + a: Int; + b: Int; + + init(a: Int, b: Int) { + self.a = a; + self.b = b; + } +}, + "name": { + "id": 1, + "kind": "id", + "loc": Sample, + "text": "Sample", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-with-trait 1`] = ` +{ + "id": 24, + "imports": [], + "items": [ + { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 6, + "initializer": null, + "kind": "field_decl", + "loc": a: Int, + "name": { + "id": 4, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 5, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": virtual, + "type": "virtual", + }, + ], + "id": 11, + "kind": "function_def", + "loc": virtual fun a(): Int { + return a; + }, + "name": { + "id": 7, + "kind": "id", + "loc": a, + "text": "a", + }, + "params": [], + "return": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 9, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 10, + "kind": "statement_return", + "loc": return a;, + }, + ], + }, + ], + "id": 12, + "kind": "trait", + "loc": trait SomeTrait { + a: Int; + + virtual fun a(): Int { + return a; + } +}, + "name": { + "id": 3, + "kind": "id", + "loc": SomeTrait, + "text": "SomeTrait", + }, + "traits": [], + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": b: Int, + "name": { + "id": 15, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 16, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": override, + "type": "override", + }, + ], + "id": 22, + "kind": "function_def", + "loc": override fun a(): Int { + return b; + }, + "name": { + "id": 18, + "kind": "id", + "loc": a, + "text": "a", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 20, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 21, + "kind": "statement_return", + "loc": return b;, + }, + ], + }, + ], + "id": 23, + "kind": "contract", + "loc": contract Main with SomeTrait { + b: Int; + + override fun a(): Int { + return b; + } +}, + "name": { + "id": 13, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [ + { + "id": 14, + "kind": "id", + "loc": SomeTrait, + "text": "SomeTrait", + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse contract-with-trait-string-literal 1`] = ` +{ + "id": 24, + "imports": [], + "items": [ + { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 6, + "initializer": null, + "kind": "field_decl", + "loc": a: Int, + "name": { + "id": 4, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 5, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": virtual, + "type": "virtual", + }, + ], + "id": 11, + "kind": "function_def", + "loc": virtual fun a(): Int { + return a; + }, + "name": { + "id": 7, + "kind": "id", + "loc": a, + "text": "a", + }, + "params": [], + "return": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 9, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 10, + "kind": "statement_return", + "loc": return a;, + }, + ], + }, + ], + "id": 12, + "kind": "trait", + "loc": trait SomeTrait { + a: Int; + + virtual fun a(): Int { + return a; + } +}, + "name": { + "id": 3, + "kind": "id", + "loc": SomeTrait, + "text": "SomeTrait", + }, + "traits": [], + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": b: Int, + "name": { + "id": 15, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 16, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": override, + "type": "override", + }, + ], + "id": 22, + "kind": "function_def", + "loc": override fun a(): Int { + return "hello world!"; + }, + "name": { + "id": 18, + "kind": "id", + "loc": a, + "text": "a", + }, + "params": [], + "return": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 20, + "kind": "string", + "loc": "hello world!", + "value": "hello world!", + }, + "id": 21, + "kind": "statement_return", + "loc": return "hello world!";, + }, + ], + }, + ], + "id": 23, + "kind": "contract", + "loc": contract Main with SomeTrait { + b: Int; + + override fun a(): Int { + return "hello world!"; + } +}, + "name": { + "id": 13, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [ + { + "id": 14, + "kind": "id", + "loc": SomeTrait, + "text": "SomeTrait", + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-arith 1`] = ` +{ + "id": 12, + "imports": [], + "items": [ + { + "attributes": [], + "id": 11, + "kind": "function_def", + "loc": fun testFunc(): Int { + return (0 + 1) * 10 / 20; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "loc": 0 + 1, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "loc": (0 + 1) * 10, + "op": "*", + "right": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": (0 + 1) * 10 / 20, + "op": "/", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 20, + "value": 20n, + }, + }, + "id": 10, + "kind": "statement_return", + "loc": return (0 + 1) * 10 / 20;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-arith-and-cmp 1`] = ` +{ + "id": 14, + "imports": [], + "items": [ + { + "attributes": [], + "id": 13, + "kind": "function_def", + "loc": fun testFunc(): Int { + return (0 + 1) * 10 / 20 != 10; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 11, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "loc": 0 + 1, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "loc": (0 + 1) * 10, + "op": "*", + "right": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": (0 + 1) * 10 / 20, + "op": "/", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 20, + "value": 20n, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10, + "op": "!=", + "right": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "id": 12, + "kind": "statement_return", + "loc": return (0 + 1) * 10 / 20 != 10;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-arith-bool-cmp-method-call 1`] = ` +{ + "id": 28, + "imports": [], + "items": [ + { + "attributes": [], + "id": 27, + "kind": "function_def", + "loc": fun testFunc(): Int { + return (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < 123.add(10); +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 25, + "kind": "op_binary", + "left": { + "id": 13, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "loc": 0 + 1, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "loc": (0 + 1) * 10, + "op": "*", + "right": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": (0 + 1) * 10 / 20, + "op": "/", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 20, + "value": 20n, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId, + "op": "!=", + "right": { + "id": 12, + "kind": "op_binary", + "left": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 10, + "value": 10n, + }, + "loc": 10 * someId, + "op": "*", + "right": { + "id": 11, + "kind": "id", + "loc": someId, + "text": "someId", + }, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < 123.add(10), + "op": "||", + "right": { + "id": 24, + "kind": "op_binary", + "left": { + "id": 16, + "kind": "op_binary", + "left": { + "id": 14, + "kind": "id", + "loc": some2, + "text": "some2", + }, + "loc": some2 > 10, + "op": ">", + "right": { + "base": 10, + "id": 15, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": some2 > 10 && some3 < 123.add(10), + "op": "&&", + "right": { + "id": 23, + "kind": "op_binary", + "left": { + "id": 17, + "kind": "id", + "loc": some3, + "text": "some3", + }, + "loc": some3 < 123.add(10), + "op": "<", + "right": { + "args": [ + { + "base": 10, + "id": 21, + "kind": "number", + "loc": 10, + "value": 10n, + }, + ], + "id": 22, + "kind": "method_call", + "loc": 123.add(10), + "method": { + "id": 19, + "kind": "id", + "loc": add, + "text": "add", + }, + "self": { + "base": 10, + "id": 18, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + }, + }, + }, + "id": 26, + "kind": "statement_return", + "loc": return (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < 123.add(10);, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-arith-bool-var 1`] = ` +{ + "id": 24, + "imports": [], + "items": [ + { + "attributes": [], + "id": 23, + "kind": "function_def", + "loc": fun testFunc(): Int { + return (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < 10; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 21, + "kind": "op_binary", + "left": { + "id": 13, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "loc": 0 + 1, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "loc": (0 + 1) * 10, + "op": "*", + "right": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": (0 + 1) * 10 / 20, + "op": "/", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 20, + "value": 20n, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId, + "op": "!=", + "right": { + "id": 12, + "kind": "op_binary", + "left": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 10, + "value": 10n, + }, + "loc": 10 * someId, + "op": "*", + "right": { + "id": 11, + "kind": "id", + "loc": someId, + "text": "someId", + }, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < 10, + "op": "||", + "right": { + "id": 20, + "kind": "op_binary", + "left": { + "id": 16, + "kind": "op_binary", + "left": { + "id": 14, + "kind": "id", + "loc": some2, + "text": "some2", + }, + "loc": some2 > 10, + "op": ">", + "right": { + "base": 10, + "id": 15, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": some2 > 10 && some3 < 10, + "op": "&&", + "right": { + "id": 19, + "kind": "op_binary", + "left": { + "id": 17, + "kind": "id", + "loc": some3, + "text": "some3", + }, + "loc": some3 < 10, + "op": "<", + "right": { + "base": 10, + "id": 18, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + }, + }, + "id": 22, + "kind": "statement_return", + "loc": return (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < 10;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-chaining-unbox 1`] = ` +{ + "id": 18, + "imports": [], + "items": [ + { + "attributes": [], + "id": 17, + "kind": "function_def", + "loc": fun testFunc(m: map): Int { + return m.asCell()!!.hash(); +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 7, + "kind": "typed_parameter", + "loc": m: map, + "name": { + "id": 3, + "kind": "id", + "loc": m, + "text": "m", + }, + "type": { + "id": 6, + "keyStorageType": null, + "keyType": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": null, + "valueType": { + "id": 5, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [], + "id": 15, + "kind": "method_call", + "loc": m.asCell()!!.hash(), + "method": { + "id": 13, + "kind": "id", + "loc": hash, + "text": "hash", + }, + "self": { + "id": 12, + "kind": "op_unary", + "loc": m.asCell()!!, + "op": "!!", + "operand": { + "args": [], + "id": 11, + "kind": "method_call", + "loc": m.asCell(), + "method": { + "id": 9, + "kind": "id", + "loc": asCell, + "text": "asCell", + }, + "self": { + "id": 8, + "kind": "id", + "loc": m, + "text": "m", + }, + }, + }, + }, + "id": 16, + "kind": "statement_return", + "loc": return m.asCell()!!.hash();, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-condition-with-or 1`] = ` +{ + "id": 22, + "imports": [], + "items": [ + { + "attributes": [], + "id": 21, + "kind": "function_def", + "loc": fun testFunc(a: Int): Int { + return a == 123 || a == 456 ? a + 1 : a + 2; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 5, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "condition": { + "id": 12, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "op_binary", + "left": { + "id": 6, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 123, + "op": "==", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "loc": a == 123 || a == 456, + "op": "||", + "right": { + "id": 11, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 456, + "op": "==", + "right": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 456, + "value": 456n, + }, + }, + }, + "elseBranch": { + "id": 18, + "kind": "op_binary", + "left": { + "id": 16, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a + 2, + "op": "+", + "right": { + "base": 10, + "id": 17, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 19, + "kind": "conditional", + "loc": a == 123 || a == 456 ? a + 1 : a + 2, + "thenBranch": { + "id": 15, + "kind": "op_binary", + "left": { + "id": 13, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a + 1, + "op": "+", + "right": { + "base": 10, + "id": 14, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + }, + "id": 20, + "kind": "statement_return", + "loc": return a == 123 || a == 456 ? a + 1 : a + 2;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-conditional 1`] = ` +{ + "id": 14, + "imports": [], + "items": [ + { + "attributes": [], + "id": 13, + "kind": "function_def", + "loc": fun testFunc(a: Int): Int { + return a == 123 ? 1 : 2; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 5, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "condition": { + "id": 8, + "kind": "op_binary", + "left": { + "id": 6, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 123, + "op": "==", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "elseBranch": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 11, + "kind": "conditional", + "loc": a == 123 ? 1 : 2, + "thenBranch": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 12, + "kind": "statement_return", + "loc": return a == 123 ? 1 : 2;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-conditional-with-let 1`] = ` +{ + "id": 18, + "imports": [], + "items": [ + { + "attributes": [], + "id": 17, + "kind": "function_def", + "loc": fun testFunc(a: Int): Int { + let b: Int = a == 123 ? 1 : 2; + return b; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 5, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "condition": { + "id": 10, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 123, + "op": "==", + "right": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "elseBranch": { + "base": 10, + "id": 12, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 13, + "kind": "conditional", + "loc": a == 123 ? 1 : 2, + "thenBranch": { + "base": 10, + "id": 11, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 14, + "kind": "statement_let", + "loc": let b: Int = a == 123 ? 1 : 2;, + "name": { + "id": 6, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 15, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 16, + "kind": "statement_return", + "loc": return b;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-fun-call 1`] = ` +{ + "id": 30, + "imports": [], + "items": [ + { + "attributes": [], + "id": 29, + "kind": "function_def", + "loc": fun testFunc(): Int { + return (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < abs(123.add(10)); +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 27, + "kind": "op_binary", + "left": { + "id": 13, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "loc": 0 + 1, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "loc": (0 + 1) * 10, + "op": "*", + "right": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": (0 + 1) * 10 / 20, + "op": "/", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 20, + "value": 20n, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId, + "op": "!=", + "right": { + "id": 12, + "kind": "op_binary", + "left": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 10, + "value": 10n, + }, + "loc": 10 * someId, + "op": "*", + "right": { + "id": 11, + "kind": "id", + "loc": someId, + "text": "someId", + }, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < abs(123.add(10)), + "op": "||", + "right": { + "id": 26, + "kind": "op_binary", + "left": { + "id": 16, + "kind": "op_binary", + "left": { + "id": 14, + "kind": "id", + "loc": some2, + "text": "some2", + }, + "loc": some2 > 10, + "op": ">", + "right": { + "base": 10, + "id": 15, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": some2 > 10 && some3 < abs(123.add(10)), + "op": "&&", + "right": { + "id": 25, + "kind": "op_binary", + "left": { + "id": 17, + "kind": "id", + "loc": some3, + "text": "some3", + }, + "loc": some3 < abs(123.add(10)), + "op": "<", + "right": { + "args": [ + { + "args": [ + { + "base": 10, + "id": 22, + "kind": "number", + "loc": 10, + "value": 10n, + }, + ], + "id": 23, + "kind": "method_call", + "loc": 123.add(10), + "method": { + "id": 20, + "kind": "id", + "loc": add, + "text": "add", + }, + "self": { + "base": 10, + "id": 19, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + ], + "function": { + "id": 18, + "kind": "id", + "loc": abs, + "text": "abs", + }, + "id": 24, + "kind": "static_call", + "loc": abs(123.add(10)), + }, + }, + }, + }, + "id": 28, + "kind": "statement_return", + "loc": return (0 + 1) * 10 / 20 != 10 * someId || some2 > 10 && some3 < abs(123.add(10));, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-int-literal 1`] = ` +{ + "id": 6, + "imports": [], + "items": [ + { + "attributes": [], + "id": 5, + "kind": "function_def", + "loc": fun testFunc(): Int { + return 0; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "id": 4, + "kind": "statement_return", + "loc": return 0;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-nested-conditional 1`] = ` +{ + "id": 27, + "imports": [], + "items": [ + { + "attributes": [], + "id": 26, + "kind": "function_def", + "loc": fun testFunc(a: Int): Int { + return a == 123 || a == 456 ? (a == 10 ? a : a * 2) : a + 2; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 5, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "condition": { + "id": 12, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "op_binary", + "left": { + "id": 6, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 123, + "op": "==", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "loc": a == 123 || a == 456, + "op": "||", + "right": { + "id": 11, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 456, + "op": "==", + "right": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 456, + "value": 456n, + }, + }, + }, + "elseBranch": { + "id": 23, + "kind": "op_binary", + "left": { + "id": 21, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a + 2, + "op": "+", + "right": { + "base": 10, + "id": 22, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 24, + "kind": "conditional", + "loc": a == 123 || a == 456 ? (a == 10 ? a : a * 2) : a + 2, + "thenBranch": { + "condition": { + "id": 15, + "kind": "op_binary", + "left": { + "id": 13, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a == 10, + "op": "==", + "right": { + "base": 10, + "id": 14, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "elseBranch": { + "id": 19, + "kind": "op_binary", + "left": { + "id": 17, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a * 2, + "op": "*", + "right": { + "base": 10, + "id": 18, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 20, + "kind": "conditional", + "loc": a == 10 ? a : a * 2, + "thenBranch": { + "id": 16, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + }, + "id": 25, + "kind": "statement_return", + "loc": return a == 123 || a == 456 ? (a == 10 ? a : a * 2) : a + 2;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-parens 1`] = ` +{ + "id": 15, + "imports": [], + "items": [ + { + "attributes": [], + "id": 14, + "kind": "function_def", + "loc": fun testFunc(): Int { + return 1 + 2 + (123 + 3)!! > 123; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 12, + "kind": "op_binary", + "left": { + "id": 10, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "loc": 1 + 2, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "loc": 1 + 2 + (123 + 3)!!, + "op": "+", + "right": { + "id": 9, + "kind": "op_unary", + "loc": (123 + 3)!!, + "op": "!!", + "operand": { + "id": 8, + "kind": "op_binary", + "left": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 123, + "value": 123n, + }, + "loc": 123 + 3, + "op": "+", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 3, + "value": 3n, + }, + }, + }, + }, + "loc": 1 + 2 + (123 + 3)!! > 123, + "op": ">", + "right": { + "base": 10, + "id": 11, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "id": 13, + "kind": "statement_return", + "loc": return 1 + 2 + (123 + 3)!! > 123;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-with-unbox 1`] = ` +{ + "id": 13, + "imports": [], + "items": [ + { + "attributes": [], + "id": 12, + "kind": "function_def", + "loc": fun testFunc(): Int { + return 1 + 2 + 3!! > 123; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 10, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "loc": 1 + 2, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "loc": 1 + 2 + 3!!, + "op": "+", + "right": { + "id": 7, + "kind": "op_unary", + "loc": 3!!, + "op": "!!", + "operand": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 3, + "value": 3n, + }, + }, + }, + "loc": 1 + 2 + 3!! > 123, + "op": ">", + "right": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "id": 11, + "kind": "statement_return", + "loc": return 1 + 2 + 3!! > 123;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse expr-with-var 1`] = ` +{ + "id": 16, + "imports": [], + "items": [ + { + "attributes": [], + "id": 15, + "kind": "function_def", + "loc": fun testFunc(): Int { + return (0 + 1) * 10 / 20 != 10 * someId; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 13, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "op_binary", + "left": { + "id": 5, + "kind": "op_binary", + "left": { + "base": 10, + "id": 3, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "loc": 0 + 1, + "op": "+", + "right": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "loc": (0 + 1) * 10, + "op": "*", + "right": { + "base": 10, + "id": 6, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": (0 + 1) * 10 / 20, + "op": "/", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 20, + "value": 20n, + }, + }, + "loc": (0 + 1) * 10 / 20 != 10 * someId, + "op": "!=", + "right": { + "id": 12, + "kind": "op_binary", + "left": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 10, + "value": 10n, + }, + "loc": 10 * someId, + "op": "*", + "right": { + "id": 11, + "kind": "id", + "loc": someId, + "text": "someId", + }, + }, + }, + "id": 14, + "kind": "statement_return", + "loc": return (0 + 1) * 10 / 20 != 10 * someId;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse items-asm-funs 1`] = ` +{ + "id": 67, + "imports": [], + "items": [ + { + "attributes": [], + "id": 6, + "instructions": [ + "1 + INT + HASHEXT_KECCAK256", + ], + "kind": "asm_function_def", + "loc": asm fun keccak256(s: Slice): Int { + 1 + INT + HASHEXT_KECCAK256 +}, + "name": { + "id": 1, + "kind": "id", + "loc": keccak256, + "text": "keccak256", + }, + "params": [ + { + "id": 5, + "kind": "typed_parameter", + "loc": s: Slice, + "name": { + "id": 3, + "kind": "id", + "loc": s, + "text": "s", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Slice, + "text": "Slice", + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": extends, + "type": "extends", + }, + ], + "id": 14, + "instructions": [ + "LDVARUINT16", + ], + "kind": "asm_function_def", + "loc": asm( -> 1 0) extends fun loadCoins(self: Slice): Int { + LDVARUINT16 +}, + "name": { + "id": 9, + "kind": "id", + "loc": loadCoins, + "text": "loadCoins", + }, + "params": [ + { + "id": 13, + "kind": "typed_parameter", + "loc": self: Slice, + "name": { + "id": 11, + "kind": "id", + "loc": self, + "text": "self", + }, + "type": { + "id": 12, + "kind": "type_id", + "loc": Slice, + "text": "Slice", + }, + }, + ], + "return": { + "id": 10, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [ + { + "base": 10, + "id": 7, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 8, + "kind": "number", + "loc": 0, + "value": 0n, + }, + ], + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": extends, + "type": "extends", + }, + ], + "id": 24, + "instructions": [ + "STDICT", + ], + "kind": "asm_function_def", + "loc": asm(c b) extends fun storeDict(b: Builder, c: Cell) { + STDICT +}, + "name": { + "id": 17, + "kind": "id", + "loc": storeDict, + "text": "storeDict", + }, + "params": [ + { + "id": 20, + "kind": "typed_parameter", + "loc": b: Builder, + "name": { + "id": 18, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 19, + "kind": "type_id", + "loc": Builder, + "text": "Builder", + }, + }, + { + "id": 23, + "kind": "typed_parameter", + "loc": c: Cell, + "name": { + "id": 21, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 22, + "kind": "type_id", + "loc": Cell, + "text": "Cell", + }, + }, + ], + "return": null, + "shuffle": { + "args": [ + { + "id": 15, + "kind": "id", + "loc": c, + "text": "c", + }, + { + "id": 16, + "kind": "id", + "loc": b, + "text": "b", + }, + ], + "ret": [], + }, + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": extends, + "type": "extends", + }, + ], + "id": 37, + "instructions": [ + "LDIX", + ], + "kind": "asm_function_def", + "loc": asm(s len -> 1 0) extends fun loadInt(self: Slice, len: Int): Int { + LDIX +}, + "name": { + "id": 29, + "kind": "id", + "loc": loadInt, + "text": "loadInt", + }, + "params": [ + { + "id": 33, + "kind": "typed_parameter", + "loc": self: Slice, + "name": { + "id": 31, + "kind": "id", + "loc": self, + "text": "self", + }, + "type": { + "id": 32, + "kind": "type_id", + "loc": Slice, + "text": "Slice", + }, + }, + { + "id": 36, + "kind": "typed_parameter", + "loc": len: Int, + "name": { + "id": 34, + "kind": "id", + "loc": len, + "text": "len", + }, + "type": { + "id": 35, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 30, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [ + { + "id": 25, + "kind": "id", + "loc": s, + "text": "s", + }, + { + "id": 26, + "kind": "id", + "loc": len, + "text": "len", + }, + ], + "ret": [ + { + "base": 10, + "id": 27, + "kind": "number", + "loc": 1, + "value": 1n, + }, + { + "base": 10, + "id": 28, + "kind": "number", + "loc": 0, + "value": 0n, + }, + ], + }, + }, + { + "attributes": [], + "id": 43, + "instructions": [ + "x{02} SDBEGINSQ", + ], + "kind": "asm_function_def", + "loc": asm fun checkAndRemoveAddExtensionPrefix(self: Slice): Int { + x{02} SDBEGINSQ +}, + "name": { + "id": 38, + "kind": "id", + "loc": checkAndRemoveAddExtensionPrefix, + "text": "checkAndRemoveAddExtensionPrefix", + }, + "params": [ + { + "id": 42, + "kind": "typed_parameter", + "loc": self: Slice, + "name": { + "id": 40, + "kind": "id", + "loc": self, + "text": "self", + }, + "type": { + "id": 41, + "kind": "type_id", + "loc": Slice, + "text": "Slice", + }, + }, + ], + "return": { + "id": 39, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 45, + "instructions": [ + "-ROT", + ], + "kind": "asm_function_def", + "loc": asm fun checkAndRemoveAddExtensionPrefix() { + -ROT +}, + "name": { + "id": 44, + "kind": "id", + "loc": checkAndRemoveAddExtensionPrefix, + "text": "checkAndRemoveAddExtensionPrefix", + }, + "params": [], + "return": null, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 47, + "instructions": [ + ""Works!" DEBUGSTR", + ], + "kind": "asm_function_def", + "loc": asm fun debugStr1() { + "Works!" DEBUGSTR +}, + "name": { + "id": 46, + "kind": "id", + "loc": debugStr1, + "text": "debugStr1", + }, + "params": [], + "return": null, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 49, + "instructions": [ + ""Works!"", + ], + "kind": "asm_function_def", + "loc": asm fun debugStr2() { "Works!" }, + "name": { + "id": 48, + "kind": "id", + "loc": debugStr2, + "text": "debugStr2", + }, + "params": [], + "return": null, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 51, + "instructions": [ + "{ INC }", + ], + "kind": "asm_function_def", + "loc": asm fun createWord() { + { INC } +}, + "name": { + "id": 50, + "kind": "id", + "loc": createWord, + "text": "createWord", + }, + "params": [], + "return": null, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 54, + "instructions": [ + "{ INC } : incinc + 41 incinc", + ], + "kind": "asm_function_def", + "loc": asm fun createAndUseWord1(): Int { + { INC } : incinc + 41 incinc +}, + "name": { + "id": 52, + "kind": "id", + "loc": createAndUseWord1, + "text": "createAndUseWord1", + }, + "params": [], + "return": { + "id": 53, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 57, + "instructions": [ + "{ INC +} +: incinc 41 incinc", + ], + "kind": "asm_function_def", + "loc": asm fun createAndUseWord2(): Int { { INC +} +: incinc 41 incinc +}, + "name": { + "id": 55, + "kind": "id", + "loc": createAndUseWord2, + "text": "createAndUseWord2", + }, + "params": [], + "return": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 60, + "instructions": [ + "{ +INC +} +: +incinc +41 +incinc", + ], + "kind": "asm_function_def", + "loc": asm fun createAndUseWord3(): Int { +{ +INC +} +: +incinc +41 +incinc +}, + "name": { + "id": 58, + "kind": "id", + "loc": createAndUseWord3, + "text": "createAndUseWord3", + }, + "params": [], + "return": { + "id": 59, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [], + }, + }, + { + "attributes": [], + "id": 66, + "instructions": [ + "<{ + TRY:<{ + 0 PUSHINT ADD DROP -1 PUSHINT + }>CATCH<{ + 2DROP 0 PUSHINT + }> + }>CONT 1 1 CALLXARGS", + ], + "kind": "asm_function_def", + "loc": asm fun isIntAnInt(x: Int): Int { + <{ + TRY:<{ + 0 PUSHINT ADD DROP -1 PUSHINT + }>CATCH<{ + 2DROP 0 PUSHINT + }> + }>CONT 1 1 CALLXARGS +}, + "name": { + "id": 61, + "kind": "id", + "loc": isIntAnInt, + "text": "isIntAnInt", + }, + "params": [ + { + "id": 65, + "kind": "typed_parameter", + "loc": x: Int, + "name": { + "id": 63, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 64, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 62, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "shuffle": { + "args": [], + "ret": [], + }, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse items-method-def-initof-trailing-comma-shifts 1`] = ` +{ + "id": 112, + "imports": [], + "items": [ + { + "attributes": [], + "id": 19, + "kind": "function_def", + "loc": fun function(a: Int, b: Int): Int { + return (a >> b) || (a << (32 - b)); +}, + "name": { + "id": 1, + "kind": "id", + "loc": function, + "text": "function", + }, + "params": [ + { + "id": 5, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 8, + "kind": "typed_parameter", + "loc": b: Int, + "name": { + "id": 6, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 7, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 17, + "kind": "op_binary", + "left": { + "id": 11, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a >> b, + "op": ">>", + "right": { + "id": 10, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + "loc": (a >> b) || (a << (32 - b)), + "op": "||", + "right": { + "id": 16, + "kind": "op_binary", + "left": { + "id": 12, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a << (32 - b), + "op": "<<", + "right": { + "id": 15, + "kind": "op_binary", + "left": { + "base": 10, + "id": 13, + "kind": "number", + "loc": 32, + "value": 32n, + }, + "loc": 32 - b, + "op": "-", + "right": { + "id": 14, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + }, + }, + "id": 18, + "kind": "statement_return", + "loc": return (a >> b) || (a << (32 - b));, + }, + ], + }, + { + "attributes": [], + "id": 38, + "kind": "function_def", + "loc": fun anotherFunction( + a: Int, + b: Int, + ): Int { + return (a >> b) || (a << (32 - b)); +}, + "name": { + "id": 20, + "kind": "id", + "loc": anotherFunction, + "text": "anotherFunction", + }, + "params": [ + { + "id": 24, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 22, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 23, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 27, + "kind": "typed_parameter", + "loc": b: Int, + "name": { + "id": 25, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 26, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 36, + "kind": "op_binary", + "left": { + "id": 30, + "kind": "op_binary", + "left": { + "id": 28, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a >> b, + "op": ">>", + "right": { + "id": 29, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + "loc": (a >> b) || (a << (32 - b)), + "op": "||", + "right": { + "id": 35, + "kind": "op_binary", + "left": { + "id": 31, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a << (32 - b), + "op": "<<", + "right": { + "id": 34, + "kind": "op_binary", + "left": { + "base": 10, + "id": 32, + "kind": "number", + "loc": 32, + "value": 32n, + }, + "loc": 32 - b, + "op": "-", + "right": { + "id": 33, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + }, + }, + "id": 37, + "kind": "statement_return", + "loc": return (a >> b) || (a << (32 - b));, + }, + ], + }, + { + "attributes": [ + { + "kind": "function_attribute", + "loc": extends, + "type": "extends", + }, + ], + "id": 55, + "kind": "function_def", + "loc": extends fun extension(self: Int, c: Int, d: Int) { + return self + c + d; +}, + "name": { + "id": 39, + "kind": "id", + "loc": extension, + "text": "extension", + }, + "params": [ + { + "id": 42, + "kind": "typed_parameter", + "loc": self: Int, + "name": { + "id": 40, + "kind": "id", + "loc": self, + "text": "self", + }, + "type": { + "id": 41, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 45, + "kind": "typed_parameter", + "loc": c: Int, + "name": { + "id": 43, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 44, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 48, + "kind": "typed_parameter", + "loc": d: Int, + "name": { + "id": 46, + "kind": "id", + "loc": d, + "text": "d", + }, + "type": { + "id": 47, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": null, + "statements": [ + { + "expression": { + "id": 53, + "kind": "op_binary", + "left": { + "id": 51, + "kind": "op_binary", + "left": { + "id": 49, + "kind": "id", + "loc": self, + "text": "self", + }, + "loc": self + c, + "op": "+", + "right": { + "id": 50, + "kind": "id", + "loc": c, + "text": "c", + }, + }, + "loc": self + c + d, + "op": "+", + "right": { + "id": 52, + "kind": "id", + "loc": d, + "text": "d", + }, + }, + "id": 54, + "kind": "statement_return", + "loc": return self + c + d;, + }, + ], + }, + { + "attributes": [], + "id": 79, + "kind": "function_def", + "loc": fun coverage(a: Int, b: Int) { + let k: Int = a.extension( + b, + 4, + ); + + let c: Int = anotherFunction( + a, + b, + ); +}, + "name": { + "id": 56, + "kind": "id", + "loc": coverage, + "text": "coverage", + }, + "params": [ + { + "id": 59, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 57, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 58, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 62, + "kind": "typed_parameter", + "loc": b: Int, + "name": { + "id": 60, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 61, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": null, + "statements": [ + { + "expression": { + "args": [ + { + "id": 68, + "kind": "id", + "loc": b, + "text": "b", + }, + { + "base": 10, + "id": 69, + "kind": "number", + "loc": 4, + "value": 4n, + }, + ], + "id": 70, + "kind": "method_call", + "loc": a.extension( + b, + 4, + ), + "method": { + "id": 66, + "kind": "id", + "loc": extension, + "text": "extension", + }, + "self": { + "id": 65, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + "id": 71, + "kind": "statement_let", + "loc": let k: Int = a.extension( + b, + 4, + );, + "name": { + "id": 63, + "kind": "id", + "loc": k, + "text": "k", + }, + "type": { + "id": 64, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "args": [ + { + "id": 75, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 76, + "kind": "id", + "loc": b, + "text": "b", + }, + ], + "function": { + "id": 74, + "kind": "id", + "loc": anotherFunction, + "text": "anotherFunction", + }, + "id": 77, + "kind": "static_call", + "loc": anotherFunction( + a, + b, + ), + }, + "id": 78, + "kind": "statement_let", + "loc": let c: Int = anotherFunction( + a, + b, + );, + "name": { + "id": 72, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 73, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + }, + { + "attributes": [], + "id": 93, + "kind": "function_def", + "loc": fun oneMoreFunction( + a: Int, + b: Int, + ): Int { + return anotherFunction( + a, + b, + ); +}, + "name": { + "id": 80, + "kind": "id", + "loc": oneMoreFunction, + "text": "oneMoreFunction", + }, + "params": [ + { + "id": 84, + "kind": "typed_parameter", + "loc": a: Int, + "name": { + "id": 82, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 83, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 87, + "kind": "typed_parameter", + "loc": b: Int, + "name": { + "id": 85, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 86, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "return": { + "id": 81, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [ + { + "id": 89, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 90, + "kind": "id", + "loc": b, + "text": "b", + }, + ], + "function": { + "id": 88, + "kind": "id", + "loc": anotherFunction, + "text": "anotherFunction", + }, + "id": 91, + "kind": "static_call", + "loc": anotherFunction( + a, + b, + ), + }, + "id": 92, + "kind": "statement_return", + "loc": return anotherFunction( + a, + b, + );, + }, + ], + }, + { + "attributes": [], + "declarations": [ + { + "id": 101, + "kind": "contract_init", + "loc": init( + arg1: Int, + arg2: Int, + ) {}, + "params": [ + { + "id": 97, + "kind": "typed_parameter", + "loc": arg1: Int, + "name": { + "id": 95, + "kind": "id", + "loc": arg1, + "text": "arg1", + }, + "type": { + "id": 96, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "id": 100, + "kind": "typed_parameter", + "loc": arg2: Int, + "name": { + "id": 98, + "kind": "id", + "loc": arg2, + "text": "arg2", + }, + "type": { + "id": 99, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "statements": [], + }, + ], + "id": 102, + "kind": "contract", + "loc": contract TestContract { + init( + arg1: Int, + arg2: Int, + ) {} +}, + "name": { + "id": 94, + "kind": "id", + "loc": TestContract, + "text": "TestContract", + }, + "traits": [], + }, + { + "attributes": [], + "id": 111, + "kind": "function_def", + "loc": fun test() { + let k: StateInit = initOf TestContract( + 2, + 3, + ); +}, + "name": { + "id": 103, + "kind": "id", + "loc": test, + "text": "test", + }, + "params": [], + "return": null, + "statements": [ + { + "expression": { + "args": [ + { + "base": 10, + "id": 107, + "kind": "number", + "loc": 2, + "value": 2n, + }, + { + "base": 10, + "id": 108, + "kind": "number", + "loc": 3, + "value": 3n, + }, + ], + "contract": { + "id": 106, + "kind": "id", + "loc": TestContract, + "text": "TestContract", + }, + "id": 109, + "kind": "init_of", + "loc": initOf TestContract( + 2, + 3, + ), + }, + "id": 110, + "kind": "statement_let", + "loc": let k: StateInit = initOf TestContract( + 2, + 3, + );, + "name": { + "id": 104, + "kind": "id", + "loc": k, + "text": "k", + }, + "type": { + "id": 105, + "kind": "type_id", + "loc": StateInit, + "text": "StateInit", + }, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse items-multi-funs 1`] = ` +{ + "id": 15, + "imports": [], + "items": [ + { + "attributes": [], + "id": 4, + "kind": "function_def", + "loc": fun testFunc() { + return 0; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": null, + "statements": [ + { + "expression": { + "base": 10, + "id": 2, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "id": 3, + "kind": "statement_return", + "loc": return 0;, + }, + ], + }, + { + "attributes": [], + "id": 9, + "kind": "function_def", + "loc": fun testFunc(): Int { + return 0; +}, + "name": { + "id": 5, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 6, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "id": 8, + "kind": "statement_return", + "loc": return 0;, + }, + ], + }, + { + "attributes": [], + "id": 14, + "kind": "function_def", + "loc": fun testFunc(): Bool { + return 0; +}, + "name": { + "id": 10, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 11, + "kind": "type_id", + "loc": Bool, + "text": "Bool", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 12, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "id": 13, + "kind": "statement_return", + "loc": return 0;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse items-native-fun-decls 1`] = ` +{ + "id": 12, + "imports": [], + "items": [ + { + "attributes": [], + "id": 3, + "kind": "native_function_decl", + "loc": @name(native_name_1) +native testFunc();, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "nativeName": { + "id": 2, + "kind": "func_id", + "loc": native_name_1, + "text": "native_name_1", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 7, + "kind": "native_function_decl", + "loc": @name(native_name_2) +native testFunc(): Int;, + "name": { + "id": 4, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "nativeName": { + "id": 5, + "kind": "func_id", + "loc": native_name_2, + "text": "native_name_2", + }, + "params": [], + "return": { + "id": 6, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [], + "id": 11, + "kind": "native_function_decl", + "loc": @name(native_name_3) +native testFunc(): Bool;, + "name": { + "id": 8, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "nativeName": { + "id": 9, + "kind": "func_id", + "loc": native_name_3, + "text": "native_name_3", + }, + "params": [], + "return": { + "id": 10, + "kind": "type_id", + "loc": Bool, + "text": "Bool", + }, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse items-native-fun-funcid 1`] = ` +{ + "id": 124, + "imports": [], + "items": [ + { + "attributes": [], + "id": 3, + "kind": "native_function_decl", + "loc": @name(query') +native idTest1();, + "name": { + "id": 1, + "kind": "id", + "loc": idTest1, + "text": "idTest1", + }, + "nativeName": { + "id": 2, + "kind": "func_id", + "loc": query', + "text": "query'", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 6, + "kind": "native_function_decl", + "loc": @name(query'') +native idTest2();, + "name": { + "id": 4, + "kind": "id", + "loc": idTest2, + "text": "idTest2", + }, + "nativeName": { + "id": 5, + "kind": "func_id", + "loc": query'', + "text": "query''", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 9, + "kind": "native_function_decl", + "loc": @name(CHECK) +native idTest3();, + "name": { + "id": 7, + "kind": "id", + "loc": idTest3, + "text": "idTest3", + }, + "nativeName": { + "id": 8, + "kind": "func_id", + "loc": CHECK, + "text": "CHECK", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 12, + "kind": "native_function_decl", + "loc": @name(_internal_val) +native idTest4();, + "name": { + "id": 10, + "kind": "id", + "loc": idTest4, + "text": "idTest4", + }, + "nativeName": { + "id": 11, + "kind": "func_id", + "loc": _internal_val, + "text": "_internal_val", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 15, + "kind": "native_function_decl", + "loc": @name(message_found?) +native idTest5();, + "name": { + "id": 13, + "kind": "id", + "loc": idTest5, + "text": "idTest5", + }, + "nativeName": { + "id": 14, + "kind": "func_id", + "loc": message_found?, + "text": "message_found?", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 18, + "kind": "native_function_decl", + "loc": @name(get_pubkeys&signatures) +native idTest6();, + "name": { + "id": 16, + "kind": "id", + "loc": idTest6, + "text": "idTest6", + }, + "nativeName": { + "id": 17, + "kind": "func_id", + "loc": get_pubkeys&signatures, + "text": "get_pubkeys&signatures", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 21, + "kind": "native_function_decl", + "loc": @name(dict::udict_set_builder) +native idTest7();, + "name": { + "id": 19, + "kind": "id", + "loc": idTest7, + "text": "idTest7", + }, + "nativeName": { + "id": 20, + "kind": "func_id", + "loc": dict::udict_set_builder, + "text": "dict::udict_set_builder", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 24, + "kind": "native_function_decl", + "loc": @name(_+_) +native idTest8();, + "name": { + "id": 22, + "kind": "id", + "loc": idTest8, + "text": "idTest8", + }, + "nativeName": { + "id": 23, + "kind": "func_id", + "loc": _+_, + "text": "_+_", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 27, + "kind": "native_function_decl", + "loc": @name(__) +native idTest9();, + "name": { + "id": 25, + "kind": "id", + "loc": idTest9, + "text": "idTest9", + }, + "nativeName": { + "id": 26, + "kind": "func_id", + "loc": __, + "text": "__", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 30, + "kind": "native_function_decl", + "loc": @name(fatal!) +native idTest10();, + "name": { + "id": 28, + "kind": "id", + "loc": idTest10, + "text": "idTest10", + }, + "nativeName": { + "id": 29, + "kind": "func_id", + "loc": fatal!, + "text": "fatal!", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 33, + "kind": "native_function_decl", + "loc": @name(123validname) +native idTest11();, + "name": { + "id": 31, + "kind": "id", + "loc": idTest11, + "text": "idTest11", + }, + "nativeName": { + "id": 32, + "kind": "func_id", + "loc": 123validname, + "text": "123validname", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 36, + "kind": "native_function_decl", + "loc": @name(2+2=2*2) +native idTest12();, + "name": { + "id": 34, + "kind": "id", + "loc": idTest12, + "text": "idTest12", + }, + "nativeName": { + "id": 35, + "kind": "func_id", + "loc": 2+2=2*2, + "text": "2+2=2*2", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 39, + "kind": "native_function_decl", + "loc": @name(-alsovalidname) +native idTest13();, + "name": { + "id": 37, + "kind": "id", + "loc": idTest13, + "text": "idTest13", + }, + "nativeName": { + "id": 38, + "kind": "func_id", + "loc": -alsovalidname, + "text": "-alsovalidname", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 42, + "kind": "native_function_decl", + "loc": @name(0xefefefhahaha) +native idTest14();, + "name": { + "id": 40, + "kind": "id", + "loc": idTest14, + "text": "idTest14", + }, + "nativeName": { + "id": 41, + "kind": "func_id", + "loc": 0xefefefhahaha, + "text": "0xefefefhahaha", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 45, + "kind": "native_function_decl", + "loc": @name({hehehe}) +native idTest15();, + "name": { + "id": 43, + "kind": "id", + "loc": idTest15, + "text": "idTest15", + }, + "nativeName": { + "id": 44, + "kind": "func_id", + "loc": {hehehe}, + "text": "{hehehe}", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 48, + "kind": "native_function_decl", + "loc": @name(pa{--}in"\`aaa\`") +native idTest16();, + "name": { + "id": 46, + "kind": "id", + "loc": idTest16, + "text": "idTest16", + }, + "nativeName": { + "id": 47, + "kind": "func_id", + "loc": pa{--}in"\`aaa\`", + "text": "pa{--}in"\`aaa\`"", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 51, + "kind": "native_function_decl", + "loc": @name(\`I'm a function too\`) +native idTest17();, + "name": { + "id": 49, + "kind": "id", + "loc": idTest17, + "text": "idTest17", + }, + "nativeName": { + "id": 50, + "kind": "func_id", + "loc": \`I'm a function too\`, + "text": "\`I'm a function too\`", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 54, + "kind": "native_function_decl", + "loc": @name(\`any symbols ; ~ () are allowed here...\`) +native idTest18();, + "name": { + "id": 52, + "kind": "id", + "loc": idTest18, + "text": "idTest18", + }, + "nativeName": { + "id": 53, + "kind": "func_id", + "loc": \`any symbols ; ~ () are allowed here...\`, + "text": "\`any symbols ; ~ () are allowed here...\`", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 57, + "kind": "native_function_decl", + "loc": @name(C4) +native idTest19();, + "name": { + "id": 55, + "kind": "id", + "loc": idTest19, + "text": "idTest19", + }, + "nativeName": { + "id": 56, + "kind": "func_id", + "loc": C4, + "text": "C4", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 60, + "kind": "native_function_decl", + "loc": @name(C4g) +native idTest20();, + "name": { + "id": 58, + "kind": "id", + "loc": idTest20, + "text": "idTest20", + }, + "nativeName": { + "id": 59, + "kind": "func_id", + "loc": C4g, + "text": "C4g", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 63, + "kind": "native_function_decl", + "loc": @name(4C) +native idTest21();, + "name": { + "id": 61, + "kind": "id", + "loc": idTest21, + "text": "idTest21", + }, + "nativeName": { + "id": 62, + "kind": "func_id", + "loc": 4C, + "text": "4C", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 66, + "kind": "native_function_decl", + "loc": @name(_0x0) +native idTest22();, + "name": { + "id": 64, + "kind": "id", + "loc": idTest22, + "text": "idTest22", + }, + "nativeName": { + "id": 65, + "kind": "func_id", + "loc": _0x0, + "text": "_0x0", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 69, + "kind": "native_function_decl", + "loc": @name(_0) +native idTest23();, + "name": { + "id": 67, + "kind": "id", + "loc": idTest23, + "text": "idTest23", + }, + "nativeName": { + "id": 68, + "kind": "func_id", + "loc": _0, + "text": "_0", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 72, + "kind": "native_function_decl", + "loc": @name(0x_) +native idTest24();, + "name": { + "id": 70, + "kind": "id", + "loc": idTest24, + "text": "idTest24", + }, + "nativeName": { + "id": 71, + "kind": "func_id", + "loc": 0x_, + "text": "0x_", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 75, + "kind": "native_function_decl", + "loc": @name(0x0_) +native idTest25();, + "name": { + "id": 73, + "kind": "id", + "loc": idTest25, + "text": "idTest25", + }, + "nativeName": { + "id": 74, + "kind": "func_id", + "loc": 0x0_, + "text": "0x0_", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 78, + "kind": "native_function_decl", + "loc": @name(0_) +native idTest26();, + "name": { + "id": 76, + "kind": "id", + "loc": idTest26, + "text": "idTest26", + }, + "nativeName": { + "id": 77, + "kind": "func_id", + "loc": 0_, + "text": "0_", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 81, + "kind": "native_function_decl", + "loc": @name(hash#256) +native idTest27();, + "name": { + "id": 79, + "kind": "id", + "loc": idTest27, + "text": "idTest27", + }, + "nativeName": { + "id": 80, + "kind": "func_id", + "loc": hash#256, + "text": "hash#256", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 84, + "kind": "native_function_decl", + "loc": @name(💀💀💀0xDEADBEEF💀💀💀) +native idTest28();, + "name": { + "id": 82, + "kind": "id", + "loc": idTest28, + "text": "idTest28", + }, + "nativeName": { + "id": 83, + "kind": "func_id", + "loc": 💀💀💀0xDEADBEEF💀💀💀, + "text": "💀💀💀0xDEADBEEF💀💀💀", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 87, + "kind": "native_function_decl", + "loc": @name(__tact_verify_address) +native idTest29();, + "name": { + "id": 85, + "kind": "id", + "loc": idTest29, + "text": "idTest29", + }, + "nativeName": { + "id": 86, + "kind": "func_id", + "loc": __tact_verify_address, + "text": "__tact_verify_address", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 90, + "kind": "native_function_decl", + "loc": @name(__tact_pow2) +native idTest30();, + "name": { + "id": 88, + "kind": "id", + "loc": idTest30, + "text": "idTest30", + }, + "nativeName": { + "id": 89, + "kind": "func_id", + "loc": __tact_pow2, + "text": "__tact_pow2", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 93, + "kind": "native_function_decl", + "loc": @name(randomize_lt) +native idTest31();, + "name": { + "id": 91, + "kind": "id", + "loc": idTest31, + "text": "idTest31", + }, + "nativeName": { + "id": 92, + "kind": "func_id", + "loc": randomize_lt, + "text": "randomize_lt", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 96, + "kind": "native_function_decl", + "loc": @name(fixed248::asin) +native idTest32();, + "name": { + "id": 94, + "kind": "id", + "loc": idTest32, + "text": "idTest32", + }, + "nativeName": { + "id": 95, + "kind": "func_id", + "loc": fixed248::asin, + "text": "fixed248::asin", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 99, + "kind": "native_function_decl", + "loc": @name(fixed248::nrand_fast) +native idTest33();, + "name": { + "id": 97, + "kind": "id", + "loc": idTest33, + "text": "idTest33", + }, + "nativeName": { + "id": 98, + "kind": "func_id", + "loc": fixed248::nrand_fast, + "text": "fixed248::nrand_fast", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 102, + "kind": "native_function_decl", + "loc": @name(atan_f261_inlined) +native idTest34();, + "name": { + "id": 100, + "kind": "id", + "loc": idTest34, + "text": "idTest34", + }, + "nativeName": { + "id": 101, + "kind": "func_id", + "loc": atan_f261_inlined, + "text": "atan_f261_inlined", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 105, + "kind": "native_function_decl", + "loc": @name(~impure_touch) +native idTest35();, + "name": { + "id": 103, + "kind": "id", + "loc": idTest35, + "text": "idTest35", + }, + "nativeName": { + "id": 104, + "kind": "func_id", + "loc": ~impure_touch, + "text": "~impure_touch", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 108, + "kind": "native_function_decl", + "loc": @name(~udict::delete_get_min) +native idTest36();, + "name": { + "id": 106, + "kind": "id", + "loc": idTest36, + "text": "idTest36", + }, + "nativeName": { + "id": 107, + "kind": "func_id", + "loc": ~udict::delete_get_min, + "text": "~udict::delete_get_min", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 111, + "kind": "native_function_decl", + "loc": @name(.something) +native idTest37();, + "name": { + "id": 109, + "kind": "id", + "loc": idTest37, + "text": "idTest37", + }, + "nativeName": { + "id": 110, + "kind": "func_id", + "loc": .something, + "text": ".something", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 114, + "kind": "native_function_decl", + "loc": @name(f̷̨͈͚́͌̀i̵̩͔̭̐͐̊n̸̟̝̻̩̎̓͋̕e̸̝̙̒̿͒̾̕) +native idTest38();, + "name": { + "id": 112, + "kind": "id", + "loc": idTest38, + "text": "idTest38", + }, + "nativeName": { + "id": 113, + "kind": "func_id", + "loc": f̷̨͈͚́͌̀i̵̩͔̭̐͐̊n̸̟̝̻̩̎̓͋̕e̸̝̙̒̿͒̾̕, + "text": "f̷̨͈͚́͌̀i̵̩͔̭̐͐̊n̸̟̝̻̩̎̓͋̕e̸̝̙̒̿͒̾̕", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 117, + "kind": "native_function_decl", + "loc": @name(❤️❤️❤️thanks❤️❤️❤️) +native idTest39();, + "name": { + "id": 115, + "kind": "id", + "loc": idTest39, + "text": "idTest39", + }, + "nativeName": { + "id": 116, + "kind": "func_id", + "loc": ❤️❤️❤️thanks❤️❤️❤️, + "text": "❤️❤️❤️thanks❤️❤️❤️", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 120, + "kind": "native_function_decl", + "loc": @name(intslice) +native idTest40();, + "name": { + "id": 118, + "kind": "id", + "loc": idTest40, + "text": "idTest40", + }, + "nativeName": { + "id": 119, + "kind": "func_id", + "loc": intslice, + "text": "intslice", + }, + "params": [], + "return": null, + }, + { + "attributes": [], + "id": 123, + "kind": "native_function_decl", + "loc": @name(int2) +native idTest40();, + "name": { + "id": 121, + "kind": "id", + "loc": idTest40, + "text": "idTest40", + }, + "nativeName": { + "id": 122, + "kind": "func_id", + "loc": int2, + "text": "int2", + }, + "params": [], + "return": null, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse items-struct-msg-fun-const 1`] = ` +{ + "id": 60, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 4, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 2, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 7, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 5, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 6, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 8, + "kind": "struct_decl", + "loc": struct A { + x: Int; + y: Int; +}, + "name": { + "id": 1, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + { + "attributes": [], + "id": 16, + "initializer": { + "args": [ + { + "field": { + "id": 12, + "kind": "id", + "loc": x, + "text": "x", + }, + "id": 14, + "initializer": { + "base": 10, + "id": 13, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "kind": "struct_field_initializer", + "loc": x: 1, + }, + ], + "id": 15, + "kind": "struct_instance", + "loc": A { x: 1 }, + "type": { + "id": 11, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + "kind": "constant_def", + "loc": const a: A = A { x: 1 };, + "name": { + "id": 9, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 10, + "kind": "type_id", + "loc": A, + "text": "A", + }, + }, + { + "attributes": [], + "id": 28, + "kind": "function_def", + "loc": fun getA(): A { + return A { + x: 1, + y: 2, + }; +}, + "name": { + "id": 17, + "kind": "id", + "loc": getA, + "text": "getA", + }, + "params": [], + "return": { + "id": 18, + "kind": "type_id", + "loc": A, + "text": "A", + }, + "statements": [ + { + "expression": { + "args": [ + { + "field": { + "id": 20, + "kind": "id", + "loc": x, + "text": "x", + }, + "id": 22, + "initializer": { + "base": 10, + "id": 21, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "kind": "struct_field_initializer", + "loc": x: 1, + }, + { + "field": { + "id": 23, + "kind": "id", + "loc": y, + "text": "y", + }, + "id": 25, + "initializer": { + "base": 10, + "id": 24, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "kind": "struct_field_initializer", + "loc": y: 2, + }, + ], + "id": 26, + "kind": "struct_instance", + "loc": A { + x: 1, + y: 2, + }, + "type": { + "id": 19, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + "id": 27, + "kind": "statement_return", + "loc": return A { + x: 1, + y: 2, + };, + }, + ], + }, + { + "fields": [ + { + "as": null, + "id": 32, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 30, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 31, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 35, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 33, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 34, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 36, + "kind": "message_decl", + "loc": message B { + x: Int; + y: Int; +}, + "name": { + "id": 29, + "kind": "id", + "loc": B, + "text": "B", + }, + "opcode": null, + }, + { + "attributes": [], + "id": 47, + "initializer": { + "args": [ + { + "field": { + "id": 40, + "kind": "id", + "loc": x, + "text": "x", + }, + "id": 42, + "initializer": { + "base": 10, + "id": 41, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "kind": "struct_field_initializer", + "loc": x: 2, + }, + { + "field": { + "id": 43, + "kind": "id", + "loc": y, + "text": "y", + }, + "id": 45, + "initializer": { + "base": 10, + "id": 44, + "kind": "number", + "loc": 3, + "value": 3n, + }, + "kind": "struct_field_initializer", + "loc": y: 3, + }, + ], + "id": 46, + "kind": "struct_instance", + "loc": B { + x: 2, + y: 3, +}, + "type": { + "id": 39, + "kind": "id", + "loc": B, + "text": "B", + }, + }, + "kind": "constant_def", + "loc": const b: B = B { + x: 2, + y: 3, +};, + "name": { + "id": 37, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 38, + "kind": "type_id", + "loc": B, + "text": "B", + }, + }, + { + "attributes": [], + "id": 59, + "kind": "function_def", + "loc": fun getB(): B { + return B { x: 1, y: 5, }; +}, + "name": { + "id": 48, + "kind": "id", + "loc": getB, + "text": "getB", + }, + "params": [], + "return": { + "id": 49, + "kind": "type_id", + "loc": B, + "text": "B", + }, + "statements": [ + { + "expression": { + "args": [ + { + "field": { + "id": 51, + "kind": "id", + "loc": x, + "text": "x", + }, + "id": 53, + "initializer": { + "base": 10, + "id": 52, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "kind": "struct_field_initializer", + "loc": x: 1, + }, + { + "field": { + "id": 54, + "kind": "id", + "loc": y, + "text": "y", + }, + "id": 56, + "initializer": { + "base": 10, + "id": 55, + "kind": "number", + "loc": 5, + "value": 5n, + }, + "kind": "struct_field_initializer", + "loc": y: 5, + }, + ], + "id": 57, + "kind": "struct_instance", + "loc": B { x: 1, y: 5, }, + "type": { + "id": 50, + "kind": "id", + "loc": B, + "text": "B", + }, + }, + "id": 58, + "kind": "statement_return", + "loc": return B { x: 1, y: 5, };, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse literals-int-underscores-bin-dec-hex-oct 1`] = ` +{ + "id": 80, + "imports": [], + "items": [ + { + "attributes": [], + "id": 79, + "kind": "function_def", + "loc": fun test_fun(): Int { + let a: Int = 123; + let b: Int = -123; + let c: Int = 1_0123_00_000; + let d: Int = 0x123; + let e: Int = -0x123; + let f: Int = 0x1_0123_00_000; + let g: Int = 0b101010; + let h: Int = -0b101010; + let i: Int = 0b1_0101_00_000; + let j: Int = 0o123; + let k: Int = -0o123; + let l: Int = 0o1_0123_00_000; + return a + b + c + d + e + f + g + h + i + j + k + l; +}, + "name": { + "id": 1, + "kind": "id", + "loc": test_fun, + "text": "test_fun", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 5, + "kind": "number", + "loc": 123, + "value": 123n, + }, + "id": 6, + "kind": "statement_let", + "loc": let a: Int = 123;, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 10, + "kind": "op_unary", + "loc": -123, + "op": "-", + "operand": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "id": 11, + "kind": "statement_let", + "loc": let b: Int = -123;, + "name": { + "id": 7, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 10, + "id": 14, + "kind": "number", + "loc": 1_0123_00_000, + "value": 1012300000n, + }, + "id": 15, + "kind": "statement_let", + "loc": let c: Int = 1_0123_00_000;, + "name": { + "id": 12, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 13, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 16, + "id": 18, + "kind": "number", + "loc": 0x123, + "value": 291n, + }, + "id": 19, + "kind": "statement_let", + "loc": let d: Int = 0x123;, + "name": { + "id": 16, + "kind": "id", + "loc": d, + "text": "d", + }, + "type": { + "id": 17, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 23, + "kind": "op_unary", + "loc": -0x123, + "op": "-", + "operand": { + "base": 16, + "id": 22, + "kind": "number", + "loc": 0x123, + "value": 291n, + }, + }, + "id": 24, + "kind": "statement_let", + "loc": let e: Int = -0x123;, + "name": { + "id": 20, + "kind": "id", + "loc": e, + "text": "e", + }, + "type": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 16, + "id": 27, + "kind": "number", + "loc": 0x1_0123_00_000, + "value": 69024612352n, + }, + "id": 28, + "kind": "statement_let", + "loc": let f: Int = 0x1_0123_00_000;, + "name": { + "id": 25, + "kind": "id", + "loc": f, + "text": "f", + }, + "type": { + "id": 26, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 2, + "id": 31, + "kind": "number", + "loc": 0b101010, + "value": 42n, + }, + "id": 32, + "kind": "statement_let", + "loc": let g: Int = 0b101010;, + "name": { + "id": 29, + "kind": "id", + "loc": g, + "text": "g", + }, + "type": { + "id": 30, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 36, + "kind": "op_unary", + "loc": -0b101010, + "op": "-", + "operand": { + "base": 2, + "id": 35, + "kind": "number", + "loc": 0b101010, + "value": 42n, + }, + }, + "id": 37, + "kind": "statement_let", + "loc": let h: Int = -0b101010;, + "name": { + "id": 33, + "kind": "id", + "loc": h, + "text": "h", + }, + "type": { + "id": 34, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 2, + "id": 40, + "kind": "number", + "loc": 0b1_0101_00_000, + "value": 672n, + }, + "id": 41, + "kind": "statement_let", + "loc": let i: Int = 0b1_0101_00_000;, + "name": { + "id": 38, + "kind": "id", + "loc": i, + "text": "i", + }, + "type": { + "id": 39, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 8, + "id": 44, + "kind": "number", + "loc": 0o123, + "value": 83n, + }, + "id": 45, + "kind": "statement_let", + "loc": let j: Int = 0o123;, + "name": { + "id": 42, + "kind": "id", + "loc": j, + "text": "j", + }, + "type": { + "id": 43, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 49, + "kind": "op_unary", + "loc": -0o123, + "op": "-", + "operand": { + "base": 8, + "id": 48, + "kind": "number", + "loc": 0o123, + "value": 83n, + }, + }, + "id": 50, + "kind": "statement_let", + "loc": let k: Int = -0o123;, + "name": { + "id": 46, + "kind": "id", + "loc": k, + "text": "k", + }, + "type": { + "id": 47, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 8, + "id": 53, + "kind": "number", + "loc": 0o1_0123_00_000, + "value": 136937472n, + }, + "id": 54, + "kind": "statement_let", + "loc": let l: Int = 0o1_0123_00_000;, + "name": { + "id": 51, + "kind": "id", + "loc": l, + "text": "l", + }, + "type": { + "id": 52, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 77, + "kind": "op_binary", + "left": { + "id": 75, + "kind": "op_binary", + "left": { + "id": 73, + "kind": "op_binary", + "left": { + "id": 71, + "kind": "op_binary", + "left": { + "id": 69, + "kind": "op_binary", + "left": { + "id": 67, + "kind": "op_binary", + "left": { + "id": 65, + "kind": "op_binary", + "left": { + "id": 63, + "kind": "op_binary", + "left": { + "id": 61, + "kind": "op_binary", + "left": { + "id": 59, + "kind": "op_binary", + "left": { + "id": 57, + "kind": "op_binary", + "left": { + "id": 55, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a + b, + "op": "+", + "right": { + "id": 56, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + "loc": a + b + c, + "op": "+", + "right": { + "id": 58, + "kind": "id", + "loc": c, + "text": "c", + }, + }, + "loc": a + b + c + d, + "op": "+", + "right": { + "id": 60, + "kind": "id", + "loc": d, + "text": "d", + }, + }, + "loc": a + b + c + d + e, + "op": "+", + "right": { + "id": 62, + "kind": "id", + "loc": e, + "text": "e", + }, + }, + "loc": a + b + c + d + e + f, + "op": "+", + "right": { + "id": 64, + "kind": "id", + "loc": f, + "text": "f", + }, + }, + "loc": a + b + c + d + e + f + g, + "op": "+", + "right": { + "id": 66, + "kind": "id", + "loc": g, + "text": "g", + }, + }, + "loc": a + b + c + d + e + f + g + h, + "op": "+", + "right": { + "id": 68, + "kind": "id", + "loc": h, + "text": "h", + }, + }, + "loc": a + b + c + d + e + f + g + h + i, + "op": "+", + "right": { + "id": 70, + "kind": "id", + "loc": i, + "text": "i", + }, + }, + "loc": a + b + c + d + e + f + g + h + i + j, + "op": "+", + "right": { + "id": 72, + "kind": "id", + "loc": j, + "text": "j", + }, + }, + "loc": a + b + c + d + e + f + g + h + i + j + k, + "op": "+", + "right": { + "id": 74, + "kind": "id", + "loc": k, + "text": "k", + }, + }, + "loc": a + b + c + d + e + f + g + h + i + j + k + l, + "op": "+", + "right": { + "id": 76, + "kind": "id", + "loc": l, + "text": "l", + }, + }, + "id": 78, + "kind": "statement_return", + "loc": return a + b + c + d + e + f + g + h + i + j + k + l;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-augmented-assign-arith 1`] = ` +{ + "id": 94, + "imports": [], + "items": [ + { + "attributes": [], + "id": 93, + "kind": "function_def", + "loc": fun testFunc(): Int { + let a: Int = 1; + let b: Int = 2; + a += b; + b += a; + a += 3; + a += b + 4; + b -= 1; + a -= b; + a -= b - 1; + b *= 2; + a *= b; + a *= b * 2; + b /= 2; + a /= b; + a /= b / 2; + a %= 2; + a %= b; + a %= b % 2; + a <<= 2; + a <<= b; + a <<= b << 2; + a >>= 2; + a >>= b; + a >>= b >> 2; + return a; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 5, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 6, + "kind": "statement_let", + "loc": let a: Int = 1;, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 10, + "kind": "statement_let", + "loc": let b: Int = 2;, + "name": { + "id": 7, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 12, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 13, + "kind": "statement_augmentedassign", + "loc": a += b;, + "op": "+", + "path": { + "id": 11, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 15, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 16, + "kind": "statement_augmentedassign", + "loc": b += a;, + "op": "+", + "path": { + "id": 14, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "base": 10, + "id": 18, + "kind": "number", + "loc": 3, + "value": 3n, + }, + "id": 19, + "kind": "statement_augmentedassign", + "loc": a += 3;, + "op": "+", + "path": { + "id": 17, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 23, + "kind": "op_binary", + "left": { + "id": 21, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b + 4, + "op": "+", + "right": { + "base": 10, + "id": 22, + "kind": "number", + "loc": 4, + "value": 4n, + }, + }, + "id": 24, + "kind": "statement_augmentedassign", + "loc": a += b + 4;, + "op": "+", + "path": { + "id": 20, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 26, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 27, + "kind": "statement_augmentedassign", + "loc": b -= 1;, + "op": "-", + "path": { + "id": 25, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 29, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 30, + "kind": "statement_augmentedassign", + "loc": a -= b;, + "op": "-", + "path": { + "id": 28, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 34, + "kind": "op_binary", + "left": { + "id": 32, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b - 1, + "op": "-", + "right": { + "base": 10, + "id": 33, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 35, + "kind": "statement_augmentedassign", + "loc": a -= b - 1;, + "op": "-", + "path": { + "id": 31, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 37, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 38, + "kind": "statement_augmentedassign", + "loc": b *= 2;, + "op": "*", + "path": { + "id": 36, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 40, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 41, + "kind": "statement_augmentedassign", + "loc": a *= b;, + "op": "*", + "path": { + "id": 39, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 45, + "kind": "op_binary", + "left": { + "id": 43, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b * 2, + "op": "*", + "right": { + "base": 10, + "id": 44, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 46, + "kind": "statement_augmentedassign", + "loc": a *= b * 2;, + "op": "*", + "path": { + "id": 42, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 48, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 49, + "kind": "statement_augmentedassign", + "loc": b /= 2;, + "op": "/", + "path": { + "id": 47, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 51, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 52, + "kind": "statement_augmentedassign", + "loc": a /= b;, + "op": "/", + "path": { + "id": 50, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 56, + "kind": "op_binary", + "left": { + "id": 54, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b / 2, + "op": "/", + "right": { + "base": 10, + "id": 55, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 57, + "kind": "statement_augmentedassign", + "loc": a /= b / 2;, + "op": "/", + "path": { + "id": 53, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 59, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 60, + "kind": "statement_augmentedassign", + "loc": a %= 2;, + "op": "%", + "path": { + "id": 58, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 62, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 63, + "kind": "statement_augmentedassign", + "loc": a %= b;, + "op": "%", + "path": { + "id": 61, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 67, + "kind": "op_binary", + "left": { + "id": 65, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b % 2, + "op": "%", + "right": { + "base": 10, + "id": 66, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 68, + "kind": "statement_augmentedassign", + "loc": a %= b % 2;, + "op": "%", + "path": { + "id": 64, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 70, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 71, + "kind": "statement_augmentedassign", + "loc": a <<= 2;, + "op": "<<", + "path": { + "id": 69, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 73, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 74, + "kind": "statement_augmentedassign", + "loc": a <<= b;, + "op": "<<", + "path": { + "id": 72, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 78, + "kind": "op_binary", + "left": { + "id": 76, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b << 2, + "op": "<<", + "right": { + "base": 10, + "id": 77, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 79, + "kind": "statement_augmentedassign", + "loc": a <<= b << 2;, + "op": "<<", + "path": { + "id": 75, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 81, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 82, + "kind": "statement_augmentedassign", + "loc": a >>= 2;, + "op": ">>", + "path": { + "id": 80, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 84, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 85, + "kind": "statement_augmentedassign", + "loc": a >>= b;, + "op": ">>", + "path": { + "id": 83, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 89, + "kind": "op_binary", + "left": { + "id": 87, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b >> 2, + "op": ">>", + "right": { + "base": 10, + "id": 88, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 90, + "kind": "statement_augmentedassign", + "loc": a >>= b >> 2;, + "op": ">>", + "path": { + "id": 86, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 91, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 92, + "kind": "statement_return", + "loc": return a;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-augmented-assign-bitwise 1`] = ` +{ + "id": 56, + "imports": [], + "items": [ + { + "attributes": [], + "id": 55, + "kind": "function_def", + "loc": fun testFunc(): Int { + let a: Int = 1; + let b: Int = 2; + a |= b; + b |= a; + a |= 3; + a |= b | 4; + b &= 1; + a &= b; + b &= a; + a &= b & 1; + b ^= 2; + a ^= b; + b ^= a; + a ^= b ^ 2; + return a; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 5, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 6, + "kind": "statement_let", + "loc": let a: Int = 1;, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 10, + "kind": "statement_let", + "loc": let b: Int = 2;, + "name": { + "id": 7, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "expression": { + "id": 12, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 13, + "kind": "statement_augmentedassign", + "loc": a |= b;, + "op": "|", + "path": { + "id": 11, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 15, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 16, + "kind": "statement_augmentedassign", + "loc": b |= a;, + "op": "|", + "path": { + "id": 14, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "base": 10, + "id": 18, + "kind": "number", + "loc": 3, + "value": 3n, + }, + "id": 19, + "kind": "statement_augmentedassign", + "loc": a |= 3;, + "op": "|", + "path": { + "id": 17, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 23, + "kind": "op_binary", + "left": { + "id": 21, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b | 4, + "op": "|", + "right": { + "base": 10, + "id": 22, + "kind": "number", + "loc": 4, + "value": 4n, + }, + }, + "id": 24, + "kind": "statement_augmentedassign", + "loc": a |= b | 4;, + "op": "|", + "path": { + "id": 20, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 26, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 27, + "kind": "statement_augmentedassign", + "loc": b &= 1;, + "op": "&", + "path": { + "id": 25, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 29, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 30, + "kind": "statement_augmentedassign", + "loc": a &= b;, + "op": "&", + "path": { + "id": 28, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 32, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 33, + "kind": "statement_augmentedassign", + "loc": b &= a;, + "op": "&", + "path": { + "id": 31, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 37, + "kind": "op_binary", + "left": { + "id": 35, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b & 1, + "op": "&", + "right": { + "base": 10, + "id": 36, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 38, + "kind": "statement_augmentedassign", + "loc": a &= b & 1;, + "op": "&", + "path": { + "id": 34, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "base": 10, + "id": 40, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "id": 41, + "kind": "statement_augmentedassign", + "loc": b ^= 2;, + "op": "^", + "path": { + "id": 39, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 43, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 44, + "kind": "statement_augmentedassign", + "loc": a ^= b;, + "op": "^", + "path": { + "id": 42, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 46, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 47, + "kind": "statement_augmentedassign", + "loc": b ^= a;, + "op": "^", + "path": { + "id": 45, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + { + "expression": { + "id": 51, + "kind": "op_binary", + "left": { + "id": 49, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b ^ 2, + "op": "^", + "right": { + "base": 10, + "id": 50, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "id": 52, + "kind": "statement_augmentedassign", + "loc": a ^= b ^ 2;, + "op": "^", + "path": { + "id": 48, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 53, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 54, + "kind": "statement_return", + "loc": return a;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-augmented-assign-logic 1`] = ` +{ + "id": 36, + "imports": [], + "items": [ + { + "attributes": [], + "id": 35, + "kind": "function_def", + "loc": fun testFunc(): Bool { + let a: Bool = true; + let b: Bool = false; + a ||= true; + a ||= b; + a ||= b || true; + a &&= true; + a &&= b; + a &&= b && true; + return a; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 2, + "kind": "type_id", + "loc": Bool, + "text": "Bool", + }, + "statements": [ + { + "expression": { + "id": 5, + "kind": "boolean", + "loc": true, + "value": true, + }, + "id": 6, + "kind": "statement_let", + "loc": let a: Bool = true;, + "name": { + "id": 3, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 4, + "kind": "type_id", + "loc": Bool, + "text": "Bool", + }, + }, + { + "expression": { + "id": 9, + "kind": "boolean", + "loc": false, + "value": false, + }, + "id": 10, + "kind": "statement_let", + "loc": let b: Bool = false;, + "name": { + "id": 7, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 8, + "kind": "type_id", + "loc": Bool, + "text": "Bool", + }, + }, + { + "expression": { + "id": 12, + "kind": "boolean", + "loc": true, + "value": true, + }, + "id": 13, + "kind": "statement_augmentedassign", + "loc": a ||= true;, + "op": "||", + "path": { + "id": 11, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 15, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 16, + "kind": "statement_augmentedassign", + "loc": a ||= b;, + "op": "||", + "path": { + "id": 14, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 20, + "kind": "op_binary", + "left": { + "id": 18, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b || true, + "op": "||", + "right": { + "id": 19, + "kind": "boolean", + "loc": true, + "value": true, + }, + }, + "id": 21, + "kind": "statement_augmentedassign", + "loc": a ||= b || true;, + "op": "||", + "path": { + "id": 17, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 23, + "kind": "boolean", + "loc": true, + "value": true, + }, + "id": 24, + "kind": "statement_augmentedassign", + "loc": a &&= true;, + "op": "&&", + "path": { + "id": 22, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 26, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 27, + "kind": "statement_augmentedassign", + "loc": a &&= b;, + "op": "&&", + "path": { + "id": 25, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 31, + "kind": "op_binary", + "left": { + "id": 29, + "kind": "id", + "loc": b, + "text": "b", + }, + "loc": b && true, + "op": "&&", + "right": { + "id": 30, + "kind": "boolean", + "loc": true, + "value": true, + }, + }, + "id": 32, + "kind": "statement_augmentedassign", + "loc": a &&= b && true;, + "op": "&&", + "path": { + "id": 28, + "kind": "id", + "loc": a, + "text": "a", + }, + }, + { + "expression": { + "id": 33, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 34, + "kind": "statement_return", + "loc": return a;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-destructuring 1`] = ` +{ + "id": 126, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 4, + "initializer": null, + "kind": "field_decl", + "loc": a: Int, + "name": { + "id": 2, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 7, + "initializer": null, + "kind": "field_decl", + "loc": b: Int, + "name": { + "id": 5, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 6, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 10, + "initializer": null, + "kind": "field_decl", + "loc": c: Int, + "name": { + "id": 8, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 9, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 11, + "kind": "struct_decl", + "loc": struct S { + a: Int; + b: Int; + c: Int; +}, + "name": { + "id": 1, + "kind": "id", + "loc": S, + "text": "S", + }, + }, + { + "fields": [ + { + "as": null, + "id": 15, + "initializer": null, + "kind": "field_decl", + "loc": a: Int, + "name": { + "id": 13, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 18, + "initializer": null, + "kind": "field_decl", + "loc": b: Int, + "name": { + "id": 16, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 17, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 19, + "kind": "message_decl", + "loc": message M { + a: Int; + b: Int; +}, + "name": { + "id": 12, + "kind": "id", + "loc": M, + "text": "M", + }, + "opcode": null, + }, + { + "attributes": [], + "id": 125, + "kind": "function_def", + "loc": fun testFunc(): Int { + let s = S{ a: 1, b: 2, c: 3 }; + let S { a, b, c } = s; + let S { a: a1, .. } = s; + let S { b: b1, .. } = s; + let S { c: c1, .. } = s; + let S { a: a2, b: b2, .. } = s; + let S { a: a3, c: c3, .. } = s; + let S { b: b4, c: c4, .. } = s; + + let m = M{ a: 1, b: 2 }; + let M { a: a_m, b: b_m } = m; + + return a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3 + b4 + c4 + a_m + b_m; +}, + "name": { + "id": 20, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [], + "return": { + "id": 21, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "args": [ + { + "field": { + "id": 24, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 26, + "initializer": { + "base": 10, + "id": 25, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "kind": "struct_field_initializer", + "loc": a: 1, + }, + { + "field": { + "id": 27, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 29, + "initializer": { + "base": 10, + "id": 28, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "kind": "struct_field_initializer", + "loc": b: 2, + }, + { + "field": { + "id": 30, + "kind": "id", + "loc": c, + "text": "c", + }, + "id": 32, + "initializer": { + "base": 10, + "id": 31, + "kind": "number", + "loc": 3, + "value": 3n, + }, + "kind": "struct_field_initializer", + "loc": c: 3, + }, + ], + "id": 33, + "kind": "struct_instance", + "loc": S{ a: 1, b: 2, c: 3 }, + "type": { + "id": 23, + "kind": "id", + "loc": S, + "text": "S", + }, + }, + "id": 34, + "kind": "statement_let", + "loc": let s = S{ a: 1, b: 2, c: 3 };, + "name": { + "id": 22, + "kind": "id", + "loc": s, + "text": "s", + }, + "type": null, + }, + { + "expression": { + "id": 42, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 43, + "identifiers": Map { + "a" => [ + { + "id": 35, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 36, + "kind": "id", + "loc": a, + "text": "a", + }, + ], + "b" => [ + { + "id": 37, + "kind": "id", + "loc": b, + "text": "b", + }, + { + "id": 38, + "kind": "id", + "loc": b, + "text": "b", + }, + ], + "c" => [ + { + "id": 39, + "kind": "id", + "loc": c, + "text": "c", + }, + { + "id": 40, + "kind": "id", + "loc": c, + "text": "c", + }, + ], + }, + "ignoreUnspecifiedFields": false, + "kind": "statement_destruct", + "loc": let S { a, b, c } = s;, + "type": { + "id": 41, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "id": 47, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 48, + "identifiers": Map { + "a" => [ + { + "id": 44, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 45, + "kind": "id", + "loc": a1, + "text": "a1", + }, + ], + }, + "ignoreUnspecifiedFields": true, + "kind": "statement_destruct", + "loc": let S { a: a1, .. } = s;, + "type": { + "id": 46, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "id": 52, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 53, + "identifiers": Map { + "b" => [ + { + "id": 49, + "kind": "id", + "loc": b, + "text": "b", + }, + { + "id": 50, + "kind": "id", + "loc": b1, + "text": "b1", + }, + ], + }, + "ignoreUnspecifiedFields": true, + "kind": "statement_destruct", + "loc": let S { b: b1, .. } = s;, + "type": { + "id": 51, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "id": 57, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 58, + "identifiers": Map { + "c" => [ + { + "id": 54, + "kind": "id", + "loc": c, + "text": "c", + }, + { + "id": 55, + "kind": "id", + "loc": c1, + "text": "c1", + }, + ], + }, + "ignoreUnspecifiedFields": true, + "kind": "statement_destruct", + "loc": let S { c: c1, .. } = s;, + "type": { + "id": 56, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "id": 64, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 65, + "identifiers": Map { + "a" => [ + { + "id": 59, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 60, + "kind": "id", + "loc": a2, + "text": "a2", + }, + ], + "b" => [ + { + "id": 61, + "kind": "id", + "loc": b, + "text": "b", + }, + { + "id": 62, + "kind": "id", + "loc": b2, + "text": "b2", + }, + ], + }, + "ignoreUnspecifiedFields": true, + "kind": "statement_destruct", + "loc": let S { a: a2, b: b2, .. } = s;, + "type": { + "id": 63, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "id": 71, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 72, + "identifiers": Map { + "a" => [ + { + "id": 66, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 67, + "kind": "id", + "loc": a3, + "text": "a3", + }, + ], + "c" => [ + { + "id": 68, + "kind": "id", + "loc": c, + "text": "c", + }, + { + "id": 69, + "kind": "id", + "loc": c3, + "text": "c3", + }, + ], + }, + "ignoreUnspecifiedFields": true, + "kind": "statement_destruct", + "loc": let S { a: a3, c: c3, .. } = s;, + "type": { + "id": 70, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "id": 78, + "kind": "id", + "loc": s, + "text": "s", + }, + "id": 79, + "identifiers": Map { + "b" => [ + { + "id": 73, + "kind": "id", + "loc": b, + "text": "b", + }, + { + "id": 74, + "kind": "id", + "loc": b4, + "text": "b4", + }, + ], + "c" => [ + { + "id": 75, + "kind": "id", + "loc": c, + "text": "c", + }, + { + "id": 76, + "kind": "id", + "loc": c4, + "text": "c4", + }, + ], + }, + "ignoreUnspecifiedFields": true, + "kind": "statement_destruct", + "loc": let S { b: b4, c: c4, .. } = s;, + "type": { + "id": 77, + "kind": "type_id", + "loc": S, + "text": "S", + }, + }, + { + "expression": { + "args": [ + { + "field": { + "id": 82, + "kind": "id", + "loc": a, + "text": "a", + }, + "id": 84, + "initializer": { + "base": 10, + "id": 83, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "kind": "struct_field_initializer", + "loc": a: 1, + }, + { + "field": { + "id": 85, + "kind": "id", + "loc": b, + "text": "b", + }, + "id": 87, + "initializer": { + "base": 10, + "id": 86, + "kind": "number", + "loc": 2, + "value": 2n, + }, + "kind": "struct_field_initializer", + "loc": b: 2, + }, + ], + "id": 88, + "kind": "struct_instance", + "loc": M{ a: 1, b: 2 }, + "type": { + "id": 81, + "kind": "id", + "loc": M, + "text": "M", + }, + }, + "id": 89, + "kind": "statement_let", + "loc": let m = M{ a: 1, b: 2 };, + "name": { + "id": 80, + "kind": "id", + "loc": m, + "text": "m", + }, + "type": null, + }, + { + "expression": { + "id": 95, + "kind": "id", + "loc": m, + "text": "m", + }, + "id": 96, + "identifiers": Map { + "a" => [ + { + "id": 90, + "kind": "id", + "loc": a, + "text": "a", + }, + { + "id": 91, + "kind": "id", + "loc": a_m, + "text": "a_m", + }, + ], + "b" => [ + { + "id": 92, + "kind": "id", + "loc": b, + "text": "b", + }, + { + "id": 93, + "kind": "id", + "loc": b_m, + "text": "b_m", + }, + ], + }, + "ignoreUnspecifiedFields": false, + "kind": "statement_destruct", + "loc": let M { a: a_m, b: b_m } = m;, + "type": { + "id": 94, + "kind": "type_id", + "loc": M, + "text": "M", + }, + }, + { + "expression": { + "id": 123, + "kind": "op_binary", + "left": { + "id": 121, + "kind": "op_binary", + "left": { + "id": 119, + "kind": "op_binary", + "left": { + "id": 117, + "kind": "op_binary", + "left": { + "id": 115, + "kind": "op_binary", + "left": { + "id": 113, + "kind": "op_binary", + "left": { + "id": 111, + "kind": "op_binary", + "left": { + "id": 109, + "kind": "op_binary", + "left": { + "id": 107, + "kind": "op_binary", + "left": { + "id": 105, + "kind": "op_binary", + "left": { + "id": 103, + "kind": "op_binary", + "left": { + "id": 101, + "kind": "op_binary", + "left": { + "id": 99, + "kind": "op_binary", + "left": { + "id": 97, + "kind": "id", + "loc": a, + "text": "a", + }, + "loc": a + b, + "op": "+", + "right": { + "id": 98, + "kind": "id", + "loc": b, + "text": "b", + }, + }, + "loc": a + b + c, + "op": "+", + "right": { + "id": 100, + "kind": "id", + "loc": c, + "text": "c", + }, + }, + "loc": a + b + c + a1, + "op": "+", + "right": { + "id": 102, + "kind": "id", + "loc": a1, + "text": "a1", + }, + }, + "loc": a + b + c + a1 + b1, + "op": "+", + "right": { + "id": 104, + "kind": "id", + "loc": b1, + "text": "b1", + }, + }, + "loc": a + b + c + a1 + b1 + c1, + "op": "+", + "right": { + "id": 106, + "kind": "id", + "loc": c1, + "text": "c1", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2, + "op": "+", + "right": { + "id": 108, + "kind": "id", + "loc": a2, + "text": "a2", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2, + "op": "+", + "right": { + "id": 110, + "kind": "id", + "loc": b2, + "text": "b2", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2 + a3, + "op": "+", + "right": { + "id": 112, + "kind": "id", + "loc": a3, + "text": "a3", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3, + "op": "+", + "right": { + "id": 114, + "kind": "id", + "loc": c3, + "text": "c3", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3 + b4, + "op": "+", + "right": { + "id": 116, + "kind": "id", + "loc": b4, + "text": "b4", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3 + b4 + c4, + "op": "+", + "right": { + "id": 118, + "kind": "id", + "loc": c4, + "text": "c4", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3 + b4 + c4 + a_m, + "op": "+", + "right": { + "id": 120, + "kind": "id", + "loc": a_m, + "text": "a_m", + }, + }, + "loc": a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3 + b4 + c4 + a_m + b_m, + "op": "+", + "right": { + "id": 122, + "kind": "id", + "loc": b_m, + "text": "b_m", + }, + }, + "id": 124, + "kind": "statement_return", + "loc": return a + b + c + a1 + b1 + c1 + a2 + b2 + a3 + c3 + b4 + c4 + a_m + b_m;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-if 1`] = ` +{ + "id": 16, + "imports": [], + "items": [ + { + "attributes": [], + "id": 15, + "kind": "function_def", + "loc": fun testFunc(src: Int?): Int { + if (src != null) { + return src; + } + return 0; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 6, + "kind": "typed_parameter", + "loc": src: Int?, + "name": { + "id": 3, + "kind": "id", + "loc": src, + "text": "src", + }, + "type": { + "id": 5, + "kind": "optional_type", + "loc": Int?, + "typeArg": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "condition": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "id", + "loc": src, + "text": "src", + }, + "loc": src != null, + "op": "!=", + "right": { + "id": 8, + "kind": "null", + "loc": null, + }, + }, + "elseif": null, + "falseStatements": null, + "id": 12, + "kind": "statement_condition", + "loc": if (src != null) { + return src; + }, + "trueStatements": [ + { + "expression": { + "id": 10, + "kind": "id", + "loc": src, + "text": "src", + }, + "id": 11, + "kind": "statement_return", + "loc": return src;, + }, + ], + }, + { + "expression": { + "base": 10, + "id": 13, + "kind": "number", + "loc": 0, + "value": 0n, + }, + "id": 14, + "kind": "statement_return", + "loc": return 0;, + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-if-else 1`] = ` +{ + "id": 16, + "imports": [], + "items": [ + { + "attributes": [], + "id": 15, + "kind": "function_def", + "loc": fun testFunc(src: Int?): Int { + if (src != null) { + return src; + } else { + return 10; + } +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 6, + "kind": "typed_parameter", + "loc": src: Int?, + "name": { + "id": 3, + "kind": "id", + "loc": src, + "text": "src", + }, + "type": { + "id": 5, + "kind": "optional_type", + "loc": Int?, + "typeArg": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "condition": { + "id": 9, + "kind": "op_binary", + "left": { + "id": 7, + "kind": "id", + "loc": src, + "text": "src", + }, + "loc": src != null, + "op": "!=", + "right": { + "id": 8, + "kind": "null", + "loc": null, + }, + }, + "elseif": null, + "falseStatements": [ + { + "expression": { + "base": 10, + "id": 12, + "kind": "number", + "loc": 10, + "value": 10n, + }, + "id": 13, + "kind": "statement_return", + "loc": return 10;, + }, + ], + "id": 14, + "kind": "statement_condition", + "loc": if (src != null) { + return src; + } else { + return 10; + }, + "trueStatements": [ + { + "expression": { + "id": 10, + "kind": "id", + "loc": src, + "text": "src", + }, + "id": 11, + "kind": "statement_return", + "loc": return src;, + }, + ], + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-optional-semicolon-for-last-statement 1`] = ` +{ + "id": 40, + "imports": [], + "items": [ + { + "attributes": [], + "id": 20, + "kind": "function_def", + "loc": fun test1() { + let i: Int = 1; + while(i >= 10 || i <= 100) { i += 1 } + let i = 42 +}, + "name": { + "id": 1, + "kind": "id", + "loc": test1, + "text": "test1", + }, + "params": [], + "return": null, + "statements": [ + { + "expression": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 5, + "kind": "statement_let", + "loc": let i: Int = 1;, + "name": { + "id": 2, + "kind": "id", + "loc": i, + "text": "i", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "condition": { + "id": 12, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "op_binary", + "left": { + "id": 6, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i >= 10, + "op": ">=", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": i >= 10 || i <= 100, + "op": "||", + "right": { + "id": 11, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i <= 100, + "op": "<=", + "right": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 100, + "value": 100n, + }, + }, + }, + "id": 16, + "kind": "statement_while", + "loc": while(i >= 10 || i <= 100) { i += 1 }, + "statements": [ + { + "expression": { + "base": 10, + "id": 14, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 15, + "kind": "statement_augmentedassign", + "loc": i += 1, + "op": "+", + "path": { + "id": 13, + "kind": "id", + "loc": i, + "text": "i", + }, + }, + ], + }, + { + "expression": { + "base": 10, + "id": 18, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "id": 19, + "kind": "statement_let", + "loc": let i = 42, + "name": { + "id": 17, + "kind": "id", + "loc": i, + "text": "i", + }, + "type": null, + }, + ], + }, + { + "attributes": [], + "id": 23, + "kind": "function_def", + "loc": fun test2() { return }, + "name": { + "id": 21, + "kind": "id", + "loc": test2, + "text": "test2", + }, + "params": [], + "return": null, + "statements": [ + { + "expression": null, + "id": 22, + "kind": "statement_return", + "loc": return, + }, + ], + }, + { + "attributes": [], + "id": 28, + "kind": "function_def", + "loc": fun test3(): Int { return 42 }, + "name": { + "id": 24, + "kind": "id", + "loc": test3, + "text": "test3", + }, + "params": [], + "return": { + "id": 25, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "base": 10, + "id": 26, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "id": 27, + "kind": "statement_return", + "loc": return 42, + }, + ], + }, + { + "attributes": [], + "id": 39, + "kind": "function_def", + "loc": fun test4(): Int { + do { 21 + 21 } until (true && true) +}, + "name": { + "id": 29, + "kind": "id", + "loc": test4, + "text": "test4", + }, + "params": [], + "return": { + "id": 30, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "condition": { + "id": 33, + "kind": "op_binary", + "left": { + "id": 31, + "kind": "boolean", + "loc": true, + "value": true, + }, + "loc": true && true, + "op": "&&", + "right": { + "id": 32, + "kind": "boolean", + "loc": true, + "value": true, + }, + }, + "id": 38, + "kind": "statement_until", + "loc": do { 21 + 21 } until (true && true), + "statements": [ + { + "expression": { + "id": 36, + "kind": "op_binary", + "left": { + "base": 10, + "id": 34, + "kind": "number", + "loc": 21, + "value": 21n, + }, + "loc": 21 + 21, + "op": "+", + "right": { + "base": 10, + "id": 35, + "kind": "number", + "loc": 21, + "value": 21n, + }, + }, + "id": 37, + "kind": "statement_expression", + "loc": 21 + 21, + }, + ], + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-while-loop 1`] = ` +{ + "id": 20, + "imports": [], + "items": [ + { + "attributes": [], + "id": 19, + "kind": "function_def", + "loc": fun main() { + let i: Int = 1; + while(i >= 10 || i <= 100) { + i = i + 1; + } +}, + "name": { + "id": 1, + "kind": "id", + "loc": main, + "text": "main", + }, + "params": [], + "return": null, + "statements": [ + { + "expression": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 5, + "kind": "statement_let", + "loc": let i: Int = 1;, + "name": { + "id": 2, + "kind": "id", + "loc": i, + "text": "i", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "condition": { + "id": 12, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "op_binary", + "left": { + "id": 6, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i >= 10, + "op": ">=", + "right": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "loc": i >= 10 || i <= 100, + "op": "||", + "right": { + "id": 11, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i <= 100, + "op": "<=", + "right": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 100, + "value": 100n, + }, + }, + }, + "id": 18, + "kind": "statement_while", + "loc": while(i >= 10 || i <= 100) { + i = i + 1; + }, + "statements": [ + { + "expression": { + "id": 16, + "kind": "op_binary", + "left": { + "id": 14, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i + 1, + "op": "+", + "right": { + "base": 10, + "id": 15, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 17, + "kind": "statement_assign", + "loc": i = i + 1;, + "path": { + "id": 13, + "kind": "id", + "loc": i, + "text": "i", + }, + }, + ], + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse stmt-while-repeat-do-loops 1`] = ` +{ + "id": 28, + "imports": [], + "items": [ + { + "attributes": [], + "id": 27, + "kind": "function_def", + "loc": fun main() { + let i: Int = 1; + while(true) { + i = i + 1; + } + repeat(10) { + i = i * 10; + } + do { + i = i - 1; + } until(false); +}, + "name": { + "id": 1, + "kind": "id", + "loc": main, + "text": "main", + }, + "params": [], + "return": null, + "statements": [ + { + "expression": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "id": 5, + "kind": "statement_let", + "loc": let i: Int = 1;, + "name": { + "id": 2, + "kind": "id", + "loc": i, + "text": "i", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "condition": { + "id": 6, + "kind": "boolean", + "loc": true, + "value": true, + }, + "id": 12, + "kind": "statement_while", + "loc": while(true) { + i = i + 1; + }, + "statements": [ + { + "expression": { + "id": 10, + "kind": "op_binary", + "left": { + "id": 8, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i + 1, + "op": "+", + "right": { + "base": 10, + "id": 9, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 11, + "kind": "statement_assign", + "loc": i = i + 1;, + "path": { + "id": 7, + "kind": "id", + "loc": i, + "text": "i", + }, + }, + ], + }, + { + "id": 19, + "iterations": { + "base": 10, + "id": 13, + "kind": "number", + "loc": 10, + "value": 10n, + }, + "kind": "statement_repeat", + "loc": repeat(10) { + i = i * 10; + }, + "statements": [ + { + "expression": { + "id": 17, + "kind": "op_binary", + "left": { + "id": 15, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i * 10, + "op": "*", + "right": { + "base": 10, + "id": 16, + "kind": "number", + "loc": 10, + "value": 10n, + }, + }, + "id": 18, + "kind": "statement_assign", + "loc": i = i * 10;, + "path": { + "id": 14, + "kind": "id", + "loc": i, + "text": "i", + }, + }, + ], + }, + { + "condition": { + "id": 20, + "kind": "boolean", + "loc": false, + "value": false, + }, + "id": 26, + "kind": "statement_until", + "loc": do { + i = i - 1; + } until(false);, + "statements": [ + { + "expression": { + "id": 24, + "kind": "op_binary", + "left": { + "id": 22, + "kind": "id", + "loc": i, + "text": "i", + }, + "loc": i - 1, + "op": "-", + "right": { + "base": 10, + "id": 23, + "kind": "number", + "loc": 1, + "value": 1n, + }, + }, + "id": 25, + "kind": "statement_assign", + "loc": i = i - 1;, + "path": { + "id": 21, + "kind": "id", + "loc": i, + "text": "i", + }, + }, + ], + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse struct-field-punning 1`] = ` +{ + "id": 26, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 4, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 2, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 7, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 5, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 6, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 8, + "kind": "struct_decl", + "loc": struct A { + x: Int; + y: Int; +}, + "name": { + "id": 1, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + { + "attributes": [], + "id": 12, + "initializer": { + "base": 10, + "id": 11, + "kind": "number", + "loc": 5, + "value": 5n, + }, + "kind": "constant_def", + "loc": const x: Int = 5;, + "name": { + "id": 9, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 10, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [], + "id": 16, + "initializer": { + "base": 10, + "id": 15, + "kind": "number", + "loc": 6, + "value": 6n, + }, + "kind": "constant_def", + "loc": const y: Int = 6;, + "name": { + "id": 13, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 14, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [], + "id": 25, + "initializer": { + "args": [ + { + "field": { + "id": 20, + "kind": "id", + "loc": x, + "text": "x", + }, + "id": 21, + "initializer": { + "id": 20, + "kind": "id", + "loc": x, + "text": "x", + }, + "kind": "struct_field_initializer", + "loc": x, + }, + { + "field": { + "id": 22, + "kind": "id", + "loc": y, + "text": "y", + }, + "id": 23, + "initializer": { + "id": 22, + "kind": "id", + "loc": y, + "text": "y", + }, + "kind": "struct_field_initializer", + "loc": y, + }, + ], + "id": 24, + "kind": "struct_instance", + "loc": A { x, y }, + "type": { + "id": 19, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + "kind": "constant_def", + "loc": const D: A = A { x, y };, + "name": { + "id": 17, + "kind": "id", + "loc": D, + "text": "D", + }, + "type": { + "id": 18, + "kind": "type_id", + "loc": A, + "text": "A", + }, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse struct-msg-as 1`] = ` +{ + "id": 12, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 4, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 2, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 5, + "kind": "struct_decl", + "loc": struct A { + x: Int; +}, + "name": { + "id": 1, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + { + "fields": [ + { + "as": { + "id": 9, + "kind": "id", + "loc": coin, + "text": "coin", + }, + "id": 10, + "initializer": null, + "kind": "field_decl", + "loc": x: Int as coin, + "name": { + "id": 7, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 11, + "kind": "message_decl", + "loc": message B { + x: Int as coin; +}, + "name": { + "id": 6, + "kind": "id", + "loc": B, + "text": "B", + }, + "opcode": null, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse struct-msg-initializers 1`] = ` +{ + "id": 18, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 5, + "initializer": { + "base": 10, + "id": 4, + "kind": "number", + "loc": 1000, + "value": 1000n, + }, + "kind": "field_decl", + "loc": x: Int = 1000, + "name": { + "id": 2, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 6, + "kind": "struct_decl", + "loc": struct A { + x: Int = 1000; +}, + "name": { + "id": 1, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + { + "fields": [ + { + "as": { + "id": 11, + "kind": "id", + "loc": coins, + "text": "coins", + }, + "id": 12, + "initializer": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 1000, + "value": 1000n, + }, + "kind": "field_decl", + "loc": x: Int as coins = 1000, + "name": { + "id": 8, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 9, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 16, + "initializer": { + "id": 15, + "kind": "boolean", + "loc": true, + "value": true, + }, + "kind": "field_decl", + "loc": y: Bool = true, + "name": { + "id": 13, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 14, + "kind": "type_id", + "loc": Bool, + "text": "Bool", + }, + }, + ], + "id": 17, + "kind": "message_decl", + "loc": message B { + x: Int as coins = 1000; + y: Bool = true; +}, + "name": { + "id": 7, + "kind": "id", + "loc": B, + "text": "B", + }, + "opcode": null, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse struct-msg-trailing-semicolon 1`] = ` +{ + "id": 63, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 4, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 2, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 5, + "kind": "struct_decl", + "loc": struct A { x: Int }, + "name": { + "id": 1, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + { + "fields": [ + { + "as": null, + "id": 9, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 7, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 8, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 12, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 10, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 11, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 13, + "kind": "struct_decl", + "loc": struct B { x: Int; y: Int }, + "name": { + "id": 6, + "kind": "id", + "loc": B, + "text": "B", + }, + }, + { + "fields": [ + { + "as": null, + "id": 17, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 15, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 16, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 21, + "initializer": { + "base": 10, + "id": 20, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "kind": "field_decl", + "loc": y: Int = 42, + "name": { + "id": 18, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 19, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 22, + "kind": "struct_decl", + "loc": struct C { x: Int; y: Int = 42 }, + "name": { + "id": 14, + "kind": "id", + "loc": C, + "text": "C", + }, + }, + { + "fields": [ + { + "as": null, + "id": 27, + "initializer": { + "base": 10, + "id": 26, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "kind": "field_decl", + "loc": x: Int = 42, + "name": { + "id": 24, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 25, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 30, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 28, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 29, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 31, + "kind": "struct_decl", + "loc": struct D { x: Int = 42; y: Int }, + "name": { + "id": 23, + "kind": "id", + "loc": D, + "text": "D", + }, + }, + { + "fields": [ + { + "as": null, + "id": 35, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 33, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 34, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 36, + "kind": "message_decl", + "loc": message E { x: Int }, + "name": { + "id": 32, + "kind": "id", + "loc": E, + "text": "E", + }, + "opcode": null, + }, + { + "fields": [ + { + "as": null, + "id": 40, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 38, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 39, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 43, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 41, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 42, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 44, + "kind": "message_decl", + "loc": message F { x: Int; y: Int }, + "name": { + "id": 37, + "kind": "id", + "loc": F, + "text": "F", + }, + "opcode": null, + }, + { + "fields": [ + { + "as": null, + "id": 48, + "initializer": null, + "kind": "field_decl", + "loc": x: Int, + "name": { + "id": 46, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 47, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 52, + "initializer": { + "base": 10, + "id": 51, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "kind": "field_decl", + "loc": y: Int = 42, + "name": { + "id": 49, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 50, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 53, + "kind": "message_decl", + "loc": message G { x: Int; y: Int = 42 }, + "name": { + "id": 45, + "kind": "id", + "loc": G, + "text": "G", + }, + "opcode": null, + }, + { + "fields": [ + { + "as": null, + "id": 58, + "initializer": { + "base": 10, + "id": 57, + "kind": "number", + "loc": 42, + "value": 42n, + }, + "kind": "field_decl", + "loc": x: Int = 42, + "name": { + "id": 55, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 56, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + { + "as": null, + "id": 61, + "initializer": null, + "kind": "field_decl", + "loc": y: Int, + "name": { + "id": 59, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 60, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 62, + "kind": "message_decl", + "loc": message G { x: Int = 42; y: Int }, + "name": { + "id": 54, + "kind": "id", + "loc": G, + "text": "G", + }, + "opcode": null, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse trait-optional-semicolon-for-last-const-decl 1`] = ` +{ + "id": 6, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "attributes": [ + { + "loc": abstract, + "type": "abstract", + }, + ], + "id": 4, + "kind": "constant_decl", + "loc": abstract const foo: Int, + "name": { + "id": 2, + "kind": "id", + "loc": foo, + "text": "foo", + }, + "type": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 5, + "kind": "trait", + "loc": trait Test { abstract const foo: Int }, + "name": { + "id": 1, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse trait-optional-semicolon-for-last-fun-decl 1`] = ` +{ + "id": 5, + "imports": [], + "items": [ + { + "attributes": [], + "declarations": [ + { + "attributes": [ + { + "kind": "function_attribute", + "loc": abstract, + "type": "abstract", + }, + ], + "id": 3, + "kind": "function_decl", + "loc": abstract fun foo(), + "name": { + "id": 2, + "kind": "id", + "loc": foo, + "text": "foo", + }, + "params": [], + "return": null, + }, + ], + "id": 4, + "kind": "trait", + "loc": trait Test { abstract fun foo() }, + "name": { + "id": 1, + "kind": "id", + "loc": Test, + "text": "Test", + }, + "traits": [], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse traits-inheritance-trailing-comma 1`] = ` +{ + "id": 20, + "imports": [], + "items": [ + { + "id": 2, + "kind": "primitive_type_decl", + "loc": primitive Int;, + "name": { + "id": 1, + "kind": "id", + "loc": Int, + "text": "Int", + }, + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 6, + "initializer": null, + "kind": "field_decl", + "loc": c: Int, + "name": { + "id": 4, + "kind": "id", + "loc": c, + "text": "c", + }, + "type": { + "id": 5, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 7, + "kind": "trait", + "loc": trait OtherTrait { + c: Int; +}, + "name": { + "id": 3, + "kind": "id", + "loc": OtherTrait, + "text": "OtherTrait", + }, + "traits": [], + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 12, + "initializer": null, + "kind": "field_decl", + "loc": a: Int, + "name": { + "id": 10, + "kind": "id", + "loc": a, + "text": "a", + }, + "type": { + "id": 11, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 13, + "kind": "trait", + "loc": trait SomeTrait with OtherTrait, { + a: Int; +}, + "name": { + "id": 8, + "kind": "id", + "loc": SomeTrait, + "text": "SomeTrait", + }, + "traits": [ + { + "id": 9, + "kind": "id", + "loc": OtherTrait, + "text": "OtherTrait", + }, + ], + }, + { + "attributes": [], + "declarations": [ + { + "as": null, + "id": 18, + "initializer": null, + "kind": "field_decl", + "loc": b: Int, + "name": { + "id": 16, + "kind": "id", + "loc": b, + "text": "b", + }, + "type": { + "id": 17, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + ], + "id": 19, + "kind": "contract", + "loc": contract Main with SomeTrait, { + b: Int; +}, + "name": { + "id": 14, + "kind": "id", + "loc": Main, + "text": "Main", + }, + "traits": [ + { + "id": 15, + "kind": "id", + "loc": SomeTrait, + "text": "SomeTrait", + }, + ], + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse type-struct-with-map 1`] = ` +{ + "id": 15, + "imports": [], + "items": [ + { + "fields": [ + { + "as": null, + "id": 6, + "initializer": null, + "kind": "field_decl", + "loc": y: map, + "name": { + "id": 2, + "kind": "id", + "loc": y, + "text": "y", + }, + "type": { + "id": 5, + "keyStorageType": null, + "keyType": { + "id": 3, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": null, + "valueType": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "id": 7, + "kind": "struct_decl", + "loc": struct A { + y: map; +}, + "name": { + "id": 1, + "kind": "id", + "loc": A, + "text": "A", + }, + }, + { + "fields": [ + { + "as": null, + "id": 13, + "initializer": null, + "kind": "field_decl", + "loc": x: map, + "name": { + "id": 9, + "kind": "id", + "loc": x, + "text": "x", + }, + "type": { + "id": 12, + "keyStorageType": null, + "keyType": { + "id": 10, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "kind": "map_type", + "loc": map, + "valueStorageType": null, + "valueType": { + "id": 11, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "id": 14, + "kind": "message_decl", + "loc": message B { + x: map; +}, + "name": { + "id": 8, + "kind": "id", + "loc": B, + "text": "B", + }, + "opcode": null, + }, + ], + "kind": "module", +} +`; + +exports[`grammar should parse types-optional 1`] = ` +{ + "id": 19, + "imports": [], + "items": [ + { + "attributes": [], + "id": 18, + "kind": "function_def", + "loc": fun testFunc(src: Int?): Int { + return 1 + 2 + (123 + 3)!! > 123; +}, + "name": { + "id": 1, + "kind": "id", + "loc": testFunc, + "text": "testFunc", + }, + "params": [ + { + "id": 6, + "kind": "typed_parameter", + "loc": src: Int?, + "name": { + "id": 3, + "kind": "id", + "loc": src, + "text": "src", + }, + "type": { + "id": 5, + "kind": "optional_type", + "loc": Int?, + "typeArg": { + "id": 4, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + }, + }, + ], + "return": { + "id": 2, + "kind": "type_id", + "loc": Int, + "text": "Int", + }, + "statements": [ + { + "expression": { + "id": 16, + "kind": "op_binary", + "left": { + "id": 14, + "kind": "op_binary", + "left": { + "id": 9, + "kind": "op_binary", + "left": { + "base": 10, + "id": 7, + "kind": "number", + "loc": 1, + "value": 1n, + }, + "loc": 1 + 2, + "op": "+", + "right": { + "base": 10, + "id": 8, + "kind": "number", + "loc": 2, + "value": 2n, + }, + }, + "loc": 1 + 2 + (123 + 3)!!, + "op": "+", + "right": { + "id": 13, + "kind": "op_unary", + "loc": (123 + 3)!!, + "op": "!!", + "operand": { + "id": 12, + "kind": "op_binary", + "left": { + "base": 10, + "id": 10, + "kind": "number", + "loc": 123, + "value": 123n, + }, + "loc": 123 + 3, + "op": "+", + "right": { + "base": 10, + "id": 11, + "kind": "number", + "loc": 3, + "value": 3n, + }, + }, + }, + }, + "loc": 1 + 2 + (123 + 3)!! > 123, + "op": ">", + "right": { + "base": 10, + "id": 15, + "kind": "number", + "loc": 123, + "value": 123n, + }, + }, + "id": 17, + "kind": "statement_return", + "loc": return 1 + 2 + (123 + 3)!! > 123;, + }, + ], + }, + ], + "kind": "module", +} +`; diff --git a/src/grammar/next/grammar.gg b/src/grammar/next/grammar.gg new file mode 100644 index 000000000..bd5d431ce --- /dev/null +++ b/src/grammar/next/grammar.gg @@ -0,0 +1,342 @@ +Module = + imports:Import* + items:moduleItem*; + +Import = + keyword<"import"> + path:StringLiteral + ";"; + +moduleItem + = PrimitiveTypeDecl + / Function + / AsmFunction + / NativeFunctionDecl + / Constant + / StructDecl + / MessageDecl + / Contract + / Trait; + +contractItemDecl + = ContractInit + / Receiver + / Function + / Constant + / storageVar; + +traitItemDecl + = Receiver + / Function + / Constant + / storageVar; + +PrimitiveTypeDecl = + keyword<"primitive"> + name:TypeId + ";"; + +Function = + attributes:FunctionAttribute* + keyword<"fun"> + name:Id + parameters:parameterList + returnType:ascription? + body:(FunctionDefinition / FunctionDeclaration); + +FunctionDefinition = body:statements; + +FunctionDeclaration = semicolon; + +AsmFunction = + "asm" + shuffle:shuffle? + attributes:FunctionAttribute* + keyword<"fun"> + name:Id + parameters:parameterList + returnType:ascription? + "{" + instructions:assembly + "}"; + +shuffle = "(" ids:Id* to:("->" @IntegerLiteralDec+)? ")"; + +NativeFunctionDecl = + "@name" "(" + nativeName:#FuncId + ")" + attributes:FunctionAttribute* + keyword<"native"> + name:Id + parameters:parameterList + returnType:ascription? + ";"; + +Constant = + attributes:ConstantAttribute* + keyword<"const"> + name:Id + type:ascription + body:(ConstantDefinition / ConstantDeclaration); + +ConstantAttribute = name:( + keyword<"virtual"> + / keyword<"override"> + / keyword<"abstract"> +); + +ConstantDefinition = "=" expression:expression semicolon; + +ConstantDeclaration = semicolon; + +storageVar = @FieldDecl semicolon; + +StructDecl = + "struct" + name:TypeId + "{" + fields:structFields + "}"; + +MessageDecl = + "message" + opcode:("(" @expression ")")? + name:TypeId + "{" + fields:structFields + "}"; + +structFields = @inter? ";"?; + +FieldDecl = + name:Id + type:ascription as:asType? + expression:("=" @expression)?; + +Contract = + attributes:ContractAttribute* + keyword<"contract"> + name:Id + traits:inheritedTraits? + "{" + declarations:contractItemDecl* + "}"; + +Trait = + attributes:ContractAttribute* + keyword<"trait"> + name:Id + traits:inheritedTraits? + "{" + declarations:traitItemDecl* + "}"; + +inheritedTraits = keyword<"with"> @commaList; + +ContractInit = + "init" + parameters:parameterList + body:statements; + +ContractAttribute = "@interface" "(" name:StringLiteral ")"; + +// 'get' cannot be a reserved word because there is the map '.get' method +FunctionAttribute = name:( + GetAttribute + / keyword<"mutates"> + / keyword<"extends"> + / keyword<"virtual"> + / keyword<"override"> + / keyword<"inline"> + / keyword<"abstract"> +); + +GetAttribute = "get" methodId:("(" @expression ")")?; + +Receiver = type:receiverType "(" param:receiverParam ")" body:statements; +// "bounced" cannot be a reserved word because there a 'bounced' field in stdlib's 'Context' structure +receiverType = "bounced" / keyword<"receive"> / keyword<"external">; +receiverParam = @(Parameter / StringLiteral)?; + +assembly = #$assemblySequence; +assemblySequence = assemblyItem*; +assemblyItem + = "{" assemblySequence "}" + / comment + / "\"" [^"]* "\"" + / (!(["{}] / "//" / "/*") .)+; + +ascription = ":" @type; +type + = TypeOptional + / TypeRegular + / TypeMap + / TypeBounced; +TypeOptional = child:TypeId "?"; +TypeRegular = child:TypeId; +TypeBounced = "bounced" "<" child:TypeId ">"; +TypeMap = + keyword<"map"> + "<" + key:TypeId keyAs:asType? + "," + value:TypeId valueAs:asType? + ">"; +TypeId "capitalized identifier" = name:#$([A-Z] [a-zA-Z0-9_]*); +asType = keyword<"as"> @Id; + +statement + = StatementLet + / StatementDestruct + / StatementBlock + / StatementReturn + / StatementCondition + / StatementWhile + / StatementRepeat + / StatementUntil + / StatementTry + / StatementForEach + / StatementExpression + / StatementAssign; + +statements = "{" @statement* "}"; + +StatementLet = keyword<"let"> name:Id type:ascription? "=" init:expression semicolon; +StatementDestruct = keyword<"let"> type:TypeId "{" fields:inter rest:optionalRest "}" "=" init:expression semicolon; +StatementBlock = body:statements; +StatementReturn = keyword<"return"> expression:expression? semicolon; +StatementExpression = expression:expression semicolon; +StatementAssign = left:expression operator:augmentedOp? "=" right:expression semicolon; +StatementCondition = keyword<"if"> condition:expression trueBranch:statements falseBranch:(keyword<"else"> @(FalseBranch / StatementCondition))?; +StatementWhile = keyword<"while"> condition:parens body:statements; +StatementRepeat = keyword<"repeat"> condition:parens body:statements; +StatementUntil = keyword<"do"> body:statements keyword<"until"> condition:parens semicolon; +StatementTry = keyword<"try"> body:statements handler:(keyword<"catch"> "(" name:Id ")" body:statements)?; +StatementForEach = keyword<"foreach"> "(" key:Id "," value:Id "in" expression:expression ")" body:statements; + +augmentedOp = "||" / "&&" / ">>" / "<<" / [-+*/%|&^]; +FalseBranch = body:statements; +semicolon = ";" / &"}"; + +destructItem = RegularField / PunnedField; +RegularField = fieldName:Id ":" varName:Id; +PunnedField = name:Id; + +optionalRest = "," @RestArgument / NoRestArgument; +RestArgument = ".."; +NoRestArgument = ","?; + +expression = Conditional; + +Conditional = head:or tail:("?" thenBranch:or ":" elseBranch:Conditional)?; + +or = Binary; +and = Binary; +bitwiseOr = Binary; +bitwiseXor = Binary; +bitwiseAnd = Binary; +equality = Binary=" / ">")>; +bitwiseShift = Binary>")>; +add = Binary; +mul = Binary; + +Unary = prefixes:Operator<[-+!~]>* expression:Suffix; +Suffix = expression:primary suffixes:suffix*; + +Binary = exprs:inter>; +Operator = name:U; + +suffix + = SuffixUnboxNotNull + / SuffixCall + / SuffixFieldAccess; + +SuffixUnboxNotNull = "!!"; +SuffixCall = params:parameterList; +SuffixFieldAccess = "." name:Id; + +// Order is important +primary + = Parens + / StructInstance + / IntegerLiteral + / BoolLiteral + / InitOf + / Null + / StringLiteral + / Id; + +Null = keyword<"null">; + +parens = "(" @expression ")"; +Parens = child:parens; + +StructInstance = type:TypeId "{" fields:commaList? "}"; +InitOf = keyword<"initOf"> name:Id params:parameterList; + +StructFieldInitializer = name:Id init:(":" @expression)?; + +parameterList = "(" @commaList? ")"; +Parameter = name:Id type:ascription; + +commaList = @inter ","?; + +// order is important +IntegerLiteral = value:(IntegerLiteralHex / IntegerLiteralBin / IntegerLiteralOct / IntegerLiteralDec); + +IntegerLiteralDec = digits:#underscored; +IntegerLiteralHex = digits:#("0" [xX] @underscored); +IntegerLiteralBin = digits:#("0" [bB] @underscored<[01]>); +IntegerLiteralOct = digits:#("0" [oO] @underscored<[0-7]>); +underscored = $(T ("_"? T)*); +digit "digit" = [0-9]; + +idPart "identifier character" = [a-zA-Z0-9_]; +Id "identifier" = name:#$(!reservedWord [a-zA-Z_] idPart*); + +// FunC identifiers, where `FuncId` stands for FunC function identifier +// A plain identifier cannot be a number, a single underscore, an operator, a keyword or a compiler directive +// See: https://github.com/ton-blockchain/ton/blob/master/crypto/func/keywords.cpp + +FuncId "FunC identifier" = accessor:[.~]? id:$("`" [^`\r\n]+ "`" / [^ \t\r\n()[\],.;~]+); + +// Boolean literals +BoolLiteral = value:("true" / "false") !idPart; + +// String literals +StringLiteral = value:#("\"" @$([^"\\] / "\\" @escapeChar)* "\""); + +escapeChar + = [\\"nrtvbf] + / "u{" @$(hexDigit hexDigit? hexDigit? hexDigit? hexDigit? hexDigit?) "}" + / "u" @$(hexDigit hexDigit hexDigit hexDigit) + / "x" @$(hexDigit hexDigit); + +hexDigit "hexadecimal digit" = [0-9a-fA-F]; + +keyword = #(@T !idPart); + +// Order is important +reservedWord "reserved word" = keyword<( + // extend and public are reserved for legacy reasons + "extend" / "public" / + + "fun" / "let" / "return" / "receive" / "native" / "primitive" / "null" / + "if" / "else" / "while" / "repeat" / "do" / "until" / "try" / "catch" / + "foreach" / "as" / "map" / "mutates" / "extends" / "external" / "import" + / "with" / "trait" / "initOf" / "override" / "abstract" / "virtual" / + "inline" / "const" +)>; + +space "space" = [ \t\r\n] / comment; +comment = multiLineComment / singleLineComment; +multiLineComment = "/*" @$(!"*/" .)* "*/"; +singleLineComment = "//" @$[^\r\n]*; + +// This is not used in the Tact grammar but +// it is useful for imports resolution +JustImports = imports:Import* .*; + +inter = head:A tail:(op:B right:A)*; \ No newline at end of file diff --git a/src/grammar/next/grammar.spec.ts b/src/grammar/next/grammar.spec.ts new file mode 100644 index 000000000..6b6c0b2af --- /dev/null +++ b/src/grammar/next/grammar.spec.ts @@ -0,0 +1,29 @@ +import { getAstFactory } from "../ast"; +import { loadCases } from "../../utils/loadCases"; +import { getParser } from "../grammar"; +import { SrcInfo, isSrcInfo } from "../src-info"; + +expect.addSnapshotSerializer({ + test: (src) => isSrcInfo(src), + print: (src) => (src as SrcInfo).contents, +}); + +describe("grammar", () => { + for (const r of loadCases(__dirname + "/../test/")) { + it("should parse " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast, "new"); + expect(parse(r.code, "", "user")).toMatchSnapshot(); + }); + } + + for (const r of loadCases(__dirname + "/../test-failed/")) { + it("should fail " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast, "new"); + expect(() => + parse(r.code, "", "user"), + ).toThrowErrorMatchingSnapshot(); + }); + } +}); diff --git a/src/grammar/next/grammar.ts b/src/grammar/next/grammar.ts new file mode 100644 index 000000000..00e80d9c8 --- /dev/null +++ b/src/grammar/next/grammar.ts @@ -0,0 +1,516 @@ +/* Generated. Do not edit. */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/ban-types */ +/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ +/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import * as $ from "@tonstudio/parser-runtime"; +export namespace $ast { + export type Module = $.Located<{ + readonly $: "Module"; + readonly imports: readonly Import[]; + readonly items: readonly moduleItem[]; + }>; + export type Import = $.Located<{ + readonly $: "Import"; + readonly path: StringLiteral; + }>; + export type PrimitiveTypeDecl = $.Located<{ + readonly $: "PrimitiveTypeDecl"; + readonly name: TypeId; + }>; + export type $Function = $.Located<{ + readonly $: "Function"; + readonly attributes: readonly FunctionAttribute[]; + readonly name: Id; + readonly parameters: parameterList; + readonly returnType: ascription | undefined; + readonly body: FunctionDefinition | FunctionDeclaration; + }>; + export type AsmFunction = $.Located<{ + readonly $: "AsmFunction"; + readonly shuffle: shuffle | undefined; + readonly attributes: readonly FunctionAttribute[]; + readonly name: Id; + readonly parameters: parameterList; + readonly returnType: ascription | undefined; + readonly instructions: assembly; + }>; + export type NativeFunctionDecl = $.Located<{ + readonly $: "NativeFunctionDecl"; + readonly nativeName: FuncId; + readonly attributes: readonly FunctionAttribute[]; + readonly name: Id; + readonly parameters: parameterList; + readonly returnType: ascription | undefined; + }>; + export type Constant = $.Located<{ + readonly $: "Constant"; + readonly attributes: readonly ConstantAttribute[]; + readonly name: Id; + readonly type: ascription; + readonly body: ConstantDefinition | ConstantDeclaration; + }>; + export type StructDecl = $.Located<{ + readonly $: "StructDecl"; + readonly name: TypeId; + readonly fields: structFields; + }>; + export type MessageDecl = $.Located<{ + readonly $: "MessageDecl"; + readonly opcode: expression | undefined; + readonly name: TypeId; + readonly fields: structFields; + }>; + export type Contract = $.Located<{ + readonly $: "Contract"; + readonly attributes: readonly ContractAttribute[]; + readonly name: Id; + readonly traits: inheritedTraits | undefined; + readonly declarations: readonly contractItemDecl[]; + }>; + export type Trait = $.Located<{ + readonly $: "Trait"; + readonly attributes: readonly ContractAttribute[]; + readonly name: Id; + readonly traits: inheritedTraits | undefined; + readonly declarations: readonly traitItemDecl[]; + }>; + export type moduleItem = PrimitiveTypeDecl | $Function | AsmFunction | NativeFunctionDecl | Constant | StructDecl | MessageDecl | Contract | Trait; + export type ContractInit = $.Located<{ + readonly $: "ContractInit"; + readonly parameters: parameterList; + readonly body: statements; + }>; + export type Receiver = $.Located<{ + readonly $: "Receiver"; + readonly type: receiverType; + readonly param: receiverParam; + readonly body: statements; + }>; + export type FieldDecl = $.Located<{ + readonly $: "FieldDecl"; + readonly name: Id; + readonly type: ascription; + readonly as: asType | undefined; + readonly expression: expression | undefined; + }>; + export type semicolon = ";" | "}"; + export type storageVar = FieldDecl; + export type contractItemDecl = ContractInit | Receiver | $Function | Constant | storageVar; + export type traitItemDecl = Receiver | $Function | Constant | storageVar; + export type FunctionDefinition = $.Located<{ + readonly $: "FunctionDefinition"; + readonly body: statements; + }>; + export type FunctionDeclaration = $.Located<{ + readonly $: "FunctionDeclaration"; + }>; + export type Id = $.Located<{ + readonly $: "Id"; + readonly name: string; + }>; + export type IntegerLiteralDec = $.Located<{ + readonly $: "IntegerLiteralDec"; + readonly digits: underscored; + }>; + export type shuffle = { + readonly ids: readonly Id[]; + readonly to: readonly IntegerLiteralDec[] | undefined; + }; + export type ConstantAttribute = $.Located<{ + readonly $: "ConstantAttribute"; + readonly name: keyword<"virtual"> | keyword<"override"> | keyword<"abstract">; + }>; + export type ConstantDefinition = $.Located<{ + readonly $: "ConstantDefinition"; + readonly expression: expression; + }>; + export type ConstantDeclaration = $.Located<{ + readonly $: "ConstantDeclaration"; + }>; + export type inter = { + readonly head: A; + readonly tail: readonly { + readonly op: B; + readonly right: A; + }[]; + }; + export type structFields = inter | undefined; + export type keyword = T; + export type commaList = inter; + export type inheritedTraits = commaList; + export type ContractAttribute = $.Located<{ + readonly $: "ContractAttribute"; + readonly name: StringLiteral; + }>; + export type FunctionAttribute = $.Located<{ + readonly $: "FunctionAttribute"; + readonly name: GetAttribute | keyword<"mutates"> | keyword<"extends"> | keyword<"virtual"> | keyword<"override"> | keyword<"inline"> | keyword<"abstract">; + }>; + export type GetAttribute = $.Located<{ + readonly $: "GetAttribute"; + readonly methodId: expression | undefined; + }>; + export type receiverType = "bounced" | keyword<"receive"> | keyword<"external">; + export type Parameter = $.Located<{ + readonly $: "Parameter"; + readonly name: Id; + readonly type: ascription; + }>; + export type StringLiteral = $.Located<{ + readonly $: "StringLiteral"; + readonly value: string; + }>; + export type receiverParam = Parameter | StringLiteral | undefined; + export type assembly = string; + export type multiLineComment = string; + export type singleLineComment = string; + export type comment = multiLineComment | singleLineComment; + export type assemblyItem = {} | comment | {} | readonly {}[]; + export type assemblySequence = readonly assemblyItem[]; + export type TypeOptional = $.Located<{ + readonly $: "TypeOptional"; + readonly child: TypeId; + }>; + export type TypeRegular = $.Located<{ + readonly $: "TypeRegular"; + readonly child: TypeId; + }>; + export type TypeMap = $.Located<{ + readonly $: "TypeMap"; + readonly key: TypeId; + readonly keyAs: asType | undefined; + readonly value: TypeId; + readonly valueAs: asType | undefined; + }>; + export type TypeBounced = $.Located<{ + readonly $: "TypeBounced"; + readonly child: TypeId; + }>; + export type $type = TypeOptional | TypeRegular | TypeMap | TypeBounced; + export type ascription = $type; + export type TypeId = $.Located<{ + readonly $: "TypeId"; + readonly name: string; + }>; + export type asType = Id; + export type StatementLet = $.Located<{ + readonly $: "StatementLet"; + readonly name: Id; + readonly type: ascription | undefined; + readonly init: expression; + }>; + export type StatementDestruct = $.Located<{ + readonly $: "StatementDestruct"; + readonly type: TypeId; + readonly fields: inter; + readonly rest: optionalRest; + readonly init: expression; + }>; + export type StatementBlock = $.Located<{ + readonly $: "StatementBlock"; + readonly body: statements; + }>; + export type StatementReturn = $.Located<{ + readonly $: "StatementReturn"; + readonly expression: expression | undefined; + }>; + export type StatementCondition = $.Located<{ + readonly $: "StatementCondition"; + readonly condition: expression; + readonly trueBranch: statements; + readonly falseBranch: FalseBranch | StatementCondition | undefined; + }>; + export type StatementWhile = $.Located<{ + readonly $: "StatementWhile"; + readonly condition: parens; + readonly body: statements; + }>; + export type StatementRepeat = $.Located<{ + readonly $: "StatementRepeat"; + readonly condition: parens; + readonly body: statements; + }>; + export type StatementUntil = $.Located<{ + readonly $: "StatementUntil"; + readonly body: statements; + readonly condition: parens; + }>; + export type StatementTry = $.Located<{ + readonly $: "StatementTry"; + readonly body: statements; + readonly handler: { + readonly name: Id; + readonly body: statements; + } | undefined; + }>; + export type StatementForEach = $.Located<{ + readonly $: "StatementForEach"; + readonly key: Id; + readonly value: Id; + readonly expression: expression; + readonly body: statements; + }>; + export type StatementExpression = $.Located<{ + readonly $: "StatementExpression"; + readonly expression: expression; + }>; + export type StatementAssign = $.Located<{ + readonly $: "StatementAssign"; + readonly left: expression; + readonly operator: augmentedOp | undefined; + readonly right: expression; + }>; + export type statement = StatementLet | StatementDestruct | StatementBlock | StatementReturn | StatementCondition | StatementWhile | StatementRepeat | StatementUntil | StatementTry | StatementForEach | StatementExpression | StatementAssign; + export type statements = readonly statement[]; + export type augmentedOp = "||" | "&&" | ">>" | "<<" | "-" | "+" | "*" | "/" | "%" | "|" | "&" | "^"; + export type FalseBranch = $.Located<{ + readonly $: "FalseBranch"; + readonly body: statements; + }>; + export type RegularField = $.Located<{ + readonly $: "RegularField"; + readonly fieldName: Id; + readonly varName: Id; + }>; + export type PunnedField = $.Located<{ + readonly $: "PunnedField"; + readonly name: Id; + }>; + export type destructItem = RegularField | PunnedField; + export type RestArgument = $.Located<{ + readonly $: "RestArgument"; + }>; + export type NoRestArgument = $.Located<{ + readonly $: "NoRestArgument"; + }>; + export type optionalRest = RestArgument | NoRestArgument; + export type Conditional = $.Located<{ + readonly $: "Conditional"; + readonly head: or; + readonly tail: { + readonly thenBranch: or; + readonly elseBranch: Conditional; + } | undefined; + }>; + export type expression = Conditional; + export type Binary = $.Located<{ + readonly $: "Binary"; + readonly exprs: inter>; + }>; + export type Unary = $.Located<{ + readonly $: "Unary"; + readonly prefixes: readonly Operator<"-" | "+" | "!" | "~">[]; + readonly expression: Suffix; + }>; + export type mul = Binary; + export type add = Binary; + export type bitwiseShift = Binary>">; + export type compare = Binary=" | ">">; + export type equality = Binary; + export type bitwiseXor = Binary; + export type bitwiseOr = Binary; + export type and = Binary; + export type or = Binary; + export type Suffix = $.Located<{ + readonly $: "Suffix"; + readonly expression: primary; + readonly suffixes: readonly suffix[]; + }>; + export type Operator = $.Located<{ + readonly $: "Operator"; + readonly name: U; + }>; + export type SuffixUnboxNotNull = $.Located<{ + readonly $: "SuffixUnboxNotNull"; + }>; + export type SuffixCall = $.Located<{ + readonly $: "SuffixCall"; + readonly params: parameterList; + }>; + export type SuffixFieldAccess = $.Located<{ + readonly $: "SuffixFieldAccess"; + readonly name: Id; + }>; + export type suffix = SuffixUnboxNotNull | SuffixCall | SuffixFieldAccess; + export type Parens = $.Located<{ + readonly $: "Parens"; + readonly child: parens; + }>; + export type StructInstance = $.Located<{ + readonly $: "StructInstance"; + readonly type: TypeId; + readonly fields: commaList | undefined; + }>; + export type IntegerLiteral = $.Located<{ + readonly $: "IntegerLiteral"; + readonly value: IntegerLiteralHex | IntegerLiteralBin | IntegerLiteralOct | IntegerLiteralDec; + }>; + export type BoolLiteral = $.Located<{ + readonly $: "BoolLiteral"; + readonly value: "true" | "false"; + }>; + export type InitOf = $.Located<{ + readonly $: "InitOf"; + readonly name: Id; + readonly params: parameterList; + }>; + export type Null = $.Located<{ + readonly $: "Null"; + }>; + export type primary = Parens | StructInstance | IntegerLiteral | BoolLiteral | InitOf | Null | StringLiteral | Id; + export type parens = expression; + export type StructFieldInitializer = $.Located<{ + readonly $: "StructFieldInitializer"; + readonly name: Id; + readonly init: expression | undefined; + }>; + export type parameterList = commaList | undefined; + export type IntegerLiteralHex = $.Located<{ + readonly $: "IntegerLiteralHex"; + readonly digits: underscored; + }>; + export type IntegerLiteralBin = $.Located<{ + readonly $: "IntegerLiteralBin"; + readonly digits: underscored<"0" | "1">; + }>; + export type IntegerLiteralOct = $.Located<{ + readonly $: "IntegerLiteralOct"; + readonly digits: underscored; + }>; + export type underscored = string; + export type digit = string; + export type idPart = string | string | string | "_"; + export type FuncId = $.Located<{ + readonly $: "FuncId"; + readonly accessor: "." | "~" | undefined; + readonly id: string; + }>; + export type hexDigit = string | string | string; + export type escapeChar = "\\" | "\"" | "n" | "r" | "t" | "v" | "b" | "f" | string | string | string; + export type reservedWord = keyword<"extend" | "public" | "fun" | "let" | "return" | "receive" | "native" | "primitive" | "null" | "if" | "else" | "while" | "repeat" | "do" | "until" | "try" | "catch" | "foreach" | "as" | "map" | "mutates" | "extends" | "external" | "import" | "with" | "trait" | "initOf" | "override" | "abstract" | "virtual" | "inline" | "const">; + export type space = " " | "\t" | "\r" | "\n" | comment; + export type JustImports = $.Located<{ + readonly $: "JustImports"; + readonly imports: readonly Import[]; + }>; +} +export const Module: $.Parser<$ast.Module> = $.loc($.field($.pure("Module"), "$", $.field($.star($.lazy(() => Import)), "imports", $.field($.star($.lazy(() => moduleItem)), "items", $.eps)))); +export const Import: $.Parser<$ast.Import> = $.loc($.field($.pure("Import"), "$", $.right($.lazy(() => keyword($.str("import"))), $.field($.lazy(() => StringLiteral), "path", $.right($.str(";"), $.eps))))); +export const PrimitiveTypeDecl: $.Parser<$ast.PrimitiveTypeDecl> = $.loc($.field($.pure("PrimitiveTypeDecl"), "$", $.right($.lazy(() => keyword($.str("primitive"))), $.field($.lazy(() => TypeId), "name", $.right($.str(";"), $.eps))))); +export const $Function: $.Parser<$ast.$Function> = $.loc($.field($.pure("Function"), "$", $.field($.star($.lazy(() => FunctionAttribute)), "attributes", $.right($.lazy(() => keyword($.str("fun"))), $.field($.lazy(() => Id), "name", $.field($.lazy(() => parameterList($.lazy(() => Parameter))), "parameters", $.field($.opt($.lazy(() => ascription)), "returnType", $.field($.alt($.lazy(() => FunctionDefinition), $.lazy(() => FunctionDeclaration)), "body", $.eps)))))))); +export const AsmFunction: $.Parser<$ast.AsmFunction> = $.loc($.field($.pure("AsmFunction"), "$", $.right($.str("asm"), $.field($.opt($.lazy(() => shuffle)), "shuffle", $.field($.star($.lazy(() => FunctionAttribute)), "attributes", $.right($.lazy(() => keyword($.str("fun"))), $.field($.lazy(() => Id), "name", $.field($.lazy(() => parameterList($.lazy(() => Parameter))), "parameters", $.field($.opt($.lazy(() => ascription)), "returnType", $.right($.str("{"), $.field($.lazy(() => assembly), "instructions", $.right($.str("}"), $.eps)))))))))))); +export const NativeFunctionDecl: $.Parser<$ast.NativeFunctionDecl> = $.loc($.field($.pure("NativeFunctionDecl"), "$", $.right($.str("@name"), $.right($.str("("), $.field($.lex($.lazy(() => FuncId)), "nativeName", $.right($.str(")"), $.field($.star($.lazy(() => FunctionAttribute)), "attributes", $.right($.lazy(() => keyword($.str("native"))), $.field($.lazy(() => Id), "name", $.field($.lazy(() => parameterList($.lazy(() => Parameter))), "parameters", $.field($.opt($.lazy(() => ascription)), "returnType", $.right($.str(";"), $.eps)))))))))))); +export const Constant: $.Parser<$ast.Constant> = $.loc($.field($.pure("Constant"), "$", $.field($.star($.lazy(() => ConstantAttribute)), "attributes", $.right($.lazy(() => keyword($.str("const"))), $.field($.lazy(() => Id), "name", $.field($.lazy(() => ascription), "type", $.field($.alt($.lazy(() => ConstantDefinition), $.lazy(() => ConstantDeclaration)), "body", $.eps))))))); +export const StructDecl: $.Parser<$ast.StructDecl> = $.loc($.field($.pure("StructDecl"), "$", $.right($.str("struct"), $.field($.lazy(() => TypeId), "name", $.right($.str("{"), $.field($.lazy(() => structFields), "fields", $.right($.str("}"), $.eps))))))); +export const MessageDecl: $.Parser<$ast.MessageDecl> = $.loc($.field($.pure("MessageDecl"), "$", $.right($.str("message"), $.field($.opt($.right($.str("("), $.left($.lazy(() => expression), $.str(")")))), "opcode", $.field($.lazy(() => TypeId), "name", $.right($.str("{"), $.field($.lazy(() => structFields), "fields", $.right($.str("}"), $.eps)))))))); +export const Contract: $.Parser<$ast.Contract> = $.loc($.field($.pure("Contract"), "$", $.field($.star($.lazy(() => ContractAttribute)), "attributes", $.right($.lazy(() => keyword($.str("contract"))), $.field($.lazy(() => Id), "name", $.field($.opt($.lazy(() => inheritedTraits)), "traits", $.right($.str("{"), $.field($.star($.lazy(() => contractItemDecl)), "declarations", $.right($.str("}"), $.eps))))))))); +export const Trait: $.Parser<$ast.Trait> = $.loc($.field($.pure("Trait"), "$", $.field($.star($.lazy(() => ContractAttribute)), "attributes", $.right($.lazy(() => keyword($.str("trait"))), $.field($.lazy(() => Id), "name", $.field($.opt($.lazy(() => inheritedTraits)), "traits", $.right($.str("{"), $.field($.star($.lazy(() => traitItemDecl)), "declarations", $.right($.str("}"), $.eps))))))))); +export const moduleItem: $.Parser<$ast.moduleItem> = $.alt(PrimitiveTypeDecl, $.alt($Function, $.alt(AsmFunction, $.alt(NativeFunctionDecl, $.alt(Constant, $.alt(StructDecl, $.alt(MessageDecl, $.alt(Contract, Trait)))))))); +export const ContractInit: $.Parser<$ast.ContractInit> = $.loc($.field($.pure("ContractInit"), "$", $.right($.str("init"), $.field($.lazy(() => parameterList($.lazy(() => Parameter))), "parameters", $.field($.lazy(() => statements), "body", $.eps))))); +export const Receiver: $.Parser<$ast.Receiver> = $.loc($.field($.pure("Receiver"), "$", $.field($.lazy(() => receiverType), "type", $.right($.str("("), $.field($.lazy(() => receiverParam), "param", $.right($.str(")"), $.field($.lazy(() => statements), "body", $.eps))))))); +export const FieldDecl: $.Parser<$ast.FieldDecl> = $.loc($.field($.pure("FieldDecl"), "$", $.field($.lazy(() => Id), "name", $.field($.lazy(() => ascription), "type", $.field($.opt($.lazy(() => asType)), "as", $.field($.opt($.right($.str("="), $.lazy(() => expression))), "expression", $.eps)))))); +export const semicolon: $.Parser<$ast.semicolon> = $.alt($.str(";"), $.lookPos($.str("}"))); +export const storageVar: $.Parser<$ast.storageVar> = $.left(FieldDecl, semicolon); +export const contractItemDecl: $.Parser<$ast.contractItemDecl> = $.alt(ContractInit, $.alt(Receiver, $.alt($Function, $.alt(Constant, storageVar)))); +export const traitItemDecl: $.Parser<$ast.traitItemDecl> = $.alt(Receiver, $.alt($Function, $.alt(Constant, storageVar))); +export const FunctionDefinition: $.Parser<$ast.FunctionDefinition> = $.loc($.field($.pure("FunctionDefinition"), "$", $.field($.lazy(() => statements), "body", $.eps))); +export const FunctionDeclaration: $.Parser<$ast.FunctionDeclaration> = $.loc($.field($.pure("FunctionDeclaration"), "$", $.right(semicolon, $.eps))); +export const Id: $.Parser<$ast.Id> = $.named("identifier", $.loc($.field($.pure("Id"), "$", $.field($.lex($.stry($.right($.lookNeg($.lazy(() => reservedWord)), $.right($.regex("a-zA-Z_", [$.ExpRange("a", "z"), $.ExpRange("A", "Z"), $.ExpString("_")]), $.right($.star($.lazy(() => idPart)), $.eps))))), "name", $.eps)))); +export const IntegerLiteralDec: $.Parser<$ast.IntegerLiteralDec> = $.loc($.field($.pure("IntegerLiteralDec"), "$", $.field($.lex($.lazy(() => underscored($.lazy(() => digit)))), "digits", $.eps))); +export const shuffle: $.Parser<$ast.shuffle> = $.right($.str("("), $.field($.star(Id), "ids", $.field($.opt($.right($.str("->"), $.plus(IntegerLiteralDec))), "to", $.right($.str(")"), $.eps)))); +export const ConstantAttribute: $.Parser<$ast.ConstantAttribute> = $.loc($.field($.pure("ConstantAttribute"), "$", $.field($.alt($.lazy(() => keyword($.str("virtual"))), $.alt($.lazy(() => keyword($.str("override"))), $.lazy(() => keyword($.str("abstract"))))), "name", $.eps))); +export const ConstantDefinition: $.Parser<$ast.ConstantDefinition> = $.loc($.field($.pure("ConstantDefinition"), "$", $.right($.str("="), $.field($.lazy(() => expression), "expression", $.right(semicolon, $.eps))))); +export const ConstantDeclaration: $.Parser<$ast.ConstantDeclaration> = $.loc($.field($.pure("ConstantDeclaration"), "$", $.right(semicolon, $.eps))); +export const inter = (A: $.Parser, B: $.Parser): $.Parser<$ast.inter> => $.field($.lazy(() => A), "head", $.field($.star($.field($.lazy(() => B), "op", $.field($.lazy(() => A), "right", $.eps))), "tail", $.eps)); +export const structFields: $.Parser<$ast.structFields> = $.left($.opt(inter(FieldDecl, $.str(";"))), $.opt($.str(";"))); +export const keyword = (T: $.Parser): $.Parser<$ast.keyword> => $.lex($.left($.lazy(() => T), $.lookNeg($.lazy(() => idPart)))); +export const commaList = (T: $.Parser): $.Parser<$ast.commaList> => $.left(inter($.lazy(() => T), $.str(",")), $.opt($.str(","))); +export const inheritedTraits: $.Parser<$ast.inheritedTraits> = $.right(keyword($.str("with")), commaList(Id)); +export const ContractAttribute: $.Parser<$ast.ContractAttribute> = $.loc($.field($.pure("ContractAttribute"), "$", $.right($.str("@interface"), $.right($.str("("), $.field($.lazy(() => StringLiteral), "name", $.right($.str(")"), $.eps)))))); +export const FunctionAttribute: $.Parser<$ast.FunctionAttribute> = $.loc($.field($.pure("FunctionAttribute"), "$", $.field($.alt($.lazy(() => GetAttribute), $.alt(keyword($.str("mutates")), $.alt(keyword($.str("extends")), $.alt(keyword($.str("virtual")), $.alt(keyword($.str("override")), $.alt(keyword($.str("inline")), keyword($.str("abstract")))))))), "name", $.eps))); +export const GetAttribute: $.Parser<$ast.GetAttribute> = $.loc($.field($.pure("GetAttribute"), "$", $.right($.str("get"), $.field($.opt($.right($.str("("), $.left($.lazy(() => expression), $.str(")")))), "methodId", $.eps)))); +export const receiverType: $.Parser<$ast.receiverType> = $.alt($.str("bounced"), $.alt(keyword($.str("receive")), keyword($.str("external")))); +export const Parameter: $.Parser<$ast.Parameter> = $.loc($.field($.pure("Parameter"), "$", $.field(Id, "name", $.field($.lazy(() => ascription), "type", $.eps)))); +export const StringLiteral: $.Parser<$ast.StringLiteral> = $.loc($.field($.pure("StringLiteral"), "$", $.field($.lex($.right($.str("\""), $.left($.stry($.star($.alt($.regex<"\"" | "\\">("^\"\\\\", $.negateExps([$.ExpString("\""), $.ExpString("\\")])), $.right($.str("\\"), $.lazy(() => escapeChar))))), $.str("\"")))), "value", $.eps))); +export const receiverParam: $.Parser<$ast.receiverParam> = $.opt($.alt(Parameter, StringLiteral)); +export const assembly: $.Parser<$ast.assembly> = $.lex($.stry($.lazy(() => assemblySequence))); +export const multiLineComment: $.Parser<$ast.multiLineComment> = $.right($.str("/*"), $.left($.stry($.star($.right($.lookNeg($.str("*/")), $.right($.any, $.eps)))), $.str("*/"))); +export const singleLineComment: $.Parser<$ast.singleLineComment> = $.right($.str("//"), $.stry($.star($.regex<"\r" | "\n">("^\\r\\n", $.negateExps([$.ExpString("\r"), $.ExpString("\n")]))))); +export const comment: $.Parser<$ast.comment> = $.alt(multiLineComment, singleLineComment); +export const assemblyItem: $.Parser<$ast.assemblyItem> = $.alt($.right($.str("{"), $.right($.lazy(() => assemblySequence), $.right($.str("}"), $.eps))), $.alt(comment, $.alt($.right($.str("\""), $.right($.star($.regex<"\"">("^\"", $.negateExps([$.ExpString("\"")]))), $.right($.str("\""), $.eps))), $.plus($.right($.lookNeg($.alt($.regex<"\"" | "{" | "}">("\"{}", [$.ExpString("\""), $.ExpString("{"), $.ExpString("}")]), $.alt($.str("//"), $.str("/*")))), $.right($.any, $.eps)))))); +export const assemblySequence: $.Parser<$ast.assemblySequence> = $.star(assemblyItem); +export const TypeOptional: $.Parser<$ast.TypeOptional> = $.loc($.field($.pure("TypeOptional"), "$", $.field($.lazy(() => TypeId), "child", $.right($.str("?"), $.eps)))); +export const TypeRegular: $.Parser<$ast.TypeRegular> = $.loc($.field($.pure("TypeRegular"), "$", $.field($.lazy(() => TypeId), "child", $.eps))); +export const TypeMap: $.Parser<$ast.TypeMap> = $.loc($.field($.pure("TypeMap"), "$", $.right(keyword($.str("map")), $.right($.str("<"), $.field($.lazy(() => TypeId), "key", $.field($.opt($.lazy(() => asType)), "keyAs", $.right($.str(","), $.field($.lazy(() => TypeId), "value", $.field($.opt($.lazy(() => asType)), "valueAs", $.right($.str(">"), $.eps)))))))))); +export const TypeBounced: $.Parser<$ast.TypeBounced> = $.loc($.field($.pure("TypeBounced"), "$", $.right($.str("bounced"), $.right($.str("<"), $.field($.lazy(() => TypeId), "child", $.right($.str(">"), $.eps)))))); +export const $type: $.Parser<$ast.$type> = $.alt(TypeOptional, $.alt(TypeRegular, $.alt(TypeMap, TypeBounced))); +export const ascription: $.Parser<$ast.ascription> = $.right($.str(":"), $type); +export const TypeId: $.Parser<$ast.TypeId> = $.named("capitalized identifier", $.loc($.field($.pure("TypeId"), "$", $.field($.lex($.stry($.right($.regex("A-Z", [$.ExpRange("A", "Z")]), $.right($.star($.regex("a-zA-Z0-9_", [$.ExpRange("a", "z"), $.ExpRange("A", "Z"), $.ExpRange("0", "9"), $.ExpString("_")])), $.eps)))), "name", $.eps)))); +export const asType: $.Parser<$ast.asType> = $.right(keyword($.str("as")), Id); +export const StatementLet: $.Parser<$ast.StatementLet> = $.loc($.field($.pure("StatementLet"), "$", $.right(keyword($.str("let")), $.field(Id, "name", $.field($.opt(ascription), "type", $.right($.str("="), $.field($.lazy(() => expression), "init", $.right(semicolon, $.eps)))))))); +export const StatementDestruct: $.Parser<$ast.StatementDestruct> = $.loc($.field($.pure("StatementDestruct"), "$", $.right(keyword($.str("let")), $.field(TypeId, "type", $.right($.str("{"), $.field(inter($.lazy(() => destructItem), $.str(",")), "fields", $.field($.lazy(() => optionalRest), "rest", $.right($.str("}"), $.right($.str("="), $.field($.lazy(() => expression), "init", $.right(semicolon, $.eps))))))))))); +export const StatementBlock: $.Parser<$ast.StatementBlock> = $.loc($.field($.pure("StatementBlock"), "$", $.field($.lazy(() => statements), "body", $.eps))); +export const StatementReturn: $.Parser<$ast.StatementReturn> = $.loc($.field($.pure("StatementReturn"), "$", $.right(keyword($.str("return")), $.field($.opt($.lazy(() => expression)), "expression", $.right(semicolon, $.eps))))); +export const StatementCondition: $.Parser<$ast.StatementCondition> = $.loc($.field($.pure("StatementCondition"), "$", $.right(keyword($.str("if")), $.field($.lazy(() => expression), "condition", $.field($.lazy(() => statements), "trueBranch", $.field($.opt($.right(keyword($.str("else")), $.alt($.lazy(() => FalseBranch), $.lazy(() => StatementCondition)))), "falseBranch", $.eps)))))); +export const StatementWhile: $.Parser<$ast.StatementWhile> = $.loc($.field($.pure("StatementWhile"), "$", $.right(keyword($.str("while")), $.field($.lazy(() => parens), "condition", $.field($.lazy(() => statements), "body", $.eps))))); +export const StatementRepeat: $.Parser<$ast.StatementRepeat> = $.loc($.field($.pure("StatementRepeat"), "$", $.right(keyword($.str("repeat")), $.field($.lazy(() => parens), "condition", $.field($.lazy(() => statements), "body", $.eps))))); +export const StatementUntil: $.Parser<$ast.StatementUntil> = $.loc($.field($.pure("StatementUntil"), "$", $.right(keyword($.str("do")), $.field($.lazy(() => statements), "body", $.right(keyword($.str("until")), $.field($.lazy(() => parens), "condition", $.right(semicolon, $.eps))))))); +export const StatementTry: $.Parser<$ast.StatementTry> = $.loc($.field($.pure("StatementTry"), "$", $.right(keyword($.str("try")), $.field($.lazy(() => statements), "body", $.field($.opt($.right(keyword($.str("catch")), $.right($.str("("), $.field(Id, "name", $.right($.str(")"), $.field($.lazy(() => statements), "body", $.eps)))))), "handler", $.eps))))); +export const StatementForEach: $.Parser<$ast.StatementForEach> = $.loc($.field($.pure("StatementForEach"), "$", $.right(keyword($.str("foreach")), $.right($.str("("), $.field(Id, "key", $.right($.str(","), $.field(Id, "value", $.right($.str("in"), $.field($.lazy(() => expression), "expression", $.right($.str(")"), $.field($.lazy(() => statements), "body", $.eps))))))))))); +export const StatementExpression: $.Parser<$ast.StatementExpression> = $.loc($.field($.pure("StatementExpression"), "$", $.field($.lazy(() => expression), "expression", $.right(semicolon, $.eps)))); +export const StatementAssign: $.Parser<$ast.StatementAssign> = $.loc($.field($.pure("StatementAssign"), "$", $.field($.lazy(() => expression), "left", $.field($.opt($.lazy(() => augmentedOp)), "operator", $.right($.str("="), $.field($.lazy(() => expression), "right", $.right(semicolon, $.eps))))))); +export const statement: $.Parser<$ast.statement> = $.alt(StatementLet, $.alt(StatementDestruct, $.alt(StatementBlock, $.alt(StatementReturn, $.alt(StatementCondition, $.alt(StatementWhile, $.alt(StatementRepeat, $.alt(StatementUntil, $.alt(StatementTry, $.alt(StatementForEach, $.alt(StatementExpression, StatementAssign))))))))))); +export const statements: $.Parser<$ast.statements> = $.right($.str("{"), $.left($.star(statement), $.str("}"))); +export const augmentedOp: $.Parser<$ast.augmentedOp> = $.alt($.str("||"), $.alt($.str("&&"), $.alt($.str(">>"), $.alt($.str("<<"), $.regex<"-" | "+" | "*" | "/" | "%" | "|" | "&" | "^">("-+*/%|&^", [$.ExpString("-"), $.ExpString("+"), $.ExpString("*"), $.ExpString("/"), $.ExpString("%"), $.ExpString("|"), $.ExpString("&"), $.ExpString("^")]))))); +export const FalseBranch: $.Parser<$ast.FalseBranch> = $.loc($.field($.pure("FalseBranch"), "$", $.field(statements, "body", $.eps))); +export const RegularField: $.Parser<$ast.RegularField> = $.loc($.field($.pure("RegularField"), "$", $.field(Id, "fieldName", $.right($.str(":"), $.field(Id, "varName", $.eps))))); +export const PunnedField: $.Parser<$ast.PunnedField> = $.loc($.field($.pure("PunnedField"), "$", $.field(Id, "name", $.eps))); +export const destructItem: $.Parser<$ast.destructItem> = $.alt(RegularField, PunnedField); +export const RestArgument: $.Parser<$ast.RestArgument> = $.loc($.field($.pure("RestArgument"), "$", $.right($.str(".."), $.eps))); +export const NoRestArgument: $.Parser<$ast.NoRestArgument> = $.loc($.field($.pure("NoRestArgument"), "$", $.right($.opt($.str(",")), $.eps))); +export const optionalRest: $.Parser<$ast.optionalRest> = $.alt($.right($.str(","), RestArgument), NoRestArgument); +export const Conditional: $.Parser<$ast.Conditional> = $.loc($.field($.pure("Conditional"), "$", $.field($.lazy(() => or), "head", $.field($.opt($.right($.str("?"), $.field($.lazy(() => or), "thenBranch", $.right($.str(":"), $.field($.lazy(() => Conditional), "elseBranch", $.eps))))), "tail", $.eps)))); +export const expression: $.Parser<$ast.expression> = Conditional; +export const Binary = (T: $.Parser, U: $.Parser): $.Parser<$ast.Binary> => $.loc($.field($.pure("Binary"), "$", $.field(inter($.lazy(() => T), $.lazy(() => Operator($.lazy(() => U)))), "exprs", $.eps))); +export const Unary: $.Parser<$ast.Unary> = $.loc($.field($.pure("Unary"), "$", $.field($.star($.lazy(() => Operator($.regex<"-" | "+" | "!" | "~">("-+!~", [$.ExpString("-"), $.ExpString("+"), $.ExpString("!"), $.ExpString("~")])))), "prefixes", $.field($.lazy(() => Suffix), "expression", $.eps)))); +export const mul: $.Parser<$ast.mul> = Binary(Unary, $.regex<"*" | "/" | "%">("*/%", [$.ExpString("*"), $.ExpString("/"), $.ExpString("%")])); +export const add: $.Parser<$ast.add> = Binary(mul, $.alt($.str("+"), $.str("-"))); +export const bitwiseShift: $.Parser<$ast.bitwiseShift> = Binary(add, $.alt($.str("<<"), $.str(">>"))); +export const compare: $.Parser<$ast.compare> = Binary(bitwiseShift, $.alt($.str("<="), $.alt($.str("<"), $.alt($.str(">="), $.str(">"))))); +export const equality: $.Parser<$ast.equality> = Binary(compare, $.alt($.str("!="), $.str("=="))); +export const bitwiseAnd: $.Parser<$ast.bitwiseAnd> = Binary(equality, $.str("&")); +export const bitwiseXor: $.Parser<$ast.bitwiseXor> = Binary(bitwiseAnd, $.str("^")); +export const bitwiseOr: $.Parser<$ast.bitwiseOr> = Binary(bitwiseXor, $.str("|")); +export const and: $.Parser<$ast.and> = Binary(bitwiseOr, $.str("&&")); +export const or: $.Parser<$ast.or> = Binary(and, $.str("||")); +export const Suffix: $.Parser<$ast.Suffix> = $.loc($.field($.pure("Suffix"), "$", $.field($.lazy(() => primary), "expression", $.field($.star($.lazy(() => suffix)), "suffixes", $.eps)))); +export const Operator = (U: $.Parser): $.Parser<$ast.Operator> => $.loc($.field($.pure("Operator"), "$", $.field($.lazy(() => U), "name", $.eps))); +export const SuffixUnboxNotNull: $.Parser<$ast.SuffixUnboxNotNull> = $.loc($.field($.pure("SuffixUnboxNotNull"), "$", $.right($.str("!!"), $.eps))); +export const SuffixCall: $.Parser<$ast.SuffixCall> = $.loc($.field($.pure("SuffixCall"), "$", $.field($.lazy(() => parameterList(expression)), "params", $.eps))); +export const SuffixFieldAccess: $.Parser<$ast.SuffixFieldAccess> = $.loc($.field($.pure("SuffixFieldAccess"), "$", $.right($.str("."), $.field(Id, "name", $.eps)))); +export const suffix: $.Parser<$ast.suffix> = $.alt(SuffixUnboxNotNull, $.alt(SuffixCall, SuffixFieldAccess)); +export const Parens: $.Parser<$ast.Parens> = $.loc($.field($.pure("Parens"), "$", $.field($.lazy(() => parens), "child", $.eps))); +export const StructInstance: $.Parser<$ast.StructInstance> = $.loc($.field($.pure("StructInstance"), "$", $.field(TypeId, "type", $.right($.str("{"), $.field($.opt(commaList($.lazy(() => StructFieldInitializer))), "fields", $.right($.str("}"), $.eps)))))); +export const IntegerLiteral: $.Parser<$ast.IntegerLiteral> = $.loc($.field($.pure("IntegerLiteral"), "$", $.field($.alt($.lazy(() => IntegerLiteralHex), $.alt($.lazy(() => IntegerLiteralBin), $.alt($.lazy(() => IntegerLiteralOct), IntegerLiteralDec))), "value", $.eps))); +export const BoolLiteral: $.Parser<$ast.BoolLiteral> = $.loc($.field($.pure("BoolLiteral"), "$", $.field($.alt($.str("true"), $.str("false")), "value", $.right($.lookNeg($.lazy(() => idPart)), $.eps)))); +export const InitOf: $.Parser<$ast.InitOf> = $.loc($.field($.pure("InitOf"), "$", $.right(keyword($.str("initOf")), $.field(Id, "name", $.field($.lazy(() => parameterList(expression)), "params", $.eps))))); +export const Null: $.Parser<$ast.Null> = $.loc($.field($.pure("Null"), "$", $.right(keyword($.str("null")), $.eps))); +export const primary: $.Parser<$ast.primary> = $.alt(Parens, $.alt(StructInstance, $.alt(IntegerLiteral, $.alt(BoolLiteral, $.alt(InitOf, $.alt(Null, $.alt(StringLiteral, Id))))))); +export const parens: $.Parser<$ast.parens> = $.right($.str("("), $.left(expression, $.str(")"))); +export const StructFieldInitializer: $.Parser<$ast.StructFieldInitializer> = $.loc($.field($.pure("StructFieldInitializer"), "$", $.field(Id, "name", $.field($.opt($.right($.str(":"), expression)), "init", $.eps)))); +export const parameterList = (T: $.Parser): $.Parser<$ast.parameterList> => $.right($.str("("), $.left($.opt(commaList($.lazy(() => T))), $.str(")"))); +export const IntegerLiteralHex: $.Parser<$ast.IntegerLiteralHex> = $.loc($.field($.pure("IntegerLiteralHex"), "$", $.field($.lex($.right($.str("0"), $.right($.regex<"x" | "X">("xX", [$.ExpString("x"), $.ExpString("X")]), $.lazy(() => underscored($.lazy(() => hexDigit)))))), "digits", $.eps))); +export const IntegerLiteralBin: $.Parser<$ast.IntegerLiteralBin> = $.loc($.field($.pure("IntegerLiteralBin"), "$", $.field($.lex($.right($.str("0"), $.right($.regex<"b" | "B">("bB", [$.ExpString("b"), $.ExpString("B")]), $.lazy(() => underscored($.regex<"0" | "1">("01", [$.ExpString("0"), $.ExpString("1")])))))), "digits", $.eps))); +export const IntegerLiteralOct: $.Parser<$ast.IntegerLiteralOct> = $.loc($.field($.pure("IntegerLiteralOct"), "$", $.field($.lex($.right($.str("0"), $.right($.regex<"o" | "O">("oO", [$.ExpString("o"), $.ExpString("O")]), $.lazy(() => underscored($.regex("0-7", [$.ExpRange("0", "7")])))))), "digits", $.eps))); +export const underscored = (T: $.Parser): $.Parser<$ast.underscored> => $.stry($.right($.lazy(() => T), $.right($.star($.right($.opt($.str("_")), $.right($.lazy(() => T), $.eps))), $.eps))); +export const digit: $.Parser<$ast.digit> = $.named("digit", $.regex("0-9", [$.ExpRange("0", "9")])); +export const idPart: $.Parser<$ast.idPart> = $.named("identifier character", $.regex("a-zA-Z0-9_", [$.ExpRange("a", "z"), $.ExpRange("A", "Z"), $.ExpRange("0", "9"), $.ExpString("_")])); +export const FuncId: $.Parser<$ast.FuncId> = $.named("FunC identifier", $.loc($.field($.pure("FuncId"), "$", $.field($.opt($.regex<"." | "~">(".~", [$.ExpString("."), $.ExpString("~")])), "accessor", $.field($.stry($.alt($.right($.str("`"), $.right($.plus($.regex<"`" | "\r" | "\n">("^`\\r\\n", $.negateExps([$.ExpString("`"), $.ExpString("\r"), $.ExpString("\n")]))), $.right($.str("`"), $.eps))), $.plus($.regex<" " | "\t" | "\r" | "\n" | "(" | ")" | "[" | string | "," | "." | ";" | "~">("^ \\t\\r\\n()[\\],.;~", $.negateExps([$.ExpString(" "), $.ExpString("\t"), $.ExpString("\r"), $.ExpString("\n"), $.ExpString("("), $.ExpString(")"), $.ExpString("["), $.ExpString("\"\\]\""), $.ExpString(","), $.ExpString("."), $.ExpString(";"), $.ExpString("~")]))))), "id", $.eps))))); +export const hexDigit: $.Parser<$ast.hexDigit> = $.named("hexadecimal digit", $.regex("0-9a-fA-F", [$.ExpRange("0", "9"), $.ExpRange("a", "f"), $.ExpRange("A", "F")])); +export const escapeChar: $.Parser<$ast.escapeChar> = $.alt($.regex<"\\" | "\"" | "n" | "r" | "t" | "v" | "b" | "f">("\\\\\"nrtvbf", [$.ExpString("\\"), $.ExpString("\""), $.ExpString("n"), $.ExpString("r"), $.ExpString("t"), $.ExpString("v"), $.ExpString("b"), $.ExpString("f")]), $.alt($.right($.str("u{"), $.left($.stry($.right(hexDigit, $.right($.opt(hexDigit), $.right($.opt(hexDigit), $.right($.opt(hexDigit), $.right($.opt(hexDigit), $.right($.opt(hexDigit), $.eps))))))), $.str("}"))), $.alt($.right($.str("u"), $.stry($.right(hexDigit, $.right(hexDigit, $.right(hexDigit, $.right(hexDigit, $.eps)))))), $.right($.str("x"), $.stry($.right(hexDigit, $.right(hexDigit, $.eps))))))); +export const reservedWord: $.Parser<$ast.reservedWord> = $.named("reserved word", keyword($.alt($.str("extend"), $.alt($.str("public"), $.alt($.str("fun"), $.alt($.str("let"), $.alt($.str("return"), $.alt($.str("receive"), $.alt($.str("native"), $.alt($.str("primitive"), $.alt($.str("null"), $.alt($.str("if"), $.alt($.str("else"), $.alt($.str("while"), $.alt($.str("repeat"), $.alt($.str("do"), $.alt($.str("until"), $.alt($.str("try"), $.alt($.str("catch"), $.alt($.str("foreach"), $.alt($.str("as"), $.alt($.str("map"), $.alt($.str("mutates"), $.alt($.str("extends"), $.alt($.str("external"), $.alt($.str("import"), $.alt($.str("with"), $.alt($.str("trait"), $.alt($.str("initOf"), $.alt($.str("override"), $.alt($.str("abstract"), $.alt($.str("virtual"), $.alt($.str("inline"), $.str("const")))))))))))))))))))))))))))))))))); +export const space: $.Parser<$ast.space> = $.named("space", $.alt($.regex<" " | "\t" | "\r" | "\n">(" \\t\\r\\n", [$.ExpString(" "), $.ExpString("\t"), $.ExpString("\r"), $.ExpString("\n")]), comment)); +export const JustImports: $.Parser<$ast.JustImports> = $.loc($.field($.pure("JustImports"), "$", $.field($.star(Import), "imports", $.right($.star($.any), $.eps)))); \ No newline at end of file diff --git a/src/grammar/next/index.ts b/src/grammar/next/index.ts new file mode 100644 index 000000000..6a1341c7e --- /dev/null +++ b/src/grammar/next/index.ts @@ -0,0 +1,1288 @@ +import * as $ from "@tonstudio/parser-runtime"; +import * as A from "../ast"; +import * as G from "./grammar"; +import type { $ast } from "./grammar"; +import { TactCompilationError, throwInternalCompilerError } from "../../errors"; +import { SyntaxErrors, syntaxErrorSchema } from "../parser-error"; +import { AstSchema, getAstSchema } from "../ast-typed"; +import { getSrcInfo, ItemOrigin } from "../src-info"; +import { displayToString } from "../../error/display-to-string"; +import { makeMakeVisitor } from "../../utils/tricks"; + +const makeVisitor = makeMakeVisitor("$"); + +type Context = { + ast: AstSchema; + err: SyntaxErrors<(loc: $.Loc) => never>; +}; + +type Handler = (ctx: Context) => T; + +const map = + (ts: readonly T[], handler: (t: T) => Handler): Handler => + (ctx) => { + return ts.map((t) => handler(t)(ctx)); + }; + +const parseList = (node: $ast.inter | undefined): T[] => { + if (!node) { + return []; + } + const { head, tail } = node; + return [head, ...tail.map(({ right }) => right)]; +}; + +const parseId = + ({ name, loc }: $ast.Id | $ast.TypeId): Handler => + (ctx) => { + if (name.startsWith("__gen")) { + ctx.err.reservedVarPrefix("__gen")(loc); + } + if (name.startsWith("__tact")) { + ctx.err.reservedVarPrefix("__tact")(loc); + } + return ctx.ast.Id(name, loc); + }; + +/* + FunC can parse much more than Fift can handle. For example, _0x0 and _0 are + valid identifiers in FunC, and using either of them compiles and is then + interpreted fine by Fift. But if you use both, FunC still compiles, but Fift crashes. + + Same goes for plain identifiers using hashes # or emojis — you can have one + FunC function with any of those combinations of characters, but you (generally) + cannot have two or more of such functions. +*/ +const reservedFuncIds: Set = new Set([ + "_", + "#include", + "#pragma", + "[", + "]", + "{", + "}", + "?", + ":", + "+", + "-", + "*", + "/%", + "/", + "%", + "~/", + "^/", + "~%", + "^%", + "<=>", + "<=", + "<", + ">=", + ">", + "!=", + "==", + "~>>", + "~", + "^>>", + "^", + "&", + "|", + "<<", + ">>", + "=", + "+=", + "-=", + "*=", + "/=", + "%=", + "~>>=", + "~/=", + "~%=", + "^>>=", + "^/=", + "^%=", + "^=", + "<<=", + ">>=", + "&=", + "|=", + "int", + "cell", + "builder", + "slice", + "cont", + "tuple", + "type", + "->", + "forall", + "return", + "var", + "repeat", + "do", + "while", + "until", + "try", + "catch", + "ifnot", + "if", + "then", + "elseifnot", + "elseif", + "else", + "extern", + "global", + "asm", + "impure", + "inline_ref", + "inline", + "auto_apply", + "method_id", + "operator", + "infixl", + "infixr", + "infix", + "const", +]); + +const parseFuncId = + ({ accessor, id, loc }: $ast.FuncId): Handler => + (ctx) => { + if (reservedFuncIds.has(id)) { + ctx.err.reservedFuncId()(loc); + } + if (id.match(/^-?([0-9]+|0x[0-9a-fA-F]+)$/)) { + ctx.err.numericFuncId()(loc); + } + if (id.startsWith('"') || id.startsWith("{-")) { + ctx.err.invalidFuncId()(loc); + } + return ctx.ast.FuncId((accessor ?? "") + id, loc); + }; + +const baseMap = { + IntegerLiteralBin: 2, + IntegerLiteralOct: 8, + IntegerLiteralDec: 10, + IntegerLiteralHex: 16, +} as const; + +const prefixMap = { + IntegerLiteralBin: "0b", + IntegerLiteralOct: "0o", + IntegerLiteralDec: "", + IntegerLiteralHex: "0x", +} as const; + +const parseIntegerLiteralValue = + ({ $, digits, loc }: $ast.IntegerLiteral["value"]): Handler => + (ctx) => { + if ( + $ === "IntegerLiteralDec" && + digits.startsWith("0") && + digits.includes("_") + ) { + ctx.err.leadingZeroUnderscore()(loc); + } + const value = BigInt(prefixMap[$] + digits.replaceAll("_", "")); + return ctx.ast.Number(baseMap[$], value, loc); + }; + +const parseIntegerLiteral = + ({ value }: $ast.IntegerLiteral): Handler => + (ctx) => { + return parseIntegerLiteralValue(value)(ctx); + }; + +const parseStringLiteral = + ({ value, loc }: $ast.StringLiteral): Handler => + (ctx) => { + return ctx.ast.String(value, loc); + }; + +const parseBoolLiteral = + ({ value, loc }: $ast.BoolLiteral): Handler => + (ctx) => { + return ctx.ast.Boolean(value === "true", loc); + }; + +const parseNull = + ({ loc }: $ast.Null): Handler => + (ctx) => { + return ctx.ast.Null(loc); + }; + +const parseStructFieldInitializer = + ({ + name, + init, + loc, + }: $ast.StructFieldInitializer): Handler => + (ctx) => { + const fieldId = parseId(name)(ctx); + + return ctx.ast.StructFieldInitializer( + fieldId, + init ? parseExpression(init)(ctx) : fieldId, + loc, + ); + }; + +const parseStructInstance = + ({ + type, + fields, + loc, + }: $ast.StructInstance): Handler => + (ctx) => { + return ctx.ast.StructInstance( + parseId(type)(ctx), + map(parseList(fields), parseStructFieldInitializer)(ctx), + loc, + ); + }; + +const parseInitOf = + ({ name, params, loc }: $ast.InitOf): Handler => + (ctx) => { + return ctx.ast.InitOf( + parseId(name)(ctx), + map(parseList(params), parseExpression)(ctx), + loc, + ); + }; + +const parseConditional = + ({ head, tail, loc }: $ast.Conditional): Handler => + (ctx) => { + const condition = parseExpression(head)(ctx); + if (!tail) { + return condition; + } + const { thenBranch, elseBranch } = tail; + return ctx.ast.Conditional( + condition, + parseExpression(thenBranch)(ctx), + parseExpression(elseBranch)(ctx), + loc, + ); + }; + +const parseBinary = + ({ + exprs: { head, tail }, + }: $ast.Binary< + Expression, + A.AstBinaryOperation + >): Handler => + (ctx) => { + return tail.reduce( + ({ child, range }, { op, right }) => { + const merged = $.mergeLoc(range, $.mergeLoc(op.loc, right.loc)); + return { + child: ctx.ast.OpBinary( + op.name, + child, + parseExpression(right)(ctx), + merged, + ), + range: merged, + }; + }, + { child: parseExpression(head)(ctx), range: head.loc }, + ).child; + }; + +const parseUnary = + ({ prefixes, expression }: $ast.Unary): Handler => + (ctx) => { + return prefixes.reduceRight( + ({ child, range }, { name, loc }) => { + const merged = $.mergeLoc(loc, range); + return { + child: ctx.ast.OpUnary(name, child, merged), + range: merged, + }; + }, + { child: parseExpression(expression)(ctx), range: expression.loc }, + ).child; + }; + +type SuffixHandler = Handler< + (child: A.AstExpression, loc: $.Loc) => A.AstExpression +>; + +const parseSuffixUnboxNotNull = + (_: $ast.SuffixUnboxNotNull): SuffixHandler => + (ctx) => + (child, loc) => { + return ctx.ast.OpUnary("!!", child, loc); + }; + +const parseSuffixCall = + ({ params }: $ast.SuffixCall): SuffixHandler => + (ctx) => + (child, loc) => { + const paramsAst = map(parseList(params), parseExpression)(ctx); + if (child.kind === "id") { + return ctx.ast.StaticCall(child, paramsAst, loc); + } else if (child.kind === "field_access") { + return ctx.ast.MethodCall( + child.aggregate, + child.field, + paramsAst, + loc, + ); + } else { + ctx.err.notCallable()(loc); + return ctx.ast.StaticCall( + ctx.ast.Id("__invalid__", loc), + paramsAst, + loc, + ); + } + }; + +const parseSuffixFieldAccess = + ({ name }: $ast.SuffixFieldAccess): SuffixHandler => + (ctx) => + (child, loc) => { + return ctx.ast.FieldAccess(child, parseId(name)(ctx), loc); + }; + +const suffixVisitor: (node: $ast.suffix) => SuffixHandler = + makeVisitor<$ast.suffix>()({ + SuffixUnboxNotNull: parseSuffixUnboxNotNull, + SuffixCall: parseSuffixCall, + SuffixFieldAccess: parseSuffixFieldAccess, + }); + +const parseSuffix = + ({ expression, suffixes }: $ast.Suffix): Handler => + (ctx) => { + return suffixes.reduce( + ({ child, range }, suffix) => { + const merged = $.mergeLoc(range, suffix.loc); + return { + child: suffixVisitor(suffix)(ctx)(child, merged), + range: merged, + }; + }, + { child: parseExpression(expression)(ctx), range: expression.loc }, + ).child; + }; + +const parseParens = ({ child }: $ast.Parens): Handler => { + return parseExpression(child); +}; + +// has to be an interface because of the way TS handles circular type references +interface Binary extends $ast.Binary {} + +type Expression = + | $ast.Conditional + | Binary + | $ast.Unary + | $ast.Suffix + | $ast.Parens + | $ast.StructInstance + | $ast.IntegerLiteral + | $ast.BoolLiteral + | $ast.InitOf + | $ast.Null + | $ast.StringLiteral + | $ast.Id; + +const parseExpression: (input: Expression) => Handler = + makeVisitor()({ + Conditional: parseConditional, + Binary: parseBinary, + Unary: parseUnary, + Suffix: parseSuffix, + Parens: parseParens, + StructInstance: parseStructInstance, + IntegerLiteral: parseIntegerLiteral, + BoolLiteral: parseBoolLiteral, + InitOf: parseInitOf, + Null: parseNull, + StringLiteral: parseStringLiteral, + Id: parseId, + }); + +const parseStatementLet = + ({ + name, + type, + init, + loc, + }: $ast.StatementLet): Handler => + (ctx) => { + return ctx.ast.StatementLet( + parseId(name)(ctx), + type ? parseType(type)(ctx) : null, + parseExpression(init)(ctx), + loc, + ); + }; + +const parsePunnedField = + ({ name }: $ast.PunnedField): Handler<[A.AstId, A.AstId]> => + (ctx) => { + return [parseId(name)(ctx), parseId(name)(ctx)]; + }; + +const parseRegularField = + ({ fieldName, varName }: $ast.RegularField): Handler<[A.AstId, A.AstId]> => + (ctx) => { + return [parseId(fieldName)(ctx), parseId(varName)(ctx)]; + }; + +const parseDestructItem: ( + node: $ast.destructItem, +) => Handler<[A.AstId, A.AstId]> = makeVisitor<$ast.destructItem>()({ + PunnedField: parsePunnedField, + RegularField: parseRegularField, +}); + +const parseStatementDestruct = + ({ + type, + fields, + rest, + init, + loc, + }: $ast.StatementDestruct): Handler => + (ctx) => { + const ids: Map = new Map(); + for (const param of parseList(fields)) { + const pair = parseDestructItem(param)(ctx); + const [field] = pair; + const name = field.text; + if (ids.has(name)) { + ctx.err.duplicateField(name)(param.loc); + } + ids.set(name, pair); + } + + return ctx.ast.StatementDestruct( + parseTypeId(type)(ctx), + ids, + rest.$ === "RestArgument", + parseExpression(init)(ctx), + loc, + ); + }; + +const parseStatementBlock = + (_node: $ast.StatementBlock): Handler => + () => { + // TODO: process StatementBlock + throwInternalCompilerError("Block statements are not supported"); + }; + +const parseStatementReturn = + ({ + expression, + loc, + }: $ast.StatementReturn): Handler => + (ctx) => { + return ctx.ast.StatementReturn( + expression ? parseExpression(expression)(ctx) : null, + loc, + ); + }; + +const parseStatementCondition = + ({ + condition, + trueBranch, + falseBranch, + loc, + }: $ast.StatementCondition): Handler => + (ctx) => { + if (typeof falseBranch === "undefined") { + return ctx.ast.Condition( + parseExpression(condition)(ctx), + parseStatements(trueBranch)(ctx), + null, + null, + loc, + ); + } else if (falseBranch.$ === "FalseBranch") { + return ctx.ast.Condition( + parseExpression(condition)(ctx), + parseStatements(trueBranch)(ctx), + parseStatements(falseBranch.body)(ctx), + null, + loc, + ); + } else { + return ctx.ast.Condition( + parseExpression(condition)(ctx), + parseStatements(trueBranch)(ctx), + null, + parseStatementCondition(falseBranch)(ctx), + loc, + ); + } + }; + +const parseStatementWhile = + ({ + condition, + body, + loc, + }: $ast.StatementWhile): Handler => + (ctx) => { + return ctx.ast.StatementWhile( + parseExpression(condition)(ctx), + parseStatements(body)(ctx), + loc, + ); + }; + +const parseStatementRepeat = + ({ + condition, + body, + loc, + }: $ast.StatementRepeat): Handler => + (ctx) => { + return ctx.ast.StatementRepeat( + parseExpression(condition)(ctx), + parseStatements(body)(ctx), + loc, + ); + }; + +const parseStatementUntil = + ({ + condition, + body, + loc, + }: $ast.StatementUntil): Handler => + (ctx) => { + return ctx.ast.StatementUntil( + parseExpression(condition)(ctx), + parseStatements(body)(ctx), + loc, + ); + }; + +const parseStatementTry = + ({ + body, + handler, + loc, + }: $ast.StatementTry): Handler< + A.AstStatementTry | A.AstStatementTryCatch + > => + (ctx) => { + if (handler) { + return ctx.ast.StatementTryCatch( + parseStatements(body)(ctx), + parseId(handler.name)(ctx), + parseStatements(handler.body)(ctx), + loc, + ); + } else { + return ctx.ast.StatementTry(parseStatements(body)(ctx), loc); + } + }; + +const parseStatementForEach = + ({ + key, + value, + expression, + body, + loc, + }: $ast.StatementForEach): Handler => + (ctx) => { + return ctx.ast.StatementForEach( + parseId(key)(ctx), + parseId(value)(ctx), + parseExpression(expression)(ctx), + parseStatements(body)(ctx), + loc, + ); + }; + +const parseStatementExpression = + ({ + expression, + loc, + }: $ast.StatementExpression): Handler => + (ctx) => { + return ctx.ast.StatementExpression( + parseExpression(expression)(ctx), + loc, + ); + }; + +const parseStatementAssign = + ({ + left, + operator, + right, + loc, + }: $ast.StatementAssign): Handler< + A.AstStatementAssign | A.AstStatementAugmentedAssign + > => + (ctx) => { + if (typeof operator === "undefined") { + return ctx.ast.StatementAssign( + parseExpression(left)(ctx), + parseExpression(right)(ctx), + loc, + ); + } else { + return ctx.ast.StatementAugmentedAssign( + operator, + parseExpression(left)(ctx), + parseExpression(right)(ctx), + loc, + ); + } + }; + +const parseStatement: (node: $ast.statement) => Handler = + makeVisitor<$ast.statement>()({ + StatementLet: parseStatementLet, + StatementDestruct: parseStatementDestruct, + StatementBlock: parseStatementBlock, + StatementReturn: parseStatementReturn, + StatementCondition: parseStatementCondition, + StatementWhile: parseStatementWhile, + StatementRepeat: parseStatementRepeat, + StatementUntil: parseStatementUntil, + StatementTry: parseStatementTry, + StatementForEach: parseStatementForEach, + StatementExpression: parseStatementExpression, + StatementAssign: parseStatementAssign, + }); + +const parseStatements = + (nodes: readonly $ast.statement[]): Handler => + (ctx) => { + return map(nodes, parseStatement)(ctx); + }; + +const parseFunctionAttribute = + (node: $ast.FunctionAttribute): Handler => + (ctx) => { + if (typeof node.name === "string") { + return ctx.ast.FunctionAttribute(node.name, node.loc); + } + + return ctx.ast.FunctionAttributeGet( + node.name.methodId + ? parseExpression(node.name.methodId)(ctx) + : null, + node.loc, + ); + }; + +const checkAttributes = + (kind: "constant" | "function") => + ( + ctx: Context, + isAbstract: boolean, + attributes: readonly ( + | $ast.FunctionAttribute + | $ast.ConstantAttribute + )[], + loc: $.Loc, + ) => { + const { duplicate, tooAbstract, notAbstract } = ctx.err[kind]; + const k: Set = new Set(); + for (const { name, loc } of attributes) { + const type = typeof name === "string" ? name : name.$; + if (k.has(type)) { + duplicate(type)(loc); + } + k.add(type); + } + if (isAbstract && !k.has("abstract")) { + notAbstract()(loc); + } + if (!isAbstract && k.has("abstract")) { + tooAbstract()(loc); + } + }; + +const parseFunctionAttributes = + ( + nodes: readonly $ast.FunctionAttribute[], + isAbstract: boolean, + loc: $.Loc, + ): Handler => + (ctx) => { + checkAttributes("function")(ctx, isAbstract, nodes, loc); + return map(nodes, parseFunctionAttribute)(ctx); + }; + +const parseConstantAttribute = + ({ name, loc }: $ast.ConstantAttribute): Handler => + (ctx) => { + return ctx.ast.ConstantAttribute(name, loc); + }; + +const parseConstantAttributes = + ( + nodes: readonly $ast.ConstantAttribute[], + isAbstract: boolean, + loc: $.Loc, + ): Handler => + (ctx) => { + checkAttributes("constant")(ctx, isAbstract, nodes, loc); + return map(nodes, parseConstantAttribute)(ctx); + }; + +const parseParameter = + ({ name, type, loc }: $ast.Parameter): Handler => + (ctx) => { + return ctx.ast.TypedParameter( + parseId(name)(ctx), + parseType(type)(ctx), + loc, + ); + }; + +const parseTypeId = + ({ name, loc }: $ast.TypeId): Handler => + (ctx) => { + return ctx.ast.TypeId(name, loc); + }; + +const parseTypeOptional = + ({ child, loc }: $ast.TypeOptional): Handler => + (ctx) => { + return ctx.ast.OptionalType(parseTypeId(child)(ctx), loc); + }; + +const parseTypeRegular = + ({ child }: $ast.TypeRegular): Handler => + (ctx) => { + return parseTypeId(child)(ctx); + }; + +const parseTypeMap = + ({ key, keyAs, value, valueAs, loc }: $ast.TypeMap): Handler => + (ctx) => { + return ctx.ast.MapType( + parseTypeId(key)(ctx), + keyAs ? parseId(keyAs)(ctx) : null, + parseTypeId(value)(ctx), + valueAs ? parseId(valueAs)(ctx) : null, + loc, + ); + }; + +const parseTypeBounced = + ({ child, loc }: $ast.TypeBounced): Handler => + (ctx) => { + return ctx.ast.BouncedMessageType(parseTypeId(child)(ctx), loc); + }; + +const parseType: (input: $ast.$type) => Handler = + makeVisitor<$ast.$type>()({ + TypeBounced: parseTypeBounced, + TypeMap: parseTypeMap, + TypeOptional: parseTypeOptional, + TypeRegular: parseTypeRegular, + }); + +const parseFieldDecl = + ({ + name, + as, + type, + expression, + loc, + }: $ast.FieldDecl): Handler => + (ctx) => { + return ctx.ast.FieldDecl( + parseId(name)(ctx), + parseType(type)(ctx), + expression ? parseExpression(expression)(ctx) : null, + as ? parseId(as)(ctx) : null, + loc, + ); + }; + +const parseReceiverReceive = + ({ param, body, loc }: $ast.Receiver): Handler => + (ctx) => { + const selector: A.AstReceiverKind = !param + ? { kind: "internal-fallback" } + : param.$ === "Parameter" + ? { + kind: "internal-simple", + param: parseParameter(param)(ctx), + } + : { + kind: "internal-comment", + comment: parseStringLiteral(param)(ctx), + }; + + return ctx.ast.Receiver(selector, map(body, parseStatement)(ctx), loc); + }; + +const parseReceiverExternal = + ({ param, body, loc }: $ast.Receiver): Handler => + (ctx) => { + const selector: A.AstReceiverKind = !param + ? { kind: "external-fallback" } + : param.$ === "Parameter" + ? { + kind: "external-simple", + param: parseParameter(param)(ctx), + } + : { + kind: "external-comment", + comment: parseStringLiteral(param)(ctx), + }; + + return ctx.ast.Receiver(selector, map(body, parseStatement)(ctx), loc); + }; + +const repairParam: $ast.receiverParam = { + $: "Parameter", + name: { + $: "Id", + name: "__invalid__", + loc: { $: "range", start: 0, end: 0 }, + }, + type: { + $: "TypeRegular", + child: { + $: "TypeId", + name: "__Invalid__", + loc: { $: "range", start: 0, end: 0 }, + }, + loc: { $: "range", start: 0, end: 0 }, + }, + loc: { $: "range", start: 0, end: 0 }, +}; + +const parseReceiverBounced = + ({ param, body, loc }: $ast.Receiver): Handler => + (ctx) => { + if (typeof param === "undefined") { + ctx.err.noBouncedWithoutArg()(loc); + param = repairParam; + } + + if (param.$ === "StringLiteral") { + ctx.err.noBouncedWithString()(loc); + param = repairParam; + } + + const selector: A.AstReceiverKind = { + kind: "bounce", + param: parseParameter(param)(ctx), + }; + + return ctx.ast.Receiver(selector, map(body, parseStatement)(ctx), loc); + }; + +const parserByReceiverType: Record< + $ast.receiverType, + (node: $ast.Receiver) => Handler +> = { + bounced: parseReceiverBounced, + receive: parseReceiverReceive, + external: parseReceiverExternal, +}; + +const parseReceiver = (node: $ast.Receiver): Handler => { + return parserByReceiverType[node.type](node); +}; + +const defaultShuffle = { + args: [], + ret: [], +}; + +const parseAsmShuffle = + (node: $ast.shuffle | undefined): Handler => + (ctx) => { + if (!node) { + return defaultShuffle; + } + + return { + args: map(node.ids, parseId)(ctx), + ret: node.to ? map(node.to, parseIntegerLiteralValue)(ctx) : [], + }; + }; + +const parseAsmFunction = + (node: $ast.AsmFunction): Handler => + (ctx) => { + return ctx.ast.AsmFunctionDef( + parseAsmShuffle(node.shuffle)(ctx), + parseFunctionAttributes(node.attributes, false, node.loc)(ctx), + parseId(node.name)(ctx), + node.returnType ? parseType(node.returnType)(ctx) : null, + map(parseList(node.parameters), parseParameter)(ctx), + [node.instructions.trim()], + node.loc, + ); + }; + +const parseContractInit = + ({ + parameters, + body, + loc, + }: $ast.ContractInit): Handler => + (ctx) => { + return ctx.ast.ContractInit( + map(parseList(parameters), parseParameter)(ctx), + map(body, parseStatement)(ctx), + loc, + ); + }; + +const parseConstantDefInModule = + (node: $ast.Constant): Handler => + (ctx) => { + const result = parseConstantDef(node)(ctx); + const firstAttribute = result.attributes[0]; + if (typeof firstAttribute !== "undefined") { + // FIXME: should be `firstAttribute.loc` + // https://github.com/tact-lang/tact/issues/1255 + ctx.err.topLevelConstantWithAttribute()(node.loc); + result.attributes = []; + } + return result; + }; + +const parseConstantDef = + (node: $ast.Constant): Handler => + (ctx) => { + const result = parseConstant(node)(ctx); + + if (result.kind !== "constant_def") { + ctx.err.noConstantDecl()(node.loc); + return { + ...parseConstant(node)(ctx), + kind: "constant_def", + initializer: ctx.ast.Number(10, 0n, node.loc), + }; + } + + return result; + }; + +const parseConstant = + (node: $ast.Constant): Handler => + (ctx) => { + const name = parseId(node.name)(ctx); + const type = parseType(node.type)(ctx); + + if (node.body.$ === "ConstantDeclaration") { + const attributes = parseConstantAttributes( + node.attributes, + true, + node.loc, + )(ctx); + return ctx.ast.ConstantDecl(attributes, name, type, node.loc); + } else { + const attributes = parseConstantAttributes( + node.attributes, + false, + node.loc, + )(ctx); + const initializer = parseExpression(node.body.expression)(ctx); + return ctx.ast.ConstantDef( + attributes, + name, + type, + initializer, + node.loc, + ); + } + }; + +const parseContract = + ({ + name, + attributes, + traits, + declarations, + loc, + }: $ast.Contract): Handler => + (ctx) => { + return ctx.ast.Contract( + parseId(name)(ctx), + map(parseList(traits), parseId)(ctx), + map(attributes, parseContractAttribute)(ctx), + map(declarations, parseContractItem)(ctx), + loc, + ); + }; + +const parseFunctionDef = + (node: $ast.$Function): Handler => + (ctx) => { + const result = parseFunction(node)(ctx); + + if (result.kind !== "function_def") { + ctx.err.noFunctionDecl()(node.loc); + return { + ...parseFunction(node)(ctx), + kind: "function_def", + statements: [], + }; + } + + return result; + }; + +const parseFunction = + (node: $ast.$Function): Handler => + (ctx) => { + const name = parseId(node.name)(ctx); + const returnType = node.returnType + ? parseType(node.returnType)(ctx) + : null; + const parameters = map(parseList(node.parameters), parseParameter)(ctx); + + if (node.body.$ === "FunctionDeclaration") { + const attributes = parseFunctionAttributes( + node.attributes, + true, + node.loc, + )(ctx); + return ctx.ast.FunctionDecl( + attributes, + name, + returnType, + parameters, + node.loc, + ); + } else { + const attributes = parseFunctionAttributes( + node.attributes, + false, + node.loc, + )(ctx); + const statements = map(node.body.body, parseStatement)(ctx); + return ctx.ast.FunctionDef( + attributes, + name, + returnType, + parameters, + statements, + node.loc, + ); + } + }; + +const parseMessageDecl = + ({ + name, + opcode, + fields, + loc, + }: $ast.MessageDecl): Handler => + (ctx) => { + return ctx.ast.MessageDecl( + parseId(name)(ctx), + opcode ? parseExpression(opcode)(ctx) : null, + map(parseList(fields), parseFieldDecl)(ctx), + loc, + ); + }; + +const parseNativeFunctionDecl = + ({ + name, + attributes, + nativeName, + parameters, + returnType, + loc, + }: $ast.NativeFunctionDecl): Handler => + (ctx) => { + return ctx.ast.NativeFunctionDecl( + map(attributes, parseFunctionAttribute)(ctx), + parseId(name)(ctx), + parseFuncId(nativeName)(ctx), + map(parseList(parameters), parseParameter)(ctx), + returnType ? parseType(returnType)(ctx) : null, + loc, + ); + }; + +const parsePrimitiveTypeDecl = + ({ name, loc }: $ast.PrimitiveTypeDecl): Handler => + (ctx) => { + return ctx.ast.PrimitiveTypeDecl(parseId(name)(ctx), loc); + }; + +const parseStructDecl = + ({ name, fields, loc }: $ast.StructDecl): Handler => + (ctx) => { + return ctx.ast.StructDecl( + parseId(name)(ctx), + map(parseList(fields), parseFieldDecl)(ctx), + loc, + ); + }; + +const parseContractAttribute = + ({ name, loc }: $ast.ContractAttribute): Handler => + (ctx) => { + return ctx.ast.ContractAttribute(parseStringLiteral(name)(ctx), loc); + }; + +const parseTrait = + ({ + name, + traits, + attributes, + declarations, + loc, + }: $ast.Trait): Handler => + (ctx) => { + return ctx.ast.Trait( + parseId(name)(ctx), + traits ? map(parseList(traits), parseId)(ctx) : [], + map(attributes, parseContractAttribute)(ctx), + map(declarations, parseTraitItem)(ctx), + loc, + ); + }; + +const parseContractItem: ( + input: $ast.contractItemDecl, +) => Handler = makeVisitor<$ast.contractItemDecl>()({ + ContractInit: parseContractInit, + FieldDecl: parseFieldDecl, + Receiver: parseReceiver, + Function: parseFunctionDef, + Constant: parseConstantDef, +}); + +const parseTraitItem: ( + input: $ast.traitItemDecl, +) => Handler = makeVisitor<$ast.traitItemDecl>()({ + FieldDecl: parseFieldDecl, + Receiver: parseReceiver, + Function: parseFunction, + Constant: parseConstant, +}); + +const parseModuleItem: (input: $ast.moduleItem) => Handler = + makeVisitor<$ast.moduleItem>()({ + PrimitiveTypeDecl: parsePrimitiveTypeDecl, + Function: parseFunctionDef, + AsmFunction: parseAsmFunction, + NativeFunctionDecl: parseNativeFunctionDecl, + Constant: parseConstantDefInModule, + StructDecl: parseStructDecl, + MessageDecl: parseMessageDecl, + Contract: parseContract, + Trait: parseTrait, + }); + +const parseImport = + ({ path, loc }: $ast.Import): Handler => + (ctx) => { + if (path.value.includes("\\")) { + ctx.err.importWithBackslash()(loc); + path = { ...path, value: path.value.replace(/\\/g, "/") }; + } + + return ctx.ast.Import(parseStringLiteral(path)(ctx), loc); + }; + +const parseModule = + ({ imports, items }: $ast.Module): Handler => + (ctx) => { + return ctx.ast.Module( + map(imports, parseImport)(ctx), + map(items, parseModuleItem)(ctx), + ); + }; + +const parseJustImports = + ({ imports }: $ast.JustImports): Handler => + (ctx) => { + return map(imports, parseImport)(ctx); + }; + +export const getParser = (ast: A.FactoryAst) => { + const display = displayToString; + + const doParse = ( + grammar: $.Parser, + handler: (t: T) => Handler, + src: string, + path: string, + origin: ItemOrigin, + ) => { + const locationToSrcInfo = (loc: $.Loc) => { + if (loc.$ === "range") { + return getSrcInfo(src, loc.start, loc.end, path, origin); + } else { + console.error("Invalid range"); + return getSrcInfo(src, loc.at, loc.at, path, origin); + } + }; + + const err = syntaxErrorSchema( + display, + (message: string) => (source: $.Loc) => { + const srcInfo = locationToSrcInfo(source); + throw new TactCompilationError( + display.at(srcInfo, message), + srcInfo, + ); + }, + ); + + const result = $.parse({ + grammar, + space: G.space, + text: src, + }); + if (result.$ === "error") { + const { expected, position } = result.error; + return err.expected(expected)({ + $: "range", + start: position, + end: position, + }); + } + const ctx = { + ast: getAstSchema(ast, locationToSrcInfo), + err, + }; + return handler(result.value)(ctx); + }; + + return { + parse: (src: string, path: string, origin: ItemOrigin): A.AstModule => { + return doParse(G.Module, parseModule, src, path, origin); + }, + parseExpression: (src: string): A.AstExpression => { + return doParse( + G.expression, + parseExpression, + src, + "", + "user", + ); + }, + parseImports: ( + src: string, + path: string, + origin: ItemOrigin, + ): A.AstImport[] => { + return doParse(G.JustImports, parseJustImports, src, path, origin); + }, + }; +}; diff --git a/src/grammar/parser-error.ts b/src/grammar/parser-error.ts index 3b258f1fb..ebd73847f 100644 --- a/src/grammar/parser-error.ts +++ b/src/grammar/parser-error.ts @@ -1,7 +1,4 @@ -import { MatchResult } from "ohm-js"; import { ErrorDisplay } from "../error/display"; -import { TactCompilationError } from "../errors"; -import { getSrcInfoFromOhm, ItemOrigin, SrcInfo } from "./src-info"; const attributeSchema = (name: string) => @@ -23,7 +20,23 @@ const attributeSchema = }, }); -const syntaxErrorSchema = ( +const getExpectedText = (expected: ReadonlySet) => { + const result: string[] = []; + const failures = [...expected].sort(); + for (const [idx, failure] of failures.entries()) { + if (idx > 0) { + if (idx === failures.length - 1) { + result.push(failures.length > 2 ? ", or " : " or "); + } else { + result.push(", "); + } + } + result.push(failure); + } + return result.join(""); +}; + +export const syntaxErrorSchema = ( display: ErrorDisplay, handle: (t: T) => U, ) => { @@ -48,26 +61,50 @@ const syntaxErrorSchema = ( duplicateField: (name: string) => { return handle(text(`Duplicate field destructuring: "${name}"`)); }, + restShouldBeLast: () => { + return handle(text(`Rest parameter should be last`)); + }, importWithBackslash: () => { return handle(sub`Import path can't contain "\\"`); }, reservedVarPrefix: (prefix: string) => { return handle(text(`Variable name cannot start with "${prefix}"`)); }, + notCallable: () => { + return handle(sub`Expression is not callable`); + }, + noBouncedWithoutArg: () => { + return handle(sub`bounced() cannot be used as fallback`); + }, + noBouncedWithString: () => { + return handle( + sub`bounced() cannot be used with a string literal name`, + ); + }, + noConstantDecl: () => { + return handle(sub`Constant definition requires an initializer`); + }, + noFunctionDecl: () => { + return handle(sub`Only full function definitions are allowed here`); + }, + expected: (expects: ReadonlySet) => { + return handle(text(`Expected ${getExpectedText(expects)}`)); + }, + invalidFuncId: () => { + return handle(sub`Invalid FunC identifier`); + }, + reservedFuncId: () => { + return handle(sub`Reserved FunC identifier`); + }, + numericFuncId: () => { + return handle(sub`FunC identifier cannot be a number`); + }, + leadingZeroUnderscore: () => { + return handle( + sub`Numbers with leading zeroes cannot use underscores for JS compatibility`, + ); + }, }; }; -export const parserErrorSchema = (display: ErrorDisplay) => ({ - ...syntaxErrorSchema(display, (message) => (source: SrcInfo) => { - throw new TactCompilationError(display.at(source, message), source); - }), - generic: (matchResult: MatchResult, path: string, origin: ItemOrigin) => { - const interval = matchResult.getInterval(); - const source = getSrcInfoFromOhm(interval, path, origin); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const message = `Expected ${(matchResult as any).getExpectedText()}\n`; - throw new TactCompilationError(display.at(source, message), source); - }, -}); - -export type ParserErrors = ReturnType; +export type SyntaxErrors = ReturnType>; diff --git a/src/grammar/__snapshots__/grammar.spec.ts.snap b/src/grammar/prev/__snapshots__/grammar.spec.ts.snap similarity index 99% rename from src/grammar/__snapshots__/grammar.spec.ts.snap rename to src/grammar/prev/__snapshots__/grammar.spec.ts.snap index 7a65aa252..4de0df7de 100644 --- a/src/grammar/__snapshots__/grammar.spec.ts.snap +++ b/src/grammar/prev/__snapshots__/grammar.spec.ts.snap @@ -647,16 +647,6 @@ Line 3, col 5: " `; -exports[`grammar should fail items-asm-fun-6 1`] = ` -":2:5: Bitstring has more than 128 digits -Line 2, col 5: - 1 | asm fun giganticBinary() { -> 2 | b{000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110} - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 3 | } -" -`; - exports[`grammar should fail literal-dec-trailing-underscore 1`] = ` ":2:16: Expected a digit diff --git a/src/grammar/grammar.ohm b/src/grammar/prev/grammar.ohm similarity index 100% rename from src/grammar/grammar.ohm rename to src/grammar/prev/grammar.ohm diff --git a/src/grammar/prev/grammar.spec.ts b/src/grammar/prev/grammar.spec.ts new file mode 100644 index 000000000..02f4e003b --- /dev/null +++ b/src/grammar/prev/grammar.spec.ts @@ -0,0 +1,29 @@ +import { getAstFactory } from "../ast"; +import { loadCases } from "../../utils/loadCases"; +import { getParser } from "../grammar"; +import { SrcInfo, isSrcInfo } from "../src-info"; + +expect.addSnapshotSerializer({ + test: (src) => isSrcInfo(src), + print: (src) => (src as SrcInfo).contents, +}); + +describe("grammar", () => { + for (const r of loadCases(__dirname + "/../test/")) { + it("should parse " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast, "old"); + expect(parse(r.code, "", "user")).toMatchSnapshot(); + }); + } + + for (const r of loadCases(__dirname + "/../test-failed/")) { + it("should fail " + r.name, () => { + const ast = getAstFactory(); + const { parse } = getParser(ast, "old"); + expect(() => + parse(r.code, "", "user"), + ).toThrowErrorMatchingSnapshot(); + }); + } +}); diff --git a/src/grammar/prev/grammar.ts b/src/grammar/prev/grammar.ts new file mode 100644 index 000000000..4964f03ce --- /dev/null +++ b/src/grammar/prev/grammar.ts @@ -0,0 +1,1566 @@ +import { Node, IterationNode, NonterminalNode } from "ohm-js"; +import tactGrammar from "./grammar.ohm-bundle"; +import { throwInternalCompilerError } from "../../errors"; +import { + AstAugmentedAssignOperation, + AstConstantAttribute, + AstContractAttribute, + AstExpression, + AstFunctionAttribute, + AstNode, + AstModule, + AstReceiverKind, + AstString, + AstType, + AstImport, + AstConstantDef, + AstNumberBase, + AstId, + FactoryAst, +} from "../ast"; +import { ItemOrigin, SrcInfo } from "../src-info"; +import { displayToString } from "../../error/display-to-string"; +import { ParserErrors, parserErrorSchema } from "./parser-error"; +import { getSrcInfoFromOhm } from "./src-info"; + +type Context = { + origin: ItemOrigin | null; + currentFile: string | null; + createNode: FactoryAst["createNode"] | null; + errorTypes: ParserErrors | null; +}; + +const defaultContext: Context = Object.freeze({ + createNode: null, + currentFile: null, + origin: null, + errorTypes: null, +}); + +let context: Context = defaultContext; + +const withContext = (ctx: Context, callback: () => T): T => { + try { + context = ctx; + return callback(); + } finally { + context = defaultContext; + } +}; + +function createRef(s: Node): SrcInfo { + if (context.origin === null) { + throwInternalCompilerError("Parser context was not initialized"); + } + + return getSrcInfoFromOhm(s.source, context.currentFile, context.origin); +} + +const createNode: FactoryAst["createNode"] = (...args) => { + if (context.createNode === null) { + throwInternalCompilerError("Parser context was not initialized"); + } + + return context.createNode(...args); +}; + +const err = () => { + if (context.errorTypes === null) { + throwInternalCompilerError("Parser context was not initialized"); + } + + return context.errorTypes; +}; + +// helper to unwrap optional grammar elements (marked with "?") +// ohm-js represents those essentially as lists (IterationNodes) +function unwrapOptNode( + optional: IterationNode, + f: (n: Node) => T, +): T | null { + const optNode = optional.children[0] as Node | undefined; + return optNode !== undefined ? f(optNode) : null; +} + +function checkVariableName(name: string, loc: SrcInfo) { + if (name.startsWith("__gen")) { + err().reservedVarPrefix("__gen")(loc); + } + if (name.startsWith("__tact")) { + err().reservedVarPrefix("__tact")(loc); + } +} + +const checkAttributes = + (kind: "constant" | "function") => + ( + isAbstract: boolean, + attributes: (AstConstantAttribute | AstFunctionAttribute)[], + loc: SrcInfo, + ) => { + const { duplicate, tooAbstract, notAbstract } = err()[kind]; + const k: Set = new Set(); + for (const a of attributes) { + if (k.has(a.type)) { + duplicate(a.type)(a.loc); + } + k.add(a.type); + } + if (isAbstract && !k.has("abstract")) { + notAbstract()(loc); + } + if (!isAbstract && k.has("abstract")) { + tooAbstract()(loc); + } + }; + +const checkConstAttributes = checkAttributes("constant"); + +const checkFunctionAttributes = checkAttributes("function"); + +const semantics = tactGrammar.createSemantics(); + +semantics.addOperation("astOfModule", { + Module(imports, items) { + return createNode({ + kind: "module", + imports: imports.children.map((item) => item.astOfImport()), + items: items.children.map((item) => item.astOfModuleItem()), + }); + }, +}); + +semantics.addOperation("astOfImport", { + Import(_importKwd, path, _semicolon) { + const pathAST = path.astOfExpression() as AstString; + if (pathAST.value.includes("\\")) { + err().importWithBackslash()(createRef(path)); + } + return createNode({ + kind: "import", + path: pathAST, + loc: createRef(this), + }); + }, +}); + +semantics.addOperation("astOfJustImports", { + JustImports(imports, _restOfInput) { + return imports.children.map((item) => item.astOfImport()); + }, +}); + +semantics.addOperation("astOfModuleItem", { + PrimitiveTypeDecl(_primitive_kwd, typeId, _semicolon) { + checkVariableName(typeId.sourceString, createRef(typeId)); + return createNode({ + kind: "primitive_type_decl", + name: typeId.astOfType(), + loc: createRef(this), + }); + }, + NativeFunctionDecl( + _name, + _lparen1, + funcId, + _rparen1, + funAttributes, + _nativeKwd, + tactId, + params, + _optColon, + optReturnType, + _semicolon, + ) { + checkVariableName(tactId.sourceString, createRef(tactId)); + return createNode({ + kind: "native_function_decl", + attributes: funAttributes.children.map((a) => + a.astOfFunctionAttributes(), + ), + name: tactId.astOfExpression(), + nativeName: funcId.astOfExpression(), + return: unwrapOptNode(optReturnType, (t) => t.astOfType()), + params: params.astsOfList(), + loc: createRef(this), + }); + }, + StructDecl_regular(_structKwd, typeId, _lbrace, fields, _rbrace) { + checkVariableName(typeId.sourceString, createRef(typeId)); + return createNode({ + kind: "struct_decl", + name: typeId.astOfType(), + fields: fields.astsOfList(), + loc: createRef(this), + }); + }, + StructDecl_message( + _messageKwd, + _optLparen, + optIntMsgId, + _optRparen, + typeId, + _lbrace, + fields, + _rbrace, + ) { + checkVariableName(typeId.sourceString, createRef(typeId)); + return createNode({ + kind: "message_decl", + name: typeId.astOfType(), + fields: fields.astsOfList(), + opcode: unwrapOptNode(optIntMsgId, (msgId) => + msgId.astOfExpression(), + ), + loc: createRef(this), + }); + }, + Contract( + attributes, + _contractKwd, + contractId, + _optWithKwd, + optInheritedTraits, + _lbrace, + contractItems, + _rbrace, + ) { + checkVariableName(contractId.sourceString, createRef(contractId)); + return createNode({ + kind: "contract", + name: contractId.astOfExpression(), + attributes: attributes.children.map((ca) => + ca.astOfContractAttributes(), + ), + declarations: contractItems.children.map((item) => + item.astOfItem(), + ), + traits: optInheritedTraits.children[0]?.astsOfList() ?? [], + loc: createRef(this), + }); + }, + Trait( + attributes, + _traitKwd, + traitId, + _optWithKwd, + optInheritedTraits, + _lbrace, + traitItems, + _rbrace, + ) { + checkVariableName(traitId.sourceString, createRef(traitId)); + return createNode({ + kind: "trait", + name: traitId.astOfExpression(), + attributes: attributes.children.map((ca) => + ca.astOfContractAttributes(), + ), + declarations: traitItems.children.map((item) => item.astOfItem()), + traits: optInheritedTraits.children[0]?.astsOfList() ?? [], + loc: createRef(this), + }); + }, + ModuleFunction(fun) { + return fun.astOfItem(); + }, + ModuleConstant(constant) { + const astConstDef: AstConstantDef = constant.astOfItem(); + if (astConstDef.attributes.length !== 0) { + err().topLevelConstantWithAttribute()( + astConstDef.attributes[0]!.loc, + ); + } + return astConstDef; + }, +}); + +// top-level (module-level), contract or trait items: +// constant declarations/definitions, functions, receivers, +// getters, etc. +semantics.addOperation("astOfItem", { + ConstantDefinition( + constAttributes, + _constKwd, + constId, + _colon, + constType, + _equals, + initExpr, + _semicolon, + ) { + const attributes = constAttributes.children.map((a) => + a.astOfConstAttribute(), + ) as AstConstantAttribute[]; + checkConstAttributes(false, attributes, createRef(this)); + return createNode({ + kind: "constant_def", + name: constId.astOfExpression(), + type: constType.astOfType(), + initializer: initExpr.astOfExpression(), + attributes, + loc: createRef(this), + }); + }, + ConstantDeclaration( + constAttributes, + _constKwd, + constId, + _colon, + constType, + _semicolon, + ) { + const attributes = constAttributes.children.map((a) => + a.astOfConstAttribute(), + ) as AstConstantAttribute[]; + checkConstAttributes(true, attributes, createRef(this)); + return createNode({ + kind: "constant_decl", + name: constId.astOfExpression(), + type: constType.astOfType(), + attributes, + loc: createRef(this), + }); + }, + StorageVar(fieldDecl, _semicolon) { + return fieldDecl.astOfDeclaration(); + }, + FunctionDefinition( + funAttributes, + _funKwd, + funId, + funParameters, + _optColon, + optReturnType, + _lbrace, + funBody, + _rbrace, + ) { + const attributes = funAttributes.children.map((a) => + a.astOfFunctionAttributes(), + ) as AstFunctionAttribute[]; + checkVariableName(funId.sourceString, createRef(funId)); + checkFunctionAttributes(false, attributes, createRef(this)); + return createNode({ + kind: "function_def", + attributes, + name: funId.astOfExpression(), + return: unwrapOptNode(optReturnType, (t) => t.astOfType()), + params: funParameters.astsOfList(), + statements: funBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + AsmFunction( + _asmKwd, + optAsmShuffle, + funAttributes, + _funKwd, + funId, + funParameters, + _optColon, + optReturnType, + _lbrace, + asmInstructions, + _rbrace, + ) { + const shuffle = optAsmShuffle.children[0]?.astsOfAsmShuffle() ?? { + args: [], + ret: [], + }; + const attributes = funAttributes.children.map((a) => + a.astOfFunctionAttributes(), + ) as AstFunctionAttribute[]; + checkVariableName(funId.sourceString, createRef(funId)); + checkFunctionAttributes(false, attributes, createRef(this)); + return createNode({ + kind: "asm_function_def", + shuffle, + attributes, + name: funId.astOfExpression(), + return: unwrapOptNode(optReturnType, (t) => t.astOfType()), + params: funParameters.astsOfList(), + instructions: asmInstructions.children.map((s) => + s.astOfAsmInstruction(), + ), + loc: createRef(this), + }); + }, + FunctionDeclaration( + funAttributes, + _funKwd, + funId, + funParameters, + _optColon, + optReturnType, + _semicolon, + ) { + const attributes = funAttributes.children.map((a) => + a.astOfFunctionAttributes(), + ) as AstFunctionAttribute[]; + checkVariableName(funId.sourceString, createRef(funId)); + checkFunctionAttributes(true, attributes, createRef(this)); + return createNode({ + kind: "function_decl", + attributes, + name: funId.astOfExpression(), + return: unwrapOptNode(optReturnType, (t) => t.astOfType()), + params: funParameters.astsOfList(), + loc: createRef(this), + }); + }, + ContractInit(_initKwd, initParameters, _lbrace, initBody, _rbrace) { + return createNode({ + kind: "contract_init", + params: initParameters.astsOfList(), + statements: initBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + Receiver_regular( + _receiveKwd, + _lparen, + optParameter, + _rparen, + _lbrace, + receiverBody, + _rbrace, + ) { + const optParam = optParameter.children[0] as Node | undefined; + const selector: AstReceiverKind = optParam + ? { + kind: "internal-simple", + param: optParam.astOfDeclaration(), + } + : { kind: "internal-fallback" }; + return createNode({ + kind: "receiver", + selector, + statements: receiverBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + Receiver_comment( + _receiveKwd, + _lparen, + comment, + _rparen, + _lbrace, + receiverBody, + _rbrace, + ) { + return createNode({ + kind: "receiver", + selector: { + kind: "internal-comment", + comment: comment.astOfExpression(), + }, + statements: receiverBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + Receiver_bounced( + _bouncedKwd, + _lparen, + parameter, + _rparen, + _lbrace, + receiverBody, + _rbrace, + ) { + return createNode({ + kind: "receiver", + selector: { kind: "bounce", param: parameter.astOfDeclaration() }, + statements: receiverBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + Receiver_externalRegular( + _externalKwd, + _lparen, + optParameter, + _rparen, + _lbrace, + receiverBody, + _rbrace, + ) { + const optParam = optParameter.children[0] as Node | undefined; + const selector: AstReceiverKind = optParam + ? { + kind: "external-simple", + param: optParam.astOfDeclaration(), + } + : { kind: "external-fallback" }; + return createNode({ + kind: "receiver", + selector, + statements: receiverBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + Receiver_externalComment( + _externalKwd, + _lparen, + comment, + _rparen, + _lbrace, + receiverBody, + _rbrace, + ) { + return createNode({ + kind: "receiver", + selector: { + kind: "external-comment", + comment: comment.astOfExpression(), + }, + statements: receiverBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, +}); + +// Beginnings of the possible future AST for Fift-asm +semantics.addOperation("astOfAsmInstruction", { + asmInstruction(word) { + return word.sourceString; + }, + AsmInstruction(instruction) { + return instruction.astOfAsmInstruction(); + }, + AsmInstruction_custom(instruction) { + return instruction.astOfAsmInstruction(); + }, + AsmInstruction_internal( + _leftBracket, + _ws1, + instructions, + _rightBracket, + _ws2, + ) { + return [ + "[", + instructions.children.map((s) => s.astOfAsmInstruction()).join(" "), + "]", + ].join(" "); + }, + AsmInstruction_list(_lbrace, _ws1, instructions, _rbrace, _ws2) { + return [ + "{", + instructions.children.map((s) => s.astOfAsmInstruction()).join(" "), + "}", + ].join(" "); + }, + AsmInstruction_listNoStateCheck( + _lbrace, + _ws1, + instructions, + _rbrace, + _ws2, + ) { + return [ + "({)", + instructions.children.map((s) => s.astOfAsmInstruction()).join(" "), + "(})", + ].join(" "); + }, + AsmInstruction_string( + startQuotationMarkWord, + string, + _endQuotationMark, + _ws, + ) { + return `${startQuotationMarkWord.sourceString}${string.sourceString}"`; + }, + AsmInstruction_tick(_singleQuote, _ws1, instruction) { + return `' ${instruction.sourceString}`; + }, + AsmInstruction_char(_word, _ws1, char, _ws2) { + return `char ${char.sourceString}`; + }, + AsmInstruction_hexLiteral(prefix, digits, optUnderscore, _rbrace, _ws) { + const length = digits.numChildren; + const underscore = unwrapOptNode(optUnderscore, (t) => t.sourceString); + if (length > 128) { + err().literalTooLong()(createRef(this)); + } + return `${prefix.sourceString}${digits.sourceString}${underscore ?? ""}}`; + }, + AsmInstruction_binLiteral(_prefix, digits, _rbrace, _ws) { + const length = digits.numChildren; + if (length > 128) { + err().literalTooLong()(createRef(this)); + } + return `b{${digits.sourceString}}`; + }, +}); + +semantics.addOperation("astOfFunctionAttributes", { + FunctionAttribute_getter(_getKwd, _optLparen, optMethodId, _optRparen) { + return { + kind: "function_attribute", + type: "get", + methodId: unwrapOptNode(optMethodId, (e) => e.astOfExpression()), + loc: createRef(this), + }; + }, + FunctionAttribute_extends(_) { + return { + kind: "function_attribute", + type: "extends", + loc: createRef(this), + }; + }, + FunctionAttribute_mutates(_) { + return { + kind: "function_attribute", + type: "mutates", + loc: createRef(this), + }; + }, + FunctionAttribute_override(_) { + return { + kind: "function_attribute", + type: "override", + loc: createRef(this), + }; + }, + FunctionAttribute_inline(_) { + return { + kind: "function_attribute", + type: "inline", + loc: createRef(this), + }; + }, + FunctionAttribute_virtual(_) { + return { + kind: "function_attribute", + type: "virtual", + loc: createRef(this), + }; + }, + FunctionAttribute_abstract(_) { + return { + kind: "function_attribute", + type: "abstract", + loc: createRef(this), + }; + }, +}); + +semantics.addOperation<{ args: AstNode[]; ret: AstNode[] }>( + "astsOfAsmShuffle", + { + AsmShuffle(_lparen, argsShuffle, _optArrow, optRetShuffle, _rparen) { + return { + args: argsShuffle.children.map((id) => id.astOfExpression()), + ret: + optRetShuffle.children[0]?.children.map((num) => + num.astOfExpression(), + ) ?? [], + }; + }, + }, +); + +semantics.addOperation("astOfConstAttribute", { + ConstantAttribute_override(_) { + return { type: "override", loc: createRef(this) }; + }, + ConstantAttribute_virtual(_) { + return { type: "virtual", loc: createRef(this) }; + }, + ConstantAttribute_abstract(_) { + return { type: "abstract", loc: createRef(this) }; + }, +}); + +semantics.addOperation("astsOfList", { + InheritedTraits(traits, _optTrailingComma) { + return traits + .asIteration() + .children.map((id, _comma) => id.astOfExpression()); + }, + StructFields(fields, _optSemicolon) { + return fields + .asIteration() + .children.map((field, _semicolon) => field.astOfDeclaration()); + }, + Parameters(_lparen, params, optTrailingComma, _rparen) { + if ( + params.source.contents === "" && + optTrailingComma.sourceString === "," + ) { + err().extraneousComma()(createRef(optTrailingComma)); + } + return params.asIteration().children.map((p) => p.astOfDeclaration()); + }, + Arguments(_lparen, args, optTrailingComma, _rparen) { + if ( + args.source.contents === "" && + optTrailingComma.sourceString === "," + ) { + err().extraneousComma()(createRef(optTrailingComma)); + } + return args.asIteration().children.map((arg) => arg.astOfExpression()); + }, +}); + +semantics.addOperation("astOfContractAttributes", { + ContractAttribute_interface(_interface, _lparen, interfaceName, _rparen) { + return { + type: "interface", + name: interfaceName.astOfExpression(), + loc: createRef(this), + }; + }, +}); + +semantics.addOperation("astOfDeclaration", { + FieldDecl( + id, + _colon, + type, + _optAs, + optStorageType, + _optEq, + optInitializer, + ) { + return createNode({ + kind: "field_decl", + name: id.astOfExpression(), + type: type.astOfType() as AstType, + as: unwrapOptNode(optStorageType, (t) => t.astOfExpression()), + initializer: unwrapOptNode(optInitializer, (e) => + e.astOfExpression(), + ), + loc: createRef(this), + }); + }, + Parameter(id, _colon, type) { + checkVariableName(id.sourceString, createRef(id)); + return createNode({ + kind: "typed_parameter", + name: id.astOfExpression(), + type: type.astOfType(), + loc: createRef(this), + }); + }, + StructFieldInitializer_full(fieldId, _colon, initializer) { + return createNode({ + kind: "struct_field_initializer", + field: fieldId.astOfExpression(), + initializer: initializer.astOfExpression(), + loc: createRef(this), + }); + }, + StructFieldInitializer_punned(fieldId) { + return createNode({ + kind: "struct_field_initializer", + field: fieldId.astOfExpression(), + initializer: fieldId.astOfExpression(), + loc: createRef(this), + }); + }, +}); + +// Statements +semantics.addOperation("astOfStatement", { + // TODO: process StatementBlock + + StatementLet( + _letKwd, + id, + _optColon, + optType, + _equals, + expression, + _optSemicolonIfLastStmtInBlock, + ) { + checkVariableName(id.sourceString, createRef(id)); + + return createNode({ + kind: "statement_let", + name: id.astOfExpression(), + type: unwrapOptNode(optType, (t) => t.astOfType()), + expression: expression.astOfExpression(), + loc: createRef(this), + }); + }, + StatementReturn(_returnKwd, optExpression, _optSemicolonIfLastStmtInBlock) { + return createNode({ + kind: "statement_return", + expression: unwrapOptNode(optExpression, (e) => + e.astOfExpression(), + ), + loc: createRef(this), + }); + }, + StatementExpression(expression, _optSemicolonIfLastStmtInBlock) { + return createNode({ + kind: "statement_expression", + expression: expression.astOfExpression(), + loc: createRef(this), + }); + }, + StatementAssign( + lvalue, + operator, + expression, + _optSemicolonIfLastStmtInBlock, + ) { + if (operator.sourceString === "=") { + return createNode({ + kind: "statement_assign", + path: lvalue.astOfExpression(), + expression: expression.astOfExpression(), + loc: createRef(this), + }); + } else { + let op: AstAugmentedAssignOperation; + switch (operator.sourceString) { + case "+=": + op = "+"; + break; + case "-=": + op = "-"; + break; + case "*=": + op = "*"; + break; + case "/=": + op = "/"; + break; + case "%=": + op = "%"; + break; + case "|=": + op = "|"; + break; + case "&=": + op = "&"; + break; + case "^=": + op = "^"; + break; + case "||=": + op = "||"; + break; + case "&&=": + op = "&&"; + break; + case "<<=": + op = "<<"; + break; + case ">>=": + op = ">>"; + break; + default: + throwInternalCompilerError( + "Unreachable augmented assignment operator.", + ); + } + return createNode({ + kind: "statement_augmentedassign", + path: lvalue.astOfExpression(), + op, + expression: expression.astOfExpression(), + loc: createRef(this), + }); + } + }, + StatementCondition_noElse(_ifKwd, condition, _lbrace, thenBlock, _rbrace) { + return createNode({ + kind: "statement_condition", + condition: condition.astOfExpression(), + trueStatements: thenBlock.children.map((s) => s.astOfStatement()), + falseStatements: null, + elseif: null, + loc: createRef(this), + }); + }, + StatementCondition_withElse( + _ifKwd, + condition, + _lbraceThen, + thenBlock, + _rbraceThen, + _elseKwd, + _lbraceElse, + elseBlock, + _rbraceElse, + ) { + return createNode({ + kind: "statement_condition", + condition: condition.astOfExpression(), + trueStatements: thenBlock.children.map((s) => s.astOfStatement()), + falseStatements: elseBlock.children.map((s) => s.astOfStatement()), + elseif: null, + loc: createRef(this), + }); + }, + StatementCondition_withElseIf( + _ifKwd, + condition, + _lbraceThen, + thenBlock, + _rbraceThen, + _elseKwd, + elseifClause, + ) { + return createNode({ + kind: "statement_condition", + condition: condition.astOfExpression(), + trueStatements: thenBlock.children.map((s) => s.astOfStatement()), + falseStatements: null, + elseif: elseifClause.astOfStatement(), + loc: createRef(this), + }); + }, + StatementWhile( + _whileKwd, + _lparen, + condition, + _rparen, + _lbrace, + loopBody, + _rbrace, + ) { + return createNode({ + kind: "statement_while", + condition: condition.astOfExpression(), + statements: loopBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + StatementRepeat( + _repeatKwd, + _lparen, + iterations, + _rparen, + _lbrace, + loopBody, + _rbrace, + ) { + return createNode({ + kind: "statement_repeat", + iterations: iterations.astOfExpression(), + statements: loopBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + StatementUntil( + _doKwd, + _lbrace, + loopBody, + _rbrace, + _untilKwd, + _lparen, + condition, + _rparen, + _optSemicolonIfLastStmtInBlock, + ) { + return createNode({ + kind: "statement_until", + condition: condition.astOfExpression(), + statements: loopBody.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + StatementTry_noCatch(_tryKwd, _lbraceTry, tryBlock, _rbraceTry) { + return createNode({ + kind: "statement_try", + statements: tryBlock.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + StatementTry_withCatch( + _tryKwd, + _lbraceTry, + tryBlock, + _rbraceTry, + _catchKwd, + _lparen, + exitCodeId, + _rparen, + _lbraceCatch, + catchBlock, + _rbraceCatch, + ) { + return createNode({ + kind: "statement_try_catch", + statements: tryBlock.children.map((s) => s.astOfStatement()), + catchName: exitCodeId.astOfExpression(), + catchStatements: catchBlock.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + StatementForEach( + _foreachKwd, + _lparen, + keyId, + _comma, + valueId, + _inKwd, + mapId, + _rparen, + _lbrace, + foreachBlock, + _rbrace, + ) { + checkVariableName(keyId.sourceString, createRef(keyId)); + checkVariableName(valueId.sourceString, createRef(valueId)); + return createNode({ + kind: "statement_foreach", + keyName: keyId.astOfExpression(), + valueName: valueId.astOfExpression(), + map: mapId.astOfExpression(), + statements: foreachBlock.children.map((s) => s.astOfStatement()), + loc: createRef(this), + }); + }, + StatementDestruct( + _letKwd, + typeId, + _lparen, + identifiers, + endOfIdentifiers, + _rparen, + _equals, + expression, + _semicolon, + ) { + return createNode({ + kind: "statement_destruct", + type: typeId.astOfType(), + identifiers: identifiers + .asIteration() + .children.reduce((map, item) => { + const destructItem = item.astOfExpression(); + if (map.has(destructItem.field.text)) { + err().duplicateField(destructItem.field.text)( + destructItem.loc, + ); + } + map.set(destructItem.field.text, [ + destructItem.field, + destructItem.name, + ]); + return map; + }, new Map()), + ignoreUnspecifiedFields: + endOfIdentifiers.astOfExpression().ignoreUnspecifiedFields, + expression: expression.astOfExpression(), + loc: createRef(this), + }); + }, +}); + +semantics.addOperation("astOfType", { + typeId(firstTactTypeIdCharacter, restOfTactTypeId) { + return createNode({ + kind: "type_id", + text: + firstTactTypeIdCharacter.sourceString + + restOfTactTypeId.sourceString, + loc: createRef(this), + }); + }, + Type_optional(typeId, _questionMark) { + return createNode({ + kind: "optional_type", + typeArg: typeId.astOfType(), + loc: createRef(this), + }); + }, + Type_regular(typeId) { + return typeId.astOfType(); + }, + Type_map( + _mapKwd, + _langle, + keyTypeId, + _optAsKwdKey, + optKeyStorageType, + _comma, + valueTypeId, + _optAsKwdValue, + optValueStorageType, + _rangle, + ) { + return createNode({ + kind: "map_type", + keyType: keyTypeId.astOfType(), + keyStorageType: unwrapOptNode(optKeyStorageType, (t) => + t.astOfExpression(), + ), + valueType: valueTypeId.astOfType(), + valueStorageType: unwrapOptNode(optValueStorageType, (t) => + t.astOfExpression(), + ), + loc: createRef(this), + }); + }, + Type_bounced(_bouncedKwd, _langle, typeId, _rangle) { + return createNode({ + kind: "bounced_message_type", + messageType: typeId.astOfType(), + loc: createRef(this), + }); + }, +}); + +// handles binary, octal, decimal and hexadecimal integer literals +function bigintOfIntLiteral(litString: NonterminalNode): bigint { + return BigInt(litString.sourceString.replaceAll("_", "")); +} + +function baseOfIntLiteral(node: NonterminalNode): AstNumberBase { + const basePrefix = node.sourceString.slice(0, 2).toLowerCase(); + switch (basePrefix) { + case "0x": + return 16; + case "0o": + return 8; + case "0b": + return 2; + default: + return 10; + } +} + +function astOfNumber(node: Node): AstNode { + return createNode({ + kind: "number", + base: baseOfIntLiteral(node), + value: bigintOfIntLiteral(node), + loc: createRef(node), + }); +} + +// Expressions +semantics.addOperation("astOfExpression", { + // Literals + integerLiteral(_) { + // Parses dec, hex, and bin numbers + return astOfNumber(this); + }, + integerLiteralDec(_) { + return astOfNumber(this); + }, + integerLiteralHex(_0x, _digit, _1, _2) { + return astOfNumber(this); + }, + boolLiteral(boolValue) { + return createNode({ + kind: "boolean", + value: boolValue.sourceString === "true", + loc: createRef(this), + }); + }, + id(firstTactIdCharacter, restOfTactId) { + return createNode({ + kind: "id", + text: firstTactIdCharacter.sourceString + restOfTactId.sourceString, + loc: createRef(this), + }); + }, + funcId(firstFuncIdCharacter, restOfFuncId) { + return createNode({ + kind: "func_id", + text: firstFuncIdCharacter.sourceString + restOfFuncId.sourceString, + loc: createRef(this), + }); + }, + null(_nullKwd) { + return createNode({ kind: "null", loc: createRef(this) }); + }, + stringLiteral(_startQuotationMark, string, _endQuotationMark) { + return createNode({ + kind: "string", + value: string.sourceString, + loc: createRef(this), + }); + }, + DestructItem_punned(id) { + return createNode({ + kind: "destruct_mapping", + field: id.astOfExpression(), + name: id.astOfExpression(), + loc: createRef(this), + }); + }, + DestructItem_regular(idFrom, _colon, id) { + return createNode({ + kind: "destruct_mapping", + field: idFrom.astOfExpression(), + name: id.astOfExpression(), + loc: createRef(this), + }); + }, + EndOfIdentifiers_regular(_comma) { + return createNode({ + kind: "destruct_end", + ignoreUnspecifiedFields: false, + loc: createRef(this), + }); + }, + EndOfIdentifiers_ignoreUnspecifiedFields(_comma, _dotDot) { + return createNode({ + kind: "destruct_end", + ignoreUnspecifiedFields: true, + loc: createRef(this), + }); + }, + ExpressionAdd_add(left, _plus, right) { + return createNode({ + kind: "op_binary", + op: "+", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionAdd_sub(left, _minus, right) { + return createNode({ + kind: "op_binary", + op: "-", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionMul_div(left, _slash, right) { + return createNode({ + kind: "op_binary", + op: "/", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionMul_mul(left, _star, right) { + return createNode({ + kind: "op_binary", + op: "*", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionMul_rem(left, _percent, right) { + return createNode({ + kind: "op_binary", + op: "%", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionEquality_eq(left, _equalsEquals, right) { + return createNode({ + kind: "op_binary", + op: "==", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionEquality_not(left, _bangEquals, right) { + return createNode({ + kind: "op_binary", + op: "!=", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionCompare_gt(left, _rangle, right) { + return createNode({ + kind: "op_binary", + op: ">", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionCompare_gte(left, _rangleEquals, right) { + return createNode({ + kind: "op_binary", + op: ">=", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionCompare_lt(left, _langle, right) { + return createNode({ + kind: "op_binary", + op: "<", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionCompare_lte(left, _langleEquals, right) { + return createNode({ + kind: "op_binary", + op: "<=", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionOr_or(left, _pipePipe, right) { + return createNode({ + kind: "op_binary", + op: "||", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionAnd_and(left, _ampersandAmpersand, right) { + return createNode({ + kind: "op_binary", + op: "&&", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionBitwiseShift_shr(left, _rangleRangle, right) { + return createNode({ + kind: "op_binary", + op: ">>", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionBitwiseShift_shl(left, _langleLangle, right) { + return createNode({ + kind: "op_binary", + op: "<<", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionBitwiseAnd_bitwiseAnd(left, _ampersand, right) { + return createNode({ + kind: "op_binary", + op: "&", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionBitwiseOr_bitwiseOr(left, _pipe, right) { + return createNode({ + kind: "op_binary", + op: "|", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionBitwiseXor_bitwiseXor(left, _caret, right) { + return createNode({ + kind: "op_binary", + op: "^", + left: left.astOfExpression(), + right: right.astOfExpression(), + loc: createRef(this), + }); + }, + + // Unary + ExpressionUnary_plus(_plus, operand) { + return createNode({ + kind: "op_unary", + op: "+", + operand: operand.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionUnary_minus(_minus, operand) { + return createNode({ + kind: "op_unary", + op: "-", + operand: operand.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionUnary_not(_bang, operand) { + return createNode({ + kind: "op_unary", + op: "!", + operand: operand.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionUnary_bitwiseNot(_tilde, operand) { + return createNode({ + kind: "op_unary", + op: "~", + operand: operand.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionParens(_lparen, expression, _rparen) { + return expression.astOfExpression(); + }, + ExpressionUnboxNotNull(operand, _bangBang) { + return createNode({ + kind: "op_unary", + op: "!!", + operand: operand.astOfExpression(), + loc: createRef(this), + }); + }, + + ExpressionFieldAccess(source, _dot, fieldId) { + return createNode({ + kind: "field_access", + aggregate: source.astOfExpression(), + field: fieldId.astOfExpression(), + loc: createRef(this), + }); + }, + ExpressionMethodCall(source, _dot, methodId, methodArguments) { + return createNode({ + kind: "method_call", + self: source.astOfExpression(), + method: methodId.astOfExpression(), + args: methodArguments.astsOfList(), + loc: createRef(this), + }); + }, + ExpressionStaticCall(functionId, functionArguments) { + return createNode({ + kind: "static_call", + function: functionId.astOfExpression(), + args: functionArguments.astsOfList(), + loc: createRef(this), + }); + }, + ExpressionStructInstance( + typeId, + _lbrace, + structFields, + optTrailingComma, + _rbrace, + ) { + if ( + structFields.source.contents === "" && + optTrailingComma.sourceString === "," + ) { + err().extraneousComma()(createRef(optTrailingComma)); + } + + return createNode({ + kind: "struct_instance", + type: typeId.astOfType(), + args: structFields + .asIteration() + .children.map((d) => d.astOfDeclaration()), + loc: createRef(this), + }); + }, + ExpressionInitOf(_initOfKwd, contractId, initArguments) { + return createNode({ + kind: "init_of", + contract: contractId.astOfExpression(), + args: initArguments.astsOfList(), + loc: createRef(this), + }); + }, + + // Ternary conditional + ExpressionConditional_ternary( + condition, + _questionMark, + thenExpression, + _colon, + elseExpression, + ) { + return createNode({ + kind: "conditional", + condition: condition.astOfExpression(), + thenBranch: thenExpression.astOfExpression(), + elseBranch: elseExpression.astOfExpression(), + loc: createRef(this), + }); + }, +}); + +/** + * @deprecated + */ +export const getParser = (ast: FactoryAst) => { + const errorTypes = parserErrorSchema(displayToString); + + function parse(src: string, path: string, origin: ItemOrigin): AstModule { + return withContext( + { + currentFile: path, + origin, + createNode: ast.createNode, + errorTypes, + }, + () => { + const matchResult = tactGrammar.match(src); + if (matchResult.failed()) { + errorTypes.generic(matchResult, path, origin); + } + return semantics(matchResult).astOfModule(); + }, + ); + } + + function parseExpression(sourceCode: string): AstExpression { + return withContext( + { + currentFile: null, + origin: "user", + createNode: ast.createNode, + errorTypes, + }, + () => { + const matchResult = tactGrammar.match(sourceCode, "Expression"); + if (matchResult.failed()) { + errorTypes.generic(matchResult, "", "user"); + } + return semantics(matchResult).astOfExpression(); + }, + ); + } + + function parseImports( + src: string, + path: string, + origin: ItemOrigin, + ): AstImport[] { + return withContext( + { + currentFile: path, + origin, + createNode: ast.createNode, + errorTypes, + }, + () => { + const matchResult = tactGrammar.match(src, "JustImports"); + if (matchResult.failed()) { + errorTypes.generic(matchResult, path, origin); + } + return semantics(matchResult).astOfJustImports(); + }, + ); + } + + return { + parse, + parseExpression, + parseImports, + }; +}; diff --git a/src/grammar/prev/parser-error.ts b/src/grammar/prev/parser-error.ts new file mode 100644 index 000000000..b5cf31015 --- /dev/null +++ b/src/grammar/prev/parser-error.ts @@ -0,0 +1,27 @@ +import { MatchResult } from "ohm-js"; +import { ErrorDisplay } from "../../error/display"; +import { TactCompilationError } from "../../errors"; +import { syntaxErrorSchema } from "../parser-error"; +import { ItemOrigin, SrcInfo } from "../src-info"; +import { getSrcInfoFromOhm } from "./src-info"; + +/** + * @deprecated + */ +export const parserErrorSchema = (display: ErrorDisplay) => ({ + ...syntaxErrorSchema(display, (message) => (source: SrcInfo) => { + throw new TactCompilationError(display.at(source, message), source); + }), + generic: (matchResult: MatchResult, path: string, origin: ItemOrigin) => { + const interval = matchResult.getInterval(); + const source = getSrcInfoFromOhm(interval, path, origin); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const message = `Expected ${(matchResult as any).getExpectedText()}\n`; + throw new TactCompilationError(display.at(source, message), source); + }, +}); + +/** + * @deprecated + */ +export type ParserErrors = ReturnType; diff --git a/src/grammar/prev/src-info.ts b/src/grammar/prev/src-info.ts new file mode 100644 index 000000000..57ff7e548 --- /dev/null +++ b/src/grammar/prev/src-info.ts @@ -0,0 +1,13 @@ +import { Interval } from "ohm-js"; +import { getSrcInfo, ItemOrigin, SrcInfo } from "../src-info"; + +/** + * @deprecated + */ +export const getSrcInfoFromOhm = ( + { sourceString, startIdx, endIdx }: Interval, + file: string | null, + origin: ItemOrigin, +): SrcInfo => { + return getSrcInfo(sourceString, startIdx, endIdx, file, origin); +}; diff --git a/src/grammar/src-info.ts b/src/grammar/src-info.ts index 8485c4e3c..296a29d3f 100644 --- a/src/grammar/src-info.ts +++ b/src/grammar/src-info.ts @@ -1,5 +1,3 @@ -import { Interval as RawInterval } from "ohm-js"; - import { throwInternalCompilerError } from "../errors"; export type ItemOrigin = "stdlib" | "user"; @@ -245,7 +243,7 @@ const errorPrinter = getErrorPrinter({ contextLines: 1, }); -const getSrcInfo = ( +export const getSrcInfo = ( sourceString: string, startIdx: number, endIdx: number, @@ -281,15 +279,4 @@ const getSrcInfo = ( }; }; -/** - * @deprecated - */ -export const getSrcInfoFromOhm = ( - { sourceString, startIdx, endIdx }: RawInterval, - file: string | null, - origin: ItemOrigin, -): SrcInfo => { - return getSrcInfo(sourceString, startIdx, endIdx, file, origin); -}; - export const dummySrcInfo: SrcInfo = getSrcInfo("", 0, 0, null, "user"); diff --git a/src/grammar/test-asm/embed-asm-fif.tact b/src/grammar/test-asm/embed-asm-fif.tact deleted file mode 100644 index de29f1eae..000000000 --- a/src/grammar/test-asm/embed-asm-fif.tact +++ /dev/null @@ -1,1655 +0,0 @@ -/// Tests parsing of Asm.fif by embedding its contents -asm fun embedAsmFif() { - library TVM_Asm - // simple TVM Assembler - namespace Asm - Asm definitions - "0.4.5" constant asm-fif-version - - variable @atend - variable @was-split - false @was-split ! - { "not in asm context" abort } @atend ! - { `normal eq? not abort"must be terminated by }>" } : @normal? - { context@ @atend @ 2 { @atend ! context! @normal? } does @atend ! } : @pushatend - { @pushatend Asm - { }> b> } : }>c - { }>c s - { @atend @ 2 { true @was-split ! @atend ! rot b> ref, swap @endblk } does @atend ! = -rot <= and } : 2x<= - { 2 pick brembitrefs 1- 2x<= } : @havebitrefs - { @havebits ' @| ifnot } : @ensurebits - { @havebitrefs ' @| ifnot } : @ensurebitrefs - { rot over @ensurebits -rot u, } : @simpleuop - { tuck sbitrefs @ensurebitrefs swap s, } : @addop - { tuck bbitrefs @ensurebitrefs swap b+ } : @addopb - ' @addopb : @inline - { 1 ' @addop does create } : @Defop - { 1 { } : si() - // x mi ma -- ? - { rot tuck >= -rot <= and } : @range - { rot tuck < -rot > or } : @-range - { @-range abort"Out of range" } : @rangechk - { dup 0 < over 255 > or abort"Invalid stack register number" si() } : s() - { si() constant } : @Sreg - -2 @Sreg s(-2) - -1 @Sreg s(-1) - 0 @Sreg s0 - 1 @Sreg s1 - 2 @Sreg s2 - 3 @Sreg s3 - 4 @Sreg s4 - 5 @Sreg s5 - 6 @Sreg s6 - 7 @Sreg s7 - 8 @Sreg s8 - 9 @Sreg s9 - 10 @Sreg s10 - 11 @Sreg s11 - 12 @Sreg s12 - 13 @Sreg s13 - 14 @Sreg s14 - 15 @Sreg s15 - { dup 0 < over 7 > or abort"Invalid control register number" } : c() - { c() constant } : @Creg - 0 @Creg c0 - 1 @Creg c1 - 2 @Creg c2 - 3 @Creg c3 - 4 @Creg c4 - 5 @Creg c5 - 7 @Creg c7 - { abort"not a stack register" 12 i@+ s> } : @bigsridx - { @bigsridx dup 16 >= over 0< or abort"stack register s0..s15 expected" } : @sridx - { rot @bigsridx tuck < -rot tuck > rot or abort"stack register out of range" } : @sridxrange - { swap @bigsridx + dup 16 >= over 0< or abort"stack register out of range" } : @sridx+ - { swap 0xcc <> over 7 > or over 6 = or abort"not a control register c0..c5 or c7" } : @cridx - { = - { tuck 16 >= - { = and - { 15 and abort"integer too large" 8 + 2dup fits } until - > 2- 5 u, -rot i, - } cond - } cond - } cond - @addopb } dup : PUSHINT : INT - { dup 256 = abort"use PUSHNAN instead of 256 PUSHPOW2" = or abort"invalid slice padding" - swap 1 1 u, 0 rot u, } : @scomplete - { tuck sbitrefs swap 26 + swap @havebitrefs not - { PUSHREFSLICE } - { over sbitrefs 2dup 123 0 2x<= - { drop tuck 4 + 3 >> swap x{8B} s, over 4 u, 3 roll s, - -rot 3 << 4 + swap - @scomplete } - { 2dup 1 >= swap 248 <= and - { rot x{8C} s, swap 1- 2 u, over 7 + 3 >> tuck 5 u, 3 roll s, - -rot 3 << 1 + swap - @scomplete } - { rot x{8D} s, swap 3 u, over 2 + 3 >> tuck 7 u, 3 roll s, - -rot 3 << 6 + swap - @scomplete - } cond - } cond - } cond - } dup : PUSHSLICE : SLICE - // ( b' -- ? ) - { bbitrefs or 0= } : @cont-empty? - { bbits 7 and 0= } : @cont-aligned? - // ( b b' -- ? ) - { bbitrefs over 7 and { 2drop drop false } { - swap 16 + swap @havebitrefs nip - } cond - } : @cont-fits? - // ( b b' -- ? ) - { bbitrefs over 7 and { 2drop drop false } { - 32 1 pair+ @havebitrefs nip - } cond - } : @cont-ref-fit? - // ( b b' b'' -- ? ) - { over @cont-aligned? over @cont-aligned? and not { 2drop drop false } { - bbitrefs rot bbitrefs pair+ swap 32 + swap @havebitrefs nip - } cond - } : @two-cont-fit? - { 2dup @cont-fits? not - { b> PUSHREFCONT } - { swap over bbitrefs 2dup 120 0 2x<= - { drop swap x{9} s, swap 3 >> 4 u, swap b+ } - { rot x{8F_} s, swap 2 u, swap 3 >> 7 u, swap b+ } cond - } cond - } dup : PUSHCONT : CONT - { }> PUSHCONT } : }>CONT - { { @normal? PUSHCONT } @doafter<{ } : CONT:<{ - - // arithmetic operations - { 2 { rot dup 8 fits - { nip = { rot drop -rot PUSHINT swap LSHIFT# } { - { drop PUSHINT } { - not pow2decomp swap -1 = { nip PUSHPOW2DEC } { - drop PUSHINT - } cond } cond } cond } cond } cond } cond - } dup : PUSHINTX : INTX - - // integer comparison - x{B8} @Defop SGN - x{B9} @Defop LESS - x{BA} @Defop EQUAL - x{BB} @Defop LEQ - x{BC} @Defop GREATER - x{BD} @Defop NEQ - x{BE} @Defop GEQ - x{BF} @Defop CMP - x{C0} x{BA} @Defop(8i,alt) EQINT - x{C000} @Defop ISZERO - x{C1} x{B9} @Defop(8i,alt) LESSINT - { 1+ LESSINT } : LEQINT - x{C100} @Defop ISNEG - x{C101} @Defop ISNPOS - x{C2} x{BC} @Defop(8i,alt) GTINT - { 1- GTINT } : GEQINT - x{C200} @Defop ISPOS - x{C2FF} @Defop ISNNEG - x{C3} x{BD} @Defop(8i,alt) NEQINT - x{C300} @Defop ISNZERO - x{C4} @Defop ISNAN - x{C5} @Defop CHKNAN - - // other comparison - x{C700} @Defop SEMPTY - x{C701} @Defop SDEMPTY - x{C702} @Defop SREMPTY - x{C703} @Defop SDFIRST - x{C704} @Defop SDLEXCMP - x{C705} @Defop SDEQ - x{C708} @Defop SDPFX - x{C709} @Defop SDPFXREV - x{C70A} @Defop SDPPFX - x{C70B} @Defop SDPPFXREV - x{C70C} @Defop SDSFX - x{C70D} @Defop SDSFXREV - x{C70E} @Defop SDPSFX - x{C70F} @Defop SDPSFXREV - x{C710} @Defop SDCNTLEAD0 - x{C711} @Defop SDCNTLEAD1 - x{C712} @Defop SDCNTTRAIL0 - x{C713} @Defop SDCNTTRAIL1 - - // cell serialization (Builder manipulation primitives) - x{C8} @Defop NEWC - x{C9} @Defop ENDC - x{CA} @Defop(8u+1) STI - x{CB} @Defop(8u+1) STU - x{CC} @Defop STREF - x{CD} dup @Defop STBREFR @Defop ENDCST - x{CE} @Defop STSLICE - x{CF00} @Defop STIX - x{CF01} @Defop STUX - x{CF02} @Defop STIXR - x{CF03} @Defop STUXR - x{CF04} @Defop STIXQ - x{CF05} @Defop STUXQ - x{CF06} @Defop STIXRQ - x{CF07} @Defop STUXRQ - x{CF08} @Defop(8u+1) STI_l - x{CF09} @Defop(8u+1) STU_l - x{CF0A} @Defop(8u+1) STIR - x{CF0B} @Defop(8u+1) STUR - x{CF0C} @Defop(8u+1) STIQ - x{CF0D} @Defop(8u+1) STUQ - x{CF0E} @Defop(8u+1) STIRQ - x{CF0F} @Defop(8u+1) STURQ - x{CF10} @Defop STREF_l - x{CF11} @Defop STBREF - x{CF12} @Defop STSLICE_l - x{CF13} @Defop STB - x{CF14} @Defop STREFR - x{CF15} @Defop STBREFR_l - x{CF16} @Defop STSLICER - x{CF17} dup @Defop STBR @Defop BCONCAT - x{CF18} @Defop STREFQ - x{CF19} @Defop STBREFQ - x{CF1A} @Defop STSLICEQ - x{CF1B} @Defop STBQ - x{CF1C} @Defop STREFRQ - x{CF1D} @Defop STBREFRQ - x{CF1E} @Defop STSLICERQ - x{CF1F} dup @Defop STBRQ @Defop BCONCATQ - x{CF20} @Defop(ref) STREFCONST - { > tuck 3 u, 3 roll s, - -rot 3 << 2 + swap - @scomplete } - { 2drop swap PUSHSLICE STSLICER } cond - } cond - } : STSLICECONST - x{CF81} @Defop STZERO - x{CF83} @Defop STONE - - // cell deserialization (CellSlice primitives) - x{D0} @Defop CTOS - x{D1} @Defop ENDS - x{D2} @Defop(8u+1) LDI - x{D3} @Defop(8u+1) LDU - x{D4} @Defop LDREF - x{D5} @Defop LDREFRTOS - x{D6} @Defop(8u+1) LDSLICE - x{D700} @Defop LDIX - x{D701} @Defop LDUX - x{D702} @Defop PLDIX - x{D703} @Defop PLDUX - x{D704} @Defop LDIXQ - x{D705} @Defop LDUXQ - x{D706} @Defop PLDIXQ - x{D707} @Defop PLDUXQ - x{D708} @Defop(8u+1) LDI_l - x{D709} @Defop(8u+1) LDU_l - x{D70A} @Defop(8u+1) PLDI - x{D70B} @Defop(8u+1) PLDU - x{D70C} @Defop(8u+1) LDIQ - x{D70D} @Defop(8u+1) LDUQ - x{D70E} @Defop(8u+1) PLDIQ - x{D70F} @Defop(8u+1) PLDUQ - { dup 31 and abort"argument must be a multiple of 32" 5 >> 1- - > swap x{D72A_} s, over 7 u, 3 roll s, - -rot 3 << 3 + swap - @scomplete } : SDBEGINS:imm - { tuck sbitrefs abort"no references allowed in slice" dup 26 <= - { drop > swap x{D72E_} s, over 7 u, 3 roll s, - -rot 3 << 3 + swap - @scomplete } : SDBEGINSQ:imm - { tuck sbitrefs abort"no references allowed in slice" dup 26 <= - { drop rot 2 } { - swap @| swap 2dup @cont-fits? { rot 1 } { - b> rot 2 - } cond } cond } cond } cond - [] execute - } : @run-cont-op - { triple 1 ' @run-cont-op does create } : @def-cont-op - { DROP } { PUSHCONT IF } { IFREF } @def-cont-op IF-cont - { IFRET } { PUSHCONT IFJMP } { IFJMPREF } @def-cont-op IFJMP-cont - { DROP } { PUSHCONT IFNOT } { IFNOTREF } @def-cont-op IFNOT-cont - { IFNOTRET } { PUSHCONT IFNOTJMP } { IFNOTJMPREF } @def-cont-op IFNOTJMP-cont - { dup 2over rot } : 3dup - - recursive IFELSE-cont2 { - dup @cont-empty? { drop IF-cont } { - over @cont-empty? { nip IFNOT-cont } { - 3dup @two-cont-fit? { -rot PUSHCONT swap PUSHCONT IFELSE } { - 3dup nip @cont-ref-fit? { rot swap PUSHCONT swap b> IFREFELSE } { - 3dup drop @cont-ref-fit? { -rot PUSHCONT swap b> IFELSEREF } { - rot 32 2 @havebitrefs { rot b> rot b> IFREFELSEREF } { - @| -rot IFELSE-cont2 - } cond } cond } cond } cond } cond } cond - } swap ! - - { }> IF-cont } : }>IF - { }> IFNOT-cont } : }>IFNOT - { }> IFJMP-cont } : }>IFJMP - { }> IFNOTJMP-cont } : }>IFNOTJMP - { { @normal? IFJMP-cont } @doafter<{ } : IFJMP:<{ - { { @normal? IFNOTJMP-cont } @doafter<{ } : IFNOTJMP:<{ - { `else @endblk } : }>ELSE<{ - { `else: @endblk } : }>ELSE: - { 1 { swap @normal? swap IFELSE-cont2 } does @doafter<{ } : @doifelse - { 1 { swap @normal? IFELSE-cont2 } does @doafter<{ } : @doifnotelse - { - { dup `else eq? - { drop @doifelse } - { dup `else: eq? - { drop IFJMP-cont } - { @normal? IF-cont - } cond - } cond - } @doafter<{ - } : IF:<{ - { - { dup `else eq? - { drop @doifnotelse } - { dup `else: eq? - { drop IFNOTJMP-cont } - { @normal? IFNOT-cont - } cond - } cond - } @doafter<{ - } : IFNOT:<{ - - x{E304} @Defop CONDSEL - x{E305} @Defop CONDSELCHK - x{E308} @Defop IFRETALT - x{E309} @Defop IFNOTRETALT - { DO<{ - { `do: @endblk } : }>DO: - { }> PUSHCONT REPEAT } : }>REPEAT - { { @normal? PUSHCONT REPEAT } @doafter<{ } : REPEAT:<{ - { }> PUSHCONT UNTIL } : }>UNTIL - { { @normal? PUSHCONT UNTIL } @doafter<{ } : UNTIL:<{ - { PUSHCONT { @normal? PUSHCONT WHILE } @doafter<{ } : @dowhile - { - { dup `do eq? - { drop @dowhile } - { `do: eq? not abort"`}>DO<{` expected" PUSHCONT WHILEEND - } cond - } @doafter<{ - } : WHILE:<{ - { }> PUSHCONT AGAIN } : }>AGAIN - { { @normal? PUSHCONT AGAIN } @doafter<{ } : AGAIN:<{ - - x{E314} @Defop REPEATBRK - x{E315} @Defop REPEATENDBRK - x{E316} @Defop UNTILBRK - x{E317} dup @Defop UNTILENDBRK @Defop UNTILBRK: - x{E318} @Defop WHILEBRK - x{E319} @Defop WHILEENDBRK - x{E31A} @Defop AGAINBRK - x{E31B} dup @Defop AGAINENDBRK @Defop AGAINBRK: - - { }> PUSHCONT REPEATBRK } : }>REPEATBRK - { { @normal? PUSHCONT REPEATBRK } @doafter<{ } : REPEATBRK:<{ - { }> PUSHCONT UNTILBRK } : }>UNTILBRK - { { @normal? PUSHCONT UNTILBRK } @doafter<{ } : UNTILBRK:<{ - { PUSHCONT { @normal? PUSHCONT WHILEBRK } @doafter<{ } : @dowhile - { - { dup `do eq? - { drop @dowhile } - { `do: eq? not abort"`}>DO<{` expected" PUSHCONT WHILEENDBRK - } cond - } @doafter<{ - } : WHILEBRK:<{ - { }> PUSHCONT AGAINBRK } : }>AGAINBRK - { { @normal? PUSHCONT AGAINBRK } @doafter<{ } : AGAINBRK:<{ - - - // - // continuation stack manipulation and continuation creation - // - { PUSHCONT ATEXIT } : }>ATEXIT - { { @normal? PUSHCONT ATEXIT } @doafter<{ } : ATEXIT:<{ - x{EDF4} @Defop ATEXITALT - { }> PUSHCONT ATEXITALT } : }>ATEXITALT - { { @normal? PUSHCONT ATEXITALT } @doafter<{ } : ATEXITALT:<{ - x{EDF5} @Defop SETEXITALT - { }> PUSHCONT SETEXITALT } : }>SETEXITALT - { { @normal? PUSHCONT SETEXITALT } @doafter<{ } : SETEXITALT:<{ - x{EDF6} @Defop THENRET - x{EDF7} @Defop THENRETALT - x{EDF8} @Defop INVERT - x{EDF9} @Defop BOOLEVAL - x{EDFA} @Defop SAMEALT - x{EDFB} @Defop SAMEALTSAVE - // x{EE} is BLESSARGS - // - // dictionary subroutine call/jump primitives - { c3 PUSH EXECUTE } : CALLVAR - { c3 PUSH JMPX } : JMPVAR - { c3 PUSH } : PREPAREVAR - { dup 14 ufits { - dup 8 ufits { - CATCH<{ - { PUSHCONT { @normal? PUSHCONT TRY } @doafter<{ } : @trycatch - { - { `catch eq? not abort"`}>CATCH<{` expected" @trycatch - } @doafter<{ - } : TRY:<{ - // - // dictionary manipulation - ' NULL : NEWDICT - ' ISNULL : DICTEMPTY - ' STSLICE : STDICTS - x{F400} dup @Defop STDICT @Defop STOPTREF - x{F401} dup @Defop SKIPDICT @Defop SKIPOPTREF - x{F402} @Defop LDDICTS - x{F403} @Defop PLDDICTS - x{F404} dup @Defop LDDICT @Defop LDOPTREF - x{F405} dup @Defop PLDDICT @Defop PLDOPTREF - x{F406} @Defop LDDICTQ - x{F407} @Defop PLDDICTQ - - x{F40A} @Defop DICTGET - x{F40B} @Defop DICTGETREF - x{F40C} @Defop DICTIGET - x{F40D} @Defop DICTIGETREF - x{F40E} @Defop DICTUGET - x{F40F} @Defop DICTUGETREF - - x{F412} @Defop DICTSET - x{F413} @Defop DICTSETREF - x{F414} @Defop DICTISET - x{F415} @Defop DICTISETREF - x{F416} @Defop DICTUSET - x{F417} @Defop DICTUSETREF - x{F41A} @Defop DICTSETGET - x{F41B} @Defop DICTSETGETREF - x{F41C} @Defop DICTISETGET - x{F41D} @Defop DICTISETGETREF - x{F41E} @Defop DICTUSETGET - x{F41F} @Defop DICTUSETGETREF - - x{F422} @Defop DICTREPLACE - x{F423} @Defop DICTREPLACEREF - x{F424} @Defop DICTIREPLACE - x{F425} @Defop DICTIREPLACEREF - x{F426} @Defop DICTUREPLACE - x{F427} @Defop DICTUREPLACEREF - x{F42A} @Defop DICTREPLACEGET - x{F42B} @Defop DICTREPLACEGETREF - x{F42C} @Defop DICTIREPLACEGET - x{F42D} @Defop DICTIREPLACEGETREF - x{F42E} @Defop DICTUREPLACEGET - x{F42F} @Defop DICTUREPLACEGETREF - - x{F432} @Defop DICTADD - x{F433} @Defop DICTADDREF - x{F434} @Defop DICTIADD - x{F435} @Defop DICTIADDREF - x{F436} @Defop DICTUADD - x{F437} @Defop DICTUADDREF - x{F43A} @Defop DICTADDGET - x{F43B} @Defop DICTADDGETREF - x{F43C} @Defop DICTIADDGET - x{F43D} @Defop DICTIADDGETREF - x{F43E} @Defop DICTUADDGET - x{F43F} @Defop DICTUADDGETREF - - x{F441} @Defop DICTSETB - x{F442} @Defop DICTISETB - x{F443} @Defop DICTUSETB - x{F445} @Defop DICTSETGETB - x{F446} @Defop DICTISETGETB - x{F447} @Defop DICTUSETGETB - - x{F449} @Defop DICTREPLACEB - x{F44A} @Defop DICTIREPLACEB - x{F44B} @Defop DICTUREPLACEB - x{F44D} @Defop DICTREPLACEGETB - x{F44E} @Defop DICTIREPLACEGETB - x{F44F} @Defop DICTUREPLACEGETB - - x{F451} @Defop DICTADDB - x{F452} @Defop DICTIADDB - x{F453} @Defop DICTUADDB - x{F455} @Defop DICTADDGETB - x{F456} @Defop DICTIADDGETB - x{F457} @Defop DICTUADDGETB - - x{F459} @Defop DICTDEL - x{F45A} @Defop DICTIDEL - x{F45B} @Defop DICTUDEL - - x{F462} @Defop DICTDELGET - x{F463} @Defop DICTDELGETREF - x{F464} @Defop DICTIDELGET - x{F465} @Defop DICTIDELGETREF - x{F466} @Defop DICTUDELGET - x{F467} @Defop DICTUDELGETREF - - x{F469} @Defop DICTGETOPTREF - x{F46A} @Defop DICTIGETOPTREF - x{F46B} @Defop DICTUGETOPTREF - x{F46D} @Defop DICTSETGETOPTREF - x{F46E} @Defop DICTISETGETOPTREF - x{F46F} @Defop DICTUSETGETOPTREF - - x{F470} @Defop PFXDICTSET - x{F471} @Defop PFXDICTREPLACE - x{F472} @Defop PFXDICTADD - x{F473} @Defop PFXDICTDEL - - x{F474} @Defop DICTGETNEXT - x{F475} @Defop DICTGETNEXTEQ - x{F476} @Defop DICTGETPREV - x{F477} @Defop DICTGETPREVEQ - x{F478} @Defop DICTIGETNEXT - x{F479} @Defop DICTIGETNEXTEQ - x{F47A} @Defop DICTIGETPREV - x{F47B} @Defop DICTIGETPREVEQ - x{F47C} @Defop DICTUGETNEXT - x{F47D} @Defop DICTUGETNEXTEQ - x{F47E} @Defop DICTUGETPREV - x{F47F} @Defop DICTUGETPREVEQ - - x{F482} @Defop DICTMIN - x{F483} @Defop DICTMINREF - x{F484} @Defop DICTIMIN - x{F485} @Defop DICTIMINREF - x{F486} @Defop DICTUMIN - x{F487} @Defop DICTUMINREF - x{F48A} @Defop DICTMAX - x{F48B} @Defop DICTMAXREF - x{F48C} @Defop DICTIMAX - x{F48D} @Defop DICTIMAXREF - x{F48E} @Defop DICTUMAX - x{F48F} @Defop DICTUMAXREF - - x{F492} @Defop DICTREMMIN - x{F493} @Defop DICTREMMINREF - x{F494} @Defop DICTIREMMIN - x{F495} @Defop DICTIREMMINREF - x{F496} @Defop DICTUREMMIN - x{F497} @Defop DICTUREMMINREF - x{F49A} @Defop DICTREMMAX - x{F49B} @Defop DICTREMMAXREF - x{F49C} @Defop DICTIREMMAX - x{F49D} @Defop DICTIREMMAXREF - x{F49E} @Defop DICTUREMMAX - x{F49F} @Defop DICTUREMMAXREF - - x{F4A0} @Defop DICTIGETJMP - x{F4A1} @Defop DICTUGETJMP - x{F4A2} @Defop DICTIGETEXEC - x{F4A3} @Defop DICTUGETEXEC - { dup sbitrefs tuck 1 > swap 1 <> or abort"not a dictionary" swap 1 u@ over <> abort"not a dictionary" } : @chkdicts - { dup null? tuck { idict! - not abort"cannot add key to procedure info dictionary" - @procinfo ! - } : @procinfo! - // ( x v1 v2 -- ) - { not 2 pick @procinfo@ and xor swap @procinfo! } : @procinfo~! - // ( s i f -- ) - { over @procdictkeylen fits not abort"procedure index out of range" - over swap dup @procinfo~! 2dup @proclistadd - 1 'nop does swap 0 (create) - } : @declproc - { 1 'nop does swap 0 (create) } : @declglobvar - { @proccnt @ 1+ dup @proccnt ! 1 @declproc } : @newproc - { @gvarcnt @ 1+ dup @gvarcnt ! @declglobvar } : @newglobvar - variable @oldcurrent variable @oldctx - Fift-wordlist dup @oldcurrent ! @oldctx ! - { current@ @oldcurrent ! context@ @oldctx ! Asm definitions - @proccnt @ @proclist @ @procdict @ @procinfo @ @gvarcnt @ @parent-state @ current@ @oldcurrent @ @oldctx @ - 9 tuple @parent-state ! - hole current! - 0 =: main @proclist null! @proccnt 0! @gvarcnt 0! - { bl word @newproc } : NEWPROC - { bl word dup (def?) ' drop ' @newproc cond } : DECLPROC - { bl word dup find - { nip execute <> abort"method redefined with different id" } - { swap 17 @declproc } - cond } : DECLMETHOD - { bl word @newglobvar } : DECLGLOBVAR - "main" 0 @proclistadd - dictnew dup @procdict ! - @procinfo ! 16 0 @procinfo! - } : PROGRAM{ - { over sbits < { s>c } : }END> - { }END> b> } : }END>c - { }END>c s - - 0 constant recv_internal - -1 constant recv_external - -2 constant run_ticktock - -3 constant split_prepare - -4 constant split_install - - { asm-mode 0 3 ~! } : asm-no-remove-unused - { asm-mode 1 1 ~! } : asm-remove-unused // enabled by default - { asm-mode 3 3 ~! } : asm-warn-remove-unused - { asm-mode 4 4 ~! } : asm-warn-inline-mix - { asm-mode 0 4 ~! } : asm-no-warn-inline-mix // disabled by default - { asm-mode 8 8 ~! } : asm-warn-unused - { asm-mode 0 8 ~! } : asm-no-warn-unused // disabled by default - - // ( c -- ) add vm library for later use with runvmcode - { spec } : hash>libref - // ( c -- c' ) - { hash hash>libref } : >libref - - { dup "." $pos dup -1 = - { drop 0 } - { $| 1 $| nip swap (number) 1- abort"invalid version" - dup dup 0 < swap 999 > or abort"invalid version" - } - cond - } : parse-version-level - - { - 0 swap - "." $+ - { swap 1000 * swap parse-version-level rot + swap } 3 times - "" $= not abort"invalid version" - } : parse-asm-fif-version - - { - dup =: required-version parse-asm-fif-version - asm-fif-version parse-asm-fif-version - = 1+ { - "Required Asm.fif version: " @' required-version "; actual Asm.fif version: " asm-fif-version $+ $+ $+ abort - } if - } : require-asm-fif-version - - { - dup =: required-version parse-asm-fif-version - asm-fif-version parse-asm-fif-version - swap - >= 1+ { - "Required Asm.fif version: " @' required-version "; actual Asm.fif version: " asm-fif-version $+ $+ $+ abort - } if - } : require-asm-fif-version>= - - - Fift definitions Asm - ' <{ : <{ - ' PROGRAM{ : PROGRAM{ - ' asm-fif-version : asm-fif-version - ' require-asm-fif-version : require-asm-fif-version - ' require-asm-fif-version>= : require-asm-fif-version>= - Fift -} diff --git a/src/grammar/test-asm/embed-fift-fif.tact b/src/grammar/test-asm/embed-fift-fif.tact deleted file mode 100644 index f8fc844b7..000000000 --- a/src/grammar/test-asm/embed-fift-fif.tact +++ /dev/null @@ -1,150 +0,0 @@ -/// Tests parsing of Fift.fif by embedding its contents -asm fun embedFiftFif() { - { 0 word drop 0 'nop } :: // - { char " word 1 { swap { abort } if drop } } ::_ abort" - { { bl word dup "" $= abort"comment extends after end of file" "*/" $= } until 0 'nop } :: /* - // { bl word 1 2 ' (create) } "::" 1 (create) - // { bl word 0 2 ' (create) } :: : - // { bl word 2 2 ' (create) } :: :_ - // { bl word 3 2 ' (create) } :: ::_ - // { bl word 0 (create) } : create - // { bl word (forget) } : forget - { bl word 1 ' (forget) } :: [forget] - { char " word 1 ' type } ::_ ." - { char } word x>B 1 'nop } ::_ B{ - { swap ({) over 2+ -roll swap (compile) (}) } : does - { 1 'nop does create } : constant - { 2 'nop does create } : 2constant - { hole constant } : variable - 10 constant ten - { bl word 1 { find 0= abort"word not found" } } :: (') - { bl word find not abort"-?" 0 swap } :: [compile] - { bl word 1 { - dup find { " -?" $+ abort } ifnot nip execute - } } :: @' - { bl word 1 { swap 1 'nop does swap 0 (create) } - } :: =: - { bl word 1 { -rot 2 'nop does swap 0 (create) } - } :: 2=: - { } : s>c - { s>c hashB } : shash - // to be more efficiently re-implemented in C++ in the future - { dup 0< ' negate if } : abs - { 2dup > ' swap if } : minmax - { minmax drop } : min - { minmax nip } : max - "" constant <# - ' $reverse : #> - { swap 10 /mod char 0 + rot swap hold } : # - { { # over 0<= } until } : #s - { 0< { char - hold } if } : sign - // { dup abs <# #s rot sign #> nip } : (.) - // { (.) type } : ._ - // { ._ space } : . - { dup 10 < { 48 } { 55 } cond + } : Digit - { dup 10 < { 48 } { 87 } cond + } : digit - // x s b -- x' s' - { rot swap /mod Digit rot swap hold } : B# - { rot swap /mod digit rot swap hold } : b# - { 16 B# } : X# - { 16 b# } : x# - // x s b -- 0 s' - { -rot { 2 pick B# over 0<= } until rot drop } : B#s - { -rot { 2 pick b# over 0<= } until rot drop } : b#s - { 16 B#s } : X#s - { 16 b#s } : x#s - variable base - { 10 base ! } : decimal - { 16 base ! } : hex - { 8 base ! } : octal - { 2 base ! } : binary - { base @ B# } : Base# - { base @ b# } : base# - { base @ B#s } : Base#s - { base @ b#s } : base#s - // x w -- s - { over abs <# rot 1- ' X# swap times X#s rot sign #> nip } : (0X.) - { over abs <# rot 1- ' x# swap times x#s rot sign #> nip } : (0x.) - { (0X.) type } : 0X._ - { 0X._ space } : 0X. - { (0x.) type } : 0x._ - { 0x._ space } : 0x. - { bl (-trailing) } : -trailing - { char 0 (-trailing) } : -trailing0 - { char " word 1 ' $+ } ::_ +" - { find 0<> dup ' nip if } : (def?) - { bl word 1 ' (def?) } :: def? - { bl word 1 { (def?) not } } :: undef? - { def? ' skip-to-eof if } : skip-ifdef - { bl word dup (def?) { drop skip-to-eof } { 'nop swap 0 (create) } cond } : library - { bl word dup (def?) { 2drop skip-to-eof } { swap 1 'nop does swap 0 (create) } cond } : library-version - { hole dup 1 'nop does swap 1 { context! } does bl word tuck 0 (create) +"-wordlist" 0 (create) } : namespace - { context@ current! } : definitions - { char ) word "$" swap $+ 1 { find 0= abort"undefined parameter" execute } } ::_ $( - // b s -- ? - { sbitrefs rot brembitrefs rot >= -rot <= and } : s-fits? - // b s x -- ? - { swap sbitrefs -rot + rot brembitrefs -rot <= -rot <= and } : s-fits-with? - { 0 swap ! } : 0! - { tuck @ + swap ! } : +! - { tuck @ swap - swap ! } : -! - { 1 swap +! } : 1+! - { -1 swap +! } : 1-! - { null swap ! } : null! - { not 2 pick @ and xor swap ! } : ~! - 0 tuple constant nil - { 1 tuple } : single - { 2 tuple } : pair - { 3 tuple } : triple - { 1 untuple } : unsingle - { 2 untuple } : unpair - { 3 untuple } : untriple - { over tuple? { swap count = } { 2drop false } cond } : tuple-len? - { 0 tuple-len? } : nil? - { 1 tuple-len? } : single? - { 2 tuple-len? } : pair? - { 3 tuple-len? } : triple? - { 0 [] } : first - { 1 [] } : second - { 2 [] } : third - ' pair : cons - ' unpair : uncons - { 0 [] } : car - { 1 [] } : cdr - { cdr car } : cadr - { cdr cdr } : cddr - { cdr cdr car } : caddr - { null ' cons rot times } : list - { -rot pair swap ! } : 2! - { @ unpair } : 2@ - { true (atom) drop } : atom - { bl word atom 1 'nop } ::_ ` - { hole dup 1 { @ execute } does create } : recursive - { 0 { 1+ dup 1 ' $() does over (.) "$" swap $+ 0 (create) } rot times drop } : :$1..n - { 10 hold } : +cr - { 9 hold } : +tab - { "" swap { 0 word 2dup $cmp } { rot swap $+ +cr swap } while 2drop } : scan-until-word - { 0 word -trailing scan-until-word 1 'nop } ::_ $<< - { 0x40 runvmx } : runvmcode - { 0x48 runvmx } : gasrunvmcode - { 0xc8 runvmx } : gas2runvmcode - { 0x43 runvmx } : runvmdict - { 0x4b runvmx } : gasrunvmdict - { 0xcb runvmx } : gas2runvmdict - { 0x45 runvmx } : runvm - { 0x4d runvmx } : gasrunvm - { 0xcd runvmx } : gas2runvm - { 0x55 runvmx } : runvmctx - { 0x5d runvmx } : gasrunvmctx - { 0xdd runvmx } : gas2runvmctx - { 0x75 runvmx } : runvmctxact - { 0x7d runvmx } : gasrunvmctxact - { 0xfd runvmx } : gas2runvmctxact - { 0x35 runvmx } : runvmctxactq - { 0x3d runvmx } : gasrunvmctxactq -} - -// NOTE: FiftExt.fif isn't added to the test suite, because of two reasons: -// 1. It shadows the most important instructions for parsing: { and } -// That is, that shadowing uses out-of-place } and {, which cannot be allowed in the current (stackless and non-typechecking) version of the parser -// 2. That file isn't included into any smart contracts in TON monorepo (except for tests). Moreover, in third-party code on Github, it occurs only once — in a test .fif code, not the actual one. diff --git a/src/grammar/test-asm/embed-other-libs-fif.tact b/src/grammar/test-asm/embed-other-libs-fif.tact deleted file mode 100644 index d077d8a39..000000000 --- a/src/grammar/test-asm/embed-other-libs-fif.tact +++ /dev/null @@ -1,1207 +0,0 @@ -// -// Color.fif -// - -/// Tests parsing of Color.fif by embedding its contents -asm fun embedColorFif() { - library Color - { 27 emit } : esc - { char " word 27 chr swap $+ 1 ' type does create } :_ make-esc" - make-esc"[0m" ^reset - make-esc"[30m" ^black - make-esc"[31m" ^red - make-esc"[32m" ^green - make-esc"[33m" ^yellow - make-esc"[34m" ^blue - make-esc"[35m" ^magenta - make-esc"[36m" ^cyan - make-esc"[37m" ^white - // bold - make-esc"[30;1m" ^Black - make-esc"[31;1m" ^Red - make-esc"[32;1m" ^Green - make-esc"[33;1m" ^Yellow - make-esc"[34;1m" ^Blue - make-esc"[35;1m" ^Magenta - make-esc"[36;1m" ^Cyan - make-esc"[37;1m" ^White -} - -// -// Disasm.fif -// - -/// Tests parsing of Disasm.fif by embedding its contents -asm fun embedDisasmFif() { - library TVM_Disasm - // simple TVM Disassembler - "Lists.fif" include - - variable 'disasm - { 'disasm @ execute } : disasm // disassemble a slice - // usage: x{74B0} disasm - - variable @dismode @dismode 0! - { rot over @ and rot xor swap ! } : andxor! - { -2 0 @dismode andxor! } : stack-disasm // output 's1 s4 XCHG' - { -2 1 @dismode andxor! } : std-disasm // output 'XCHG s1, s4' - { -3 2 @dismode andxor! } : show-vm-code - { -3 0 @dismode andxor! } : hide-vm-code - { @dismode @ 1 and 0= } : stack-disasm? - - variable @indent @indent 0! - { ' space @indent @ 2* times } : .indent - { @indent 1+! } : +indent - { @indent 1-! } : -indent - - { " " $pos } : spc-pos - { dup " " $pos swap "," $pos dup 0< { drop } { - over 0< { nip } { min } cond } cond - } : spc-comma-pos - { { dup spc-pos 0= } { 1 $| nip } while } : -leading - { -leading -trailing dup spc-pos dup 0< { - drop dup $len { atom single } { drop nil } cond } { - $| swap atom swap -leading 2 { over spc-comma-pos dup 0>= } { - swap 1+ -rot $| 1 $| nip -leading rot - } while drop tuple - } cond - } : parse-op - { dup "s-1" $= { drop "s(-1)" true } { - dup "s-2" $= { drop "s(-2)" true } { - dup 1 $| swap "x" $= { nip "x{" swap $+ +"}" true } { - 2drop false } cond } cond } cond - } : adj-op-arg - { over count over <= { drop } { 2dup [] adj-op-arg { swap []= } { drop } cond } cond } : adj-arg[] - { 1 adj-arg[] 2 adj-arg[] 3 adj-arg[] - dup first - dup `XCHG eq? { - drop dup count 2 = { tpop swap "s0" , swap , } if } { - dup `LSHIFT eq? { - drop dup count 2 = stack-disasm? and { second `LSHIFT# swap pair } if } { - dup `RSHIFT eq? { - drop dup count 2 = stack-disasm? and { second `RSHIFT# swap pair } if } { - drop - } cond } cond } cond - } : adjust-op - - variable @cp @cp 0! - variable @curop - variable @contX variable @contY variable @cdict - - { atom>$ type } : .atom - { dup first .atom dup count 1 > { space 0 over count 2- { 1+ 2dup [] type .", " } swap times 1+ [] type } { drop } cond } : std-show-op - { 0 over count 1- { 1+ 2dup [] type space } swap times drop first .atom } : stk-show-op - { @dismode @ 2 and { .indent ."// " @curop @ csr. } if } : .curop? - { .curop? .indent @dismode @ 1 and ' std-show-op ' stk-show-op cond cr - } : show-simple-op - { dup 4 u@ 9 = { 8 u@+ swap 15 and 3 << s@ } { - dup 7 u@ 0x47 = { 7 u@+ nip 2 u@+ 7 u@+ -rot 3 << swap sr@ } { - dup 8 u@ 0x8A = { ref@ " cr } : show-cont-op - { swap scont-swap ":<{" show-cont-bodyx scont-swap - "" show-cont-bodyx .indent ."}>" cr } : show-cont2-op - - { @contX @ null? { "CONT" show-cont-op } ifnot - } : flush-contX - { @contY @ null? { scont-swap "CONT" show-cont-op scont-swap } ifnot - } : flush-contY - { flush-contY flush-contX } : flush-cont - { @contX @ null? not } : have-cont? - { @contY @ null? not } : have-cont2? - { flush-contY @contY ! scont-swap } : save-cont-body - - { @cdict ! } : save-const-dict - { @cdict null! } : flush-dict - { @cdict @ null? not } : have-dict? - - { flush-cont .indent type .":<{" cr - @curop @ ref@ " cr - } : show-ref-op - { flush-contY .indent rot type .":<{" cr - @curop @ ref@ " cr - } : show-cont-ref-op - { flush-cont .indent swap type .":<{" cr - @curop @ ref@+ " cr - } : show-ref2-op - - { flush-cont first atom>$ dup 5 $| drop "DICTI" $= swap - .indent type ." {" cr +indent @cdict @ @cdict null! unpair - rot { - swap .indent . ."=> <{" cr +indent disasm -indent .indent ."}>" cr true - } swap ' idictforeach ' dictforeach cond drop - -indent .indent ."}" cr - } : show-const-dict-op - - ( `PUSHCONT `PUSHREFCONT ) constant @PushContL - ( `REPEAT `UNTIL `IF `IFNOT `IFJMP `IFNOTJMP ) constant @CmdC1 - ( `IFREF `IFNOTREF `IFJMPREF `IFNOTJMPREF `CALLREF `JMPREF ) constant @CmdR1 - ( `DICTIGETJMP `DICTIGETJMPZ `DICTUGETJMP `DICTUGETJMPZ `DICTIGETEXEC `DICTUGETEXEC ) constant @JmpDictL - { dup first `DICTPUSHCONST eq? { - flush-cont @curop @ get-const-dict save-const-dict show-simple-op } { - dup first @JmpDictL list-member? have-dict? and { - flush-cont show-const-dict-op } { - flush-dict - dup first @PushContL list-member? { - drop @curop @ get-cont-body save-cont-body } { - dup first @CmdC1 list-member? have-cont? and { - flush-contY first atom>$ .curop? show-cont-op } { - dup first @CmdR1 list-member? { - flush-cont first atom>$ dup $len 3 - $| drop .curop? show-ref-op } { - dup first `WHILE eq? have-cont2? and { - drop "WHILE" "}>DO<{" .curop? show-cont2-op } { - dup first `IFELSE eq? have-cont2? and { - drop "IF" "}>ELSE<{" .curop? show-cont2-op } { - dup first dup `IFREFELSE eq? swap `IFELSEREF eq? or have-cont? and { - first `IFREFELSE eq? "IF" "}>ELSE<{" rot .curop? show-cont-ref-op } { - dup first `IFREFELSEREF eq? { - drop "IF" "}>ELSE<{" .curop? show-ref2-op } { - flush-cont show-simple-op - } cond } cond } cond } cond } cond } cond } cond } cond } cond - } : show-op - { dup @cp @ (vmoplen) dup 0> { 65536 /mod swap sr@+ swap dup @cp @ (vmopdump) parse-op swap s> true } { drop false } cond } : fetch-one-op - { { fetch-one-op } { swap @curop ! adjust-op show-op } while } : disasm-slice - { { disasm-slice dup sbitrefs 1- or 0= } { ref@ = { 2dup [] 3 pick 2 pick [] equal? { 1+ } { drop -1 } cond - } if } rot times - nip nip 0>= - } { drop 2drop false } cond - } { 2drop false } cond - } { eqv? } cond - } swap ! - // (a1 .. an) -- (an .. a1) - { null swap { dup null? not } { uncons swap rot cons swap } while drop } : list-reverse - // (a1 .. an) -- an Computes last element of non-empty list l - { { uncons dup null? { drop true } { nip false } cond } until } : list-last - // l l' -- l++l' Concatenates two lists - recursive list+ { - over null? { nip } { swap uncons rot list+ cons } cond - } swap ! - // l l' -- l'' -1 or 0, where l = l' ++ l'' - // Removes prefix from list - { { dup null? { drop true true } { - swap dup null? { 2drop false true } { // l' l - uncons swap rot uncons -rot equal? { false } { - 2drop false true - } cond } cond } cond } until - } : list- - // (a1 .. an) -- a1 .. an n Explodes a list - { 0 { over null? not } { swap uncons rot 1+ } while nip } : explode-list - // (a1 .. an) x -- a1 .. an n x Explodes a list under the topmost element - { swap explode-list dup 1+ roll } : explode-list-1 - // l -- t Transforms a list into a tuple with the same elements - { explode-list tuple } : list>tuple - // a1 ... an n x -- (a1 .. an) x - { null swap rot { -rot cons swap } swap times } : mklist-1 - // (s1 ... sn) -- s1+...+sn Concatenates a list of strings - { "" { over null? not } { swap uncons -rot $+ } while nip - } : concat-string-list - // (x1 ... xn) -- x1+...+xn Sums a list of integers - { 0 { over null? not } { swap uncons -rot + } while nip - } : sum-list - // (a1 ... an) a e -- e(...e(e(a,a1),a2),...),an) - { -rot { over null? not } { swap uncons -rot 3 pick execute } while nip nip - } : foldl - // (a1 ... an) e -- e(...e(e(a1,a2),a3),...),an) - { swap uncons swap rot foldl } : foldl-ne - // (a1 ... an) a e -- e(a1,e(a2,...,e(an,a)...)) - recursive foldr { - rot dup null? { 2drop } { - uncons -rot 2swap swap 3 pick foldr rot execute - } cond - } swap ! - // (a1 ... an) e -- e(a1,e(a2,...,e(a[n-1],an)...)) - recursive foldr-ne { - over cdr null? { drop car } { - swap uncons 2 pick foldr-ne rot execute - } cond - } swap ! - // (l1 ... ln) -- l1++...++ln Concatenates a list of lists - { dup null? { ' list+ foldr-ne } ifnot } : concat-list-lists - // (a1 .. an . t) n -- t Computes the n-th tail of a list - { ' cdr swap times } : list-tail - // (a0 .. an ..) n -- an Computes the n-th element of a list - { list-tail car } : list-ref - // l -- ? - { { dup null? { drop true true } { - dup pair? { cdr false } { - drop false true - } cond } cond } until - } : list? - // l -- n - { 0 { over null? not } { 1+ swap uncons nip swap } while nip - } : list-length - // l e -- t // returns tail of l after first member that satisfies e - { swap { - dup null? { nip true } { - tuck car over execute { drop true } { - swap cdr false - } cond } cond } until - } : list-tail-from - // a l -- t // tail of l after first occurence of a using eq? - { swap 1 ' eq? does list-tail-from } : list-member-eq - { swap 1 ' eqv? does list-tail-from } : list-member-eqv - { swap 1 ' equal? does list-tail-from } : list-member-equal - // a l -- ? - { list-member-eq null? not } : list-member? - { list-member-eqv null? not } : list-member-eqv? - // l -- a -1 or 0 // returns car l if l is non-empty - { dup null? { drop false } { car true } cond - } : safe-car - { dup null? { drop false } { car second true } cond - } : get-first-value - // l e -- v -1 or 0 - { list-tail-from safe-car } : assoc-gen - { list-tail-from get-first-value } : assoc-gen-x - // a l -- (a.v) -1 or 0 -- returns first entry (a . v) in l - { swap 1 { swap first eq? } does assoc-gen } : assq - { swap 1 { swap first eqv? } does assoc-gen } : assv - { swap 1 { swap first equal? } does assoc-gen } : assoc - // a l -- v -1 or 0 -- returns v from first entry (a . v) in l - { swap 1 { swap first eq? } does assoc-gen-x } : assq-val - { swap 1 { swap first eqv? } does assoc-gen-x } : assv-val - { swap 1 { swap first equal? } does assoc-gen-x } : assoc-val - // (a1 .. an) e -- (e(a1) .. e(an)) - recursive list-map { - over null? { drop } { - swap uncons -rot over execute -rot list-map cons - } cond - } swap ! - - variable ctxdump variable curctx - // (a1 .. an) e -- executes e for a1, ..., an - { ctxdump @ curctx @ ctxdump 2! curctx 2! - { curctx 2@ over null? not } { swap uncons rot tuck curctx 2! execute } - while 2drop ctxdump 2@ curctx ! ctxdump ! - } : list-foreach - forget ctxdump forget curctx - - // - // Experimental implementation of `for` loops with index - // - variable loopdump variable curloop - { curloop @ loopdump @ loopdump 2! } : push-loop-ctx - { loopdump 2@ loopdump ! curloop ! } : pop-loop-ctx - // ilast i0 e -- executes e for i=i0,i0+1,...,ilast-1 - { -rot 2dup > { - push-loop-ctx { - triple dup curloop ! first execute curloop @ untriple 1+ 2dup <= - } until pop-loop-ctx - } if 2drop drop - } : for - // ilast i0 e -- same as 'for', but pushes current index i before executing e - { -rot 2dup > { - push-loop-ctx { - triple dup curloop ! untriple nip swap execute curloop @ untriple 1+ 2dup <= - } until pop-loop-ctx - } if 2drop drop - } : for-i - // ( -- i ) Returns innermost loop index - { curloop @ third } : i - // ( -- j ) Returns outer loop index - { loopdump @ car third } : j - { loopdump @ cadr third } : k - forget curloop forget loopdump - - // - // create Lisp-style lists using words "(" and ")" - // - variable ') - 'nop box constant ', - { ") without (" abort } ') ! - { ') @ execute } : ) - anon constant dot-marker - // m x1 ... xn t m -- (x1 ... xn . t) - { swap - { -rot 2dup eq? not } - { over dot-marker eq? abort"invalid dotted list" - swap rot cons } while 2drop - } : list-tail-until-marker - // m x1 ... xn m -- (x1 ... xn) - { null swap list-tail-until-marker } : list-until-marker - { over dot-marker eq? { nip 2dup eq? abort"invalid dotted list" } - { null swap } cond - list-tail-until-marker - } : list-until-marker-ext - { ') @ ', @ } : ops-get - { ', ! ') ! } : ops-set - { anon dup ops-get 3 { ops-set list-until-marker-ext } does ') ! 'nop ', ! - } : ( - // test of Lisp-style lists - // ( 42 ( `+ 9 ( `* 3 4 ) ) "test" ) .l cr - // ( `eq? ( `* 3 4 ) 3 4 * ) .l cr - // `alpha ( `beta `gamma `delta ) cons .l cr - // { ( `eq? ( `* 3 5 pick ) 3 4 roll * ) } : 3*sample - // 17 3*sample .l cr - - // similar syntax _( x1 .. xn ) for tuples - { 2 { 1+ 2dup pick eq? } until 3 - nip } : count-to-marker - { count-to-marker tuple nip } : tuple-until-marker - { anon dup ops-get 3 { ops-set tuple-until-marker } does ') ! 'nop ', ! } : _( - // test of tuples - // _( _( 2 "two" ) _( 3 "three" ) _( 4 "four" ) ) .dump cr - - // pseudo-Lisp tokenizer - "()[]'" 34 hold constant lisp-delims - { lisp-delims 11 (word) } : lisp-token - { null cons `quote swap cons } : do-quote - { 1 { ', @ 2 { 2 { ', ! execute ', @ execute } does ', ! } - does ', ! } does - } : postpone-prefix - { ', @ 1 { ', ! } does ', ! } : postpone-', - ( `( ' ( pair - `) ' ) pair - `[ ' _( pair - `] ' ) pair - `' ' do-quote postpone-prefix pair - `. ' dot-marker postpone-prefix pair - `" { char " word } pair - `;; { 0 word drop postpone-', } pair - ) constant lisp-token-dict - variable eol - { eol @ eol 0! anon dup ') @ 'nop 3 - { ops-set list-until-marker-ext true eol ! } does ') ! rot ', ! - { lisp-token dup (number) dup { roll drop } { - drop atom dup lisp-token-dict assq { nip second execute } if - } cond - ', @ execute - eol @ - } until - -rot eol ! execute - } :_ List-generic( - { 'nop 'nop List-generic( } :_ LIST( - // LIST((lambda (x) (+ x 1)) (* 3 4)) - // LIST('(+ 3 4)) - // LIST(2 3 "test" . 9) - // LIST((process '[plus 3 4])) -} - -// -// TonUtil.fif -// - -/// Tests parsing of TonUtil.fif by embedding its contents -asm fun embedTonUtilFif() { - library TonUtil // TON Blockchain Fift Library - "Lists.fif" include - - -1 constant Masterchain - 0 constant Basechain - - // parse workchain id - // ( S -- workchain ) - { (number) 1- abort"workchain id must be an integer" - dup 32 fits not abort"workchain id must fit in 32 bits" - } : parse-workchain-id - - { (number) 1- abort"integer expected" } : parse-int - - { over null? ' swap if drop } : replace-if-null - - // Private key load/generate - // ( fname -- pubkey privkey ) - { dup ."Loading private key from file " type cr - file>B dup Blen 32 <> abort"Private key must be exactly 32 bytes long" - dup priv>pub swap - } : load-keypair - // ( fname -- pubkey privkey ) - { dup file-exists? - { load-keypair } - { dup newkeypair swap rot over swap B>file - rot ."Saved new private key to file " type cr - } cond - } : load-generate-keypair - - // Parse smart-contract address - // ( S -- workchain addr bounce? ) - { $>smca not abort"invalid smart-contract address" - 1 and 0= - } : parse-smc-addr - - // ( x -- ) Displays a 64-digit hex number - { 64 0x. } : 64x. - { 64 0X. } : 64X. - // ( wc addr -- ) Show address in : form - { swap ._ .":" 64x. } : .addr - // ( wc addr flags -- ) Show address in base64url form - { smca>$ type } : .Addr - // ( wc addr fname -- ) Save address to file in 36-byte format - { -rot 256 u>B swap 32 i>B B+ swap B>file } : save-address - // ( wc addr fname -- ) Save address and print message - { dup ."(Saving address to file " type .")" cr save-address - } : save-address-verbose - - // ( fname -- wc addr ) Load address from file - { file>B 32 B| - dup Blen { 32 B>i@ } { drop Basechain } cond - swap 256 B>u@ - } : load-address - // ( fname -- wc addr ) Load address from file and print message - { dup ."(Loading address from file " type .")" cr load-address - } : load-address-verbose - // Parse string as address or load address from file (if string is prefixed by @) - // ( S default-bounce -- workchain addr bounce? ) - { over $len 0= abort"empty smart-contract address" - swap dup 1 $| swap "@" $= - { nip load-address rot } { drop nip parse-smc-addr } cond - } : parse-load-address - - // ( hex-str -- addr ) Parses ADNL address - { dup $len 64 <> abort"ADNL address must consist of exactly 64 hexadecimal characters" - (hex-number) 1 <> abort"ADNL address must consist of 64 hexadecimal characters" - dup 256 ufits not abort"invalid ADNL address" - } : parse-adnl-address - - // ( b wc addr -- b' ) Serializes address into Builder b - { -rot 8 i, swap 256 u, } : addr, - { over 8 fits { rot b{100} s, -rot addr, } { - rot b{110} s, 256 9 u, rot 32 i, swap 256 u, } cond - } : Addr, - - // Gram utilities - 1000000000 constant Gram - { Gram swap */r } : Gram*/ - { Gram * } : Gram* - { (number) dup { 1- ' Gram*/ ' Gram* cond true } if - } : $>GR? - // ( S -- nanograms ) - { $>GR? not abort"not a valid Gram amount" - } : $>GR - { bl word $>GR 1 'nop } ::_ GR$ - // ( nanograms -- S ) - { dup abs <# ' # 9 times char . hold #s rot sign #> - nip -trailing0 } : (.GR) - { (.GR) ."GR$" type } : .GR_ - { .GR_ space } : .GR - - // b x -- b' ( serializes a Gram amount ) - { -1 { 1+ 2dup 8 * ufits } until - rot over 4 u, -rot 8 * u, } : Gram, - // s -- x s' ( deserializes a Gram amount ) - { 4 u@+ swap 8 * u@+ } : Gram@+ - // s -- x - { 4 u@+ swap 8 * u@ } : Gram@ - - // currency collections - // b x --> b' ( serializes a VarUInteger32 ) - { -1 { 1+ 2dup 8 * ufits } until - rot over 5 u, -rot 8 * u, } : VarUInt32, - // s --> x ( deserializes a VarUInteger32 ) - { 5 u@+ swap 8 * u@ } : VarUInt32@ - 32 constant cc-key-bits - ' VarUInt32, : val, - ' VarUInt32@ : val@ - // d k v -- d' - { cc - { dup null? { ."(null)" drop } { val@ ._ } cond } dup : .maybeVarUInt32 : .val - { swap cc-key-bits { rot { ."+" } if .val ."*$" ._ true true } idictforeach drop } : (.cc) - { false (.cc) { ."0" } ifnot } : .cc_ - { .cc_ space } : .cc - { true (.cc) drop } : .+cc_ - { .+cc_ space } : .+cc - { cc-key-bits { rot . ."-> " swap .val .val ."; " true } dictdiff drop cr } : show-cc-diff - { cc-key-bits { val@ swap val@ + val, true } dictmerge } : cc+ - { null swap cc-key-bits { val@ pair swap cons true } idictforeach drop } : cc>list-rev - { cc>list-rev list-reverse } : cc>list - forget val, forget val@ forget .val - - // ( S -- x -1 or 0 ) - { (number) dup 2 = { -rot 2drop } if 1 = } : int? - { int? dup { drop dup 0< { drop false } { true } cond } if } : pos-int? - // ( S -- k v -1 or 0 ) Parses expression * or *$ - { dup "*" $pos dup 0< { 2drop false } { - $| dup $len 2 < { 2drop false } { - 1 $| nip dup 1 $| swap "$" $= { swap } if drop - int? dup { over 32 fits { 2drop false } ifnot } if - not { drop false } { - swap pos-int? not { drop false } { - true - } cond } cond } cond } cond - } : cc-key-value? - // ( S -- D -1 or 0 ) Parses an extra currency collection - // e.g. "10000*$3+7777*$-11" means "10000 units of currency #3 and 7777 units of currency #-11" - { dictnew { // S D - swap dup "+" $pos dup 0< { drop null -rot } { $| 1 $| nip -rot } cond - cc-key-value? { +ccpair over null? dup { rot drop true } if } { 2drop false true } cond - } until - } : $>xcc? - { $>xcc? not abort"invalid extra currency collection" } : $>xcc - { char } word dup $len { $>xcc } { drop dictnew } cond 1 'nop } ::_ CX{ - - // complete currency collections - { $>xcc? { true } { drop false } cond } : end-parse-cc - // ( S -- x D -1 or 0 ) Parses a currency collection - // e.g. "1.2+300*$2" means "1200000000ng plus 300 units of currency #2" - { 0 swap dup "+" $pos dup 0< { drop dup - $>GR? { nip nip dictnew true } { end-parse-cc } cond - } { over swap $| swap $>GR? { 2swap 2drop swap 1 $| nip } { drop - } cond end-parse-cc } cond - } : $>cc? - { $>cc? not abort"invalid currency collection" } : $>cc - { char } word dup $len { $>cc } { drop 0 dictnew } cond 2 'nop } ::_ CC{ - // ( x D -- ) - { swap ?dup { .GR_ .+cc_ } { .cc_ } cond } : .GR+cc_ - { .GR+cc_ space } : .GR+cc - { -rot Gram, swap dict, } : Gram+cc, - - // Libraries - // ( -- D ) New empty library collection - ' dictnew : Libs{ - // ( D -- D ) Return library collection as dictionary - 'nop : }Libs - // ( D c x -- D' ) Add a public/private library c to collection D - { -rot B, swap ref, - } cond - } swap ! - // b S n -- b' - { swap $>B swap append-long-bytes } : append-long-string - // S -- c - { - } : simple-transfer-body - - // ( S -- x ) parse public key - { dup $len 48 <> abort"public key must be 48 characters long" - base64url>B dup Blen 36 <> abort"public key must be 48 characters long" - 34 B| 16 B>u@ over crc16 <> abort"crc16 mismatch in public key" - 16 B>u@+ 0x3ee6 <> abort"invalid tag in public key" - 256 B>u@ - } : parse-pubkey - { bl word parse-pubkey 1 'nop } ::_ PK' - // ( x -- S ) serialize public key - { 256 u>B B{3ee6} swap B+ dup crc16 16 u>B B+ B>base64 } : pubkey>$ - { pubkey>$ type } : .pubkey - - // ( S -- x ) parse validator-encoded public key - { base64>B dup Blen 36 <> abort"public key with magic must be 36 bytes long" - 4 B| swap 32 B>u@ 0xC6B41348 <> abort"unknown magic for public key (not Ed25519)" - } : parse-val-pubkey - { bl word parse-val-pubkey 1 'nop } ::_ VPK' - { char } word base64>B 1 'nop } ::_ B64{ - - // adnl address parser - { 256 u>B B{2D} swap B+ dup crc16 16 u>B B+ } : adnl-preconv - { swap 32 /mod dup 26 < { 65 } { 24 } cond + rot swap hold } : Base32# - { <# ' Base32# 8 times #> } : Base32#*8 - { "" over Blen 5 / { swap 40 B>u@+ Base32#*8 nip rot swap $+ } swap times nip } : B>Base32 - - // ( x -- S ) Converts an adnl-address from a 256-bit integer to a string - { adnl-preconv B>Base32 1 $| nip } : adnl>$ - - { 65 - dup 0>= { -33 and dup 26 < } { 41 + dup 25 > over 32 < and } cond ?dup nip } : Base32-digit? - { Base32-digit? not abort"not a Base32 digit" } : Base32-digit - { 0 { over $len } { swap 1 $| -rot (char) Base32-digit swap 5 << + } while nip } : Base32-number - { B{} { over $len } { swap 8 $| -rot Base32-number 40 u>B B+ } while nip } : Base32>B - - // ( S -- x ) Converts an adnl address from a string to 256-bit integer - { dup $len 55 <> abort"not 55 alphanumeric characters" "F" swap $+ Base32>B - 33 B| 16 B>u@ over crc16 <> abort"crc16 checksum mismatch" - 8 B>u@+ 0x2D <> abort"not a valid adnl address" 256 B>u@ } : $>adnl - - { 65 - dup 0>= { -33 and 10 + dup 16 < } { 17 + dup 0>= over 10 < and } cond ?dup nip } : hex-digit? - // ( S -- x -1 or 0 ) Parses a hexadecimal integer - { dup $len { - 0 { - 4 << swap 1 $| -rot (char) hex-digit? // S a d -1 or S a 0 - { + over $len 0= } { drop -1 true } cond - } until - dup 0< { 2drop false } { nip true } cond - } { drop false } cond - } : hex$>u? - // ( S -- x ) - { hex$>u? not abort"not a hexadecimal number" } : hex$>u - - { dup $len 64 = { hex$>u } { - dup $len 55 = { $>adnl } { - true abort"invalid adnl address" - } cond } cond - } : parse-adnl-addr - { adnl>$ type } : .adnl - { bl word parse-adnl-addr 1 'nop } ::_ adnl: - - // ( x a b -- a<=x<=b ) - { 2 pick >= -rot >= and } : in-range? - - // ( c i -- ? ) Checks whether c is a valid value for config param #i - def? config-valid? { - { nip 0>= { ."warning: cannot check validity of configuration parameter value, use create-state instead of fift to check validity" cr } if - true } : config-valid? - } ifnot - - { dup -1000 = { drop - { - // anycast_info$_ depth:(#<= 30) { depth >= 1 } - // rewrite_pfx:(bits depth) = Anycast; - 30 u@+ swap // get depth - - dup 1 > { - dup 2 roll swap u@+ // get rewrite_pfx - // return depth, rewrite_pfx, slice - } - { - drop // drop depth (<=1) - 0 0 2 roll // set anycast to none - } cond - } - { - 0 0 2 roll // set anycast to none - } cond - } : maybe-anycast - - // Rewrite first bits of addr with anycast info - { // input: anycast depth, rewrite_pfx, workchain, slice, address length - 4 -roll - 3 roll dup dup 0 = { 2drop 2 roll drop } - { - rot swap u@+ swap drop - 3 roll - // Get addr: addr_none$00 / addr_extern$01 / addr_std$10 / addr_var$11 - { // if greater that zero - dup 1 > - { - 2 = - { - // if addr_std$10 - // anycast:(Maybe Anycast) - // workchain_id:int8 - // address:bits256 = MsgAddressInt; - maybe-anycast // get anycast depth, bits, slice - 8 i@+ // get workchain - 256 parse-address-with-anycast - `addr-std swap - } - - { - // if addr_var$11 - // anycast:(Maybe Anycast) - // addr_len:(## 9) - // workchain_id:int32 - // address:(bits addr_len) = MsgAddressInt; - maybe-anycast // get anycast depth, bits, slice - 9 u@+ // get addr_len - 32 i@+ // get workchain - swap 2 -roll // move workchain to neede position - swap parse-address-with-anycast - `addr-var swap - } cond - - } - { - drop // drop header (dup for statment upper) - // if addr_extern$01 - // addr_extern$01 len:(## 9) - // external_address:(bits len) - 9 u@+ swap // bit len - u@+ // external_address - `addr-extern swap - } cond - } - { - swap - // if addr_none$00 - `addr-none swap - } cond - } : addr@+ - - { addr@+ drop } : addr@ - - // User-friendly prints output of addr@ - // (0 A or addr A or wc addr A -- ) - { - dup `addr-none eq? - { 2drop ."addr_none" } - { - `addr-extern eq? - { (dump) type } - { (x.) swap (dump) ":" $+ swap $+ type } - cond - } - cond - } : print-addr // print addr with workchain - - forget maybe-anycast - forget parse-address-with-anycast -} - -// -// Stack.fif -// - -/// Tests parsing of Stack.fif by embedding its contents -asm fun embedStackFif() { - library Stack // advanced stack manupulation library - "Lists.fif" include - // S(a b c - a c 2 a b) would compile to code performing the requested stack manipulation - - // interface to low-level stack manipulation primitives - { (number) 1- abort"index expected" dup 0 < over 255 > or - abort"index 0..255 expected" - } : (idx) - // push(n) : a0 .. an - a0 .. an a0 equivalent to "n pick" - // push(0) = dup, push(1) = over - { 0 char ) word (idx) } ::_ push( - // pop(n) : a0 a1 .. a(n-1) an - an a1 .. a(n-1) - // pop(0) = drop, pop(1) = nip - { 0 char ) word (idx) } ::_ pop( - // xchg(i,j) : equivalent to "i j exch2" - { 0 char , word (idx) char ) word (idx) } ::_ xchg( - // xchg0(i) : equivalent to "i exch" or "xchg(0,i)" - // xchg0(1) = swap - { 0 char ) word (idx) 0 } ::_ xchg0( - forget (idx) - - // parser for stack notation expressions - ")" 34 hold +" -" constant stk-delims - anon constant stk-start - anon constant stk-to - variable stk-mode - { stk-delims 11 (word) } : stk-token - 'nop : mk-lit - // stk-start vn ... v0 -- stk-start ... v0 i where v[i]=v0 - { 0 { - 1+ 2dup 2+ pick dup stk-start eq? { 2drop drop 0 true } { eqv? } cond - } until - } : stk-lookup - // stk-start a1 .. an stk-to b1 .. bm -- [a1 .. an] [b1 .. bm] - { stk-mode @ 0= abort"identifier expected" } : chk-lit - { stk-to list-until-marker stk-mode ! - stk-start list-until-marker stk-mode @ - stk-mode 0! - } : build-stk-effect - { stk-start stk-mode 0! { - stk-token dup ")" $= { drop true } { - dup "-" $= { - drop stk-mode @ abort"duplicate -" true stk-mode ! stk-to false } { - dup 34 chr $= { chk-lit drop char " word mk-lit false } { - dup (number) ?dup { chk-lit 1- { swap mk-lit -rot } if mk-lit nip false } { - atom dup `_ eq? { stk-mode @ abort"identifier expected" false } { - stk-lookup 0= stk-mode @ = { - stk-mode @ { atom>$ +" -?" } { atom>$ +" redefined" } cond abort } { - false - } cond } cond } cond } cond } cond } cond } until - stk-mode @ 0= abort"'-' expected" - build-stk-effect - } :_ parse-stk-list( - - // stack operation list construction - variable op-rlist - { op-rlist null! } : clear-op-list - { op-rlist @ list-reverse } : get-op-list - { op-rlist @ cons op-rlist ! } : issue-op - { minmax `xchg -rot triple } : op-xchg - { `push swap pair } : op-push - { `lit swap pair } : op-lit - { `pop swap pair } : op-pop - 0 op-pop constant op-drop - { 2dup <> { op-xchg issue-op } if } : issue-xchg - { op-push issue-op } : issue-push - { op-lit issue-op } : issue-lit - { op-pop issue-op } : issue-pop - { op-drop issue-op } : issue-drop - { ' issue-drop swap times } : issue-drop-# - - // emulated stack contents - variable emul-stk - { emul-stk @ count } : emul-depth - { emul-depth 1- swap - } : adj-i - { emul-depth 1- tuck swap - swap rot - swap } : adj-ij - // i j -- - { adj-ij 2dup emul-stk @ tuck swap [] swap rot [] rot // i sj si j - emul-stk @ -rot []= swap rot []= emul-stk ! - } : emul-xchg - { emul-stk @ tpop drop emul-stk ! } : emul-drop - // i -- - { 0 emul-xchg emul-drop } : emul-pop - // i -- s[i] - { emul-stk @ swap [] } : emul-stk[] - // i -- si - { adj-i emul-stk[] } : emul-get - { 0 emul-get } : emul-tos - // v i -- ? Check whether s[i]=v - { dup emul-depth < { emul-stk[] eqv? } { 2drop false } cond } : emul[]-eq? - // v -- i or -1 Returns maximum i with s[i]=v - { emul-stk @ dup count { // v s i - ?dup 0= { -1 true } { 1- 2dup [] 3 pick eqv? } cond // v s i' ? - } until nip nip - } : emul-stk-lookup-rev - // i -- - { emul-get emul-stk @ swap , emul-stk ! } : emul-push - { emul-stk @ swap , emul-stk ! } : emul-lit - // show emulated stack contents similarly to .s - { emul-stk @ explode dup 1 reverse ' .l swap times cr } : .e - - // both issue an operation and emulate it - { 2dup issue-xchg emul-xchg } : issue-emul-xchg - { dup issue-push emul-push } : issue-emul-push - { dup issue-lit emul-lit } : issue-emul-lit - { dup issue-pop emul-pop } : issue-emul-pop - { issue-drop emul-drop } : issue-emul-drop - { ' issue-emul-drop swap times } : issue-emul-drop-# - - // b.. s -- b.. s moves tos value to stk[s] - { dup emul-stk[] 2 pick cdr list-member-eqv? { - dup adj-i 0 issue-emul-xchg } { dup adj-i issue-emul-pop } cond - } : move-tos-to - - // new s -- ops registered - { { over null? not } { - // .sl .e get-op-list .l cr - // get-op-list list-length 100 > abort"too long" - emul-depth over > - { over emul-tos swap list-member-eqv? not } { false } cond { - // b.. s tos unneeded - issue-emul-drop } { - over car // b.. s b1 - 2dup swap emul[]-eq? { drop swap cdr swap 1+ } { - dup emul-stk-lookup-rev // b.. s b1 i - dup 0< { // b.. s b1 i not found, must be a literal - drop dup atom? abort"unavailable value" - issue-emul-lit } { - dup 3 pick < { // b.. s b1 i found in bottom s stack values - nip adj-i issue-emul-push // b.. s - dup emul-depth 1- < { move-tos-to } if - } { - emul-depth 1- over = { // b.. s b1 i found in tos - 2drop move-tos-to - } { // b.. s b1 i - nip over adj-ij issue-emul-xchg - } cond } cond } cond } cond } cond } while - nip emul-depth swap - issue-emul-drop-# - } : generate-reorder-ops - - // old new -- op-list - { emul-stk @ op-rlist @ 2swap - swap list>tuple emul-stk ! clear-op-list - 0 generate-reorder-ops get-op-list - -rot op-rlist ! emul-stk ! - } : generate-reorder - { parse-stk-list( generate-reorder } :_ SG( - - // op-list rewriting according to a ruleset - // l f l1 l2 -- l' -1 or l f with l' = l2 + (l - l1) - { push(3) rot list- { list+ nip nip true } { drop } cond - } : try-rule - // l f ll -- l' -1 or l f - { { dup null? not } { uncons 3 -roll unpair try-rule rot } while drop - } : try-ruleset - // l ll -- l' - { swap { over false swap try-ruleset 0= } until nip - } : try-ruleset* - // l ruleset -- l' - recursive try-ruleset*-everywhere { - tuck try-ruleset* dup null? { nip } { - uncons rot try-ruleset*-everywhere cons } cond - } swap ! - LIST( - [([xchg 0 1] [xchg 0 2]) ([rot])] - [([xchg 0 1] [xchg 1 2]) ([-rot])] - [([xchg 0 2] [xchg 1 2]) ([rot])] - [([xchg 0 2] [xchg 0 1]) ([-rot])] - [([xchg 1 2] [xchg 0 1]) ([rot])] - [([xchg 1 2] [xchg 0 2]) ([-rot])] - [([xchg 0 1] [rot]) ([xchg 0 2])] - [([-rot] [xchg 0 1]) ([xchg 0 2])] - [([xchg 0 2] [xchg 1 3]) ([2swap])] - [([xchg 1 3] [xchg 0 2]) ([2swap])] - [([push 1] [push 1]) ([2dup])] - [([push 3] [push 3]) ([2over])] - [([pop 0] [pop 0]) ([2drop])] - [([pop 1] [pop 0]) ([2drop])] - [([xchg 0 1] [push 1]) ([tuck])] - [([rot] [-rot]) ()] - [([-rot] [rot]) ()] - ) constant fift-stack-ruleset - { fift-stack-ruleset try-ruleset*-everywhere } : fift-ops-rewrite - { SG( fift-ops-rewrite } :_ SGF( - - // helpers for creating Fift source strings for one fift-op - // i j -- s - { minmax over { "xchg(" rot (.) $+ +"," swap (.) $+ +")" } - { nip dup 1 = { drop "swap" } { - ?dup { "xchg0(" swap (.) $+ +")" } { "" } cond - } cond } cond - } : source- - // i -- s - { dup 1 = { drop "over" } { - ?dup { "push(" swap (.) $+ +")" } { "dup" } cond - } cond - } : source- - // i -- s - { dup 1 = { drop "nip" } { - ?dup { "pop(" swap (.) $+ +")" } { "drop" } cond - } cond - } : source- - // lit -- s - { dup string? { char " chr swap $+ char " hold } { (.) } cond - } : source- - - // dictionary with all fift op compilation/source creation - { 0 swap (compile) } : fop-compile - ( _( `xchg 2 { fop-compile } { source- swap cons } ) - _( `push 1 { fop-compile } { source- swap cons } ) - _( `pop 1 { fop-compile } { source- swap cons } ) - _( `lit 1 { 1 'nop (compile) } { source- swap cons } ) - _( `rot 0 { ' rot fop-compile } { "rot" swap cons } ) - _( `-rot 0 { ' -rot fop-compile } { "-rot" swap cons } ) - _( `tuck 0 { ' tuck fop-compile } { "tuck" swap cons } ) - _( `2swap 0 { ' 2swap fop-compile } { "2swap" swap cons } ) - _( `2drop 0 { ' 2drop fop-compile } { "2drop" swap cons } ) - _( `2dup 0 { ' 2dup fop-compile } { "2dup" swap cons } ) - _( `2over 0 { ' 2over fop-compile } { "2over" swap cons } ) - ) box constant fift-op-dict - - { dup atom? { atom>$ } { drop "" } cond - "unknown operation " swap $+ abort - } : report-unknown-op - variable 'fop-entry-exec - // process fift-op according to 'fop-entry-exec - // ... op - ... - { dup first dup fift-op-dict @ assq { report-unknown-op } ifnot - dup second 1+ push(3) count <> abort"incorrect param count" - nip swap explode dup roll drop 1- roll // o2 .. on entry - 'fop-entry-exec @ execute - } : process-fift-op - - // compile op-list into Fift wordlist - // wl op-list -- wl' - { { third execute } 'fop-entry-exec ! - swap ' process-fift-op foldl } : compile-fift-op* - // op-list -- e - { fift-ops-rewrite ({) swap compile-fift-op* (}) } : ops>wdef - - // S( - ) compiles a "word" performing required action - { SG( ops>wdef 0 swap } ::_ S( - // 1 2 3 S(a b c - c a b a) .s would print 3 1 2 1 - - // transform op-list into Fift source - // ls op -- ls' - { fift-ops-rewrite - { 3 [] execute } 'fop-entry-exec ! - null ' process-fift-op foldl - dup null? { drop "" } { { +" " swap $+ } foldr-ne } cond - } : ops>$ - { SG( ops>$ 1 'nop } ::_ $S( - { SG( ops>$ type } :_ .$S( - // $S(a b c - b c a c a c) => string "rot 2dup over" - // S(a b c - b c a c a c) => compile/execute block { rot 2dup over } - // $S(_ x y _ - y x) => string "drop pop(2)" - // .$S(x1 x2 - 17 x1) => print string "drop 17 swap" - - // simplify/transform sequences of stack manipulation operations - LIST(. [a b c d e f g h i j]) constant std-stack - { stk-start std-stack explode drop stk-to std-stack explode drop - } : simplify<{ - { build-stk-effect generate-reorder ops>$ } : }>stack - // simplify<{ drop drop over over -13 }>stack => string "2drop 2dup -13" - // simplify<{ 17 rot }>stack => string "swap 17 swap" - // simplify<{ 5 1 reverse }>stack => string "xchg(1,5) xchg(2,4)" -} - -// -// GetOpt.fif -// - -/// Tests parsing of GetOpt.fif by embedding its contents -asm fun embedGetOptFif() { - library GetOpt // Simple command-line options parser - "Lists.fif" include - - // May be used as follows: - // begin-options - // "h" { ."Help Message" 0 halt } short-option - // "v" { parse-int =: verbosity } short-option-arg - // "i" "--interactive" { true =: interactive } short-long-option - // parse-options - - // ( l -- l') computes tail of list l if non-empty; else () - { dup null? ' cdr ifnot } : safe-cdr - // ( l c -- l') deletes first c elements from list l - { ' safe-cdr swap times } : list-delete-first - // ( l n c -- l' ) deletes c elements starting from n-th in list l - recursive list-delete-range { - dup 0<= { 2drop } { - over 0<= { nip list-delete-first } { - swap 1- swap rot uncons 2swap list-delete-range cons - } cond } cond - } swap ! - // ( n c -- ) deletes $n .. $(n+c-1) from the argument list $* - { swap 1- $* @ swap rot list-delete-range $* ! } : $*del.. - // ( s s' -- ? ) checks whether s' is a prefix of s - { tuck $len over $len over >= { $| drop $= } { 2drop drop false } cond - } : $pfx? - // ( s -- ? ) checks whether s is an option (a string beginning with '-') - { dup $len 1 > { "-" $pfx? } { drop false } cond } : is-opt? - // ( s -- ? ) checks whether s is a digit option - { 2 $| drop 1 $| nip $>B 8 B>u@ dup 57 <= swap 48 >= and } : is-digit-opt? - 0 box constant disable-digit-opts - // ( l -- s i or 0 ) finds first string in l beginning with '-' - { 0 { 1+ over null? { 2drop 0 true } { - swap uncons over is-opt? - { disable-digit-opts @ { over is-digit-opt? not } { true } cond } { false } cond - { drop swap true } { nip swap false } cond - } cond } until - } : list-find-opt - // ( -- s i or 0 ) finds first option in cmdline args - { $* @ list-find-opt } : first-opt - ' second : get-opt-flags - ' first : get-opt-exec - // ( s t -- ? ) checks whether short/long option s matches description t - { third $= } : short-option-matches - { dup get-opt-flags 4 and 0= 3 + [] $= - } : long-option-matches - // ( t -- s -1 or 0 ) extracts help message from description - { dup get-opt-flags 4 and 0= 4 + over count over > - { [] true } { 2drop false } cond - } : get-opt-help - // ( s l -- t -1 or 0 ) finds short/long option s in list l - { swap 1 { swap short-option-matches } does assoc-gen - } : lookup-short-option - { swap 1 { swap long-option-matches } does assoc-gen - } : lookup-long-option - // ( s -- s' null or s' s'' ) Splits long option --opt=arg at '=' - { dup "=" $pos 1+ ?dup { tuck $| swap rot 1- $| drop swap } { null } cond - } : split-longopt - // ( l -- f or 0 ) Extracts global option flags from first entry of l - { dup null? { drop 0 } { car get-opt-flags -256 and } cond - } : get-global-option-flags - variable options-list - // ( l -- i or 0 ) - // parses command line arguments according to option description list l - // and returns index i of first incorrect option - { dup options-list ! get-global-option-flags - 256 and disable-digit-opts ! - { first-opt dup 0= { true } { - swap dup "--" $pfx? { // i s - dup $len 2 = { drop dup 1 $*del.. 0 true } { - split-longopt swap options-list @ - lookup-long-option not { drop true } { // i s' t f - dup get-opt-exec swap get-opt-flags 3 and // i s' e f' - 2 pick null? { dup 1 = } { dup 0= negate } cond // i s' e f' f'' - dup 1 = { 2drop 2drop true } { - { drop nip over 1+ $() swap execute 2 $*del.. false } { - ' nip ifnot execute 1 $*del.. false - } cond } cond } cond } cond } { // i s - 1 $| nip { - dup $len 0= { drop 1 $*del.. false true } { - 1 $| swap options-list @ // i s' s l - lookup-short-option not { drop true true } { // i s' t - dup get-opt-exec swap get-opt-flags 3 and // i s' e f' - ?dup 0= { execute false } { - 2 pick $len { drop execute "" false } { - 2 = { nip null swap execute "" false } { // i e - nip over 1+ $() swap execute 2 $*del.. false true - } cond } cond } cond } cond } cond } until - } cond - } cond } until - } : getopt - // ( t -- ) Displays help message for one option - { dup get-opt-flags dup 4 and 2 pick third swap { - ."-" type ."/" over 3 [] type } { - dup $len { dup "--" $pfx? { ."-" } ifnot type } { - drop ."usage: " $0 type - } cond } cond - dup 3 and ?dup { - 2 = { ."[=]" } { ."=" } cond - } if - 8 and { 9 emit } ifnot - get-opt-help { type } { ."No help available" } cond cr - } : show-opt-help - // ( -- ) Displays options help message according to options-list - { options-list @ { dup null? not } { - uncons swap show-opt-help - } while drop - } : show-options-help - // ( l -- ) Parses options and throws an error on failure - { getopt ?dup { - $() "cannot parse command line options near `" swap $+ +"`" - show-options-help abort } if - } : run-getopt - anon constant opt-list-marker - ' opt-list-marker : begin-options - { opt-list-marker list-until-marker } : end-options - { end-options run-getopt } : parse-options - // ( s e -- o ) Creates short/long option s with execution token e - { 0 rot triple } dup : short-option : long-option - // ( s s' e -- o ) Creates a combined short option s and long option s' with execution token e - { 4 2swap 4 tuple } : short-long-option - { 1 rot triple } dup : short-option-arg : long-option-arg - { 2 rot triple } dup : short-option-?arg : long-option-?arg - { 5 2swap 4 tuple } : short-long-option-arg - { 6 2swap 4 tuple } : short-long-option-?arg - // ( o s -- s' ) Adds help message to option - ' , : option-help - // ( s f -- o ) Creates a generic help message - { swap 'nop rot "" 3 roll 4 tuple } : generic-help-setopt - { 0 generic-help-setopt } : generic-help - 256 constant disable-digit-options -} diff --git a/src/grammar/test-failed/items-asm-fun-6.tact b/src/grammar/test-failed/items-asm-fun-6.tact deleted file mode 100644 index 695744f9e..000000000 --- a/src/grammar/test-failed/items-asm-fun-6.tact +++ /dev/null @@ -1,3 +0,0 @@ -asm fun giganticBinary() { - b{000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110} -} diff --git a/src/grammar/test/expr-equality.spec.ts b/src/grammar/test/expr-equality.spec.ts index 77fe1614e..c53361f10 100644 --- a/src/grammar/test/expr-equality.spec.ts +++ b/src/grammar/test/expr-equality.spec.ts @@ -1,5 +1,6 @@ import { eqExpressions, getAstFactory } from "../ast"; import { getParser } from "../"; +import { defaultParser } from "../grammar"; type Test = { expr1: string; expr2: string; equality: boolean }; @@ -367,7 +368,7 @@ const initOfExpressions: Test[] = [ function testEquality(expr1: string, expr2: string, equal: boolean) { const ast = getAstFactory(); - const { parseExpression } = getParser(ast); + const { parseExpression } = getParser(ast, defaultParser); expect(eqExpressions(parseExpression(expr1), parseExpression(expr2))).toBe( equal, ); diff --git a/src/grammar/test/expr-is-value.spec.ts b/src/grammar/test/expr-is-value.spec.ts index 0ebee15cb..c4b75d3af 100644 --- a/src/grammar/test/expr-is-value.spec.ts +++ b/src/grammar/test/expr-is-value.spec.ts @@ -2,6 +2,7 @@ import { getAstFactory, isValue } from "../ast"; import { getParser } from "../"; +import { defaultParser } from "../grammar"; const valueExpressions: string[] = [ "1", @@ -53,7 +54,7 @@ const notValueExpressions: string[] = [ function testIsValue(expr: string, testResult: boolean) { const ast = getAstFactory(); - const { parseExpression } = getParser(ast); + const { parseExpression } = getParser(ast, defaultParser); expect(isValue(parseExpression(expr))).toBe(testResult); } diff --git a/src/imports/resolveImports.spec.ts b/src/imports/resolveImports.spec.ts index 8b65f14da..c67bdaa80 100644 --- a/src/imports/resolveImports.spec.ts +++ b/src/imports/resolveImports.spec.ts @@ -3,6 +3,7 @@ import { createNodeFileSystem } from "../vfs/createNodeFileSystem"; import path from "path"; import { getParser } from "../grammar"; import { getAstFactory } from "../grammar/ast"; +import { defaultParser } from "../grammar/grammar"; describe("resolveImports", () => { it("should resolve imports", () => { @@ -17,7 +18,7 @@ describe("resolveImports", () => { project, stdlib, entrypoint: "./main.tact", - parser: getParser(ast), + parser: getParser(ast, defaultParser), }); expect(resolved).toMatchObject({ func: [ diff --git a/src/interpreter.ts b/src/interpreter.ts index 2b9268cab..be27bee88 100644 --- a/src/interpreter.ts +++ b/src/interpreter.ts @@ -74,6 +74,7 @@ import { showValue, } from "./types/types"; import { sha256_sync } from "@ton/crypto"; +import { defaultParser } from "./grammar/grammar"; // TVM integers are signed 257-bit integers const minTvmInt: bigint = -(2n ** 256n); @@ -602,7 +603,7 @@ class EnvironmentStack { export function parseAndEvalExpression( sourceCode: string, ast: FactoryAst = getAstFactory(), - parser: Parser = getParser(ast), + parser: Parser = getParser(ast, defaultParser), ): EvalResult { try { const ast = parser.parseExpression(sourceCode); diff --git a/src/optimizer/test/partial-eval.spec.ts b/src/optimizer/test/partial-eval.spec.ts index 77c1e4ac0..8a23f4f0a 100644 --- a/src/optimizer/test/partial-eval.spec.ts +++ b/src/optimizer/test/partial-eval.spec.ts @@ -13,6 +13,7 @@ import { ExpressionTransformer, Rule } from "../types"; import { AssociativeRule3 } from "../associative"; import { evalBinaryOp, evalUnaryOp } from "../../interpreter"; import { getParser } from "../../grammar"; +import { defaultParser } from "../../grammar/grammar"; const MAX: string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"; @@ -316,7 +317,7 @@ const booleanExpressions = [ function testExpression(original: string, simplified: string) { it(`should simplify ${original} to ${simplified}`, () => { const ast = getAstFactory(); - const { parseExpression } = getParser(ast); + const { parseExpression } = getParser(ast, defaultParser); const util = getAstUtil(ast); const { partiallyEvalExpression } = getOptimizer(util); const originalValue = partiallyEvalExpression( @@ -340,7 +341,7 @@ function testExpressionWithOptimizer( ) { it(`should simplify ${original} to ${simplified}`, () => { const ast = getAstFactory(); - const { parseExpression } = getParser(ast); + const { parseExpression } = getParser(ast, defaultParser); const util = getAstUtil(ast); const originalValue = optimizer.applyRules( dummyEval(parseExpression(original), ast, util), diff --git a/src/pipeline/build.ts b/src/pipeline/build.ts index fc1d8dd1a..d13216484 100644 --- a/src/pipeline/build.ts +++ b/src/pipeline/build.ts @@ -22,6 +22,7 @@ import { getCompilerVersion } from "./version"; import { FactoryAst, getAstFactory, idText } from "../grammar/ast"; import { TactErrorCollection } from "../errors"; import { getParser, Parser } from "../grammar"; +import { defaultParser } from "../grammar/grammar"; export function enableFeatures( ctx: CompilerContext, @@ -61,7 +62,8 @@ export async function build(args: { ? createVirtualFileSystem(args.stdlib, files) : args.stdlib; const ast: FactoryAst = args.ast ?? getAstFactory(); - const parser: Parser = args.parser ?? getParser(ast); + const parser: Parser = + args.parser ?? getParser(ast, config.options?.parser ?? defaultParser); const logger: ILogger = args.logger ?? new Logger(); // Configure context diff --git a/src/storage/__snapshots__/resolveAllocation.spec.ts.snap b/src/storage/__snapshots__/resolveAllocation.spec.ts.snap index eac051980..18186e26f 100644 --- a/src/storage/__snapshots__/resolveAllocation.spec.ts.snap +++ b/src/storage/__snapshots__/resolveAllocation.spec.ts.snap @@ -124,7 +124,7 @@ exports[`resolveAllocation should write program 1`] = ` "loc": {}, "name": { "id": 28, - "kind": "type_id", + "kind": "id", "loc": {}, "text": "Point", }, @@ -311,7 +311,7 @@ exports[`resolveAllocation should write program 1`] = ` "loc": {}, "name": { "id": 36, - "kind": "type_id", + "kind": "id", "loc": {}, "text": "Point2", }, @@ -520,7 +520,7 @@ exports[`resolveAllocation should write program 1`] = ` "loc": {}, "name": { "id": 20, - "kind": "type_id", + "kind": "id", "loc": {}, "text": "Point3", }, @@ -1191,7 +1191,7 @@ exports[`resolveAllocation should write program 1`] = ` "loc": {}, "name": { "id": 41, - "kind": "type_id", + "kind": "id", "loc": {}, "text": "Deep", }, @@ -1864,7 +1864,7 @@ exports[`resolveAllocation should write program 1`] = ` "loc": {}, "name": { "id": 76, - "kind": "type_id", + "kind": "id", "loc": {}, "text": "Deep2", }, diff --git a/src/storage/resolveAllocation.spec.ts b/src/storage/resolveAllocation.spec.ts index f4f823556..e784bb90c 100644 --- a/src/storage/resolveAllocation.spec.ts +++ b/src/storage/resolveAllocation.spec.ts @@ -8,6 +8,7 @@ import { resolveSignatures } from "../types/resolveSignatures"; import path from "path"; import { getParser } from "../grammar"; import { getAstFactory } from "../grammar/ast"; +import { defaultParser } from "../grammar/grammar"; const stdlibPath = path.resolve(__dirname, "../../stdlib/std/primitives.tact"); const stdlib = fs.readFileSync(stdlibPath, "utf-8"); @@ -71,7 +72,7 @@ describe("resolveAllocation", () => { { code: src, path: "", origin: "user" }, ], [], - getParser(ast), + getParser(ast, defaultParser), ); ctx = resolveDescriptors(ctx, ast); ctx = resolveSignatures(ctx); diff --git a/src/test/compare.spec.ts b/src/test/compare.spec.ts index 46701de5b..c8e0fcca7 100644 --- a/src/test/compare.spec.ts +++ b/src/test/compare.spec.ts @@ -5,6 +5,7 @@ import { AstComparator } from "../grammar/compare"; import { CONTRACTS_DIR } from "./util"; import * as assert from "assert"; import { getAstFactory } from "../grammar/ast"; +import { defaultParser } from "../grammar/grammar"; describe("comparator", () => { it.each(fs.readdirSync(CONTRACTS_DIR, { withFileTypes: true }))( @@ -16,7 +17,7 @@ describe("comparator", () => { const filePath = join(CONTRACTS_DIR, dentry.name); const src = fs.readFileSync(filePath, "utf-8"); const Ast = getAstFactory(); - const { parse } = getParser(Ast); + const { parse } = getParser(Ast, defaultParser); const ast1 = parse(src, filePath, "user"); const ast2 = parse(src, filePath, "user"); assert.strictEqual( diff --git a/src/test/prettyPrinter.spec.ts b/src/test/prettyPrinter.spec.ts index be2e7067e..832dbf455 100644 --- a/src/test/prettyPrinter.spec.ts +++ b/src/test/prettyPrinter.spec.ts @@ -6,6 +6,7 @@ import { trimTrailingCR, CONTRACTS_DIR } from "./util"; import * as assert from "assert"; import JSONBig from "json-bigint"; import { getAstFactory } from "../grammar/ast"; +import { defaultParser } from "../grammar/grammar"; describe("formatter", () => { it.each(fs.readdirSync(CONTRACTS_DIR, { withFileTypes: true }))( @@ -15,7 +16,7 @@ describe("formatter", () => { return; } const Ast = getAstFactory(); - const { parse } = getParser(Ast); + const { parse } = getParser(Ast, defaultParser); const filePath = join(CONTRACTS_DIR, dentry.name); const src = trimTrailingCR(fs.readFileSync(filePath, "utf-8")); const ast = parse(src, filePath, "user"); @@ -37,7 +38,7 @@ describe("formatter", () => { return; } const Ast = getAstFactory(); - const { parse } = getParser(Ast); + const { parse } = getParser(Ast, defaultParser); const filePath = join(CONTRACTS_DIR, dentry.name); const src = fs.readFileSync(filePath, "utf-8"); const ast = parse(src, filePath, "user"); diff --git a/src/test/rename.spec.ts b/src/test/rename.spec.ts index 31e3fb6f5..c49e7b94a 100644 --- a/src/test/rename.spec.ts +++ b/src/test/rename.spec.ts @@ -6,6 +6,7 @@ import { trimTrailingCR, CONTRACTS_DIR } from "./util"; import * as assert from "assert"; import { getParser } from "../grammar"; import { getAstFactory } from "../grammar/ast"; +import { defaultParser } from "../grammar/grammar"; const EXPECTED_DIR = join(CONTRACTS_DIR, "renamer-expected"); @@ -17,7 +18,7 @@ describe("renamer", () => { return; } const ast = getAstFactory(); - const { parse } = getParser(ast); + const { parse } = getParser(ast, defaultParser); const expectedFilePath = join(EXPECTED_DIR, dentry.name); const expected = fs.readFileSync(expectedFilePath, "utf-8"); const filePath = join(CONTRACTS_DIR, dentry.name); diff --git a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap index 98f09ba25..1b1cd6331 100644 --- a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap +++ b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap @@ -691,7 +691,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-extends-fun 1`] = "loc": primitive Slice;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Slice, "text": "Slice", }, @@ -813,7 +813,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-extends-fun 1`] = "loc": primitive Cell;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Cell, "text": "Cell", }, @@ -849,7 +849,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-fun-no-arg-shuffl "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -975,7 +975,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-fun-no-ret-shuffl "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -1007,8 +1007,8 @@ exports[`resolveDescriptors should resolve descriptors for asm-fun-no-ret-shuffl "attributes": [], "id": 12, "instructions": [ - "DROP", - "DROP", + "DROP + DROP", ], "kind": "asm_function_def", "loc": asm(y x) fun foo(x: Int, y: Int) { @@ -1132,7 +1132,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-fun-no-shuffle 1` "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -1243,7 +1243,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-fun-shuffle-pair "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -1312,7 +1312,7 @@ exports[`resolveDescriptors should resolve descriptors for asm-fun-shuffle-pair "loc": struct Pair { fst: Int; snd: Int }, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Pair, "text": "Pair", }, @@ -1557,7 +1557,7 @@ exports[`resolveDescriptors should resolve descriptors for const-decl-struct-wit "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -1645,7 +1645,7 @@ exports[`resolveDescriptors should resolve descriptors for const-decl-struct-wit "loc": struct S { s: Int = 42 }, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": S, "text": "S", }, @@ -1728,7 +1728,7 @@ exports[`resolveDescriptors should resolve descriptors for const-decl-struct-wit "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -1815,7 +1815,7 @@ exports[`resolveDescriptors should resolve descriptors for const-decl-struct-wit "loc": struct S { s: Int? }, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": S, "text": "S", }, @@ -1897,7 +1897,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-bounced-slic "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -1926,7 +1926,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-bounced-slic "loc": primitive Slice;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Slice, "text": "Slice", }, @@ -2017,7 +2017,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-bounced-slic }, "name": { "id": 7, - "kind": "type_id", + "kind": "id", "loc": A, "text": "A", }, @@ -2335,7 +2335,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-bounced-too- "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -2364,7 +2364,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-bounced-too- "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -2500,7 +2500,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-bounced-too- }, "name": { "id": 7, - "kind": "type_id", + "kind": "id", "loc": A, "text": "A", }, @@ -2984,7 +2984,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -3174,10 +3174,10 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "type": "override", }, ], - "id": 14, + "id": 15, "initializer": { "base": 10, - "id": 13, + "id": 14, "kind": "number", "loc": 42, "value": 42n, @@ -3185,13 +3185,13 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "kind": "constant_def", "loc": override const Foo: Int = 42;, "name": { - "id": 11, + "id": 12, "kind": "id", "loc": Foo, "text": "Foo", }, "type": { - "id": 12, + "id": 13, "kind": "type_id", "loc": Int, "text": "Int", @@ -3211,7 +3211,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri }, "traits": [ { - "id": 15, + "id": 11, "kind": "id", "loc": T, "text": "T", @@ -3227,10 +3227,10 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "type": "override", }, ], - "id": 14, + "id": 15, "initializer": { "base": 10, - "id": 13, + "id": 14, "kind": "number", "loc": 42, "value": 42n, @@ -3238,13 +3238,13 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "kind": "constant_def", "loc": override const Foo: Int = 42;, "name": { - "id": 11, + "id": 12, "kind": "id", "loc": Foo, "text": "Foo", }, "type": { - "id": 12, + "id": 13, "kind": "type_id", "loc": Int, "text": "Int", @@ -3459,7 +3459,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -3663,10 +3663,10 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "type": "override", }, ], - "id": 15, + "id": 16, "initializer": { "base": 10, - "id": 14, + "id": 15, "kind": "number", "loc": 42, "value": 42n, @@ -3674,13 +3674,13 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "kind": "constant_def", "loc": override const Foo: Int = 42;, "name": { - "id": 12, + "id": 13, "kind": "id", "loc": Foo, "text": "Foo", }, "type": { - "id": 13, + "id": 14, "kind": "type_id", "loc": Int, "text": "Int", @@ -3700,7 +3700,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri }, "traits": [ { - "id": 16, + "id": 12, "kind": "id", "loc": T, "text": "T", @@ -3716,10 +3716,10 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "type": "override", }, ], - "id": 15, + "id": 16, "initializer": { "base": 10, - "id": 14, + "id": 15, "kind": "number", "loc": 42, "value": 42n, @@ -3727,13 +3727,13 @@ exports[`resolveDescriptors should resolve descriptors for contract-const-overri "kind": "constant_def", "loc": override const Foo: Int = 42;, "name": { - "id": 12, + "id": 13, "kind": "id", "loc": Foo, "text": "Foo", }, "type": { - "id": 13, + "id": 14, "kind": "type_id", "loc": Int, "text": "Int", @@ -3962,7 +3962,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-external-fal "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -4053,7 +4053,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-external-fal }, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": A, "text": "A", }, @@ -4383,7 +4383,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -4608,18 +4608,18 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr "type": "get", }, ], - "id": 15, + "id": 16, "kind": "function_def", "loc": override get fun getter(): Int { return 0 }, "name": { - "id": 11, + "id": 12, "kind": "id", "loc": getter, "text": "getter", }, "params": [], "return": { - "id": 12, + "id": 13, "kind": "type_id", "loc": Int, "text": "Int", @@ -4628,12 +4628,12 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr { "expression": { "base": 10, - "id": 13, + "id": 14, "kind": "number", "loc": 0, "value": 0n, }, - "id": 14, + "id": 15, "kind": "statement_return", "loc": return 0, }, @@ -4653,7 +4653,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr }, "traits": [ { - "id": 16, + "id": 11, "kind": "id", "loc": T, "text": "T", @@ -4679,18 +4679,18 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr "type": "get", }, ], - "id": 15, + "id": 16, "kind": "function_def", "loc": override get fun getter(): Int { return 0 }, "name": { - "id": 11, + "id": 12, "kind": "id", "loc": getter, "text": "getter", }, "params": [], "return": { - "id": 12, + "id": 13, "kind": "type_id", "loc": Int, "text": "Int", @@ -4699,12 +4699,12 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr { "expression": { "base": 10, - "id": 13, + "id": 14, "kind": "number", "loc": 0, "value": 0n, }, - "id": 14, + "id": 15, "kind": "statement_return", "loc": return 0, }, @@ -4956,7 +4956,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -5209,18 +5209,18 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr "type": "get", }, ], - "id": 17, + "id": 18, "kind": "function_def", "loc": override get fun getter(): Int { return 43 }, "name": { - "id": 13, + "id": 14, "kind": "id", "loc": getter, "text": "getter", }, "params": [], "return": { - "id": 14, + "id": 15, "kind": "type_id", "loc": Int, "text": "Int", @@ -5229,12 +5229,12 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr { "expression": { "base": 10, - "id": 15, + "id": 16, "kind": "number", "loc": 43, "value": 43n, }, - "id": 16, + "id": 17, "kind": "statement_return", "loc": return 43, }, @@ -5254,7 +5254,7 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr }, "traits": [ { - "id": 18, + "id": 13, "kind": "id", "loc": T, "text": "T", @@ -5280,18 +5280,18 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr "type": "get", }, ], - "id": 17, + "id": 18, "kind": "function_def", "loc": override get fun getter(): Int { return 43 }, "name": { - "id": 13, + "id": 14, "kind": "id", "loc": getter, "text": "getter", }, "params": [], "return": { - "id": 14, + "id": 15, "kind": "type_id", "loc": Int, "text": "Int", @@ -5300,12 +5300,12 @@ exports[`resolveDescriptors should resolve descriptors for contract-getter-overr { "expression": { "base": 10, - "id": 15, + "id": 16, "kind": "number", "loc": 43, "value": 43n, }, - "id": 16, + "id": 17, "kind": "statement_return", "loc": return 43, }, @@ -5585,7 +5585,7 @@ exports[`resolveDescriptors should resolve descriptors for fun-extends-opt-self "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -6355,7 +6355,7 @@ exports[`resolveDescriptors should resolve descriptors for init-vars-analysis-un "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -6384,7 +6384,7 @@ exports[`resolveDescriptors should resolve descriptors for init-vars-analysis-un "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -6784,7 +6784,7 @@ exports[`resolveDescriptors should resolve descriptors for item-funs-with-errors "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -6813,7 +6813,7 @@ exports[`resolveDescriptors should resolve descriptors for item-funs-with-errors "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -7095,7 +7095,7 @@ exports[`resolveDescriptors should resolve descriptors for item-funs-with-errors "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -7124,7 +7124,7 @@ exports[`resolveDescriptors should resolve descriptors for item-funs-with-errors "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -7210,7 +7210,7 @@ exports[`resolveDescriptors should resolve descriptors for item-funs-with-errors }, "name": { "id": 7, - "kind": "type_id", + "kind": "id", "loc": Point, "text": "Point", }, @@ -7770,7 +7770,7 @@ exports[`resolveDescriptors should resolve descriptors for item-method 1`] = ` "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -7893,7 +7893,7 @@ exports[`resolveDescriptors should resolve descriptors for item-method 1`] = ` "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -7963,7 +7963,7 @@ exports[`resolveDescriptors should resolve descriptors for item-native-decl 1`] "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -7992,7 +7992,7 @@ exports[`resolveDescriptors should resolve descriptors for item-native-decl 1`] "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -8074,17 +8074,17 @@ native sample(a: Int): Int;, }, "params": [ { - "id": 12, + "id": 11, "kind": "typed_parameter", "loc": a: Int, "name": { - "id": 10, + "id": 9, "kind": "id", "loc": a, "text": "a", }, "type": { - "id": 11, + "id": 10, "kind": "type_id", "loc": Int, "text": "Int", @@ -8092,7 +8092,7 @@ native sample(a: Int): Int;, }, ], "return": { - "id": 9, + "id": 12, "kind": "type_id", "loc": Int, "text": "Int", @@ -8111,7 +8111,7 @@ native sample(a: Int): Int;, { "loc": a: Int, "name": { - "id": 10, + "id": 9, "kind": "id", "loc": a, "text": "a", @@ -8142,7 +8142,7 @@ exports[`resolveDescriptors should resolve descriptors for item-native-mutating- "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -8183,17 +8183,17 @@ mutates extends native inc(self: Int): Int;, }, "params": [ { - "id": 12, + "id": 11, "kind": "typed_parameter", "loc": self: Int, "name": { - "id": 10, + "id": 9, "kind": "id", "loc": self, "text": "self", }, "type": { - "id": 11, + "id": 10, "kind": "type_id", "loc": Int, "text": "Int", @@ -8201,7 +8201,7 @@ mutates extends native inc(self: Int): Int;, }, ], "return": { - "id": 9, + "id": 12, "kind": "type_id", "loc": Int, "text": "Int", @@ -8249,7 +8249,7 @@ mutates extends native inc(self: Int): Int;, "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -8319,7 +8319,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -8425,7 +8425,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "type": "get", }, ], - "id": 48, + "id": 52, "kind": "function_def", "loc": get fun test(): Int { let m: map = emptyMap(); @@ -8499,20 +8499,20 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "args": [ { "base": 10, - "id": 24, + "id": 25, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 25, + "id": 26, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 26, + "id": 27, "kind": "method_call", "loc": m.set(1, 2), "method": { @@ -8528,7 +8528,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "text": "m", }, }, - "id": 27, + "id": 28, "kind": "statement_expression", "loc": m.set(1, 2);, }, @@ -8537,75 +8537,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "args": [ { "base": 10, - "id": 32, + "id": 34, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 33, + "id": 35, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 34, + "id": 36, "kind": "method_call", "loc": self.m.set(1, 2), "method": { - "id": 31, + "id": 32, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 28, + "id": 29, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 29, + "id": 30, "kind": "id", "loc": m, "text": "m", }, - "id": 30, + "id": 31, "kind": "field_access", "loc": self.m, }, }, - "id": 35, + "id": 37, "kind": "statement_expression", "loc": self.m.set(1, 2);, }, { "expression": { - "id": 46, + "id": 50, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 38, + "id": 41, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 39, + "id": 42, "kind": "method_call", "loc": m.get(1), "method": { - "id": 37, + "id": 39, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 36, + "id": 38, "kind": "id", "loc": m, "text": "m", @@ -8617,48 +8617,48 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "args": [ { "base": 10, - "id": 44, + "id": 48, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 45, + "id": 49, "kind": "method_call", "loc": self.m.get(1), "method": { - "id": 43, + "id": 46, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 40, + "id": 43, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 41, + "id": 44, "kind": "id", "loc": m, "text": "m", }, - "id": 42, + "id": 45, "kind": "field_access", "loc": self.m, }, }, }, - "id": 47, + "id": 51, "kind": "statement_return", "loc": return m.get(1) + self.m.get(1);, }, ], }, ], - "id": 49, + "id": 53, "kind": "contract", "loc": contract Main { m: map; @@ -8754,7 +8754,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "type": "get", }, ], - "id": 48, + "id": 52, "kind": "function_def", "loc": get fun test(): Int { let m: map = emptyMap(); @@ -8828,20 +8828,20 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "args": [ { "base": 10, - "id": 24, + "id": 25, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 25, + "id": 26, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 26, + "id": 27, "kind": "method_call", "loc": m.set(1, 2), "method": { @@ -8857,7 +8857,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "text": "m", }, }, - "id": 27, + "id": 28, "kind": "statement_expression", "loc": m.set(1, 2);, }, @@ -8866,75 +8866,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "args": [ { "base": 10, - "id": 32, + "id": 34, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 33, + "id": 35, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 34, + "id": 36, "kind": "method_call", "loc": self.m.set(1, 2), "method": { - "id": 31, + "id": 32, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 28, + "id": 29, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 29, + "id": 30, "kind": "id", "loc": m, "text": "m", }, - "id": 30, + "id": 31, "kind": "field_access", "loc": self.m, }, }, - "id": 35, + "id": 37, "kind": "statement_expression", "loc": self.m.set(1, 2);, }, { "expression": { - "id": 46, + "id": 50, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 38, + "id": 41, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 39, + "id": 42, "kind": "method_call", "loc": m.get(1), "method": { - "id": 37, + "id": 39, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 36, + "id": 38, "kind": "id", "loc": m, "text": "m", @@ -8946,41 +8946,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "args": [ { "base": 10, - "id": 44, + "id": 48, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 45, + "id": 49, "kind": "method_call", "loc": self.m.get(1), "method": { - "id": 43, + "id": 46, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 40, + "id": 43, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 41, + "id": 44, "kind": "id", "loc": m, "text": "m", }, - "id": 42, + "id": 45, "kind": "field_access", "loc": self.m, }, }, }, - "id": 47, + "id": 51, "kind": "statement_return", "loc": return m.get(1) + self.m.get(1);, }, @@ -9011,7 +9011,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-coins 1` "header": null, "init": { "ast": { - "id": 51, + "id": 55, "kind": "contract_init", "loc": contract Main { m: map; @@ -9088,7 +9088,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -9231,7 +9231,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "type": "get", }, ], - "id": 54, + "id": 58, "kind": "function_def", "loc": get fun test1(): Int { let m1: map = emptyMap(); @@ -9305,20 +9305,20 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 30, + "id": 31, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 31, + "id": 32, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 32, + "id": 33, "kind": "method_call", "loc": m1.set(1, 2), "method": { @@ -9334,7 +9334,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "text": "m1", }, }, - "id": 33, + "id": 34, "kind": "statement_expression", "loc": m1.set(1, 2);, }, @@ -9343,75 +9343,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 38, + "id": 40, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 39, + "id": 41, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 40, + "id": 42, "kind": "method_call", "loc": self.m1.set(1, 2), "method": { - "id": 37, + "id": 38, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 34, + "id": 35, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 35, + "id": 36, "kind": "id", "loc": m1, "text": "m1", }, - "id": 36, + "id": 37, "kind": "field_access", "loc": self.m1, }, }, - "id": 41, + "id": 43, "kind": "statement_expression", "loc": self.m1.set(1, 2);, }, { "expression": { - "id": 52, + "id": 56, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 44, + "id": 47, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 45, + "id": 48, "kind": "method_call", "loc": m1.get(1), "method": { - "id": 43, + "id": 45, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 42, + "id": 44, "kind": "id", "loc": m1, "text": "m1", @@ -9423,41 +9423,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 50, + "id": 54, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 51, + "id": 55, "kind": "method_call", "loc": self.m1.get(1), "method": { - "id": 49, + "id": 52, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 46, + "id": 49, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 47, + "id": 50, "kind": "id", "loc": m1, "text": "m1", }, - "id": 48, + "id": 51, "kind": "field_access", "loc": self.m1, }, }, }, - "id": 53, + "id": 57, "kind": "statement_return", "loc": return m1.get(1) + self.m1.get(1);, }, @@ -9472,7 +9472,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "type": "get", }, ], - "id": 91, + "id": 99, "kind": "function_def", "loc": get fun test2(): Int { let m2: map = emptyMap(); @@ -9481,14 +9481,14 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 return m2.get(1) + self.m2.get(1); }, "name": { - "id": 55, + "id": 59, "kind": "id", "loc": test2, "text": "test2", }, "params": [], "return": { - "id": 56, + "id": 60, "kind": "type_id", "loc": Int, "text": "Int", @@ -9498,29 +9498,29 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "expression": { "args": [], "function": { - "id": 62, + "id": 66, "kind": "id", "loc": emptyMap, "text": "emptyMap", }, - "id": 63, + "id": 67, "kind": "static_call", "loc": emptyMap(), }, - "id": 64, + "id": 68, "kind": "statement_let", "loc": let m2: map = emptyMap();, "name": { - "id": 57, + "id": 61, "kind": "id", "loc": m2, "text": "m2", }, "type": { - "id": 61, + "id": 65, "keyStorageType": null, "keyType": { - "id": 58, + "id": 62, "kind": "type_id", "loc": Int, "text": "Int", @@ -9528,13 +9528,13 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "kind": "map_type", "loc": map, "valueStorageType": { - "id": 60, + "id": 64, "kind": "id", "loc": varint32, "text": "varint32", }, "valueType": { - "id": 59, + "id": 63, "kind": "type_id", "loc": Int, "text": "Int", @@ -9546,36 +9546,36 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 67, + "id": 72, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 68, + "id": 73, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 69, + "id": 74, "kind": "method_call", "loc": m2.set(1, 2), "method": { - "id": 66, + "id": 70, "kind": "id", "loc": set, "text": "set", }, "self": { - "id": 65, + "id": 69, "kind": "id", "loc": m2, "text": "m2", }, }, - "id": 70, + "id": 75, "kind": "statement_expression", "loc": m2.set(1, 2);, }, @@ -9584,75 +9584,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 75, + "id": 81, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 76, + "id": 82, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 77, + "id": 83, "kind": "method_call", "loc": self.m2.set(1, 2), "method": { - "id": 74, + "id": 79, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 71, + "id": 76, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 72, + "id": 77, "kind": "id", "loc": m2, "text": "m2", }, - "id": 73, + "id": 78, "kind": "field_access", "loc": self.m2, }, }, - "id": 78, + "id": 84, "kind": "statement_expression", "loc": self.m2.set(1, 2);, }, { "expression": { - "id": 89, + "id": 97, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 81, + "id": 88, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 82, + "id": 89, "kind": "method_call", "loc": m2.get(1), "method": { - "id": 80, + "id": 86, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 79, + "id": 85, "kind": "id", "loc": m2, "text": "m2", @@ -9664,48 +9664,48 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 87, + "id": 95, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 88, + "id": 96, "kind": "method_call", "loc": self.m2.get(1), "method": { - "id": 86, + "id": 93, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 83, + "id": 90, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 84, + "id": 91, "kind": "id", "loc": m2, "text": "m2", }, - "id": 85, + "id": 92, "kind": "field_access", "loc": self.m2, }, }, }, - "id": 90, + "id": 98, "kind": "statement_return", "loc": return m2.get(1) + self.m2.get(1);, }, ], }, ], - "id": 92, + "id": 100, "kind": "contract", "loc": contract Main { m1: map; @@ -9870,7 +9870,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "type": "get", }, ], - "id": 54, + "id": 58, "kind": "function_def", "loc": get fun test1(): Int { let m1: map = emptyMap(); @@ -9944,20 +9944,20 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 30, + "id": 31, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 31, + "id": 32, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 32, + "id": 33, "kind": "method_call", "loc": m1.set(1, 2), "method": { @@ -9973,7 +9973,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "text": "m1", }, }, - "id": 33, + "id": 34, "kind": "statement_expression", "loc": m1.set(1, 2);, }, @@ -9982,75 +9982,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 38, + "id": 40, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 39, + "id": 41, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 40, + "id": 42, "kind": "method_call", "loc": self.m1.set(1, 2), "method": { - "id": 37, + "id": 38, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 34, + "id": 35, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 35, + "id": 36, "kind": "id", "loc": m1, "text": "m1", }, - "id": 36, + "id": 37, "kind": "field_access", "loc": self.m1, }, }, - "id": 41, + "id": 43, "kind": "statement_expression", "loc": self.m1.set(1, 2);, }, { "expression": { - "id": 52, + "id": 56, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 44, + "id": 47, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 45, + "id": 48, "kind": "method_call", "loc": m1.get(1), "method": { - "id": 43, + "id": 45, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 42, + "id": 44, "kind": "id", "loc": m1, "text": "m1", @@ -10062,41 +10062,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 50, + "id": 54, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 51, + "id": 55, "kind": "method_call", "loc": self.m1.get(1), "method": { - "id": 49, + "id": 52, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 46, + "id": 49, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 47, + "id": 50, "kind": "id", "loc": m1, "text": "m1", }, - "id": 48, + "id": 51, "kind": "field_access", "loc": self.m1, }, }, }, - "id": 53, + "id": 57, "kind": "statement_return", "loc": return m1.get(1) + self.m1.get(1);, }, @@ -10133,7 +10133,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "type": "get", }, ], - "id": 91, + "id": 99, "kind": "function_def", "loc": get fun test2(): Int { let m2: map = emptyMap(); @@ -10142,14 +10142,14 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 return m2.get(1) + self.m2.get(1); }, "name": { - "id": 55, + "id": 59, "kind": "id", "loc": test2, "text": "test2", }, "params": [], "return": { - "id": 56, + "id": 60, "kind": "type_id", "loc": Int, "text": "Int", @@ -10159,29 +10159,29 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "expression": { "args": [], "function": { - "id": 62, + "id": 66, "kind": "id", "loc": emptyMap, "text": "emptyMap", }, - "id": 63, + "id": 67, "kind": "static_call", "loc": emptyMap(), }, - "id": 64, + "id": 68, "kind": "statement_let", "loc": let m2: map = emptyMap();, "name": { - "id": 57, + "id": 61, "kind": "id", "loc": m2, "text": "m2", }, "type": { - "id": 61, + "id": 65, "keyStorageType": null, "keyType": { - "id": 58, + "id": 62, "kind": "type_id", "loc": Int, "text": "Int", @@ -10189,13 +10189,13 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "kind": "map_type", "loc": map, "valueStorageType": { - "id": 60, + "id": 64, "kind": "id", "loc": varint32, "text": "varint32", }, "valueType": { - "id": 59, + "id": 63, "kind": "type_id", "loc": Int, "text": "Int", @@ -10207,36 +10207,36 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 67, + "id": 72, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 68, + "id": 73, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 69, + "id": 74, "kind": "method_call", "loc": m2.set(1, 2), "method": { - "id": 66, + "id": 70, "kind": "id", "loc": set, "text": "set", }, "self": { - "id": 65, + "id": 69, "kind": "id", "loc": m2, "text": "m2", }, }, - "id": 70, + "id": 75, "kind": "statement_expression", "loc": m2.set(1, 2);, }, @@ -10245,75 +10245,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 75, + "id": 81, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 76, + "id": 82, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 77, + "id": 83, "kind": "method_call", "loc": self.m2.set(1, 2), "method": { - "id": 74, + "id": 79, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 71, + "id": 76, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 72, + "id": 77, "kind": "id", "loc": m2, "text": "m2", }, - "id": 73, + "id": 78, "kind": "field_access", "loc": self.m2, }, }, - "id": 78, + "id": 84, "kind": "statement_expression", "loc": self.m2.set(1, 2);, }, { "expression": { - "id": 89, + "id": 97, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 81, + "id": 88, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 82, + "id": 89, "kind": "method_call", "loc": m2.get(1), "method": { - "id": 80, + "id": 86, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 79, + "id": 85, "kind": "id", "loc": m2, "text": "m2", @@ -10325,41 +10325,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "args": [ { "base": 10, - "id": 87, + "id": 95, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 88, + "id": 96, "kind": "method_call", "loc": self.m2.get(1), "method": { - "id": 86, + "id": 93, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 83, + "id": 90, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 84, + "id": 91, "kind": "id", "loc": m2, "text": "m2", }, - "id": 85, + "id": 92, "kind": "field_access", "loc": self.m2, }, }, }, - "id": 90, + "id": 98, "kind": "statement_return", "loc": return m2.get(1) + self.m2.get(1);, }, @@ -10390,7 +10390,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varint 1 "header": null, "init": { "ast": { - "id": 94, + "id": 102, "kind": "contract_init", "loc": contract Main { m1: map; @@ -10475,7 +10475,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -10618,7 +10618,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "type": "get", }, ], - "id": 54, + "id": 58, "kind": "function_def", "loc": get fun test1(): Int { let m1: map = emptyMap(); @@ -10692,20 +10692,20 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 30, + "id": 31, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 31, + "id": 32, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 32, + "id": 33, "kind": "method_call", "loc": m1.set(1, 2), "method": { @@ -10721,7 +10721,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "text": "m1", }, }, - "id": 33, + "id": 34, "kind": "statement_expression", "loc": m1.set(1, 2);, }, @@ -10730,75 +10730,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 38, + "id": 40, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 39, + "id": 41, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 40, + "id": 42, "kind": "method_call", "loc": self.m1.set(1, 2), "method": { - "id": 37, + "id": 38, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 34, + "id": 35, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 35, + "id": 36, "kind": "id", "loc": m1, "text": "m1", }, - "id": 36, + "id": 37, "kind": "field_access", "loc": self.m1, }, }, - "id": 41, + "id": 43, "kind": "statement_expression", "loc": self.m1.set(1, 2);, }, { "expression": { - "id": 52, + "id": 56, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 44, + "id": 47, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 45, + "id": 48, "kind": "method_call", "loc": m1.get(1), "method": { - "id": 43, + "id": 45, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 42, + "id": 44, "kind": "id", "loc": m1, "text": "m1", @@ -10810,41 +10810,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 50, + "id": 54, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 51, + "id": 55, "kind": "method_call", "loc": self.m1.get(1), "method": { - "id": 49, + "id": 52, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 46, + "id": 49, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 47, + "id": 50, "kind": "id", "loc": m1, "text": "m1", }, - "id": 48, + "id": 51, "kind": "field_access", "loc": self.m1, }, }, }, - "id": 53, + "id": 57, "kind": "statement_return", "loc": return m1.get(1) + self.m1.get(1);, }, @@ -10859,7 +10859,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "type": "get", }, ], - "id": 91, + "id": 99, "kind": "function_def", "loc": get fun test2(): Int { let m2: map = emptyMap(); @@ -10868,14 +10868,14 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint return m2.get(1) + self.m2.get(1); }, "name": { - "id": 55, + "id": 59, "kind": "id", "loc": test2, "text": "test2", }, "params": [], "return": { - "id": 56, + "id": 60, "kind": "type_id", "loc": Int, "text": "Int", @@ -10885,29 +10885,29 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "expression": { "args": [], "function": { - "id": 62, + "id": 66, "kind": "id", "loc": emptyMap, "text": "emptyMap", }, - "id": 63, + "id": 67, "kind": "static_call", "loc": emptyMap(), }, - "id": 64, + "id": 68, "kind": "statement_let", "loc": let m2: map = emptyMap();, "name": { - "id": 57, + "id": 61, "kind": "id", "loc": m2, "text": "m2", }, "type": { - "id": 61, + "id": 65, "keyStorageType": null, "keyType": { - "id": 58, + "id": 62, "kind": "type_id", "loc": Int, "text": "Int", @@ -10915,13 +10915,13 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "kind": "map_type", "loc": map, "valueStorageType": { - "id": 60, + "id": 64, "kind": "id", "loc": varuint32, "text": "varuint32", }, "valueType": { - "id": 59, + "id": 63, "kind": "type_id", "loc": Int, "text": "Int", @@ -10933,36 +10933,36 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 67, + "id": 72, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 68, + "id": 73, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 69, + "id": 74, "kind": "method_call", "loc": m2.set(1, 2), "method": { - "id": 66, + "id": 70, "kind": "id", "loc": set, "text": "set", }, "self": { - "id": 65, + "id": 69, "kind": "id", "loc": m2, "text": "m2", }, }, - "id": 70, + "id": 75, "kind": "statement_expression", "loc": m2.set(1, 2);, }, @@ -10971,75 +10971,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 75, + "id": 81, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 76, + "id": 82, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 77, + "id": 83, "kind": "method_call", "loc": self.m2.set(1, 2), "method": { - "id": 74, + "id": 79, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 71, + "id": 76, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 72, + "id": 77, "kind": "id", "loc": m2, "text": "m2", }, - "id": 73, + "id": 78, "kind": "field_access", "loc": self.m2, }, }, - "id": 78, + "id": 84, "kind": "statement_expression", "loc": self.m2.set(1, 2);, }, { "expression": { - "id": 89, + "id": 97, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 81, + "id": 88, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 82, + "id": 89, "kind": "method_call", "loc": m2.get(1), "method": { - "id": 80, + "id": 86, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 79, + "id": 85, "kind": "id", "loc": m2, "text": "m2", @@ -11051,48 +11051,48 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 87, + "id": 95, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 88, + "id": 96, "kind": "method_call", "loc": self.m2.get(1), "method": { - "id": 86, + "id": 93, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 83, + "id": 90, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 84, + "id": 91, "kind": "id", "loc": m2, "text": "m2", }, - "id": 85, + "id": 92, "kind": "field_access", "loc": self.m2, }, }, }, - "id": 90, + "id": 98, "kind": "statement_return", "loc": return m2.get(1) + self.m2.get(1);, }, ], }, ], - "id": 92, + "id": 100, "kind": "contract", "loc": contract Main { m1: map; @@ -11257,7 +11257,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "type": "get", }, ], - "id": 54, + "id": 58, "kind": "function_def", "loc": get fun test1(): Int { let m1: map = emptyMap(); @@ -11331,20 +11331,20 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 30, + "id": 31, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 31, + "id": 32, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 32, + "id": 33, "kind": "method_call", "loc": m1.set(1, 2), "method": { @@ -11360,7 +11360,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "text": "m1", }, }, - "id": 33, + "id": 34, "kind": "statement_expression", "loc": m1.set(1, 2);, }, @@ -11369,75 +11369,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 38, + "id": 40, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 39, + "id": 41, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 40, + "id": 42, "kind": "method_call", "loc": self.m1.set(1, 2), "method": { - "id": 37, + "id": 38, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 34, + "id": 35, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 35, + "id": 36, "kind": "id", "loc": m1, "text": "m1", }, - "id": 36, + "id": 37, "kind": "field_access", "loc": self.m1, }, }, - "id": 41, + "id": 43, "kind": "statement_expression", "loc": self.m1.set(1, 2);, }, { "expression": { - "id": 52, + "id": 56, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 44, + "id": 47, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 45, + "id": 48, "kind": "method_call", "loc": m1.get(1), "method": { - "id": 43, + "id": 45, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 42, + "id": 44, "kind": "id", "loc": m1, "text": "m1", @@ -11449,41 +11449,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 50, + "id": 54, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 51, + "id": 55, "kind": "method_call", "loc": self.m1.get(1), "method": { - "id": 49, + "id": 52, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 46, + "id": 49, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 47, + "id": 50, "kind": "id", "loc": m1, "text": "m1", }, - "id": 48, + "id": 51, "kind": "field_access", "loc": self.m1, }, }, }, - "id": 53, + "id": 57, "kind": "statement_return", "loc": return m1.get(1) + self.m1.get(1);, }, @@ -11520,7 +11520,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "type": "get", }, ], - "id": 91, + "id": 99, "kind": "function_def", "loc": get fun test2(): Int { let m2: map = emptyMap(); @@ -11529,14 +11529,14 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint return m2.get(1) + self.m2.get(1); }, "name": { - "id": 55, + "id": 59, "kind": "id", "loc": test2, "text": "test2", }, "params": [], "return": { - "id": 56, + "id": 60, "kind": "type_id", "loc": Int, "text": "Int", @@ -11546,29 +11546,29 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "expression": { "args": [], "function": { - "id": 62, + "id": 66, "kind": "id", "loc": emptyMap, "text": "emptyMap", }, - "id": 63, + "id": 67, "kind": "static_call", "loc": emptyMap(), }, - "id": 64, + "id": 68, "kind": "statement_let", "loc": let m2: map = emptyMap();, "name": { - "id": 57, + "id": 61, "kind": "id", "loc": m2, "text": "m2", }, "type": { - "id": 61, + "id": 65, "keyStorageType": null, "keyType": { - "id": 58, + "id": 62, "kind": "type_id", "loc": Int, "text": "Int", @@ -11576,13 +11576,13 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "kind": "map_type", "loc": map, "valueStorageType": { - "id": 60, + "id": 64, "kind": "id", "loc": varuint32, "text": "varuint32", }, "valueType": { - "id": 59, + "id": 63, "kind": "type_id", "loc": Int, "text": "Int", @@ -11594,36 +11594,36 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 67, + "id": 72, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 68, + "id": 73, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 69, + "id": 74, "kind": "method_call", "loc": m2.set(1, 2), "method": { - "id": 66, + "id": 70, "kind": "id", "loc": set, "text": "set", }, "self": { - "id": 65, + "id": 69, "kind": "id", "loc": m2, "text": "m2", }, }, - "id": 70, + "id": 75, "kind": "statement_expression", "loc": m2.set(1, 2);, }, @@ -11632,75 +11632,75 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 75, + "id": 81, "kind": "number", "loc": 1, "value": 1n, }, { "base": 10, - "id": 76, + "id": 82, "kind": "number", "loc": 2, "value": 2n, }, ], - "id": 77, + "id": 83, "kind": "method_call", "loc": self.m2.set(1, 2), "method": { - "id": 74, + "id": 79, "kind": "id", "loc": set, "text": "set", }, "self": { "aggregate": { - "id": 71, + "id": 76, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 72, + "id": 77, "kind": "id", "loc": m2, "text": "m2", }, - "id": 73, + "id": 78, "kind": "field_access", "loc": self.m2, }, }, - "id": 78, + "id": 84, "kind": "statement_expression", "loc": self.m2.set(1, 2);, }, { "expression": { - "id": 89, + "id": 97, "kind": "op_binary", "left": { "args": [ { "base": 10, - "id": 81, + "id": 88, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 82, + "id": 89, "kind": "method_call", "loc": m2.get(1), "method": { - "id": 80, + "id": 86, "kind": "id", "loc": get, "text": "get", }, "self": { - "id": 79, + "id": 85, "kind": "id", "loc": m2, "text": "m2", @@ -11712,41 +11712,41 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "args": [ { "base": 10, - "id": 87, + "id": 95, "kind": "number", "loc": 1, "value": 1n, }, ], - "id": 88, + "id": 96, "kind": "method_call", "loc": self.m2.get(1), "method": { - "id": 86, + "id": 93, "kind": "id", "loc": get, "text": "get", }, "self": { "aggregate": { - "id": 83, + "id": 90, "kind": "id", "loc": self, "text": "self", }, "field": { - "id": 84, + "id": 91, "kind": "id", "loc": m2, "text": "m2", }, - "id": 85, + "id": 92, "kind": "field_access", "loc": self.m2, }, }, }, - "id": 90, + "id": 98, "kind": "statement_return", "loc": return m2.get(1) + self.m2.get(1);, }, @@ -11777,7 +11777,7 @@ exports[`resolveDescriptors should resolve descriptors for map-value-as-varuint "header": null, "init": { "ast": { - "id": 94, + "id": 102, "kind": "contract_init", "loc": contract Main { m1: map; @@ -11862,7 +11862,7 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1 "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -11921,23 +11921,23 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1 "fields": [ { "as": { - "id": 8, + "id": 15, "kind": "id", "loc": uint4, "text": "uint4", }, - "id": 9, + "id": 16, "initializer": null, "kind": "field_decl", "loc": field: Int as uint4, "name": { - "id": 6, + "id": 13, "kind": "id", "loc": field, "text": "field", }, "type": { - "id": 7, + "id": 14, "kind": "type_id", "loc": Int, "text": "Int", @@ -11951,32 +11951,32 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1 }, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": MsgWithExprOpcode, "text": "MsgWithExprOpcode", }, "opcode": { - "id": 16, + "id": 12, "kind": "op_binary", "left": { - "id": 14, + "id": 10, "kind": "op_binary", "left": { "args": [ { - "id": 11, + "id": 7, "kind": "string", "loc": "Tact", "value": "Tact", }, ], "function": { - "id": 10, + "id": 6, "kind": "id", "loc": crc32, "text": "crc32", }, - "id": 12, + "id": 8, "kind": "static_call", "loc": crc32("Tact"), }, @@ -11984,7 +11984,7 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1 "op": "+", "right": { "base": 10, - "id": 13, + "id": 9, "kind": "number", "loc": 42, "value": 42n, @@ -11994,7 +11994,7 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1 "op": "&", "right": { "base": 16, - "id": 15, + "id": 11, "kind": "number", "loc": 0xFFFF_FFFF, "value": 4294967295n, @@ -12017,23 +12017,23 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1 "as": "uint4", "ast": { "as": { - "id": 8, + "id": 15, "kind": "id", "loc": uint4, "text": "uint4", }, - "id": 9, + "id": 16, "initializer": null, "kind": "field_decl", "loc": field: Int as uint4, "name": { - "id": 6, + "id": 13, "kind": "id", "loc": field, "text": "field", }, "type": { - "id": 7, + "id": 14, "kind": "type_id", "loc": Int, "text": "Int", @@ -12634,7 +12634,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-default-f "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -12722,7 +12722,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-default-f "loc": struct S { a: Int = 42 }, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": S, "text": "S", }, @@ -12805,7 +12805,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-nested 1` "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -12834,7 +12834,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-nested 1` "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -12940,7 +12940,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-nested 1` }, "name": { "id": 7, - "kind": "type_id", + "kind": "id", "loc": Struct1, "text": "Struct1", }, @@ -13072,7 +13072,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-nested 1` }, "name": { "id": 15, - "kind": "type_id", + "kind": "id", "loc": Struct2, "text": "Struct2", }, @@ -13148,7 +13148,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-non-rec-t "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -13257,7 +13257,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-non-rec-t }, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": SetIntMap4, "text": "SetIntMap4", }, @@ -13399,7 +13399,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-non-rec-t "loc": struct SomeStruct { value: Int }, "name": { "id": 14, - "kind": "type_id", + "kind": "id", "loc": SomeStruct, "text": "SomeStruct", }, @@ -13508,7 +13508,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-remainder "loc": primitive Int;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -13537,7 +13537,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-remainder "loc": primitive Cell;, "name": { "id": 5, - "kind": "type_id", + "kind": "id", "loc": Cell, "text": "Cell", }, @@ -13634,7 +13634,7 @@ exports[`resolveDescriptors should resolve descriptors for struct-decl-remainder }, "name": { "id": 7, - "kind": "type_id", + "kind": "id", "loc": Test, "text": "Test", }, @@ -13796,7 +13796,7 @@ exports[`resolveDescriptors should resolve descriptors for trait-base 1`] = ` "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -13825,7 +13825,7 @@ exports[`resolveDescriptors should resolve descriptors for trait-base 1`] = ` "loc": primitive Bool;, "name": { "id": 3, - "kind": "type_id", + "kind": "id", "loc": Bool, "text": "Bool", }, @@ -13895,7 +13895,7 @@ exports[`resolveDescriptors should resolve descriptors for trait-foreach 1`] = ` "loc": primitive Int;, "name": { "id": 1, - "kind": "type_id", + "kind": "id", "loc": Int, "text": "Int", }, @@ -14237,21 +14237,21 @@ exports[`resolveDescriptors should resolve descriptors for trait-foreach 1`] = ` "declarations": [ { "as": null, - "id": 25, + "id": 26, "initializer": null, "kind": "field_decl", "loc": m: map, "name": { - "id": 21, + "id": 22, "kind": "id", "loc": m, "text": "m", }, "type": { - "id": 24, + "id": 25, "keyStorageType": null, "keyType": { - "id": 22, + "id": 23, "kind": "type_id", "loc": Int, "text": "Int", @@ -14260,7 +14260,7 @@ exports[`resolveDescriptors should resolve descriptors for trait-foreach 1`] = ` "loc": map, "valueStorageType": null, "valueType": { - "id": 23, + "id": 24, "kind": "type_id", "loc": Int, "text": "Int", @@ -14281,7 +14281,7 @@ exports[`resolveDescriptors should resolve descriptors for trait-foreach 1`] = ` }, "traits": [ { - "id": 26, + "id": 21, "kind": "id", "loc": TraitWithForeach, "text": "TraitWithForeach", @@ -14305,21 +14305,21 @@ exports[`resolveDescriptors should resolve descriptors for trait-foreach 1`] = ` "as": null, "ast": { "as": null, - "id": 25, + "id": 26, "initializer": null, "kind": "field_decl", "loc": m: map, "name": { - "id": 21, + "id": 22, "kind": "id", "loc": m, "text": "m", }, "type": { - "id": 24, + "id": 25, "keyStorageType": null, "keyType": { - "id": 22, + "id": 23, "kind": "type_id", "loc": Int, "text": "Int", @@ -14328,7 +14328,7 @@ exports[`resolveDescriptors should resolve descriptors for trait-foreach 1`] = ` "loc": map, "valueStorageType": null, "valueType": { - "id": 23, + "id": 24, "kind": "type_id", "loc": Int, "text": "Int", diff --git a/src/types/resolveDescriptors.spec.ts b/src/types/resolveDescriptors.spec.ts index c311b8b7f..c662b9cf7 100644 --- a/src/types/resolveDescriptors.spec.ts +++ b/src/types/resolveDescriptors.spec.ts @@ -11,6 +11,7 @@ import { featureEnable } from "../config/features"; import { getParser, SrcInfo } from "../grammar"; import { getAstFactory } from "../grammar/ast"; import { isSrcInfo } from "../grammar/src-info"; +import { defaultParser } from "../grammar/grammar"; expect.addSnapshotSerializer({ test: (src) => isSrcInfo(src), @@ -25,7 +26,7 @@ describe("resolveDescriptors", () => { new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], - getParser(Ast), + getParser(Ast, defaultParser), ); ctx = featureEnable(ctx, "external"); ctx = resolveDescriptors(ctx, Ast); @@ -41,7 +42,7 @@ describe("resolveDescriptors", () => { new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], - getParser(Ast), + getParser(Ast, defaultParser), ); ctx = featureEnable(ctx, "external"); expect(() => { diff --git a/src/types/resolveStatements.spec.ts b/src/types/resolveStatements.spec.ts index fa8539bda..90c2c0d81 100644 --- a/src/types/resolveStatements.spec.ts +++ b/src/types/resolveStatements.spec.ts @@ -7,6 +7,7 @@ import { CompilerContext } from "../context"; import { featureEnable } from "../config/features"; import { getParser } from "../grammar"; import { getAstFactory } from "../grammar/ast"; +import { defaultParser } from "../grammar/grammar"; describe("resolveStatements", () => { for (const r of loadCases(__dirname + "/stmts/")) { @@ -16,7 +17,7 @@ describe("resolveStatements", () => { new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], - getParser(Ast), + getParser(Ast, defaultParser), ); ctx = featureEnable(ctx, "external"); ctx = resolveDescriptors(ctx, Ast); @@ -31,7 +32,7 @@ describe("resolveStatements", () => { new CompilerContext(), [{ code: r.code, path: "", origin: "user" }], [], - getParser(Ast), + getParser(Ast, defaultParser), ); ctx = featureEnable(ctx, "external"); ctx = resolveDescriptors(ctx, Ast); diff --git a/src/utils/tricks.ts b/src/utils/tricks.ts index 7afbfdff2..40ca8578a 100644 --- a/src/utils/tricks.ts +++ b/src/utils/tricks.ts @@ -106,23 +106,22 @@ type Intersect = (T extends unknown ? (x: T) => 0 : never) extends ( */ type Unwrap = T extends infer R ? { [K in keyof R]: R[K] } : never; -type Inputs = I extends { kind: infer K } +type Inputs = I extends { [Z in T]: infer K } ? K extends string ? Record unknown> : never : never; type Outputs = { [K in keyof O]: (input: never) => O[K] }; -type Handlers = Unwrap>> & Outputs; +type Handlers = Unwrap>> & + Outputs; -/** - * Make visitor for disjoint union (tagged union, discriminated union) - */ -export const makeVisitor = +export const makeMakeVisitor = + (tag: T) => () => - (handlers: Handlers) => - (input: Extract): O[keyof O] => { + (handlers: Handlers) => + (input: Extract): O[keyof O] => { const handler = (handlers as Record O[keyof O]>)[ - input.kind + input[tag] ]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition @@ -130,7 +129,12 @@ export const makeVisitor = return handler(input); } else { throwInternalCompilerError( - `Reached impossible case: ${input.kind}`, + `Reached impossible case: ${input[tag]}`, ); } }; + +/** + * Make visitor for disjoint union (tagged union, discriminated union) + */ +export const makeVisitor = makeMakeVisitor("kind"); diff --git a/yarn.lock b/yarn.lock index 68198260e..22e4638e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -64,6 +64,17 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" +"@babel/generator@^7.26.2": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" + integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== + dependencies: + "@babel/parser" "^7.26.3" + "@babel/types" "^7.26.3" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + "@babel/helper-compilation-targets@^7.23.6": version "7.23.6" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz" @@ -137,11 +148,21 @@ resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz" integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz" @@ -171,6 +192,13 @@ resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz" integrity sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg== +"@babel/parser@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" + integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== + dependencies: + "@babel/types" "^7.26.3" + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" @@ -303,6 +331,14 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.26.0", "@babel/types@^7.26.3": + version "7.26.3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" + integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" @@ -1339,6 +1375,20 @@ dependencies: node-inspect-extracted "^2.0.0" +"@tonstudio/parser-runtime@^0.0.1": + version "0.0.1" + resolved "https://registry.npmjs.org/@tonstudio/parser-runtime/-/parser-runtime-0.0.1.tgz#469955fb7ea354d4fadaa5964359b11fd17f926b" + integrity sha512-5s4fLkXWxa4SAd7QGGvJXe13GakEo0J3VF5dUI/i3A//bGZxMwCp1FcnbErpNs3y0LcAZoXE5FCUnDowDQptqw== + +"@tonstudio/pgen@^0.0.1": + version "0.0.1" + resolved "https://registry.npmjs.org/@tonstudio/pgen/-/pgen-0.0.1.tgz#cb0b1d8b1eb77ff785e49dafd0187c8fba615a2c" + integrity sha512-pyrrDwaWhYXzpwpUYZMVNyRRLtkjNXATCGYCT/Y4xcucPrRygM/hBGzOy3IaULuvmhxHWKbOWPoRZ9jnkDH0Nw== + dependencies: + "@babel/generator" "^7.26.2" + "@babel/types" "^7.26.0" + minimist "^1.2.8" + "@tootallnate/quickjs-emscripten@^0.23.0": version "0.23.0" resolved "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" @@ -3943,6 +3993,11 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== + json-bigint@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1"