├── .github └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Justfile ├── LICENSE ├── README.md ├── examples ├── parse.rs ├── parse_function.rs └── parse_ts_function.rs ├── rust-toolchain └── src ├── copy_aiken_project_lib.rs ├── ir.rs ├── ir2.rs ├── ir2_visitor.rs ├── ir_to_unode.rs ├── ir_type.rs ├── ir_visitor.rs ├── js_compiler.rs ├── js_to_ir.rs ├── lib.rs └── program.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ "main", "plutus" ] 6 | pull_request: 7 | branches: [ "main", "plutus" ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | RUST_BACKTRACE: full 12 | 13 | concurrency: 14 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 15 | cancel-in-progress: true 16 | 17 | jobs: 18 | build: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v3 23 | - uses: dtolnay/rust-toolchain@stable 24 | with: 25 | toolchain: stable 26 | components: rustfmt 27 | - run: rustup set auto-self-update disable 28 | - uses: Swatinem/rust-cache@v2 29 | - name: Show env 30 | run: | 31 | env|sort 32 | echo 33 | rustc -Vv 34 | echo 35 | cargo -Vv 36 | echo 37 | uname -a 38 | - name: Run linters 39 | run: | 40 | cargo check --all 41 | cargo fmt --all -- --check 42 | cargo clippy -- -D warnings 43 | - name: Build 44 | run: cargo build --verbose 45 | - name: Run tests 46 | run: cargo test --verbose 47 | - name: Run example (parse) 48 | run: cargo run --example parse 49 | - name: Run example (parse_function) 50 | run: cargo run --example parse_function 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | ^target/ 3 | target 4 | .idea/ 5 | notes.local.md 6 | .idea.? 7 | patches/ 8 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "Inflector" 7 | version = "0.11.4" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" 10 | dependencies = [ 11 | "lazy_static", 12 | "regex", 13 | ] 14 | 15 | [[package]] 16 | name = "addr2line" 17 | version = "0.19.0" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" 20 | dependencies = [ 21 | "gimli", 22 | ] 23 | 24 | [[package]] 25 | name = "adler" 26 | version = "1.0.2" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 29 | 30 | [[package]] 31 | name = "ahash" 32 | version = "0.3.8" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" 35 | dependencies = [ 36 | "const-random", 37 | ] 38 | 39 | [[package]] 40 | name = "ahash" 41 | version = "0.7.6" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 44 | dependencies = [ 45 | "getrandom", 46 | "once_cell", 47 | "version_check", 48 | ] 49 | 50 | [[package]] 51 | name = "aho-corasick" 52 | version = "0.7.20" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" 55 | dependencies = [ 56 | "memchr", 57 | ] 58 | 59 | [[package]] 60 | name = "aiken" 61 | version = "0.0.26" 62 | source = "git+https://github.com/aiken-lang/aiken.git?rev=43ff66c#43ff66cd012784ed826501d2c442e50333053859" 63 | dependencies = [ 64 | "aiken-lang", 65 | "aiken-lsp", 66 | "aiken-project", 67 | "anyhow", 68 | "clap", 69 | "hex", 70 | "ignore", 71 | "indoc", 72 | "miette 5.5.0", 73 | "owo-colors", 74 | "pallas-addresses", 75 | "pallas-codec", 76 | "pallas-crypto", 77 | "pallas-primitives", 78 | "pallas-traverse", 79 | "regex", 80 | "thiserror", 81 | "uplc", 82 | ] 83 | 84 | [[package]] 85 | name = "aiken-lang" 86 | version = "0.0.26" 87 | source = "git+https://github.com/aiken-lang/aiken.git?rev=43ff66c#43ff66cd012784ed826501d2c442e50333053859" 88 | dependencies = [ 89 | "chumsky", 90 | "indexmap", 91 | "itertools", 92 | "miette 5.5.0", 93 | "strum", 94 | "thiserror", 95 | "uplc", 96 | "vec1", 97 | ] 98 | 99 | [[package]] 100 | name = "aiken-lsp" 101 | version = "0.0.26" 102 | source = "git+https://github.com/aiken-lang/aiken.git?rev=43ff66c#43ff66cd012784ed826501d2c442e50333053859" 103 | dependencies = [ 104 | "aiken-lang", 105 | "aiken-project", 106 | "crossbeam-channel", 107 | "lsp-server", 108 | "lsp-types", 109 | "miette 5.5.0", 110 | "serde", 111 | "serde_json", 112 | "thiserror", 113 | "tracing", 114 | "url", 115 | ] 116 | 117 | [[package]] 118 | name = "aiken-project" 119 | version = "0.0.26" 120 | source = "git+https://github.com/aiken-lang/aiken.git?rev=43ff66c#43ff66cd012784ed826501d2c442e50333053859" 121 | dependencies = [ 122 | "aiken-lang", 123 | "askama", 124 | "hex", 125 | "ignore", 126 | "itertools", 127 | "miette 5.5.0", 128 | "pallas", 129 | "pallas-traverse", 130 | "petgraph", 131 | "pulldown-cmark", 132 | "regex", 133 | "serde", 134 | "serde_json", 135 | "thiserror", 136 | "toml", 137 | "uplc", 138 | "walkdir", 139 | ] 140 | 141 | [[package]] 142 | name = "ansi_term" 143 | version = "0.12.1" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 146 | dependencies = [ 147 | "winapi", 148 | ] 149 | 150 | [[package]] 151 | name = "anyhow" 152 | version = "1.0.68" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" 155 | 156 | [[package]] 157 | name = "arrayvec" 158 | version = "0.5.2" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 161 | 162 | [[package]] 163 | name = "askama" 164 | version = "0.10.5" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "d298738b6e47e1034e560e5afe63aa488fea34e25ec11b855a76f0d7b8e73134" 167 | dependencies = [ 168 | "askama_derive", 169 | "askama_escape", 170 | "askama_shared", 171 | ] 172 | 173 | [[package]] 174 | name = "askama_derive" 175 | version = "0.10.5" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "ca2925c4c290382f9d2fa3d1c1b6a63fa1427099721ecca4749b154cc9c25522" 178 | dependencies = [ 179 | "askama_shared", 180 | "proc-macro2", 181 | "syn", 182 | ] 183 | 184 | [[package]] 185 | name = "askama_escape" 186 | version = "0.10.3" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" 189 | 190 | [[package]] 191 | name = "askama_shared" 192 | version = "0.11.2" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "7d6083ccb191711e9c2b80b22ee24a8381a18524444914c746d4239e21d1afaf" 195 | dependencies = [ 196 | "askama_escape", 197 | "humansize", 198 | "nom", 199 | "num-traits", 200 | "percent-encoding", 201 | "proc-macro2", 202 | "quote", 203 | "serde", 204 | "syn", 205 | "toml", 206 | ] 207 | 208 | [[package]] 209 | name = "ast_node" 210 | version = "0.8.6" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "cf94863c5fdfee166d0907c44e5fee970123b2b7307046d35d1e671aa93afbba" 213 | dependencies = [ 214 | "darling", 215 | "pmutil", 216 | "proc-macro2", 217 | "quote", 218 | "swc_macros_common", 219 | "syn", 220 | ] 221 | 222 | [[package]] 223 | name = "atty" 224 | version = "0.2.14" 225 | source = "registry+https://github.com/rust-lang/crates.io-index" 226 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 227 | dependencies = [ 228 | "hermit-abi", 229 | "libc", 230 | "winapi", 231 | ] 232 | 233 | [[package]] 234 | name = "autocfg" 235 | version = "1.1.0" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 238 | 239 | [[package]] 240 | name = "backtrace" 241 | version = "0.3.67" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" 244 | dependencies = [ 245 | "addr2line", 246 | "cc", 247 | "cfg-if", 248 | "libc", 249 | "miniz_oxide", 250 | "object", 251 | "rustc-demangle", 252 | ] 253 | 254 | [[package]] 255 | name = "base58" 256 | version = "0.2.0" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" 259 | 260 | [[package]] 261 | name = "base64" 262 | version = "0.13.1" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 265 | 266 | [[package]] 267 | name = "bech32" 268 | version = "0.9.1" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" 271 | 272 | [[package]] 273 | name = "better_scoped_tls" 274 | version = "0.1.0" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "b73e8ecdec39e98aa3b19e8cd0b8ed8f77ccb86a6b0b2dc7cd86d105438a2123" 277 | dependencies = [ 278 | "scoped-tls", 279 | ] 280 | 281 | [[package]] 282 | name = "bitflags" 283 | version = "1.3.2" 284 | source = "registry+https://github.com/rust-lang/crates.io-index" 285 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 286 | 287 | [[package]] 288 | name = "bitvec" 289 | version = "0.19.6" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33" 292 | dependencies = [ 293 | "funty", 294 | "radium", 295 | "tap", 296 | "wyz", 297 | ] 298 | 299 | [[package]] 300 | name = "block-buffer" 301 | version = "0.10.3" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" 304 | dependencies = [ 305 | "generic-array", 306 | ] 307 | 308 | [[package]] 309 | name = "bstr" 310 | version = "0.2.17" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" 313 | dependencies = [ 314 | "memchr", 315 | ] 316 | 317 | [[package]] 318 | name = "bytecheck" 319 | version = "0.6.9" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f" 322 | dependencies = [ 323 | "bytecheck_derive", 324 | "ptr_meta", 325 | ] 326 | 327 | [[package]] 328 | name = "bytecheck_derive" 329 | version = "0.6.9" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" 332 | dependencies = [ 333 | "proc-macro2", 334 | "quote", 335 | "syn", 336 | ] 337 | 338 | [[package]] 339 | name = "byteorder" 340 | version = "1.4.3" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 343 | 344 | [[package]] 345 | name = "cc" 346 | version = "1.0.78" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" 349 | 350 | [[package]] 351 | name = "cfg-if" 352 | version = "1.0.0" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 355 | 356 | [[package]] 357 | name = "chumsky" 358 | version = "0.8.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4" 361 | dependencies = [ 362 | "ahash 0.3.8", 363 | ] 364 | 365 | [[package]] 366 | name = "clap" 367 | version = "3.2.23" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" 370 | dependencies = [ 371 | "atty", 372 | "bitflags", 373 | "clap_derive", 374 | "clap_lex", 375 | "indexmap", 376 | "once_cell", 377 | "strsim", 378 | "termcolor", 379 | "textwrap 0.16.0", 380 | ] 381 | 382 | [[package]] 383 | name = "clap_derive" 384 | version = "3.2.18" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" 387 | dependencies = [ 388 | "heck", 389 | "proc-macro-error", 390 | "proc-macro2", 391 | "quote", 392 | "syn", 393 | ] 394 | 395 | [[package]] 396 | name = "clap_lex" 397 | version = "0.2.4" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" 400 | dependencies = [ 401 | "os_str_bytes", 402 | ] 403 | 404 | [[package]] 405 | name = "const-random" 406 | version = "0.1.15" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" 409 | dependencies = [ 410 | "const-random-macro", 411 | "proc-macro-hack", 412 | ] 413 | 414 | [[package]] 415 | name = "const-random-macro" 416 | version = "0.1.15" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" 419 | dependencies = [ 420 | "getrandom", 421 | "once_cell", 422 | "proc-macro-hack", 423 | "tiny-keccak", 424 | ] 425 | 426 | [[package]] 427 | name = "cpufeatures" 428 | version = "0.2.5" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" 431 | dependencies = [ 432 | "libc", 433 | ] 434 | 435 | [[package]] 436 | name = "crossbeam-channel" 437 | version = "0.5.6" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" 440 | dependencies = [ 441 | "cfg-if", 442 | "crossbeam-utils", 443 | ] 444 | 445 | [[package]] 446 | name = "crossbeam-utils" 447 | version = "0.8.14" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" 450 | dependencies = [ 451 | "cfg-if", 452 | ] 453 | 454 | [[package]] 455 | name = "crunchy" 456 | version = "0.2.2" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 459 | 460 | [[package]] 461 | name = "crypto-common" 462 | version = "0.1.6" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 465 | dependencies = [ 466 | "generic-array", 467 | "typenum", 468 | ] 469 | 470 | [[package]] 471 | name = "cryptoxide" 472 | version = "0.4.2" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "129eabb7b0b78644a3a7e7cf220714aba47463bb281f69fa7a71ca5d12564cca" 475 | 476 | [[package]] 477 | name = "ctor" 478 | version = "0.1.26" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" 481 | dependencies = [ 482 | "quote", 483 | "syn", 484 | ] 485 | 486 | [[package]] 487 | name = "darling" 488 | version = "0.13.4" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" 491 | dependencies = [ 492 | "darling_core", 493 | "darling_macro", 494 | ] 495 | 496 | [[package]] 497 | name = "darling_core" 498 | version = "0.13.4" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" 501 | dependencies = [ 502 | "fnv", 503 | "ident_case", 504 | "proc-macro2", 505 | "quote", 506 | "strsim", 507 | "syn", 508 | ] 509 | 510 | [[package]] 511 | name = "darling_macro" 512 | version = "0.13.4" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" 515 | dependencies = [ 516 | "darling_core", 517 | "quote", 518 | "syn", 519 | ] 520 | 521 | [[package]] 522 | name = "dashmap" 523 | version = "5.4.0" 524 | source = "registry+https://github.com/rust-lang/crates.io-index" 525 | checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" 526 | dependencies = [ 527 | "cfg-if", 528 | "hashbrown", 529 | "lock_api", 530 | "once_cell", 531 | "parking_lot_core", 532 | ] 533 | 534 | [[package]] 535 | name = "diff" 536 | version = "0.1.13" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 539 | 540 | [[package]] 541 | name = "difference" 542 | version = "2.0.0" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" 545 | 546 | [[package]] 547 | name = "digest" 548 | version = "0.10.6" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 551 | dependencies = [ 552 | "block-buffer", 553 | "crypto-common", 554 | ] 555 | 556 | [[package]] 557 | name = "either" 558 | version = "1.8.0" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" 561 | 562 | [[package]] 563 | name = "enum-iterator" 564 | version = "1.1.3" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401" 567 | dependencies = [ 568 | "enum-iterator-derive", 569 | ] 570 | 571 | [[package]] 572 | name = "enum-iterator-derive" 573 | version = "1.1.0" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" 576 | dependencies = [ 577 | "proc-macro2", 578 | "quote", 579 | "syn", 580 | ] 581 | 582 | [[package]] 583 | name = "enum_kind" 584 | version = "0.2.1" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "78b940da354ae81ef0926c5eaa428207b8f4f091d3956c891dfbd124162bed99" 587 | dependencies = [ 588 | "pmutil", 589 | "proc-macro2", 590 | "swc_macros_common", 591 | "syn", 592 | ] 593 | 594 | [[package]] 595 | name = "fastrand" 596 | version = "1.8.0" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" 599 | dependencies = [ 600 | "instant", 601 | ] 602 | 603 | [[package]] 604 | name = "fixedbitset" 605 | version = "0.4.2" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" 608 | 609 | [[package]] 610 | name = "flat-rs" 611 | version = "0.0.21" 612 | source = "git+https://github.com/aiken-lang/aiken.git?rev=43ff66c#43ff66cd012784ed826501d2c442e50333053859" 613 | dependencies = [ 614 | "anyhow", 615 | "thiserror", 616 | ] 617 | 618 | [[package]] 619 | name = "fnv" 620 | version = "1.0.7" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 623 | 624 | [[package]] 625 | name = "form_urlencoded" 626 | version = "1.1.0" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 629 | dependencies = [ 630 | "percent-encoding", 631 | ] 632 | 633 | [[package]] 634 | name = "from_variant" 635 | version = "0.1.4" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "f0981e470d2ab9f643df3921d54f1952ea100c39fdb6a3fdc820e20d2291df6c" 638 | dependencies = [ 639 | "pmutil", 640 | "proc-macro2", 641 | "swc_macros_common", 642 | "syn", 643 | ] 644 | 645 | [[package]] 646 | name = "funty" 647 | version = "1.1.0" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" 650 | 651 | [[package]] 652 | name = "generic-array" 653 | version = "0.14.6" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 656 | dependencies = [ 657 | "typenum", 658 | "version_check", 659 | ] 660 | 661 | [[package]] 662 | name = "getrandom" 663 | version = "0.2.8" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 666 | dependencies = [ 667 | "cfg-if", 668 | "libc", 669 | "wasi", 670 | ] 671 | 672 | [[package]] 673 | name = "getset" 674 | version = "0.1.2" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" 677 | dependencies = [ 678 | "proc-macro-error", 679 | "proc-macro2", 680 | "quote", 681 | "syn", 682 | ] 683 | 684 | [[package]] 685 | name = "gimli" 686 | version = "0.27.0" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" 689 | 690 | [[package]] 691 | name = "glob" 692 | version = "0.3.0" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 695 | 696 | [[package]] 697 | name = "globset" 698 | version = "0.4.9" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" 701 | dependencies = [ 702 | "aho-corasick", 703 | "bstr", 704 | "fnv", 705 | "log", 706 | "regex", 707 | ] 708 | 709 | [[package]] 710 | name = "half" 711 | version = "1.8.2" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" 714 | 715 | [[package]] 716 | name = "hashbrown" 717 | version = "0.12.3" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 720 | dependencies = [ 721 | "ahash 0.7.6", 722 | ] 723 | 724 | [[package]] 725 | name = "heck" 726 | version = "0.4.0" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 729 | 730 | [[package]] 731 | name = "hermit-abi" 732 | version = "0.1.19" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 735 | dependencies = [ 736 | "libc", 737 | ] 738 | 739 | [[package]] 740 | name = "hex" 741 | version = "0.4.3" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 744 | 745 | [[package]] 746 | name = "humansize" 747 | version = "1.1.1" 748 | source = "registry+https://github.com/rust-lang/crates.io-index" 749 | checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" 750 | 751 | [[package]] 752 | name = "ident_case" 753 | version = "1.0.1" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 756 | 757 | [[package]] 758 | name = "idna" 759 | version = "0.3.0" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 762 | dependencies = [ 763 | "unicode-bidi", 764 | "unicode-normalization", 765 | ] 766 | 767 | [[package]] 768 | name = "if_chain" 769 | version = "1.0.2" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" 772 | 773 | [[package]] 774 | name = "ignore" 775 | version = "0.4.18" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" 778 | dependencies = [ 779 | "crossbeam-utils", 780 | "globset", 781 | "lazy_static", 782 | "log", 783 | "memchr", 784 | "regex", 785 | "same-file", 786 | "thread_local", 787 | "walkdir", 788 | "winapi-util", 789 | ] 790 | 791 | [[package]] 792 | name = "indexmap" 793 | version = "1.9.2" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" 796 | dependencies = [ 797 | "autocfg", 798 | "hashbrown", 799 | ] 800 | 801 | [[package]] 802 | name = "indoc" 803 | version = "1.0.8" 804 | source = "registry+https://github.com/rust-lang/crates.io-index" 805 | checksum = "da2d6f23ffea9d7e76c53eee25dfb67bcd8fde7f1198b0855350698c9f07c780" 806 | 807 | [[package]] 808 | name = "instant" 809 | version = "0.1.12" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 812 | dependencies = [ 813 | "cfg-if", 814 | ] 815 | 816 | [[package]] 817 | name = "is-macro" 818 | version = "0.2.1" 819 | source = "registry+https://github.com/rust-lang/crates.io-index" 820 | checksum = "1c068d4c6b922cd6284c609cfa6dec0e41615c9c5a1a4ba729a970d8daba05fb" 821 | dependencies = [ 822 | "Inflector", 823 | "pmutil", 824 | "proc-macro2", 825 | "quote", 826 | "syn", 827 | ] 828 | 829 | [[package]] 830 | name = "is_ci" 831 | version = "1.1.1" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" 834 | 835 | [[package]] 836 | name = "itertools" 837 | version = "0.10.5" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 840 | dependencies = [ 841 | "either", 842 | ] 843 | 844 | [[package]] 845 | name = "itoa" 846 | version = "1.0.5" 847 | source = "registry+https://github.com/rust-lang/crates.io-index" 848 | checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" 849 | 850 | [[package]] 851 | name = "jutus" 852 | version = "0.1.0" 853 | dependencies = [ 854 | "aiken", 855 | "aiken-lang", 856 | "aiken-project", 857 | "hex", 858 | "indoc", 859 | "miette 5.5.0", 860 | "num-bigint", 861 | "pallas", 862 | "pallas-traverse", 863 | "regex", 864 | "serde", 865 | "serde_derive", 866 | "serde_json", 867 | "swc_core", 868 | "thiserror", 869 | "uplc", 870 | "vec1", 871 | "walkdir", 872 | ] 873 | 874 | [[package]] 875 | name = "lazy_static" 876 | version = "1.4.0" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 879 | 880 | [[package]] 881 | name = "lexical" 882 | version = "6.1.1" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6" 885 | dependencies = [ 886 | "lexical-core 0.8.5", 887 | ] 888 | 889 | [[package]] 890 | name = "lexical-core" 891 | version = "0.7.6" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" 894 | dependencies = [ 895 | "arrayvec", 896 | "bitflags", 897 | "cfg-if", 898 | "ryu", 899 | "static_assertions", 900 | ] 901 | 902 | [[package]] 903 | name = "lexical-core" 904 | version = "0.8.5" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" 907 | dependencies = [ 908 | "lexical-parse-float", 909 | "lexical-parse-integer", 910 | "lexical-util", 911 | "lexical-write-float", 912 | "lexical-write-integer", 913 | ] 914 | 915 | [[package]] 916 | name = "lexical-parse-float" 917 | version = "0.8.5" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" 920 | dependencies = [ 921 | "lexical-parse-integer", 922 | "lexical-util", 923 | "static_assertions", 924 | ] 925 | 926 | [[package]] 927 | name = "lexical-parse-integer" 928 | version = "0.8.6" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" 931 | dependencies = [ 932 | "lexical-util", 933 | "static_assertions", 934 | ] 935 | 936 | [[package]] 937 | name = "lexical-util" 938 | version = "0.8.5" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" 941 | dependencies = [ 942 | "static_assertions", 943 | ] 944 | 945 | [[package]] 946 | name = "lexical-write-float" 947 | version = "0.8.5" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" 950 | dependencies = [ 951 | "lexical-util", 952 | "lexical-write-integer", 953 | "static_assertions", 954 | ] 955 | 956 | [[package]] 957 | name = "lexical-write-integer" 958 | version = "0.8.5" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" 961 | dependencies = [ 962 | "lexical-util", 963 | "static_assertions", 964 | ] 965 | 966 | [[package]] 967 | name = "libc" 968 | version = "0.2.138" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" 971 | 972 | [[package]] 973 | name = "lock_api" 974 | version = "0.4.9" 975 | source = "registry+https://github.com/rust-lang/crates.io-index" 976 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 977 | dependencies = [ 978 | "autocfg", 979 | "scopeguard", 980 | ] 981 | 982 | [[package]] 983 | name = "log" 984 | version = "0.4.17" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 987 | dependencies = [ 988 | "cfg-if", 989 | ] 990 | 991 | [[package]] 992 | name = "lsp-server" 993 | version = "0.6.0" 994 | source = "registry+https://github.com/rust-lang/crates.io-index" 995 | checksum = "f70570c1c29cf6654029b8fe201a5507c153f0d85be6f234d471d756bc36775a" 996 | dependencies = [ 997 | "crossbeam-channel", 998 | "log", 999 | "serde", 1000 | "serde_json", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "lsp-types" 1005 | version = "0.93.2" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "9be6e9c7e2d18f651974370d7aff703f9513e0df6e464fd795660edc77e6ca51" 1008 | dependencies = [ 1009 | "bitflags", 1010 | "serde", 1011 | "serde_json", 1012 | "serde_repr", 1013 | "url", 1014 | ] 1015 | 1016 | [[package]] 1017 | name = "matchers" 1018 | version = "0.1.0" 1019 | source = "registry+https://github.com/rust-lang/crates.io-index" 1020 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 1021 | dependencies = [ 1022 | "regex-automata", 1023 | ] 1024 | 1025 | [[package]] 1026 | name = "memchr" 1027 | version = "2.5.0" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 1030 | 1031 | [[package]] 1032 | name = "miette" 1033 | version = "4.7.1" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" 1036 | dependencies = [ 1037 | "atty", 1038 | "backtrace", 1039 | "miette-derive 4.7.1", 1040 | "once_cell", 1041 | "owo-colors", 1042 | "supports-color", 1043 | "supports-hyperlinks", 1044 | "supports-unicode", 1045 | "terminal_size", 1046 | "textwrap 0.15.2", 1047 | "thiserror", 1048 | "unicode-width", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "miette" 1053 | version = "5.5.0" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "4afd9b301defa984bbdbe112b4763e093ed191750a0d914a78c1106b2d0fe703" 1056 | dependencies = [ 1057 | "atty", 1058 | "backtrace", 1059 | "miette-derive 5.5.0", 1060 | "once_cell", 1061 | "owo-colors", 1062 | "supports-color", 1063 | "supports-hyperlinks", 1064 | "supports-unicode", 1065 | "terminal_size", 1066 | "textwrap 0.15.2", 1067 | "thiserror", 1068 | "unicode-width", 1069 | ] 1070 | 1071 | [[package]] 1072 | name = "miette-derive" 1073 | version = "4.7.1" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" 1076 | dependencies = [ 1077 | "proc-macro2", 1078 | "quote", 1079 | "syn", 1080 | ] 1081 | 1082 | [[package]] 1083 | name = "miette-derive" 1084 | version = "5.5.0" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "97c2401ab7ac5282ca5c8b518a87635b1a93762b0b90b9990c509888eeccba29" 1087 | dependencies = [ 1088 | "proc-macro2", 1089 | "quote", 1090 | "syn", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "minicbor" 1095 | version = "0.18.0" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "2a20020e8e2d1881d8736f64011bb5ff99f1db9947ce3089706945c8915695cb" 1098 | dependencies = [ 1099 | "half", 1100 | "minicbor-derive", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "minicbor-derive" 1105 | version = "0.12.0" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "8608fb1c805b5b6b3d5ab7bd95c40c396df622b64d77b2d621a5eae1eed050ee" 1108 | dependencies = [ 1109 | "proc-macro2", 1110 | "quote", 1111 | "syn", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "miniz_oxide" 1116 | version = "0.6.2" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" 1119 | dependencies = [ 1120 | "adler", 1121 | ] 1122 | 1123 | [[package]] 1124 | name = "new_debug_unreachable" 1125 | version = "1.0.4" 1126 | source = "registry+https://github.com/rust-lang/crates.io-index" 1127 | checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" 1128 | 1129 | [[package]] 1130 | name = "nom" 1131 | version = "6.1.2" 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" 1133 | checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" 1134 | dependencies = [ 1135 | "bitvec", 1136 | "funty", 1137 | "lexical-core 0.7.6", 1138 | "memchr", 1139 | "version_check", 1140 | ] 1141 | 1142 | [[package]] 1143 | name = "nu-ansi-term" 1144 | version = "0.46.0" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 1147 | dependencies = [ 1148 | "overload", 1149 | "winapi", 1150 | ] 1151 | 1152 | [[package]] 1153 | name = "num-bigint" 1154 | version = "0.4.3" 1155 | source = "registry+https://github.com/rust-lang/crates.io-index" 1156 | checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" 1157 | dependencies = [ 1158 | "autocfg", 1159 | "num-integer", 1160 | "num-traits", 1161 | "serde", 1162 | ] 1163 | 1164 | [[package]] 1165 | name = "num-integer" 1166 | version = "0.1.45" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 1169 | dependencies = [ 1170 | "autocfg", 1171 | "num-traits", 1172 | ] 1173 | 1174 | [[package]] 1175 | name = "num-traits" 1176 | version = "0.2.15" 1177 | source = "registry+https://github.com/rust-lang/crates.io-index" 1178 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1179 | dependencies = [ 1180 | "autocfg", 1181 | ] 1182 | 1183 | [[package]] 1184 | name = "num_cpus" 1185 | version = "1.14.0" 1186 | source = "registry+https://github.com/rust-lang/crates.io-index" 1187 | checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" 1188 | dependencies = [ 1189 | "hermit-abi", 1190 | "libc", 1191 | ] 1192 | 1193 | [[package]] 1194 | name = "object" 1195 | version = "0.30.0" 1196 | source = "registry+https://github.com/rust-lang/crates.io-index" 1197 | checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" 1198 | dependencies = [ 1199 | "memchr", 1200 | ] 1201 | 1202 | [[package]] 1203 | name = "once_cell" 1204 | version = "1.16.0" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" 1207 | 1208 | [[package]] 1209 | name = "os_str_bytes" 1210 | version = "6.4.1" 1211 | source = "registry+https://github.com/rust-lang/crates.io-index" 1212 | checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" 1213 | 1214 | [[package]] 1215 | name = "output_vt100" 1216 | version = "0.1.3" 1217 | source = "registry+https://github.com/rust-lang/crates.io-index" 1218 | checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" 1219 | dependencies = [ 1220 | "winapi", 1221 | ] 1222 | 1223 | [[package]] 1224 | name = "overload" 1225 | version = "0.1.1" 1226 | source = "registry+https://github.com/rust-lang/crates.io-index" 1227 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 1228 | 1229 | [[package]] 1230 | name = "owo-colors" 1231 | version = "3.5.0" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" 1234 | 1235 | [[package]] 1236 | name = "pallas" 1237 | version = "0.14.2" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "787c11d5b78aaf5279ea6763452128a09616aecb51d975fd0dd1abfaf33497be" 1240 | dependencies = [ 1241 | "pallas-addresses", 1242 | "pallas-codec", 1243 | "pallas-crypto", 1244 | "pallas-miniprotocols", 1245 | "pallas-multiplexer", 1246 | "pallas-primitives", 1247 | "pallas-traverse", 1248 | ] 1249 | 1250 | [[package]] 1251 | name = "pallas-addresses" 1252 | version = "0.14.2" 1253 | source = "registry+https://github.com/rust-lang/crates.io-index" 1254 | checksum = "f23f3baf5ad87aee98de1e4e95ae97971af3fbc49173cef4f78a1d790f106f64" 1255 | dependencies = [ 1256 | "base58", 1257 | "bech32", 1258 | "hex", 1259 | "pallas-codec", 1260 | "pallas-crypto", 1261 | "thiserror", 1262 | ] 1263 | 1264 | [[package]] 1265 | name = "pallas-codec" 1266 | version = "0.14.2" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "68828565e0ec4fd73615fddbc76597d46611f8ad5042bf9fb7fd469c260e769c" 1269 | dependencies = [ 1270 | "hex", 1271 | "minicbor", 1272 | "serde", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "pallas-crypto" 1277 | version = "0.14.2" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "4b2a818f58055bdf1c2c5d6e50dbbb7f45c2336b9434373243267bebeef3a5d0" 1280 | dependencies = [ 1281 | "cryptoxide", 1282 | "hex", 1283 | "pallas-codec", 1284 | "rand_core", 1285 | "serde", 1286 | "thiserror", 1287 | ] 1288 | 1289 | [[package]] 1290 | name = "pallas-miniprotocols" 1291 | version = "0.14.2" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "25e69e505a19201407c226a93f068b1623d15bb0b8ed807feeb829f55c3d5b8d" 1294 | dependencies = [ 1295 | "hex", 1296 | "itertools", 1297 | "log", 1298 | "pallas-codec", 1299 | "pallas-multiplexer", 1300 | "thiserror", 1301 | ] 1302 | 1303 | [[package]] 1304 | name = "pallas-multiplexer" 1305 | version = "0.14.2" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "11c436dd7cac09e6e93a8e2e053ea1e2a7e6695fe99165754396143b865aa0b4" 1308 | dependencies = [ 1309 | "byteorder", 1310 | "hex", 1311 | "log", 1312 | "pallas-codec", 1313 | "rand", 1314 | "thiserror", 1315 | ] 1316 | 1317 | [[package]] 1318 | name = "pallas-primitives" 1319 | version = "0.14.2" 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" 1321 | checksum = "990086e210dd1ad2878db847629a9038370b7f8085d34ed6b5fc0e2bf4a0f19a" 1322 | dependencies = [ 1323 | "base58", 1324 | "bech32", 1325 | "hex", 1326 | "log", 1327 | "pallas-codec", 1328 | "pallas-crypto", 1329 | "serde", 1330 | "serde_json", 1331 | ] 1332 | 1333 | [[package]] 1334 | name = "pallas-traverse" 1335 | version = "0.14.2" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "3566497b265cced65ae62fb85ffccf5bae51d645f40cd21c1dc293db6021e55b" 1338 | dependencies = [ 1339 | "hex", 1340 | "pallas-addresses", 1341 | "pallas-codec", 1342 | "pallas-crypto", 1343 | "pallas-primitives", 1344 | "thiserror", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "parking_lot" 1349 | version = "0.12.1" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1352 | dependencies = [ 1353 | "lock_api", 1354 | "parking_lot_core", 1355 | ] 1356 | 1357 | [[package]] 1358 | name = "parking_lot_core" 1359 | version = "0.9.5" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" 1362 | dependencies = [ 1363 | "cfg-if", 1364 | "libc", 1365 | "redox_syscall", 1366 | "smallvec", 1367 | "windows-sys", 1368 | ] 1369 | 1370 | [[package]] 1371 | name = "peg" 1372 | version = "0.8.1" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "a07f2cafdc3babeebc087e499118343442b742cc7c31b4d054682cc598508554" 1375 | dependencies = [ 1376 | "peg-macros", 1377 | "peg-runtime", 1378 | ] 1379 | 1380 | [[package]] 1381 | name = "peg-macros" 1382 | version = "0.8.1" 1383 | source = "registry+https://github.com/rust-lang/crates.io-index" 1384 | checksum = "4a90084dc05cf0428428e3d12399f39faad19b0909f64fb9170c9fdd6d9cd49b" 1385 | dependencies = [ 1386 | "peg-runtime", 1387 | "proc-macro2", 1388 | "quote", 1389 | ] 1390 | 1391 | [[package]] 1392 | name = "peg-runtime" 1393 | version = "0.8.1" 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" 1395 | checksum = "9fa00462b37ead6d11a82c9d568b26682d78e0477dc02d1966c013af80969739" 1396 | 1397 | [[package]] 1398 | name = "percent-encoding" 1399 | version = "2.2.0" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 1402 | 1403 | [[package]] 1404 | name = "petgraph" 1405 | version = "0.6.2" 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" 1407 | checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" 1408 | dependencies = [ 1409 | "fixedbitset", 1410 | "indexmap", 1411 | ] 1412 | 1413 | [[package]] 1414 | name = "phf" 1415 | version = "0.10.1" 1416 | source = "registry+https://github.com/rust-lang/crates.io-index" 1417 | checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" 1418 | dependencies = [ 1419 | "phf_macros", 1420 | "phf_shared", 1421 | "proc-macro-hack", 1422 | ] 1423 | 1424 | [[package]] 1425 | name = "phf_generator" 1426 | version = "0.10.0" 1427 | source = "registry+https://github.com/rust-lang/crates.io-index" 1428 | checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" 1429 | dependencies = [ 1430 | "phf_shared", 1431 | "rand", 1432 | ] 1433 | 1434 | [[package]] 1435 | name = "phf_macros" 1436 | version = "0.10.0" 1437 | source = "registry+https://github.com/rust-lang/crates.io-index" 1438 | checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" 1439 | dependencies = [ 1440 | "phf_generator", 1441 | "phf_shared", 1442 | "proc-macro-hack", 1443 | "proc-macro2", 1444 | "quote", 1445 | "syn", 1446 | ] 1447 | 1448 | [[package]] 1449 | name = "phf_shared" 1450 | version = "0.10.0" 1451 | source = "registry+https://github.com/rust-lang/crates.io-index" 1452 | checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" 1453 | dependencies = [ 1454 | "siphasher", 1455 | ] 1456 | 1457 | [[package]] 1458 | name = "pin-project-lite" 1459 | version = "0.2.9" 1460 | source = "registry+https://github.com/rust-lang/crates.io-index" 1461 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1462 | 1463 | [[package]] 1464 | name = "pmutil" 1465 | version = "0.5.3" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" 1468 | dependencies = [ 1469 | "proc-macro2", 1470 | "quote", 1471 | "syn", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "ppv-lite86" 1476 | version = "0.2.17" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1479 | 1480 | [[package]] 1481 | name = "precomputed-hash" 1482 | version = "0.1.1" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" 1485 | 1486 | [[package]] 1487 | name = "pretty" 1488 | version = "0.11.3" 1489 | source = "registry+https://github.com/rust-lang/crates.io-index" 1490 | checksum = "83f3aa1e3ca87d3b124db7461265ac176b40c277f37e503eaa29c9c75c037846" 1491 | dependencies = [ 1492 | "arrayvec", 1493 | "log", 1494 | "typed-arena", 1495 | "unicode-segmentation", 1496 | ] 1497 | 1498 | [[package]] 1499 | name = "pretty_assertions" 1500 | version = "1.3.0" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" 1503 | dependencies = [ 1504 | "ctor", 1505 | "diff", 1506 | "output_vt100", 1507 | "yansi", 1508 | ] 1509 | 1510 | [[package]] 1511 | name = "proc-macro-error" 1512 | version = "1.0.4" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1515 | dependencies = [ 1516 | "proc-macro-error-attr", 1517 | "proc-macro2", 1518 | "quote", 1519 | "syn", 1520 | "version_check", 1521 | ] 1522 | 1523 | [[package]] 1524 | name = "proc-macro-error-attr" 1525 | version = "1.0.4" 1526 | source = "registry+https://github.com/rust-lang/crates.io-index" 1527 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1528 | dependencies = [ 1529 | "proc-macro2", 1530 | "quote", 1531 | "version_check", 1532 | ] 1533 | 1534 | [[package]] 1535 | name = "proc-macro-hack" 1536 | version = "0.5.19" 1537 | source = "registry+https://github.com/rust-lang/crates.io-index" 1538 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 1539 | 1540 | [[package]] 1541 | name = "proc-macro2" 1542 | version = "1.0.49" 1543 | source = "registry+https://github.com/rust-lang/crates.io-index" 1544 | checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" 1545 | dependencies = [ 1546 | "unicode-ident", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "ptr_meta" 1551 | version = "0.1.4" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" 1554 | dependencies = [ 1555 | "ptr_meta_derive", 1556 | ] 1557 | 1558 | [[package]] 1559 | name = "ptr_meta_derive" 1560 | version = "0.1.4" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" 1563 | dependencies = [ 1564 | "proc-macro2", 1565 | "quote", 1566 | "syn", 1567 | ] 1568 | 1569 | [[package]] 1570 | name = "pulldown-cmark" 1571 | version = "0.8.0" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" 1574 | dependencies = [ 1575 | "bitflags", 1576 | "memchr", 1577 | "unicase", 1578 | ] 1579 | 1580 | [[package]] 1581 | name = "quote" 1582 | version = "1.0.23" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" 1585 | dependencies = [ 1586 | "proc-macro2", 1587 | ] 1588 | 1589 | [[package]] 1590 | name = "radium" 1591 | version = "0.5.3" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" 1594 | 1595 | [[package]] 1596 | name = "rand" 1597 | version = "0.8.5" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1600 | dependencies = [ 1601 | "libc", 1602 | "rand_chacha", 1603 | "rand_core", 1604 | ] 1605 | 1606 | [[package]] 1607 | name = "rand_chacha" 1608 | version = "0.3.1" 1609 | source = "registry+https://github.com/rust-lang/crates.io-index" 1610 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1611 | dependencies = [ 1612 | "ppv-lite86", 1613 | "rand_core", 1614 | ] 1615 | 1616 | [[package]] 1617 | name = "rand_core" 1618 | version = "0.6.4" 1619 | source = "registry+https://github.com/rust-lang/crates.io-index" 1620 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1621 | dependencies = [ 1622 | "getrandom", 1623 | ] 1624 | 1625 | [[package]] 1626 | name = "redox_syscall" 1627 | version = "0.2.16" 1628 | source = "registry+https://github.com/rust-lang/crates.io-index" 1629 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1630 | dependencies = [ 1631 | "bitflags", 1632 | ] 1633 | 1634 | [[package]] 1635 | name = "regex" 1636 | version = "1.7.0" 1637 | source = "registry+https://github.com/rust-lang/crates.io-index" 1638 | checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" 1639 | dependencies = [ 1640 | "aho-corasick", 1641 | "memchr", 1642 | "regex-syntax", 1643 | ] 1644 | 1645 | [[package]] 1646 | name = "regex-automata" 1647 | version = "0.1.10" 1648 | source = "registry+https://github.com/rust-lang/crates.io-index" 1649 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 1650 | dependencies = [ 1651 | "regex-syntax", 1652 | ] 1653 | 1654 | [[package]] 1655 | name = "regex-syntax" 1656 | version = "0.6.28" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" 1659 | 1660 | [[package]] 1661 | name = "relative-path" 1662 | version = "1.7.2" 1663 | source = "registry+https://github.com/rust-lang/crates.io-index" 1664 | checksum = "0df32d82cedd1499386877b062ebe8721f806de80b08d183c70184ef17dd1d42" 1665 | 1666 | [[package]] 1667 | name = "remove_dir_all" 1668 | version = "0.5.3" 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" 1670 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1671 | dependencies = [ 1672 | "winapi", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "rend" 1677 | version = "0.3.6" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" 1680 | dependencies = [ 1681 | "bytecheck", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "rkyv" 1686 | version = "0.7.37" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "1f08c8062c1fe1253064043b8fc07bfea1b9702b71b4a86c11ea3588183b12e1" 1689 | dependencies = [ 1690 | "bytecheck", 1691 | "hashbrown", 1692 | "ptr_meta", 1693 | "rend", 1694 | "rkyv_derive", 1695 | "seahash", 1696 | ] 1697 | 1698 | [[package]] 1699 | name = "rkyv_derive" 1700 | version = "0.7.37" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "e289706df51226e84814bf6ba1a9e1013112ae29bc7a9878f73fce360520c403" 1703 | dependencies = [ 1704 | "proc-macro2", 1705 | "quote", 1706 | "syn", 1707 | ] 1708 | 1709 | [[package]] 1710 | name = "rustc-demangle" 1711 | version = "0.1.21" 1712 | source = "registry+https://github.com/rust-lang/crates.io-index" 1713 | checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 1714 | 1715 | [[package]] 1716 | name = "rustc-hash" 1717 | version = "1.1.0" 1718 | source = "registry+https://github.com/rust-lang/crates.io-index" 1719 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1720 | 1721 | [[package]] 1722 | name = "rustc_version" 1723 | version = "0.2.3" 1724 | source = "registry+https://github.com/rust-lang/crates.io-index" 1725 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1726 | dependencies = [ 1727 | "semver", 1728 | ] 1729 | 1730 | [[package]] 1731 | name = "rustversion" 1732 | version = "1.0.11" 1733 | source = "registry+https://github.com/rust-lang/crates.io-index" 1734 | checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" 1735 | 1736 | [[package]] 1737 | name = "ryu" 1738 | version = "1.0.12" 1739 | source = "registry+https://github.com/rust-lang/crates.io-index" 1740 | checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" 1741 | 1742 | [[package]] 1743 | name = "same-file" 1744 | version = "1.0.6" 1745 | source = "registry+https://github.com/rust-lang/crates.io-index" 1746 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1747 | dependencies = [ 1748 | "winapi-util", 1749 | ] 1750 | 1751 | [[package]] 1752 | name = "scoped-tls" 1753 | version = "1.0.1" 1754 | source = "registry+https://github.com/rust-lang/crates.io-index" 1755 | checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" 1756 | 1757 | [[package]] 1758 | name = "scopeguard" 1759 | version = "1.1.0" 1760 | source = "registry+https://github.com/rust-lang/crates.io-index" 1761 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1762 | 1763 | [[package]] 1764 | name = "seahash" 1765 | version = "4.1.0" 1766 | source = "registry+https://github.com/rust-lang/crates.io-index" 1767 | checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" 1768 | 1769 | [[package]] 1770 | name = "semver" 1771 | version = "0.9.0" 1772 | source = "registry+https://github.com/rust-lang/crates.io-index" 1773 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1774 | dependencies = [ 1775 | "semver-parser", 1776 | ] 1777 | 1778 | [[package]] 1779 | name = "semver-parser" 1780 | version = "0.7.0" 1781 | source = "registry+https://github.com/rust-lang/crates.io-index" 1782 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1783 | 1784 | [[package]] 1785 | name = "serde" 1786 | version = "1.0.151" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" 1789 | dependencies = [ 1790 | "serde_derive", 1791 | ] 1792 | 1793 | [[package]] 1794 | name = "serde_derive" 1795 | version = "1.0.151" 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" 1797 | checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" 1798 | dependencies = [ 1799 | "proc-macro2", 1800 | "quote", 1801 | "syn", 1802 | ] 1803 | 1804 | [[package]] 1805 | name = "serde_json" 1806 | version = "1.0.91" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" 1809 | dependencies = [ 1810 | "indexmap", 1811 | "itoa", 1812 | "ryu", 1813 | "serde", 1814 | ] 1815 | 1816 | [[package]] 1817 | name = "serde_repr" 1818 | version = "0.1.10" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" 1821 | dependencies = [ 1822 | "proc-macro2", 1823 | "quote", 1824 | "syn", 1825 | ] 1826 | 1827 | [[package]] 1828 | name = "sha-1" 1829 | version = "0.10.0" 1830 | source = "registry+https://github.com/rust-lang/crates.io-index" 1831 | checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" 1832 | dependencies = [ 1833 | "cfg-if", 1834 | "cpufeatures", 1835 | "digest", 1836 | ] 1837 | 1838 | [[package]] 1839 | name = "sharded-slab" 1840 | version = "0.1.4" 1841 | source = "registry+https://github.com/rust-lang/crates.io-index" 1842 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 1843 | dependencies = [ 1844 | "lazy_static", 1845 | ] 1846 | 1847 | [[package]] 1848 | name = "siphasher" 1849 | version = "0.3.10" 1850 | source = "registry+https://github.com/rust-lang/crates.io-index" 1851 | checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" 1852 | 1853 | [[package]] 1854 | name = "smallvec" 1855 | version = "1.10.0" 1856 | source = "registry+https://github.com/rust-lang/crates.io-index" 1857 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 1858 | 1859 | [[package]] 1860 | name = "smawk" 1861 | version = "0.3.1" 1862 | source = "registry+https://github.com/rust-lang/crates.io-index" 1863 | checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" 1864 | 1865 | [[package]] 1866 | name = "sourcemap" 1867 | version = "6.2.0" 1868 | source = "registry+https://github.com/rust-lang/crates.io-index" 1869 | checksum = "c46fdc1838ff49cf692226f5c2b0f5b7538f556863d0eca602984714667ac6e7" 1870 | dependencies = [ 1871 | "base64", 1872 | "if_chain", 1873 | "lazy_static", 1874 | "regex", 1875 | "rustc_version", 1876 | "serde", 1877 | "serde_json", 1878 | "url", 1879 | ] 1880 | 1881 | [[package]] 1882 | name = "stable_deref_trait" 1883 | version = "1.2.0" 1884 | source = "registry+https://github.com/rust-lang/crates.io-index" 1885 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1886 | 1887 | [[package]] 1888 | name = "static_assertions" 1889 | version = "1.1.0" 1890 | source = "registry+https://github.com/rust-lang/crates.io-index" 1891 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1892 | 1893 | [[package]] 1894 | name = "string_cache" 1895 | version = "0.8.4" 1896 | source = "registry+https://github.com/rust-lang/crates.io-index" 1897 | checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" 1898 | dependencies = [ 1899 | "new_debug_unreachable", 1900 | "once_cell", 1901 | "parking_lot", 1902 | "phf_shared", 1903 | "precomputed-hash", 1904 | "serde", 1905 | ] 1906 | 1907 | [[package]] 1908 | name = "string_cache_codegen" 1909 | version = "0.5.2" 1910 | source = "registry+https://github.com/rust-lang/crates.io-index" 1911 | checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" 1912 | dependencies = [ 1913 | "phf_generator", 1914 | "phf_shared", 1915 | "proc-macro2", 1916 | "quote", 1917 | ] 1918 | 1919 | [[package]] 1920 | name = "string_enum" 1921 | version = "0.3.2" 1922 | source = "registry+https://github.com/rust-lang/crates.io-index" 1923 | checksum = "994453cd270ad0265796eb24abf5540091ed03e681c5f3c12bc33e4db33253e1" 1924 | dependencies = [ 1925 | "pmutil", 1926 | "proc-macro2", 1927 | "quote", 1928 | "swc_macros_common", 1929 | "syn", 1930 | ] 1931 | 1932 | [[package]] 1933 | name = "strsim" 1934 | version = "0.10.0" 1935 | source = "registry+https://github.com/rust-lang/crates.io-index" 1936 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1937 | 1938 | [[package]] 1939 | name = "strum" 1940 | version = "0.24.1" 1941 | source = "registry+https://github.com/rust-lang/crates.io-index" 1942 | checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" 1943 | 1944 | [[package]] 1945 | name = "strum_macros" 1946 | version = "0.24.3" 1947 | source = "registry+https://github.com/rust-lang/crates.io-index" 1948 | checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" 1949 | dependencies = [ 1950 | "heck", 1951 | "proc-macro2", 1952 | "quote", 1953 | "rustversion", 1954 | "syn", 1955 | ] 1956 | 1957 | [[package]] 1958 | name = "supports-color" 1959 | version = "1.3.1" 1960 | source = "registry+https://github.com/rust-lang/crates.io-index" 1961 | checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" 1962 | dependencies = [ 1963 | "atty", 1964 | "is_ci", 1965 | ] 1966 | 1967 | [[package]] 1968 | name = "supports-hyperlinks" 1969 | version = "1.2.0" 1970 | source = "registry+https://github.com/rust-lang/crates.io-index" 1971 | checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" 1972 | dependencies = [ 1973 | "atty", 1974 | ] 1975 | 1976 | [[package]] 1977 | name = "supports-unicode" 1978 | version = "1.0.2" 1979 | source = "registry+https://github.com/rust-lang/crates.io-index" 1980 | checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" 1981 | dependencies = [ 1982 | "atty", 1983 | ] 1984 | 1985 | [[package]] 1986 | name = "swc_atoms" 1987 | version = "0.4.30" 1988 | source = "registry+https://github.com/rust-lang/crates.io-index" 1989 | checksum = "d20167122f1f8566ec6fc4d34dcbdeed34cbade2e5d3fdcfd6fca6613c88b1ad" 1990 | dependencies = [ 1991 | "once_cell", 1992 | "rkyv", 1993 | "rustc-hash", 1994 | "serde", 1995 | "string_cache", 1996 | "string_cache_codegen", 1997 | "triomphe", 1998 | ] 1999 | 2000 | [[package]] 2001 | name = "swc_common" 2002 | version = "0.29.23" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "811faf77280a5f43fedf06769c391d4f2ed274b1ce9267e3a47e9b13527930b7" 2005 | dependencies = [ 2006 | "ahash 0.7.6", 2007 | "anyhow", 2008 | "ast_node", 2009 | "atty", 2010 | "better_scoped_tls", 2011 | "cfg-if", 2012 | "either", 2013 | "from_variant", 2014 | "new_debug_unreachable", 2015 | "num-bigint", 2016 | "once_cell", 2017 | "parking_lot", 2018 | "rkyv", 2019 | "rustc-hash", 2020 | "serde", 2021 | "siphasher", 2022 | "sourcemap", 2023 | "string_cache", 2024 | "swc_atoms", 2025 | "swc_eq_ignore_macros", 2026 | "swc_visit", 2027 | "termcolor", 2028 | "tracing", 2029 | "unicode-width", 2030 | "url", 2031 | ] 2032 | 2033 | [[package]] 2034 | name = "swc_config" 2035 | version = "0.1.4" 2036 | source = "registry+https://github.com/rust-lang/crates.io-index" 2037 | checksum = "b4de36224eb9498fccd4e68971f0b83326ccf8592c2d424f257f3a1c76b2b211" 2038 | dependencies = [ 2039 | "indexmap", 2040 | "serde", 2041 | "serde_json", 2042 | "swc_config_macro", 2043 | ] 2044 | 2045 | [[package]] 2046 | name = "swc_config_macro" 2047 | version = "0.1.0" 2048 | source = "registry+https://github.com/rust-lang/crates.io-index" 2049 | checksum = "fb64bc03d90fd5c90d6ab917bb2b1d7fbd31957df39e31ea24a3f554b4372251" 2050 | dependencies = [ 2051 | "pmutil", 2052 | "proc-macro2", 2053 | "quote", 2054 | "swc_macros_common", 2055 | "syn", 2056 | ] 2057 | 2058 | [[package]] 2059 | name = "swc_core" 2060 | version = "0.43.41" 2061 | source = "registry+https://github.com/rust-lang/crates.io-index" 2062 | checksum = "3f4849f4922b4a6f1da20e20ae978c32336cea9d8be172eb947e8f7161cdf27e" 2063 | dependencies = [ 2064 | "once_cell", 2065 | "swc_atoms", 2066 | "swc_common", 2067 | "swc_ecma_ast", 2068 | "swc_ecma_parser", 2069 | "swc_ecma_transforms_base", 2070 | "swc_ecma_transforms_react", 2071 | "swc_ecma_transforms_testing", 2072 | "swc_ecma_visit", 2073 | "swc_plugin", 2074 | "swc_plugin_macro", 2075 | "swc_plugin_proxy", 2076 | "vergen", 2077 | ] 2078 | 2079 | [[package]] 2080 | name = "swc_ecma_ast" 2081 | version = "0.94.21" 2082 | source = "registry+https://github.com/rust-lang/crates.io-index" 2083 | checksum = "b7823e863bebbcbcabba5d5781dd8cedcf1acb35a770a871c914855b43783e17" 2084 | dependencies = [ 2085 | "bitflags", 2086 | "is-macro", 2087 | "num-bigint", 2088 | "rkyv", 2089 | "scoped-tls", 2090 | "serde", 2091 | "string_enum", 2092 | "swc_atoms", 2093 | "swc_common", 2094 | "unicode-id", 2095 | ] 2096 | 2097 | [[package]] 2098 | name = "swc_ecma_codegen" 2099 | version = "0.127.39" 2100 | source = "registry+https://github.com/rust-lang/crates.io-index" 2101 | checksum = "4db075d6aacbb3bfdcd459c40d6f4abc6f6fbd26990d57bc24c30baa6f348300" 2102 | dependencies = [ 2103 | "memchr", 2104 | "num-bigint", 2105 | "once_cell", 2106 | "rustc-hash", 2107 | "serde", 2108 | "sourcemap", 2109 | "swc_atoms", 2110 | "swc_common", 2111 | "swc_ecma_ast", 2112 | "swc_ecma_codegen_macros", 2113 | "tracing", 2114 | ] 2115 | 2116 | [[package]] 2117 | name = "swc_ecma_codegen_macros" 2118 | version = "0.7.1" 2119 | source = "registry+https://github.com/rust-lang/crates.io-index" 2120 | checksum = "0159c99f81f52e48fe692ef7af1b0990b45d3006b14c6629be0b1ffee1b23aea" 2121 | dependencies = [ 2122 | "pmutil", 2123 | "proc-macro2", 2124 | "quote", 2125 | "swc_macros_common", 2126 | "syn", 2127 | ] 2128 | 2129 | [[package]] 2130 | name = "swc_ecma_parser" 2131 | version = "0.122.32" 2132 | source = "registry+https://github.com/rust-lang/crates.io-index" 2133 | checksum = "3d96fdbe0817bb029318a064e5543840ab38c0616122b31b910b3a5cda250cf2" 2134 | dependencies = [ 2135 | "either", 2136 | "enum_kind", 2137 | "lexical", 2138 | "num-bigint", 2139 | "serde", 2140 | "smallvec", 2141 | "swc_atoms", 2142 | "swc_common", 2143 | "swc_ecma_ast", 2144 | "tracing", 2145 | "typed-arena", 2146 | ] 2147 | 2148 | [[package]] 2149 | name = "swc_ecma_testing" 2150 | version = "0.20.8" 2151 | source = "registry+https://github.com/rust-lang/crates.io-index" 2152 | checksum = "25198f96ef93c4bb4cc8fa13c9b22a018cf2c0c7609ee91f7abc7968ebc2e2df" 2153 | dependencies = [ 2154 | "anyhow", 2155 | "hex", 2156 | "sha-1", 2157 | "tracing", 2158 | ] 2159 | 2160 | [[package]] 2161 | name = "swc_ecma_transforms_base" 2162 | version = "0.111.59" 2163 | source = "registry+https://github.com/rust-lang/crates.io-index" 2164 | checksum = "2542aea061bafff3ebc5b9fed840254e004d0462ac05e2be555d3053f2525674" 2165 | dependencies = [ 2166 | "better_scoped_tls", 2167 | "bitflags", 2168 | "once_cell", 2169 | "phf", 2170 | "rustc-hash", 2171 | "serde", 2172 | "smallvec", 2173 | "swc_atoms", 2174 | "swc_common", 2175 | "swc_ecma_ast", 2176 | "swc_ecma_parser", 2177 | "swc_ecma_utils", 2178 | "swc_ecma_visit", 2179 | "tracing", 2180 | ] 2181 | 2182 | [[package]] 2183 | name = "swc_ecma_transforms_macros" 2184 | version = "0.5.0" 2185 | source = "registry+https://github.com/rust-lang/crates.io-index" 2186 | checksum = "ebf907935ec5492256b523ae7935a824d9fdc0368dcadc41375bad0dca91cd8b" 2187 | dependencies = [ 2188 | "pmutil", 2189 | "proc-macro2", 2190 | "quote", 2191 | "swc_macros_common", 2192 | "syn", 2193 | ] 2194 | 2195 | [[package]] 2196 | name = "swc_ecma_transforms_react" 2197 | version = "0.155.57" 2198 | source = "registry+https://github.com/rust-lang/crates.io-index" 2199 | checksum = "69b265c36094d2b56244806d2040710a10cc11ecd24bfb1219267631e1616a39" 2200 | dependencies = [ 2201 | "ahash 0.7.6", 2202 | "base64", 2203 | "dashmap", 2204 | "indexmap", 2205 | "once_cell", 2206 | "regex", 2207 | "serde", 2208 | "sha-1", 2209 | "string_enum", 2210 | "swc_atoms", 2211 | "swc_common", 2212 | "swc_config", 2213 | "swc_ecma_ast", 2214 | "swc_ecma_parser", 2215 | "swc_ecma_transforms_base", 2216 | "swc_ecma_transforms_macros", 2217 | "swc_ecma_utils", 2218 | "swc_ecma_visit", 2219 | ] 2220 | 2221 | [[package]] 2222 | name = "swc_ecma_transforms_testing" 2223 | version = "0.114.44" 2224 | source = "registry+https://github.com/rust-lang/crates.io-index" 2225 | checksum = "1d8910113373614932f310ae039ff762a0ca8f25aeeb2c417190d1298bcdbfb5" 2226 | dependencies = [ 2227 | "ansi_term", 2228 | "anyhow", 2229 | "base64", 2230 | "hex", 2231 | "serde", 2232 | "serde_json", 2233 | "sha-1", 2234 | "sourcemap", 2235 | "swc_common", 2236 | "swc_ecma_ast", 2237 | "swc_ecma_codegen", 2238 | "swc_ecma_parser", 2239 | "swc_ecma_testing", 2240 | "swc_ecma_transforms_base", 2241 | "swc_ecma_utils", 2242 | "swc_ecma_visit", 2243 | "tempfile", 2244 | "testing", 2245 | ] 2246 | 2247 | [[package]] 2248 | name = "swc_ecma_utils" 2249 | version = "0.105.40" 2250 | source = "registry+https://github.com/rust-lang/crates.io-index" 2251 | checksum = "00bb6ce08b6978bbc17a7a7e22c608d3e5c566218bd765ad4a7f0a83758e8a1b" 2252 | dependencies = [ 2253 | "indexmap", 2254 | "num_cpus", 2255 | "once_cell", 2256 | "swc_atoms", 2257 | "swc_common", 2258 | "swc_ecma_ast", 2259 | "swc_ecma_visit", 2260 | "tracing", 2261 | "unicode-id", 2262 | ] 2263 | 2264 | [[package]] 2265 | name = "swc_ecma_visit" 2266 | version = "0.80.21" 2267 | source = "registry+https://github.com/rust-lang/crates.io-index" 2268 | checksum = "07c3c5ca0a76f58b8b40e3733e4c67c47a6875c318e40ad11d535a26e44609b6" 2269 | dependencies = [ 2270 | "num-bigint", 2271 | "swc_atoms", 2272 | "swc_common", 2273 | "swc_ecma_ast", 2274 | "swc_visit", 2275 | "tracing", 2276 | ] 2277 | 2278 | [[package]] 2279 | name = "swc_eq_ignore_macros" 2280 | version = "0.1.1" 2281 | source = "registry+https://github.com/rust-lang/crates.io-index" 2282 | checksum = "0c20468634668c2bbab581947bb8c75c97158d5a6959f4ba33df20983b20b4f6" 2283 | dependencies = [ 2284 | "pmutil", 2285 | "proc-macro2", 2286 | "quote", 2287 | "syn", 2288 | ] 2289 | 2290 | [[package]] 2291 | name = "swc_error_reporters" 2292 | version = "0.13.24" 2293 | source = "registry+https://github.com/rust-lang/crates.io-index" 2294 | checksum = "035712357b19deefa23cec538f5cca48e6a799b1f37f6bf7cfbf1328f035c030" 2295 | dependencies = [ 2296 | "anyhow", 2297 | "miette 4.7.1", 2298 | "once_cell", 2299 | "parking_lot", 2300 | "swc_common", 2301 | ] 2302 | 2303 | [[package]] 2304 | name = "swc_macros_common" 2305 | version = "0.3.6" 2306 | source = "registry+https://github.com/rust-lang/crates.io-index" 2307 | checksum = "a4be988307882648d9bc7c71a6a73322b7520ef0211e920489a98f8391d8caa2" 2308 | dependencies = [ 2309 | "pmutil", 2310 | "proc-macro2", 2311 | "quote", 2312 | "syn", 2313 | ] 2314 | 2315 | [[package]] 2316 | name = "swc_plugin" 2317 | version = "0.90.0" 2318 | source = "registry+https://github.com/rust-lang/crates.io-index" 2319 | checksum = "ca5df720531bfbd7ceb1139319c39c20c446abfb8f7e0eb47b104205a71152b4" 2320 | dependencies = [ 2321 | "once_cell", 2322 | ] 2323 | 2324 | [[package]] 2325 | name = "swc_plugin_macro" 2326 | version = "0.9.10" 2327 | source = "registry+https://github.com/rust-lang/crates.io-index" 2328 | checksum = "8c00caf955dfbff15974f061f8c2e8a8b9b5ce999cb601f02f3ec66253e81149" 2329 | dependencies = [ 2330 | "proc-macro2", 2331 | "quote", 2332 | "syn", 2333 | ] 2334 | 2335 | [[package]] 2336 | name = "swc_plugin_proxy" 2337 | version = "0.22.23" 2338 | source = "registry+https://github.com/rust-lang/crates.io-index" 2339 | checksum = "60247a2e9f091815a1e67294c65f8cbd27cfa681c1ee6aca90f086f5bf55e58f" 2340 | dependencies = [ 2341 | "better_scoped_tls", 2342 | "rkyv", 2343 | "swc_common", 2344 | "swc_ecma_ast", 2345 | "swc_trace_macro", 2346 | "tracing", 2347 | ] 2348 | 2349 | [[package]] 2350 | name = "swc_trace_macro" 2351 | version = "0.1.2" 2352 | source = "registry+https://github.com/rust-lang/crates.io-index" 2353 | checksum = "a4795c8d23e0de62eef9cac0a20ae52429ee2ffc719768e838490f195b7d7267" 2354 | dependencies = [ 2355 | "proc-macro2", 2356 | "quote", 2357 | "syn", 2358 | ] 2359 | 2360 | [[package]] 2361 | name = "swc_visit" 2362 | version = "0.5.3" 2363 | source = "registry+https://github.com/rust-lang/crates.io-index" 2364 | checksum = "82f2bcb7223e185c4c7cbf5e0c1207dec6d2bfd5e72e3fb7b3e8d179747e9130" 2365 | dependencies = [ 2366 | "either", 2367 | "swc_visit_macros", 2368 | ] 2369 | 2370 | [[package]] 2371 | name = "swc_visit_macros" 2372 | version = "0.5.4" 2373 | source = "registry+https://github.com/rust-lang/crates.io-index" 2374 | checksum = "8fb1f3561674d84947694d41fb6d5737d19539222779baeac1b3a071a2b29428" 2375 | dependencies = [ 2376 | "Inflector", 2377 | "pmutil", 2378 | "proc-macro2", 2379 | "quote", 2380 | "swc_macros_common", 2381 | "syn", 2382 | ] 2383 | 2384 | [[package]] 2385 | name = "syn" 2386 | version = "1.0.107" 2387 | source = "registry+https://github.com/rust-lang/crates.io-index" 2388 | checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" 2389 | dependencies = [ 2390 | "proc-macro2", 2391 | "quote", 2392 | "unicode-ident", 2393 | ] 2394 | 2395 | [[package]] 2396 | name = "tap" 2397 | version = "1.0.1" 2398 | source = "registry+https://github.com/rust-lang/crates.io-index" 2399 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 2400 | 2401 | [[package]] 2402 | name = "tempfile" 2403 | version = "3.3.0" 2404 | source = "registry+https://github.com/rust-lang/crates.io-index" 2405 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 2406 | dependencies = [ 2407 | "cfg-if", 2408 | "fastrand", 2409 | "libc", 2410 | "redox_syscall", 2411 | "remove_dir_all", 2412 | "winapi", 2413 | ] 2414 | 2415 | [[package]] 2416 | name = "termcolor" 2417 | version = "1.1.3" 2418 | source = "registry+https://github.com/rust-lang/crates.io-index" 2419 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 2420 | dependencies = [ 2421 | "winapi-util", 2422 | ] 2423 | 2424 | [[package]] 2425 | name = "terminal_size" 2426 | version = "0.1.17" 2427 | source = "registry+https://github.com/rust-lang/crates.io-index" 2428 | checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" 2429 | dependencies = [ 2430 | "libc", 2431 | "winapi", 2432 | ] 2433 | 2434 | [[package]] 2435 | name = "testing" 2436 | version = "0.31.25" 2437 | source = "registry+https://github.com/rust-lang/crates.io-index" 2438 | checksum = "fae24fe7e30a2c9774168db8ac116f0258da877c42ed02a267432c935672fef6" 2439 | dependencies = [ 2440 | "ansi_term", 2441 | "difference", 2442 | "once_cell", 2443 | "pretty_assertions", 2444 | "regex", 2445 | "serde_json", 2446 | "swc_common", 2447 | "swc_error_reporters", 2448 | "testing_macros", 2449 | "tracing", 2450 | "tracing-subscriber", 2451 | ] 2452 | 2453 | [[package]] 2454 | name = "testing_macros" 2455 | version = "0.2.7" 2456 | source = "registry+https://github.com/rust-lang/crates.io-index" 2457 | checksum = "e74ff09d2d4d4b7ea140ff67eb7ed8fd35a708e2c327bcde5a25707d66840099" 2458 | dependencies = [ 2459 | "anyhow", 2460 | "glob", 2461 | "once_cell", 2462 | "pmutil", 2463 | "proc-macro2", 2464 | "quote", 2465 | "regex", 2466 | "relative-path", 2467 | "syn", 2468 | ] 2469 | 2470 | [[package]] 2471 | name = "textwrap" 2472 | version = "0.15.2" 2473 | source = "registry+https://github.com/rust-lang/crates.io-index" 2474 | checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" 2475 | dependencies = [ 2476 | "smawk", 2477 | "unicode-linebreak", 2478 | "unicode-width", 2479 | ] 2480 | 2481 | [[package]] 2482 | name = "textwrap" 2483 | version = "0.16.0" 2484 | source = "registry+https://github.com/rust-lang/crates.io-index" 2485 | checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" 2486 | 2487 | [[package]] 2488 | name = "thiserror" 2489 | version = "1.0.38" 2490 | source = "registry+https://github.com/rust-lang/crates.io-index" 2491 | checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" 2492 | dependencies = [ 2493 | "thiserror-impl", 2494 | ] 2495 | 2496 | [[package]] 2497 | name = "thiserror-impl" 2498 | version = "1.0.38" 2499 | source = "registry+https://github.com/rust-lang/crates.io-index" 2500 | checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" 2501 | dependencies = [ 2502 | "proc-macro2", 2503 | "quote", 2504 | "syn", 2505 | ] 2506 | 2507 | [[package]] 2508 | name = "thread_local" 2509 | version = "1.1.4" 2510 | source = "registry+https://github.com/rust-lang/crates.io-index" 2511 | checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" 2512 | dependencies = [ 2513 | "once_cell", 2514 | ] 2515 | 2516 | [[package]] 2517 | name = "time" 2518 | version = "0.3.17" 2519 | source = "registry+https://github.com/rust-lang/crates.io-index" 2520 | checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" 2521 | dependencies = [ 2522 | "itoa", 2523 | "serde", 2524 | "time-core", 2525 | "time-macros", 2526 | ] 2527 | 2528 | [[package]] 2529 | name = "time-core" 2530 | version = "0.1.0" 2531 | source = "registry+https://github.com/rust-lang/crates.io-index" 2532 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 2533 | 2534 | [[package]] 2535 | name = "time-macros" 2536 | version = "0.2.6" 2537 | source = "registry+https://github.com/rust-lang/crates.io-index" 2538 | checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" 2539 | dependencies = [ 2540 | "time-core", 2541 | ] 2542 | 2543 | [[package]] 2544 | name = "tiny-keccak" 2545 | version = "2.0.2" 2546 | source = "registry+https://github.com/rust-lang/crates.io-index" 2547 | checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" 2548 | dependencies = [ 2549 | "crunchy", 2550 | ] 2551 | 2552 | [[package]] 2553 | name = "tinyvec" 2554 | version = "1.6.0" 2555 | source = "registry+https://github.com/rust-lang/crates.io-index" 2556 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 2557 | dependencies = [ 2558 | "tinyvec_macros", 2559 | ] 2560 | 2561 | [[package]] 2562 | name = "tinyvec_macros" 2563 | version = "0.1.0" 2564 | source = "registry+https://github.com/rust-lang/crates.io-index" 2565 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 2566 | 2567 | [[package]] 2568 | name = "toml" 2569 | version = "0.5.10" 2570 | source = "registry+https://github.com/rust-lang/crates.io-index" 2571 | checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" 2572 | dependencies = [ 2573 | "serde", 2574 | ] 2575 | 2576 | [[package]] 2577 | name = "tracing" 2578 | version = "0.1.37" 2579 | source = "registry+https://github.com/rust-lang/crates.io-index" 2580 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 2581 | dependencies = [ 2582 | "cfg-if", 2583 | "pin-project-lite", 2584 | "tracing-attributes", 2585 | "tracing-core", 2586 | ] 2587 | 2588 | [[package]] 2589 | name = "tracing-attributes" 2590 | version = "0.1.23" 2591 | source = "registry+https://github.com/rust-lang/crates.io-index" 2592 | checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" 2593 | dependencies = [ 2594 | "proc-macro2", 2595 | "quote", 2596 | "syn", 2597 | ] 2598 | 2599 | [[package]] 2600 | name = "tracing-core" 2601 | version = "0.1.30" 2602 | source = "registry+https://github.com/rust-lang/crates.io-index" 2603 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 2604 | dependencies = [ 2605 | "once_cell", 2606 | "valuable", 2607 | ] 2608 | 2609 | [[package]] 2610 | name = "tracing-log" 2611 | version = "0.1.3" 2612 | source = "registry+https://github.com/rust-lang/crates.io-index" 2613 | checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" 2614 | dependencies = [ 2615 | "lazy_static", 2616 | "log", 2617 | "tracing-core", 2618 | ] 2619 | 2620 | [[package]] 2621 | name = "tracing-subscriber" 2622 | version = "0.3.16" 2623 | source = "registry+https://github.com/rust-lang/crates.io-index" 2624 | checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" 2625 | dependencies = [ 2626 | "matchers", 2627 | "nu-ansi-term", 2628 | "once_cell", 2629 | "regex", 2630 | "sharded-slab", 2631 | "smallvec", 2632 | "thread_local", 2633 | "tracing", 2634 | "tracing-core", 2635 | "tracing-log", 2636 | ] 2637 | 2638 | [[package]] 2639 | name = "triomphe" 2640 | version = "0.1.8" 2641 | source = "registry+https://github.com/rust-lang/crates.io-index" 2642 | checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" 2643 | dependencies = [ 2644 | "serde", 2645 | "stable_deref_trait", 2646 | ] 2647 | 2648 | [[package]] 2649 | name = "typed-arena" 2650 | version = "2.0.1" 2651 | source = "registry+https://github.com/rust-lang/crates.io-index" 2652 | checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" 2653 | 2654 | [[package]] 2655 | name = "typenum" 2656 | version = "1.16.0" 2657 | source = "registry+https://github.com/rust-lang/crates.io-index" 2658 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 2659 | 2660 | [[package]] 2661 | name = "unicase" 2662 | version = "2.6.0" 2663 | source = "registry+https://github.com/rust-lang/crates.io-index" 2664 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 2665 | dependencies = [ 2666 | "version_check", 2667 | ] 2668 | 2669 | [[package]] 2670 | name = "unicode-bidi" 2671 | version = "0.3.8" 2672 | source = "registry+https://github.com/rust-lang/crates.io-index" 2673 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 2674 | 2675 | [[package]] 2676 | name = "unicode-id" 2677 | version = "0.3.3" 2678 | source = "registry+https://github.com/rust-lang/crates.io-index" 2679 | checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" 2680 | 2681 | [[package]] 2682 | name = "unicode-ident" 2683 | version = "1.0.6" 2684 | source = "registry+https://github.com/rust-lang/crates.io-index" 2685 | checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" 2686 | 2687 | [[package]] 2688 | name = "unicode-linebreak" 2689 | version = "0.1.4" 2690 | source = "registry+https://github.com/rust-lang/crates.io-index" 2691 | checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" 2692 | dependencies = [ 2693 | "hashbrown", 2694 | "regex", 2695 | ] 2696 | 2697 | [[package]] 2698 | name = "unicode-normalization" 2699 | version = "0.1.22" 2700 | source = "registry+https://github.com/rust-lang/crates.io-index" 2701 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 2702 | dependencies = [ 2703 | "tinyvec", 2704 | ] 2705 | 2706 | [[package]] 2707 | name = "unicode-segmentation" 2708 | version = "1.10.0" 2709 | source = "registry+https://github.com/rust-lang/crates.io-index" 2710 | checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" 2711 | 2712 | [[package]] 2713 | name = "unicode-width" 2714 | version = "0.1.10" 2715 | source = "registry+https://github.com/rust-lang/crates.io-index" 2716 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 2717 | 2718 | [[package]] 2719 | name = "uplc" 2720 | version = "0.0.25" 2721 | source = "git+https://github.com/aiken-lang/aiken.git?rev=43ff66c#43ff66cd012784ed826501d2c442e50333053859" 2722 | dependencies = [ 2723 | "anyhow", 2724 | "cryptoxide", 2725 | "flat-rs", 2726 | "hex", 2727 | "itertools", 2728 | "pallas-addresses", 2729 | "pallas-codec", 2730 | "pallas-crypto", 2731 | "pallas-primitives", 2732 | "pallas-traverse", 2733 | "peg", 2734 | "pretty", 2735 | "serde", 2736 | "serde_json", 2737 | "strum", 2738 | "strum_macros", 2739 | "thiserror", 2740 | ] 2741 | 2742 | [[package]] 2743 | name = "url" 2744 | version = "2.3.1" 2745 | source = "registry+https://github.com/rust-lang/crates.io-index" 2746 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 2747 | dependencies = [ 2748 | "form_urlencoded", 2749 | "idna", 2750 | "percent-encoding", 2751 | "serde", 2752 | ] 2753 | 2754 | [[package]] 2755 | name = "valuable" 2756 | version = "0.1.0" 2757 | source = "registry+https://github.com/rust-lang/crates.io-index" 2758 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 2759 | 2760 | [[package]] 2761 | name = "vec1" 2762 | version = "1.10.1" 2763 | source = "registry+https://github.com/rust-lang/crates.io-index" 2764 | checksum = "2bda7c41ca331fe9a1c278a9e7ee055f4be7f5eb1c2b72f079b4ff8b5fce9d5c" 2765 | 2766 | [[package]] 2767 | name = "vergen" 2768 | version = "7.4.3" 2769 | source = "registry+https://github.com/rust-lang/crates.io-index" 2770 | checksum = "447f9238a4553957277b3ee09d80babeae0811f1b3baefb093de1c0448437a37" 2771 | dependencies = [ 2772 | "anyhow", 2773 | "cfg-if", 2774 | "enum-iterator", 2775 | "getset", 2776 | "rustversion", 2777 | "thiserror", 2778 | "time", 2779 | ] 2780 | 2781 | [[package]] 2782 | name = "version_check" 2783 | version = "0.9.4" 2784 | source = "registry+https://github.com/rust-lang/crates.io-index" 2785 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2786 | 2787 | [[package]] 2788 | name = "walkdir" 2789 | version = "2.3.2" 2790 | source = "registry+https://github.com/rust-lang/crates.io-index" 2791 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 2792 | dependencies = [ 2793 | "same-file", 2794 | "winapi", 2795 | "winapi-util", 2796 | ] 2797 | 2798 | [[package]] 2799 | name = "wasi" 2800 | version = "0.11.0+wasi-snapshot-preview1" 2801 | source = "registry+https://github.com/rust-lang/crates.io-index" 2802 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2803 | 2804 | [[package]] 2805 | name = "winapi" 2806 | version = "0.3.9" 2807 | source = "registry+https://github.com/rust-lang/crates.io-index" 2808 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2809 | dependencies = [ 2810 | "winapi-i686-pc-windows-gnu", 2811 | "winapi-x86_64-pc-windows-gnu", 2812 | ] 2813 | 2814 | [[package]] 2815 | name = "winapi-i686-pc-windows-gnu" 2816 | version = "0.4.0" 2817 | source = "registry+https://github.com/rust-lang/crates.io-index" 2818 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2819 | 2820 | [[package]] 2821 | name = "winapi-util" 2822 | version = "0.1.5" 2823 | source = "registry+https://github.com/rust-lang/crates.io-index" 2824 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2825 | dependencies = [ 2826 | "winapi", 2827 | ] 2828 | 2829 | [[package]] 2830 | name = "winapi-x86_64-pc-windows-gnu" 2831 | version = "0.4.0" 2832 | source = "registry+https://github.com/rust-lang/crates.io-index" 2833 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2834 | 2835 | [[package]] 2836 | name = "windows-sys" 2837 | version = "0.42.0" 2838 | source = "registry+https://github.com/rust-lang/crates.io-index" 2839 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 2840 | dependencies = [ 2841 | "windows_aarch64_gnullvm", 2842 | "windows_aarch64_msvc", 2843 | "windows_i686_gnu", 2844 | "windows_i686_msvc", 2845 | "windows_x86_64_gnu", 2846 | "windows_x86_64_gnullvm", 2847 | "windows_x86_64_msvc", 2848 | ] 2849 | 2850 | [[package]] 2851 | name = "windows_aarch64_gnullvm" 2852 | version = "0.42.0" 2853 | source = "registry+https://github.com/rust-lang/crates.io-index" 2854 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" 2855 | 2856 | [[package]] 2857 | name = "windows_aarch64_msvc" 2858 | version = "0.42.0" 2859 | source = "registry+https://github.com/rust-lang/crates.io-index" 2860 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 2861 | 2862 | [[package]] 2863 | name = "windows_i686_gnu" 2864 | version = "0.42.0" 2865 | source = "registry+https://github.com/rust-lang/crates.io-index" 2866 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 2867 | 2868 | [[package]] 2869 | name = "windows_i686_msvc" 2870 | version = "0.42.0" 2871 | source = "registry+https://github.com/rust-lang/crates.io-index" 2872 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 2873 | 2874 | [[package]] 2875 | name = "windows_x86_64_gnu" 2876 | version = "0.42.0" 2877 | source = "registry+https://github.com/rust-lang/crates.io-index" 2878 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 2879 | 2880 | [[package]] 2881 | name = "windows_x86_64_gnullvm" 2882 | version = "0.42.0" 2883 | source = "registry+https://github.com/rust-lang/crates.io-index" 2884 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" 2885 | 2886 | [[package]] 2887 | name = "windows_x86_64_msvc" 2888 | version = "0.42.0" 2889 | source = "registry+https://github.com/rust-lang/crates.io-index" 2890 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 2891 | 2892 | [[package]] 2893 | name = "wyz" 2894 | version = "0.2.0" 2895 | source = "registry+https://github.com/rust-lang/crates.io-index" 2896 | checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" 2897 | 2898 | [[package]] 2899 | name = "yansi" 2900 | version = "0.5.1" 2901 | source = "registry+https://github.com/rust-lang/crates.io-index" 2902 | checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" 2903 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "jutus" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Christos KK Loverdos"] 6 | license = "Apache-2.0" 7 | description = "Plutus for the Masses - Writing Javascript/Typescript, compiling to UPLC" 8 | keywords = ["plutus", "uplc", "cardano", "smart", "contract", "blockchain", "web3", "web3000"] 9 | categories = [ "compiler" ] 10 | readme = "README.md" 11 | 12 | [profile.release] 13 | opt-level = "z" # size 14 | lto = true 15 | codegen-units = 1 16 | panic = "abort" 17 | 18 | [dependencies] 19 | serde = { version = "1.0.147", features = ["rc"] } 20 | 21 | ######################################################## 22 | # This is the JS ecosystem workhorse. 23 | # We use the parsing technology of SWC to create a 24 | # JS-friendly Plutus experience. 25 | # So, this is the frontend. 26 | ######################################################## 27 | swc_core = { version = "0.43.18", features = ["plugin_transform", "ecma_parser_typescript", "ecma_transforms_react"] } 28 | 29 | ######################################################## 30 | # This is the Plutus Core workhorse. 31 | # Basically, Plutus Core encoding in Rust (+ utilities) 32 | ######################################################## 33 | aiken-lang = { git = "https://github.com/aiken-lang/aiken.git", rev = "43ff66c"} 34 | aiken-project = { git = "https://github.com/aiken-lang/aiken.git", rev = "43ff66c" } 35 | uplc = { git = "https://github.com/aiken-lang/aiken.git", rev = "43ff66c"} 36 | aiken = { git = "https://github.com/aiken-lang/aiken.git", rev = "43ff66c"} 37 | 38 | # These are used only because we need to copy some code from Aiken (see copy_aiken_project_lib.rs) 39 | regex = "1.6.0" 40 | walkdir = "2.3.2" 41 | hex = "0.4.3" 42 | pallas = "0.14.0" 43 | pallas-traverse = "0.14.0" 44 | miette = { version = "5.3.0", features = ["fancy"] } 45 | 46 | ######################################################## 47 | # Other dependencies 48 | ######################################################## 49 | # inline strings with the intended indentation (yeah this expression is a feature, try and say it) 50 | indoc = "1.0.7" 51 | 52 | # for automatic json serialization, used in pretty-printing 53 | serde_json = "1.0.87" 54 | serde_derive = "1.0.147" 55 | 56 | # BigInt 57 | num-bigint = "0.4.3" 58 | 59 | # Vector with at least one item 60 | vec1 = "1.10.1" 61 | 62 | thiserror = "1.0.37" 63 | -------------------------------------------------------------------------------- /Justfile: -------------------------------------------------------------------------------- 1 | build: system-info 2 | cargo build 3 | 4 | mk: check build 5 | 6 | release: system-info 7 | cargo build --release 8 | 9 | fmt: system-info 10 | cargo fmt --all -- --check 11 | 12 | check: fmt 13 | cargo clippy -- -D warnings 14 | 15 | fix: system-info 16 | cargo clippy --fix 17 | 18 | # Run examples/parse 19 | parse: system-info 20 | cargo run --example parse 21 | 22 | # Run examples/parse_function 23 | parse_function: system-info 24 | cargo run --example parse_function 25 | 26 | # Run examples/parse_function 27 | parse_ts_function: system-info 28 | cargo run --example parse_ts_function 29 | 30 | examples: parse parse_function parse_ts_function 31 | 32 | test: check examples 33 | 34 | system-info: 35 | @echo "Running on {{arch()}}/{{os_family()}}/{{os()}}" 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Jutus - Plutus for the masses 2 | 3 | In "Jutus", "J" is from "**J**avascipt" and "utus" is from 4 | "Pl**utus**". With "Javascript" we mean both Javascript and 5 | Typescript. 6 | 7 | 8 | ### What 9 | 10 | As a Plutus contract developer, I want to write my Smart Contracts in 11 | Javascript. 12 | 13 | ### Why 14 | The world has 15 | [25 million](https://www.theregister.com/2021/04/26/report_developers_slashdata/) 16 | developers, and 17 | [half of them](https://www.inapps.net/how-many-software-developers-are-in-the-world/#JavaScript_developers) 18 | use Javascript. The web is the global platform. So, let's write 19 | Plutus by writing in Javascript ! 20 | 21 | ### How? 22 | 23 | We use both established and emerging open source components and glue 24 | them together in a most (cost-)effective way in order to produce an 25 | end-to-end compilation pipeline. Our strategy is as follows: 26 | 27 | - We use [`swc`](https://swc.rs/) to parse Javascript into their 28 | Abstract Syntax Tree (AST). 29 | - We transform the `swc` AST to our own Intermediate Representation (IR). 30 | - We compile our IR to [`aiken`](https://github.com/txpipe/aiken) AST(s). 31 | - We use `aiken` to type-check and compile to their Untyped Plutus Core 32 | (UPLC) representation. From here it should be straightforward 33 | (via `aiken` again) to generate the binary representation of UPLC. 34 | 35 | You may want to check the section on [architecture](#architecture) for a 36 | visualization of the above. 37 | 38 | This is a feasibility study and a proof-of-concept, and, as such, not ready 39 | for production. But the results are positive, in the sense we prove that 40 | the original idea is doable. We can also take the whole work a step 41 | further by using our IR as a compilation target for other languages. For 42 | instance, one could write Plutus smart contracts in Python. 43 | 44 | We chose Rust as the implementation language because everything we needed 45 | was already there in Rust. This is a very pragmatic and modern language 46 | with a huge ecosystem. 47 | 48 | Please check the examples folder if you want to follow the logic of how 49 | everything fits together. The whole compilation pipeline can also be 50 | seen encoded as `pub fn end_to_end` in `js_compiler.rs`. 51 | 52 | #### Architecture 53 | 54 | Here is the general compilation pipeline architecture. Dotted lines denote 55 | something enabled by this project but not implemented yet. 56 | 57 | ```mermaid 58 | flowchart LR 59 | subgraph "Front-end" 60 | A 61 | AA 62 | AAA 63 | end 64 | 65 | subgraph "Front-end AST" 66 | B 67 | BBB 68 | end 69 | 70 | A([Typescript]) --> B([swc AST]) 71 | AA([Javascript]) --> B 72 | B --> C([jutus IR]) 73 | 74 | 75 | AAA(Language X) -..-> BBB("X" AST) 76 | BBB -..-> C 77 | 78 | C --> D([aiken untyped AST]) 79 | D --> E([aiken typed AST]) 80 | E --> F([aiken UPLC AST]) 81 | F -..-> G([UPLC binary format]) 82 | 83 | subgraph "Back-end AST" 84 | F 85 | end 86 | ``` 87 | -------------------------------------------------------------------------------- /examples/parse.rs: -------------------------------------------------------------------------------- 1 | use indoc::indoc; 2 | use jutus::program::Error; 3 | use jutus::*; 4 | use std::path::Path; 5 | 6 | fn main() -> Result<(), Error> { 7 | let code = indoc! {r#" 8 | function test() { 9 | let b = 123; 10 | let sum = 1 + b; 11 | b + sum; 12 | } 13 | "#}; 14 | 15 | js_compiler::parser_main_helper(code, Path::new(file!())) 16 | } 17 | -------------------------------------------------------------------------------- /examples/parse_function.rs: -------------------------------------------------------------------------------- 1 | use indoc::indoc; 2 | use jutus::program::Error; 3 | use jutus::*; 4 | use std::path::Path; 5 | 6 | fn main() -> Result<(), Error> { 7 | let code = indoc! {r#" 8 | // adds two numbers 9 | function add(a, b) { 10 | let sum = a + b; 11 | return sum; 12 | } 13 | 14 | // subtracts two numbers 15 | function sub(a, b) { return a - b; } 16 | 17 | // the maximum of two numbers 18 | function max(a, b) { 19 | if(a >= b) 20 | return a; 21 | else 22 | return b; 23 | } 24 | 25 | function TheTrue() { return true; } 26 | function TheFalse() { return false; } 27 | "#}; 28 | 29 | js_compiler::parser_main_helper(code, Path::new(file!())) 30 | } 31 | -------------------------------------------------------------------------------- /examples/parse_ts_function.rs: -------------------------------------------------------------------------------- 1 | use indoc::indoc; 2 | use jutus::program::Error; 3 | use jutus::*; 4 | use std::path::Path; 5 | 6 | fn main() -> Result<(), Error> { 7 | let code = indoc! {r#" 8 | // adds two numbers 9 | // function add(a: number, b: number): number { 10 | // return a + b; 11 | // } 12 | 13 | function identity(v: number): number { 14 | return v; 15 | } 16 | 17 | // not a real validator (one of: "spend", "cert", "mint", "withdrawal"). 18 | function spend(sum: number, a: number, b: number): boolean { 19 | return sum == (a + b); 20 | } 21 | "#}; 22 | 23 | js_compiler::parser_main_helper(code, Path::new(file!())) 24 | } 25 | -------------------------------------------------------------------------------- /rust-toolchain: -------------------------------------------------------------------------------- 1 | stable 2 | -------------------------------------------------------------------------------- /src/copy_aiken_project_lib.rs: -------------------------------------------------------------------------------- 1 | // //! This is directly derived from https://github.com/aiken-lang/aiken/blob/43ff66c/crates/project/src/lib.rs 2 | // //! which is licensed as Apache-2.0: https://github.com/aiken-lang/aiken/blob/43ff66c/LICENSE 3 | // //! The reason we cannot use it as a library from aiken is that some functions there are not public. 4 | // //! NOTE Wherever we could use a `use` statements instead of just copying everything, we did it, 5 | // //! e.g. for [aiken_project::Source]. 6 | // //! TODO open a PR/issue 7 | // //! 8 | 9 | use std::{ 10 | collections::HashMap, 11 | fs, 12 | path::{Path, PathBuf}, 13 | }; 14 | 15 | use aiken_lang::{ 16 | ast::{Definition, Function, ModuleKind, TypedDataType, TypedDefinition, TypedFunction}, 17 | builder::{DataTypeKey, FunctionAccessKey}, 18 | builtins::{self, generic_var}, 19 | tipo::TypeInfo, 20 | uplc::CodeGenerator, 21 | IdGenerator, 22 | }; 23 | use aiken_project::module::{CERT, MINT, SPEND, VALIDATOR_NAMES, WITHDRAW}; 24 | use aiken_project::options::{CodeGenMode, Options}; 25 | use aiken_project::script::{EvalHint, EvalInfo, Script}; 26 | use aiken_project::telemetry::EventListener; 27 | use aiken_project::{ 28 | config::Config, 29 | docs, 30 | error::{Error, Warning}, 31 | module::{CheckedModule, CheckedModules, ParsedModule, ParsedModules}, 32 | telemetry::Event, 33 | Source, 34 | }; 35 | use miette::NamedSource; 36 | use pallas::{ 37 | codec::minicbor, 38 | ledger::{addresses::Address, primitives::babbage}, 39 | }; 40 | use pallas_traverse::ComputeHash; 41 | use serde_json::json; 42 | use uplc::{ 43 | ast::{Constant, DeBruijn, Program, Term}, 44 | machine::cost_model::ExBudget, 45 | }; 46 | 47 | // Note(christos): use from library, since everything is public 48 | // #[derive(Debug)] 49 | // pub struct Source { 50 | // pub path: PathBuf, 51 | // pub name: String, 52 | // pub code: String, 53 | // pub kind: ModuleKind, 54 | // } 55 | 56 | pub struct Project 57 | where 58 | T: EventListener, 59 | { 60 | config: Config, 61 | defined_modules: HashMap, 62 | id_gen: IdGenerator, 63 | module_types: HashMap, 64 | root: PathBuf, 65 | sources: Vec, 66 | pub warnings: Vec, 67 | event_listener: T, 68 | } 69 | 70 | impl Project 71 | where 72 | T: EventListener, 73 | { 74 | pub fn new(config: Config, root: PathBuf, event_listener: T) -> Project { 75 | let id_gen = IdGenerator::new(); 76 | 77 | let mut module_types = HashMap::new(); 78 | 79 | module_types.insert("aiken".to_string(), builtins::prelude(&id_gen)); 80 | module_types.insert("aiken/builtin".to_string(), builtins::plutus(&id_gen)); 81 | 82 | Project { 83 | config, 84 | defined_modules: HashMap::new(), 85 | id_gen, 86 | module_types, 87 | root, 88 | sources: vec![], 89 | warnings: vec![], 90 | event_listener, 91 | } 92 | } 93 | 94 | pub fn build(&mut self, uplc: bool) -> Result<(), Error> { 95 | let options = Options { 96 | code_gen_mode: CodeGenMode::Build(uplc), 97 | }; 98 | 99 | self.compile(options) 100 | } 101 | 102 | pub fn docs(&mut self, destination: Option) -> Result<(), Error> { 103 | self.event_listener 104 | .handle_event(Event::BuildingDocumentation { 105 | root: self.root.clone(), 106 | name: self.config.name.clone(), 107 | version: self.config.version.clone(), 108 | }); 109 | self.read_source_files()?; 110 | 111 | let destination = destination.unwrap_or_else(|| self.root.join("doc")); 112 | let mut parsed_modules = self.parse_sources()?; 113 | for (_, module) in parsed_modules.iter_mut() { 114 | module.attach_doc_and_module_comments(); 115 | } 116 | let checked_modules = self.type_check(parsed_modules)?; 117 | self.event_listener.handle_event(Event::GeneratingDocFiles { 118 | output_path: destination.clone(), 119 | }); 120 | let doc_files = 121 | docs::generate_all(&self.root, &self.config, checked_modules.values().collect()); 122 | for file in doc_files { 123 | let path = destination.join(file.path); 124 | fs::create_dir_all(path.parent().unwrap())?; 125 | fs::write(&path, file.content)?; 126 | } 127 | 128 | Ok(()) 129 | } 130 | 131 | pub fn check( 132 | &mut self, 133 | skip_tests: bool, 134 | match_tests: Option, 135 | verbose: bool, 136 | ) -> Result<(), Error> { 137 | let options = Options { 138 | code_gen_mode: if skip_tests { 139 | CodeGenMode::NoOp 140 | } else { 141 | CodeGenMode::Test { 142 | match_tests, 143 | verbose, 144 | } 145 | }, 146 | }; 147 | 148 | self.compile(options) 149 | } 150 | 151 | pub fn compile(&mut self, options: Options) -> Result<(), Error> { 152 | self.event_listener 153 | .handle_event(Event::StartingCompilation { 154 | root: self.root.clone(), 155 | name: self.config.name.clone(), 156 | version: self.config.version.clone(), 157 | }); 158 | 159 | self.read_source_files()?; 160 | let parsed_modules = self.parse_sources()?; 161 | let mut checked_modules = self.type_check(parsed_modules)?; 162 | let validators = self.validate_validators(&mut checked_modules)?; 163 | 164 | match options.code_gen_mode { 165 | CodeGenMode::Build(uplc_dump) => { 166 | self.event_listener.handle_event(Event::GeneratingUPLC { 167 | output_path: self.output_path(), 168 | }); 169 | let programs = self.code_gen(validators, &checked_modules)?; 170 | self.write_build_outputs(programs, uplc_dump)?; 171 | Ok(()) 172 | } 173 | CodeGenMode::Test { 174 | match_tests, 175 | verbose, 176 | } => { 177 | let tests = self.collect_scripts(&checked_modules, verbose, |def| { 178 | matches!(def, Definition::Test(..)) 179 | })?; 180 | if !tests.is_empty() { 181 | self.event_listener.handle_event(Event::RunningTests); 182 | } 183 | let results = self.eval_scripts(tests, match_tests); 184 | let errors: Vec = results 185 | .iter() 186 | .filter_map(|e| { 187 | if e.success { 188 | None 189 | } else { 190 | Some(Error::TestFailure { 191 | name: e.script.name.clone(), 192 | path: e.script.input_path.clone(), 193 | evaluation_hint: e.script.evaluation_hint.clone(), 194 | src: e.script.program.to_pretty(), 195 | verbose, 196 | }) 197 | } 198 | }) 199 | .collect(); 200 | 201 | self.event_listener 202 | .handle_event(Event::FinishedTests { tests: results }); 203 | if !errors.is_empty() { 204 | Err(Error::List(errors)) 205 | } else { 206 | Ok(()) 207 | } 208 | } 209 | CodeGenMode::NoOp => Ok(()), 210 | } 211 | } 212 | 213 | fn read_source_files(&mut self) -> Result<(), Error> { 214 | let lib = self.root.join("lib"); 215 | let validators = self.root.join("validators"); 216 | 217 | self.aiken_files(&validators, ModuleKind::Validator)?; 218 | self.aiken_files(&lib, ModuleKind::Lib)?; 219 | 220 | Ok(()) 221 | } 222 | 223 | fn parse_sources(&mut self) -> Result { 224 | self.event_listener.handle_event(Event::ParsingProjectFiles); 225 | 226 | let mut errors = Vec::new(); 227 | let mut parsed_modules = HashMap::with_capacity(self.sources.len()); 228 | 229 | for Source { 230 | path, 231 | name, 232 | code, 233 | kind, 234 | } in self.sources.drain(0..) 235 | { 236 | match aiken_lang::parser::module(&code, kind) { 237 | Ok((mut ast, extra)) => { 238 | // Store the name 239 | ast.name = name.clone(); 240 | 241 | let module = ParsedModule { 242 | kind, 243 | ast, 244 | code, 245 | name, 246 | path, 247 | extra, 248 | package: self.config.name.clone(), 249 | }; 250 | 251 | if let Some(first) = self 252 | .defined_modules 253 | .insert(module.name.clone(), module.path.clone()) 254 | { 255 | return Err(Error::DuplicateModule { 256 | module: module.name.clone(), 257 | first, 258 | second: module.path, 259 | }); 260 | } 261 | 262 | parsed_modules.insert(module.name.clone(), module); 263 | } 264 | Err(errs) => { 265 | for error in errs { 266 | errors.push(Error::Parse { 267 | path: path.clone(), 268 | src: code.clone(), 269 | named: NamedSource::new(path.display().to_string(), code.clone()), 270 | error: Box::new(error), 271 | }) 272 | } 273 | } 274 | } 275 | } 276 | 277 | if errors.is_empty() { 278 | Ok(parsed_modules.into()) 279 | } else { 280 | Err(Error::List(errors)) 281 | } 282 | } 283 | 284 | // Note(christos): Making this public 285 | pub fn type_check( 286 | &mut self, 287 | mut parsed_modules: ParsedModules, 288 | ) -> Result { 289 | self.event_listener.handle_event(Event::TypeChecking); 290 | let processing_sequence = parsed_modules.sequence()?; 291 | let mut modules = HashMap::with_capacity(parsed_modules.len() + 1); 292 | 293 | for name in processing_sequence { 294 | if let Some(ParsedModule { 295 | name, 296 | path, 297 | code, 298 | kind, 299 | extra, 300 | // TODO: come back and figure out where to use this 301 | package: _package, 302 | ast, 303 | }) = parsed_modules.remove(&name) 304 | { 305 | let mut type_warnings = Vec::new(); 306 | 307 | let ast = ast 308 | .infer( 309 | &self.id_gen, 310 | kind, 311 | &self.config.name, 312 | &self.module_types, 313 | &mut type_warnings, 314 | ) 315 | .map_err(|error| Error::Type { 316 | path: path.clone(), 317 | src: code.clone(), 318 | named: NamedSource::new(path.display().to_string(), code.clone()), 319 | error, 320 | })?; 321 | 322 | // Register any warnings emitted as type warnings 323 | let type_warnings = type_warnings 324 | .into_iter() 325 | .map(|w| Warning::from_type_warning(w, path.clone(), code.clone())); 326 | 327 | self.warnings.extend(type_warnings); 328 | 329 | // Register the types from this module so they can be imported into 330 | // other modules. 331 | self.module_types 332 | .insert(name.clone(), ast.type_info.clone()); 333 | 334 | modules.insert( 335 | name.clone(), 336 | CheckedModule { 337 | kind, 338 | extra, 339 | name, 340 | code, 341 | ast, 342 | input_path: path, 343 | }, 344 | ); 345 | } 346 | } 347 | 348 | Ok(modules.into()) 349 | } 350 | 351 | // Note(christos): Making this public 352 | pub fn validate_validators( 353 | &self, 354 | checked_modules: &mut CheckedModules, 355 | ) -> Result, Error> { 356 | let mut errors = Vec::new(); 357 | let mut validators = Vec::new(); 358 | let mut indices_to_remove = Vec::new(); 359 | 360 | for module in checked_modules.validators() { 361 | for (index, def) in module.ast.definitions().enumerate() { 362 | if let Definition::Fn(func_def) = def { 363 | if VALIDATOR_NAMES.contains(&func_def.name.as_str()) { 364 | // validators must return a Bool 365 | if !func_def.return_type.is_bool() { 366 | errors.push(Error::ValidatorMustReturnBool { 367 | location: func_def.location, 368 | src: module.code.clone(), 369 | path: module.input_path.clone(), 370 | named: NamedSource::new( 371 | module.input_path.display().to_string(), 372 | module.code.clone(), 373 | ), 374 | }) 375 | } 376 | 377 | // depending on name, validate the minimum number of arguments 378 | // if too low, push a new error on to errors 379 | if [MINT, CERT, WITHDRAW].contains(&func_def.name.as_str()) 380 | && func_def.arguments.len() < 2 381 | { 382 | errors.push(Error::WrongValidatorArity { 383 | location: func_def.location, 384 | src: module.code.clone(), 385 | path: module.input_path.clone(), 386 | named: NamedSource::new( 387 | module.input_path.display().to_string(), 388 | module.code.clone(), 389 | ), 390 | name: func_def.name.clone(), 391 | at_least: 2, 392 | }) 393 | } 394 | 395 | if SPEND == func_def.name && func_def.arguments.len() < 3 { 396 | errors.push(Error::WrongValidatorArity { 397 | location: func_def.location, 398 | src: module.code.clone(), 399 | path: module.input_path.clone(), 400 | named: NamedSource::new( 401 | module.input_path.display().to_string(), 402 | module.code.clone(), 403 | ), 404 | name: func_def.name.clone(), 405 | at_least: 3, 406 | }) 407 | } 408 | 409 | validators.push(( 410 | module.input_path.clone(), 411 | module.name.clone(), 412 | func_def.clone(), 413 | )); 414 | indices_to_remove.push(index); 415 | } 416 | } 417 | } 418 | 419 | for index in indices_to_remove.drain(0..) { 420 | module.ast.definitions.remove(index); 421 | } 422 | } 423 | 424 | if errors.is_empty() { 425 | Ok(validators) 426 | } else { 427 | Err(Error::List(errors)) 428 | } 429 | } 430 | 431 | // Note(christos): Making this public 432 | pub fn code_gen( 433 | &mut self, 434 | validators: Vec<(PathBuf, String, TypedFunction)>, 435 | checked_modules: &CheckedModules, 436 | ) -> Result, Error> { 437 | let mut programs = Vec::new(); 438 | let mut functions = HashMap::new(); 439 | let mut type_aliases = HashMap::new(); 440 | let mut data_types = HashMap::new(); 441 | let mut imports = HashMap::new(); 442 | let mut constants = HashMap::new(); 443 | 444 | let option_data_type = TypedDataType::option(generic_var(self.id_gen.next())); 445 | 446 | data_types.insert( 447 | DataTypeKey { 448 | module_name: "".to_string(), 449 | defined_type: "Option".to_string(), 450 | }, 451 | &option_data_type, 452 | ); 453 | 454 | for module in checked_modules.values() { 455 | for def in module.ast.definitions() { 456 | match def { 457 | Definition::Fn(func) => { 458 | functions.insert( 459 | FunctionAccessKey { 460 | module_name: module.name.clone(), 461 | function_name: func.name.clone(), 462 | variant_name: String::new(), 463 | }, 464 | func, 465 | ); 466 | } 467 | Definition::Test(_) => {} 468 | Definition::TypeAlias(ta) => { 469 | type_aliases.insert((module.name.clone(), ta.alias.clone()), ta); 470 | } 471 | Definition::DataType(dt) => { 472 | data_types.insert( 473 | DataTypeKey { 474 | module_name: module.name.clone(), 475 | defined_type: dt.name.clone(), 476 | }, 477 | dt, 478 | ); 479 | } 480 | Definition::Use(import) => { 481 | imports.insert((module.name.clone(), import.module.join("/")), import); 482 | } 483 | Definition::ModuleConstant(mc) => { 484 | constants.insert((module.name.clone(), mc.name.clone()), mc); 485 | } 486 | } 487 | } 488 | } 489 | 490 | for (input_path, module_name, func_def) in validators { 491 | let Function { 492 | arguments, 493 | name, 494 | body, 495 | .. 496 | } = func_def; 497 | 498 | let mut generator = CodeGenerator::new( 499 | &functions, 500 | // &type_aliases, 501 | &data_types, 502 | // &imports, 503 | // &constants, 504 | &self.module_types, 505 | ); 506 | 507 | let program = generator.generate(body, arguments, true); 508 | 509 | let script = Script::new( 510 | input_path, 511 | module_name, 512 | name, 513 | program.try_into().unwrap(), 514 | None, 515 | ); 516 | 517 | programs.push(script); 518 | } 519 | 520 | Ok(programs) 521 | } 522 | 523 | // TODO: revisit ownership and lifetimes of data in this function 524 | fn collect_scripts( 525 | &mut self, 526 | checked_modules: &CheckedModules, 527 | verbose: bool, 528 | should_collect: fn(&TypedDefinition) -> bool, 529 | ) -> Result, Error> { 530 | let mut programs = Vec::new(); 531 | let mut functions = HashMap::new(); 532 | let mut type_aliases = HashMap::new(); 533 | let mut data_types = HashMap::new(); 534 | let mut imports = HashMap::new(); 535 | let mut constants = HashMap::new(); 536 | 537 | let option_data_type = TypedDataType::option(generic_var(self.id_gen.next())); 538 | 539 | data_types.insert( 540 | DataTypeKey { 541 | module_name: "".to_string(), 542 | defined_type: "Option".to_string(), 543 | }, 544 | &option_data_type, 545 | ); 546 | 547 | // let mut indices_to_remove = Vec::new(); 548 | let mut scripts = Vec::new(); 549 | 550 | for module in checked_modules.values() { 551 | for (_index, def) in module.ast.definitions().enumerate() { 552 | match def { 553 | Definition::Fn(func) => { 554 | functions.insert( 555 | FunctionAccessKey { 556 | module_name: module.name.clone(), 557 | function_name: func.name.clone(), 558 | variant_name: String::new(), 559 | }, 560 | func, 561 | ); 562 | if should_collect(def) { 563 | scripts.push((module.input_path.clone(), module.name.clone(), func)); 564 | } 565 | } 566 | Definition::Test(func) => { 567 | if should_collect(def) { 568 | scripts.push((module.input_path.clone(), module.name.clone(), func)); 569 | } 570 | // indices_to_remove.push(index); 571 | } 572 | Definition::TypeAlias(ta) => { 573 | type_aliases.insert((module.name.clone(), ta.alias.clone()), ta); 574 | } 575 | Definition::DataType(dt) => { 576 | data_types.insert( 577 | DataTypeKey { 578 | module_name: module.name.clone(), 579 | defined_type: dt.name.clone(), 580 | }, 581 | dt, 582 | ); 583 | } 584 | Definition::Use(import) => { 585 | imports.insert((module.name.clone(), import.module.join("/")), import); 586 | } 587 | Definition::ModuleConstant(mc) => { 588 | constants.insert((module.name.clone(), mc.name.clone()), mc); 589 | } 590 | } 591 | } 592 | 593 | // for index in indices_to_remove.drain(0..) { 594 | // module.ast.definitions.remove(index); 595 | // } 596 | } 597 | 598 | for (input_path, module_name, func_def) in scripts { 599 | let Function { 600 | arguments, 601 | name, 602 | body, 603 | .. 604 | } = func_def; 605 | 606 | if verbose { 607 | self.event_listener.handle_event(Event::GeneratingUPLCFor { 608 | name: name.clone(), 609 | path: input_path.clone(), 610 | }) 611 | } 612 | 613 | let mut generator = CodeGenerator::new( 614 | &functions, 615 | // &type_aliases, 616 | &data_types, 617 | // &imports, 618 | // &constants, 619 | &self.module_types, 620 | ); 621 | 622 | let evaluation_hint = if let Some((bin_op, left_src, right_src)) = func_def.test_hint() 623 | { 624 | let left = CodeGenerator::new(&functions, &data_types, &self.module_types) 625 | .generate(*left_src, vec![], false) 626 | .try_into() 627 | .unwrap(); 628 | let right = CodeGenerator::new(&functions, &data_types, &self.module_types) 629 | .generate(*right_src, vec![], false) 630 | .try_into() 631 | .unwrap(); 632 | Some(EvalHint { 633 | bin_op, 634 | left, 635 | right, 636 | }) 637 | } else { 638 | None 639 | }; 640 | 641 | let program = generator.generate(body.clone(), arguments.clone(), false); 642 | 643 | let script = Script::new( 644 | input_path, 645 | module_name, 646 | name.to_string(), 647 | program.try_into().unwrap(), 648 | evaluation_hint, 649 | ); 650 | 651 | programs.push(script); 652 | } 653 | 654 | Ok(programs) 655 | } 656 | 657 | // Note(christos): Making this public 658 | pub fn eval_scripts(&self, scripts: Vec