diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 138932beaf..5c597886c7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ updates: schedule: interval: daily time: "10:00" - target-branch: "staging" + target-branch: "testnet3" open-pull-requests-limit: 20 ignore: - dependency-name: snarkvm-curves diff --git a/Cargo.lock b/Cargo.lock index 98bbc22fde..eafa305075 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd" [[package]] name = "assert_cmd" @@ -127,34 +127,13 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" dependencies = [ - "generic-array 0.14.5", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -175,12 +154,6 @@ version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" version = "1.4.3" @@ -267,9 +240,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.14" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" +checksum = "6d76c22c9b9b215eeb8d016ad3a90417bd13cb24cf8142756e6472445876cab7" dependencies = [ "atty", "bitflags", @@ -362,7 +335,7 @@ dependencies = [ "clap 2.34.0", "criterion-plot", "csv", - "itertools 0.10.3", + "itertools", "lazy_static", "num-traits", "oorandom", @@ -384,7 +357,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" dependencies = [ "cast", - "itertools 0.10.3", + "itertools", ] [[package]] @@ -433,11 +406,12 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ - "generic-array 0.14.5", + "generic-array", + "typenum", ] [[package]] @@ -468,9 +442,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -481,22 +455,12 @@ checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "digest" -version = "0.8.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" -dependencies = [ - "block-buffer 0.10.0", + "block-buffer", "crypto-common", - "generic-array 0.14.5", ] [[package]] @@ -566,34 +530,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", - "synstructure", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fastrand" version = "1.7.0" @@ -658,16 +594,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "from-pest" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba9389cedcba1fb3a2aa2ed00f584f2606bce8e0106614a17327a24513bc60f" -dependencies = [ - "pest", - "void", -] - [[package]] name = "fsevent" version = "0.4.0" @@ -776,15 +702,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.5" @@ -1036,15 +953,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" -[[package]] -name = "itertools" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.10.3" @@ -1112,22 +1020,33 @@ dependencies = [ "criterion", "indexmap", "leo-errors", - "leo-input", "leo-span", - "pest", "serde", "serde_json", "smallvec", "tendril", ] +[[package]] +name = "leo-ast-passes" +version = "1.5.3" +dependencies = [ + "indexmap", + "leo-ast", + "leo-errors", + "leo-parser", + "leo-span", +] + [[package]] name = "leo-compiler" version = "1.5.3" dependencies = [ "leo-ast", + "leo-ast-passes", "leo-errors", "leo-parser", + "leo-span", "sha2", ] @@ -1140,38 +1059,23 @@ dependencies = [ "colored", "derivative", "eyre", - "leo-input", "leo-span", - "pest", "serde", "tendril", "thiserror", ] -[[package]] -name = "leo-input" -version = "1.5.3" -dependencies = [ - "from-pest", - "pest", - "pest-ast", - "pest_derive", - "thiserror", - "tracing", -] - [[package]] name = "leo-lang" version = "1.5.3" dependencies = [ "ansi_term", "assert_cmd", - "clap 3.0.14", + "clap 3.1.1", "color-backtrace", "colored", "console", "dirs", - "from-pest", "indexmap", "lazy_static", "leo-ast", @@ -1219,13 +1123,13 @@ dependencies = [ "lazy_static", "leo-ast", "leo-errors", - "leo-input", "leo-span", "leo-test-framework", "serde", "serde_json", "serde_yaml", "smallvec", + "structopt", "tendril", "tracing", ] @@ -1236,7 +1140,6 @@ version = "1.5.3" dependencies = [ "fxhash", "indexmap", - "pest", "scoped-tls", "serde", "tendril", @@ -1281,12 +1184,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "matches" version = "0.1.9" @@ -1551,12 +1448,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "openssl" version = "0.10.38" @@ -1614,53 +1505,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "pest-ast" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf404899169771dd6a32c84248b83cd67a26cc7cc957aac87661490e1227e4" -dependencies = [ - "itertools 0.7.11", - "proc-macro2 0.4.30", - "quote 0.6.13", - "single", - "syn 0.15.44", -] - -[[package]] -name = "pest_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", -] - -[[package]] -name = "pest_meta" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" -dependencies = [ - "maplit", - "pest", - "sha-1", -] - [[package]] name = "pin-project-lite" version = "0.2.8" @@ -1720,7 +1564,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" dependencies = [ "difflib", - "itertools 0.10.3", + "itertools", "predicates-core", ] @@ -1756,9 +1600,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", "version_check", ] @@ -1768,27 +1612,18 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", + "proc-macro2", + "quote", "version_check", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ - "unicode-xid 0.2.2", + "unicode-xid", ] [[package]] @@ -1800,22 +1635,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ - "proc-macro2 1.0.36", + "proc-macro2", ] [[package]] @@ -2166,9 +1992,9 @@ version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2207,27 +2033,15 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug", -] - [[package]] name = "sha2" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.1", + "digest", ] [[package]] @@ -2239,15 +2053,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "single" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5add732a1ab689845591a1b50339cf5310b563e08dc5813c65991f30369ea2" -dependencies = [ - "failure", -] - [[package]] name = "slab" version = "0.4.5" @@ -2270,9 +2075,9 @@ source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc8 dependencies = [ "proc-macro-crate", "proc-macro-error", - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2282,7 +2087,7 @@ source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc8 dependencies = [ "anyhow", "bincode", - "itertools 0.10.3", + "itertools", "num-bigint", "rand 0.8.4", "serde", @@ -2331,20 +2136,9 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", -] - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2353,21 +2147,9 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "unicode-xid 0.2.2", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", - "unicode-xid 0.2.2", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -2459,9 +2241,9 @@ version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2580,9 +2362,9 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2673,12 +2455,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.2" @@ -2721,12 +2497,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - [[package]] name = "wait-timeout" version = "0.2.0" @@ -2788,9 +2558,9 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-shared", ] @@ -2812,7 +2582,7 @@ version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ - "quote 1.0.15", + "quote", "wasm-bindgen-macro-support", ] @@ -2822,9 +2592,9 @@ version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ - "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.86", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index 37b9bc78b5..17ca9838e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ members = [ # "asg", # "asg-passes", "ast", -# "ast-passes", + "ast-passes", "compiler", "errors", "grammar", @@ -63,9 +63,6 @@ version = "1.5.3" #path = "./imports" #version = "1.5.3" # -#[dependencies.leo-input] -#path = "./input" -#version = "1.5.3" [dependencies.leo-package] path = "./package" @@ -107,7 +104,7 @@ git = "https://github.com/AleoHQ/snarkVM.git" rev = "51633e2" [dependencies.clap] -version = "3.0.10" +version = "3.1" [dependencies.color-backtrace] version = "0.5.1" @@ -121,9 +118,6 @@ version = "4.0.0" [dependencies.console] version = "0.15.0" -[dependencies.from-pest] -version = "0.3.1" - [dependencies.indexmap] version = "1.8" features = ["serde"] diff --git a/ast-passes/Cargo.toml b/ast-passes/Cargo.toml index 0a63c84dbb..57f6d387dd 100644 --- a/ast-passes/Cargo.toml +++ b/ast-passes/Cargo.toml @@ -36,6 +36,10 @@ version = "1.5.3" path = "../parser" version = "1.5.3" +[dependencies.leo-span] +path = "../span" +version = "1.5.3" + #[dependencies.leo-stdlib] #path = "../stdlib" #version = "1.5.3" \ No newline at end of file diff --git a/ast-passes/src/canonicalization/canonicalizer.rs b/ast-passes/src/canonicalization/canonicalizer.rs index ac05fa3db2..4c42d32407 100644 --- a/ast-passes/src/canonicalization/canonicalizer.rs +++ b/ast-passes/src/canonicalization/canonicalizer.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. +// Copyright (C) 2019-2022 Aleo Systems Inc. // This file is part of the Leo library. // The Leo library is free software: you can redistribute it and/or modify @@ -14,8 +14,15 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +//! Creates a struct that implements a ReconstructingReducer +//! such that it applies changes to the AST nodes for canonicalization. +//! An example of these changes are transforming Self -> to the circuit name. + use leo_ast::*; -use leo_errors::{AstError, Result, Span}; +use leo_errors::{AstError, Result}; +use leo_span::{sym, Span, Symbol}; + +use indexmap::IndexMap; /// Replace Self when it is in a enclosing circuit type. /// Error when Self is outside an enclosing circuit type. @@ -30,14 +37,6 @@ pub struct Canonicalizer { in_circuit: bool, } -impl AstPass for Canonicalizer { - fn do_pass(ast: Program) -> Result { - Ok(Ast::new( - ReconstructingDirector::new(Self::default()).reduce_program(&ast)?, - )) - } -} - impl Canonicalizer { pub fn canonicalize_accesses( &mut self, @@ -50,34 +49,34 @@ impl Canonicalizer { for access in accesses.iter() { match self.canonicalize_assignee_access(access) { AssigneeAccess::ArrayIndex(index) => { - left = Box::new(Expression::ArrayAccess(ArrayAccessExpression { + left = Box::new(Expression::Access(AccessExpression::Array(ArrayAccess { array: left, index: Box::new(index), span: span.clone(), - })); + }))); } AssigneeAccess::ArrayRange(start, stop) => { - left = Box::new(Expression::ArrayRangeAccess(ArrayRangeAccessExpression { + left = Box::new(Expression::Access(AccessExpression::ArrayRange(ArrayRangeAccess { array: left, left: start.map(Box::new), right: stop.map(Box::new), span: span.clone(), - })); + }))); } AssigneeAccess::Tuple(positive_number, _) => { - left = Box::new(Expression::TupleAccess(TupleAccessExpression { + left = Box::new(Expression::Access(AccessExpression::Tuple(TupleAccess { tuple: left, index: positive_number, span: span.clone(), - })); + }))); } AssigneeAccess::Member(identifier) => { - left = Box::new(Expression::CircuitMemberAccess(CircuitMemberAccessExpression { - circuit: left, + left = Box::new(Expression::Access(AccessExpression::Member(MemberAccess { + inner: left, name: identifier, span: span.clone(), type_: None, - })); + }))); } } } @@ -85,7 +84,7 @@ impl Canonicalizer { Ok(left) } - pub fn compound_operation_converstion(&mut self, operation: &AssignOperation) -> Result { + pub fn compound_operation_conversion(&mut self, operation: &AssignOperation) -> Result { match operation { AssignOperation::Assign => unreachable!(), AssignOperation::Add => Ok(BinaryOperation::Add), @@ -125,11 +124,11 @@ impl Canonicalizer { } } - fn canonicalize_circuit_implied_variable_definition( + fn canonicalize_circuit_variable_initializer( &mut self, - member: &CircuitImpliedVariableDefinition, - ) -> CircuitImpliedVariableDefinition { - CircuitImpliedVariableDefinition { + member: &CircuitVariableInitializer, + ) -> CircuitVariableInitializer { + CircuitVariableInitializer { identifier: member.identifier.clone(), expression: member .expression @@ -156,7 +155,7 @@ impl Canonicalizer { return Expression::Binary(BinaryExpression { left, right, - op: binary.op.clone(), + op: binary.op, span: binary.span.clone(), }); } @@ -184,6 +183,62 @@ impl Canonicalizer { }); } + Expression::Access(access) => { + let access = match access { + AccessExpression::Array(array_access) => { + let array = Box::new(self.canonicalize_expression(&array_access.array)); + let index = Box::new(self.canonicalize_expression(&array_access.index)); + + AccessExpression::Array(ArrayAccess { + array, + index, + span: array_access.span.clone(), + }) + } + AccessExpression::ArrayRange(array_range_access) => { + let array = Box::new(self.canonicalize_expression(&array_range_access.array)); + let left = array_range_access + .left + .as_ref() + .map(|left| Box::new(self.canonicalize_expression(left))); + let right = array_range_access + .right + .as_ref() + .map(|right| Box::new(self.canonicalize_expression(right))); + + AccessExpression::ArrayRange(ArrayRangeAccess { + array, + left, + right, + span: array_range_access.span.clone(), + }) + } + AccessExpression::Member(member_access) => AccessExpression::Member(MemberAccess { + inner: Box::new(self.canonicalize_expression(&member_access.inner)), + name: member_access.name.clone(), + span: member_access.span.clone(), + type_: None, + }), + AccessExpression::Tuple(tuple_access) => { + let tuple = Box::new(self.canonicalize_expression(&tuple_access.tuple)); + + AccessExpression::Tuple(TupleAccess { + tuple, + index: tuple_access.index.clone(), + span: tuple_access.span.clone(), + }) + } + AccessExpression::Static(static_access) => AccessExpression::Static(StaticAccess { + inner: Box::new(self.canonicalize_expression(&static_access.inner)), + name: static_access.name.clone(), + type_: self.canonicalize_self_type(static_access.type_.as_ref()), + span: static_access.span.clone(), + }), + }; + + return Expression::Access(access); + } + Expression::ArrayInline(array_inline) => { let elements = array_inline .elements @@ -214,36 +269,6 @@ impl Canonicalizer { }); } - Expression::ArrayAccess(array_access) => { - let array = Box::new(self.canonicalize_expression(&array_access.array)); - let index = Box::new(self.canonicalize_expression(&array_access.index)); - - return Expression::ArrayAccess(ArrayAccessExpression { - array, - index, - span: array_access.span.clone(), - }); - } - - Expression::ArrayRangeAccess(array_range_access) => { - let array = Box::new(self.canonicalize_expression(&array_range_access.array)); - let left = array_range_access - .left - .as_ref() - .map(|left| Box::new(self.canonicalize_expression(left))); - let right = array_range_access - .right - .as_ref() - .map(|right| Box::new(self.canonicalize_expression(right))); - - return Expression::ArrayRangeAccess(ArrayRangeAccessExpression { - array, - left, - right, - span: array_range_access.span.clone(), - }); - } - Expression::TupleInit(tuple_init) => { let elements = tuple_init .elements @@ -257,20 +282,10 @@ impl Canonicalizer { }); } - Expression::TupleAccess(tuple_access) => { - let tuple = Box::new(self.canonicalize_expression(&tuple_access.tuple)); - - return Expression::TupleAccess(TupleAccessExpression { - tuple, - index: tuple_access.index.clone(), - span: tuple_access.span.clone(), - }); - } - Expression::CircuitInit(circuit_init) => { let mut name = circuit_init.name.clone(); - if name.name.as_ref() == "Self" && self.circuit_name.is_some() { - name = self.circuit_name.as_ref().unwrap().clone(); + if name.name == sym::SelfUpper && self.circuit_name.is_some() { + name = self.circuit_name.clone().unwrap(); } return Expression::CircuitInit(CircuitInitExpression { @@ -278,26 +293,11 @@ impl Canonicalizer { members: circuit_init .members .iter() - .map(|member| self.canonicalize_circuit_implied_variable_definition(member)) + .map(|member| self.canonicalize_circuit_variable_initializer(member)) .collect(), span: circuit_init.span.clone(), }); } - Expression::CircuitMemberAccess(circuit_member_access) => { - return Expression::CircuitMemberAccess(CircuitMemberAccessExpression { - circuit: Box::new(self.canonicalize_expression(&circuit_member_access.circuit)), - name: circuit_member_access.name.clone(), - span: circuit_member_access.span.clone(), - type_: None, - }); - } - Expression::CircuitStaticFunctionAccess(circuit_static_func_access) => { - return Expression::CircuitStaticFunctionAccess(CircuitStaticFunctionAccessExpression { - circuit: Box::new(self.canonicalize_expression(&circuit_static_func_access.circuit)), - name: circuit_static_func_access.name.clone(), - span: circuit_static_func_access.span.clone(), - }); - } Expression::Call(call) => { return Expression::Call(CallExpression { function: Box::new(self.canonicalize_expression(&call.function)), @@ -310,7 +310,7 @@ impl Canonicalizer { }); } Expression::Identifier(identifier) => { - if identifier.name.as_ref() == "Self" && self.circuit_name.is_some() { + if identifier.name == sym::SelfUpper && self.circuit_name.is_some() { return Expression::Identifier(self.circuit_name.as_ref().unwrap().clone()); } } @@ -376,6 +376,7 @@ impl Canonicalizer { Statement::Definition(DefinitionStatement { declaration_type: definition.declaration_type.clone(), variable_names: definition.variable_names.clone(), + parened: definition.parened, type_, value, span: definition.span.clone(), @@ -478,6 +479,13 @@ impl Canonicalizer { fn canonicalize_circuit_member(&mut self, circuit_member: &CircuitMember) -> CircuitMember { match circuit_member { + CircuitMember::CircuitConst(identifier, type_, value) => { + return CircuitMember::CircuitConst( + identifier.clone(), + type_.clone(), + self.canonicalize_expression(value), + ); + } CircuitMember::CircuitVariable(_, _) => {} CircuitMember::CircuitFunction(function) => { let input = function @@ -488,14 +496,16 @@ impl Canonicalizer { let output = self.canonicalize_self_type(function.output.as_ref()); let block = self.canonicalize_block(&function.block); - return CircuitMember::CircuitFunction(Function { + return CircuitMember::CircuitFunction(Box::new(Function { annotations: function.annotations.clone(), identifier: function.identifier.clone(), + const_: function.const_, input, output, block, + core_mapping: function.core_mapping.clone(), span: function.span.clone(), - }); + })); } } @@ -513,35 +523,20 @@ impl ReconstructingReducer for Canonicalizer { } fn reduce_type(&mut self, _type_: &Type, new: Type, span: &Span) -> Result { - match new { - Type::Array(type_, dimensions) => { - if let Some(mut dimensions) = dimensions { - if dimensions.is_zero() { - return Err(AstError::invalid_array_dimension_size(span).into()); - } - - let mut next = Type::Array(type_, Some(ArrayDimensions(vec![dimensions.remove_last().unwrap()]))); - let mut array = next.clone(); - - loop { - if dimensions.is_empty() { - break; - } - - array = Type::Array( - Box::new(next), - Some(ArrayDimensions(vec![dimensions.remove_last().unwrap()])), - ); - next = array.clone(); - } - - Ok(array) - } else { - Ok(Type::Array(type_, None)) - } + match new.clone() { + Type::Array(base, dims) if dims.is_empty() => Ok(Type::Array(base, dims)), + Type::Array(_, dims) if dims.is_zero() => Err(AstError::invalid_array_dimension_size(span).into()), + // Reduce `ArrayDimensions` into nested `Array` types. + Type::Array(base, dims) => { + let mut iter = dims.0.into_iter().rev(); + let ctor = |ty, dim| Type::Array(ty, ArrayDimensions::single(dim)); + let dim = iter.next().unwrap(); + let base = ctor(base, dim); + Ok(iter.fold(base, |ty, dim| ctor(Box::new(ty), dim))) } Type::SelfType if !self.in_circuit => Err(AstError::big_self_outside_of_circuit(span).into()), - _ => Ok(new.clone()), + Type::Tuple(types) if types.len() == 1 => Err(AstError::invalid_tuple_dimension_size(span).into()), + _ => Ok(new), } } @@ -594,6 +589,10 @@ impl ReconstructingReducer for Canonicalizer { ))); } + if elements.is_empty() { + return Err(AstError::invalid_array_dimension_size(span).into()); + } + Ok(Expression::ArrayInline(ArrayInlineExpression { elements, span: span.clone(), @@ -605,46 +604,40 @@ impl ReconstructingReducer for Canonicalizer { array_init: &ArrayInitExpression, element: Expression, ) -> Result { - if array_init.dimensions.is_zero() { - return Err(AstError::invalid_array_dimension_size(&array_init.span).into()); - } - - let element = Box::new(element); - - if array_init.dimensions.0.len() == 1 { - return Ok(ArrayInitExpression { - element, - dimensions: array_init.dimensions.clone(), - span: array_init.span.clone(), - }); - } - - let mut dimensions = array_init.dimensions.clone(); - - let mut next = Expression::ArrayInit(ArrayInitExpression { + let mk_expr = |element, dim| ArrayInitExpression { element, - dimensions: ArrayDimensions(vec![dimensions.remove_last().unwrap()]), + dimensions: ArrayDimensions::single(dim), span: array_init.span.clone(), - }); + }; - let mut outer_element = Box::new(next.clone()); - for (index, dimension) in dimensions.0.iter().rev().enumerate() { - if index == dimensions.0.len() - 1 { - break; + let mut iter = array_init.dimensions.iter().rev().cloned(); + // We know the array has non-zero dimensions. + let init = mk_expr(Box::new(element), iter.next().unwrap()); + Ok(iter.fold(init, |elem, dim| mk_expr(Box::new(Expression::ArrayInit(elem)), dim))) + } + + fn reduce_definition( + &mut self, + definition: &DefinitionStatement, + variable_names: Vec, + type_: Option, + value: Expression, + ) -> Result { + match &type_ { + Some(Type::Tuple(elements)) if elements.len() != 1 => {} + _ if definition.parened => { + return Err(AstError::invalid_parens_around_single_variable(&definition.span).into()); } - - next = Expression::ArrayInit(ArrayInitExpression { - element: outer_element, - dimensions: ArrayDimensions(vec![dimension.clone()]), - span: array_init.span.clone(), - }); - outer_element = Box::new(next.clone()); + _ => {} } - Ok(ArrayInitExpression { - element: outer_element, - dimensions: ArrayDimensions(vec![dimensions.remove_first().unwrap()]), - span: array_init.span.clone(), + Ok(DefinitionStatement { + declaration_type: definition.declaration_type.clone(), + variable_names, + parened: definition.parened, + type_, + value, + span: definition.span.clone(), }) } @@ -662,7 +655,7 @@ impl ReconstructingReducer for Canonicalizer { &assign.span, )?; let right = Box::new(value); - let op = self.compound_operation_converstion(&assign.operation)?; + let op = self.compound_operation_conversion(&assign.operation)?; let new_value = Expression::Binary(BinaryExpression { left, @@ -691,8 +684,9 @@ impl ReconstructingReducer for Canonicalizer { &mut self, function: &Function, identifier: Identifier, - annotations: Vec, + annotations: IndexMap, input: Vec, + const_: bool, output: Option, block: Block, ) -> Result { @@ -705,22 +699,23 @@ impl ReconstructingReducer for Canonicalizer { identifier, annotations, input, + const_, output: new_output, block, + core_mapping: function.core_mapping.clone(), span: function.span.clone(), }) } fn reduce_circuit( &mut self, - circuit: &Circuit, + _circuit: &Circuit, circuit_name: Identifier, members: Vec, ) -> Result { self.circuit_name = Some(circuit_name.clone()); let circ = Circuit { circuit_name, - core_mapping: circuit.core_mapping.clone(), members: members .iter() .map(|member| self.canonicalize_circuit_member(member)) diff --git a/ast-passes/src/canonicalization/mod.rs b/ast-passes/src/canonicalization/mod.rs index 155ccd8043..26f172ff16 100644 --- a/ast-passes/src/canonicalization/mod.rs +++ b/ast-passes/src/canonicalization/mod.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. +// Copyright (C) 2019-2022 Aleo Systems Inc. // This file is part of the Leo library. // The Leo library is free software: you can redistribute it and/or modify @@ -14,5 +14,18 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +//! Implements the AstPass trait for the Canonicalizer +//! which is a ReconstructingReducer trait to canonicalize AST nodes. +//! This allows for easy calling of the Canonicalization pass. + pub mod canonicalizer; pub use canonicalizer::*; + +use leo_ast::{Ast, AstPass, Program, ReconstructingDirector}; +use leo_errors::Result; + +impl AstPass for Canonicalizer { + fn do_pass(self, ast: Program) -> Result { + Ok(Ast::new(ReconstructingDirector::new(self).reduce_program(&ast)?)) + } +} diff --git a/ast-passes/src/lib.rs b/ast-passes/src/lib.rs index b8add261cf..0f9455d9de 100644 --- a/ast-passes/src/lib.rs +++ b/ast-passes/src/lib.rs @@ -19,5 +19,7 @@ pub mod canonicalization; pub use canonicalization::*; -pub mod import_resolution; -pub use import_resolution::*; +// Temporarily disable import resolution +// until we migrate stdlib and then import resolution. +/* pub mod import_resolution; +pub use import_resolution::*; */ diff --git a/ast/Cargo.toml b/ast/Cargo.toml index 368ffc1d51..85f5e3bc6b 100644 --- a/ast/Cargo.toml +++ b/ast/Cargo.toml @@ -21,10 +21,6 @@ rust-version = "1.56" [dependencies] smallvec = { version = "1.8.0", features = ["serde"] } -[dependencies.leo-input] -path = "../input" -version = "1.5.3" - [dependencies.leo-errors] path = "../errors" version = "1.5.3" @@ -37,9 +33,6 @@ version = "1.5.3" version = "1.8.0" features = [ "serde-1" ] -[dependencies.pest] -version = "2.0" - [dependencies.serde] version = "1.0" features = [ "derive", "rc" ] diff --git a/ast/src/chars/char_value.rs b/ast/src/chars/char_value.rs index 06391a50fc..37857a3c5d 100644 --- a/ast/src/chars/char_value.rs +++ b/ast/src/chars/char_value.rs @@ -17,7 +17,6 @@ use leo_span::Span; use serde::{Deserialize, Serialize}; -// use serde::de::{Deserialize as SerDeserialize, Deserializer}; use std::fmt; fn char_to_u32(character: &char, serializer: S) -> Result diff --git a/ast/src/common/array_dimensions.rs b/ast/src/common/array_dimensions.rs index 261b78df3a..4b661f703f 100644 --- a/ast/src/common/array_dimensions.rs +++ b/ast/src/common/array_dimensions.rs @@ -15,7 +15,6 @@ // along with the Leo library. If not, see . use crate::PositiveNumber; -use leo_input::types::ArrayDimensions as InputArrayDimensions; use serde::{ser::SerializeSeq, Deserialize, Serialize, Serializer}; use smallvec::{smallvec, SmallVec}; @@ -114,24 +113,6 @@ impl Serialize for ArrayDimensions { } } -/// Create a new [`ArrayDimensions`] from a [`InputArrayDimensions`] in a Leo program file. -impl<'ast> From> for ArrayDimensions { - fn from(dimensions: InputArrayDimensions<'ast>) -> Self { - match dimensions { - InputArrayDimensions::Single(single) => { - Self(smallvec![Dimension::Number(PositiveNumber::from(single.number))]) - } - InputArrayDimensions::Multiple(multiple) => Self( - multiple - .numbers - .into_iter() - .map(|num| Dimension::Number(PositiveNumber::from(num))) - .collect(), - ), - } - } -} - impl fmt::Display for ArrayDimensions { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match &*self.0 { diff --git a/ast/src/common/identifier.rs b/ast/src/common/identifier.rs index 7273012d44..b2f2ba5c61 100644 --- a/ast/src/common/identifier.rs +++ b/ast/src/common/identifier.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_input::common::Identifier as InputIdentifier; use leo_span::{Span, Symbol}; use crate::Node; @@ -68,15 +67,6 @@ impl Identifier { } } -impl<'ast> From> for Identifier { - fn from(identifier: InputIdentifier<'ast>) -> Self { - Self { - name: Symbol::intern(&identifier.value), - span: Span::from(identifier.span), - } - } -} - impl fmt::Display for Identifier { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.name) diff --git a/ast/src/common/positive_number.rs b/ast/src/common/positive_number.rs index 1ecc719398..a083e45b26 100644 --- a/ast/src/common/positive_number.rs +++ b/ast/src/common/positive_number.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_input::values::PositiveNumber as InputPositiveNumber; - use serde::{Deserialize, Serialize}; use std::fmt; use tendril::StrTendril; @@ -36,15 +34,6 @@ impl PositiveNumber { } } -/// Create a new [`PositiveNumber`] from an [`InputPositiveNumber`] in a Leo input file. -impl<'ast> From> for PositiveNumber { - fn from(array: InputPositiveNumber<'ast>) -> Self { - Self { - value: array.value.into(), - } - } -} - impl fmt::Display for PositiveNumber { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.value) diff --git a/ast/src/groups/group_coordinate.rs b/ast/src/groups/group_coordinate.rs index a19c88c269..8fb39aee29 100644 --- a/ast/src/groups/group_coordinate.rs +++ b/ast/src/groups/group_coordinate.rs @@ -14,10 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_input::values::{ - GroupCoordinate as InputGroupCoordinate, Inferred as InputInferred, NumberValue as InputNumberValue, - SignHigh as InputSignHigh, SignLow as InputSignLow, -}; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -40,17 +36,6 @@ pub enum GroupCoordinate { Inferred, } -impl<'ast> From> for GroupCoordinate { - fn from(coordinate: InputGroupCoordinate<'ast>) -> Self { - match coordinate { - InputGroupCoordinate::Number(number) => GroupCoordinate::from(number), - InputGroupCoordinate::SignHigh(sign_high) => GroupCoordinate::from(sign_high), - InputGroupCoordinate::SignLow(sign_low) => GroupCoordinate::from(sign_low), - InputGroupCoordinate::Inferred(inferred) => GroupCoordinate::from(inferred), - } - } -} - impl fmt::Display for GroupCoordinate { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { @@ -61,30 +46,3 @@ impl fmt::Display for GroupCoordinate { } } } - -impl<'ast> From> for GroupCoordinate { - fn from(number: InputNumberValue<'ast>) -> Self { - let value = number.to_string(); - let span = Span::from(number.span().clone()); - - GroupCoordinate::Number(value.into(), span) - } -} - -impl<'ast> From> for GroupCoordinate { - fn from(_sign: InputSignHigh<'ast>) -> Self { - GroupCoordinate::SignHigh - } -} - -impl<'ast> From> for GroupCoordinate { - fn from(_sign: InputSignLow<'ast>) -> Self { - GroupCoordinate::SignLow - } -} - -impl<'ast> From> for GroupCoordinate { - fn from(_sign: InputInferred<'ast>) -> Self { - GroupCoordinate::Inferred - } -} diff --git a/ast/src/groups/group_value.rs b/ast/src/groups/group_value.rs index 74e9a34779..567527fd90 100644 --- a/ast/src/groups/group_value.rs +++ b/ast/src/groups/group_value.rs @@ -15,9 +15,6 @@ // along with the Leo library. If not, see . use crate::groups::GroupCoordinate; -use leo_input::values::{ - GroupRepresentation as InputGroupRepresentation, GroupTuple as InputGroupTuple, GroupValue as InputGroupValue, -}; use leo_span::Span; use serde::{Deserialize, Serialize}; @@ -52,17 +49,6 @@ impl GroupValue { } } -impl<'ast> From> for GroupValue { - fn from(ast_group: InputGroupValue) -> Self { - let span = Span::from(ast_group.span); - - match ast_group.value { - InputGroupRepresentation::Single(number) => GroupValue::Single(number.to_string().into(), span), - InputGroupRepresentation::Tuple(tuple) => GroupValue::Tuple(GroupTuple::from(tuple)), - } - } -} - impl fmt::Display for GroupValue { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { @@ -83,19 +69,6 @@ pub struct GroupTuple { pub span: Span, } -impl<'ast> From> for GroupTuple { - fn from(ast_group: InputGroupTuple<'ast>) -> Self { - let ast_x = ast_group.x; - let ast_y = ast_group.y; - - Self { - x: GroupCoordinate::from(ast_x), - y: GroupCoordinate::from(ast_y), - span: Span::from(ast_group.span), - } - } -} - impl fmt::Display for GroupTuple { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "({}, {})", self.x, self.y) diff --git a/ast/src/input/program_input/registers.rs b/ast/src/input/definition.rs similarity index 66% rename from ast/src/input/program_input/registers.rs rename to ast/src/input/definition.rs index 7fdd7fc276..b98eab8279 100644 --- a/ast/src/input/program_input/registers.rs +++ b/ast/src/input/definition.rs @@ -14,9 +14,15 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{InputValue, Parameter}; -use leo_input::{definitions::Definition, InputParserError}; +use super::*; +use crate::{Expression, Identifier, Type}; -use indexmap::IndexMap; - -record_input_section!(Registers); +/// A single definition inside a section in a state or an input file. +/// Definitions should be structured as: `: = ;` +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Definition { + pub type_: Type, + pub name: Identifier, + pub value: Expression, + pub span: Span, +} diff --git a/ast/src/input/input.rs b/ast/src/input/input.rs index e4465300a9..f5c6d9658f 100644 --- a/ast/src/input/input.rs +++ b/ast/src/input/input.rs @@ -14,126 +14,26 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ConstantInput, InputValue, MainInput, ProgramInput, ProgramState, Record, Registers, State, StateLeaf}; -use leo_input::{ - files::{File, TableOrSection}, - InputParserError, -}; -use leo_span::Symbol; +use super::*; +use leo_errors::AstError; -#[derive(Clone, PartialEq, Eq)] +/// Input data which includes [`ProgramInput`] and [`ProgramState`]. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct Input { - name: String, - program_input: ProgramInput, - program_state: ProgramState, + pub program_input: ProgramInput, + pub program_state: ProgramState, } -impl Default for Input { - fn default() -> Self { - Self { - name: "default".to_owned(), - program_input: ProgramInput::new(), - program_state: ProgramState::new(), - } - } +/// A raw unprocessed input or state file data. Used for future conversion +/// into [`ProgramInput`] or [`ProgramState`]. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct ParsedInputFile { + pub sections: Vec
, } -#[allow(clippy::len_without_is_empty)] impl Input { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input variables. - pub fn empty(&self) -> Self { - let input = self.program_input.empty(); - let state = self.program_state.empty(); - - Self { - name: self.name.clone(), - program_input: input, - program_state: state, - } - } - - /// Returns the number of input variables to pass into the `main` program function - pub fn len(&self) -> usize { - self.program_input.len() + self.program_state.len() - } - - /// Manually set the input variables to the `main` program function - pub fn set_main_input(&mut self, input: MainInput) { - self.program_input.main = input; - } - - /// Parse all input variables included in a file and store them in `self`. - pub fn parse_input(&mut self, file: File) -> Result<(), InputParserError> { - for entry in file.entries.into_iter() { - match entry { - TableOrSection::Section(section) => { - self.program_input.parse(section)?; - } - TableOrSection::Table(table) => return Err(InputParserError::table(table)), - } - } - - Ok(()) - } - - /// Parse all state variables included in a file and store them in `self`. - pub fn parse_state(&mut self, file: File) -> Result<(), InputParserError> { - for entry in file.entries.into_iter() { - match entry { - TableOrSection::Section(section) => return Err(InputParserError::section(section.header)), - TableOrSection::Table(table) => { - self.program_state.parse(table)?; - } - } - } - - Ok(()) - } - - /// Returns the main function input value with the given `name`. - #[allow(clippy::ptr_arg)] - pub fn get(&self, name: Symbol) -> Option> { - self.program_input.get(name) - } - - /// Returns the constant input value with the given `name`. - #[allow(clippy::ptr_arg)] - pub fn get_constant(&self, name: Symbol) -> Option> { - self.program_input.get_constant(name) - } - - /// Returns the main input values - pub fn get_main_inputs(&self) -> &MainInput { - &self.program_input.main - } - - /// Returns the main input values - pub fn get_constant_inputs(&self) -> &ConstantInput { - &self.program_input.constants - } - - /// Returns the runtime register input values - pub fn get_registers(&self) -> &Registers { - self.program_input.get_registers() - } - - /// Returns the runtime record input values - pub fn get_record(&self) -> &Record { - self.program_state.get_record() - } - - /// Returns the runtime state input values - pub fn get_state(&self) -> &State { - self.program_state.get_state() - } - - /// Returns the runtime state leaf input values - pub fn get_state_leaf(&self) -> &StateLeaf { - self.program_state.get_state_leaf() + /// Serializes the ast into a JSON string. + pub fn to_json_string(&self) -> Result { + Ok(serde_json::to_string_pretty(&self).map_err(|e| AstError::failed_to_convert_ast_to_json_string(&e))?) } } diff --git a/ast/src/input/input_value.rs b/ast/src/input/input_value.rs index 2578931f08..8007a43110 100644 --- a/ast/src/input/input_value.rs +++ b/ast/src/input/input_value.rs @@ -14,22 +14,13 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::{ArrayDimensions, Char, CharValue, GroupValue, IntegerType}; -use leo_input::{ - errors::InputParserError, - expressions::{ArrayInitializerExpression, ArrayInlineExpression, Expression, StringExpression, TupleExpression}, - types::{ArrayType, CharType, DataType, IntegerType as InputIntegerType, TupleType, Type}, - values::{ - Address, AddressValue, BooleanValue, CharValue as InputCharValue, FieldValue, GroupValue as InputGroupValue, - IntegerValue, NumberValue, Value, - }, -}; -use leo_span::Span as AstSpan; -use pest::Span; +use crate::{CharValue, Expression, GroupValue, IntegerType, Node, SpreadOrExpression, Type, ValueExpression}; +use leo_errors::{InputError, LeoError, ParserError, Result}; +use serde::{Deserialize, Serialize}; use std::fmt; -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum InputValue { Address(String), Boolean(bool), @@ -41,350 +32,125 @@ pub enum InputValue { Tuple(Vec), } -impl InputValue { - fn from_address(address: Address) -> Self { - InputValue::Address(address.value) - } - - fn from_address_value(value: AddressValue) -> Self { - match value { - AddressValue::Explicit(address) => Self::from_address(address.address), - AddressValue::Implicit(address) => Self::from_address(address), - } - } - - fn from_boolean(boolean: BooleanValue) -> Result { - let boolean = boolean.value.parse::()?; - Ok(InputValue::Boolean(boolean)) - } - - fn from_char(input_character: InputCharValue) -> Result { - let character = match input_character.value.inner()? { - leo_input::values::Char::Scalar(scalar) => Char::Scalar(scalar), - leo_input::values::Char::NonScalar(non_scalar) => Char::NonScalar(non_scalar), - }; - - let span = AstSpan::from(input_character.span); - Ok(InputValue::Char(CharValue { character, span })) - } - - fn from_number(integer_type: InputIntegerType, number: String) -> Self { - InputValue::Integer(integer_type.into(), number) - } - - fn from_group(group: InputGroupValue) -> Self { - InputValue::Group(GroupValue::from(group)) - } - - fn from_field(field: FieldValue) -> Self { - InputValue::Field(field.number.to_string()) - } - - fn from_implicit(data_type: DataType, implicit: NumberValue) -> Result { - match data_type { - DataType::Address(_) => Err(InputParserError::implicit_type(data_type, implicit)), - DataType::Boolean(_) => Err(InputParserError::implicit_type(data_type, implicit)), - DataType::Char(_) => Err(InputParserError::implicit_type(data_type, implicit)), - DataType::Integer(integer_type) => Ok(InputValue::from_number(integer_type, implicit.to_string())), - DataType::Group(_) => Err(InputParserError::implicit_group(implicit)), - DataType::Field(_) => Ok(InputValue::Field(implicit.to_string())), - } - } - - fn from_value(data_type: DataType, value: Value) -> Result { - match (data_type, value) { - (DataType::Address(_), Value::Address(address)) => Ok(InputValue::from_address_value(address)), - (DataType::Boolean(_), Value::Boolean(boolean)) => InputValue::from_boolean(boolean), - (DataType::Char(_), Value::Char(character)) => InputValue::from_char(character), - (DataType::Integer(integer_type), Value::Integer(integer)) => { - match integer.clone() { - IntegerValue::Signed(signed) => { - if let InputIntegerType::Signed(inner) = integer_type.clone() { - let singed_type = signed.clone().type_; - if std::mem::discriminant(&inner) != std::mem::discriminant(&singed_type) { - return Err(InputParserError::integer_type_mismatch( - integer_type, - InputIntegerType::Signed(singed_type), - integer.span(), - )); - } +impl TryFrom<(Type, Expression)> for InputValue { + type Error = LeoError; + fn try_from(value: (Type, Expression)) -> Result { + Ok(match value { + (type_, Expression::Value(value)) => { + match (type_, value) { + (Type::Address, ValueExpression::Address(value, _)) => Self::Address(value.to_string()), + (Type::Boolean, ValueExpression::Boolean(value, span)) => { + let bool_value = value.parse::().map_err(|_| ParserError::unexpected_eof(&span))?; // TODO: change error + Self::Boolean(bool_value) + } + (Type::Char, ValueExpression::Char(value)) => Self::Char(value), + (Type::Field, ValueExpression::Field(value, _) | ValueExpression::Implicit(value, _)) => { + Self::Field(value.to_string()) + } + (Type::Group, ValueExpression::Group(value)) => Self::Group(*value), + (Type::IntegerType(type_), ValueExpression::Implicit(value, _)) => { + Self::Integer(type_, value.to_string()) + } + (Type::IntegerType(expected), ValueExpression::Integer(actual, value, span)) => { + if expected == actual { + Self::Integer(expected, value.to_string()) + } else { + return Err(InputError::unexpected_type(expected.to_string(), actual, &span).into()); } } - IntegerValue::Unsigned(unsigned) => { - if let InputIntegerType::Unsigned(inner) = integer_type.clone() { - let unsinged_type = unsigned.clone().type_; - if std::mem::discriminant(&inner) != std::mem::discriminant(&unsinged_type) { - return Err(InputParserError::integer_type_mismatch( - integer_type, - InputIntegerType::Unsigned(unsinged_type), - integer.span(), - )); - } + (Type::Array(type_, _), ValueExpression::String(string, span)) => { + if !matches!(*type_, Type::Char) { + return Err(InputError::string_is_array_of_chars(type_, &span).into()); } + + Self::Array( + string + .into_iter() + .map(|c| { + Self::Char(CharValue { + character: c, + span: span.clone(), + }) + }) + .collect(), + ) + } + (x, y) => { + return Err(InputError::unexpected_type(x, &y, y.span()).into()); } } - Ok(InputValue::from_number(integer_type, integer.to_string())) } - (DataType::Group(_), Value::Group(group)) => Ok(InputValue::from_group(group)), - (DataType::Field(_), Value::Field(field)) => Ok(InputValue::from_field(field)), - (data_type, Value::Implicit(implicit)) => InputValue::from_implicit(data_type, implicit), - (data_type, value) => Err(InputParserError::data_type_mismatch(data_type, value)), - } - } + (Type::Array(type_, type_dimensions), Expression::ArrayInit(mut array_init)) => { + let span = array_init.span.clone(); - pub(crate) fn from_expression(type_: Type, expression: Expression) -> Result { - match (type_, expression) { - (Type::Basic(data_type), Expression::Value(value)) => InputValue::from_value(data_type, value), - (Type::Array(array_type), Expression::ArrayInline(inline)) => { - InputValue::from_array_inline(array_type, inline) + if type_dimensions != array_init.dimensions || array_init.dimensions.is_zero() { + return Err(InputError::invalid_array_dimension_size(&span).into()); + } + + if let Some(dimension) = array_init.dimensions.remove_first() { + if let Some(number) = dimension.as_specified() { + let size = number.value.parse::().unwrap(); + let mut values = Vec::with_capacity(size); + + // For when Dimensions are specified in a canonical way: [[u8; 3], 2]; + // Else treat as math notation: [u8; (2, 3)]; + if array_init.dimensions.len() == 0 { + for _ in 0..size { + values.push(InputValue::try_from((*type_.clone(), *array_init.element.clone()))?); + } + // Faking canonical array init is relatively easy: instead of using a straightforward + // recursion, with each iteration we manually modify ArrayInitExpression cutting off + // dimension by dimension. + } else { + for _ in 0..size { + values.push(InputValue::try_from(( + Type::Array(type_.clone(), array_init.dimensions.clone()), + Expression::ArrayInit(array_init.clone()), + ))?); + } + }; + + Self::Array(values) + } else { + unreachable!("dimensions must be specified"); + } + } else { + unreachable!("dimensions are checked for zero"); + } } - (Type::Array(array_type), Expression::ArrayInitializer(initializer)) => { - InputValue::from_array_initializer(array_type, initializer) + (Type::Tuple(types), Expression::TupleInit(tuple_init)) => { + let size = tuple_init.elements.len(); + let mut elements = Vec::with_capacity(size); + + if size != types.len() { + return Err(InputError::tuple_length_mismatch(size, types.len(), tuple_init.span()).into()); + } + + for (i, element) in tuple_init.elements.into_iter().enumerate() { + elements.push(Self::try_from((types[i].clone(), element))?); + } + + Self::Tuple(elements) } - (Type::Array(array_type), Expression::StringExpression(string)) => { - InputValue::from_string(array_type, string) + (Type::Array(element_type, dimensions), Expression::ArrayInline(array_inline)) => { + let mut elements = Vec::with_capacity(array_inline.elements.len()); + let span = array_inline.span().clone(); + + if !dimensions.is_specified() { + return Err(InputError::array_dimensions_must_be_specified(&span).into()); + } + + for element in array_inline.elements.into_iter() { + if let SpreadOrExpression::Expression(value_expression) = element { + elements.push(Self::try_from((*element_type.clone(), value_expression))?); + } else { + return Err(InputError::array_spread_is_not_allowed(&span).into()); + } + } + Self::Array(elements) } - (Type::Tuple(tuple_type), Expression::Tuple(tuple)) => InputValue::from_tuple(tuple_type, tuple), - (type_, expression) => Err(InputParserError::expression_type_mismatch(type_, expression)), - } - } - - /// - /// Returns a new `InputValue` from the given `ArrayType` and `StringExpression`. - /// - pub(crate) fn from_string(mut array_type: ArrayType, string: StringExpression) -> Result { - // Create a new `ArrayDimensions` type from the input array_type dimensions. - let array_dimensions_type = ArrayDimensions::from(array_type.dimensions.clone()); - assert!(matches!(*array_type.type_, Type::Basic(DataType::Char(CharType {})))); - - // Convert the array dimensions to usize. - let array_dimensions = parse_array_dimensions(array_dimensions_type, &array_type.span)?; - - // Return an error if the outer array dimension does not equal the number of array elements. - if array_dimensions[0] != string.chars.len() { - return Err(InputParserError::invalid_string_length( - array_dimensions[0], - string.chars.len(), - &string.span, - )); - } - - array_type.dimensions = array_type.dimensions.next_dimension(); - - let inner_array_type = if array_dimensions.len() == 1 { - // This is a single array - *array_type.type_ - } else { - // This is a multi-dimensional array - return Err(InputParserError::invalid_string_dimensions(&array_type.span)); - }; - - let mut elements = Vec::with_capacity(string.chars.len()); - for character in string.chars.into_iter() { - let element = InputValue::from_expression( - inner_array_type.clone(), - Expression::Value(Value::Char(InputCharValue { - value: character.clone(), - span: character.span().clone(), - })), - )?; - - elements.push(element) - } - - Ok(InputValue::Array(elements)) - } - - /// - /// Returns a new `InputValue` from the given `ArrayType` and `ArrayInlineExpression`. - /// - pub(crate) fn from_array_inline( - mut array_type: ArrayType, - inline: ArrayInlineExpression, - ) -> Result { - // Create a new `ArrayDimensions` type from the input array_type dimensions. - let array_dimensions_type = ArrayDimensions::from(array_type.dimensions.clone()); - - // Convert the array dimensions to usize. - let array_dimensions = parse_array_dimensions(array_dimensions_type, &array_type.span)?; - - // Return an error if the outer array dimension does not equal the number of array elements. - if array_dimensions[0] != inline.expressions.len() { - return Err(InputParserError::array_inline_length(array_dimensions[0], inline)); - } - - array_type.dimensions = array_type.dimensions.next_dimension(); - - let inner_array_type = if array_dimensions.len() == 1 { - // This is a single array - *array_type.type_ - } else { - // This is a multi-dimensional array - Type::Array(array_type) - }; - - let mut elements = Vec::with_capacity(inline.expressions.len()); - for expression in inline.expressions.into_iter() { - let element = InputValue::from_expression(inner_array_type.clone(), expression)?; - - elements.push(element) - } - - Ok(InputValue::Array(elements)) - } - - pub(crate) fn from_array_initializer( - array_type: ArrayType, - initializer: ArrayInitializerExpression, - ) -> Result { - let array_dimensions_type = ArrayDimensions::from(initializer.dimensions.clone()); - let array_dimensions = parse_array_dimensions(array_dimensions_type, &array_type.span)?; - - if array_dimensions.len() > 1 { - // The expression is an array initializer with tuple syntax - Self::from_array_initializer_tuple(array_type, initializer, array_dimensions) - } else { - // The expression is an array initializer with nested syntax - Self::from_array_initializer_nested(array_type, initializer, array_dimensions) - } - } - - pub(crate) fn from_array_initializer_tuple( - array_type: ArrayType, - initializer: ArrayInitializerExpression, - initializer_dimensions: Vec, - ) -> Result { - let (array_dimensions, array_element_type) = fetch_nested_array_type_dimensions(array_type.clone(), vec![])?; - - // Return an error if the dimensions of the array are incorrect. - if array_dimensions.ne(&initializer_dimensions) { - return Err(InputParserError::array_init_length( - array_dimensions, - initializer_dimensions, - &initializer.span, - )); - } - - let value = InputValue::from_expression(array_element_type, *initializer.expression.clone())?; - let mut elements = vec![]; - - // Build the elements of the array using the `vec!` macro - for (i, dimension) in initializer_dimensions.into_iter().rev().enumerate() { - if i == 0 { - elements = vec![value.clone(); dimension]; - } else { - let element = InputValue::Array(elements.clone()); - - elements = vec![element; dimension]; - } - } - - Ok(InputValue::Array(elements)) - } - - pub(crate) fn from_array_initializer_nested( - mut array_type: ArrayType, - initializer: ArrayInitializerExpression, - initializer_dimensions: Vec, - ) -> Result { - // Create a new `ArrayDimensions` type from the input array_type dimensions. - let array_dimensions_type = ArrayDimensions::from(array_type.dimensions.clone()); - - // Convert the array dimensions to usize. - let array_dimensions = parse_array_dimensions(array_dimensions_type, &array_type.span)?; - - let current_array_dimension = array_dimensions[0]; - let current_initializer_dimension = initializer_dimensions[0]; - - // Return an error if the outer array dimension does not equal the number of array elements. - if current_array_dimension.ne(¤t_initializer_dimension) { - return Err(InputParserError::array_init_length( - array_dimensions, - initializer_dimensions, - &initializer.span, - )); - } - - array_type.dimensions = array_type.dimensions.next_dimension(); - - let inner_array_type = if array_dimensions.len() == 1 { - // This is the innermost dimension - *array_type.type_ - } else { - // This is an outer dimension of a multi-dimensional array - Type::Array(array_type) - }; - - // Evaluate the array initializer - let element = InputValue::from_expression(inner_array_type.clone(), *initializer.expression)?; - let elements = vec![element; current_initializer_dimension]; - - Ok(InputValue::Array(elements)) - } - - pub(crate) fn from_tuple(tuple_type: TupleType, tuple: TupleExpression) -> Result { - let num_types = tuple_type.types_.len(); - let num_values = tuple.expressions.len(); - - if num_types != num_values { - return Err(InputParserError::tuple_length(num_types, num_values, &tuple_type.span)); - } - - let mut values = Vec::with_capacity(tuple_type.types_.len()); - for (type_, value) in tuple_type.types_.into_iter().zip(tuple.expressions.into_iter()) { - let value = InputValue::from_expression(type_, value)?; - - values.push(value) - } - - Ok(InputValue::Tuple(values)) - } -} - -/// Returns a new vector of usize values from an [`ArrayDimensions`] type. -/// -/// Attempts to parse each dimension in the array from a `String` to a `usize` value. If parsing -/// is successful, the `usize` value is appended to the return vector. If parsing fails, an error -/// is returned. -fn parse_array_dimensions(dimensions: ArrayDimensions, span: &Span) -> Result, InputParserError> { - // Convert the array dimensions to usize. - let mut result_array_dimensions = Vec::with_capacity(dimensions.len()); - - for dimension in dimensions.iter() { - // Convert the dimension to a string. - let dimension_string = dimension.to_string(); - - // Convert the string to usize. - let dimension_usize = match dimension_string.parse::() { - Ok(dimension_usize) => dimension_usize, - Err(_) => return Err(InputParserError::array_index(dimension_string, span)), - }; - - // Collect dimension usize values. - result_array_dimensions.push(dimension_usize); - } - - Ok(result_array_dimensions) -} - -/// -/// Recursively fetch all dimensions from the array type. -/// -fn fetch_nested_array_type_dimensions( - array_type: ArrayType, - mut array_dimensions: Vec, -) -> Result<(Vec, Type), InputParserError> { - // Create a new `ArrayDimensions` type from the input array_type dimensions. - let array_dimensions_type = ArrayDimensions::from(array_type.dimensions.clone()); - - // Convert the array dimensions to usize. - let mut current_dimension = parse_array_dimensions(array_dimensions_type, &array_type.span)?; - - array_dimensions.append(&mut current_dimension); - - match *array_type.type_ { - Type::Array(next_array_type) => fetch_nested_array_type_dimensions(next_array_type, array_dimensions), - type_ => Ok((array_dimensions, type_)), + (_type_, expr) => return Err(InputError::illegal_expression(&expr, expr.span()).into()), + }) } } @@ -399,12 +165,10 @@ impl fmt::Display for InputValue { InputValue::Integer(ref type_, ref number) => write!(f, "{}{:?}", number, type_), InputValue::Array(ref array) => { let values = array.iter().map(|x| x.to_string()).collect::>().join(", "); - write!(f, "array [{}]", values) } InputValue::Tuple(ref tuple) => { let values = tuple.iter().map(|x| x.to_string()).collect::>().join(", "); - write!(f, "({})", values) } } diff --git a/ast/src/input/macros.rs b/ast/src/input/macros.rs deleted file mode 100644 index 94d5b7454e..0000000000 --- a/ast/src/input/macros.rs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -/// Constructs an input section to store data parsed from a Leo input file. -/// Constructs sections that pass variables to the main function through the input keyword. -#[macro_export] -macro_rules! record_input_section { - ($($name: ident), *) => ($( - - /// An input section declared in an input file with `[$name]`. - #[derive(Clone, PartialEq, Eq, Default)] - pub struct $name { - is_present: bool, - values: IndexMap>, - } - - impl $name { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input variables. - pub fn empty(&self) -> Self { - let is_present = self.is_present; - let mut values = self.values.clone(); - - values.iter_mut().for_each(|(_parameter, value)| { - *value = None; - }); - - Self { is_present, values } - } - - /// Returns `true` if the main function contains the `$name` variable. - pub fn is_present(&self) -> bool { - self.is_present - } - - /// Parses register input definitions and stores them in `self`. - /// This function is called if the main function input contains the `$name` variable. - pub fn parse(&mut self, definitions: Vec) -> Result<(), InputParserError> { - self.is_present = true; - - for definition in definitions { - let value = InputValue::from_expression(definition.parameter.type_.clone(), definition.expression)?; - let parameter = Parameter::from(definition.parameter); - - self.values.insert(parameter, Some(value)); - } - - Ok(()) - } - - /// Returns this section's [IndexMap] of values. - pub fn values(&self) -> IndexMap> { - self.values.clone() - } - - /// a list of all defined name -> type pairs - pub fn types(&self) -> Vec<(String, crate::Type)> { - self.values.iter() - .map(|(parameter, _)| (parameter.variable.name.to_string(), parameter.type_.clone())) - .collect() - } - - /// a map of all defined name -> value pairs, if present - pub fn raw_values(&self) -> IndexMap { - self.values.iter() - .filter(|(_, value)| value.is_some()) - .map(|(parameter, value)| (parameter.variable.name.to_string(), value.as_ref().unwrap().clone())) - .collect() - } - } - )*) -} - -/// Constructs an input section to store data parsed from a Leo input file. -/// Constructs sections that pass variables directly to the main function. -#[macro_export] -macro_rules! main_input_section { - ($($name: ident), *) => ($( - - /// `[$name]` program input section. - #[derive(Clone, PartialEq, Eq, Default)] - pub struct $name { - input: IndexMap>, - } - - #[allow(clippy::len_without_is_empty)] - impl $name { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input variables. - pub fn empty(&self) -> Self { - let mut input = self.input.clone(); - - input.iter_mut().for_each(|(_name, value)| { - *value = None; - }); - - Self { input } - } - - pub fn len(&self) -> usize { - self.input.len() - } - - pub fn insert(&mut self, key: leo_span::Symbol, value: Option) { - self.input.insert(key, value); - } - - /// Parses main input definitions and stores them in `self`. - pub fn parse(&mut self, definitions: Vec) -> Result<(), InputParserError> { - for definition in definitions { - let name = leo_span::Symbol::intern(&definition.parameter.variable.value); - let value = InputValue::from_expression(definition.parameter.type_, definition.expression)?; - - self.insert(name, Some(value)); - } - - Ok(()) - } - - /// Returns an `Option` of the main function input at `name`. - pub fn get(&self, name: leo_span::Symbol) -> Option> { - self.input.get(&name).cloned() - } - - pub fn iter(&self) -> impl Iterator)> { - self.input.iter() - } - } - )*) -} diff --git a/ast/src/input/mod.rs b/ast/src/input/mod.rs index e27b113efb..dbfe148acb 100644 --- a/ast/src/input/mod.rs +++ b/ast/src/input/mod.rs @@ -14,11 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -#![allow(clippy::module_inception)] - -#[macro_use] -pub mod macros; -pub use macros::*; +pub mod definition; +pub use definition::*; pub mod input; pub use input::*; @@ -26,11 +23,18 @@ pub use input::*; pub mod input_value; pub use input_value::*; -pub mod parameters; -pub use parameters::*; - pub mod program_input; pub use program_input::*; pub mod program_state; pub use program_state::*; + +pub mod section; +pub use section::*; + +use indexmap::IndexMap; +use leo_errors::{InputError, LeoError, Result}; +use leo_span::{sym, Span, Symbol}; +use serde::{Deserialize, Serialize}; + +type Definitions = IndexMap; diff --git a/ast/src/input/parameters/parameter.rs b/ast/src/input/parameters/parameter.rs deleted file mode 100644 index 321eaa6946..0000000000 --- a/ast/src/input/parameters/parameter.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{Identifier, Type}; -use leo_input::parameters::Parameter as GrammarParameter; -use leo_span::Span; - -#[derive(Clone, PartialEq, Eq, Hash)] -pub struct Parameter { - pub variable: Identifier, - pub type_: Type, - pub span: Span, -} - -impl<'ast> From> for Parameter { - fn from(parameter: GrammarParameter<'ast>) -> Self { - Self { - variable: Identifier::from(parameter.variable), - type_: Type::from(parameter.type_), - span: Span::from(parameter.span), - } - } -} diff --git a/ast/src/input/program_input.rs b/ast/src/input/program_input.rs new file mode 100644 index 0000000000..96ff686758 --- /dev/null +++ b/ast/src/input/program_input.rs @@ -0,0 +1,63 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use super::*; + +/// Processed Program input. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +pub struct ProgramInput { + pub main: Definitions, + pub registers: Definitions, + pub constants: Definitions, +} + +impl TryFrom for ProgramInput { + type Error = LeoError; + fn try_from(input: ParsedInputFile) -> Result { + let mut main = IndexMap::new(); + let mut registers = IndexMap::new(); + let mut constants = IndexMap::new(); + + for section in input.sections { + let target = match section.name { + sym::main => &mut main, + sym::registers => &mut registers, + sym::constants => &mut constants, + _ => { + return Err(InputError::unexpected_section( + &["main", "registers", "constants"], + section.name, + §ion.span, + ) + .into()) + } + }; + + for definition in section.definitions { + target.insert( + definition.name.name, + InputValue::try_from((definition.type_, definition.value))?, + ); + } + } + + Ok(ProgramInput { + main, + registers, + constants, + }) + } +} diff --git a/ast/src/input/program_input/constant_input.rs b/ast/src/input/program_input/constant_input.rs deleted file mode 100644 index 728feffd7e..0000000000 --- a/ast/src/input/program_input/constant_input.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::InputValue; -use leo_input::{definitions::Definition, InputParserError}; - -use indexmap::IndexMap; - -main_input_section!(ConstantInput); diff --git a/ast/src/input/program_input/mod.rs b/ast/src/input/program_input/mod.rs deleted file mode 100644 index c672586aa3..0000000000 --- a/ast/src/input/program_input/mod.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -#![allow(clippy::module_inception)] - -pub mod constant_input; -pub use constant_input::*; - -pub mod main_input; -pub use main_input::*; - -pub mod program_input; -pub use program_input::*; - -pub mod registers; -pub use registers::*; diff --git a/ast/src/input/program_input/program_input.rs b/ast/src/input/program_input/program_input.rs deleted file mode 100644 index 99996278ce..0000000000 --- a/ast/src/input/program_input/program_input.rs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ConstantInput, InputValue, MainInput, Registers}; -use leo_input::{ - sections::{Header, Section}, - InputParserError, -}; -use leo_span::Symbol; - -#[derive(Clone, PartialEq, Eq, Default)] -pub struct ProgramInput { - pub main: MainInput, - pub constants: ConstantInput, - registers: Registers, -} - -#[allow(clippy::len_without_is_empty)] -impl ProgramInput { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input values. - pub fn empty(&self) -> Self { - let main = self.main.empty(); - let constants = self.constants.empty(); - let registers = self.registers.empty(); - - Self { - main, - constants, - registers, - } - } - - pub fn len(&self) -> usize { - let mut len = 0; - - // Add main input variables and constants. - len += self.main.len(); - len += self.constants.len(); - - // Add registers. - if self.registers.is_present() { - len += 1; - } - - len - } - - /// Parse each input included in a file and store them in `self`. - pub fn parse(&mut self, section: Section) -> Result<(), InputParserError> { - match section.header { - Header::Constants(_constants) => self.constants.parse(section.definitions), - Header::Main(_main) => self.main.parse(section.definitions), - Header::Registers(_registers) => self.registers.parse(section.definitions), - header => Err(InputParserError::input_section_header(header)), - } - } - - /// Returns the main function input value with the given `name` - #[allow(clippy::ptr_arg)] - pub fn get(&self, name: Symbol) -> Option> { - self.main.get(name) - } - - #[allow(clippy::ptr_arg)] - pub fn get_constant(&self, name: Symbol) -> Option> { - self.constants.get(name) - } - - /// Returns the runtime register input values - pub fn get_registers(&self) -> &Registers { - &self.registers - } -} diff --git a/ast/src/input/program_state.rs b/ast/src/input/program_state.rs new file mode 100644 index 0000000000..7dbfc5caf8 --- /dev/null +++ b/ast/src/input/program_state.rs @@ -0,0 +1,50 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use super::*; + +/// Processed Program state. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +pub struct ProgramState { + pub state: Definitions, +} + +impl TryFrom for ProgramState { + type Error = LeoError; + fn try_from(input: ParsedInputFile) -> Result { + let mut state = IndexMap::new(); + + for section in input.sections { + if matches!(section.name, sym::state | sym::record | sym::state_leaf) { + for definition in section.definitions { + state.insert( + definition.name.name, + InputValue::try_from((definition.type_, definition.value))?, + ); + } + } else { + return Err(InputError::unexpected_section( + &["state", "record", "state_leaf"], + section.name, + §ion.span, + ) + .into()); + } + } + + Ok(ProgramState { state }) + } +} diff --git a/ast/src/input/program_state/mod.rs b/ast/src/input/program_state/mod.rs deleted file mode 100644 index 15b01e33ea..0000000000 --- a/ast/src/input/program_state/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -#![allow(clippy::module_inception)] - -pub mod private_state; -pub use private_state::*; - -pub mod program_state; -pub use program_state::*; - -pub mod public_state; -pub use public_state::*; diff --git a/ast/src/input/program_state/private_state/mod.rs b/ast/src/input/program_state/private_state/mod.rs deleted file mode 100644 index f2ae76c725..0000000000 --- a/ast/src/input/program_state/private_state/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -#![allow(clippy::module_inception)] - -pub mod private_state; -pub use private_state::*; - -pub mod record; -pub use record::*; - -pub mod state_leaf; -pub use state_leaf::*; diff --git a/ast/src/input/program_state/private_state/private_state.rs b/ast/src/input/program_state/private_state/private_state.rs deleted file mode 100644 index a31f97ea65..0000000000 --- a/ast/src/input/program_state/private_state/private_state.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{Record, StateLeaf}; -use leo_input::{ - sections::{Header, Section}, - InputParserError, -}; - -#[derive(Clone, PartialEq, Eq, Default)] -pub struct PrivateState { - record: Record, - state_leaf: StateLeaf, -} - -#[allow(clippy::len_without_is_empty)] -impl PrivateState { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input variables. - pub fn empty(&self) -> Self { - let record = self.record.empty(); - let state_leaf = self.state_leaf.empty(); - - Self { record, state_leaf } - } - - pub fn len(&self) -> usize { - let mut len = 0; - - // add record variable - if self.record.is_present() { - len += 1; - } - - // add state_leaf variable - if self.state_leaf.is_present() { - len += 1; - } - - len - } - - /// Parse all input variables included in a file and store them in `self`. - pub fn parse(&mut self, sections: Vec
) -> Result<(), InputParserError> { - for section in sections { - match section.header { - Header::Record(_state) => self.record.parse(section.definitions)?, - Header::StateLeaf(_state_leaf) => self.state_leaf.parse(section.definitions)?, - header => return Err(InputParserError::private_section(header)), - } - } - - Ok(()) - } - - /// Returns the runtime record input values - pub fn get_record(&self) -> &Record { - &self.record - } - - /// Returns the runtime state leaf input values - pub fn get_state_leaf(&self) -> &StateLeaf { - &self.state_leaf - } -} diff --git a/ast/src/input/program_state/private_state/record.rs b/ast/src/input/program_state/private_state/record.rs deleted file mode 100644 index 1f903d0af6..0000000000 --- a/ast/src/input/program_state/private_state/record.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{InputValue, Parameter}; -use leo_input::{definitions::Definition, InputParserError}; - -use indexmap::IndexMap; - -record_input_section!(Record); diff --git a/ast/src/input/program_state/private_state/state_leaf.rs b/ast/src/input/program_state/private_state/state_leaf.rs deleted file mode 100644 index d545d79b1c..0000000000 --- a/ast/src/input/program_state/private_state/state_leaf.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{InputValue, Parameter}; -use leo_input::{definitions::Definition, InputParserError}; - -use indexmap::IndexMap; - -record_input_section!(StateLeaf); diff --git a/ast/src/input/program_state/program_state.rs b/ast/src/input/program_state/program_state.rs deleted file mode 100644 index bce55706a2..0000000000 --- a/ast/src/input/program_state/program_state.rs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{PrivateState, PublicState, Record, State, StateLeaf}; -use leo_input::{ - tables::{Table, Visibility}, - InputParserError, -}; - -#[derive(Clone, PartialEq, Eq, Default)] -pub struct ProgramState { - public: PublicState, - private: PrivateState, -} - -#[allow(clippy::len_without_is_empty)] -impl ProgramState { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input variables. - pub fn empty(&self) -> Self { - let public = self.public.empty(); - let private = self.private.empty(); - - Self { public, private } - } - - pub fn len(&self) -> usize { - self.public.len() + self.private.len() - } - - /// Parse all input variables included in a file and store them in `self`. - pub fn parse(&mut self, table: Table) -> Result<(), InputParserError> { - match table.visibility { - Visibility::Private(_private) => self.private.parse(table.sections), - Visibility::Public(_public) => self.public.parse(table.sections), - } - } - - /// Returns the runtime record input values - pub fn get_record(&self) -> &Record { - self.private.get_record() - } - - /// Returns the runtime state input values - pub fn get_state(&self) -> &State { - self.public.get_state() - } - - /// Returns the runtime state leaf input values - pub fn get_state_leaf(&self) -> &StateLeaf { - self.private.get_state_leaf() - } -} diff --git a/ast/src/input/program_state/public_state/mod.rs b/ast/src/input/program_state/public_state/mod.rs deleted file mode 100644 index f12d7d2e2e..0000000000 --- a/ast/src/input/program_state/public_state/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -#![allow(clippy::module_inception)] - -pub mod public_state; -pub use public_state::*; - -pub mod state; -pub use state::*; diff --git a/ast/src/input/program_state/public_state/public_state.rs b/ast/src/input/program_state/public_state/public_state.rs deleted file mode 100644 index e4ede088b5..0000000000 --- a/ast/src/input/program_state/public_state/public_state.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::State; -use leo_input::{ - sections::{Header, Section}, - InputParserError, -}; - -#[derive(Clone, PartialEq, Eq, Default)] -pub struct PublicState { - state: State, -} - -#[allow(clippy::len_without_is_empty)] -impl PublicState { - pub fn new() -> Self { - Self::default() - } - - /// Returns an empty version of this struct with `None` values. - /// Called during constraint synthesis to provide private input variables. - pub fn empty(&self) -> Self { - let state = self.state.empty(); - - Self { state } - } - - pub fn len(&self) -> usize { - if self.state.is_present() { - 1usize - } else { - 0usize - } - } - - /// Parse all input variables included in a file and store them in `self`. - pub fn parse(&mut self, sections: Vec
) -> Result<(), InputParserError> { - for section in sections { - match section.header { - Header::State(_state) => self.state.parse(section.definitions)?, - header => return Err(InputParserError::public_section(header)), - } - } - - Ok(()) - } - - /// Returns the runtime state input values - pub fn get_state(&self) -> &State { - &self.state - } -} diff --git a/ast/src/input/program_state/public_state/state.rs b/ast/src/input/program_state/public_state/state.rs deleted file mode 100644 index aed560a535..0000000000 --- a/ast/src/input/program_state/public_state/state.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{InputValue, Parameter}; -use leo_input::{definitions::Definition, InputParserError}; - -use indexmap::IndexMap; - -record_input_section!(State); diff --git a/ast/src/input/program_input/main_input.rs b/ast/src/input/section.rs similarity index 73% rename from ast/src/input/program_input/main_input.rs rename to ast/src/input/section.rs index f84233bbf9..217d8e7be1 100644 --- a/ast/src/input/program_input/main_input.rs +++ b/ast/src/input/section.rs @@ -14,9 +14,13 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use crate::InputValue; -use leo_input::{definitions::Definition, InputParserError}; +use super::*; -use indexmap::IndexMap; - -main_input_section!(MainInput); +/// A single section in an input or a state file. +/// An example of a section would be: `[main]`. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Section { + pub name: Symbol, + pub definitions: Vec, + pub span: Span, +} diff --git a/ast/src/lib.rs b/ast/src/lib.rs index 409e4e927a..52e817c2ff 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -79,8 +79,6 @@ use leo_errors::{AstError, Result}; /// /// The [`Ast`] type represents a Leo program as a series of recursive data types. /// These data types form a tree that begins from a [`Program`] type root. -/// -/// A new [`Ast`] can be created from a [`Grammar`] generated by the pest parser in the `grammar` module. #[derive(Clone, Debug, Eq, PartialEq)] pub struct Ast { ast: Program, diff --git a/ast/src/reducer/mod.rs b/ast/src/reducer/mod.rs index 1d37a7eb23..87d296ee02 100644 --- a/ast/src/reducer/mod.rs +++ b/ast/src/reducer/mod.rs @@ -14,6 +14,11 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +//! This module contains both a Director to reconstruct the AST +//! which maps over every node of the AST and calls a reducer. +//! The Trait for a reducer are methods that can be overridden +//! to make changes to how AST nodes are rebuilt. + pub mod reconstructing_reducer; pub use reconstructing_reducer::*; diff --git a/ast/src/reducer/reconstructing_director.rs b/ast/src/reducer/reconstructing_director.rs index ba70f7d729..e40dc08cad 100644 --- a/ast/src/reducer/reconstructing_director.rs +++ b/ast/src/reducer/reconstructing_director.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -//! This module contains the reducer which iterates through ast nodes - converting them into -//! asg nodes and saving relevant information. +//! This module contains a Director for how to map over the AST +//! and applies a reducer call to each node. use crate::*; diff --git a/ast/src/reducer/reconstructing_reducer.rs b/ast/src/reducer/reconstructing_reducer.rs index 808f4ecd35..939180a96a 100644 --- a/ast/src/reducer/reconstructing_reducer.rs +++ b/ast/src/reducer/reconstructing_reducer.rs @@ -14,6 +14,10 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . +//! This module contains a Reducer Trait for the AST. +//! It implements default methods for each node to be made +//! given the information of the old node. + use crate::*; use leo_errors::Result; @@ -282,6 +286,7 @@ pub trait ReconstructingReducer { Ok(DefinitionStatement { declaration_type: definition.declaration_type.clone(), variable_names, + parened: definition.parened, type_, value, span: definition.span.clone(), diff --git a/ast/src/statements/definition/mod.rs b/ast/src/statements/definition/mod.rs index b73ae7b28b..fe4ccba13d 100644 --- a/ast/src/statements/definition/mod.rs +++ b/ast/src/statements/definition/mod.rs @@ -33,6 +33,8 @@ pub struct DefinitionStatement { pub declaration_type: Declare, /// The bindings / variable names to declare. pub variable_names: Vec, + /// Tracks whether the variable(s) are in parens. + pub parened: bool, /// The types of the bindings, if specified, or inferred otherwise. pub type_: Option, /// An initializer value for the bindings. diff --git a/ast/src/types/integer_type.rs b/ast/src/types/integer_type.rs index 078d866305..f3dea925cc 100644 --- a/ast/src/types/integer_type.rs +++ b/ast/src/types/integer_type.rs @@ -14,10 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -use leo_input::types::{ - IntegerType as InputIntegerType, SignedIntegerType as InputSignedIntegerType, - UnsignedIntegerType as InputUnsignedIntegerType, -}; use leo_span::{sym, Symbol}; use serde::{Deserialize, Serialize}; @@ -63,39 +59,6 @@ impl IntegerType { } } -impl From for IntegerType { - fn from(integer_type: InputIntegerType) -> Self { - match integer_type { - InputIntegerType::Signed(signed) => Self::from(signed), - InputIntegerType::Unsigned(unsigned) => Self::from(unsigned), - } - } -} - -impl From for IntegerType { - fn from(integer_type: InputUnsignedIntegerType) -> Self { - match integer_type { - InputUnsignedIntegerType::U8Type(_type) => IntegerType::U8, - InputUnsignedIntegerType::U16Type(_type) => IntegerType::U16, - InputUnsignedIntegerType::U32Type(_type) => IntegerType::U32, - InputUnsignedIntegerType::U64Type(_type) => IntegerType::U64, - InputUnsignedIntegerType::U128Type(_type) => IntegerType::U128, - } - } -} - -impl From for IntegerType { - fn from(integer_type: InputSignedIntegerType) -> Self { - match integer_type { - InputSignedIntegerType::I8Type(_type) => IntegerType::I8, - InputSignedIntegerType::I16Type(_type) => IntegerType::I16, - InputSignedIntegerType::I32Type(_type) => IntegerType::I32, - InputSignedIntegerType::I64Type(_type) => IntegerType::I64, - InputSignedIntegerType::I128Type(_type) => IntegerType::I128, - } - } -} - impl fmt::Display for IntegerType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { diff --git a/ast/src/types/type_.rs b/ast/src/types/type_.rs index b1fcf01ba2..bb5c573984 100644 --- a/ast/src/types/type_.rs +++ b/ast/src/types/type_.rs @@ -15,9 +15,6 @@ // along with the Leo library. If not, see . use crate::{ArrayDimensions, Identifier, IntegerType}; -use leo_input::types::{ - ArrayType as InputArrayType, DataType as InputDataType, TupleType as InputTupleType, Type as InputType, -}; use serde::{Deserialize, Serialize}; use std::fmt; @@ -122,48 +119,6 @@ impl Type { } } -/// input pest ast -> Explicit Type - -impl From for Type { - fn from(data_type: InputDataType) -> Self { - match data_type { - InputDataType::Address(_type) => Type::Address, - InputDataType::Boolean(_type) => Type::Boolean, - InputDataType::Char(_type) => Type::Char, - InputDataType::Field(_type) => Type::Field, - InputDataType::Group(_type) => Type::Group, - InputDataType::Integer(type_) => Type::IntegerType(IntegerType::from(type_)), - } - } -} - -impl<'ast> From> for Type { - fn from(array_type: InputArrayType<'ast>) -> Self { - let element_type = Box::new(Type::from(*array_type.type_)); - let dimensions = ArrayDimensions::from(array_type.dimensions); - - Type::Array(element_type, dimensions) - } -} - -impl<'ast> From> for Type { - fn from(tuple_type: InputTupleType<'ast>) -> Self { - let types = tuple_type.types_.into_iter().map(Type::from).collect(); - - Type::Tuple(types) - } -} - -impl<'ast> From> for Type { - fn from(type_: InputType<'ast>) -> Self { - match type_ { - InputType::Basic(type_) => Type::from(type_), - InputType::Array(type_) => Type::from(type_), - InputType::Tuple(type_) => Type::from(type_), - } - } -} - impl fmt::Display for Type { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 4fc58e75fd..8047dfe638 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -22,6 +22,10 @@ rust-version = "1.56.1" path = "../ast" version = "1.5.3" +[dependencies.leo-ast-passes] +path = "../ast-passes" +version = "1.5.3" + [dependencies.leo-errors] path = "../errors" version = "1.5.3" @@ -30,6 +34,10 @@ version = "1.5.3" path = "../parser" version = "1.5.3" +[dependencies.leo-span] +path = "../span" +version = "1.5.3" + [dependencies.sha2] version = "0.10" diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 176aaea6dd..d5679ad9b9 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -22,8 +22,10 @@ #![allow(clippy::upper_case_acronyms)] #![doc = include_str!("../README.md")] +use leo_ast::AstPass; use leo_errors::emitter::Handler; use leo_errors::{CompilerError, Result}; +use leo_span::symbol::create_session_if_not_set_then; use sha2::{Digest, Sha256}; use std::fs; @@ -33,16 +35,18 @@ use std::path::PathBuf; pub struct Compiler<'a> { handler: &'a Handler, main_file_path: PathBuf, + output_directory: PathBuf, } impl<'a> Compiler<'a> { /// /// Returns a new Leo compiler. /// - pub fn new(handler: &'a Handler, main_file_path: PathBuf) -> Self { + pub fn new(handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf) -> Self { Self { handler, main_file_path, + output_directory, } } @@ -63,20 +67,34 @@ impl<'a> Compiler<'a> { } /// - /// Returns a compiled Leo program. + /// Runs the compiler stages. /// - pub fn compile(self) -> Result { + fn compiler_stages(self) -> Result { // Load the program file. let program_string = fs::read_to_string(&self.main_file_path) .map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?; // Use the parser to construct the abstract syntax tree (ast). - let ast: leo_ast::Ast = leo_parser::parse_ast( + let mut ast: leo_ast::Ast = leo_parser::parse_ast( self.handler, self.main_file_path.to_str().unwrap_or_default(), program_string, )?; + // Write the AST snapshot post parsing. + ast.to_json_file_without_keys(self.output_directory.clone(), "inital_ast.json", &["span"])?; + + // Canonicalize the AST. + ast = leo_ast_passes::Canonicalizer::do_pass(Default::default(), ast.into_repr())?; + // Write the AST snapshot post parsing + ast.to_json_file_without_keys(self.output_directory, "canonicalization_ast.json", &["span"])?; Ok(ast) } + + /// + /// Returns a compiled Leo program. + /// + pub fn compile(self) -> Result { + create_session_if_not_set_then(|_| self.compiler_stages()) + } } diff --git a/compiler/src/unused/Cargo.toml b/compiler/src/unused/Cargo.toml index f775271447..a63d06a42a 100644 --- a/compiler/src/unused/Cargo.toml +++ b/compiler/src/unused/Cargo.toml @@ -30,9 +30,6 @@ version = "1.5.3" #path = "../imports" #version = "1.5.3" # -#[dependencies.leo-input] -#path = "../input" -#version = "1.5.3" # #[dependencies.leo-package] #path = "../package" @@ -102,9 +99,6 @@ features = [ "serde-1" ] [dependencies.num-bigint] version = "0.4" -[dependencies.pest] -version = "2.0" - [dependencies.rand] version = "0.8" diff --git a/compiler/src/unused/compiler.rs b/compiler/src/unused/compiler.rs index 969cf8bec0..72fe585372 100644 --- a/compiler/src/unused/compiler.rs +++ b/compiler/src/unused/compiler.rs @@ -24,7 +24,6 @@ use leo_asg::{Asg, AsgPass, Program as AsgProgram}; use leo_ast::{AstPass, Input, MainInput, Program as AstProgram}; use leo_errors::{CompilerError, Result}; use leo_imports::ImportParser; -use leo_input::LeoInputParser; use leo_package::inputs::InputPairs; use leo_parser::parse_ast; diff --git a/compiler/src/unused/constraints/constraints.rs b/compiler/src/unused/constraints/constraints.rs index 8f740ae175..32951ef463 100644 --- a/compiler/src/unused/constraints/constraints.rs +++ b/compiler/src/unused/constraints/constraints.rs @@ -20,7 +20,6 @@ use crate::{ConstrainedProgram, GroupType, Output, OutputFile}; use leo_asg::Program; use leo_ast::Input; use leo_errors::{CompilerError, Result}; -use leo_input::LeoInputParser; use leo_package::inputs::InputPairs; use snarkvm_fields::PrimeField; diff --git a/errors/Cargo.toml b/errors/Cargo.toml index a2e51114d4..b12fc2331d 100644 --- a/errors/Cargo.toml +++ b/errors/Cargo.toml @@ -25,10 +25,6 @@ version = "0.3.62" path = "../span" version = "1.5.3" -[dependencies.leo-input] -path = "../input" -version = "1.5.3" - [dependencies.colored] version = "2.0.0" @@ -42,9 +38,6 @@ version = "2.2.0" version = "0.6.6" default-features = false -[dependencies.pest] -version = "2.0" - [dependencies.serde] version = "1.0.133" features = [ "derive", "rc" ] diff --git a/errors/README.md b/errors/README.md index ce05b1ed5d..edfd180bff 100644 --- a/errors/README.md +++ b/errors/README.md @@ -13,7 +13,7 @@ The common section of this crate contains a few sub files: - [Backtraced Error](./src/common/backtraced.rs): Which contains the information needed to create a backtraceable error for Leo. - [Formatted Error](./src/common/formatted.rs): Which contains the information needed to create a formatted error for Leo. - [Macros](./src/common/macros.rs): Which contains the logic to make creating errors easy through a DSL. It also figures out the error codes for each error via a **top down** method. Meaning all new errors should be added to the bottom of the file. You can specify whether an error is formatted or backtraced through a decorator above a function name, where the formatted ones require a Span as an argument by default. The body takes any additional arguments you want provided to the function, the message, and the optional help message for the error. The additional arguments are just specified to implement traits to avoid as many type conversions in other Leo crates. -- [Span](./src/common/span.rs): Which contains the span object used throughout the other Leo crates(with the exception of the Input crate see more [below](#input)). +- [Span](./src/common/span.rs): Which contains the span object used throughout the other Leo crates (with the exception of the Input crate see more [below](#input)). - [Tendril JSON](./src/common/tendril_json.rs): Which contains the common logic for how to searlize a StrTendril from the tendril crate. - [Traits](./src/common/traits.rs): Which contains the common traits in errors to make defining errors easier. @@ -41,10 +41,9 @@ The errors for the `leo-compiler` crate. Its error codes will range from 6_000-6 The errors for the `leo-imports` crate. Its error codes will range from 4_000-4_999 and be prefixed with the characters `IMP`. -### Input +## Input -The errors for the `leo-input` crate. For right now, they have an exit code of 1, as they aren't ported. -The reason they aren't ported is due to a desire for 0 deps in case this crate moves to SnarkVM. +The errors for the `leo-ast` crate. Its error codes will range from 8_000-8_999 and be prefixed with the characters `INP`. ### Package diff --git a/errors/src/ast/ast_errors.rs b/errors/src/ast/ast_errors.rs index fa2c6b6f81..031bc6f87f 100644 --- a/errors/src/ast/ast_errors.rs +++ b/errors/src/ast/ast_errors.rs @@ -130,4 +130,20 @@ create_errors!( msg: format!("failed to convert ast to a json value {}", error), help: None, } + + /// For when a user tries to define a tuple dimension of 1. + @formatted + invalid_tuple_dimension_size { + args: (), + msg: "tuples of 1 element are not allowed", + help: None, + } + + /// For when a user puts parens around a single defined variable. + @formatted + invalid_parens_around_single_variable { + args: (), + msg: "do not put parens around single variable names", + help: None, + } ); diff --git a/errors/src/input/input_errors.rs b/errors/src/input/input_errors.rs new file mode 100644 index 0000000000..c8ebb79799 --- /dev/null +++ b/errors/src/input/input_errors.rs @@ -0,0 +1,104 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use crate::create_errors; +use std::fmt::{Debug, Display}; + +create_errors!( + /// InputError enum that represents all the errors for the inputs part of `leo-ast` crate. + InputError, + exit_code_mask: 8000i32, + error_code_prefix: "INP", + + /// For when declared variable type mismatches actual type. + @formatted + unexpected_type { + args: (expected: impl Display, received: impl Display), + msg: format!( + "unexpected type, expected: '{}', received: '{}'", + expected, + received, + ), + help: None, + } + + /// For when string value is assigned to an array of non Char type. + @formatted + string_is_array_of_chars { + args: (expected: impl Display), + msg: format!( + "strings transforms into array of 'char', expected: {}", + expected, + ), + help: None, + } + + /// For when [`ArrayDimensions`] are not specified. + @formatted + array_dimensions_must_be_specified { + args: (), + msg: "array dimensions must be specified", + help: None, + } + + /// For when array init is using spread. + @formatted + array_spread_is_not_allowed { + args: (), + msg: "array spread is not allowed in inputs", + help: None, + } + + /// For when any of the array dimensions is zero. + @formatted + invalid_array_dimension_size { + args: (), + msg: "received dimension size of 0, expected it to be 1 or larger.", + help: None, + } + + /// For when the expression is not allowed in an input file. + @formatted + illegal_expression { + args: (expr: impl Display), + msg: format!("expression '{}' is not allowed in inputs", expr), + help: None, + } + + /// For when section name is not an allowed one. + @formatted + unexpected_section { + args: (expected: &[impl Display], received: impl Display), + msg: format!( + "unexpected section: expected {} -- got '{}'", + expected + .iter() + .map(|x| format!("'{}'", x)) + .collect::>() + .join(", "), + received + ), + help: None, + } + + /// For when declared tuple length is not equal to the value's. + @formatted + tuple_length_mismatch { + args: (expected: impl Display, received: impl Display), + msg: format!("tuple length mismatch, defined {} types, got {} values", expected, received), + help: None, + } +); diff --git a/ast/src/input/parameters/mod.rs b/errors/src/input/mod.rs similarity index 87% rename from ast/src/input/parameters/mod.rs rename to errors/src/input/mod.rs index 44b61cc20f..a263dcde02 100644 --- a/ast/src/input/parameters/mod.rs +++ b/errors/src/input/mod.rs @@ -14,5 +14,6 @@ // You should have received a copy of the GNU General Public License // along with the Leo library. If not, see . -pub mod parameter; -pub use parameter::*; +/// This module contains the Input error definitions. +pub mod input_errors; +pub use self::input_errors::*; diff --git a/errors/src/lib.rs b/errors/src/lib.rs index 73ecd4d342..c76a766a44 100644 --- a/errors/src/lib.rs +++ b/errors/src/lib.rs @@ -45,6 +45,10 @@ pub use self::compiler::*; pub mod import; pub use self::import::*; +/// Contains the Input error definitions. +pub mod input; +pub use self::input::*; + /// Contains the Package error definitions. pub mod package; pub use self::package::*; @@ -64,8 +68,6 @@ pub use self::state::*; #[macro_use] extern crate thiserror; -use leo_input::InputParserError; - /// The LeoError type that contains all sub error types. /// This allows a unified error type throughout the Leo crates. #[derive(Debug, Error)] @@ -92,7 +94,7 @@ pub enum LeoError { /// Represents an Input Error in a Leo Error. #[error(transparent)] - InputError(#[from] InputParserError), + InputError(#[from] InputError), /// Represents an Package Error in a Leo Error. #[error(transparent)] @@ -122,7 +124,7 @@ impl LeoError { CliError(error) => error.error_code(), CompilerError(error) => error.error_code(), ImportError(error) => error.error_code(), - InputError(_error) => Default::default(), // TODO migrate me, or not cause we want inputs to have 0 deps. + InputError(error) => error.error_code(), PackageError(error) => error.error_code(), ParserError(error) => error.error_code(), SnarkVMError(_error) => Default::default(), // TODO update once snarkvm implments a global top level error similar to LeoError. @@ -140,7 +142,7 @@ impl LeoError { CliError(error) => error.exit_code(), CompilerError(error) => error.exit_code(), ImportError(error) => error.exit_code(), - InputError(_error) => 1, // TODO migrate me, or not cause we want inputs to have 0 deps. + InputError(error) => error.exit_code(), PackageError(error) => error.exit_code(), ParserError(error) => error.exit_code(), SnarkVMError(_error) => 1, // TODO update once snarkvm implments a global top level error similar to LeoError. diff --git a/grammar/README.md b/grammar/README.md index 557f748a55..105de2cbe4 100644 --- a/grammar/README.md +++ b/grammar/README.md @@ -625,25 +625,6 @@ identifier = letter *( letter / decimal-digit / "_" ) Go to: _[letter](#user-content-letter)_; -A package name consists of one or more segments separated by single dashes, -where each segment is a non-empty sequence of -lowercase letters and (decimal) digits. -Similarly to an identifier, a package name must not be a keyword -and must not be or start with `aleo1`. - - -```abnf -package-name = lowercase-letter *( lowercase-letter / decimal-digit ) - *( "-" 1*( lowercase-letter / decimal-digit ) ) - ; but not a keyword or a boolean literal or aleo1... -``` - -Go to: _[lowercase-letter](#user-content-lowercase-letter)_; - - -Note that, grammatically, identifiers are also package names. -They are disambiguated from context, based on the syntactic grammar. - Annotations have names, which are identifiers immediately preceded by `@`. @@ -918,12 +899,11 @@ is a token, as defined by the following rule. token = keyword / identifier / atomic-literal - / package-name / annotation-name / symbol ``` -Go to: _[annotation-name](#user-content-annotation-name), [atomic-literal](#user-content-atomic-literal), [identifier](#user-content-identifier), [keyword](#user-content-keyword), [package-name](#user-content-package-name), [symbol](#user-content-symbol)_; +Go to: _[annotation-name](#user-content-annotation-name), [atomic-literal](#user-content-atomic-literal), [identifier](#user-content-identifier), [keyword](#user-content-keyword), [symbol](#user-content-symbol)_; Tokens, comments, and whitespace are lexemes, i.e. lexical units. @@ -1795,33 +1775,33 @@ An import declaration consists of the `import` keyword followed by a package path, which may be one of the following: a single wildcard; an identifier, optionally followed by a local renamer; -a package name followed by a path, recursively; +an identifier followed by a path, recursively; or a parenthesized list of package paths, which are "fan out" of the initial path. Note that we allow the last element of the parenthesized list to be followed by a comma, for convenience. -The package path in the import declaration must start with a package name +The package path in the import declaration must start with an identifier (e.g. it cannot be a `*`): the rule for import declaration expresses this requirement -by using an explicit package name before the package path. +by using an explicit identifier before the package path. ```abnf -import-declaration = %s"import" package-name "." package-path ";" +import-declaration = %s"import" identifier "." package-path ";" ``` -Go to: _[package-name](#user-content-package-name), [package-path](#user-content-package-path)_; +Go to: _[identifier](#user-content-identifier), [package-path](#user-content-package-path)_; ```abnf package-path = "*" / identifier [ %s"as" identifier ] - / package-name "." package-path + / identifier "." package-path / "(" package-path *( "," package-path ) [","] ")" ``` -Go to: _[identifier](#user-content-identifier), [package-name](#user-content-package-name), [package-path](#user-content-package-path)_; +Go to: _[identifier](#user-content-identifier), [package-path](#user-content-package-path)_; A type alias declaration defines an identifier to stand for a type. diff --git a/grammar/abnf-grammar.txt b/grammar/abnf-grammar.txt index dcb7cdc51c..af4bd430a1 100644 --- a/grammar/abnf-grammar.txt +++ b/grammar/abnf-grammar.txt @@ -447,19 +447,6 @@ hexadecimal-digit = decimal-digit / "a" / "b" / "c" / "d" / "e" / "f" identifier = letter *( letter / decimal-digit / "_" ) ; but not a keyword or a boolean literal or aleo1... -; A package name consists of one or more segments separated by single dashes, -; where each segment is a non-empty sequence of -; lowercase letters and (decimal) digits. -; Similarly to an identifier, a package name must not be a keyword -; and must not be or start with `aleo1`. - -package-name = lowercase-letter *( lowercase-letter / decimal-digit ) - *( "-" 1*( lowercase-letter / decimal-digit ) ) - ; but not a keyword or a boolean literal or aleo1... - -; Note that, grammatically, identifiers are also package names. -; They are disambiguated from context, based on the syntactic grammar. - ; Annotations have names, which are identifiers immediately preceded by `@`. annotation-name = "@" identifier @@ -606,7 +593,6 @@ symbol = "!" / "&" / "&&" / "||" token = keyword / identifier / atomic-literal - / package-name / annotation-name / symbol @@ -1063,21 +1049,21 @@ circuit-declaration = %s"circuit" identifier ; followed by a package path, which may be one of the following: ; a single wildcard; ; an identifier, optionally followed by a local renamer; -; a package name followed by a path, recursively; +; an identifier followed by a path, recursively; ; or a parenthesized list of package paths, ; which are "fan out" of the initial path. ; Note that we allow the last element of the parenthesized list ; to be followed by a comma, for convenience. -; The package path in the import declaration must start with a package name +; The package path in the import declaration must start with an identifier ; (e.g. it cannot be a `*`): ; the rule for import declaration expresses this requirement -; by using an explicit package name before the package path. +; by using an explicit identifier before the package path. -import-declaration = %s"import" package-name "." package-path ";" +import-declaration = %s"import" identifier "." package-path ";" package-path = "*" / identifier [ %s"as" identifier ] - / package-name "." package-path + / identifier "." package-path / "(" package-path *( "," package-path ) [","] ")" ; A type alias declaration defines an identifier to stand for a type. diff --git a/input/Cargo.toml b/input/Cargo.toml deleted file mode 100644 index 19765514b5..0000000000 --- a/input/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "leo-input" -version = "1.5.3" -authors = [ "The Aleo Team " ] -description = "Input parser of the Leo programming language" -homepage = "https://aleo.org" -repository = "https://github.com/AleoHQ/leo" -keywords = [ - "aleo", - "cryptography", - "leo", - "programming-language", - "zero-knowledge" -] -categories = [ "cryptography::cryptocurrencies", "web-programming" ] -include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] -license = "GPL-3.0" -edition = "2021" -rust-version = "1.56.1" - -[dependencies.from-pest] -version = "0.3.1" - -[dependencies.pest] -version = "2.0" - -[dependencies.pest-ast] -version = "0.3.3" - -[dependencies.pest_derive] -version = "2.0" - -[dependencies.thiserror] -version = "1.0" - -[dependencies.tracing] -version = "0.1" diff --git a/input/LICENSE.md b/input/LICENSE.md deleted file mode 100644 index b95c626e2a..0000000000 --- a/input/LICENSE.md +++ /dev/null @@ -1,596 +0,0 @@ -GNU General Public License -========================== - -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. <> - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -## Preamble - -The GNU General Public License is a free, copyleft license for software and other -kinds of works. - -The licenses for most software and other practical works are designed to take away -your freedom to share and change the works. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change all versions of a -program--to make sure it remains free software for all its users. We, the Free -Software Foundation, use the GNU General Public License for most of our software; it -applies also to any other work released this way by its authors. You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General -Public Licenses are designed to make sure that you have the freedom to distribute -copies of free software (and charge for them if you wish), that you receive source -code or can get it if you want it, that you can change the software or use pieces of -it in new free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you these rights or -asking you to surrender the rights. Therefore, you have certain responsibilities if -you distribute copies of the software, or if you modify it: responsibilities to -respect the freedom of others. - -For example, if you distribute copies of such a program, whether gratis or for a fee, -you must pass on to the recipients the same freedoms that you received. You must make -sure that they, too, receive or can get the source code. And you must show them these -terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: **(1)** assert -copyright on the software, and **(2)** offer you this License giving you legal permission -to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains that there is -no warranty for this free software. For both users' and authors' sake, the GPL -requires that modified versions be marked as changed, so that their problems will not -be attributed erroneously to authors of previous versions. - -Some devices are designed to deny users access to install or run modified versions of -the software inside them, although the manufacturer can do so. This is fundamentally -incompatible with the aim of protecting users' freedom to change the software. The -systematic pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we have designed -this version of the GPL to prohibit the practice for those products. If such problems -arise substantially in other domains, we stand ready to extend this provision to -those domains in future versions of the GPL, as needed to protect the freedom of -users. - -Finally, every program is threatened constantly by software patents. States should -not allow patents to restrict development and use of software on general-purpose -computers, but in those that do, we wish to avoid the special danger that patents -applied to a free program could make it effectively proprietary. To prevent this, the -GPL assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and modification follow. - -## TERMS AND CONDITIONS - -### 0. Definitions - -“This License” refers to version 3 of the GNU General Public License. - -“Copyright” also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - -“The Program” refers to any copyrightable work licensed under this -License. Each licensee is addressed as “you”. “Licensees” and -“recipients” may be individuals or organizations. - -To “modify” a work means to copy from or adapt all or part of the work in -a fashion requiring copyright permission, other than the making of an exact copy. The -resulting work is called a “modified version” of the earlier work or a -work “based on” the earlier work. - -A “covered work” means either the unmodified Program or a work based on -the Program. - -To “propagate” a work means to do anything with it that, without -permission, would make you directly or secondarily liable for infringement under -applicable copyright law, except executing it on a computer or modifying a private -copy. Propagation includes copying, distribution (with or without modification), -making available to the public, and in some countries other activities as well. - -To “convey” a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through a computer -network, with no transfer of a copy, is not conveying. - -An interactive user interface displays “Appropriate Legal Notices” to the -extent that it includes a convenient and prominently visible feature that **(1)** -displays an appropriate copyright notice, and **(2)** tells the user that there is no -warranty for the work (except to the extent that warranties are provided), that -licensees may convey the work under this License, and how to view a copy of this -License. If the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -### 1. Source Code - -The “source code” for a work means the preferred form of the work for -making modifications to it. “Object code” means any non-source form of a -work. - -A “Standard Interface” means an interface that either is an official -standard defined by a recognized standards body, or, in the case of interfaces -specified for a particular programming language, one that is widely used among -developers working in that language. - -The “System Libraries” of an executable work include anything, other than -the work as a whole, that **(a)** is included in the normal form of packaging a Major -Component, but which is not part of that Major Component, and **(b)** serves only to -enable use of the work with that Major Component, or to implement a Standard -Interface for which an implementation is available to the public in source code form. -A “Major Component”, in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system (if any) on which -the executable work runs, or a compiler used to produce the work, or an object code -interpreter used to run it. - -The “Corresponding Source” for a work in object code form means all the -source code needed to generate, install, and (for an executable work) run the object -code and to modify the work, including scripts to control those activities. However, -it does not include the work's System Libraries, or general-purpose tools or -generally available free programs which are used unmodified in performing those -activities but which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for the work, and -the source code for shared libraries and dynamically linked subprograms that the work -is specifically designed to require, such as by intimate data communication or -control flow between those subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate -automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -### 2. Basic Permissions - -All rights granted under this License are granted for the term of copyright on the -Program, and are irrevocable provided the stated conditions are met. This License -explicitly affirms your unlimited permission to run the unmodified Program. The -output from running a covered work is covered by this License only if the output, -given its content, constitutes a covered work. This License acknowledges your rights -of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without -conditions so long as your license otherwise remains in force. You may convey covered -works to others for the sole purpose of having them make modifications exclusively -for you, or provide you with facilities for running those works, provided that you -comply with the terms of this License in conveying all material for which you do not -control copyright. Those thus making or running the covered works for you must do so -exclusively on your behalf, under your direction and control, on terms that prohibit -them from making any copies of your copyrighted material outside their relationship -with you. - -Conveying under any other circumstances is permitted solely under the conditions -stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -### 3. Protecting Users' Legal Rights From Anti-Circumvention Law - -No covered work shall be deemed part of an effective technological measure under any -applicable law fulfilling obligations under article 11 of the WIPO copyright treaty -adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention -of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of -technological measures to the extent such circumvention is effected by exercising -rights under this License with respect to the covered work, and you disclaim any -intention to limit operation or modification of the work as a means of enforcing, -against the work's users, your or third parties' legal rights to forbid circumvention -of technological measures. - -### 4. Conveying Verbatim Copies - -You may convey verbatim copies of the Program's source code as you receive it, in any -medium, provided that you conspicuously and appropriately publish on each copy an -appropriate copyright notice; keep intact all notices stating that this License and -any non-permissive terms added in accord with section 7 apply to the code; keep -intact all notices of the absence of any warranty; and give all recipients a copy of -this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer -support or warranty protection for a fee. - -### 5. Conveying Modified Source Versions - -You may convey a work based on the Program, or the modifications to produce it from -the Program, in the form of source code under the terms of section 4, provided that -you also meet all of these conditions: - -* **a)** The work must carry prominent notices stating that you modified it, and giving a -relevant date. -* **b)** The work must carry prominent notices stating that it is released under this -License and any conditions added under section 7. This requirement modifies the -requirement in section 4 to “keep intact all notices”. -* **c)** You must license the entire work, as a whole, under this License to anyone who -comes into possession of a copy. This License will therefore apply, along with any -applicable section 7 additional terms, to the whole of the work, and all its parts, -regardless of how they are packaged. This License gives no permission to license the -work in any other way, but it does not invalidate such permission if you have -separately received it. -* **d)** If the work has interactive user interfaces, each must display Appropriate Legal -Notices; however, if the Program has interactive interfaces that do not display -Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are -not by their nature extensions of the covered work, and which are not combined with -it such as to form a larger program, in or on a volume of a storage or distribution -medium, is called an “aggregate” if the compilation and its resulting -copyright are not used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work in an aggregate -does not cause this License to apply to the other parts of the aggregate. - -### 6. Conveying Non-Source Forms - -You may convey a covered work in object code form under the terms of sections 4 and -5, provided that you also convey the machine-readable Corresponding Source under the -terms of this License, in one of these ways: - -* **a)** Convey the object code in, or embodied in, a physical product (including a -physical distribution medium), accompanied by the Corresponding Source fixed on a -durable physical medium customarily used for software interchange. -* **b)** Convey the object code in, or embodied in, a physical product (including a -physical distribution medium), accompanied by a written offer, valid for at least -three years and valid for as long as you offer spare parts or customer support for -that product model, to give anyone who possesses the object code either **(1)** a copy of -the Corresponding Source for all the software in the product that is covered by this -License, on a durable physical medium customarily used for software interchange, for -a price no more than your reasonable cost of physically performing this conveying of -source, or **(2)** access to copy the Corresponding Source from a network server at no -charge. -* **c)** Convey individual copies of the object code with a copy of the written offer to -provide the Corresponding Source. This alternative is allowed only occasionally and -noncommercially, and only if you received the object code with such an offer, in -accord with subsection 6b. -* **d)** Convey the object code by offering access from a designated place (gratis or for -a charge), and offer equivalent access to the Corresponding Source in the same way -through the same place at no further charge. You need not require recipients to copy -the Corresponding Source along with the object code. If the place to copy the object -code is a network server, the Corresponding Source may be on a different server -(operated by you or a third party) that supports equivalent copying facilities, -provided you maintain clear directions next to the object code saying where to find -the Corresponding Source. Regardless of what server hosts the Corresponding Source, -you remain obligated to ensure that it is available for as long as needed to satisfy -these requirements. -* **e)** Convey the object code using peer-to-peer transmission, provided you inform -other peers where the object code and Corresponding Source of the work are being -offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the -Corresponding Source as a System Library, need not be included in conveying the -object code work. - -A “User Product” is either **(1)** a “consumer product”, which -means any tangible personal property which is normally used for personal, family, or -household purposes, or **(2)** anything designed or sold for incorporation into a -dwelling. In determining whether a product is a consumer product, doubtful cases -shall be resolved in favor of coverage. For a particular product received by a -particular user, “normally used” refers to a typical or common use of -that class of product, regardless of the status of the particular user or of the way -in which the particular user actually uses, or expects or is expected to use, the -product. A product is a consumer product regardless of whether the product has -substantial commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - -“Installation Information” for a User Product means any methods, -procedures, authorization keys, or other information required to install and execute -modified versions of a covered work in that User Product from a modified version of -its Corresponding Source. The information must suffice to ensure that the continued -functioning of the modified object code is in no case prevented or interfered with -solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for -use in, a User Product, and the conveying occurs as part of a transaction in which -the right of possession and use of the User Product is transferred to the recipient -in perpetuity or for a fixed term (regardless of how the transaction is -characterized), the Corresponding Source conveyed under this section must be -accompanied by the Installation Information. But this requirement does not apply if -neither you nor any third party retains the ability to install modified object code -on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to -continue to provide support service, warranty, or updates for a work that has been -modified or installed by the recipient, or for the User Product in which it has been -modified or installed. Access to a network may be denied when the modification itself -materially and adversely affects the operation of the network or violates the rules -and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with -this section must be in a format that is publicly documented (and with an -implementation available to the public in source code form), and must require no -special password or key for unpacking, reading or copying. - -### 7. Additional Terms - -“Additional permissions” are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. Additional -permissions that are applicable to the entire Program shall be treated as though they -were included in this License, to the extent that they are valid under applicable -law. If additional permissions apply only to part of the Program, that part may be -used separately under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any -additional permissions from that copy, or from any part of it. (Additional -permissions may be written to require their own removal in certain cases when you -modify the work.) You may place additional permissions on material, added by you to a -covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a -covered work, you may (if authorized by the copyright holders of that material) -supplement the terms of this License with terms: - -* **a)** Disclaiming warranty or limiting liability differently from the terms of -sections 15 and 16 of this License; or -* **b)** Requiring preservation of specified reasonable legal notices or author -attributions in that material or in the Appropriate Legal Notices displayed by works -containing it; or -* **c)** Prohibiting misrepresentation of the origin of that material, or requiring that -modified versions of such material be marked in reasonable ways as different from the -original version; or -* **d)** Limiting the use for publicity purposes of names of licensors or authors of the -material; or -* **e)** Declining to grant rights under trademark law for use of some trade names, -trademarks, or service marks; or -* **f)** Requiring indemnification of licensors and authors of that material by anyone -who conveys the material (or modified versions of it) with contractual assumptions of -liability to the recipient, for any liability that these contractual assumptions -directly impose on those licensors and authors. - -All other non-permissive additional terms are considered “further -restrictions” within the meaning of section 10. If the Program as you received -it, or any part of it, contains a notice stating that it is governed by this License -along with a term that is a further restriction, you may remove that term. If a -license document contains a further restriction but permits relicensing or conveying -under this License, you may add to a covered work material governed by the terms of -that license document, provided that the further restriction does not survive such -relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in -the relevant source files, a statement of the additional terms that apply to those -files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a -separately written license, or stated as exceptions; the above requirements apply -either way. - -### 8. Termination - -You may not propagate or modify a covered work except as expressly provided under -this License. Any attempt otherwise to propagate or modify it is void, and will -automatically terminate your rights under this License (including any patent licenses -granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a -particular copyright holder is reinstated **(a)** provisionally, unless and until the -copyright holder explicitly and finally terminates your license, and **(b)** permanently, -if the copyright holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently -if the copyright holder notifies you of the violation by some reasonable means, this -is the first time you have received notice of violation of this License (for any -work) from that copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of -parties who have received copies or rights from you under this License. If your -rights have been terminated and not permanently reinstated, you do not qualify to -receive new licenses for the same material under section 10. - -### 9. Acceptance Not Required for Having Copies - -You are not required to accept this License in order to receive or run a copy of the -Program. Ancillary propagation of a covered work occurring solely as a consequence of -using peer-to-peer transmission to receive a copy likewise does not require -acceptance. However, nothing other than this License grants you permission to -propagate or modify any covered work. These actions infringe copyright if you do not -accept this License. Therefore, by modifying or propagating a covered work, you -indicate your acceptance of this License to do so. - -### 10. Automatic Licensing of Downstream Recipients - -Each time you convey a covered work, the recipient automatically receives a license -from the original licensors, to run, modify and propagate that work, subject to this -License. You are not responsible for enforcing compliance by third parties with this -License. - -An “entity transaction” is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an organization, or -merging organizations. If propagation of a covered work results from an entity -transaction, each party to that transaction who receives a copy of the work also -receives whatever licenses to the work the party's predecessor in interest had or -could give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if the predecessor -has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or -affirmed under this License. For example, you may not impose a license fee, royalty, -or other charge for exercise of rights granted under this License, and you may not -initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging -that any patent claim is infringed by making, using, selling, offering for sale, or -importing the Program or any portion of it. - -### 11. Patents - -A “contributor” is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The work thus -licensed is called the contributor's “contributor version”. - -A contributor's “essential patent claims” are all patent claims owned or -controlled by the contributor, whether already acquired or hereafter acquired, that -would be infringed by some manner, permitted by this License, of making, using, or -selling its contributor version, but do not include claims that would be infringed -only as a consequence of further modification of the contributor version. For -purposes of this definition, “control” includes the right to grant patent -sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license -under the contributor's essential patent claims, to make, use, sell, offer for sale, -import and otherwise run, modify and propagate the contents of its contributor -version. - -In the following three paragraphs, a “patent license” is any express -agreement or commitment, however denominated, not to enforce a patent (such as an -express permission to practice a patent or covenant not to sue for patent -infringement). To “grant” such a patent license to a party means to make -such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the -Corresponding Source of the work is not available for anyone to copy, free of charge -and under the terms of this License, through a publicly available network server or -other readily accessible means, then you must either **(1)** cause the Corresponding -Source to be so available, or **(2)** arrange to deprive yourself of the benefit of the -patent license for this particular work, or **(3)** arrange, in a manner consistent with -the requirements of this License, to extend the patent license to downstream -recipients. “Knowingly relying” means you have actual knowledge that, but -for the patent license, your conveying the covered work in a country, or your -recipient's use of the covered work in a country, would infringe one or more -identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you -convey, or propagate by procuring conveyance of, a covered work, and grant a patent -license to some of the parties receiving the covered work authorizing them to use, -propagate, modify or convey a specific copy of the covered work, then the patent -license you grant is automatically extended to all recipients of the covered work and -works based on it. - -A patent license is “discriminatory” if it does not include within the -scope of its coverage, prohibits the exercise of, or is conditioned on the -non-exercise of one or more of the rights that are specifically granted under this -License. You may not convey a covered work if you are a party to an arrangement with -a third party that is in the business of distributing software, under which you make -payment to the third party based on the extent of your activity of conveying the -work, and under which the third party grants, to any of the parties who would receive -the covered work from you, a discriminatory patent license **(a)** in connection with -copies of the covered work conveyed by you (or copies made from those copies), or **(b)** -primarily for and in connection with specific products or compilations that contain -the covered work, unless you entered into that arrangement, or that patent license -was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied -license or other defenses to infringement that may otherwise be available to you -under applicable patent law. - -### 12. No Surrender of Others' Freedom - -If conditions are imposed on you (whether by court order, agreement or otherwise) -that contradict the conditions of this License, they do not excuse you from the -conditions of this License. If you cannot convey a covered work so as to satisfy -simultaneously your obligations under this License and any other pertinent -obligations, then as a consequence you may not convey it at all. For example, if you -agree to terms that obligate you to collect a royalty for further conveying from -those to whom you convey the Program, the only way you could satisfy both those terms -and this License would be to refrain entirely from conveying the Program. - -### 13. Use with the GNU Affero General Public License - -Notwithstanding any other provision of this License, you have permission to link or -combine any covered work with a work licensed under version 3 of the GNU Affero -General Public License into a single combined work, and to convey the resulting work. -The terms of this License will continue to apply to the part which is the covered -work, but the special requirements of the GNU Affero General Public License, section -13, concerning interaction through a network will apply to the combination as such. - -### 14. Revised Versions of this License - -The Free Software Foundation may publish revised and/or new versions of the GNU -General Public License from time to time. Such new versions will be similar in spirit -to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that -a certain numbered version of the GNU General Public License “or any later -version” applies to it, you have the option of following the terms and -conditions either of that numbered version or of any later version published by the -Free Software Foundation. If the Program does not specify a version number of the GNU -General Public License, you may choose any version ever published by the Free -Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU -General Public License can be used, that proxy's public statement of acceptance of a -version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no -additional obligations are imposed on any author or copyright holder as a result of -your choosing to follow a later version. - -### 15. Disclaimer of Warranty - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -### 16. Limitation of Liability - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY -COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS -PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, -INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE -OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE -WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - -### 17. Interpretation of Sections 15 and 16 - -If the disclaimer of warranty and limitation of liability provided above cannot be -given local legal effect according to their terms, reviewing courts shall apply local -law that most closely approximates an absolute waiver of all civil liability in -connection with the Program, unless a warranty or assumption of liability accompanies -a copy of the Program in return for a fee. - -_END OF TERMS AND CONDITIONS_ - -## How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to -the public, the best way to achieve this is to make it free software which everyone -can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them -to the start of each source file to most effectively state the exclusion of warranty; -and each file should have at least the “copyright” line and a pointer to -where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short notice like this -when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands `show w` and `show c` should show the appropriate parts of -the General Public License. Of course, your program's commands might be different; -for a GUI interface, you would use an “about box”. - -You should also get your employer (if you work as a programmer) or school, if any, to -sign a “copyright disclaimer” for the program, if necessary. For more -information on this, and how to apply and follow the GNU GPL, see -<>. - -The GNU General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may consider it -more useful to permit linking proprietary applications with the library. If this is -what you want to do, use the GNU Lesser General Public License instead of this -License. But first, please read -<>. diff --git a/input/README.md b/input/README.md deleted file mode 100644 index ec4927aee7..0000000000 --- a/input/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# leo-input - -[![Crates.io](https://img.shields.io/crates/v/leo-input.svg?color=neon)](https://crates.io/crates/leo-input) -[![Authors](https://img.shields.io/badge/authors-Aleo-orange.svg)](../AUTHORS) -[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](./LICENSE.md) diff --git a/input/src/ast.rs b/input/src/ast.rs deleted file mode 100644 index 1a5ec0d99e..0000000000 --- a/input/src/ast.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . -#![allow(clippy::upper_case_acronyms)] - -//! Abstract syntax tree (ast) representation from leo-input.pest. -use pest::{error::Error, iterators::Pairs, Parser, Span}; -#[derive(Parser)] -#[grammar = "leo-input.pest"] -pub struct LanguageParser; - -pub fn parse(input: &str) -> Result, Error> { - LanguageParser::parse(Rule::file, input) -} - -pub fn span_into_string(span: Span) -> String { - span.as_str().to_string() -} diff --git a/input/src/common/eoi.rs b/input/src/common/eoi.rs deleted file mode 100644 index 3eda4b51e9..0000000000 --- a/input/src/common/eoi.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . -#![allow(clippy::upper_case_acronyms)] - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::EOI))] -pub struct EOI; diff --git a/input/src/common/identifier.rs b/input/src/common/identifier.rs deleted file mode 100644 index 606ac424ee..0000000000 --- a/input/src/common/identifier.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::{span_into_string, Rule}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::identifier))] -pub struct Identifier<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for Identifier<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.value) - } -} diff --git a/input/src/common/line_end.rs b/input/src/common/line_end.rs deleted file mode 100644 index 3cfde86f5e..0000000000 --- a/input/src/common/line_end.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::LINE_END))] -pub struct LineEnd; diff --git a/input/src/common/mod.rs b/input/src/common/mod.rs deleted file mode 100644 index 6956627b12..0000000000 --- a/input/src/common/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod eoi; -pub use eoi::*; - -pub mod identifier; -pub use identifier::*; - -pub mod line_end; -pub use line_end::*; diff --git a/input/src/definitions/definition.rs b/input/src/definitions/definition.rs deleted file mode 100644 index c0c64bbe67..0000000000 --- a/input/src/definitions/definition.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, common::LineEnd, expressions::Expression, parameters::Parameter}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::definition))] -pub struct Definition<'ast> { - pub parameter: Parameter<'ast>, - pub expression: Expression<'ast>, - pub line_end: LineEnd, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/definitions/mod.rs b/input/src/definitions/mod.rs deleted file mode 100644 index d59ffd9d5d..0000000000 --- a/input/src/definitions/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod definition; -pub use definition::*; diff --git a/input/src/errors/mod.rs b/input/src/errors/mod.rs deleted file mode 100644 index 9a69051aaa..0000000000 --- a/input/src/errors/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod parser; -pub use parser::*; - -pub mod syntax; -pub use syntax::*; diff --git a/input/src/errors/parser.rs b/input/src/errors/parser.rs deleted file mode 100644 index cca4dc850a..0000000000 --- a/input/src/errors/parser.rs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - errors::SyntaxError as InputSyntaxError, - expressions::{ArrayInlineExpression, Expression}, - sections::Header, - tables::Table, - types::{DataType, IntegerType, Type}, - values::{NumberValue, Value}, -}; - -use pest::{ - error::{Error, ErrorVariant}, - Span, -}; -use std::{num::ParseIntError, path::PathBuf, str::ParseBoolError}; - -#[derive(Debug, Error)] -pub enum InputParserError { - #[error("Program input value {} not found", _0)] - InputNotFound(String), - - #[error("Cannot read from the provided file path - {:?}", _0)] - FileReadError(PathBuf), - - #[error("{}", _0)] - ParseIntError(#[from] ParseIntError), - - #[error("{}", _0)] - ParseBoolError(#[from] ParseBoolError), - - #[error("{}", _0)] - SyntaxError(#[from] InputSyntaxError), - - #[error("Unable to construct program input abstract syntax tree")] - SyntaxTreeError, -} - -impl InputParserError { - pub fn set_path(&mut self, path: &str, _content: &[String]) { - if let InputParserError::SyntaxError(error) = self { - let new_error: Error = match error { - InputSyntaxError::Error(error) => { - let new_error = error.clone(); - new_error.with_path(path) - } - }; - - tracing::error!("{}", new_error); - - *error = InputSyntaxError::Error(new_error); - } - } - - pub fn get_path(&self) -> Option<&str> { - None - } - - fn new_from_span(message: String, span: &Span) -> Self { - let error = Error::new_from_span(ErrorVariant::CustomError { message }, span.to_owned()); - - InputParserError::SyntaxError(InputSyntaxError::from(error)) - } - - pub fn array_index(actual: String, span: &Span) -> Self { - let message = format!("Expected constant number for array index, found `{}`", actual); - - Self::new_from_span(message, span) - } - - pub fn integer_type_mismatch(expected: IntegerType, received: IntegerType, span: &Span) -> Self { - let message = format!("expected data type `{}`, found `{}`", expected, received); - - Self::new_from_span(message, span) - } - - pub fn invalid_char(character: String, span: &Span) -> Self { - let message = format!("Expected valid character found `{}`", character); - - Self::new_from_span(message, span) - } - - pub fn invalid_string_dimensions(span: &Span) -> Self { - let message = "String type defintion of a char array should not be multi-dimensional".to_string(); - - Self::new_from_span(message, span) - } - - pub fn invalid_string_length(expected: usize, received: usize, span: &Span) -> Self { - let message = format!( - "Expected size of char array `{}` to match string size instead received `{}`", - expected, received - ); - - Self::new_from_span(message, span) - } - - pub fn implicit_type(data_type: DataType, implicit: NumberValue) -> Self { - let message = format!("expected `{}`, found `{}`", data_type, implicit); - - Self::new_from_span(message, implicit.span()) - } - - pub fn implicit_group(number: NumberValue) -> Self { - let message = format!("group coordinates should be in (x, y)group format, found `{}`", number); - - Self::new_from_span(message, number.span()) - } - - pub fn data_type_mismatch(data_type: DataType, value: Value) -> Self { - let message = format!("expected data type `{}`, found `{}`", data_type, value); - - Self::new_from_span(message, value.span()) - } - - pub fn expression_type_mismatch(type_: Type, expression: Expression) -> Self { - let message = format!("expected expression type `{}`, found `{}`", type_, expression); - let span = expression.span().to_owned(); - - Self::new_from_span(message, &span) - } - - pub fn array_inline_length(number: usize, array: ArrayInlineExpression) -> Self { - let message = format!( - "expected an array with a fixed size of {} elements, found one with {} elements", - number, - array.expressions.len() - ); - let span = array.span.to_owned(); - - Self::new_from_span(message, &span) - } - - pub fn array_init_length(expected: Vec, actual: Vec, span: &Span) -> Self { - let message = format!( - "expected an array with a fixed size of {:?} elements, found one with {:?} elements", - expected, actual - ); - - Self::new_from_span(message, span) - } - - pub fn input_section_header(header: Header) -> Self { - let message = format!("the section header `{}` is not valid in an input `.in` file", header); - let span = header.span(); - - Self::new_from_span(message, &span) - } - - pub fn public_section(header: Header) -> Self { - let message = format!("the section header `{}` is not a public section", header); - let span = header.span(); - - Self::new_from_span(message, &span) - } - - pub fn private_section(header: Header) -> Self { - let message = format!("the section header `{}` is not a private section", header); - let span = header.span(); - - Self::new_from_span(message, &span) - } - - pub fn table(table: Table) -> Self { - let message = format!( - "the double bracket section `{}` is not valid in an input `.in` file", - table - ); - - Self::new_from_span(message, &table.span) - } - - pub fn tuple_length(expected: usize, actual: usize, span: &Span) -> Self { - let message = format!( - "expected a tuple with {} elements, found a tuple with {} elements", - expected, actual - ); - - Self::new_from_span(message, span) - } - - pub fn section(header: Header) -> Self { - let message = format!( - "the section header `{}` must have a double bracket visibility in a state `.state` file", - header - ); - let span = header.span(); - - Self::new_from_span(message, &span) - } -} - -impl From> for InputParserError { - fn from(error: Error) -> Self { - InputParserError::SyntaxError(InputSyntaxError::from(error)) - } -} diff --git a/input/src/errors/syntax.rs b/input/src/errors/syntax.rs deleted file mode 100644 index df03534215..0000000000 --- a/input/src/errors/syntax.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::error::Error; - -#[derive(Debug, Error)] -pub enum SyntaxError { - #[error("aborting due to syntax error")] - Error(Error), -} - -impl From> for SyntaxError { - fn from(mut error: Error) -> Self { - error = error.renamed_rules(|rule| match *rule { - Rule::LINE_END => "`;`".to_owned(), - Rule::type_integer => "`u32`".to_owned(), - Rule::type_field => "`field`".to_owned(), - Rule::type_group => "`group`".to_owned(), - Rule::file => "a table or section".to_owned(), - Rule::identifier => "a variable name".to_owned(), - Rule::type_ => "a type".to_owned(), - Rule::header => "[[public]] or [[private]]".to_owned(), - - rule => format!("{:?}", rule), - }); - - SyntaxError::Error(error) - } -} diff --git a/input/src/expressions/array_initializer_expression.rs b/input/src/expressions/array_initializer_expression.rs deleted file mode 100644 index 7870ac76ba..0000000000 --- a/input/src/expressions/array_initializer_expression.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, expressions::Expression, types::ArrayDimensions}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::expression_array_initializer))] -pub struct ArrayInitializerExpression<'ast> { - pub expression: Box>, - pub dimensions: ArrayDimensions<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/expressions/array_inline_expression.rs b/input/src/expressions/array_inline_expression.rs deleted file mode 100644 index 573085bc79..0000000000 --- a/input/src/expressions/array_inline_expression.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, expressions::Expression}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::expression_array_inline))] -pub struct ArrayInlineExpression<'ast> { - pub expressions: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/expressions/expression.rs b/input/src/expressions/expression.rs deleted file mode 100644 index 6f4397800a..0000000000 --- a/input/src/expressions/expression.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, expressions::*, values::Value}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::expression))] -pub enum Expression<'ast> { - ArrayInitializer(ArrayInitializerExpression<'ast>), - ArrayInline(ArrayInlineExpression<'ast>), - StringExpression(StringExpression<'ast>), - Tuple(TupleExpression<'ast>), - Value(Value<'ast>), -} - -impl<'ast> Expression<'ast> { - pub fn span(&self) -> &Span { - match self { - Expression::ArrayInitializer(expression) => &expression.span, - Expression::ArrayInline(expression) => &expression.span, - Expression::StringExpression(string) => &string.span, - Expression::Tuple(tuple) => &tuple.span, - Expression::Value(value) => value.span(), - } - } -} - -impl<'ast> fmt::Display for Expression<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - Expression::ArrayInitializer(ref expression) => { - write!(f, "array [{} ; {}]", expression.expression, expression.dimensions) - } - Expression::ArrayInline(ref array) => { - let values = array - .expressions - .iter() - .map(|x| x.to_string()) - .collect::>() - .join(", "); - - write!(f, "array [{}]", values) - } - Expression::StringExpression(ref string) => write!(f, "{}", string), - Expression::Tuple(ref tuple) => { - let values = tuple - .expressions - .iter() - .map(|x| x.to_string()) - .collect::>() - .join(", "); - - write!(f, "({})", values) - } - Expression::Value(ref expression) => write!(f, "{}", expression), - } - } -} diff --git a/input/src/expressions/mod.rs b/input/src/expressions/mod.rs deleted file mode 100644 index 18a1505dd5..0000000000 --- a/input/src/expressions/mod.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod array_initializer_expression; -pub use array_initializer_expression::*; - -pub mod array_inline_expression; -pub use array_inline_expression::*; - -pub mod expression; -pub use expression::*; - -pub mod tuple_expression; -pub use tuple_expression::*; - -pub mod string_expression; -pub use string_expression::*; diff --git a/input/src/expressions/string_expression.rs b/input/src/expressions/string_expression.rs deleted file mode 100644 index 8c4b1cc38c..0000000000 --- a/input/src/expressions/string_expression.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, values::CharTypes}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::expression_string))] -pub struct StringExpression<'ast> { - pub chars: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for StringExpression<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "\"")?; - - for character in self.chars.iter() { - write!(f, "{:?}", character)?; - } - - write!(f, "\"") - } -} diff --git a/input/src/expressions/tuple_expression.rs b/input/src/expressions/tuple_expression.rs deleted file mode 100644 index 5cbb95dffb..0000000000 --- a/input/src/expressions/tuple_expression.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, expressions::Expression}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::expression_tuple))] -pub struct TupleExpression<'ast> { - pub expressions: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/files/file.rs b/input/src/files/file.rs deleted file mode 100644 index 61142390b8..0000000000 --- a/input/src/files/file.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, common::EOI, files::TableOrSection}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::file))] -pub struct File<'ast> { - pub entries: Vec>, - pub eoi: EOI, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/files/mod.rs b/input/src/files/mod.rs deleted file mode 100644 index 64275480c6..0000000000 --- a/input/src/files/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod file; -pub use file::*; - -pub mod table_or_section; -pub use table_or_section::*; diff --git a/input/src/files/table_or_section.rs b/input/src/files/table_or_section.rs deleted file mode 100644 index 93dd31dfc9..0000000000 --- a/input/src/files/table_or_section.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, sections::Section, tables::Table}; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::table_or_section))] -pub enum TableOrSection<'ast> { - Section(Section<'ast>), - Table(Table<'ast>), -} diff --git a/input/src/leo-input.pest b/input/src/leo-input.pest deleted file mode 100644 index cbfdb02b9b..0000000000 --- a/input/src/leo-input.pest +++ /dev/null @@ -1,277 +0,0 @@ -/// Common - -// Declared in common/identifier.rs -identifier = @{ ((!protected_name ~ ASCII_ALPHA) | (protected_name ~ (ASCII_ALPHANUMERIC | "_"))) ~ (ASCII_ALPHANUMERIC | "_")* } -protected_name = { - "address" - | "as" - | "const" - | "else" - | "false" - | type_field - | type_char - | "for" - | "function" - | type_group - | "if" - | "import" - | "in" - | "let" - | main - | "mut" - | private - | public - | record - | registers - | "return" - | state - | state_leaf - | "static" - | "test" - | "true" - } - -// Declared in common/line_end.rs -LINE_END = { ";" ~ NEWLINE* } -/// Types - -// Declared in types/type_.rs -type_ = { type_tuple | type_array | type_data } - -// Declared in types/integer_type.rs -type_integer = { - type_integer_signed - | type_integer_unsigned -} - -// Declared in types/unsigned_integer_type.rs -type_u8 = { "u8" } -type_u16 = { "u16" } -type_u32 = { "u32" } -type_u64 = { "u64" } -type_u128 = { "u128" } - -type_integer_unsigned = { - type_u8 - | type_u16 - | type_u32 - | type_u64 - | type_u128 -} - -// Declared in types/signed_integer_type.rs -type_i8 = { "i8" } -type_i16 = { "i16" } -type_i32 = { "i32" } -type_i64 = { "i64" } -type_i128 = { "i128" } - -type_integer_signed = { - type_i8 - | type_i16 - | type_i32 - | type_i64 - | type_i128 -} - -// Declared in types/char_type.rs -type_char = { "char" } - -// Declared in types/field_type.rs -type_field = { "field" } - -// Declared in types/group_type.rs -type_group = { "group" } - -// Declared in types/boolean_type.rs -type_boolean = { "bool" } - -// Declared in types/address_type.rs -type_address = { "address" } - -// Declared in types/data_type.rs -type_data = { type_field | type_group | type_boolean | type_address | type_integer | type_char } - -// Declared in types/array_type.rs -type_array = { "[" ~ type_ ~ ";" ~ array_dimensions ~ "]" } - -// Declared in types/array_dimensions.rs -array_dimensions = { - dimension_single - | dimension_multiple -} - -// Declared in types/array_dimensions.rs -dimension_single = { - number_positive -} - -// Declared in types/array_dimensions.rs -dimension_multiple = { "(" ~ number_positive ~ ("," ~ number_positive)* ~ ")"} - -type_tuple = { "(" ~ NEWLINE* ~ (type_ ~ ("," ~ NEWLINE* ~ type_)+ ~ ","?)? ~ NEWLINE* ~ ")" } - -/// Values - -// Declared in values/value.rs -value = { - value_address - | value_boolean - | value_field - | value_group - | value_char - | value_integer - | value_number // must be last as a catch all -} - -// Declared in values/number_value.rs -value_number = { number_negative | number_positive } - -// Declared in values/number_negative.rs -number_negative = @{ "-" ~ ASCII_DIGIT+ } - -// Declared in values/number_positive.rs -number_positive = @{ ASCII_DIGIT+ } - -// Decalred in values/char_types.rs -// ANY is equivalent to '\u{00}'..'\u{10FFFF}' -basic_char = { ANY } -escaped_char = @{ "\\" ~ ("\"" | "\'" | "\\" | "/" | "b" | "f" | "n" | "r" | "t") } -hex_char = @{ "\\" ~ "x" ~ ASCII_HEX_DIGIT{2} } -unicode_char = @{ "\\" ~ "u" ~ "{" ~ ASCII_HEX_DIGIT{1, 6} ~ "}" } - -char_types = { - escaped_char - | unicode_char - | hex_char - | basic_char -} - -// Declared in values/char_value.rs -value_char = ${ "\'" ~ char_types ~ "\'" } - -// Declared in values/integer_value.rs -value_integer = { value_integer_signed | value_integer_unsigned} - -// Declared in values/signed_integer_value.rs -value_integer_signed = ${ value_number ~ type_integer_signed } - -// Declared in values/unsigned_integer_value.rs -value_integer_unsigned = ${ number_positive ~ type_integer_unsigned } - -// Declared in values/boolean_value.rs -value_boolean = { "true" | "false" } - -// Declared in values/field_value.rs -value_field = ${ value_number ~ type_field } - -// Declared in values/group_value.rs -value_group = ${ group_single_or_tuple ~ type_group } -group_single_or_tuple = {value_number | group_tuple} -group_tuple = !{"(" ~ group_coordinate ~ "," ~ group_coordinate ~ ")"} - -// Declared in values/group_coordinate.rs -group_coordinate = { - value_number - | sign_high - | sign_low - | inferred -} - -sign_high = @{"+"} -sign_low = @{"-"} -inferred = @{"_"} - -// Declared in values/address.rs -address = @{ "aleo" ~ ASCII_DIGIT ~ (LOWERCASE_LETTER | ASCII_DIGIT){58} } - -// Declared in values/address_typed.rs -address_typed = ${ type_address ~ "(" ~ address ~ ")" } - -// Declared in values/address_value.rs -value_address = {address | address_typed} - -/// Expressions - -// Declared in expressions/array_initializer_expression.rs -expression_array_initializer = { "[" ~ expression ~ ";" ~ array_dimensions ~ "]" } - -// Declared in expressions/array_inline_expression.rs -expression_array_inline = { "[" ~ NEWLINE* ~ inline_array_inner ~ NEWLINE* ~ "]"} -inline_array_inner = _{ (expression ~ ("," ~ NEWLINE* ~ expression)*)? } - -// Declared in expressions/string_expression.rs -expression_string = ${ "\"" ~ (!"\"" ~ char_types)+ ~ "\"" } - -// Declared in expressions/expression.rs -expression = { - value - | expression_tuple - | expression_array_inline - | expression_array_initializer - | expression_string -} -expression_tuple = { "(" ~ expression ~ ("," ~ expression)+ ~")" } - -/// Parameters - -// Declared in parameters/parameters.rs -parameter = { identifier ~ ":" ~ type_ } - -/// Section - -// Declared in sections/section.rs -section = { "[" ~ header ~ "]" ~ NEWLINE+ ~ (definition ~ NEWLINE*)* } - -// Declared in sections/main_.rs -main = { "main" } - -// Declared in sections/record.rs -record = { "record" } - -// Declared in sections/registers.rs -registers = { "registers" } - -// Declared in sections/state.rs -state = { "state" } - -// Declared in sections/constants.rs -constants = { "constants" } - -// Declared in sections/state_leaf.rs -state_leaf = { "state_leaf" } - -// Declared in sections/header.rs -header = { main | constants | record | registers | state_leaf | state | identifier } - -/// Definitions - -// Declared in definition/definition.rs -definition = { parameter ~ "=" ~ expression ~ LINE_END } - -/// Table - -// Declared in tables/public.rs -public = { "public" } - -// Declared in tables/private.rs -private = { "private" } - -// Declared in tables/visibility.rs -visibility = { public | private } - -// Declared in sections/table.rs -table = {"[[" ~ visibility ~ "]]" ~ NEWLINE+ ~ section*} - -/// Utilities - -COMMENT = _{ ("/*" ~ (!"*/" ~ ANY)* ~ "*/") | ("//" ~ (!NEWLINE ~ ANY)*) } -WHITESPACE = _{ " " | "\t" ~ (NEWLINE)* } - -/// Files - -// Declared in files/table_or_section.rs -table_or_section = { table | section } - -// Declared in files/file.rs -file = { SOI ~ NEWLINE* ~ table_or_section* ~ NEWLINE* ~ EOI } diff --git a/input/src/lib.rs b/input/src/lib.rs deleted file mode 100644 index 1b73fdb778..0000000000 --- a/input/src/lib.rs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -#![doc = include_str!("../README.md")] - -#[macro_use] -extern crate pest_derive; -#[macro_use] -extern crate thiserror; - -pub mod errors; -pub use errors::*; - -mod ast; -pub mod common; -pub mod definitions; -pub mod expressions; -pub mod files; -pub mod parameters; -pub mod sections; -pub mod tables; -pub mod types; -pub mod values; - -use from_pest::FromPest; -use std::{fs, path::Path}; - -pub struct LeoInputParser; - -impl LeoInputParser { - /// Reads in the given file path into a string. - pub fn load_file(file_path: &Path) -> Result { - fs::read_to_string(file_path).map_err(|_| InputParserError::FileReadError(file_path.to_owned())) - } - - /// Parses the input file and constructs a syntax tree. - pub fn parse_file(input_file: &str) -> Result { - // Parse the file using leo-input.pest - let mut file = ast::parse(input_file)?; - - // Build the abstract syntax tree - let syntax_tree = files::File::from_pest(&mut file).map_err(|_| InputParserError::SyntaxTreeError)?; - - Ok(syntax_tree) - } -} diff --git a/input/src/parameters/mod.rs b/input/src/parameters/mod.rs deleted file mode 100644 index 15f8820a53..0000000000 --- a/input/src/parameters/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod parameter; -pub use parameter::*; diff --git a/input/src/parameters/parameter.rs b/input/src/parameters/parameter.rs deleted file mode 100644 index 410ef775a9..0000000000 --- a/input/src/parameters/parameter.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, common::Identifier, types::Type}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::parameter))] -pub struct Parameter<'ast> { - pub variable: Identifier<'ast>, - pub type_: Type<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/constants.rs b/input/src/sections/constants.rs deleted file mode 100644 index 5e238f59c1..0000000000 --- a/input/src/sections/constants.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::constants))] -pub struct Constants<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/header.rs b/input/src/sections/header.rs deleted file mode 100644 index e0296bf165..0000000000 --- a/input/src/sections/header.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - common::Identifier, - sections::{Constants, Main, Record, Registers, State, StateLeaf}, -}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::header))] -pub enum Header<'ast> { - Constants(Constants<'ast>), - Main(Main<'ast>), - Record(Record<'ast>), - Registers(Registers<'ast>), - State(State<'ast>), - StateLeaf(StateLeaf<'ast>), - Identifier(Identifier<'ast>), -} - -impl<'ast> Header<'ast> { - pub fn span(self) -> Span<'ast> { - match self { - Header::Constants(constants) => constants.span, - Header::Main(main) => main.span, - Header::Record(record) => record.span, - Header::Registers(registers) => registers.span, - Header::State(state) => state.span, - Header::StateLeaf(state_leaf) => state_leaf.span, - Header::Identifier(identifier) => identifier.span, - } - } -} - -impl<'ast> fmt::Display for Header<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - Header::Constants(_constants) => write!(f, "constants"), - Header::Main(_main) => write!(f, "main"), - Header::Record(_record) => write!(f, "record"), - Header::Registers(_registers) => write!(f, "registers"), - Header::State(_state) => write!(f, "state"), - Header::StateLeaf(_state_leaf) => write!(f, "state_leaf"), - Header::Identifier(identifier) => write!(f, "{}", identifier.value), - } - } -} diff --git a/input/src/sections/main_.rs b/input/src/sections/main_.rs deleted file mode 100644 index 0e8763a638..0000000000 --- a/input/src/sections/main_.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::main))] -pub struct Main<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/mod.rs b/input/src/sections/mod.rs deleted file mode 100644 index 45025d9cb0..0000000000 --- a/input/src/sections/mod.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod constants; -pub use constants::*; - -pub mod header; -pub use header::*; - -pub mod main_; -pub use main_::*; - -pub mod record; -pub use record::*; - -pub mod registers; -pub use registers::*; - -pub mod state; -pub use state::*; - -pub mod state_leaf; -pub use state_leaf::*; - -pub mod section; -pub use section::*; diff --git a/input/src/sections/record.rs b/input/src/sections/record.rs deleted file mode 100644 index 8f431dd040..0000000000 --- a/input/src/sections/record.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::record))] -pub struct Record<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/registers.rs b/input/src/sections/registers.rs deleted file mode 100644 index 0c14fe007f..0000000000 --- a/input/src/sections/registers.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::registers))] -pub struct Registers<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/section.rs b/input/src/sections/section.rs deleted file mode 100644 index e53a6331cd..0000000000 --- a/input/src/sections/section.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, definitions::Definition, sections::Header}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::section))] -pub struct Section<'ast> { - pub header: Header<'ast>, - pub definitions: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/state.rs b/input/src/sections/state.rs deleted file mode 100644 index 25b454245f..0000000000 --- a/input/src/sections/state.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::state))] -pub struct State<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/sections/state_leaf.rs b/input/src/sections/state_leaf.rs deleted file mode 100644 index c44ef71a4e..0000000000 --- a/input/src/sections/state_leaf.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::state_leaf))] -pub struct StateLeaf<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/tables/mod.rs b/input/src/tables/mod.rs deleted file mode 100644 index 4edfa339dd..0000000000 --- a/input/src/tables/mod.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod private; -pub use private::*; - -pub mod public; -pub use public::*; - -pub mod table; -pub use table::*; - -pub mod visibility; -pub use visibility::*; diff --git a/input/src/tables/private.rs b/input/src/tables/private.rs deleted file mode 100644 index 3735989fae..0000000000 --- a/input/src/tables/private.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::private))] -pub struct Private<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for Private<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.span.as_str()) - } -} diff --git a/input/src/tables/public.rs b/input/src/tables/public.rs deleted file mode 100644 index aaee16f425..0000000000 --- a/input/src/tables/public.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::public))] -pub struct Public<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for Public<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.span.as_str()) - } -} diff --git a/input/src/tables/table.rs b/input/src/tables/table.rs deleted file mode 100644 index 9ea777cbda..0000000000 --- a/input/src/tables/table.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, sections::Section, tables::Visibility}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::table))] -pub struct Table<'ast> { - pub visibility: Visibility<'ast>, - pub sections: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for Table<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "[[{}]]", self.visibility) - } -} diff --git a/input/src/tables/visibility.rs b/input/src/tables/visibility.rs deleted file mode 100644 index 0abe3828ee..0000000000 --- a/input/src/tables/visibility.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - tables::{Private, Public}, -}; - -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::visibility))] -pub enum Visibility<'ast> { - Private(Private<'ast>), - Public(Public<'ast>), -} - -impl<'ast> fmt::Display for Visibility<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - Visibility::Private(private) => write!(f, "{}", private), - Visibility::Public(public) => write!(f, "{}", public), - } - } -} diff --git a/input/src/types/address_type.rs b/input/src/types/address_type.rs deleted file mode 100644 index a3bc14b2ad..0000000000 --- a/input/src/types/address_type.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_address))] -pub struct AddressType {} diff --git a/input/src/types/array_dimensions.rs b/input/src/types/array_dimensions.rs deleted file mode 100644 index 776ca0d899..0000000000 --- a/input/src/types/array_dimensions.rs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, values::PositiveNumber}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::array_dimensions))] -pub enum ArrayDimensions<'ast> { - Single(Single<'ast>), - Multiple(Multiple<'ast>), -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::dimension_single))] -pub struct Single<'ast> { - pub number: PositiveNumber<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::dimension_multiple))] -pub struct Multiple<'ast> { - pub numbers: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> ArrayDimensions<'ast> { - pub fn next_dimension(&self) -> Self { - match self { - ArrayDimensions::Single(single) => ArrayDimensions::Multiple(Multiple { - numbers: vec![], - span: single.span.clone(), - }), - ArrayDimensions::Multiple(multiple) => { - let old_dimension = &multiple.numbers; - - ArrayDimensions::Multiple(Multiple { - numbers: old_dimension[1..].to_vec(), - span: multiple.span.clone(), - }) - } - } - } - - pub fn is_empty(&self) -> bool { - match self { - ArrayDimensions::Single(_) => false, - ArrayDimensions::Multiple(multiple) => multiple.numbers.is_empty(), - } - } -} - -impl<'ast> std::fmt::Display for ArrayDimensions<'ast> { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match *self { - ArrayDimensions::Single(ref single) => write!(f, "{}", single.number), - ArrayDimensions::Multiple(ref multiple) => { - let string = multiple - .numbers - .iter() - .map(|x| x.value.clone()) - .collect::>() - .join(", "); - - write!(f, "{}", string) - } - } - } -} diff --git a/input/src/types/array_type.rs b/input/src/types/array_type.rs deleted file mode 100644 index 0132228e0d..0000000000 --- a/input/src/types/array_type.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - types::{ArrayDimensions, Type}, -}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_array))] -pub struct ArrayType<'ast> { - pub type_: Box>, - pub dimensions: ArrayDimensions<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> std::fmt::Display for ArrayType<'ast> { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "[{}; ({})]", self.type_, self.dimensions) - } -} diff --git a/input/src/types/boolean_type.rs b/input/src/types/boolean_type.rs deleted file mode 100644 index a482295004..0000000000 --- a/input/src/types/boolean_type.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_boolean))] -pub struct BooleanType {} diff --git a/input/src/types/char_type.rs b/input/src/types/char_type.rs deleted file mode 100644 index 56e20a68e0..0000000000 --- a/input/src/types/char_type.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_char))] -pub struct CharType {} diff --git a/input/src/types/data_type.rs b/input/src/types/data_type.rs deleted file mode 100644 index a0977be017..0000000000 --- a/input/src/types/data_type.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - types::{BooleanType, CharType, FieldType, GroupType, IntegerType}, -}; - -use crate::types::AddressType; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_data))] -pub enum DataType { - Address(AddressType), - Boolean(BooleanType), - Char(CharType), - Field(FieldType), - Group(GroupType), - Integer(IntegerType), -} - -impl std::fmt::Display for DataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - DataType::Address(_) => write!(f, "address"), - DataType::Boolean(_) => write!(f, "bool"), - DataType::Char(_) => write!(f, "char"), - DataType::Field(_) => write!(f, "field"), - DataType::Group(_) => write!(f, "group"), - DataType::Integer(ref integer) => write!(f, "{}", integer), - } - } -} diff --git a/input/src/types/field_type.rs b/input/src/types/field_type.rs deleted file mode 100644 index 867868394e..0000000000 --- a/input/src/types/field_type.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_field))] -pub struct FieldType {} diff --git a/input/src/types/group_type.rs b/input/src/types/group_type.rs deleted file mode 100644 index cc99e58d24..0000000000 --- a/input/src/types/group_type.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_group))] -pub struct GroupType {} diff --git a/input/src/types/integer_type.rs b/input/src/types/integer_type.rs deleted file mode 100644 index a66e28d079..0000000000 --- a/input/src/types/integer_type.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - types::{SignedIntegerType, UnsignedIntegerType}, -}; - -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_integer))] -pub enum IntegerType { - Signed(SignedIntegerType), - Unsigned(UnsignedIntegerType), -} - -impl fmt::Display for IntegerType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - IntegerType::Signed(integer) => write!(f, "{}", integer), - IntegerType::Unsigned(integer) => write!(f, "{}", integer), - } - } -} diff --git a/input/src/types/mod.rs b/input/src/types/mod.rs deleted file mode 100644 index 3f8bb810f8..0000000000 --- a/input/src/types/mod.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod address_type; -pub use address_type::*; - -pub mod array_dimensions; -pub use array_dimensions::*; - -pub mod array_type; -pub use array_type::*; - -pub mod boolean_type; -pub use boolean_type::*; - -pub mod char_type; -pub use char_type::*; - -pub mod data_type; -pub use data_type::*; - -pub mod field_type; -pub use field_type::*; - -pub mod group_type; -pub use group_type::*; - -pub mod integer_type; -pub use integer_type::*; - -pub mod signed_integer_type; -pub use signed_integer_type::*; - -pub mod tuple_type; -pub use tuple_type::*; - -pub mod type_; -pub use type_::*; - -pub mod unsigned_integer_type; -pub use unsigned_integer_type::*; diff --git a/input/src/types/signed_integer_type.rs b/input/src/types/signed_integer_type.rs deleted file mode 100644 index eaac0faadc..0000000000 --- a/input/src/types/signed_integer_type.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_integer_signed))] -pub enum SignedIntegerType { - I8Type(I8Type), - I16Type(I16Type), - I32Type(I32Type), - I64Type(I64Type), - I128Type(I128Type), -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_i8))] -pub struct I8Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_i16))] -pub struct I16Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_i32))] -pub struct I32Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_i64))] -pub struct I64Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_i128))] -pub struct I128Type {} - -impl fmt::Display for SignedIntegerType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - SignedIntegerType::I8Type(_) => write!(f, "i8"), - SignedIntegerType::I16Type(_) => write!(f, "i16"), - SignedIntegerType::I32Type(_) => write!(f, "i32"), - SignedIntegerType::I64Type(_) => write!(f, "i64"), - SignedIntegerType::I128Type(_) => write!(f, "i128"), - } - } -} diff --git a/input/src/types/tuple_type.rs b/input/src/types/tuple_type.rs deleted file mode 100644 index c5086c077a..0000000000 --- a/input/src/types/tuple_type.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, types::Type}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_tuple))] -pub struct TupleType<'ast> { - pub types_: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> std::fmt::Display for TupleType<'ast> { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - let tuple = self.types_.iter().map(|x| x.to_string()).collect::>().join(", "); - - write!(f, "({})", tuple) - } -} diff --git a/input/src/types/type_.rs b/input/src/types/type_.rs deleted file mode 100644 index 605f919f1d..0000000000 --- a/input/src/types/type_.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, types::*}; - -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_))] -pub enum Type<'ast> { - Basic(DataType), - Array(ArrayType<'ast>), - Tuple(TupleType<'ast>), -} - -impl<'ast> fmt::Display for Type<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - Type::Basic(ref basic) => write!(f, "{}", basic), - Type::Array(ref array) => write!(f, "{}", array), - Type::Tuple(ref tuple) => write!(f, "{}", tuple), - } - } -} diff --git a/input/src/types/unsigned_integer_type.rs b/input/src/types/unsigned_integer_type.rs deleted file mode 100644 index 819bb372de..0000000000 --- a/input/src/types/unsigned_integer_type.rs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::Rule; - -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_integer_unsigned))] -pub enum UnsignedIntegerType { - U8Type(U8Type), - U16Type(U16Type), - U32Type(U32Type), - U64Type(U64Type), - U128Type(U128Type), -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_u8))] -pub struct U8Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_u16))] -pub struct U16Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_u32))] -pub struct U32Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_u64))] -pub struct U64Type {} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::type_u128))] -pub struct U128Type {} - -impl fmt::Display for UnsignedIntegerType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - UnsignedIntegerType::U8Type(_) => write!(f, "u8"), - UnsignedIntegerType::U16Type(_) => write!(f, "u16"), - UnsignedIntegerType::U32Type(_) => write!(f, "u32"), - UnsignedIntegerType::U64Type(_) => write!(f, "u64"), - UnsignedIntegerType::U128Type(_) => write!(f, "u128"), - } - } -} diff --git a/input/src/values/address.rs b/input/src/values/address.rs deleted file mode 100644 index becdf5f31f..0000000000 --- a/input/src/values/address.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::{span_into_string, Rule}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::address))] -pub struct Address<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for Address<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.value) - } -} diff --git a/input/src/values/address_typed.rs b/input/src/values/address_typed.rs deleted file mode 100644 index 17e678e86c..0000000000 --- a/input/src/values/address_typed.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, types::AddressType, values::address::Address}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::address_typed))] -pub struct AddressTyped<'ast> { - pub type_: AddressType, - pub address: Address<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for AddressTyped<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "address({})", self.address) - } -} diff --git a/input/src/values/address_value.rs b/input/src/values/address_value.rs deleted file mode 100644 index 6134c41278..0000000000 --- a/input/src/values/address_value.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - values::{Address, AddressTyped}, -}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::value_address))] -pub enum AddressValue<'ast> { - Implicit(Address<'ast>), - Explicit(AddressTyped<'ast>), -} - -impl<'ast> AddressValue<'ast> { - pub(crate) fn span(&self) -> &Span<'ast> { - match self { - AddressValue::Implicit(address) => &address.span, - AddressValue::Explicit(address) => &address.span, - } - } -} - -impl<'ast> fmt::Display for AddressValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - AddressValue::Explicit(address) => write!(f, "{}", address), - AddressValue::Implicit(address) => write!(f, "{}", address), - } - } -} diff --git a/input/src/values/boolean_value.rs b/input/src/values/boolean_value.rs deleted file mode 100644 index 769cddd049..0000000000 --- a/input/src/values/boolean_value.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::{span_into_string, Rule}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_boolean))] -pub struct BooleanValue<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for BooleanValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.value) - } -} diff --git a/input/src/values/char_types.rs b/input/src/values/char_types.rs deleted file mode 100644 index e6725cf08e..0000000000 --- a/input/src/values/char_types.rs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::{span_into_string, Rule}, - errors::InputParserError, -}; - -use pest::Span; -use pest_ast::FromPest; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::basic_char))] -pub struct BasicChar<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::escaped_char))] -pub struct EscapedChar<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::hex_char))] -pub struct HexChar<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::unicode_char))] -pub struct UnicodeChar<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::char_types))] -pub enum CharTypes<'ast> { - Basic(BasicChar<'ast>), - Escaped(EscapedChar<'ast>), - Hex(HexChar<'ast>), - Unicode(UnicodeChar<'ast>), -} - -impl<'ast> CharTypes<'ast> { - pub fn span(&self) -> &Span<'ast> { - match self { - CharTypes::Basic(value) => &value.span, - CharTypes::Escaped(value) => &value.span, - CharTypes::Hex(value) => &value.span, - CharTypes::Unicode(value) => &value.span, - } - } -} - -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum Char { - Scalar(char), - NonScalar(u32), -} - -impl<'ast> CharTypes<'ast> { - pub fn inner(self) -> Result { - match self { - Self::Basic(character) => { - if let Some(character) = character.value.chars().next() { - return Ok(Char::Scalar(character)); - } - - Err(InputParserError::invalid_char(character.value, &character.span)) - } - Self::Escaped(character) => { - if let Some(inner) = character.value.chars().nth(1) { - return match inner { - '0' => Ok(Char::Scalar(0 as char)), - 't' => Ok(Char::Scalar(9 as char)), - 'n' => Ok(Char::Scalar(10 as char)), - 'r' => Ok(Char::Scalar(13 as char)), - '\"' => Ok(Char::Scalar(34 as char)), - '\'' => Ok(Char::Scalar(39 as char)), - '\\' => Ok(Char::Scalar(92 as char)), - _ => Err(InputParserError::invalid_char(character.value, &character.span)), - }; - } - - Err(InputParserError::invalid_char(character.value, &character.span)) - } - Self::Hex(character) => { - let hex_string_number = character.value[2..character.value.len()].to_string(); - if let Ok(number) = u8::from_str_radix(&hex_string_number, 16) { - if number <= 127 { - return Ok(Char::Scalar(number as char)); - } - } - - Err(InputParserError::invalid_char(character.value, &character.span)) - } - Self::Unicode(character) => { - let unicode_string_number = character.value[3..=character.value.len() - 2].to_string(); - if let Ok(hex) = u32::from_str_radix(&unicode_string_number, 16) { - if let Some(unicode) = std::char::from_u32(hex) { - return Ok(Char::Scalar(unicode)); - } else if hex <= 0x10FFFF { - return Ok(Char::NonScalar(hex)); - } - } - - Err(InputParserError::invalid_char(character.value, &character.span)) - } - } - } -} diff --git a/input/src/values/char_value.rs b/input/src/values/char_value.rs deleted file mode 100644 index 4389150142..0000000000 --- a/input/src/values/char_value.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, values::CharTypes}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_char))] -pub struct CharValue<'ast> { - pub value: CharTypes<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for CharValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self.value) - } -} diff --git a/input/src/values/field_value.rs b/input/src/values/field_value.rs deleted file mode 100644 index f3bc21ebb4..0000000000 --- a/input/src/values/field_value.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, types::FieldType, values::NumberValue}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_field))] -pub struct FieldValue<'ast> { - pub number: NumberValue<'ast>, - pub type_: FieldType, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for FieldValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.number) - } -} diff --git a/input/src/values/group_coordinate.rs b/input/src/values/group_coordinate.rs deleted file mode 100644 index 70217b85cf..0000000000 --- a/input/src/values/group_coordinate.rs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, values::NumberValue}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::group_coordinate))] -pub enum GroupCoordinate<'ast> { - Number(NumberValue<'ast>), - SignHigh(SignHigh<'ast>), - SignLow(SignLow<'ast>), - Inferred(Inferred<'ast>), -} - -impl<'ast> GroupCoordinate<'ast> { - pub fn span(&self) -> &Span<'ast> { - match self { - GroupCoordinate::Number(number) => number.span(), - GroupCoordinate::SignHigh(sign_high) => &sign_high.span, - GroupCoordinate::SignLow(sign_low) => &sign_low.span, - GroupCoordinate::Inferred(inferred) => &inferred.span, - } - } -} - -impl<'ast> fmt::Display for GroupCoordinate<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - GroupCoordinate::Number(number) => write!(f, "{}", number), - GroupCoordinate::SignHigh(_) => write!(f, "+"), - GroupCoordinate::SignLow(_) => write!(f, "-"), - GroupCoordinate::Inferred(_) => write!(f, "_"), - } - } -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::sign_high))] -pub struct SignHigh<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::sign_low))] -pub struct SignLow<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::inferred))] -pub struct Inferred<'ast> { - #[pest_ast(outer())] - pub span: Span<'ast>, -} diff --git a/input/src/values/group_value.rs b/input/src/values/group_value.rs deleted file mode 100644 index bc4c72eb17..0000000000 --- a/input/src/values/group_value.rs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - types::GroupType, - values::{GroupCoordinate, NumberValue}, -}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_group))] -pub struct GroupValue<'ast> { - pub value: GroupRepresentation<'ast>, - pub type_: GroupType, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for GroupValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.value) - } -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::group_single_or_tuple))] -pub enum GroupRepresentation<'ast> { - Single(NumberValue<'ast>), - Tuple(GroupTuple<'ast>), -} - -impl<'ast> fmt::Display for GroupRepresentation<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - GroupRepresentation::Single(number) => write!(f, "{}", number), - GroupRepresentation::Tuple(tuple) => write!(f, "{}", tuple), - } - } -} - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::group_tuple))] -pub struct GroupTuple<'ast> { - pub x: GroupCoordinate<'ast>, - pub y: GroupCoordinate<'ast>, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for GroupTuple<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "({}, {})", self.x, self.y) - } -} diff --git a/input/src/values/integer_value.rs b/input/src/values/integer_value.rs deleted file mode 100644 index 9e1004a929..0000000000 --- a/input/src/values/integer_value.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - values::{SignedIntegerValue, UnsignedIntegerValue}, -}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_integer))] -pub enum IntegerValue<'ast> { - Signed(SignedIntegerValue<'ast>), - Unsigned(UnsignedIntegerValue<'ast>), -} - -impl<'ast> IntegerValue<'ast> { - pub fn span(&self) -> &Span<'ast> { - match self { - IntegerValue::Signed(integer) => &integer.span, - IntegerValue::Unsigned(integer) => &integer.span, - } - } -} - -impl<'ast> fmt::Display for IntegerValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - IntegerValue::Signed(integer) => write!(f, "{}", integer), - IntegerValue::Unsigned(integer) => write!(f, "{}", integer), - } - } -} diff --git a/input/src/values/mod.rs b/input/src/values/mod.rs deleted file mode 100644 index 1ba8019df1..0000000000 --- a/input/src/values/mod.rs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -pub mod address; -pub use address::*; - -pub mod address_typed; -pub use address_typed::*; - -pub mod address_value; -pub use address_value::*; - -pub mod boolean_value; -pub use boolean_value::*; - -pub mod char_types; -pub use char_types::*; - -pub mod char_value; -pub use char_value::*; - -pub mod field_value; -pub use field_value::*; - -pub mod group_coordinate; -pub use group_coordinate::*; - -pub mod group_value; -pub use group_value::*; - -pub mod integer_value; -pub use integer_value::*; - -pub mod negative_number; -pub use negative_number::*; - -pub mod number_value; -pub use number_value::*; - -pub mod positive_number; -pub use positive_number::*; - -pub mod signed_integer_value; -pub use signed_integer_value::*; - -pub mod value; -pub use value::*; - -pub mod unsigned_integer_value; -pub use unsigned_integer_value::*; diff --git a/input/src/values/negative_number.rs b/input/src/values/negative_number.rs deleted file mode 100644 index 704580fb9e..0000000000 --- a/input/src/values/negative_number.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::{span_into_string, Rule}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::number_negative))] -pub struct NegativeNumber<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for NegativeNumber<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.value) - } -} diff --git a/input/src/values/number_value.rs b/input/src/values/number_value.rs deleted file mode 100644 index 2071dca1a3..0000000000 --- a/input/src/values/number_value.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - values::{NegativeNumber, PositiveNumber}, -}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_number))] -pub enum NumberValue<'ast> { - Negative(NegativeNumber<'ast>), - Positive(PositiveNumber<'ast>), -} - -impl<'ast> NumberValue<'ast> { - pub fn span(&self) -> &Span<'ast> { - match self { - NumberValue::Negative(number) => &number.span, - NumberValue::Positive(number) => &number.span, - } - } -} - -impl<'ast> fmt::Display for NumberValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - NumberValue::Negative(number) => write!(f, "{}", number), - NumberValue::Positive(number) => write!(f, "{}", number), - } - } -} diff --git a/input/src/values/positive_number.rs b/input/src/values/positive_number.rs deleted file mode 100644 index 9ccf38cff2..0000000000 --- a/input/src/values/positive_number.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::ast::{span_into_string, Rule}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::number_positive))] -pub struct PositiveNumber<'ast> { - #[pest_ast(outer(with(span_into_string)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for PositiveNumber<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.value) - } -} diff --git a/input/src/values/signed_integer_value.rs b/input/src/values/signed_integer_value.rs deleted file mode 100644 index acd4301c0e..0000000000 --- a/input/src/values/signed_integer_value.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, types::SignedIntegerType, values::NumberValue}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_integer_signed))] -pub struct SignedIntegerValue<'ast> { - pub number: NumberValue<'ast>, - pub type_: SignedIntegerType, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for SignedIntegerValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.number) - } -} diff --git a/input/src/values/unsigned_integer_value.rs b/input/src/values/unsigned_integer_value.rs deleted file mode 100644 index 7b0193069c..0000000000 --- a/input/src/values/unsigned_integer_value.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ast::Rule, types::UnsignedIntegerType, values::PositiveNumber}; - -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq, Eq)] -#[pest_ast(rule(Rule::value_integer_unsigned))] -pub struct UnsignedIntegerValue<'ast> { - pub number: PositiveNumber<'ast>, - pub type_: UnsignedIntegerType, - #[pest_ast(outer())] - pub span: Span<'ast>, -} - -impl<'ast> fmt::Display for UnsignedIntegerValue<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.number) - } -} diff --git a/input/src/values/value.rs b/input/src/values/value.rs deleted file mode 100644 index 993d5ee04b..0000000000 --- a/input/src/values/value.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2019-2021 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::{ - ast::Rule, - values::{BooleanValue, CharValue, FieldValue, GroupValue, IntegerValue, NumberValue}, -}; - -use crate::values::AddressValue; -use pest::Span; -use pest_ast::FromPest; -use std::fmt; - -#[derive(Clone, Debug, FromPest, PartialEq)] -#[pest_ast(rule(Rule::value))] -pub enum Value<'ast> { - Address(AddressValue<'ast>), - Boolean(BooleanValue<'ast>), - Char(CharValue<'ast>), - Field(FieldValue<'ast>), - Group(GroupValue<'ast>), - Implicit(NumberValue<'ast>), - Integer(IntegerValue<'ast>), -} - -impl<'ast> Value<'ast> { - pub fn span(&self) -> &Span<'ast> { - match self { - Value::Address(value) => value.span(), - Value::Boolean(value) => &value.span, - Value::Char(value) => &value.span, - Value::Field(value) => &value.span, - Value::Group(value) => &value.span, - Value::Implicit(value) => value.span(), - Value::Integer(value) => value.span(), - } - } -} - -impl<'ast> fmt::Display for Value<'ast> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - Value::Address(ref value) => write!(f, "{}", value), - Value::Boolean(ref value) => write!(f, "{}", value), - Value::Char(ref value) => write!(f, "{}", value), - Value::Field(ref value) => write!(f, "{}", value), - Value::Group(ref value) => write!(f, "{}", value), - Value::Implicit(ref value) => write!(f, "{}", value), - Value::Integer(ref value) => write!(f, "{}", value), - } - } -} diff --git a/leo/commands/build.rs b/leo/commands/build.rs index 3161d24f7b..47d84c3c88 100644 --- a/leo/commands/build.rs +++ b/leo/commands/build.rs @@ -18,8 +18,9 @@ use crate::{commands::Command, context::Context}; use leo_compiler::Compiler; use leo_errors::{CliError, Result}; use leo_package::{ - inputs::*, - outputs::{ChecksumFile, CircuitFile, OutputsDirectory, OUTPUTS_DIRECTORY_NAME}, + // inputs::*, + // outputs::CircuitFile + outputs::{ChecksumFile, OutputsDirectory, OUTPUTS_DIRECTORY_NAME}, source::{MainFile, MAIN_FILENAME, SOURCE_DIRECTORY_NAME}, }; @@ -93,6 +94,7 @@ pub struct BuildOptions { #[derive(StructOpt, Debug)] #[structopt(setting = structopt::clap::AppSettings::ColoredHelp)] pub struct Build { + #[allow(dead_code)] #[structopt(flatten)] pub(crate) compiler_options: BuildOptions, } @@ -178,7 +180,7 @@ impl Command for Build { // Initialize error handler let handler = leo_errors::emitter::Handler::default(); - let program = Compiler::new(&handler, main_file_path); + let program = Compiler::new(&handler, main_file_path, output_directory); // Compute the current program checksum let program_checksum = program.checksum()?; diff --git a/leo/main.rs b/leo/main.rs index 483a0a3409..baf29ad926 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -29,7 +29,7 @@ use commands::{ // Deploy, Init, Lint, New, Prove, Run, Setup, Test, Update, Watch, }; use leo_errors::Result; -use snarkvm_utilities::Write; +// use snarkvm_utilities::Write; use std::{path::PathBuf, process::exit}; use structopt::{clap::AppSettings, StructOpt}; diff --git a/leo/tests/mod.rs b/leo/tests/mod.rs index b4f94c2b4d..c5c55e600b 100644 --- a/leo/tests/mod.rs +++ b/leo/tests/mod.rs @@ -15,9 +15,9 @@ // along with the Leo library. If not, see . use leo_errors::Result; -use std::path::PathBuf; +// use std::path::PathBuf; -use crate::{ +/* use crate::{ commands::{ // package::{Login, Logout}, Build, @@ -25,11 +25,11 @@ use crate::{ // Prove, Run, Setup, Test, }, context::{create_context, Context}, -}; +}; */ /// Path to the only complex Leo program that we have /// - relative to source dir - where Cargo.toml is located -const PEDERSEN_HASH_PATH: &str = "./examples/pedersen-hash/"; +// const PEDERSEN_HASH_PATH: &str = "./examples/pedersen-hash/"; #[test] pub fn init_logger() -> Result<()> { @@ -218,10 +218,10 @@ pub fn format_event() -> Result<()> { // Ok(()) // } -/// Create context for Pedersen Hash example -fn context() -> Result { +// /// Create context for Pedersen Hash example +/* fn context() -> Result { let path = PathBuf::from(&PEDERSEN_HASH_PATH); let context = create_context(path, None)?; Ok(context) -} +} */ diff --git a/parser/Cargo.toml b/parser/Cargo.toml index e3556c89b5..01626ee58e 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -2,7 +2,7 @@ name = "leo-parser" version = "1.5.3" authors = [ "The Aleo Team " ] -description = "AST generated by pest from the Leo grammar rules" +description = "Leo parser" homepage = "https://aleo.org" repository = "https://github.com/AleoHQ/leo" keywords = [ @@ -34,10 +34,6 @@ version = "1.5.3" path = "../errors" version = "1.5.3" -[dependencies.leo-input] -path = "../input" -version = "1.5.1" - [dependencies.leo-span] path = "../span" version = "1.5.3" @@ -72,6 +68,9 @@ features = [ "preserve_order" ] [dev-dependencies.serde_yaml] version = "0.8" +[dev-dependencies.structopt] +version = "0.3" + [features] default = [ ] ci_skip = [ ] diff --git a/parser/benches/large_1.leo b/parser/benches/large_1.leo new file mode 100644 index 0000000000..635870ffe0 --- /dev/null +++ b/parser/benches/large_1.leo @@ -0,0 +1,291 @@ +type g8SH = u8; + +type V8fkp = u128; + +const vxlan = 13658i16; + + +circuit sylcl { + bTxd7: bool, + tfTQr: bool, + l_Dfk: u32, + YDbf: address, +} + + +function xGEs ( + const GEF7g: i32, + eLHo5: i64 +) -> i64 { + let bx6u = vRAg().0; + let rasm: L9Snz = L9Snz {}; + let os4Ds: u128 = GzzO {RAyvy: '\u{6c495}', SGgTI: 3364i16, egtP: 45362813883629178786173234355737419504u128, AWm8P: '?'}.egtP; + os4Ds -= os4Ds; + os4Ds /= 255906798014072409735665528987467201281u128; + os4Ds /= 99955633017584705512543248634901668143u128; + if -49 < 74i8 || 6832u16 < 10718 { + if 59 == 214u8 && eLHo5 > 7620307708530543535i64 { + let oiM6V: i16 = vxlan; + } + bx6u -= bx6u; + if 246u8 >= 109u8 && eLHo5 == 1907427762104562352i64 { + let mcFo = -22613i16; + mcFo *= 0i16; + let gVku = GEF7g; + let RzrP = false; + RzrP = RzrP; + const pMb5 = L9Snz {}; + } + let FZVVE: char = L9Snz {}.lVSr(aleo1l44kg5uyj8psnfx76reyfwxltrxgn9jmum854grpjyal2rmjmg9qdsl3ch, -60, 95u8).2; + let GDk3: bool = true; + const ZHf8: bool = [[16281139673755659036u64; (2, 1)], [6465961370876558468u64; (2, 1)], [[8138243358139830344u64], [3000896053881090062u64; 1]]] == [[7249604088430675863u64; (2, 1)], [13296609702861980977u64; (2, 1)], [3670298495564722569u64; (2, 1)]] && 116u8 > 246u8; + os4Ds -= os4Ds; + os4Ds = os4Ds; + } else if 93 != 7u8 || GEF7g < GEF7g { + rasm = L9Snz {}; + let m8V0a: u16 = 6407; + for YbMQ in 4091427659..4091427666 { + m8V0a *= 0; + bx6u = bx6u; + os4Ds += os4Ds; + rasm = rasm; + } + let nS4e: i8 = L9Snz {}.lVSr(aleo1ryu48sn5dx2gzlj0ua2dwyr46vedrrquhgxy8pnz6573rv8yqvpsmf6yzw, -77i8, true? 192u8 : 85).1; + let jVsd: u32 = 3917661453u32; + } else { + const sj7Zv: field = 6936563642754163774323863008557263080068986485051214421772383532120071479321376198608464936088274231279486051362571687204548709195936208048652073445197732field; + let VVDV = vxlan; + let km18x = sj7Zv; + if 15299435342099296908u64 >= 10738044447347729216u64 && rasm.lVSr(aleo1ckzy8audkf2p6ve2u0040gvrk6mx9n0v088a3yc5x6rxmlv0pgxser0gzf, -31i8, 118u8).0 > 1395837987u32 { + if GEF7g <= GEF7g && ('\u{4133d}', 4990i16, aleo103cz6xcutagglr2e0rd0a46fnxxe6snfy05xqlardpanh4xjzqzqdkqpdz, os4Ds) != ('\u{7d}', VVDV * -2 - -25042i16, aleo10aandr8pvdg247lkmhqx0aef5ne4qlta245aynk80s4apydu559qcejjfl, 14813985053938346415046704789243138087u128) { + bx6u += 14534558459111474236125164661730846152; + VVDV /= vxlan; + let AiteH: i32 = GEF7g; + const seLUa: u16 = 23669u16; + rasm = L9Snz {}; + } else if 159041408574150617959504640080391229811i128 <= bx6u || [14520, -14785i16, 3573i16] != [27584i16; 3] || VVDV > (false? 13752 : VVDV) { + let xcvaS: field = 9495245829840311343768687500773412503474341293258678863329364855536358225067251860919673558180589446104317770373242242395342021886202312053663829628088260field; + const aYuS: u32 = 3607927114u32; + } else { + km18x -= BHZjx(true, false, -55i8); + bx6u += 34857824809713610052533673270581503998; + let F6K4N: u128 = 47882796570533061725516167600161938873u128; + L9Snz::PC0R(aleo10kumj5drme862697k98qnjn4dfxgry0keh55ad7hqgf5l9l23urquakjcx, 12113665486601200705u64 - (3034261385238854337 - 11626787452540944465 / 17758492766977014633u64 * 0u64 - 826119920202656664) + 10861478653900843501u64 / 11072739276507297001u64); + } + let vIMt: i8 = -44i8; + km18x += km18x; + let q3qEF = aleo1qq4psjpe72kuwc2fs4rrerd5rxd09p90p6x3h9rwnzyl889f95xq00uatz; + } else if 208u8 - 186 * 11 ** 0 + 111u8 == 177 || 7877i16 >= (false? vxlan : vxlan) { + let NYB27 = GEF7g; + L9Snz::PC0R(aleo1egfcvnawsy6hs0nc7pjl4s5ne4k7n60luu4ratkk208fal5dpvpqun3hym, 12155192664761333265); + let nfZC: u64 = 6057621151098931675u64; + const fwAeC: i128 = 96615783596569824584153535316491335220i128; + } else { + let c4S4V: [i32; 1] = [GEF7g]; + let hFQ1: char = '~'; + } + } + const W6AoN: L9Snz = L9Snz {}; + let zTGI: i64 = -4719638564784287794i64; + const ZarBp: g8SH = 43u8; + zTGI /= -4717776493235566297; + const s2IF: u16 = 54046u16; + let jEEwx: u32 = 2740345586; + let GYYkA: field = 11582113721009926081533744146578992580659382705948021135670314230777109797210071657532235986079542543588709204398834785431450613982848535394935363785557969field; + return eLHo5; +} + +circuit L9Snz { + + function PC0R ( + const jevo: address, + const PAVFU: u64 + ) { + const wiN0: i32 = -1258333968i32; + const lB0z_: i64 = 6195651560731392364i64; + const RMYXZ = lB0z_; + const uY6e: i8 = 90i8; + let m8v8: field = 1849045753805757079652732186700785301303603036928207700497640417309568558821969407937357366825028145150583808761466176190254377612596882180695831089782965; + let VggtJ: u128 = 329104773346716025207789897721050367019u128; + if -1190335173i32 - -1745345851i32 - wiN0 == 893384766 && (3950594431634582299294459077719375579440093722520345117175266254520038272680996320138725015909501750733428689005679387750685637768487056421097594765772537, 3108834599765871073, false) == (m8v8, PAVFU, true) { + m8v8 += m8v8; + let Ht_o5: i128 = -126434771302556954181557991774406279580i128; + for ePzN in 1513798056u32..1513798074u32 { + const v5KBA: i32 = -126706873i32; + let N9Me: bool = false; + } + if 19850u16 <= 62489 || jevo != aleo1prwdx2qgu22n582kpgrg2a0kluftlsvust0q5xc0a27td7ufuy8su0g8tc && 254u8 != 117u8 { + m8v8 += m8v8; + Ht_o5 /= 11553847366431664216173263832376498087; + let mRGK5: Self = Self {}; + let Skij = (55323u16, 126908632682311371168460144412966650831u128); + m8v8 *= m8v8; + let Ob5d = 2249779739u32; + } else if 43071 <= 13140u16 || 42i8 <= uY6e && VggtJ != 154955034616989135434658403414435434895u128 { + Ht_o5 += -6518746069029094677594415956468576403; + if -5143 == vxlan || lB0z_ <= RMYXZ && VggtJ != VggtJ { + VggtJ /= 157415906375046026780197645612102072420 + VggtJ / 200052657326939673132260906854658100686u128; + Ht_o5 = Ht_o5; + VggtJ /= VggtJ; + let FEcY: address = jevo; + let Ir2a = 500071970u32 ** 1u32 / 1327371589u32 * 2234521563u32 ** 1u32; + const H_Wk = 140u8; + Ht_o5 *= 1i128; + let dgMO: Self = L9Snz {}; + } else if [(82i8, (168959946214662978530327896234211537106u128, (false, 12427427169985374723u64, -31456683461208515088456471787726297252i128, 56i8), (4908752618911443246697506192699588067797133636811902421444208448276619938465397710091372538939536414834528928690449062642613610859703225105481852391756372, '\u{706ea}', 4110780615))); 3] != [(7i8, (159139823899295607358682071997551895501u128, (true, 7477239449005644245u64, -98086754633827235468560233858202930964i128, -37i8), (8339532360997214503380546868946290675233376404602181916084341884293192858826000124252309397076808078470262081187984894041055791561714485960939858801444598field, 'K', 541080119u32))); 3] || aleo1v2tk5snmzp4f63c2tess4jgrppvh9amhtceknqg0lnwzpxreucqszqllch != jevo || 12504227462827476074631665974540786136397624300384090157368248825104544021070628315696049833177009832750518440263927963531548326394629426013067610843273555field != m8v8 { + VggtJ += 8257065096993585333727606071356438242u128; + VggtJ -= VggtJ; + } + let omLT = VggtJ; + const ld6U = 37u8; + const vk_Q: char = '\u{eee33}'; + let qbiu = PAVFU; + } else { + const jM_M: address = aleo1sxg244usp0cx2vtdtacgm3vfayw228ga09faemh2q6tlej20fugsfa4zlc; + m8v8 += m8v8; + let O90S: char = '\u{49}'; + let fFzmH: i8 = -105i8; + O90S = O90S; + let hq5x: u8 = 181; + const uZWn = aleo1w5njju0sa75nql82pld5uhz52hu3dw4st6cyx03ssvnxrs8ctsrqzntzjx; + const FAjJc = 99u8; + VggtJ += 994150734172258795168679886244864026u128; + } + let IphzC: char = '\x40'; + let amRFn: u64 = 7564051209867924479u64; + amRFn += amRFn; + m8v8 += 1347255737663462458814024878372058932536755071869327526992498831547110157173; + } + const yLQS4 = -55550312298071716641145606375319507761i128; + VggtJ += 1382746757304325437648861664794573230; + //RETURN + } + + function lVSr ( + &self, + const VPWYz: address, + const ADX7z: i8, + const MHWK: g8SH + ) -> ( + u32, + i8, + char + ) { + const eE25S = -3822011864922848919i64; + let uxka: u16 = 31601u16; + uxka += uxka; + if uxka <= 54663 || 73004126144557259973298592729951019722u128 >= ([93797552382304599553760067286520681501u128; 1], 4172437329985364529i64, '\n').0[0..][2624001942 / 1517112597 / 1355807694u32 * 2889503665u32 ** 1] { + const lApV: field = 6481943367152243104806590714680752346978771244964332374740256234629614754980878356122381536407948609474900709582949603889949969672871965127817496727202767; + let cGWZP: u128 = 297768269069440894845608851567366910735u128; + self = self; + cGWZP -= cGWZP; + cGWZP *= cGWZP; + let LtjA: i128 = -22748455429796320857927085170522829329i128; + } else if 6360448123073416118i64 == eE25S && '\u{34641}' == '\u{7}' { + self = L9Snz {}; + } else { + uxka = uxka; + let FuVKM = vxlan; + uxka -= 97393095744128946381012954133028907306 != 255951602883594918442095360688675180909u128 || 17905u16 != uxka && VPWYz == VPWYz? false? 44721 : uxka : uxka; + } + uxka -= uxka; + let KUdYh: i16 = vxlan; + KUdYh /= vxlan; + KUdYh *= vxlan; + let VFAW = false; + return (1316647196u32, 37i8, '\x30'); + } +} + + +function main ( + y8dPm: u64, + sGaj: field +) { + let BYEm7: i8 = 97i8; + let hKmDf: address = aleo1m253gg39f4cwwud8sknlks2cn26v9sf9479l0yncaq5ukjxqzyzq2xxsnk; + const HZ9fX: u64 = 16202246012581085813u64 / 12465500443043502478u64 - (true? 15981860521684494965u64 : 6911258910006412467u64) * 0u64 * 0u64; + hKmDf = hKmDf; + hKmDf = hKmDf; + //RETURN +} + +function BHZjx ( + const nxhfV: bool, + OZNlW: bool, + const jOC4: i8 +) -> field { + let y7gf: field = 3130031617100883476569946236122797668194325421420005827215337287002604866213025267543520081466666132894801153349496723370271679207682862665770825319434816field; + L9Snz::PC0R(aleo14zwmfwd9he3v4hjw2r7q2ctskzgjh6dwf9kc7k30l693n3jgpgpsk5yu78, 9446428592253181660); + let GlSb = y7gf; + let WUY_d: ((u32, u16, (g8SH, i16, field), u64), (u16, bool, i16)) = ((526471171u32, 7788, (19, 32726, 3434891954732353975444046757534090600268209052607533063785913738816065601863253991997648873003147300684388051350506871325750697070337976614620994165271278), 7922971368721996438u64), (50902, false, -20508i16)); + GlSb = y7gf; + WUY_d.0.3 = WUY_d.0.3; + WUY_d.0.1 += WUY_d.0.1; + const Sc7C9: [u32; 1] = nxhfV? [874307396; 1] : [2630291403u32]; + WUY_d.0.2.0 = WUY_d.0.2.0; + let ycp91: char = '\x14'; + const DM0j: u128 = 331905196230135311940900941762579610102u128; + return WUY_d.0.2.2; +} + +circuit GzzO { + RAyvy: char, + SGgTI: i16, + AWm8P: char, + egtP: u128, +} + + +function D_6P (w9AC: L9Snz) -> ( + u32, + ((i8, g8SH, i16), [char; 3], L9Snz, field), + i32 +) { + const WWMs4: i128 = -6788181107836913317896185434758313415i128; + const vv_n: u8 = (60u8, 16982434322799018778u64, -22964401300164128577831495677249421197i128, -481530683i32).0; + const xHZT: i64 = -7542558825982757778; + let RA0L4 = 2253591488u32; + const JzkI: u128 = 51423136685081598067078208885837881611u128; + RA0L4 *= 0; + L9Snz::PC0R(aleo1ghg8n2kv59k7waylx9pu2juxe78khyq5mxqx4swk86wm6nld9cpszerza4, 14748858242389516977); + let gZid: sylcl = sylcl {bTxd7: true, YDbf: aleo1r42wfxvqg6h2r8sxazq332sd4fxc4ftvg0q0zsveptrcykd7syxswwf3au, l_Dfk: RA0L4, tfTQr: true}; + gZid.bTxd7 = gZid.bTxd7; + let qjKhR: u32 = 2925082278u32; + let EJISu = BHZjx(true, true, -71i8); + if 3985509016058024290 == 9147622246534204847u64 || EJISu + EJISu / EJISu - EJISu + BHZjx(false, gZid.tfTQr, 96i8) * EJISu != EJISu && JzkI != JzkI { + gZid = sylcl {l_Dfk: qjKhR, tfTQr: true, YDbf: gZid.YDbf, bTxd7: gZid.tfTQr}; + const p36lW = [(-814427734842719938i64, 5339320581377470661u64, 294113937729276405578547191689392764549u128); 4]; + gZid.l_Dfk -= RA0L4; + let VsEWm = gZid.bTxd7; + gZid.l_Dfk **= 1u32; + const EJGTh: field = 5561661189369667961686502997982535065877055308324648778039167906404275824028130538460917576931123645230444575965776072667677113915103516873246679748569999; + EJISu /= EJISu; + return (L9Snz {}.lVSr(aleo1r20fxtjjsq4cmcz0tvc69442g3x3amd7m79ds400q4vqrqy4gsrsap5q7y, -32, vv_n).0, ((-114i8, vv_n, 10216i16), [L9Snz {}.lVSr(aleo1263sz4dh99ch5arrgk9rqju8vm3vv889c5r9w85p3wmjwmtadu9qzqa7vk, 92, vv_n).2; 3], w9AC, EJGTh), -1086114968i32); + } else if 18247u16 != 2832u16 && -2070179985i32 >= -832203371i32 || 2108854800u32 > RA0L4 { + const nmbh: u32 = 1251166277u32; + let SsR5h = gZid.l_Dfk; + let HVAa = w9AC; + return (3766010195u32, ((-105i8, 162u8, 26251), ['\u{4e}'; 3], L9Snz {}, 3783102502099847461136024093398414597616258289790210683307756458700958277778997744007793644412769648771201890253252209457549966246727682027693578962905328), 1405827686i32); + } else { + EJISu /= EJISu; + const ecan: bool = false; + return (RA0L4, ((73i8, 67u8, -28746i16), ['\\'; 3], L9Snz {}, 9939607077961044954502119705805750533325928371640903562794817944828499108518903389133383383289034846905481326089002555501553000756689627524145002624427458field), -1889793240i32); + } +} + +function vRAg () -> ( + i128, + (address, u16) +) { + let na_U: bool = false; + let sa7tL: [bool; 2] = [true; 2]; + sa7tL[..2u32] = na_U? sa7tL : sa7tL[0..2u32]; + const bZ3_ = (5062121477657524756691001991959148343560642547664575296025469558174877724273997732296925246044794229476666182584113489143775657972780129591419547290910023field, '\u{5516b}'); + sa7tL[0] = sa7tL[0u32..][1u32]; + const FAXX: i128 = 82723903814286642271212537939014048713; + const kENpX = aleo100khm587cspwmcafftyythvamha9z4gqrmne8hq5zqetyg3xmcpqmsjrhg; + const Sr1Ln: address = kENpX; + sa7tL = sa7tL; + return (-65993239589993742548447387951590481703, (aleo1t0r4zqurd4tkr8dqjhwk0ckzpdd7690v79f5xrstwa597u6qqspsazrgcp, 23506)); +} \ No newline at end of file diff --git a/parser/benches/large_2.leo b/parser/benches/large_2.leo new file mode 100644 index 0000000000..3743951fd6 --- /dev/null +++ b/parser/benches/large_2.leo @@ -0,0 +1,396 @@ +type JzT3X = t5RQ; + +type RaEnk = JzT3X; + +type qQAv = i64; + +type lLyE = VdqTF; + +type m1ys8 = address; + +const nI8f: (bool, u128) = (false, 138624358552358706580496409244518932936u128); + + +const JtPat: u8 = 22u8; + + +function HnaR ( + ONK5A: field, + jxBI: i16 +) -> ( + i32, + (i16, [i16; 3], i64, u16), + bool, + [address; 2] +) { + let UiOY: u8 = 197; + const uqDfG = 244u8; + if 14 * -7i8 * 1 > 36 && UiOY == 50 { + const Nsof: u16 = 61299u16; + const xQG2 = (-78677041305034957029235253770237774612i128, Nsof); + UiOY = 61u8; + } else { + UiOY *= 0; + } + let xABE: address = aleo18na4r4tmlh5fgmznsxvfx2edplc0l6qgtvrsx632qjq02z8xc5xsx62fcr; + const k7_5F = 46213u16; + let VoTi: bool = false; + return (-189603432, (28990, [-1892i16; 3], -3751793658146050073, 53730), true, [aleo1mz2skscve8gq9d9j8lvsd3zmg4ppyewwkfwxxmlr053jjfxejg9sv9frxl; 2]); +} + +function Tw0p (jCQc: char) -> ( + u16, + i128, + u64, + (u16, RaEnk) +) { + let NR_C: JzT3X = t5RQ {}; + let RD1U: field = 3006368756432145027093799683618550726093102506687552253093476217748623071135112833326420434244184050077234188883388733925420743627834963361535348967445941field; + const V1nN = aleo1j9y6cc02tjpljhw3qlgte9y6l4zmxv0tzh386ksvk34m8hzawczqpqgsqr; + let QI4RL: u32 = 4174894181u32; + const wUpD: i8 = -73i8; + let SZPz: u32 = 4125266212u32; + NR_C = NR_C; + const gVoY: lLyE = VdqTF {JkBcA: V1nN, vNAMH: true, qQtCF: 5057}; + const BEcUt = ('\u{8}', -6708122641235748559i64, -2730500549981686507i64); + QI4RL /= QI4RL; + let lH95z: u32 = QI4RL; + return (6810u16, 122075245384760587708883454153053778463i128, 11162326899970246285u64, (15111u16, t5RQ {})); +} + +circuit t5RQ { +} + + +function fGeK (const YKvX: i8) -> u8 { + if YKvX >= YKvX && false && YKvX <= YKvX { + let QEAS: char = '\u{d1290}'; + const PzT2o = (3907343854998883480063214119544699297780621314687237535050680256515848549925979938945863859753374805327386884171897412321471780865498076822115347428113750field, -2127951728i32, 7820691722384525995u64); + } + let zYkk: i128 = -24135032554736812030416370574505501964i128; + const VOer = -22376i16; + zYkk -= zYkk; + zYkk = zYkk; + zYkk -= zYkk; + return 199u8; +} + +circuit q2USj { + GoGV: bool, + aLCN: i32, + E_t6: bool, + qmz3: u8, + + function GOYuA ( + self, + const fY7mJ: Self, + jWmq: u16, + const nwZP: u8 + ) -> ( + [u32; 4], + i64 + ) { + let Avj6N: i32 = fY7mJ.aLCN; + Avj6N = 364107726i32; + const DX9q2 = fY7mJ.qmz3; + if 483103504u32 > 2578589642u32 && aleo1m2cjlkawd5m0zl5rutsguz94y572mjj4u8lnxx2mq8pguhw4dqqsq9vcar == aleo1wnykcamqw5aghz56g8qrz90h7gqpm62zykyefp9vu85yqk2j0sqqachstx { + const IjwUB: u32 = 4065726433u32; + let c17Qz: u16 = jWmq; + const BnL_: u128 = 51761633273380017465434432628428125170u128; + let vxDm: i64 = -5494074842541052547i64; + const lMmJc: field = 125545887137495523397577547635418533381158968954640996668608928671130971517914452783158107876547411564762624046750113283173064518704428534673396909364510field; + } else if [201893701929816058901180594907743208728; 1] == [79982146642254653817983190224958060318u128; 1] && jWmq > jWmq && [aleo1qdck5ln6cpm3llqjk6mvhp6r5xltkv3syww8cfue0j7gwsusrvrqsmlh8h, aleo19cka50c6l7ua5a34lnfwhxlx2hs3jysn7pyuehf69kvv4gjwsqgqz6qzd5, aleo1y8q2w4zh2c7k9ee5fzsyeazyzmynv8wxrl2ec67lsdenhveqeuxsqjcwkp] != [aleo14d9jx649l5feffrk7s3xwyl5p3dz3dn7q2m65vyvg46y76chcqxske4jay; 3] { + let Fzyfc = -22317i16 - -25418i16 + 14121i16; + Avj6N **= 1; + const Ram7m: i32 = fY7mJ.aLCN; + const Jyap: address = aleo1hf5700rcpz68s7fspd25kat2felkmggzddstazkgmu7xt2syug8qu7nkjc; + Fzyfc *= 0; + Avj6N += (Ram7m / Ram7m / -1490396869i32) + self.aLCN * 1; + Avj6N /= self.aLCN; + const PBAT: i64 = -205621369696754507i64; + } else { + const Dqt5E = 995262057u32; + Avj6N -= self.aLCN; + let XJms = 61i8; + const vvOQZ: field = 2097735165804900312999580621838429207407595983420724021671887967978821818938171460938180437319640910570853915289167466089093039844862455656252123826976864field; + let sP0I = (jWmq, '\x76'); + let S9uAD: u8 = fY7mJ.qmz3; + } + let XPlIn = t5RQ {}; + let Dchf: char = '\u{79}'; + const L4mb: [i64; 1] = [(4498224565295528194i64, true).0; 1]; + XPlIn = XPlIn; + return ([688873667u32; 4], -7142513596480754292i64); + } + + function Bchw (&self, const RwPZX: i128) -> ( + u16, + i8, + i16, + i64, + char + ) { + let UYSF: u128 = 262102823998991425630620909427922442176u128; + let E1hjK = 10375244632967105723169088070309024219397254573760531061153053085696174606082038377241096687473895366928875518762523866901404864961733598111880816563280455field; + let e4zkn = '\x32'; + const Tyz9 = aleo1jtjc68kf2x3euxufngq0mm7szwwvhpzugqzk7ej4p4wvhym4cursppgq38; + self.E_t6 = self.GoGV; + return (2520u16, -121i8, 13444i16, -6913886128685393087i64, '\x0c'); + } +} + + +function AXU_S () -> ( + address, + field, + char, + [field; 1] +) { + const tVTY = [203u8; 3]; + let OV1kp = -1213152733781511670i64; + let Xq_tC = VdqTF {vNAMH: false, qQtCF: -3948i16, JkBcA: aleo1vgkk9ymnjhhxe6vmul45rxu8d4g95euafvlqne26km9qr7m42g8qhkxkgf}; + let VIrY = 17593201753785968724348147573543201683u128; + OV1kp -= OV1kp; + const Q4U3S = 27137u16; + let AlH2I: (i128, JzT3X) = (139188993752357605548144436826980887896i128, t5RQ {}); + const Vsvk: char = '1'; + Xq_tC = Xq_tC; + let nf2yj: address = aleo1pyhp5pgv0np0n5pvtr7hg97ukj3hpd33jtpeg8hn08wgr9g49uzqaqxllp; + return (aleo10nxyeq4s5l40wnl2vfl2llw78kgvt5enfeemlggmkkuuqhzqzsgsemhzt9, 10284116216941408283824722444823323169743229072384235793724572129107892255808365407378202665173472895512465558177101917815129958884392467286207303058249836, '🝎', [5251293705195853262669358257210379533137794199696014230716504931515180367833369101390595615074170181388161695941210696920452345567559460763086722252516477; 1]); +} + +function mH2Y9 (iEfoy: u8) -> ( + field, + char, + u8 +) { + const fG0q3 = -59154251402565510076278685361797057569i128; + let PrNua: u8 = iEfoy; + PrNua *= 3; + PrNua -= PrNua; + PrNua *= PrNua; + if 32668u16 != 21786u16 || (aleo1j49vf34whm0m4uws0estyu4gq5tht5zx0q6qzxmdzscnclmxfg9qdgzda0, 41540, 134304434296530196734061550676303486963u128) != (aleo1xva5m9jur0a0tprwqc8nzphgzgd6skjd0q0pw5cgr4neuu6l2ygsasgpk9, 55043u16, 129033633348452456271720971239228800745u128) && 24828206122290956941869728717938262622u128 == 190550268981330710707990793850974074495 { + let FFxXY: i128 = fG0q3; + } + const mu6N = [7582669102660056372947255416050366024078733101207257721015648696292977286038066716759935417295636191557803704683778990632154263740251772206823891196733587field, 8196660721793919824431109574792746081235843603331574262589237067642966218636776362612899587315350318796338078462915808190066779316191244649686894554175818field, 7243540293239857928937388141203501039817875319585790175435641863324995357870510220128659842790875126815373993172381399497896402138463576231151096997987235field]; + const Bpf8B: RaEnk = t5RQ {}; + return (11817726415298897201781763882612161235674380541753244883813987091658618975514747358698825992261995321821959028187112813486614880508876689770337142994146408field, '\u{105181}', 212u8); +} + +circuit VdqTF { + vNAMH: bool, + JkBcA: address, + qQtCF: i16, + + function XBi3v ( + const SLNe2: u64, + const ZceI: u8, + const BU9w: q2USj + ) -> ( + u128, + i32 + ) { + const iELE: ((u32, char), u128, i64) = ((384601192u32, '\u{5d}'), 260866785695740709874051028796502206859u128, -321465745518097240i64); + let YfiVq = iELE.1; + const iH8i = 47086u16; + YfiVq *= 0u128; + let Us69 = BU9w.qmz3; + const gt_QR: i64 = iELE.2; + let z26R: u16 = iH8i; + const CwF6T = 2122017455351828831u64; + Us69 = Us69; + let a19dG = -86613533756289588059622956126783773336i128; + if a19dG == -49319611420542273374035057559272823755 && SLNe2 <= SLNe2 && -23356 != -16419i16 { + let kX9E: char = iELE.0.1; + let AdkEx: [i16; 2] = [-5468i16; 2]; + const UcJQG: i64 = 1017251936437173056i64; + let rm6_8: u8 = Us69; + const zgZL: q2USj = BU9w; + AdkEx[..1] = [AdkEx[0u32]]; + return (108204645183890682686172343964957448867u128, 1149096697i32); + } else if -31 == -69i8 || a19dG <= a19dG { + let zpnQ: u8 = 72; + a19dG += 84542379573227848725665999581434532730; + if iELE.0.1 == '{' && BU9w.E_t6 != !false && 100 >= (q2USj {aLCN: [(4158624514u32, 123278280530457701497833478904269469213u128, 375400254i32, 4030338526369534919352204641539656959774203635820637603220580819386423470678850085111744039458909079319352854489628011888463617722287850191230995765822356field); 1][0].2, GoGV: BU9w.E_t6, E_t6: BU9w.GoGV, qmz3: Us69 ** 0 + BU9w.qmz3}).Bchw(-85474839122628384091136338030133571122).1 { + const j6mpM: u64 = CwF6T; + const Qjgj = CwF6T; + a19dG = a19dG; + YfiVq *= 0u128; + YfiVq *= YfiVq; + if (true? aleo1zlkfjx7kmswac8kkz6gmrpp5wdlfyjcpa82p3sxlc7t9hdpxyurqr4pm0y : aleo18846l5defv4cmp707jzfmnyphxe05y94wgqljklkd2vuhujuccqqncphly) == aleo1vvzw6wwnr4qzw3c833wzzzglnamw6rqw4frucvz3cz4ca9d3hvgsjm8xaj && iELE.1 >= iELE.1 || j6mpM <= j6mpM { + if Qjgj > Qjgj || -1777i16 <= -21839i16 { + let jmjH1 = aleo18a6ztczu0l2rc0w2dxtqf6nlgwwqe9k99tq5el7w5kcwrc0085yqkey0fv; + jmjH1 = jmjH1; + a19dG -= a19dG; + let HwJn: u64 = 17714981732057656865u64; + YfiVq = iELE.1; + let m3kTh = jmjH1; + m3kTh = m3kTh; + } else if mH2Y9(34).0 == mH2Y9(9u8).0 && 6273i16 < 4909 || -8867466881151025294i64 < gt_QR { + YfiVq += iELE.1; + a19dG -= a19dG; + } else { + let crw_: bool = true; + zpnQ -= 24u8; + const dsGM: [bool; 2] = BU9w.GoGV? [false, false] : [false, false]; + } + let kJb1: char = '\x59'; + a19dG += BU9w.GoGV? a19dG : a19dG; + zpnQ = 212u8; + a19dG = a19dG; + z26R = 55775u16; + let SNxJp: u8 = zpnQ; + a19dG += a19dG; + const EPCfE: i64 = -2588330871158477199; + } else { + if 8297695527096070029141173015706745148u128 < YfiVq && ('#', 42214, 15441661, 3727013545) != ('\u{59}', 34058u16, 3653945965u32, 1129351315u32) { + z26R += z26R - 55038u16 / iH8i - 30074u16; + const hNyo: char = iELE.0.1; + z26R = z26R; + } else if Us69 == Us69 || 912492226995330448 > SLNe2 { + Us69 = zpnQ; + z26R += iH8i - z26R - 0 * z26R / iH8i / z26R; + const B1Hx: u128 = iELE.1; + let V9bJ4 = BU9w.E_t6; + } else { + const YHwJ7: i64 = 8808493453600301821i64; + zpnQ += zpnQ; + const mCw1_ = 7801278669036649611368151749591863685236870578853066004483602881165648711426811156956719869085171471031126066717127183381568375078432206971070288097037807field; + YfiVq -= YfiVq; + z26R -= z26R; + a19dG += a19dG; + let zHNJ = iELE.0.1; + let wI7u: field = 2550144609268528440691705040114940648343270796680326402121986343650268171471569132206972126710945335689980818687697891282702140492021153719137048087792240field; + } + } + const LkcEj = iELE.1; + } + for SogB in iELE.0.0..384601214 { + let DYkE: u128 = iELE.1; + const kAOX = BU9w.E_t6; + DYkE -= DYkE; + const M59dm: (u16, u64, field) = (43488u16, 9124896517185954065u64, 10561644927788416398392784857829962551661255265035645354800005079247111969376265845407072644801592007585225067672023612023814003754382765372559116699973115field); + const JaobB = BU9w.aLCN; + let WvXP = SLNe2; + let VO6G: u128 = YfiVq; + let ffilS: u16 = M59dm.0; + let YZOB: [RaEnk; 1] = [t5RQ {}; 1]; + } + let dNY4: u16 = 42664u16; + const ew3P: u16 = iH8i; + const rhMm = (-12175035427752017433810985932786769741i128, t5RQ {}, 271081707118414207u64, t5RQ {}); + if CwF6T == 11331100544714433941u64 && -137675837326651778150405129011408487179 <= a19dG || ew3P > ew3P { + const EDvW_: i64 = gt_QR; + let uo2t: i8 = -49i8; + let Df3aR = CwF6T; + const O95wG: u128 = 233656278189081722025096788379753584619u128; + zpnQ *= 2; + if [YfiVq; (1, 4)] != [[169806268696379052753386048486355766015u128; 4]] && O95wG == O95wG { + a19dG = rhMm.0; + const F9OI8 = 7722095094283521054i64; + dNY4 = ew3P; + return (208326420935540144401016536701458059817, -982099885i32); + } else { + dNY4 /= iH8i; + const Bib0s: (u8, i32) = (17u8, BU9w.aLCN); + let drCDJ: u8 = mH2Y9(59).2; + return (161370180874192340940279967916022560712u128, 824395561i32); + } + } else { + Us69 **= 0u8; + if 13374625417223606661203178669122357262895208428058127395102070813150800996346310387528492920172705731913360080696233776310891992358563843352652013188713944field == 263532422099937944708673518073513763117335195026879259697639252603769892703299683875517609580006174666409952835928025508899712918393480532217337922966555 || 1096149508u32 != 2994358812u32 || [12890087337307472884436170949641374530429153345545555376245573207602294126747170115789551329058532240766554606961796542359650950559524558773090959768475930field; 1] == [2143632458517463038479141456562071005118430667816722632824939540043109994093969259778518202045640720180325070912765589063054454459930550396018099750062403] { + let L_TyE = zpnQ + ZceI / mH2Y9(zpnQ).2 ** Us69; + z26R -= dNY4; + z26R += iH8i; + dNY4 += 16917u16; + dNY4 -= iH8i; + return (41882921589805161698106929041066935475u128, -1250228558i32); + } else if iELE.0.1 != iELE.0.1 || iELE.1 <= 112733576472926129085561582397187256731 && rhMm.0 <= 156193507662835091964445626817294215008 { + if iELE.0.0 != iELE.0.0 && iELE.2 < iELE.2 && 20 < 136u8 { + dNY4 **= 0u16; + let JlUA: address = aleo1vdwy8d4xa25z933kwtrfa2rcue76y4enuqzpt2wcawnpah3wzsqq2mva5a; + const flZpN = (4615902933436516462u64, [1051606236738913649i64; 4], 52700u16); + Us69 *= mH2Y9(74u8).2; + let rvGR: (i32, VdqTF, u16, u8) = (BU9w.aLCN, Self {JkBcA: JlUA, vNAMH: BU9w.E_t6, qQtCF: 28341i16}, dNY4, mH2Y9(zpnQ).2); + } else if CwF6T < SLNe2 || -60168501559691069371405162360254879048 < -161477792457033742618657363363311658871i128 { + let XWlHi: i64 = gt_QR; + let rudj: address = aleo1lfwytf44azjrgv506dta4amsu58k3eex9dp33hg05jud25crxuxs80nrp6; + } + const dFd0: address = aleo1jeyl5j4r9u6hqz5jk3t6kla3jff5vgvn63lped7dsdwhqp4auupqsyaj5e; + const Fj_t = 26i8; + YfiVq *= YfiVq; + dNY4 /= dNY4; + return (251797454112440413890352461173202213335, 927710880i32); + } else { + dNY4 **= 30488 / dNY4 + 29821u16 - 27432u16 - 2353u16 + q2USj {GoGV: BU9w.GoGV, E_t6: BU9w.GoGV, aLCN: BU9w.aLCN, qmz3: 83}.Bchw(154446541901057916622609095185682224927).0 - 2555u16; + Us69 = ZceI; + Us69 *= 0; + const k85V: address = aleo1gtres8rsyj6d6jz5y3g3y9tjqsrr7tud2kvtzv2w2c9d46g865xq32n37e; + z26R = ew3P; + return (206704597053005722166881401158050055285u128, 1164596760i32); + } + } + } else { + if (71, 2881902654u32, -2069668436, 92123972876894013803446307211773509241) != (131u8, 3282192165u32, -2129422448i32, 43305229915134948318570373955312734854u128) && BU9w.qmz3 > 189 { + Us69 -= 49u8; + const JYg1D: i16 = -2604i16; + const rliN7: VdqTF = VdqTF {vNAMH: BU9w.GoGV, qQtCF: -24022i16, JkBcA: aleo1eujyhsjffg9r7tkxgmfurg3mt8c7nvc03a2lgzsgqe0r3sp8lvxqc5qdmh}; + z26R = z26R; + let f3kA: u64 = CwF6T; + YfiVq = YfiVq; + } else { + const VqQ9j: u64 = CwF6T; + z26R = z26R; + } + const RAtF: u64 = SLNe2; + a19dG = a19dG; + let wP8M = RAtF; + const ku4m: [u8; 1] = [BU9w.qmz3; 1]; + return (138950913523788282516433261892988500386u128, BU9w.aLCN); + } + } + + function M5uyg ( + &self, + const okvyq: address, + const jLfv: address + ) -> ( + [u16; 1], + field, + u32, + address, + i64 + ) { + const uTtoZ: u32 = 2911953024u32; + self = Self {vNAMH: HnaR(9637107400116582286875632406821960049552027667572334234709696347580021917799394395119248241957821783181912394721554018583849251698821030898138872231958121, -484i16).2, JkBcA: aleo1l37vuw8u8d7plfhcfzjt8m0qwfe3j8u4aufm9xqtvsghu5svdq8qx53uzl, qQtCF: 22825i16}; + self.vNAMH = self.vNAMH; + self.vNAMH = true; + const kJJp: field = 11645589667993280099034622824350749720911055347704063229918455679843827052479299776284340059356896792159135506144424390068971515703723527659351438790152783field; + self.vNAMH = self.vNAMH; + self = self.vNAMH? self : self; + const XicT: char = '\x3a'; + self.qQtCF /= self.qQtCF; + return ([26235u16], 10204220262695726749783274260328053259745286134580082341779447510196179136312755669231619017189600069545303530663107245149667915069169858552950905395161580field, 92907414u32, aleo16nlemverjfhlqlezej0ncfynxgcnlu5nk9n3ag6l8c5m7uuk8qyq84sh5n, -3147978309964363954i64); + } +} + + +function main ( + nq60Q: i8, + lVdR: i32 +) -> ( + i8, + i16 +) { + const HKkwa: u128 = nI8f.1; + const V03E: i8 = -79i8; + const OjYjs: (u16, u16) = (61993u16 + 36672u16 * 0u16 / (49290u16 - 1647u16 + 5273u16 + 64600u16 / 28457u16), 10262u16); + let fz_h: qQAv = 1882284745174847260; + fz_h *= -1i64; + let Yw2dn: i16 = -297i16; + let er63n: m1ys8 = aleo1yl8g8c3scda0e9gta5dxn49xm29avlwc6ngzr6l3yflmzraktygq2qaks4; + Yw2dn = Yw2dn; + const HeMx: u8 = 55u8; + let AJTYt: u64 = 4813604680719586955u64; + return (V03E, Yw2dn); +} \ No newline at end of file diff --git a/parser/benches/large_3.leo b/parser/benches/large_3.leo new file mode 100644 index 0000000000..70aca05093 --- /dev/null +++ b/parser/benches/large_3.leo @@ -0,0 +1,356 @@ +type f7emM = i32; + +type D7DUI = field; + +type eJa93 = u32; + +type R9gK = i8; + +const KN5GV: u8 = 135; + + +const HIvz: u16 = 8353u16; + + +const RxDY: i128 = 160507423339819228254499907855942116643i128; + + +function FCIe ( + const UVuLE: char, + const F9oz: D7DUI, + j9xg: u128 +) -> ( + (i64, i8, u128, i8), + char, + i128, + i16 +) { + const HUPGM: [field; 2] = [13277594549785768136284430178007837859568136834230341432435178881596844874513004667327467035429833750272956397180760385366596119340548168128876632009997790field, 1422581498637680138044229982545977777417953390362474916059262745889909423177974455160773650800419815223963856164884271573917800433866887521655476469172219field]; + let zOaeh: u64 = 2447328702336489745u64; + const drQQ: u32 = 3787261625; + zOaeh /= zOaeh; + zOaeh += 12692165764150258137; + const grLX6: u16 = 55650u16; + zOaeh *= 10578752206098725527u64 - zOaeh / 15360172840497151888u64 * 0 / zOaeh / 15868540033809659835 - 10578752206098725527u64; + zOaeh += (zOaeh - zOaeh + zOaeh + zOaeh) + zOaeh / 17962297468044929180; + let Z7cF: u8 = 186; + zOaeh *= 0u64; + Z7cF = Z7cF; + let co5i: f7emM = -593933979i32; + Z7cF -= Z7cF; + const WN3V5: i32 = -1943816238i32; + if grLX6 < grLX6 || -24321i16 <= -29946i16 { + Z7cF = Z7cF; + zOaeh -= zOaeh; + zOaeh = zOaeh; + co5i /= WN3V5; + if -2565301346371103071i64 != 5669173694005880994i64 || 2242759494058485131623600955976083003446883139676356950994987610980627965999678277966408450558596707449282885603220282725974464948026399614490986096065319 == HUPGM[0u32..][1u32] { + co5i *= co5i; + const D8FT: u8 = ((5645836405824963934i64, c0q0D {sWaX: aleo12ngdtsa7cemyulvhsk3hfu6wv4yddheun93f9dvn7n7m6eqrzu9sv0r4aw, BEMu: 'L', K4OKX: 885192667795883897u64}, (-109723950938405130273438859813497633393i128, -5739653383984923764i64, 37u8)), (836836554u32, -2194483750600446187i64, c0q0D {sWaX: aleo1dzmz8f7g2zeeqyluhfeaqvs2t95se9ltr9pfn5sv3d2qdzzdtggqgu2sfl, BEMu: '\x4a', K4OKX: 2927923949679163273u64}), '\u{d}', (c0q0D {sWaX: aleo15ej5jxywpr8hnkh6xwlu59rkgrvxv3srcvshdh7rv6gz6vwpqypqau47pl, BEMu: '\u{b}', K4OKX: 15065814023811538003u64}, -102i8)).0.2.2; + const jyff: u128 = 26382778784425638847130040540725332486u128; + } else if -6124866717687854932 < 6013203712033162263i64 && 3068062336091201633u64 <= zOaeh && 77297194591003381904415188889274252251i128 == -122057918084905958454478185247873063516 { + zOaeh *= zOaeh; + } + Z7cF /= 98u8; + const qzYd: u8 = 24u8 * 8 * 0u8; + return ((2328001503999089507i64, -33i8, 172700950727876363058053915213183512621u128, 122i8), '\u{ce906}', 165396319652248172259296996926935483030i128, -17826i16); + } else { + const J4s1l: char = UVuLE; + return ((-6092265953157273729i64, 50i8, 264509740629002487510521118509646003552u128, 72i8), '\x3c', -65096494732343930891926872919880984891i128, -7983i16); + } +} + +circuit x4x07 { + Gg_UX: u16, + CFmyP: bool, + QdLo: u64, + + function tFoP (self) -> ( + u64, + R9gK + ) { + let YhcI: D7DUI = 10041756911293925311839456197432788172577488883953451408506250325562551174751802101892197286578765117103165134818383623324827979619522104377776795934092783field; + YhcI += YhcI; + YhcI /= YhcI; + YhcI /= uocd().0; + YhcI += 2109099897408687578464162609847863160154158737566461923793201140365366378692field; + YhcI -= YhcI; + const s5UA2: [(u128, [[address; 1]; 3]); 2] = [(78520263641837826402410359563426572088u128, [aleo19v9jtk28p9hfz0s79vldtwhj2wsv7rp6qzgwpzzzlgrcypng85qszac8wy; (3, 1)]); 2]; + YhcI *= YhcI; + YhcI = YhcI; + DjAk(RxDY); + YhcI = 7044684870410365474493487720610678832328537861091382271585725006824079229854322516096295355398330317566313160532626993456065979091608689168288445268821544; + const lgfTI: bool = false; + return (self.QdLo, -118i8); + } +} + + +function main ( + HT3GJ: bool, + nfEkY: u16, + const YkvP: i128 +) -> ( + u128, + i128, + i128 +) { + const dU2_ = 17617960660724493139u64 / 6194278111530993676u64 / 3319391222769102077u64 + (10849170017303134999u64 * 0u64 - 0u64 + (true? 2774547757065642486 : 12774957265044619107u64) - 1605116883245688885u64) / (true? 14231626722754827495u64 : 413680800867858612u64) - 0u64; + let x5MF = 22368518u32; + x5MF *= 156; + let CREHc = HIvz; + let MGWLm = -1800392205i32; + let z8ku = -87i8; + const wyIn: field = 10733765163001415897583781334507501877579149054537923538817102911561935149880247989114716181053539561399586511949123113150518327567285269118282285194889342; + let G3uvm: R9gK = 23; + MGWLm -= MGWLm; + return (122363506321495815854865379581118597190, 141064124005494437087595272075651273306, -95739232923139212477565752848665046675); +} + +function nFflF ( + QFsBY: u16, + ig8AI: i32 +) -> ( + eJa93, + u128 +) { + let wVYs: u64 = 17150358843210732735u64; + let PW7m: u8 = KN5GV; + wVYs = wVYs; + wVYs *= 0; + PW7m += 6u8; + let Ngu6p = 8943877831269998164i64; + DjAk(RxDY); + const ZPntN = 494201974525721541u64; + let BI3P = false; + Ngu6p += -6302257762972050303i64; + for dOGCq in 96378382..96378385 { + let D3p6: [i128; 4] = [RxDY; 4]; + D3p6[1u32..2][0u32] /= D3p6[..3][0u32]; + let vS3t: char = 'x'; + let sSXA = -25469i16; + const ib6hy: address = aleo1m7zhdd6g3cadgjw8s2pxt2v62hlfula3sj607vfjyt0c9tqpj5xsl8tq35; + PW7m -= PW7m; + let aS3I: [bool; 2] = [false; 2]; + D3p6[3u32] *= D3p6[1u32..0 * 2851184652u32 ** 1u32 * 0 * 0 - 0u32 + 3][0u32] * (-132398739494581955581789609515195973911 * 0 * D3p6[0..][1412242597 + 2626927325u32 + (2670766347 / c0q0D {BEMu: '\u{e630a}', K4OKX: 29999364278060019u64, sWaX: aleo18kk9pny7qjlr0ahhhc7f372vsztqd7cnzcdd6zndu7hd06rp7ygqt7dkpn}.TnP8d().1 * dOGCq / dOGCq) / dOGCq - 4039169921u32] * 0i128 + D3p6[1..][0]) / -56005947257550409174821572609407516561 + D3p6[0u32..true? 4u32 : 4u32][1] / -85246368279954515360146418422322718265i128; + } + return (390197594, 260459899954261109021372419872275322165); +} + +function DjAk (const C88h: i128) { + if KN5GV > KN5GV && 123 > -90i8 && 2285689222 < 428945436u32 { + let XaiAH: u16 = HIvz; + XaiAH *= 0u16; + const aN6j: c0q0D = c0q0D {K4OKX: 8501428031508490118u64, sWaX: aleo1pcnslsg5d9qv9uss6v5glenpjrrp8emz0jjuptlgjsahzxfyfsfqgk9c5c, BEMu: '\u{106903}'}; + XaiAH = XaiAH; + let v_gr: R9gK = 86i8; + let vQBrv: i8 = v_gr; + } else if false != false && '\x02' == '\u{fe0a1}' { + const Cv6t: c0q0D = c0q0D {BEMu: '\u{1c}', K4OKX: 4026017311429506330u64, sWaX: aleo1wh7fetrs63yr5ttr2d3xptkcrg30kkxnfuwhdqfhsnpsm738es9ssasnk4}; + let CFDU = 2554706819u32; + } else { + const XTXW: address = aleo1h9pa4s2gvh7chmyv2p99m4x7kmjskvu87hdzs6k92p2xnzzfjq9qjj3fjj; + let anV6: R9gK = 106i8 ** 1i8 - (-65i8 / 39i8 * 6 ** 1) / 40; + anV6 *= -81 - anV6 / anV6 ** 1i8 / -71i8 * anV6 + 80; + let SVb5Q: [field; 1] = [4077384098494544667206066621428937904611008619967972987679305158596214220268495436363662321849766684235995314354942797342023149141772799315520179193258961field; 1]; + let hRtIk = [XTXW; 2]; + if 11360636251338665983u64 == 6182556736798576232u64 || 2818 < HIvz && 770830148i32 <= 2065969546 { + let TxKP: eJa93 = c0q0D {sWaX: aleo1phfn932fnrpqvp2kydnd9shg26yj8nx9a2fqm7yy2gffxenycy9skct8m5, BEMu: FCIe('\x40', 7762636663263793586165276257252074065285452327816447223493926745924714407746413112191982102760406793158705070144184459624393741405589435306392529691108229, 143936786489186856337147359494669603286u128).1, K4OKX: M9bVT(c0q0D {BEMu: '\x2d', sWaX: aleo1h75wyxsmkmrlzaq4qemk9k9qfq0g9nluev0vzy66qyj6tjthjy8sv3c3m9, K4OKX: 7088702153228388238u64}.Iv4zF(13735531298038916337122557094612295893u128, KN5GV).0, 9953454491133807989249392638102019888543634898766562480703825926903264258664004505403271946073825334942084724425470955112328071093521950031906547905778694).1}.TnP8d().1; + } else if 67u8 != KN5GV && 224953994693159224576578985106062181604 < 249440015587999031178484669792393069501u128 { + hRtIk = hRtIk[0u32..]; + hRtIk[1..2][0u32] = hRtIk[1u32..2u32][0u32]; + let b6Ssn: i16 = -12298i16; + let lYeI = (67037739923401076397062117992995431111i128, (-1925376793i32 >= -1453765275i32 && true != true? true : c0q0D {K4OKX: 5437340408171671476, BEMu: '\u{b01d7}', sWaX: aleo1uhje6jhv9ef0dcddjp2k9q5chepte9q69aj4xee88k25zt078qys0swynr}.Iv4zF(246374823898085179502856584377327541409, KN5GV).3)? c0q0D {BEMu: '5', K4OKX: M9bVT(-2046298489i32, SVb5Q[0..1u32][0]).1, sWaX: hRtIk[1u32..][0]} : c0q0D {BEMu: '\x38', K4OKX: 4525421086478513427u64, sWaX: aleo16d4u44sj28vv80ctyyy2yemleksgwv92ev7vu3qjgxqm05v8fqzq0xa6w4}); + SVb5Q[0u32..][0] *= SVb5Q[0u32..][..1][0]; + const OTuJD: char = 'X'; + let beqKf: char = ';'; + } + let tc8Gw: [u8; 1] = [249u8; 1]; + tc8Gw[0..][0] += 0; + tc8Gw[0u32..][0] *= 0u8; + } + if ['\x6d'; 3] == ['\u{c9437}'; 3] || -16573 <= -25741i16 || false == false { + let gvbR: i16 = 16881i16; + gvbR = gvbR; + } else if aleo1evp22w8jtdfpzczqvz8fc34g0n5manlfvdhljha39k3740wdqursqnrza7 != aleo1mwwnplsmd8wlff6472eug06eszfz34p9mfvrl2put4kta9psyuzqn9cz5h && 5948144561193241423191637167728058303641973413071041880623282696840869970146872267108964222249247879428697403882067936500263123592142073385454010941437678 != 6741557943011570877578132335502636958361532271961769794787210902450438513460639642503171383031881141592233605006765658763340012210058645164039609847020737field && true != true { + let NtCaM = [-4293925878918538465968391374178736514i128; 4]; + let uiDf = false; + let c95x = c0q0D {sWaX: aleo1q23un4fadvtem0ddrsayw2kqxkdhcp52nd8tmr0gcm83dlqwuvzq962kp7, BEMu: ')', K4OKX: M9bVT(-1443533206, 7071866406647088236012383855462583350620191614555416228696018352702230906569951503953496771707337140195132189172381742116147595416246916329483847950043580field).1}; + NtCaM[..3u32][2u32] = NtCaM[0..4266700832u32 - 991705198u32 * 3u32 - 77852670 + 25603080u32 - 1239335645u32][1u32]; + const WRzGY: char = '\x1f'; + } + const mJg_: R9gK = -106i8; + let vph1: i16 = 16028; + const gIfT = HIvz; + let PeDJx: u8 = KN5GV; + PeDJx += 74u8; + const G2XDG = 23249i16 + -16543i16 / -26625i16; + //RETURN +} + +function M9bVT ( + TSy1v: f7emM, + fEkX: D7DUI +) -> ( + [D7DUI; 2], + u64, + i16 +) { + const O5Dl = true; + const cKumc: field = 3381959365089964659190697228976142723593135010335530288360938140490965049778958198339208056882159925115722498684489544526835331723777589908514445431444956field; + const PPide: [u64; 2] = [17661624248069496308u64, 11336616822948858680u64]; + let Kq4Qa: u64 = PPide[0u32]; + Kq4Qa -= PPide[0u32..991788121 / 1342912343u32 ** 2241021841 ** 0u32 + 2u32][1474344181u32 / c0q0D {K4OKX: PPide[0..2u32][O5Dl? O5Dl? 1u32 : 1u32 : 1], sWaX: aleo1hgky57732rlgr46tuvatgtmnkhthnq4frhj8ln05j3j8xas3wg8s8znnjw, BEMu: '\u{c}'}.TnP8d().1 + 655506754u32 / 2723267006 * 0u32 - 16]; + const zPop2: address = aleo1d0kerkqm8qukl8v0r5t8zf8lrenfm905x42j7przjj9yzw3eqgpq9vgc3v; + Kq4Qa *= 1u64; + const fC_K: f7emM = -1916096586; + Kq4Qa += PPide[..1157284771 + 2286188359u32 + 510713829u32 + 314266907 - 4268453864][1]; + let elsT: u64 = PPide[0..2][0u32]; + Kq4Qa *= 7522699392864730264 / PPide[0..2][0u32] + PPide[1u32..2u32][0] / PPide[..1][0]; + return ([cKumc; 2], PPide[616486984 + 1779172181 / 497863060u32 - 732489493 * 0u32 / 2650790141 - 616486987u32..1369307979 ** 1 * 2u32 - 2738615956u32][0..][1u32], -1958); +} + +function uocd () -> ( + D7DUI, + i128, + u16 +) { + let HNDgu = aleo1wveqsn8jr2dtmg8lknwtmg6u4ecqzjl5dr3tzz0qd3yce68fuu9qvyzq69; + HNDgu = aleo1uk7ezw4dm322ky83xvpc4qlyllkhh7qzxhu3dezllkcner7cwugszrfz5y; + HNDgu = HNDgu; + const PrfI: i64 = -2415128496557894375i64; + HNDgu = HNDgu; + let sMamP: D7DUI = 3050972207293858985898027261134989740280030677253680626624233331809624642412field / 3535589802656998200414663729378559203486047389364630633320510383222552413078field - 7617669674777116573145493034288771881912278786788014099379523903600643564789field; + sMamP = 7283898863926607047829441804784735551993698333151824285033297975715284272357181121366898148613021172170773141391819075973764254354221433711234731582155247field; + HNDgu = aleo1wmcz5msr0drgm93sy3c92jgpdwc38qxnc86v6pgjrnq3h0agqcgswtq08z; + return (679694547190221403116537244681951121754919771791350316747287453042032902862057226918548953516602842317380963297974405319599274158746187816329125707432325field, 83083990534768452705048990419652926759, 21119u16); +} + +circuit c0q0D { + K4OKX: u64, + sWaX: address, + BEMu: char, + + function Iv4zF ( + &self, + const ipMh: u128, + const iOEIN: u8 + ) -> ( + i32, + u128, + [address; 1], + bool, + bool + ) { + self = self; + self = self; + const FzZBe: i64 = -643197592149967748; + let YMf89 = FzZBe; + let Dgb9: i64 = YMf89; + const CLk2: i64 = FzZBe; + let LAWrc: i16 = 32079i16; + const qoicx: i8 = 126i8; + LAWrc *= 1; + self.BEMu = self.BEMu; + let tdal7: [u64; 2] = [8388245588918634420u64, 1453414813218090559u64]; + tdal7[0..1][0] /= tdal7[3164332165u32 + 2467536369 * 0 - 995826184u32 * 3 / 2801076471u32 - 3164332164]; + if 8751819645477606739465991767336590174073657295189763951167036411552106813904106536054062561076463895660387284106042310404524825109480630466867779897231432field != 2115127521050823232154380155084113954644219345940856568249006021510649777751865861552474344263416250700685708337939930923605370429167388464237111171457269field || 13018102272562842131u64 != tdal7[3604865223u32 ** 0 + 2712791363 - 2157811397 - 554979967u32..1u32][0u32] && 268189170360476989005118072433093795065 <= 259597897676373350325954734974886119976u128 { + let F0Wce: bool = false; + const wM77z: i16 = -32698i16; + let wOaL: u16 = 14538u16; + let FV28t: c0q0D = self; + tdal7[1u32..] = tdal7[1u32..]; + const sLhCp: i16 = wM77z; + } else if -1598077892 < 834430274i32 || 7324314711686203691272558422022398360572523502301058715976822051136052462012834082000875535792826566421689489490288767984613382378164770887705837042049072field != 12020087347898652995061212535901462039777615210755734983434269553301944288156831518125668986272344618833804181615295707102238124262698343406193721402374171field && self.sWaX == self.sWaX { + const LskI: i64 = FzZBe; + let Bn5B: u8 = 37u8; + let F31fB: i8 = 34i8; + const zNbM_: u128 = 222889208679280605484259939391970401830u128; + let rmTy3: char = '&'; + let uOun = [68726522506679376221642071634646978539u128; 4]; + const pTIL: address = aleo1r89u42rfh8ptcjl93t42cvqylwq6gh3quk99tp47tm7qwxl3esps49ek4n; + uOun[2..false? true? 4 : 4u32 : 4u32] = [uOun[0u32..][3u32]; 2]; + } + return (-1330563779i32, 49869787931219468050003648635684350950u128, [aleo1rqpas4pkm4hgwh6sj0gc7aycffcvqjdarnaq3jz592hu6t4s75zq3j33g2], Dgb9 > -1331431069782354307i64 || 22i8 < -54i8, false); + } + + function TnP8d (self) -> ( + bool, + u32 + ) { + const DmLm: u16 = 62276u16; + let VcDk: u32 = 2076386889u32; + let akpiC: field = 12620179876212747618015263078521181097597683180570903043504022611362055512187511418595324819926630700868621135200337445883209486801296284506852422837115795field; + akpiC *= 6795301077265828102230819445788147289785807698219041499098841944122326621697; + const kfHSZ: i128 = -11142910603737792714635157500488940642i128; + return (Self {K4OKX: 11651891261795895744, sWaX: self.sWaX, BEMu: self.BEMu}.Iv4zF(237114277218198383018381080565600145702u128, 12).4, 84191294); + } +} + + +circuit yoi2 { + Q9XX: address, + PeYO: char, + + function d6a4a ( + self, + KcEYB: u16, + fITS7: i64, + const SK3R: eJa93 + ) -> ( + u128, + i64, + u128, + u16, + address + ) { + const uYYNS: i16 = 4741i16; + const AH1JA = SK3R; + let C4eK5 = 15184229167774774597u64; + C4eK5 = 1817823583727555793u64; + if KN5GV != KN5GV && [10418; 4] == [46848u16; 4] || HIvz != ((KcEYB, 122i8), [326029612984919646259098413389086890933u128; 3]).0.0 { + C4eK5 *= 0; + let Ssjl: bool = false; + let ELoJ: field = 4022025590070768614089504591446675525797902791905376121862004687697577330817391703446136392285510032646232430939678135588587329823607772956008498800316399field; + let zWtQ = [139948959111052778124615455604631167440u128, 336271332812688144290687269674766777149u128]; + const tHBUz: i16 = -25418; + DjAk(-152362983330921703465720711984467904217); + const ndmr: f7emM = -616661352i32; + zWtQ[0..2u32] = [zWtQ[..2][1]; 2]; + let JPT1 = uYYNS; + } else if 30299i16 > uYYNS && 13156527554563220026766089172089410459727999823345608524237717848710505815674096741335546400445265707108640077658559127214449526812881748406135944135596729field == 1058122273492342301462951281560720684476970353691764752934697683100145379802460313917016093694918124212459745345527183177838167747998263153876566167496987field && 16516805546786858913 == 7271458256740227509u64 { + let lhh7z: u8 = 184u8; + let qhAGL: i128 = -160544352790873401672660389179862682249i128; + } else { + C4eK5 /= 1474268314080872282u64; + let G7B2 = 48135549813543607988338174687857554657i128; + } + const PBF3D = -996550112i32; + C4eK5 /= M9bVT(PBF3D, 5475802643900380806255643067094297463445681606339363686226205535604484372434222551701413509272022595621682781571585753579531751460567891941376825933384850).1; + let EsRQv: i16 = uYYNS; + const gOLj: i128 = -37892591301074942600370100541164391364i128; + return (81064696772658427187273269555356373315u128, -2307465862478716785i64, 7593952914351541530419915238062231210u128, 6779u16, aleo1gdxz3j4gf0qc977262s5j620tjsk982ahlqn6vsjt3fsvjv96y8sx7gpy5); + } + + function VxgF ( + self, + const iaAWb: R9gK, + const mL53A: u16, + const atdZ: ([u16; 2], [(i32, yoi2, u8, u32); 4]) + ) -> ( + u128, + field, + i64 + ) { + const ku0bH: D7DUI = 11754752438259210427697170300987982028351432552797332663052854387111213342643848238421416191764489443428757402393852684480462172060453178973561128479470346; + const K4STs: address = atdZ.1[3u32].1.Q9XX; + const FWaK = 28672i16; + let Vnbm = 4873298198158298303i64; + Vnbm = -7525761477311718518; + let Atdc: bool = true; + const Zb3H: i128 = 130699347522932019666671778034147335541i128; + const c33Fz: D7DUI = ku0bH; + Atdc = Atdc; + return (82624614926581149725349075041935125160, 2706225903841093727126482902797685194990264682272662674982659458493642750020421705260015665573361316348405833721364351456196890223766219493504966898847324field, -6035924515464853359); + } +} diff --git a/parser/benches/large_4.leo b/parser/benches/large_4.leo new file mode 100644 index 0000000000..55300d224d --- /dev/null +++ b/parser/benches/large_4.leo @@ -0,0 +1,247 @@ +type TESjC = u8; + +type XgJbM = ud9u; + +type KMjk = u64; + +type zyIj = [gwqG; 3]; + +type nyaT0 = KMjk; + +circuit ud9u { + + function OA2a (self, const PQSm: i64) -> ( + [[u8; 1]; 2], + u8, + [field; 3] + ) { + const WR50u: u8 = 89; + const aJkWK: i64 = PQSm; + const CuB6: i64 = aJkWK; + let j6ofZ = true; + const wj6tp = aleo1m70z0jghu88ef4q3s2plwhm4h0vjrcat79278c0uv0hzhpngmszq3u4ft4; + let NZkd = j6ofZ; + for vwqa in 1814569814..1814569840u32 { + NZkd = j6ofZ; + let XCfL: u64 = 8940103248940692844u64; + NZkd = true; + const ihYs1: u128 = 200771802962651051493456821267800245072; + let GSEY = 74i8; + } + j6ofZ = NZkd; + let s8Yd: char = '\x29'; + return ([28u8; (2, 1)], 196u8, [11613534243791163909098452126521461350059044290095737839705917403745497411067632416830425209120023881761098367665718381435033217273736816307046757848867494field; 3]); + } + + function txH_ (self) { + let Bk2m: address = aleo1c52af5rl3m3kt8vvlq2wczzvnv8ef998grujqrqrn8m9pgvy4cgqjjqaql; + Bk2m = Bk2m; + let Qy_0J: address = Bk2m; + let x2r8: char = '\u{107897}'; + const Fy6DX: u64 = 14051074936732436832u64; + const aF05: u128 = 58248732485744991059773190464179758341u128; + //RETURN + } +} + + +circuit QIdG { + mOJx: u128, + ats6: i32, + QJg2: u32, +} + + +function kDEUr ( + u6nw: ((address, field, [(i8, u16); 1]), u128, u16, field), + E8rp: bool +) -> ( + (address, char), + u16, + u32, + i32 +) { + let ozt9: field = u6nw.3; + ozt9 *= ozt9; + let xOyuj: u64 = 13578623587887876151u64; + const c7OvE: ud9u = ud9u {}; + const TUHZ: TESjC = 197u8; + const cnqDN = 28229i16 + (20672i16 + -8178i16 + 25460i16 ** 0i16 / -17361i16) ** 0i16 / 18989i16 ** 0i16; + xOyuj /= xOyuj; + let j6FKQ: i8 = u6nw.0.2[0u32].0; + const jhIC = aleo14d4vderqrxpgh0akgjwlzppte4hs2nhhrwcs3r4g46l95jqp5uzqt2luuy; + return ((aleo1x4j93j80z9884fqxemay9wddpek37gd5srgc6dlzafn3q8qjlcqqwrwfny, '='), u6nw.0.2[2693679475u32 - 985713480u32 + 1702181668u32 - 3410147663u32].1, 434662353u32, -464439425i32); +} + +function main (elXa: i128) -> ( + address, + u8 +) { + let Ru9m: i128 = elXa; + let QqX1p: u16 = 29055u16; + Ru9m *= -78783067066806544842812258509769343126i128 / -5192770903335893587638550000711824419 * -9435685705221922686293311198515767869 - 23767944657469791368988025644903192385i128 + 165303230235798631663387693622639710420; + Ru9m += elXa; + QqX1p += QqX1p; + const Y9Zos: KMjk = false? 10974874796025158940 : 10392375857856966340u64; + ud9u {}.txH_(); + Ru9m *= 14204762091749667829716695633555975943 - 2i128 * elXa / elXa / -51256873949263659182183494734768974285i128 * Ru9m - 14204762091749667829716695633555975943i128; + Ru9m = Ru9m; + const DOKSH: char = 'C'; + let PYAL: i64 = -2994169907192071424i64; + return (aleo1fl2jl3jyphgprzcmj78j88s93fu3clx47uskj0508y5r7z6fncyq8706c6, (183u8 ** 0u8 + (true? 67 : 65u8) * 0u8 + 195u8 / 203u8) * 60u8 ** 1u8 - 0u8 * 0u8 ** (61u8 - 32u8 - 13u8 - 23u8 / 65u8 / 84u8)); +} + +circuit gwqG { + KWE2: (i64, i128, [i32; 2], (([address; 1], i64, address, i128), TESjC)), + PtPCd: u64, + P4SG: (i32, [(u32, bool, TESjC); 2], i32, i16), +} + + +function q7VG (const X4Gb: field) -> ( + (u64, u32, bool), + bool, + char +) { + const lX8Z = (true? true == false && 3353090067u32 < 996765664u32 && -88376969325974228891119886691968649663i128 > 56219380627480955959740192790875220093 : 128634236493270227551216251086470968550 < 238236668216240613240346188824974400926u128 && 2776064343u32 != 3820469247u32 || 1983509902 != 2041221782u32, 4206i16, 577664685i32, 7766914339925552831i64); + let QD9Lx: i128 = 28861373067964821194095254514253894788; + let ZVLx = QIdG {QJg2: 1685667744u32, ats6: lX8Z.2, mOJx: QIdG {ats6: -1461469311i32, QJg2: 3183947795u32, mOJx: 218386195035658591842525198906231184080u128}.mOJx}; + ZVLx.mOJx = 0u128 * ZVLx.mOJx * ZVLx.mOJx; + let jY4c: bool = lX8Z.0; + const mHL7 = 105i8; + ZVLx.QJg2 **= 1u32; + const ULFb1: i16 = -16154i16; + return ((6763254871531561533u64, 139486710, false), false, '\u{14e8c}'); +} + +function CoGhD (const WJFU1: (XgJbM, field, i64, field)) -> bool { + let eGKE: [[bool; 2]; 1] = [true; (1, 2)]; + let yFrO = 2036u16; + const D7Xx: i64 = -2440702085321745647i64; + const U5YY: address = aleo16t6ygmm2m382q8uehktsp4ten9sy2cxh4j8509wtr7rmm93wcgxs8tglw3; + eGKE[233845097 / 3736404436u32 - kDEUr(((aleo1g4k309zp3vaqv0sxglrvkhs9gp9ckhw5v52jmfyu62ma4u7uey8sklw2uk, 10086291435577022007997301325406879763624457159392633804470943861697748575824794153623634261246049427910568941445685913807246737378194595481640110825434705, [(-95, 42141); 1]), 87335344619067415986073728015470963163, 19630, 3283923985777856979751544617900598730773060262053677782741241332916996598750174662203783751362944176254364190278085131518918179082964387816577837078606845), eGKE[0][0..1][0u32]).2 / 1291051558][..4113867190 ** 0u32 + 2320379293u32 - 2320379292] = eGKE[0u32..][0u32]; + let oSqd = 7446728409031362153i64; + const wuEu: i128 = -50284962727750254171464282994019009082i128; + const OeE4B: TESjC = 61u8; + eGKE[0][1..2][0] = eGKE[0u32][..2u32][0u32]; + if '\x51' == '\u{2629f}' || yFrO != yFrO || eGKE[0][..2u32][1u32] != eGKE[0u32][0u32..][0] { + let oT_X: bool = eGKE[0u32][0u32..][1u32]; + } else if 11395076137437459228u64 <= 3181544859890518079u64 || 327243686524707468148062285179309560977u128 == [(103907580244344151265856573374909602732u128, [168u8; 2], 563298971i32, 7269i16)][2839524245 * 2903128575 ** 0u32 - 2839524245u32].0 { + eGKE[..1u32][0..1u32] = eGKE[0..1]; + eGKE[0..][0u32] = eGKE[..1u32][true? 0u32 : 0u32]; + eGKE[0][0u32..][1u32] = eGKE[0u32][0u32..][1u32]; + eGKE[..1u32] = eGKE[..1u32]; + } + if kDEUr(((aleo10jay9nh76z83chxdl8l8r6p3nycp58gcsy7pypafdx4f3mrwruxq02kmgq, 11687200791853548151965426187690814707484368141892857878855417328749648641559979695873324082015270477986014492427181621509748453362692313269740171990323847, [(-77, 26673)]), 100969797919704407328452720214024220208u128, 47339u16, 7449814326481628066684811708681677614363848253846043453728537648794454074889305814692166515007738753324687796145518810650479167278505003144898332234658154), eGKE[0][0..2][0u32]).3 < -1401848276 && 3490351887u32 <= 765619537u32 && U5YY == U5YY { + eGKE[0u32][..1][0u32] = eGKE[0u32][0..2][1u32]; + eGKE[0][3509040380u32 + 3116946467 / 1074258280u32 - 1196067799 - 979950986 - 1333021597u32..][0u32] = eGKE[0][1u32..][2370601846u32 + 1040939512 * 1 * 1161196229u32 ** 0 - 3411541358u32..][0u32]; + if wuEu <= wuEu || -27137 <= -3403i16 { + const Fjd8U: i16 = -10771i16; + eGKE[0u32][..2] = eGKE[..3661531842u32 ** 1u32 - 963533551u32 - 2680747516 - 5705872 + 620673541 - 632218443u32][0]; + eGKE[0][1u32..][0] = eGKE[0u32][1..][0u32]; + } else if 's' == '\u{2}' && 13295627065129031147473905922046883809660101779304731275924598473775312740820299976041279707365689742715884647665916823843495325467976847844967332012480195field == WJFU1.1 { + let mgFdw: u64 = 11577870450728313922u64; + const nuMI: u32 = 1362094470u32; + eGKE[0u32][(true? (1324099563400772497189259229374217694971725250319701416295264450434223251341129528798118554948314727574977981892553921980656954354366523311996343515643442, (wuEu, (true, 17140470428350360762u64, 13883709179841168205u64, true), 17063950483798517543u64)) != (9509400093295463668020117236440450287556405822150254027907795454481937657335598561644899647708487637402544140806933618697879228161024740767605485832813986field, (-80246066962419246510688450876934885634i128, (true, 14991284161801234458u64, 69576329936762586u64, true), 10776468650675250839u64)) && 76i8 <= (false? false? 90 : 84i8 : -107) || OeE4B != OeE4B? 1u32 : 1 : nuMI - 836493990u32 + 3497030522u32 - nuMI - 140025802 - 1148250509u32 - 1372260220u32)..] = eGKE[0u32][1u32..2u32]; + yFrO += yFrO; + const pWuv: char = '\u{5}'; + eGKE[nuMI * 1u32 + 2032926285u32 - 3395020755][..1][0u32] = eGKE[0][..1][0u32]; + } + if 97961373739574987193198311452118127234i128 <= 88149576313370097628825768959778517416 || wuEu == 140907141284439736247636185407353477261i128 { + let Xlbx: i8 = eGKE[0u32][1989383460u32 ** 1u32 + 368828696u32 + 178704341u32 + 711311306u32 - 3248227803u32..][1u32]? -39 : 19i8; + const tG_o: [[u64; 3]; 2] = [8351631060358886228u64; (2, 3)]; + const pofE = 34608u16; + eGKE[0][0u32..][0u32] = eGKE[0][0u32..896155508u32 + 2123742783u32 / 82464430 - 896155531][3599492765 + 469168208 + 1510002368u32 / kDEUr(((U5YY, 2490679513469546434529351683782591947174770828265084971041727633159185080151531469641950514197128009829000203315755718140996406599875799694693523808457143field, [(-98i8, 37092u16)]), 188547537262576526670523000470002996434, 36693u16, WJFU1.1), eGKE[0u32][1u32]).2 - 4068660976u32]; + const mvUJr: [u128; (2, 3)] = [[192135102743266045779694578941481188480u128, 250316349057433474146799608574805237644u128, 232012296241327518720945688036673048736u128], [140153643843594627170578302698357494486u128; 3]]; + const Mxoc9: char = '!'; + let Id7g = (44923u16, '\u{7}', ['{'; 2], -26120i16); + if (OeE4B, 1374) == (120u8, 6487u16) || eGKE[eGKE[3587636127u32 / 1734717873u32 * kDEUr(((aleo1559jt2h8tqaqjjg8376nl8jgwc9cnr3rjvdac78s6uhfkfgdy58q8rvy34, 4893039754597810991298101006579207465658269559265607181406483387920310275546431026893580245633409806089162204882902581239961472845825571507775938543642478field, [(Xlbx, pofE); 1]), mvUJr[1][1u32..true? 1093450336 * 2u32 * 0 * 0u32 - 0u32 + 3u32 : 3u32][0], Id7g.0, WJFU1.1), eGKE[1421989724 + 2282765521 + 1 ** kDEUr(((aleo1w9ea5jhqfvlkf63dfepcvgvlhu8jymyna7t0xx6xzse8n9czgurqu32kad, 12553051198281264968411827973380821180152422734228413690022186641595490316661398472030208591140127071025109535839461656919590189834665276233238839668056456, [(-6i8, 27335)]), 169542850521684343130284369641384038448, 44392, 3727181691205833796346995232789395995452385289630482711223012484507052098570222170942893024610259723295955017055379300068326693405492410815606192348210162), true).2 * 1640793295u32 * 0 - 3704755245][0..2][1u32]).2 - 869324706u32][0..2u32][0]? 0u32 : 0u32][0u32..][1u32] != eGKE[0u32][..2][0] { + let wWeZ3: i8 = -93; + let epWx4 = kDEUr(((aleo1guhrk23u5qwjnz8e8cmp6aj9ecs9kxvxfh00qdw9x6e44wzumqgqvnlgmq, 10850347706529691777383717267011097059081564264327863153034046577664766768121774050313599314193730778947782829388854050400394295607533685465139069269751942, [(-62, 44990); 1]), 137377424026935693438565684896161687398u128, 8800u16, 3565615291890963597709054041735431255229923978841874140464190589208258967469909660677502450044900127682733477177316102377810434350705282439917460198185775), false).3; + const us0a = false; + const Achr: bool = us0a; + const f9rd: i64 = D7Xx; + const xiaW: i64 = WJFU1.2; + if Xlbx == Xlbx && epWx4 != epWx4 { + const Jrg4 = [aleo1vv9rhr2t05pdl2sfqxjg6xclky9c66pv9y92k4dzcpz5zu97m5qsccmu6c; 4]; + const Tfxe: char = '\x38'; + let PNP2F: i8 = Xlbx; + let QJq3: i16 = Id7g.3; + eGKE[0u32][0..][1] = us0a; + eGKE[0][0u32..][1u32] = Achr; + Id7g.2[0u32..1][0u32] = Id7g.2[0u32..2u32][1u32]; + const ybJxx: i32 = -1337727605i32; + const DyNk: u128 = mvUJr[0u32][..730328362u32 + (0u32 ** 984982457u32 ** 1u32) - 3552469159u32 / 3288198542u32 - 730328359u32][1u32]; + } else if -3627647846447564088 >= WJFU1.2 || [[false; 4]] != [false; (1, 4)] && U5YY == U5YY { + Xlbx += Xlbx; + let rYoi: (i16, field, i8, u16) = (15304i16, 3625259188763400242879491794840836446305612663997255866451867848521152710113680228748341130832324989157228483488461502392395711170008392647825262579121170field, 73i8, 4687u16); + let IaPsZ: u128 = mvUJr[4087366772u32 / 1121309916u32 ** 0u32 * 0u32 * 0u32 + 1u32][..1u32][0u32 ** kDEUr(((aleo1u59h09jcvx5zun6q97h34dhw96pe6e092caht7dm8xn6z3ypagrsp3rtud, 4572346816259149108743961473575372827369895305947975888914970127393094943768582719247196172453386943091243064784373101008901733439865373142568607156802019field, [(113, 60999u16); 1]), mvUJr[1][0..us0a? 2u32 : 2u32][0], yFrO, rYoi.1), eGKE[0][0u32]).2 - 3173809056u32 ** 0u32 * 0u32 ** kDEUr(((aleo1nsmvxzakh57tdg7x9uyexk90es5a03zd7dprynn8ywgj9ku8zsxs76c2xy, 13231270929795927303772027390821043840951668465103819710789039173773877854378660101481042606411970378869697545937991133234264609078057024095623687897522873field, [(-113, 26548u16)]), 187537437138539430164480165812094435266, 14634, WJFU1.3), eGKE[0u32][0..][0]).2]; + eGKE[0..1u32] = eGKE[..1u32]; + eGKE[0u32] = eGKE[0][..2]; + Id7g.0 += rYoi.3; + const IO7T: i32 = -1775026454i32; + const nInEx = false? OeE4B : OeE4B; + Id7g.2[..2] = Id7g.2[..2u32]; + } else { + eGKE[0u32][0..945890680 + (false? 975425886u32 : 3146089746) * 0 - 945890679u32] = eGKE[0u32][..1u32]; + Id7g.2[1..][0] = Id7g.2[2419375510u32 / 190259160u32 * 2047118047u32 ** 0u32 / (eGKE[0u32][0u32]? kDEUr(((aleo1r8j6hc48ehlwhkqrdumwd55alh3nrvx6nntxt5jstc6yhmm88gfqcsfkru, 154607879377828207039408865230382656642460575105035392923433776823685140532600490051892006678379951323378194927013475952015512998723056973980863745309892field, [(-116i8, 61504u16); 1]), 5904036629510321716572936841925707394u128, 2700u16, WJFU1.3), eGKE[0][..3321162822u32 * 0u32 / (2302801384 ** 0u32 * 3620175210) + 1u32][0]).2 : kDEUr(((aleo16uscssuaaxy2tt5c3lqyxx2afl8z7pus4v8ygfjux2wxm3c4c5xqwl77jk, 1983703272889905468311836805795055485164861238369026076348929176230261086685907618645648838270802265401728739210864892526398594546017419684284779373009088field, [(14i8, 28890); 1]), 124153545594470221385586778552050724536, 40890, 12151836699736089119504903080018693322145319182124805149232958935846145521476055396995487179113270824459142148947281187229889156575035077182723450145657888field), true).2 / 863700377 * 0 + kDEUr(((aleo1dw2lmvrzx4y3x8fffgn8hcr22g30nqrzgmv30fz7nkadlg2qfvgq3akljz, 29732478688380494703339886956751542152110817174982441900083078413148796023106524594518819116049126014992186605540919343965295614262205387916810526553744, [(18i8, 2843); 1]), mvUJr[0][..3][1u32], yFrO, WJFU1.3), eGKE[0u32][0]).2) - 0u32]; + eGKE[0u32][..2u32][1] = epWx4 != 582403777i32 || (Achr? f9rd : xiaW) > D7Xx && 123i8 < -35; + } + } else if (WJFU1.1 * WJFU1.1 + 4997196675491260686001972934572280655948598823503424920331071523371386872790 - WJFU1.3 - WJFU1.1, oSqd, tG_o[0u32][0..2u32][1], (118, -25912i16)) != (5689382486401851183244561252762534880901387299311469507557881598344946452378644684946541128384662553424523434570526106597122063636091236834612694116299023field, 688179155413492233i64, 3270723359228597020u64, (-128i8, 28672i16)) && WJFU1.1 != WJFU1.3 && -1045737702 > 1167872995i32 { + let ezOw: TESjC = 176; + Xlbx -= Xlbx; + let zkzx = wuEu; + const B6nF2 = -865346137i32 - -1506338518i32 - 1889286591i32 ** 1i32; + ud9u {}.txH_(); + Id7g.2[1..2u32][0u32] = '#'; + Id7g.2[..1u32][..1][0u32] = Id7g.2[0u32..][0]; + Id7g.2[1..] = Id7g.2[..1u32]; + } else { + let Ddgt: i64 = WJFU1.2; + if wuEu > wuEu && 4950191121644525007 * 1 + WJFU1.2 / D7Xx + D7Xx / D7Xx > Ddgt && (3445709662445339124966039955851910804825394763370142824106604387483865997362734623038345126555362147677743770469355767645697752481754904401585905040649845field, 12760233673026295027169325044258802893205988142757535481584951002852675315682976473240833997243099468269850726585895476087054478306870052616041699264571589, (false, 2362554768193566915017550509045849086111347769924326264905379896693764679651344674477430023748331696530454272840838499562488956265850450263335219724879307field, 13, 238567901038010930208120788385310382705846250069475009354407688177082454479483307254797504692991707028073390522123272123983358360941385246857379307641155), 714903914) == (WJFU1.1, WJFU1.1, (eGKE[0u32][0u32..][1u32], 4993859481089268687173684676314618051582712413234438444938276593501161971006238398744898606637894395649165706956113041208809079590082468227312357865660736field, 1u8 + 232u8 ** 0u8 - 0u8, 5146126727091813424584693335683521116282876803042677903474218001976551388900344647364718712119059322786863710041208868953765066730245850518116415104245194field), 734730659i32) { + let j4xdK: bool = eGKE[0u32][0u32..][0u32]; + } else { + let rvHo: i8 = Xlbx; + } + let By0o9: u16 = Id7g.0; + if mvUJr[1][1u32..3u32][3976141290u32 * 0u32 + 888605653u32 - 888605652u32] > mvUJr[1u32][0..][0] || By0o9 > By0o9 || Xlbx == Xlbx { + const gQ0ft: address = U5YY; + } else if wuEu == -160335800677657412752072363260265326402 || [[true, false], [true; 2]] != (eGKE[0u32][1]? [[false; 2], [false; 2]] : [false; (2, 2)]) || Id7g.3 >= 14928i16 { + eGKE[0][..2u32] = [false, true]; + let pBr5 = 86236897525765601521958346370883266108i128; + let K6YXq: TESjC = 139u8; + const kA2Ks: u16 = pofE; + yFrO *= 20u16; + } else { + let XfS0 = U5YY; + eGKE[0u32][0u32..][0] = false; + oSqd /= Ddgt; + eGKE[0][2714664265 + 265918089 + 0u32 ** 4284932475u32 ** 1 - 2980582353..][417523846u32 ** 1 - 1149997708u32 * 1u32 / 3327611392 - 417523846] = true; + let JziC: u16 = yFrO; + const mCeT: i64 = -9200318551018854695i64; + } + Id7g.2[1..2][0u32..][0] = '\x7a'; + ud9u {}.txH_(); + Id7g.2 = Id7g.2[0u32..2u32]; + const miqRZ: field = WJFU1.1; + Id7g.2[1..] = [Id7g.1]; + } + let MzbK1 = mvUJr[0u32][1u32]; + } else if kDEUr(eGKE[0u32][4220456327u32 ** 0u32 + 920325500u32 - 775699652u32 - 144625849..1][0]? ((aleo1dtjlzdar745jwhvf5vhdeak3pdvarsr8jfx2t78hdl86x77ykqpqg2hks7, 10370644121642292595522409921374543364347459055821343939899800512248497191619899977622618403047143654246392905951500535716071354350642769414032597379940456field, [(124, 6169u16); 1]), 111931430081106712937097825451394535656u128, 48941u16, 10579470616455153490081489709169828901595762761679051557680779383918092539985392613485269936591554688538019497232448460996768405534418536976127377158654917field) : ((U5YY, 7275473031633978899663765071702200825091065017135552629728814753923979270436271907411600144211677939826486129786424145608822037266543066553809169109293374, [(-73, 37996u16); 1]), 334220435131399063682028438435658901662 - 35237824718992320204349492467850013805u128 * 2, 62465, 4069179869508152711227405075145957342268191129422751515316413854428985697968190682821997649146293743131581293119946427609890753151066109801720999353418883), eGKE[0u32][0u32..][..2u32][0u32]).2 >= 830715864 * 0 * 0u32 - 0u32 + (false? 1432888226 : 878164863u32) && aleo1f6y674hy8hqmzyk4fpwh0k4ftmh87aeqmdepp8d7mpsx8qmlxg8qetx9ch == U5YY || [861534212] != [kDEUr(((aleo122x2vcp2wx4hmzaa20l05tdczx5f2lzkfjwprd5v7j6p37cezq8qywr6hm, 1259883616915239703117645974018378541934807819884841255104732964781216350849549077253305202652484258263637381863439462808981263385937792580382458607366588, [(57, 52212u16); 1]), 135403533360244029398138511608494947816 * 1 / 49614810379508161127983409048041043135 + 10u128 * (true? 15081697512629196355910705568558178274 : 24103367896811228082909608839761037922u128) + 38265341771786524718198635716867211804, yFrO, WJFU1.3), eGKE[0][1..][0]).2; 1] { + eGKE[0][0u32] = false; + eGKE[..1u32][0u32] = [false, eGKE[0][2638085348 - kDEUr(((U5YY, WJFU1.3, [(104i8, 38695u16)]), 45449989719842721759392643706511860045u128, yFrO, WJFU1.3), false).2 - 3875654274u32 / 575679938u32 ** 0u32 * 0u32 - 2203422994]]; + eGKE[0][1] = (10028293976899540510u64, 63864u16, [false; (3, 3)]).2[1][0u32..][1u32]; + let lZ0a: u16 = yFrO; + let TxK3a: i32 = -1346274927i32; + } + eGKE[0u32][0..3020829405u32 / 2816243188u32 ** 1u32 * 688944866 - 688944864] = [false, false]; + let Bsws: i64 = 1953871591801733083i64; + } else { + let lmZNX: i64 = 2169515082030718947; + let Qudw: address = U5YY; + eGKE[0u32][0..2u32] = eGKE[..1u32][..1][319641018u32 / kDEUr(((aleo1e8vpjm2j6jm8q5msdz4lc0rfrmtkm3vhrpjcgpfsgcrc9907pygsz4htjt, 10906489555755384996160253267530748839587906592661473642143908920262899070262611087944298991260771730528727100761548853063124541410810053582752622065153317, [(-52, 63279); 1]), 14708957858605865911442517788844336623, 15329, 11493993658091838526906957036054647156831193054796422378866703169572166986935069159121719284018670105571796350570592933752742764863914905511942988023255439field), eGKE[0][1..][0]).2 ** 1 + 2127061393u32 * 0 + 3437810752u32 - 3437810752]; + let nzbS = wuEu; + } + const NNes: XgJbM = WJFU1.0; + return eGKE[0u32][1u32..2u32][0u32]; +} \ No newline at end of file diff --git a/parser/benches/large_5.leo b/parser/benches/large_5.leo new file mode 100644 index 0000000000..e26d11f4d2 --- /dev/null +++ b/parser/benches/large_5.leo @@ -0,0 +1,310 @@ +type NmYjQ = i32; + +const K_baB = [85i8; 3]; + + +const Piti: bool = false? true : false; + + +const GC5na: ([u32; 4], [[address; 3]; 3], u32) = ([3448216382; 4], [aleo1lfftk849g5y62cpw2u2dlad8dq9am85c2pej0lfcq5va88weecyqpv8yqq; (3, 3)], 208128685u32); + + +const lB6c: u128 = 162298174429733905534736049855024103711u128; + + +const AXWu: i32 = -1572240138; + + +function main () -> ( + char, + i16, + char, + (bool, i8, i64, i8), + NmYjQ +) { + const R9rQ: u16 = 51243u16; + const vOwHC: u16 = R9rQ; + let IA55 = 10924234741147826596u64; + IA55 = IA55; + const qBqw: u128 = lB6c; + const Obu3: u128 = lB6c; + IA55 = IA55; + IA55 += 6445515318607477828u64; + const woTZ = (-277680533i32, 5632111985474328273292436822461150888i128); + return ('\x6a', -32246, '\x0f', (false, -78, 134482078048524008i64, 54), woTZ.0); +} + +circuit XzVq { + amVgA: [i64; 2], + + function m0NjV (self) { + let ns7a: char = 'L'; + let fk8H: u8 = 249u8; + ns7a = ns7a; + let crneu: char = '5'; + let MVol: bool = Piti; + //RETURN + } +} + + +function yJ9T ( + const LZhKs: address, + const lHpLu: i8 +) { + XzVq {amVgA: [2367901415351931474; 2]}.m0NjV(); + let ADccF = M6Cza {}; + let un49O: u16 = 37669u16; + let uCXu: bool = Piti; + let ey4HW: u64 = 3300386990536871051u64; + let sHctQ: u32 = GC5na.0[0u32..3u32][2u32]; + sHctQ += GC5na.2; + //RETURN +} + +circuit M6Cza { + + function JYvIz ( + self, + const dK1r: char, + a05bL: bool + ) -> [i128; 3] { + const Dbmn: u16 = 48758u16; + let rNzi: u64 = 9786653144134249844u64; + rNzi /= 16472830353492137635u64; + rNzi /= 10130180327331766099u64; + let jFUi = XzVq {amVgA: [-5915449544088967853i64 * -1i64 / 2362964183957924237i64, -3971487555647040975i64]}; + jFUi = jFUi; + let PFCiY: field = 665449050833366163801950040274954303336695772749654704340515271878277165537536782102487505520376157097812176726897377986635097686633953549643734642663957field; + let RjR1 = Dbmn; + if [Dbmn; 3] == [27923, 44475u16, 50595] && false != a05bL { + let ZsAa = dK1r; + const B73fS: (i128, bool) = (-158089465950985221687422606333866663655i128, Piti); + jFUi.m0NjV(); + let h2hwS: field = PFCiY; + return [157852251306494179667475462121192004686i128; 3]; + } else if -63918006093606870481770261696050297213 < -56495550124737581022458288911787298947i128 || dK1r != dK1r || PFCiY == PFCiY { + XzVq {amVgA: jFUi.amVgA[..197696103u32 + (GC5na.0[0..2u32][1] - GC5na.0[1u32] + GC5na.0[1..Piti? 3u32 : 3u32][1u32]) + 46417396u32 - 3692329879][0u32..]}.m0NjV(); + const nNfe = AXWu; + return [92541869758983182973755356221231277316i128; 3]; + } else { + const F3wC = lB6c; + const eRfOf: i64 = 6615865733488357448i64; + PFCiY = 13210292667569411295876582680213285999734348468822303319353672409053939436084664250738747493105491382106522124003482872326125862769110639573504536945005026field; + jFUi.amVgA[0..][GC5na.0[0u32..4u32][2] - GC5na.0[2] - 703626867 / GC5na.0[1..4u32][2] + 1] /= jFUi.amVgA[0u32]; + let X67R: u32 = 3806229975u32; + return [-57715398463157412841011851386521399516i128, -38320140130521463705530560331425690648i128, 70285342755721462672599998236995271037i128]; + } + } +} + + +function Hv_R ( + const hdIB: i32, + hGCWD: FjCxy, + Ng2Y: XzVq +) -> ( + i8, + (i64, XzVq) +) { + const iRyz: i8 = K_baB[..1u32][0u32]; + let Z24jc: i8 = K_baB[0u32..3u32][0u32]; + Z24jc = K_baB[..2][GC5na.0[GC5na.0[..4][GC5na.0[2u32..4u32][0] / (GC5na.0[..2][0u32] - 0u32 ** GC5na.0[0u32..3u32][2]) ** 0u32 / GC5na.0[2..][930726283u32 / 2072894369 * 539781298u32 ** 0 * 0u32 + 1] ** 1 * GC5na.0[..2][0] - 3448216382u32] ** 0u32 ** GC5na.0[2..][1u32] + 2690999757u32 - 2690999757u32..3u32][GC5na.0[..4u32][0u32] * 0 / GC5na.0[1..][0u32] + 1] - 85333289u32 - 1250392080 + 1464596585u32 - 1454877115u32 - 2122210482u32]; + let I4y7: u8 = 1; + let EiX0: (i16, i128, char) = (-16393i16, 157776413619505894407704989602317788511i128, 'K'); + const s_3QF = 7249575175756079635i64; + Z24jc -= K_baB[(false? 2u32 : 2)..3][0]; + if 8451888259556015495830721527065764415025400166428207271661929189596630352926871853508994188932966884245189345045039601784362781772864676346859074246946163field == 11012775681384774712529333893121831410089026669120068975870674724655965209337389759466846852993569820558647449740077887191573324109514103515080957367667097field && 11537533470918506307708947880126150677173025345105109319452507266700925872711339094659951244000194733571650816143210040432369657103213714690849923401527240 == 13267155018508793225600470434279136160210683842295053847708184157465110711629711349737184665975669085065149008806453969639343232025453198205738841248015753field { + let Tupk = 62263u16; + const QL3ab = Piti? aleo15493t0zw0z2kxpkv0v6t5ufzy8955vlyep8qwatl7xcysr2msgzq6al67l : GC5na.1[1][0..2][0]; + I4y7 /= I4y7; + } else if 10510193118362467927702685754181902755859312520259032066366242122057602891635261901588538552529178222392629034433796480747194732401519855447280039864447190field != 10323020605364273285682111767575543276647475815895233465743149981858876233545354422470080167582462356552069862579691769248295430704410880723942383909858847 || I4y7 < I4y7 && 59 > 181u8 { + let I2qT = AXWu + -573512413i32 * -3i32; + Z24jc **= 125i8; + const tWZjx = [false; 1]; + } else { + Z24jc /= K_baB[0..1][0]; + I4y7 *= 231u8; + } + EiX0.1 = EiX0.1; + if 9673u16 >= 17571 || EiX0.2 == EiX0.2 || ((6605630297873056610026724284365997549292345399335935178800599738704530115800072964350790931488587647404602937455762336644170361236487728451889417256291489field, -3243570615589615825), 46788) == ((183373165870398460009473875903085947412650315657657244564477883647771846091964027549181661541602158070473387786985615260222601574919348807464992392922535field, -2224739339763290381i64), 26108u16) { + let JVWQq: bool = Piti == Piti || 108i8 >= (4481063272727283166896005434320654337479487679034546284963307730775322010606686848325521560124312457672695271817161699386892416796626182551177144682977100field, 66i8).1 || 111i8 >= iRyz; + EiX0.2 = '\r'; + const zKUb: u128 = 15886401916204892493948663420208300866; + } else if I4y7 > I4y7 && GC5na.0[1] ** 1 * 0 * (1882593815u32 + GC5na.0[0u32..3u32][1u32] * 0u32 ** GC5na.0[0u32..][3] / 1u32 ** GC5na.0[0..4u32][3]) * 541123131 ** 1 >= 2557011466 || lB6c > lB6c { + let Fliam: field = (6396378861739788768752167643123248196265510649978143323098231336185876021990 - 1562253746949333604976323116241847959188129176659344651191305155144323566893field - 1907590690079466125593988264803794530863623718776019788228600481978822285979field + 2826192401061709981552707701883329449637423679161878864741672467914281024731 - 7744155930567596367555138454895265470835379008487414199545455727428494397068 / 5887382286969298091463502399117813574976696749392276217880855580177392624329field) / 8138068432985050796709811429199400527728756964199209562353182355729034161610field - 4676363783900024209476989322077524423319736925630347387334837845138297847636 * (7716393770037956249493463814426875880088065621995766965952859225009720876060 + 4054464491818517944465041925004453961450750498666581601966133390075900630291 * 6470619646586328969212970545234385916067473967938270008214262410940824854748field * 5136019809719697126337585033338630155246336585752266299393598434820183635657 * 3199363828121504572471936072786041570218898172308476844390465125426120775261field / (2870735947046075509431120577200145564983224486153161281542380005676840924255 + (Piti? 7326514850008204114193923413140668023593712788820594320620854420992269671010403885619751867126434250975412004398786396991063063100809114630960658260759184 : 287691821947227194648690594322191785809355376991124495822673931314225986843982741156194617314207885085663542930841654298382265328931537999256280842784429field) + 4111224977412177408644345424935033581093673186776072518639702215411409276491field / 6396924971239159712318152437767102244199601932533137181403685339120257803760 / 2032052115950198440446636907339521858006331115389735204024877422557742018957 / (6439397127355927479815766604033208761884791896154148632511703534770967748614 + 6823611677553532338624085026977586921458547252011571045537956888166702594766 * 5498224734100066579769005985640226311034780030805045144507141850150142945239field * 5718520185124928482804734388192245075695544323566979546232491889023610798291field * 7542226518570052291643647771726838475087911398749371995409807077080488605891field))); + } else { + const CCYf: u8 = 69u8; + const TUdx: ((i16, u32, char), i8, field) = ((-16229i16, 1376365916u32, '\u{951c4}'), 30i8, 12173002344181128654339279354796894183971985760710774565698927037560371981971617359621927577061674798615472633279532436485473795733167256616729998612175398field); + if GC5na.1[1u32][0u32..3u32][GC5na.0[..2][0 ** GC5na.0[1..][2] / GC5na.0[1u32..][1] / 2450550577] - GC5na.0[0u32..1][0] / GC5na.0[3u32..4][TUdx.0.1 / GC5na.0[0u32..4][2u32] * GC5na.0[0u32..GC5na.0[0..][3] + GC5na.0[0] ** 0u32 / GC5na.0[0u32..3u32][2] / GC5na.0[..4][2] - 3448216378][0] * 0 * 0 - 0u32] / 2332650131u32 - 3448216380] != aleo14uq2mutwp4sp6g9kn3huklt7clmk4g0xeqq5akxvxnj4vu4c0sxqrv4379 || 28410 > 30824i16 && -113383771062135197880751679502769501310i128 > 7273624671757503050848051095764363087 { + const HqWt2: u8 = CCYf; + const QRcKx: (i64, u32, u64) = (-3673578757000504846i64, GC5na.0[0u32..3u32][0u32], 6872941707062733567u64); + let VVFz = EiX0.1; + I4y7 += CCYf; + if -3207026076534034896i64 <= 3652263778919217051i64 || TUdx.0.0 < TUdx.0.0 { + let QaPU: i8 = K_baB[..3u32][Piti? 1 : 1u32]; + let CyFXp: u8 = 0u8 ** I4y7 * HqWt2 * lXFx(TUdx.0.0).2; + let qhXNF: XzVq = Ng2Y; + EiX0.1 *= 0; + const s0qB: u64 = 16748477482649535899u64; + } + } else if 6023u16 != 40984u16 || I4y7 > I4y7 { + const LsidE = (XzVq {amVgA: [-6062086657179083330i64; 2]}, '𡐉', 163u8, 8183u16); + } else { + let Ibvtm: [char; 4] = ['\u{46988}'; 4]; + Ibvtm[0] = Ibvtm[1u32..][0u32]; + Ibvtm[3u32..] = Ibvtm[2u32..3u32]; + Ibvtm[1..4u32] = ['?'; 3]; + Ibvtm[..2] = ['\u{c42a7}'; 2]; + let F6EV: u64 = 17128117265803594802u64; + let sbql = hGCWD; + let lsjqA: (u128, address, address) = (4559977830801778029892755119050981913u128, aleo1wv8s4kv5cyseta3579ua2l375gdshj7y4lp5vnyj8sf3v2stdcgs37q0cm, aleo1r6flxcqqjpwsrhhu2xvlpcuajj3pzfy5kuunwm3st5vdp2qnmsxqstv5ps); + } + let DULm: u32 = 2812309314u32; + let CldaL: u8 = 195u8; + } + let XUbZ = hdIB; + EiX0 = EiX0; + if 27066 > lXFx(12217).1 || 6927229215077945246u64 >= 7423605298906567602u64 * 0 * 0u64 - 0u64 { + const sRO1: u64 = 8638881537800293187u64; + let R8WQ3 = GC5na.1[1u32][0u32..3u32][(GC5na.0[2u32..][1u32] + 410433655u32 - GC5na.0[..4u32][0u32] / 2215520944u32) - GC5na.0[0u32..][GC5na.0[1u32..4u32][2u32] / GC5na.0[0u32..][0u32] ** 1u32 / 857889251u32 + 3u32] ** 1u32 / GC5na.0[3u32] / 1u32 ** GC5na.0[1u32..2u32][0u32] - 3858650035u32]; + Z24jc /= -37; + return (K_baB[2u32..][0u32], (Ng2Y.amVgA[1u32..][3628841383u32 / 4123574656u32 + GC5na.0[0u32..4u32][3u32] - 3448216382u32], Ng2Y)); + } else { + EiX0.0 **= 1; + const x97BK: u32 = 345049321u32; + let TJGWW: (i64, i64, u16, char) = (-2112081792003952471i64, 675970213075073906i64, 24532u16, 'Z'); + const Yoph: i16 = -27924i16; + let MpPzW: u8 = I4y7; + let zFL2 = Piti; + Z24jc += K_baB[3409642267u32 / 4180980559 * 0u32]; + const jmXt = 1735784169u32; + if EiX0.2 == '\u{f9517}' && 16167948181270667293u64 - (18319198699454340865 / 3088893505027334567u64 * 2160983166367418132u64 + 9515024868518284807 * 0 + 4204057007392572310) - 17972255788488367608 / 2868695264298187559u64 != 16210555867748384950 { + const Og5B: u64 = Piti? 14082318920386055479u64 : 11881386050725131201u64; + EiX0.1 *= 1; + zFL2 = Piti; + TJGWW = TJGWW; + let dW09: i64 = Ng2Y.amVgA[0]; + TJGWW.0 /= -8341229632512320238; + } else { + const gHsV0: u64 = 15489463556002917073u64; + Ng2Y.m0NjV(); + const Zy_s: u32 = GC5na.0[Piti? 3u32 : 3]; + let tC3lK: char = TJGWW.3; + } + return (37, (-2093390865580218817i64, XzVq {amVgA: [-8123038279259036857; 2]})); + } +} + +function lXFx (XK0T: i16) -> ( + char, + i16, + u8 +) { + let GevsK: i8 = K_baB[0u32..GC5na.0[..4u32][0u32 * GC5na.0[..GC5na.0[1u32..][1u32] + GC5na.0[0u32..][1u32] / GC5na.0[0u32..2u32][0u32] - 3448216379u32][3u32] + (18065u16 < 21604u16 && GC5na.1[0u32][1u32..2u32][0u32] != GC5na.1[Piti? 1u32 : 1][(false? 1u32 : 1)..3u32][..2u32][0u32] || (GC5na.0[..4u32][1u32] >= GC5na.0[..4u32][0u32] && -1307689122451390649i64 == 2127488539316075275i64 || K_baB[1u32..][0u32] != -51i8) == true? GC5na.0[..(Piti? GC5na.0[..3][2] : GC5na.0[(true? 2 : 2)..][1u32]) / GC5na.0[1..3226391491 ** 3528347423u32 ** 0 + 145035181u32 - 3371426668u32][2u32] + 3920272396 - 3920272395][1] : 783239167u32) / 1455575933u32 ** 1u32 - 2u32] * 0u32 + 1877417993u32 - 1877417990u32][..1u32][0u32]; + GevsK **= 0i8; + let GZ9Be: FjCxy = FjCxy {}; + GZ9Be = FjCxy {}; + let lB8N: u128 = lB6c; + if lB8N > lB6c && '\u{14}' != '\x13' || 29836 >= (false? XK0T : XK0T) { + let txzUG: u32 = GC5na.0[2u32]; + let A50Vs: u16 = 12542u16; + if 5650008019146055916554586508371930930351435245054512787396927850192656022068field - 4933227739834069390849610110138103961767173270961316895740777281238360037115field + 70431822478396507075527188341288113728009976499101402504086455300768429371field == 1590870218966073091314252912732397618743063305358546847191387592337819796667 + 2872808458803440163284803150927406551373031395178872573747154805401730941206field * 7212868918825428953927155085253730102525790498605071358132902668412984131997 + 2995581854747478141140241750009120639327102627412190809155046253592740575026field * 1824777979924669359693556898537399710828257246578657532771346569613386056695 && GC5na.1[1u32][..2][0u32] == GC5na.1[GC5na.0[2..4][0u32] + 792376471u32 - (GC5na.0[1u32..Piti? Piti? 3u32 : 3 : 3u32][0..][1u32] / 112388018 / GC5na.0[1u32..3u32][0] / 116183050 ** 1u32) ** 2807171279u32 - 4240592852][0u32..1u32][0u32] && (-6618439962282640257, 31716) != (9001458957811067500i64, 714u16) { + let u1jkn = XK0T; + GZ9Be = GZ9Be; + A50Vs /= A50Vs; + const W5ty = Piti; + GZ9Be = FjCxy {}; + if lB6c > 252185208672613692740092054599750472323u128 || 3800805862554725604i64 / 4093465489338565326 * -1 * 0 > -8735765288935445631i64 && [15905i16; 1] != [-20876] { + if 503271405i32 < -1822815827i32 || 357941800873541969898682795565829563411233125965547729542360937017200033481812906459993968753506998632075420756324433909006918976184664261303953996341517 != 2985898859737055148243482254769697530770128832797044716399468557583383410819268117234438571517507247730744537292464564471428094238378600383332188425274075field { + const D5Tqt: u8 = 224u8; + const rKhFB: bool = W5ty; + const D45X = lB6c; + const vuTlx = -5634989829341940409i64; + let l4pc: field = 3031214035321266989747422688264556869165193730115967779088357747657440424579131093595423265556350362939419741625853198769891529197590822464761357748535833field; + } + u1jkn += -9708; + A50Vs = A50Vs; + A50Vs *= A50Vs; + let bcWi: address = GC5na.1[1u32][301086311u32 + GC5na.0[..4u32][3u32..][0u32] - GC5na.0[..0u32 ** GC5na.0[1u32..4u32][0u32] * GC5na.0[1u32..GC5na.0[1u32..4u32][0u32] / 3860763016u32 ** 0u32 - 3448216378u32][GC5na.0[0u32..][0u32] / GC5na.0[3u32] + 1275166309u32 ** 1u32 - 1275166310u32] * (GC5na.0[1u32..4u32][1u32] - GC5na.0[3u32..][true? 0u32 : 0u32 * GC5na.0[1u32] / GC5na.0[..2u32][1]] + 78568537u32 / 894338155u32) + 4u32][1u32..3u32][1u32] - 47545458u32 + 736110778u32 - 989651629u32..][0u32]; + } + let illfz: bool = W5ty; + A50Vs += A50Vs; + } else if 157 <= 255u8 && GC5na.0[..3][2u32] > GC5na.0[2u32..3][0] { + let QSFiW: bool = Piti; + } + A50Vs = 54465u16; + for YvHu in GC5na.0[0..2][1u32]..3448216412 { + let M2JW0: u32 = GC5na.0[0u32..][2u32]; + let ea5X: i32 = -1116691885i32; + if GC5na.0[1u32] > 2436904091u32 || -36116492946513054660489981462153647973 > 145836909874245468519676552562733775458i128 && 131511527684725280380205228950986952270i128 / 96382253206826283697837771167639093749i128 + 119069848725345222899291714663526773719i128 / 86075031580567774256760522683169900464 != -154504546051089382197739749201383627028 { + let ziyyO: u32 = 2445597197u32; + GZ9Be = GZ9Be; + } else if A50Vs < 49919u16 || 11858539661841911680u64 != 8066479542160191036u64 || XK0T >= -11268 { + let L2Mu2: [i8; 1] = K_baB[2u32..]; + } + let xICSI = GC5na.1[0u32][..GC5na.0[2u32] + 808903237u32 / GC5na.0[0u32..][0u32] - 1u32 ** GC5na.0[GC5na.0[..4u32][3u32] / GC5na.0[0u32..][false? 0u32 : 0u32] ** 0u32 - 3448216381u32] * GC5na.0[..3u32][0u32] + 1u32][0u32]; + const tpvo2: i64 = 5729090369714237708; + ea5X = ea5X; + } + txzUG **= 1u32; + lB8N -= lB6c; + } + GZ9Be = GZ9Be; + GevsK *= K_baB[4144431037u32 - GC5na.0[1..false? 4 : 4][0u32] - 240862610u32 - 455352043u32..GC5na.0[0u32] - 1625788343 * 0u32 - 3448216379u32][0u32]; + return ('g', -3069i16, 85u8); +} + +function nKDZF ( + GQvi: i8, + const PA5e: i8 +) -> ( + u128, + address +) { + const Ga8b = 66u8; + const ZTrqz = (61714u16 + 1695u16 + 1705u16 + 1584u16 / 16493u16 / (35611u16 ** 0u16 + 58312u16), lB6c, (false, true, 8093244057719019961894348430889680190272144977514810266826054962064561285394847912582096010413630818468376067546881213613711423727537355713533485479686490field, 1859488065694876536u64), Ga8b); + let J95N: u128 = lB6c; + J95N *= 0u128; + let acICD = Ga8b; + J95N = ZTrqz.1; + let DMNz = K_baB[0u32..(3437263896u32 + 835594347u32 - GC5na.0[1u32..4u32][1u32]) / 1261474132u32 / GC5na.0[..2u32][0u32] * GC5na.0[..3u32][0u32] + 3u32][2u32]; + let tXGsI = '\u{9d563}'; + DMNz -= K_baB[2..][646416367 - GC5na.0[3..4u32][0] / GC5na.0[0..4u32][2] + 3124847898 - GC5na.0[1..4][1u32] - 323047882u32]; + const jdMow: i8 = -122i8; + let hgngX: (i64, i64, i32) = (-3338157062156526977i64, 1655542284862083064i64, -826307539i32); + if -1853591717 < hgngX.2 || GC5na.0[0..3u32][0u32] >= GC5na.0[0u32..1u32][0] { + DMNz = 86i8; + const ca32: i64 = 7662664585440494512i64; + hgngX = hgngX; + hgngX.0 *= 2i64; + let U9_l = ZTrqz.2.0; + } else if -311606970 <= hgngX.2 && 1513381302355575806151475121676224619075997051620832438053416936851070376282365927807691500240864045705745854209431664169742023365721287514984843573289436field != ZTrqz.2.2 && ZTrqz.2.1 != ZTrqz.2.1 { + J95N += J95N; + } + if tXGsI != '\u{47}' && GC5na.0[0u32..4][1..4u32][2] > GC5na.2 { + J95N += 25026043934213379684868521121867068361u128; + acICD /= acICD; + let qapVn: u64 = ZTrqz.2.3; + const sPx2: u32 = GC5na.0[0u32..4u32][GC5na.0[2u32..][0u32] * 0u32 + 3618742644u32 - 3618742641u32]; + hgngX.0 += hgngX.1; + hgngX.0 /= hgngX.1; + let dSHwS: field = ZTrqz.2.2; + const hgo_i: FjCxy = FjCxy {}; + return (26612933517182050769569932657707698703u128, aleo1pt2e0h5r7jhm38deqgk398rwh8xqgw7jscw476g7ev3hap5r0vyqpz4578); + } else { + let hVi5i: i16 = -24207i16; + let PdJc1 = hgngX.0; + const iY7iv: u8 = Ga8b; + const YXBXv: u16 = ZTrqz.0; + const FWSp1 = -998948994i32; + DMNz -= K_baB[0u32..3][1040336326u32 + 3790109365 / 751309844u32 + GC5na.0[0u32..4u32][0u32..4u32][0u32] * 0 - 1040336329u32]; + hgngX.2 /= ZTrqz.2.0? FWSp1 : FWSp1; + const jLMcn: bool = false; + let ITsX: bool = Piti; + return (J95N, GC5na.1[GC5na.0[3..4u32][0] - GC5na.0[0u32..][2] / GC5na.0[319496605 + GC5na.0[GC5na.0[1..3][0u32] * 1u32 ** GC5na.0[1u32] / GC5na.0[..404575834u32 / 1271543374u32 + 4286953846 + 1181410u32 - 4288135252][1] - 1u32..4][3u32] + 0 ** GC5na.0[1202683606u32 / GC5na.0[0] / GC5na.0[0u32..3][2u32] * GC5na.0[1..][2u32] * 0 + 1] - 3767712987..2u32][0u32] - 3448216380u32][..1][0u32]); + } +} + +circuit FjCxy { +} diff --git a/parser/benches/leo_ast.rs b/parser/benches/leo_ast.rs index 9394de2b6b..94f3f598b0 100644 --- a/parser/benches/leo_ast.rs +++ b/parser/benches/leo_ast.rs @@ -27,40 +27,42 @@ fn parse_ast(path: &str, input: &str) -> Ast { }) } -fn bench_big_if_else(c: &mut Criterion) { - let ast = parse_ast("./big_if_else.leo", include_str!("./big_if_else.leo")); - c.bench_function("Ast::big_if_else", |b| b.iter(|| &ast)); +macro_rules! bench { + ($func_name:ident, $file_name:expr) => { + fn $func_name(c: &mut Criterion) { + let ast = parse_ast( + concat!("./", $file_name, ".leo"), + include_str!(concat!("./", $file_name, ".leo"),), + ); + c.bench_function(concat!("Ast::", $file_name), |b| b.iter(|| &ast)); + } + }; } -fn bench_big_ternary(c: &mut Criterion) { - let ast = parse_ast("./big_ternary.leo", include_str!("./big_ternary.leo")); - c.bench_function("Ast::big_ternary", |b| b.iter(|| &ast)); -} - -fn bench_big_circuit(c: &mut Criterion) { - let ast = parse_ast("./big_circuit.leo", include_str!("./big_circuit.leo")); - c.bench_function("Ast::big_circuit", |b| b.iter(|| &ast)); -} - -fn bench_long_expr(c: &mut Criterion) { - let ast = parse_ast("./long_expr.leo", include_str!("./long_expr.leo")); - c.bench_function("Ast::long_expr", |b| b.iter(|| &ast)); -} - -fn bench_long_array(c: &mut Criterion) { - let ast = parse_ast("./long_array.leo", include_str!("./long_array.leo")); - c.bench_function("Ast::long_array", |b| b.iter(|| &ast)); -} - -fn bench_many_foos(c: &mut Criterion) { - let ast = parse_ast("./many_foos.leo", include_str!("./many_foos.leo")); - c.bench_function("Ast::many_foos", |b| b.iter(|| &ast)); -} - -fn bench_many_assigns(c: &mut Criterion) { - let ast = parse_ast("./many_assigns.leo", include_str!("./many_assigns.leo")); - c.bench_function("Ast::many_assigns", |b| b.iter(|| &ast)); -} +bench!(bench_big_if_else, "big_if_else"); +// TODO have to figure out why this causes `thread 'main' has overflowed it's stack' +// bench!(bench_big_ternary, "big_ternary"); +bench!(bench_big_circuit, "big_circuit"); +bench!(bench_long_expr, "long_expr"); +bench!(bench_long_array, "long_array"); +bench!(bench_many_foos, "many_foos"); +bench!(bench_many_assigns, "many_assigns"); +bench!(bench_small_1, "small_1"); +bench!(bench_small_2, "small_2"); +bench!(bench_small_3, "small_3"); +bench!(bench_small_4, "small_4"); +bench!(bench_small_5, "small_5"); +bench!(bench_medium_1, "medium_1"); +bench!(bench_medium_2, "medium_2"); +bench!(bench_medium_3, "medium_3"); +bench!(bench_medium_4, "medium_4"); +bench!(bench_medium_5, "medium_5"); +bench!(bench_large_1, "large_1"); +bench!(bench_large_2, "large_2"); +bench!(bench_large_3, "large_3"); +bench!(bench_large_4, "large_4"); +bench!(bench_large_5, "large_5"); +bench!(bench_massive, "massive"); criterion_group!( name = benches; @@ -68,9 +70,24 @@ criterion_group!( targets = bench_big_circuit, bench_long_expr, bench_big_if_else, - bench_big_ternary, bench_long_array, bench_many_assigns, bench_many_foos, + bench_small_1, + bench_small_2, + bench_small_3, + bench_small_4, + bench_small_5, + bench_medium_1, + bench_medium_2, + bench_medium_3, + bench_medium_4, + bench_medium_5, + bench_large_1, + bench_large_2, + bench_large_3, + bench_large_4, + bench_large_5, + bench_massive ); criterion_main!(benches); diff --git a/parser/benches/massive.leo b/parser/benches/massive.leo new file mode 100644 index 0000000000..704567313e --- /dev/null +++ b/parser/benches/massive.leo @@ -0,0 +1,1819 @@ +type ipD5 = i8; + +type g52FJ = (field, u128); + +type Jyso = u64; + +type RKDY = i64; + +function xkgDQ ( + VHRNV: u16, + const HpqAj: char, + TduE2: address, + CIH25: ipD5, + TNuT: i128, + const vkld: u16 +) -> bool { + let AplRe: ipD5 = CIH25; + AplRe += -87i8; + AplRe **= 0i8; + AplRe *= CIH25; + AplRe /= CIH25; + K9Bs::LjoKc(); + let F8Hz: bool = false; + let IOky = 881546951i32; + IOky = IOky; + const TRNW: [field; 3] = [52229033770530569921696198393655022366315333field; 3]; + let abSD = 12122i16; + abSD -= abSD; + const Gwob: (char, i32, u16) = ('u', 789561100i32, 10574u16); + const DPk5: [K9Bs; 1] = [K9Bs {loESr: ((-128039394044482088518779123604094450639i128, aleo1zwlrmf590vmhqydlxjgs5rd43x46pjhyugj8zrrkamky8cnu05rsut2lm3, -86747085543884150928801955315927104649i128), false)}; 1]; + F8Hz = F8Hz; + F8Hz = Pd5A(27601591420452158298237207018574816301u128, 335171108478483998811257610254833field, 15918154261295189660, 388183125, Gwob.1, aleo1evk396pdwyxwusj2puy4pf648uxdq2d65tgvehhynqmalrdx4urquw6t2e).5; + IOky **= 1; + abSD **= abSD; + const uq0m: i128 = DPk5[0u32].loESr.0.0; + F8Hz = DPk5[0u32].loESr.1; + const BQ2Km: address = DPk5[0u32].loESr.0.1; + AplRe **= CIH25; + F8Hz = DPk5[0u32].loESr.1; + const GGAJ = ch4X {u4M_f: 169u8}; + abSD = abSD; + if [(-7733118925153948897, true), (-4059088959430616954i64, false), (-8445018361350257034i64, true)] != [(-2995911939586971552, true); 3] || (F8Hz? 882524478 : Gwob.1) >= Gwob.1 && Gwob.1 > Gwob.1 { + kUOeO((11, GGAJ, TRNW[0..3u32][2u32]), 6u8, 17431871066067837519, DPk5[..1u32][1247013395u32 / 4204975342u32 + 4076997934u32 - 4076997934], K9Bs {loESr: DPk5[0u32].loESr}, -90i8); + AplRe /= AplRe; + K9Bs::LjoKc(); + const L3Fm = [36i8; 3]; + const BUmnX = Gwob.2; + } else if I3mv(DPk5[0].loESr.1? uq0m : DPk5[0].loESr.0.0, [1405226538227763345; 1], '\u{389bf}', 11111986481854456003836592851920198723u128, dPwrQ(132505566255761830653398443649347796045u128, 9138083402730825739720552300field, F8Hz).3).2 != GGAJ.u4M_f || L5kB(150u8, GGAJ.u4M_f, 73u8, Gwob.1, 48, Gwob.1, aleo1tkg487aajhwhn7w2h6en8eyavrlxdje0qqapwexy3mdrjw23ggrsr8lp45, (K9Bs {loESr: ((-61304105876345571068161142882995866660i128, aleo12pud28qyhhj4ku6lva7e5nm493htj9xfp6qqum3u9euqxrmy2ygqym2y5l, 125743590990098353565066168843863802332), true)}, 31188i16)).2 > 4166u16 || [Gwob.2; 1] != [37748; 1] { + IOky /= -1069634447; + AplRe -= CIH25; + F8Hz = true; + let tjW2: ipD5 = 26i8; + } + F8Hz = DPk5[0u32].loESr.1; + abSD *= abSD; + IOky *= 2; + IOky += -1500416441; + const G5aS: field = TRNW[..1u32][0u32]; + return DPk5[0u32].loESr.1; +} + +function QD4rE ( + FQOEC: i16, + const iESaK: i32, + rbdAX: bool, + gH34: u8, + DWBOU: i128, + beZ8: i32, + const ti3l: ipD5, + const eHGI: u32 +) -> ( + (address, u32), + i128, + (((K9Bs, field, u128), ipD5, field, i64), u16, (i8, bool, u16)), + i64 +) { + let U5hyO = -14603i16; + U5hyO *= -1; + U5hyO += FQOEC; + U5hyO = U5hyO; + U5hyO = 23149i16; + let Cwnn: char = 'Z'; + Cwnn = Cwnn; + let prBX: address = Pd5A(320226406175311565765729602000943582805, true? 7507840068624801883535222field : 6391281993032969982088332, ch4X {u4M_f: true? gH34 : 144u8}.zxMYt(Cwnn, -9090, 1576741186390470924, eHGI, aleo18v8jh9vgf5zdwj9ygmxmq6725jrwpxv6s0lxdndw9llnla3wfg8sxk25sj, -29658219930010339475996033495419979146i128).1, eHGI, 413155490, aleo1uy5zhc6trek9qckxp6a9lajd36t2j03hc89qxw27zh9s8qqnpsqs7fd8fn).1; + prBX = prBX; + let OnZsb: [u16; 1] = [1248u16; 1]; + let hBSd = 60872306992948903997715492648573048464u128; + const zkToy: field = 371710394176632139; + K9Bs::LjoKc(); + let ZmT5 = (-1504846365i32, [27942i16; 3]); + ZmT5.1[(false? 1 : 1)..2u32] = ZmT5.1[1u32..2u32]; + ZmT5.1[1..][0u32] /= FQOEC; + ZmT5.1[1..][0..] = ZmT5.1[0..eHGI * 0 * eHGI * eHGI / 1316827120u32 + 45203189u32 - 45203187u32]; + let etMy: char = Cwnn; + let n1g_f: address = prBX; + ZmT5.1[..3u32][0] /= ZmT5.1[(true? 0u32 : 0u32)..3u32][2u32]; + let kt4yv: address = aleo1uswax2ycn7p9gz0dc8nuwzkq6jhrvwcsz8us8g5mgarp596gzgzs8gfq3x; + let gxVm: u32 = eHGI; + const EqxpG = -5994i16; + let JMaFB: address = prBX; + let Y0Gz: bool = true; + etMy = '\u{88639}'; + ZmT5.1[..3u32][2u32] = ZmT5.1[1u32..][0u32]; + let ZexOf = OnZsb[0u32]; + gxVm = eHGI; + let b3m_: u32 = eHGI; + let VFHp: u16 = OnZsb[eHGI / gxVm / b3m_]; + K9Bs::LjoKc(); + JMaFB = prBX; + const HtBn: (i32, i64, u32) = (88130831i32, 5597129553820350064i64, eHGI); + ZmT5.1[1u32..3][0] /= ZmT5.1[0u32..3u32][1]; + return ((aleo1krge09jc9zc9h5ucvujev2n8gts9ad39aj7klay3dny97jkphg8q7hx527, 2077703454u32), 144648028425412184969361655954497324446i128, rbdAX? (((K9Bs {loESr: ((-59883021012625512884396572370123434181, aleo1kvtlsj4yy57ukevtm5gn8mvfwz6vycyrdtmtqxszfxteqwgufyxqhcwnuh, 131081475414381690621862756950705270363i128), false)}, zkToy, hBSd), ti3l, zkToy, HtBn.1), 33852, (-54, true, 55009u16)) : (((K9Bs {loESr: ((-59994448532587962066668841828126965479i128, aleo1j8ny68pu9j5sl3h80d4xnxmjxaksx5uz3xcfu4fdssprssc0s5qsvwsqqm, -62723155996935622197099750660683503844i128), false)}, 960045619776096588298980688524278134327field, 302078113746819869913227348914436484722u128), -22i8, 73421143692025223672185field, 8089594618609388885i64), OnZsb[0u32..][0u32], (35i8, true, 61041u16)), 2685804187026141988i64); +} + +function I3mv ( + const F6uh: i128, + CBce5: [u64; 1], + CD3L7: char, + hw46: u128, + ukmmq: u64 +) -> ( + u32, + u128, + u8, + u16 +) { + let vpJA: u16 = 41996u16; + vpJA **= 0u16; + const Pjxg: ch4X = ch4X {u4M_f: 31u8}; + let zx9A: i16 = -1i16 * (1i16 ** (29057i16 * 22997i16 ** 0i16 / 1149i16) - 22926i16 - -7465i16) - -1542i16 * -10i16 + -15016i16 - -25113i16; + zx9A /= -7222; + zx9A *= 19412; + vpJA = 11010u16; + let sCAqf: u16 = vpJA; + const lsqF: address = aleo157u9cucgtsvf9c2fral59p7dq0fyhtpm9qday8tktl407xpjj5rq2m98jh; + sCAqf = 56977u16; + let Ayjt5: ipD5 = -65i8; + if -5878869791373789040 <= 3859706982261303818i64 && [(-1251734289i32, -7220757225721517715i64), (-883582287i32, 237977862583707369i64)][717854722 + 1241574490 + Pjxg.fK8MO(false, 41893u16, 95, 716418355u32, true, Ayjt5, 297275742194568184220599592364680912841u128) ** 0u32 - 1959429213].0 > -63134208i32 { + vpJA = sCAqf; + } + sCAqf = sCAqf; + sCAqf -= sCAqf; + const yJoK: u64 = 3654579137328297547u64; + let j9nwl = [-115i8; 1]; + j9nwl[..1] = j9nwl[0u32..1u32]; + j9nwl[145276430 + 4092548125 ** 1 - 4237824555u32..] = [80; 1]; + let MwFS: ch4X = ch4X {u4M_f: Pjxg.u4M_f}; + j9nwl[0u32..1u32][0] *= -1i8; + zx9A += -998i16; + sCAqf = vpJA; + MwFS = ch4X {u4M_f: MwFS.u4M_f}; + sCAqf **= 51284u16 / sCAqf * 4600 / sCAqf + vpJA / sCAqf - 2; + MwFS = MwFS; + vpJA /= vpJA; + MwFS = MwFS; + sCAqf *= vpJA; + const QDU1K: char = '\u{1a}'; + j9nwl[0..][false? 0u32 : 0u32] -= -84; + const L1p7U: bool = false; + j9nwl[0..][0u32] *= 0i8; + const JQETY: i128 = F6uh; + sCAqf **= vpJA; + const drdH: u16 = 45527u16; + return (169593762u32, 198289983051059720247797427957949280575u128, 37u8, sCAqf); +} + +function kuYb ( + HhWHZ: i16, + n130: K9Bs, + const gnbMW: u32, + AptEh: u128 +) -> ( + field, + i32, + field, + i64, + i16 +) { + const Dpgna: address = aleo1tscus8pccnx0mgruqnhphrzuae9w4utea0zcvxdmwrdpp9t9huzswjupkr; + let kmg4Z = QD4rE(-9110i16, -680270072i32, true, 14u8, n130.loESr.0.0, -23167239i32, 101, gnbMW).3; + const rUcE4 = 162481235425398689344735976012318818789u128 / 122743290846557364619654157294632509410u128 + 170880526303387509267854497471809668263u128 / 128727234350731326463767770174203680574u128; + kmg4Z += kmg4Z; + kmg4Z -= kmg4Z; + let emYol = 9632u16; + kmg4Z /= QD4rE(8125i16, -846470118, K9Bs {loESr: ((-162682666007745492851836592957479838900i128, aleo14l73q0zraheld0uxpqsg9ft9vqanmgfl754r72m2vfvvhyh4g5qs6y4azz, 144412697760935384421959600137491425555i128), n130.loESr.1)}.loESr.1, 229 / 9 * 4u8 / 120, n130.loESr.0.2, 1477497203, 45i8, gnbMW).2.0.3; + kmg4Z += kmg4Z; + emYol **= I3mv(-9326009895814666392919235970461395245, [2864103425538147435u64; 1], Y8vwD().0, 82978669198860579932737493163933300789u128, 3873547241748284247).3; + emYol -= emYol; + let IZIyh: bool = false; + let jyVAn: i64 = -372938859851883090; + const Y40M = 1159099585i32; + let P9DZL: [bool; 3] = [true; 3]; + P9DZL[..3u32][1u32] = P9DZL[1u32..][1]; + P9DZL[0u32..2u32] = P9DZL[1u32..]; + P9DZL[0u32..3u32][1u32] = P9DZL[1u32..][1u32]; + let LCJB: field = 2943080218134976476139400860826971528593268920field; + let K3z8: bool = P9DZL[0..3u32][0]; + P9DZL[0u32..3u32] = P9DZL[..3]; + const IBtUj = '\u{b}'; + let ljhZn: i128 = n130.loESr.0.0; + const UtIA: field = 905454138031079862003544641351877913875570588533560269; + let NTPo8: char = IBtUj; + P9DZL[..2][1] = K3z8; + let ByF_8: u16 = I3mv(23899903710216603947248958931872513465, [dPwrQ(rUcE4, LCJB, P9DZL[1u32..][0u32]).3], Y8vwD().0, AptEh, 12793836301427865582).3; + P9DZL[2u32] = false; + const YURj8: field = UtIA; + P9DZL[1] = P9DZL[0]; + const uiz2m: ch4X = ch4X {u4M_f: (19u8 * 5u8 - 28u8) + 34u8 ** 1u8 * 1u8}; + if LCJB == UtIA && !P9DZL[2u32..][0] != true { + emYol -= emYol; + let TFsFP: u8 = uiz2m.u4M_f; + } else if gnbMW == gnbMW || n130.loESr.0.0 < dPwrQ(I3mv(71004163258287909554844814376680146426i128, [16161565527323683946; 1], '\n', rUcE4, 6905862712507564498).1, 3103917497337282380340251021986122830159802880803317798, Pd5A(AptEh, YURj8, 13561180427336228047, gnbMW, -1961004472i32, aleo1wts0nlaw30x7t385yap8kv98lu0wz06sged2za8q9gnyzd2cn5gqptvl5y).5).2 { + const EDneU: field = 09064343790349648208800852870655439238547234287field; + P9DZL[..2][0] = true; + P9DZL[2..3u32] = P9DZL[2u32..3u32]; + const bQlgG = [19838u16; 1]; + } + let uiUd: i16 = HhWHZ; + if -31 != -15i8 && jyVAn >= kmg4Z { + const xdVCg = -7336154871647923738i64; + P9DZL[1..] = P9DZL[1u32..3u32]; + if 39779u16 > emYol || AptEh >= AptEh { + const GjXn: u16 = 21977; + NTPo8 = '\u{6}'; + P9DZL[0u32..2][1] = P9DZL[..3u32][2u32]; + const SG0gi: u64 = 4678220310023875352u64; + if 136476386357353684508697348022346341006 < AptEh { + const OjEBN: field = UtIA; + let qiyW: u64 = SG0gi; + const u27v: bool = false; + let pQI0: u64 = qiyW; + P9DZL[2u32..3u32] = P9DZL[3002320925 * gnbMW ** 0u32 - 3002320925..1]; + for DdBN in 3567005880u32..3567005883u32 { + let nB3xC: field = OjEBN; + const jcgIY: [i128; 3] = [-156586775196181642468174328179277657112; 3]; + } + return (YURj8, -1650884225i32, YURj8, kmg4Z, HhWHZ); + } else if ljhZn == ljhZn && dPwrQ(rUcE4, UtIA, P9DZL[..1u32][0u32]).4 == AptEh { + P9DZL[1..2u32] = P9DZL[1..2u32]; + const XNmPe: field = UtIA; + let B2j1: u32 = gnbMW; + return (152971649954323field, -562272437i32, 10461field, -6503119876928185534i64, -438i16); + } else { + P9DZL[0..][0] = P9DZL[(true? 0u32 : 0)..3u32][1..][1]; + const iYN7: char = IBtUj; + let BY7J: i16 = uiUd; + P9DZL[0..][0] = 25i8 >= Pd5A(AptEh, 705446185441085479011628455007776949648723864023850903037, 9659317151839264394u64, 4138928207, Y40M, aleo19l3267yg32lx53lqf20cegl4kycj22uv4u6gwadm5736j4clwy8st6jdmj).6 && uiz2m.fK8MO((true? true : true)? false : true, GjXn, uiz2m.u4M_f, gnbMW, false, -93i8, rUcE4) > 4056167920u32 && 5626252916899849359u64 < SG0gi; + return P9DZL[..2][1]? (6072774517347671292482514845721559983, -531146656, 283687959527404889471880856899676field, -5387491093966185961, -31499) : (492915035992162955497133962, 1280501314, 355291998236170542684975592100732576885363722456494193926929field, 7803078636517900758, -28669i16); + } + } else { + P9DZL[2u32..] = [P9DZL[0u32..][0u32..2u32][1u32]; 1]; + let a4T8: u128 = 299714931170042479287152615173204216338u128; + const KjUa: K9Bs = K9Bs {loESr: ((-101461611604699696889826644142575706308i128, aleo1mep073jte9pp7sjvkfs3s4pz6qncl04apmv5r07wlkkrsktp05xqwvsf5c, -28110014606886511060801681288600885956i128), false)}; + P9DZL[1..3][1u32] = P9DZL[..KjUa.loESr.1? 3u32 : 3u32][1u32]; + let yO6Pk: field = Y8vwD().1; + P9DZL[1..3][1..][0u32] = P9DZL[..3][2]; + if 123173743064040790699153201411062109712 != 23445197592402771439276195774034560421i128 || aleo177w8ma2hjvtls2dv9nx0d35llzd6x2ctsgz3n9rsr6gg3rswpqzq56kd0k != Dpgna || gnbMW >= 3719307970 { + let N6hMY: i64 = -5290890452628196247i64; + const zqVET: i64 = -9028726062829445327i64; + return (20593993654499694186520852787882261, Y40M, 81068653871116field, jyVAn, -21078); + } else { + IZIyh = true; + P9DZL[0] = P9DZL[2u32..3u32][0u32]; + let rj5f: (address, field, field, i16) = (aleo1577snf0sqzl4j9j4f733deze5w0ft2vmcd3mkplwx9gehr42lyxsujzl8r, 9756818182662649083310696779744502048677530732941744237535157field, 919358035589635201577118866888field, -5432i16); + const nLhd0: i16 = -24115i16; + const v4_dy = [(7990039973109771144i64, 3019u16, 39704u16, 4458i16); 1]; + return (12913316845690field, 925091368i32, 451309678919973405763507, 7862029581864728217, -12572); + } + } + } else { + let I8stG: u32 = gnbMW; + let yJuHr: u64 = 14803274785041848761u64; + const nJ71d = true; + P9DZL[..3][0u32] = false; + const NYux: field = 0074774488535315537820; + const Xlh2 = uiz2m; + return (807021020840383983field, 2007904417i32, 7932300785163, 8084977877027993002, -19707i16); + } +} + +function main () -> char { + const mLjV: ipD5 = 85i8; + for mbUF in 2590398885..2590398893 { + const VFEzd = 31920284739136856221207897062field; + const fkMec: bool = false; + } + const pOvM: u16 = 23374u16; + let x2s60: i128 = QD4rE(15523, 26953034i32, false, 95, 150268800098462403202327969256359121001, 3296107, 19i8, 4035500856u32).1; + let vkxD0: [bool; 2] = [true; 2]; + vkxD0[..2u32][0] = vkxD0[1u32]; + vkxD0[0u32..] = [true; 2]; + vkxD0[0u32] = vkxD0[0]; + let OoVoL = 190u8; + for aHGI in 2662292694u32..2662292714u32 { + vkxD0[3642987992u32 - 1628682886u32 - 1908882327u32 * 1 - 3368439 - 102054340u32..2][1] = vkxD0[..((false? 2451569219u32 : 3817989572u32) - 7603281u32 / 1252039027u32 * 0u32 + 271327498u32) - 16205409u32 * 79u32 - 379335825u32 - 974652009u32 - 1455101924u32][0u32]; + vkxD0[1u32..][0] = false; + let Xdwrf: i16 = 24817i16 - -1i16 * 22848i16 ** 1i16 / dmUmS().5; + const qZqj1: i128 = 141108516468390998351145152486693751306i128; + let E324o: bool = vkxD0[..1u32][0u32]; + vkxD0[1u32] = true; + vkxD0[..1376567634 * 0u32 - 0u32 + 2u32][1] = vkxD0[0u32..2u32][1u32]; + } + let ofII: bool = vkxD0[0u32]; + if I3mv(-40805146357161225964193737542940566026, [3287569269764190352; 1], '\u{0}', dPwrQ(130789019159089505931670169077925707857u128, 138537829002528295029284field, true).4, 15047320954516404995).2 >= OoVoL || !vkxD0[1..2][0u32] { + let lXei: i16 = dmUmS().5; + vkxD0[0..2u32][1] = vkxD0[..1][0u32]; + const ejOxt: ipD5 = -1i8; + const PEcp: i128 = 127110195799675324828191376574105651421i128; + const gX3Y: [u128; 4] = [198342195025824553761937069522422128674u128; 4]; + } + let BW6O = mLjV; + let l9m7: address = aleo152jvpue2pw6f7h8yqw9er46cg53pdxpcvdvzkr9kzzjxmq2q5qfqzttwrf; + const GcRG: address = aleo1svrl0xsh79fzha207uh3tdhvafkx3m7p5m7d0vhljymumjhnfvrsgsmpzf; + let i1lu: i128 = x2s60; + let MtkoE: address = aleo1tc2frhfmq5rghcd0h7agt6e9e0sn0g323jnlvx56afuets322ypqk6x0sh; + i1lu += 10471762694753349483568962325008021685; + vkxD0 = vkxD0[0u32..]; + K9Bs::LjoKc(); + let qJB5: u32 = 2809370904u32; + vkxD0[0u32..][0u32] = false; + let kfo5: u32 = 3916824720u32; + let PUKG6: (field, field, u32, i128) = (60254181795031407196841001863field, 446447669018063169212080598672840626195field, 3412520548u32, -106024904675975093439535859153642645146i128); + vkxD0[0..2u32][0] = true; + let gkpFS: RKDY = 2592439298961118891i64; + vkxD0[kfo5 / 3366900303 - 0 ** PUKG6.2 - 1u32] = vkxD0[0u32..2u32][1u32]; + const YdokC: Jyso = 5921166027097302611u64; + vkxD0[0..][0u32] = vkxD0[..2][0u32]; + let d92_ = mzTQ().3; + let bSRt: i16 = q2rpB(-11549i16, PUKG6.2, GcRG, K9Bs {loESr: ((-58934232559849538394819114612619136486i128, aleo1rk9xrspkf8d56035yu5c5kkx5fgr5tfphd6nr339nfgujc8xmugqwwafl3, -8301691453280812855589308782222977724i128), false)}, 506253671646267009346450961283355707476959210024114135field != 2151161158741278467224493739860502277614915 && 60866481893559127760017651212991220379i128 + 84024689200763601879492806377014530995i128 - -7333527861610292526942352998355626029i128 < 135557589755450360232969290701981462562i128? '\u{c04df}' : '\x10', pOvM, (40637u16, aleo1fy3yv7eyem23kf3pt3swzv75x0sez59fnw7ukgaxteyw8nymkqrseeapvw)).6; + BW6O **= BW6O / BW6O / -1 / BW6O; + vkxD0[1u32..][0] = vkxD0[0u32..][0]; + if (bSRt, bSRt, (6005361242460891100, 9438562246649483638110542373312024735field), 226669352914990788639859051052738168070u128) != (-3501i16, -30811i16, (13000576012703108477u64, PUKG6.1), 318147508697155194298428491482627822082u128) || gkpFS > 616051997468049313i64 { + vkxD0[0u32..][0] = xkgDQ(pOvM, '\x6e', d92_, mLjV, -61349905689163692826204425715195988466i128, pOvM); + if '\u{109c43}' == 'k' || vkxD0[..2u32][0u32] == false { + const IwkPG: u16 = 31442u16; + const cZ90: i32 = 1683708003i32; + vkxD0[1..] = vkxD0[..1]; + let AAap: bool = true; + let h_Gt: i16 = bSRt; + const Qqmk = -783711174245483006i64; + i1lu *= -1; + let E6z4c: u16 = IwkPG; + } else if (bmU5 {nsVm: L5kB(54u8, 195, 146, 1823582478, 112u8, -304663976i32, GcRG, (K9Bs {loESr: ((-24285563369938459229702586546754896203i128, aleo1hzd533js64lferryk3ze4dw3nhjg5sqgp34c7gd0g8f5erytjqyszjsd0e, -49086952468772918792218975881441454512), false)}, -19462i16)).0, QtiNX: [-7856i16; 3], Ym93w: 548711536944820358i64, bPmuq: 4331231135115194486}).a1NU5(d92_, 1998613155 ** 0i32 * -2073210063, GcRG).2 >= 1389169159 || '\u{44}' == Y8vwD().0 { + vkxD0[0 ** ((0u32 * (0u32 ** 1432036686u32 ** 1 / 3837910889u32 - 0 - 0u32) ** 40139409 + 1535103877) - 1489992407u32 + 1613625056u32 * 0u32) - 1550818317u32 / 3277832690u32..][0u32] = vkxD0[0u32..][0 ** dPwrQ(120373380717859714533165080799714364255, PUKG6.0, vkxD0[1u32..][PUKG6.2 * 0 / 62648198u32]).0 + 3887418821u32 - 3887418820]; + vkxD0[0u32..][1u32] = true; + const xTih5: RKDY = 7667248184417854862i64; + K9Bs::LjoKc(); + } + let F3dx: (field, u128, i16) = (PUKG6.1, 181899007005543339175463013468909038269u128, bSRt); + BW6O = mLjV; + BW6O *= -1; + let RWCen: i16 = dPwrQ(18418288912347067628364310677161798854, PUKG6.1, vkxD0[0u32..2][0]).1; + vkxD0[0u32..2][1u32] = vkxD0[0]; + vkxD0[3946428981u32 * 0 * 0 / 4132599281 / 1769035124u32 / 3530475420u32..][0] = vkxD0[..2][PUKG6.2 ** 3585280073 ** 0 - 3412520547]? true : vkxD0[1]; + let iouBx: address = GcRG; + } else { + vkxD0[1u32..0u32 * 1752213775 ** 1 * 0u32 + 2u32] = [false; 1]; + let eZLy: [bool; 1] = [false]; + eZLy[0..1u32] = vkxD0[1u32..]; + const foyJU: i128 = -107514675730026893258459609370580329418i128; + let a9vcM: bool = vkxD0[1u32..2u32][0u32]; + i1lu /= x2s60; + BW6O = -119i8; + } + const VU1yW: i16 = -7014i16; + vkxD0[..2][1] = vkxD0[731215059u32 - qJB5 * 0u32 / 3529437387u32 - 731215059u32]; + let AKKWh: [u32; 3] = [1719050219u32; 3]; + const IFI8A: u128 = 133362268192723362429055149436274160204; + return '𘁎'; +} + +function kT40 ( + const vBjOM: bool, + const TrmH: i128, + const M72G: u128, + ijR3: field, + const qAFo: u128, + const offt: u128 +) -> ( + i64, + bmU5, + u32 +) { + const FmHbf: u128 = 283592396918156406522014743724669672009u128; + const GDgl: i128 = TrmH; + let UvTZ: i16 = -32178i16; + const PwCy = -61i8; + const pwMvn: field = 65064491103329963215622085665489454621745162706303136909356field; + UvTZ *= -1; + UvTZ *= -1i16 * UvTZ + UvTZ; + if dPwrQ(offt, pwMvn, false).1 == UvTZ || false != vBjOM { + let gJx32: field = ijR3; + K9Bs::LjoKc(); + } else if 651690658518862986 < 6958411688466207618i64 && (3123869185, UvTZ, Pd5A(61072199877756902224315835393476775881, pwMvn, dPwrQ(I3mv(GDgl, [7897527050854920863; 1], 'l', 90900286496237487943859901532580553019, 10069345023883059474).1, pwMvn, vBjOM).3, 645323232, 1162019152i32, aleo14rtwkl6xhqx4cwkwe6l3cpvlget0yctcpvsymxzh6ewcjvzsjcpq3t5kxm).5, (bmU5 {QtiNX: [-15041i16; 3], nsVm: aleo1t3sdjjrgc2yh5jzgkzfsztxjy2u6yg7dy548wed5pj506my5rypqvmdwve, bPmuq: 8430435097122955911, Ym93w: 3129254962181439019}).a1NU5(aleo1jvgfe976et459tyjp2f03eq66cc9rqqgyuc7m89xjyrt2q9xcyzsr74ahc, 1603487321, aleo1qz9d37lascqugyag78ctcqy86eg2zlsxurnjlda8l87s20k3lu9swmzpw4).2) == (2394204326u32, -5131i16, false, 2523500943u32) { + let fVmGn = -31533i16; + UvTZ = 20033i16; + UvTZ /= -22558 / -25998 + UvTZ; + const PRRx5 = (PwCy, 108u8, -1932433557i32); + UvTZ += fVmGn; + let qrWj: address = aleo1gxmf8a5xhv4zvxwmpt3m3xjykwemf4d2jpedgepxvmn7rp0yryxqrn5rs0; + const xnomE: [u32; 1] = [3321166216u32]; + UvTZ = -20001i16; + qrWj = qrWj; + } + UvTZ -= 1i16 ** 5773 ** 1i16 / -1041; + const zK2XA: u32 = 1562033296u32 ** 0u32 + 583746925u32 + 4260046549u32 * 0u32 / 2189538460u32; + UvTZ *= UvTZ; + UvTZ *= UvTZ; + let Q0lFH: RKDY = -60223549626067394i64; + UvTZ += UvTZ; + Q0lFH *= 78; + Q0lFH -= Q0lFH; + Q0lFH += Q0lFH; + Q0lFH = Q0lFH; + let hWCe: i64 = -7254606535212052181i64; + Q0lFH /= hWCe; + const TcByO: i32 = 1458329743i32; + UvTZ = UvTZ; + const eGAs: char = '4'; + const RJge0: bool = vBjOM; + const jg1br: K9Bs = K9Bs {loESr: ((-6141939816142007429440342149361644651i128, aleo1yztqfgwex45y582ve0973zz9ykn8fm2830qg30vsntanh0fm959q6wtduk, 17930722332300113280210317541978869825i128), vBjOM)}; + Q0lFH -= -4054529307118908029i64; + hWCe = hWCe; + const xfI8u: [u32; 4] = [1065007301u32; 4]; + Q0lFH = Q0lFH; + const pm1i: u16 = 23411; + let L4zm = jg1br.loESr.0.1; + let qFw32: i128 = jg1br.loESr.0.0; + let yQCz: u128 = 314429458541569046871525482081416170000u128; + return (-295802124737019268i64, bmU5 {QtiNX: [17567i16; 3], bPmuq: -6192267871231238827i64, nsVm: aleo1c8yewdfzlalclu4nfpszfj89nmuhtxz8f9l9qpwr9xc30sljsqqquynph6, Ym93w: 3931930926017001688i64}, 1788579531u32); +} + +function JZulJ ( + const eYYb: Jyso, + const YTDnh: RKDY +) -> u32 { + let Tbs9: i128 = 167216233679617724987628673186043263449i128; + const lAGu = eYYb; + const jqkL7: ipD5 = 53; + K9Bs::LjoKc(); + const st6C3: RKDY = YTDnh / YTDnh + YTDnh * 1i64; + const PJct: u32 = 3012327526u32; + const Azvt: u128 = 303539454167214241661614550043053677622u128; + const mPu1s: u128 = Azvt; + const C8ZP2: i32 = -1138950787i32; + let cZ1hk: (field, i16, (ipD5, ipD5), address) = (232625660934391250398391622322005101319899718627707field, -13673, (jqkL7, -110i8), aleo1cpkgv0zksfk50plxhl9l2l2jv8pjcct94dgjza7rxs9gzaadfyqq0mpm3h); + const LQAYv: ch4X = ch4X {u4M_f: 21u8}; + const mrW5: ipD5 = jqkL7; + cZ1hk.2 = (mrW5, mrW5); + if 3508316026 <= PJct || 11 > jqkL7 && cZ1hk.1 > cZ1hk.1 { + const pFlX: i16 = 28116i16; + cZ1hk.1 *= -1; + const s_u9: ipD5 = (399649201i32, -1473537170i32, 124i8, 15499u16).2; + cZ1hk.3 = cZ1hk.3; + cZ1hk.2.0 /= jqkL7 / mrW5 / s_u9 + 24i8; + K9Bs::LjoKc(); + const kDqF: u32 = PJct; + const UDEv = 29320i16; + cZ1hk.2 = cZ1hk.2; + } else if [-61156768565862623369019448460135534692i128; 3] == [dPwrQ(216245870836099748304136776055009993878u128, cZ1hk.0, Pd5A(237142478672695441549785649493510540970u128, 570162430267020650015266636750569060769219118235649323932606742566416178, 2224925605207380105u64, PJct, C8ZP2, false? L5kB(LQAYv.u4M_f, LQAYv.u4M_f, LQAYv.u4M_f, C8ZP2, 149u8, C8ZP2, aleo1c49z7lfffdad5frldalgq7fuyxzl203zhgrdqqaffy7v3x9thuxsx9mkww, (K9Bs {loESr: ((-162517654157547464451751202209761724596i128, aleo1n5ypwtnxqwr99aq2fa6kzngcspue0557vmsxhcs80vfwtp9x4u9s2h4gxp, 44719907096075546478645430044262342084), true)}, 14543i16)).0 : cZ1hk.3).5).2; 3] && 14226241324389558998u64 >= 15261736860664232804 { + cZ1hk.3 = cZ1hk.3; + const m2l4: u8 = 92; + cZ1hk.3 = cZ1hk.3; + let MZrn = C8ZP2; + Tbs9 /= -82543229972771855339689429458290019387i128; + if Tbs9 - Tbs9 + Tbs9 - Tbs9 == Tbs9 && mPu1s < 119846261553487178408349905759623138717 { + let gWNMP = false; + const di9u: i64 = st6C3; + const zpeq = 5911653950802353147u64; + let C4BTz = cZ1hk.1; + } else { + let e1MS: ipD5 = cZ1hk.2.0; + MZrn += 1845424895; + cZ1hk.0 *= cZ1hk.0; + const Sc4b: u128 = mPu1s; + Tbs9 = -32162046998883902718401874506512798810i128; + cZ1hk.2 = cZ1hk.2; + cZ1hk.2.1 = 127i8; + cZ1hk.2.0 **= 1; + const GPgpB: bmU5 = bmU5 {nsVm: aleo1p26kfzc9gnkzksxfmfepjq0za6rmckz2g82rm2kw0me5a4u20yzqn40agk, QtiNX: [-3393i16; 3], Ym93w: -3374836245356553699i64, bPmuq: st6C3}; + } + let M350: ipD5 = cZ1hk.2.1; + const lqzc: u64 = eYYb; + } + const LSFHo: (u8, u16) = (21u8, 45700); + cZ1hk.3 = bmU5 {nsVm: aleo17z0dcp7ma4us5vuuxwppvrj5f4s68wdyekgdp0p4lt9564r2cuxqwwrm22, QtiNX: [cZ1hk.1; 3], bPmuq: 7491466688044779176i64, Ym93w: -1474713188317025904i64}.nsVm; + let bG73x: i16 = -893i16; + const T68A1 = 36814497649157862386500361129277544749i128; + let HG7o: address = (-70i8, bmU5 {bPmuq: 3732403563286602046i64, QtiNX: [23663i16; 3], nsVm: aleo1nlq9j4w94fwshzp2hcjxv8qgvngapqpkflhwdheq63k6zjgjjvxqamd3u3, Ym93w: -9070695945463904379i64}, -7902807118850693616i64).1.nsVm; + const NzOBm = 'h'; + let OOJ4M: K9Bs = K9Bs {loESr: K9Bs {loESr: ((154300490328164524915864174269644212736i128, aleo1fjfq2kkt2stvwetkv9cg2wdgy8wgj7enjzf55a79dpqd700vcugq5qj40f, 89931682204356428164322737353489014794i128), false)}.loESr}; + let S3J0 = YTDnh; + let KBvJ: i16 = cZ1hk.1; + let h07Dj: i128 = OOJ4M.loESr.0.0; + h07Dj = 166149818269390033939130977979276665924i128; + let VaxJ: u128 = 119257514155110839896103099259789409868u128; + h07Dj = -158951017897298796830840225176608680844i128; + S3J0 *= 1; + const TlUpr: u32 = PJct; + return 546147024; +} + +function v7AND ( + const Klmz: u128, + const pWVF: ipD5 +) -> ( + u64, + u32, + K9Bs, + i128, + u16, + u8, + u32, + char +) { + const FSEY: [i16; 4] = [-20691i16; 4]; + K9Bs::LjoKc(); + const svYa: i8 = pWVF; + const uGMa = svYa; + K9Bs::LjoKc(); + const TXWsQ: u128 = Klmz; + const uM0K: (u8, u8, u8) = (141u8, 143u8, 217u8); + const gEmvH: u32 = 1291712309u32; + const VgPU: bool = true; + const gAs_r: [ch4X; 1] = [ch4X {u4M_f: 3u8}; 1]; + const UfYe: address = [aleo1l3h22kgmnn4d00pjnjxdpa4rxnwqpn48yld9j2lwxqgfr52tv5xs4jgy2m; 1][..1][0]; + let ohcd: i32 = 1675439588i32; + ohcd += -510623735; + let GrD4Y: field = 38236644992279986066936465784365680621704435799318208601779728038445691field; + GrD4Y -= GrD4Y; + let MFPhv: (bool, u128, i128, bool) = (VgPU, VgPU? Klmz : Klmz, 106505998055508563008393085561850943877i128, false); + MFPhv.3 = VgPU; + if 47696 != 15395u16 || gEmvH / gEmvH + gEmvH + gEmvH + I3mv(67851833974837702477667882997138609711, [Pd5A(337223750547827394072534418776354393579u128, 68836589456548235439202569984988315334159086432792893737951088776037field, 3726735811818103833u64, gEmvH, 817444660, aleo137ued2jaqa353a8skjkatpqrpvm3mkvena47t9fw5fdchpma2c8qrvxzh8).2; 1], '\x11', TXWsQ, dPwrQ(Klmz, GrD4Y, MFPhv.3).3).0 <= 3566512232u32 && 9011847785262091766u64 != 13693005605499908120 { + ohcd -= 1706337913i32; + K9Bs::LjoKc(); + MFPhv = (MFPhv.3, Klmz, MFPhv.2, VgPU); + const Yg21: i128 = 34637204984252069492117121605015669839i128; + MFPhv.3 = MFPhv.0? VgPU : VgPU; + const TUmd: address = UfYe; + let Nf8YX: i128 = dPwrQ(TXWsQ, GrD4Y, MFPhv.3).2; + for x1i2O in 1915160082..1915160100u32 { + const OKxd: u128 = Klmz; + const I38No = 56251u16; + ohcd = ohcd; + } + MFPhv.3 = false; + } else { + const ewKlk: i8 = -5i8; + MFPhv = MFPhv; + let kltX: u8 = uM0K.1; + const rbndk: bool = VgPU; + MFPhv = MFPhv; + MFPhv = (false, 154168280934862136646174548081318275670u128, -703052716543894300825616180048879069, false); + let XocH2: bool = false; + const X5cu0 = '\u{4}'; + } + MFPhv.0 = MFPhv.0; + MFPhv.0 = VgPU; + MFPhv.1 -= TXWsQ; + MFPhv.3 = MFPhv.0; + MFPhv.1 -= MFPhv.1; + let CUFcM = 6214i16; + MFPhv.0 = VgPU; + if QD4rE(FSEY[0u32..1][0u32], 929722560i32, MFPhv.3, uM0K.1, -105484156027866280636737286961773622771, ohcd, 20, 1532464742u32).2.0.3 == 5686010017164023835 || ohcd <= ohcd && false == MFPhv.0 { + MFPhv.0 = VgPU; + MFPhv.3 = true; + MFPhv.3 = MFPhv.3; + MFPhv.3 = false; + } else { + const cI55A = 58580589548848479903316528107817696604i128; + let HDjEY: i32 = ohcd; + const IWZ0: u8 = gAs_r[0u32].u4M_f; + const r9WbS: u16 = VgPU? 28848u16 + 41717 ** (1u16 * 25459 ** 609u16 ** 0u16 * 0) / 58582 : 10022u16; + MFPhv.2 = 46945638478338013872568026352213464163i128; + const sQur: char = '\u{74}'; + const ZCa6: u32 = 4286208483u32; + MFPhv.0 = Pd5A(338891578377835090722679369817054482632, 66687269536554727268748199, 13371198536602383696, ZCa6, HDjEY, UfYe).5; + } + GrD4Y = GrD4Y; + let fniC: [i32; 4] = [ohcd; 4]; + fniC[1u32..(gEmvH + gEmvH + gEmvH) * 0u32 - gEmvH / 2691487985u32 + 1u32 * gEmvH - 1291712306u32][1] = fniC[..4u32][2u32]; + ohcd *= MFPhv.0? 0 : -3i32; + let xJDW = VgPU; + const cXf6V: u64 = 1432711571315023319u64; + const UWepT = UfYe; + const eKh_: field = VgPU? 3310864505559496586380106301820914962461344568242308890030324field : 545552621645210513242467631355011023515360003097045024135170871field; + return (14809966333139653611u64, 2319782232u32, K9Bs {loESr: ((-107374524465467955881460339270432075346i128, aleo1e25452pfqmvwdarzc66j32jyx0pzuq7vj888vv5jpd3tuhunjqgsmj9qda, 136736067659646946469424695621163180594i128), false)}, -49169409761755075314229263084521096779i128, 37781u16, 136u8, 4165096116u32, '\x45'); +} + +function q2rpB ( + H9wQ: i16, + AC0hb: u32, + eSWkW: address, + JC7O: K9Bs, + const pBch: char, + Yxkq: u16, + udac: (u16, address) +) -> ( + i64, + u128, + ipD5, + [i16; 2], + i32, + K9Bs, + i16, + u32 +) { + let CwNq = 0290456313885965310572062232477347605966259944890517357149219565912103616field; + let Pvfe: ch4X = ch4X {u4M_f: 134u8}; + Pvfe.u4M_f **= 0u8; + let whJtU: ipD5 = -71i8; + whJtU **= 1; + Pvfe = ch4X {u4M_f: 251u8}; + const AtW1: bool = true; + const tsUW: u8 = 31u8; + const xcA9: [(u8, ch4X, i128); 2] = [(137u8, ch4X {u4M_f: 48u8}, 56802552867123139698962366520017596013i128); 2]; + const DDtuK: (u32, u16) = (3237078632u32, 13697u16); + Pvfe.u4M_f /= 10u8; + if xcA9[1u32].1.u4M_f > I3mv(-52785713048201609174756380550362015779i128, [1886979463875231408u64; 1], 'h', 55735302149094196139277839302303524376u128, 10888688938020953818).2 || -378962917 != -526240851i32 || pBch != pBch { + let qYj5 = 35031185487521865563408322399852284141u128; + } + const EkxMh = -27325i16; + let EBat: u8 = 117; + Pvfe.u4M_f += xcA9[1u32].1.u4M_f; + const chbFG: u8 = tsUW; + whJtU = whJtU - whJtU / whJtU; + const t01vB: ipD5 = -64i8; + let yfvZ = CwNq; + EBat **= 1; + const sIRH = aleo1mv6zws09pse363j6fccv5e242d0mf6fk6cm2fy0ypjmx0a8pngpqeylysm; + const lv3Wq: i16 = EkxMh; + CwNq -= CwNq; + Pvfe = ch4X {u4M_f: tsUW}; + const SGOIG: u64 = 14603127253724240077u64; + Pvfe = ch4X {u4M_f: xcA9[1u32].0}.zxMYt(pBch, lv3Wq, SGOIG, 317913670u32, eSWkW, JC7O.loESr.0.0).2; + Pvfe = ch4X {u4M_f: xcA9[0u32].0}; + yfvZ /= yfvZ; + const O3S21 = DDtuK.1; + let ZnM0: char = pBch; + if AC0hb == AC0hb || -540042770i32 < 1180059696 && H9wQ != lv3Wq { + Pvfe.u4M_f = (63330u16, (3352604365284714831239453444950639637851532694891877578093205field, 225u8), true, K9Bs {loESr: ((-117079570072754320668462895504059447910i128, aleo1pmuw7rny786d55ezfkqmnenpd596xk38dp4t7ge487zxe0lneqpsn43q30, -130845246681257333566854862218809022368i128), false)}).1.1; + let UsCt: u32 = DDtuK.0; + let Ocvpi: i32 = -1455400265i32; + let d0yAc: K9Bs = K9Bs {loESr: JC7O.loESr}; + let ul2Il: address = aleo1vl8gamu2krxak7tuqckn5e42lhg7heu8p2aas6tujzmdz0ep7sxq9rmlp6; + let Qwibd: i32 = Ocvpi; + Qwibd *= 0; + const jlMkj: i32 = 1953135604i32; + return (-407020912823290395i64, 201870439454542955331285265505277120664u128, t01vB, [H9wQ, 18328i16], jlMkj, d0yAc, 30390i16, 2309485685u32); + } else { + CwNq -= 3563366796984226043678153666762555840field; + Pvfe.u4M_f **= 0; + let Nr6bc = xcA9[0u32].1; + ZnM0 = Y8vwD().0; + Pvfe.u4M_f /= 11; + return (-7458828956731939468i64, 258446147288419696884911059653102891202u128, -121, [-28212i16, 12134i16], 820043193i32, K9Bs {loESr: ((-5202006701578447181395051801711992147, aleo18exxr30g25s0uh5vrlmp209wrcnmg7d2s7g70jtjzcfl3q6j7vgqqshjsq, -89225039001206660240587827840469299731i128), true)}, 31950, 3028328107); + } +} + +function sQBcF ( + pLPJw: i16, + zqO7: char, + const PX87V: ipD5, + const RDgXN: [(field, i32, i64); 3], + Rvo3d: char, + const BiI4: [address; 1], + const yRUA: address, + WbL1c: ipD5 +) -> ( + u64, + i128 +) { + const DCm1: field = RDgXN[0u32].0; + let Dx9tR: ipD5 = PX87V; + Dx9tR /= 75 + WbL1c ** 1i8 ** PX87V; + Dx9tR /= PX87V; + let bfhoi: address = BiI4[0u32..][0u32]; + bfhoi = BiI4[..1][0u32]; + const PmfF: char = '\u{10}'; + if 99i8 <= Dx9tR && PX87V < -19 || L5kB(47u8, 99u8, 196, RDgXN[1u32].1, 29, -2113914957i32, aleo18xtkjv8d296l0vx0wjm9p04xqfjg9xnjz0wkmzucs802q7zgd5pq2laksg, (K9Bs {loESr: ((-147697704113092479395370291616387428329i128, aleo1gszzwuupepjf0peu5v33l6nrr6c9vncn2nuq7ggfrmzgwwt5yqysh5lpgu, 59467807171977700731278028825987354533i128), false)}, 18062i16)).1 != Y8vwD().1 { + let iQvl: Jyso = 16260404659926348850; + let QJ6Ih = 73i8; + iQvl -= iQvl; + if I3mv(104286654409142255000823346244707538674i128, [5303089691135538709; 1], PmfF, I3mv(168071303295701656181149069270173442642i128, [16998700761886619892u64], '\u{41}', 84375327693663351382153822841335256972u128, iQvl).1, iQvl).1 < 328923521536029595281334777666595028393u128 && dPwrQ(134664464101761461954109306579047794937u128, RDgXN[2387293974 / 622786727 + 3748228085 - 3748228088].0, true).0 == dPwrQ(159998373325154950171977561720439155897u128, DCm1, false).0 { + let VYSYp: u128 = 12852556358995687565896222743479659301u128; + iQvl += iQvl; + QJ6Ih *= Dx9tR; + const WYDCu: u16 = 15408u16; + bfhoi = BiI4[1936990328u32 * 0u32 * 0u32 + 527768640u32 - 527768640u32..1u32][0u32]; + let KyfD: ipD5 = Dx9tR; + } else if [103; 1] != [49i8] || 99 > Dx9tR && false != mzTQ().5 { + const wNGJy: u128 = 76313584714255940789025534879848248936u128; + QJ6Ih **= Dx9tR; + let W7FeV: i32 = RDgXN[2u32].1; + } + if 112132764966754863516845121093215787439 != 17798785099682114427001631334256051338u128 && 1578618154 < 3192751209u32 { + const IUNXk: bool = true; + const Ml8s: u128 = 166989271207352463789708476584533375898; + const iFvo = 1730174743u32; + } else if I3mv(-44890122499235162977327342304829466358i128, [8572251128032048282], PmfF, 240289962137635885225803911382259940751u128, iQvl * iQvl * 0 + dPwrQ(I3mv(162467367876973686482368354290330138378, [12484795043677719367u64; 1], '\u{63600}', 150131280263898471579721682838647831960u128, 7127111451917085276u64).1, RDgXN[0u32].0, Pd5A(313670421560074518913665673293327367058u128, RDgXN[2].0, 8823587598840360424, 2905415126u32, RDgXN[0u32].1, yRUA).5).3).2 > 98 && 22u8 < 194 && pLPJw >= pLPJw { + const Ew3oX: i32 = RDgXN[2u32].1; + } + } else if RDgXN[1u32].2 < RDgXN[0].2 || (L5kB(1, 212, 140, -1684139105i32, 167u8, RDgXN[1].1, BiI4[0], (K9Bs {loESr: ((77468406210926268924743983808438392513, aleo1098jcgdmp4g9ng4ty0ps2zkzv2yczmq5rvpt8pa5k6pjul9f8cpsgzw7du, -132147116942042877924324546376820634437), true)}, -18529)).2, RDgXN[2].1, 122355383285230184999227407569910865875) == (31229u16, -1565521336i32, 123531363779070526689319758725813133510i128) || 17708017634882664418 <= 11225919126499724348u64 { + let dlAok: field = RDgXN[0u32].0; + let ThnK: bmU5 = bmU5 {nsVm: L5kB(219u8, 171u8, 106u8, RDgXN[2].1, 111, RDgXN[1].1, BiI4[0u32..1u32][0], (K9Bs {loESr: ((40847282917260644641119006798197364629i128, aleo1g3963lnq6edzrk8gsucmwwzax4zhh8c7wl00gmznr8epjxn2458qy5nshd, -26792095827059957557947424906101333471i128), true)}, -26062i16)).0, Ym93w: RDgXN[0u32].2, bPmuq: RDgXN[1u32].2, QtiNX: [pLPJw, pLPJw, pLPJw]}; + let TF8ma: ch4X = ch4X {u4M_f: 103u8}; + } else { + let ByxR = (-598292233i32, false, true, PX87V); + const pYc9: i128 = -57118770293527470655876496332038431463i128; + const PHWzC: address = BiI4[0u32]; + } + let g85J: u128 = I3mv(138066782703156051718375196051174457042, [dPwrQ(321731478123064406855442097957300294668, RDgXN[2u32].0, false).3], '\x76', 316705726030830930518383015324136276360, 8145428294557256033).1; + const TNIg: u16 = 954u16; + let zHUYd: ipD5 = Dx9tR; + bfhoi = yRUA; + zHUYd *= 1; + let kJBLS: Jyso = 1348230049948955311u64; + let rYPU: bmU5 = bmU5 {bPmuq: RDgXN[2u32].2, Ym93w: RDgXN[1u32].2, nsVm: aleo135xs67mmkvgankf9lfnacn837qs2vzch2dnfdvpj5l4k7v4vj5xskae4yg, QtiNX: bmU5 {bPmuq: 1503520986370551654i64, Ym93w: 1626037207723461600i64, QtiNX: [-22217i16; 3], nsVm: aleo12527q4hr96p9ut3frc3nwk4fvuax7cs25rsl57yl0gstnx626srqaqrva7}.QtiNX[..3u32]}; + let Lk0S = rYPU; + if [-1297101651; 2] != [1064413667i32; 2] || 212553910597089036154085671197984882706 > g85J { + let FiQCR: address = BiI4[0u32]; + } + rYPU.QtiNX[1u32..3u32] = q2rpB(Lk0S.QtiNX[1..3][1u32], 470744010, BiI4[0u32..1304527784 / 208632176 - 766315432 / 2277948719u32 - 5][0u32], false? K9Bs {loESr: ((34776510283248582616826837357608710486i128, aleo1gsg72t2345l40fwmmugxdwsqlapwzgwjclarqpvfyva6jf3meszqwthen9, -88352608384043093017094703058902700122i128), true)} : K9Bs {loESr: ((-85456585294737954396729636939435112342i128, aleo12watrclsyn8lwcs64e5csy246vvf5v2dhmx3lyguuz8vlyljpcfq8zt2ew, 11659486764137515786487163633443391240), false)}, PmfF, v7AND(279583459371159432855250425097353776219u128, PX87V).4, (54727u16, bfhoi)).3[0u32..2u32]; + let eT66 = false? Lk0S.QtiNX[0..3u32][0u32..3][2u32] : Lk0S.QtiNX[0..1][0u32]; + let CTou: [i32; 1] = [1268362031i32; 1]; + let fyWY = bmU5 {bPmuq: RDgXN[1u32].2, Ym93w: rYPU.bPmuq, QtiNX: Lk0S.QtiNX[0u32..3u32], nsVm: aleo16h5uz5ewmwn5wgsq40w9a3pppa4w4j0s2x2gy6whchm9a40d3spqxyhz9z}; + eT66 /= rYPU.QtiNX[0..][0u32]; + let YDVGf: u32 = JZulJ(11848754042963669560u64, RDgXN[0].2); + let Vp6nz: [i32; 2] = [RDgXN[1u32].1; 2]; + let l8GYK: (address, u32) = (aleo1wazj9kxcnuky0u8tz7vgcu3g8yqkyddcncayhnnljv9ke9kezq9snfmu0r, 618224227u32); + let UQZMo: [u64; 3] = [394291830223693720u64, 2717145679330076289u64, 7231127097414450220u64]; + let TbXb: u128 = g85J; + return (7187860257000514789, -154403626732185511712599754186300772031); +} + +function Y8vwD () -> ( + char, + field +) { + const S1I0 = [true, false, false, false]; + const dtBzs: i16 = 29713i16; + let ddfG: i64 = QD4rE(671 / -2494 * dtBzs / -7000i16 - dtBzs ** 0, -832731701i32 * 2i32 - 0 * 1767487158i32 ** 1i32, S1I0[..4u32][0u32..2u32][true? 2421409527u32 - (S1I0[1903379363 ** 1 - 3668302074u32 / 2768397214u32 / 3549367600u32 - 1903379363..3][0u32]? 2722780023u32 : 2843055219) ** 0 * 2192879709 - 228529818 : 0], 50u8, 132591753244503802854390675803860797503, -2012358562, -116i8, 2740050011u32).3; + const izlP: char = 'v'; + let ci_bv: (i32, i16) = (604660073i32, dtBzs / dtBzs / dtBzs + -1616i16 * -5i16); + ci_bv = (ci_bv.0, 118 / ci_bv.1 + dtBzs / 24095); + let lLYs: u16 = 42541u16; + const j_xA: [char; 3] = [izlP; 3]; + const kzxM3: i32 = -255835773i32; + ddfG += 2183831618756983003; + lLYs /= 2745; + K9Bs::LjoKc(); + const ME_eP: i128 = 33076469023165570934710091138020266268i128; + ci_bv.0 -= ci_bv.0; + const cMR85: [u16; 4] = [(35439u16 / 9812u16 / 20656u16 + 28359u16 * 0u16) + 33417u16 / 15539u16 + 38863u16 - 3536u16; 4]; + let flbz = aleo132wcfgxfzzy0lwp4nfsdzawfqpm8skzm6mfrlfcerm0h0kj8gq9ql6epmw; + let Mc_L0: i128 = ME_eP; + Mc_L0 = ME_eP; + let gQau2: u8 = 104u8; + lLYs = cMR85[0u32..4238720561u32 - (742822570u32 + 306075926u32 + 1822678631u32 ** 0u32) * 0u32 - 4238720557u32][1u32..][1u32]; + let IDYt8: i16 = 3293i16; + Mc_L0 += -27052910962641680000254422068136706576i128; + let tVgKq: u64 = 6878687833905001944u64; + let zx7ok: char = j_xA[0u32..(534693095u32 ** 2382857638u32 ** 0u32 - 402265177u32 - 125065490u32 + 2446682806u32) / 1085691189u32 ** 1u32 ** 1710972137u32 ** 1u32 + 2611906986u32 - 2611906985u32][1u32]; + const DQ8zu: char = j_xA[1u32..3][0]; + let SA8Zy: i16 = dtBzs; + if 70275321758945717742924329759502829431842719883346536781995141807957field == 45259914926049225050608136411773250066243629 || (gQau2, flbz) == (243, aleo169vsn275k4y39cfl3s222vy4q9qxl0j4v25m93lcqp3h359uuvrsrl4ldn) && izlP != j_xA[0..2u32][0] { + const zwAbr: i128 = -36030236660802389348844022026853557277i128; + const GSp3Y = cMR85[1u32..][2u32]; + Mc_L0 /= 48847200596128186350863322409994814998; + IDYt8 -= SA8Zy; + } else if ci_bv.1 == ci_bv.1 || tVgKq >= tVgKq || ((SA8Zy, 306654260766574694802588615632994189285u128, 8571u16), S1I0[..4u32][0u32..][2]? '\u{c}' : '\u{40}', ci_bv.1, S1I0[0]? 76i8 : -97i8) == ((25176, 179785298516022191760632615914863698471u128, 40373), '6', dtBzs, -3i8) { + gQau2 = 214u8; + let Gynta: address = Pd5A(303868751429812632103001158091832489566u128, S1I0[1]? 752053643136688339105033197472216880462674313930624016352987316562 : 5917649076012034226940756204638558217238328873104059127151547406, tVgKq, 2806135696, 2122246464i32, flbz).1; + let DxlG: u64 = tVgKq; + lLYs *= 0; + let DYwXB = 45i8; + const sqM59: char = j_xA[1u32..3u32][0u32]; + let fBqQ: bool = false; + ddfG *= 1i64; + ci_bv.0 *= ci_bv.0; + } + let Qj4qI: u128 = 189942821958219083248607824087584879061u128; + let RxWU0 = ci_bv.0; + IDYt8 = dtBzs; + return ('\x49', 0618428222752580929025744011017473243663188325800434593874052200field); +} + +circuit ch4X { + u4M_f: u8, + + function zxMYt ( + &self, + X9V_D: char, + vhs_: i16, + VnMb: u64, + BNnFb: u32, + EG73u: address, + zStDg: i128 + ) -> ( + [bool; 1], + u64, + ch4X + ) { + self.u4M_f += 51; + const maa4: ch4X = Self {u4M_f: 70}; + const L9sK: i64 = -1568975401193933676i64; + self.u4M_f **= 0u8; + if aleo10sh98fgfhzrla0wflprf28g4tugt7cs2rtq0ulj64cr9s52p5s9q3u8e7h != EG73u || 18587946847619632631348973893337535317 < zStDg && 178497032657491341433068700018914270361u128 > 144160397270852062963597166484792840566 { + self = ch4X {u4M_f: 181u8}; + const S2EX = aleo167ham00w6gwdfuyzkxptcyzxt8w0cj9r82wap4j594kkarv68yzsc37py6; + const yhlyl: address = S2EX; + self = Self {u4M_f: maa4.u4M_f}; + let Tsu66 = 651427274674292750410977956495325812100154677362430160062098field; + } + self = self; + const xY3p: i128 = 130488948849474491780011783779754493100i128; + self = maa4; + const yj8yg: ch4X = Self {u4M_f: 174u8}; + if 545440096457733726435899354180831306854223921469733039689field == 817878757547591913441field && xY3p != 160235963843757362727539463549597571157i128 / xY3p / -35975434340406168789368101947661531498 { + const HClhA: u8 = maa4.u4M_f; + let A_fm: address = EG73u; + const CKyms: bool = true; + self = maa4; + self = Self {u4M_f: HClhA}; + } else { + self = yj8yg; + const xmTl: u128 = 56235778003755858342599565312752419716u128; + const HoR1: (Self, Self) = (ch4X {u4M_f: 55u8}, ch4X {u4M_f: 72u8}); + const djOm: i32 = 1608773832i32; + const IfTRA: u32 = 672663066u32; + let CO6ms = X9V_D; + const EoFCX: u64 = 8004040028632432570u64; + if 5252556334232861739i64 >= L9sK || yj8yg.u4M_f > 229 || xY3p <= -151232973285439455227479324690245234552 { + let CwTJ: ipD5 = Pd5A(xmTl, 59382904360230332942064847514379795679535043, EoFCX, IfTRA, djOm, EG73u).0[0u32..][0u32]; + CO6ms = '\x20'; + const CCjqK: i8 = -85; + CO6ms = X9V_D; + let aHKvC: u128 = xmTl; + const bWEC_: u64 = EoFCX; + } else { + const V0aq: bool = false; + let CqVqB: address = Pd5A(236619656583351933395551195534118599199, 3568629497912932094871973422230748619472654375176217270619281885519577340270 * 3514405695519121381734452488233736045802942259166697597235979602493477572872 * 02014516607954975998216556402field + 815326998351286440807771302225field, 12074838175353698711, 344278471u32, djOm, EG73u).1; + const RPmJh: [i128; 4] = [(49441066039857660704562599140603596000i128, 31697u16, djOm).0, -29846067654759449073925702920922170619i128, 67878075575824326487808311066630630199i128, -10660043434314207869781973084682865140i128]; + self.u4M_f -= 29u8; + let B7_J = V0aq; + let yXz5Y: i32 = djOm; + const FRX7M: u128 = xmTl; + CO6ms = '`'; + } + } + self.u4M_f *= 0u8; + let zO1_w: u16 = 42143; + const wwoG: u64 = 18253719977655444694 + 17643183187688897235u64 / 5585357133588017515; + const SUMA_: u64 = wwoG; + self.u4M_f /= yj8yg.u4M_f; + const CSb_R: u32 = ([27110u16; 4], 56970u16, 706717515u32).2; + self = maa4; + self.u4M_f **= 1u8; + self = yj8yg; + zO1_w **= 1; + self = self; + zO1_w += 12967u16; + const DqGpQ: address = aleo1ald9zzansqtupvllmft0ksvxxv9569lqdv85354u5kghcq4duqysj4jydy; + let RJkso: char = X9V_D; + if BNnFb == BNnFb || (false? -1615864926 : -759905084) >= 507101122i32 { + let zD7D3: u128 = 322224812548622873602142428820771866180u128; + const mNMtx: i32 = 1357224175i32; + zD7D3 *= 0u128; + let ajJ0n: bool = Pd5A(128375791865139413766913332730820182014u128, 014222727640889590902126562080898555896, 11022484522104529548, CSb_R, mNMtx, DqGpQ).5; + const KQlmg: ipD5 = -26i8; + } else if X9V_D != RJkso || -13 == 60i8 && BNnFb > 1013240878u32 { + RJkso = '\x25'; + RJkso = RJkso; + zO1_w /= zO1_w; + self = yj8yg; + } else { + const rQZi = 822988457i32; + self.u4M_f = 199; + let Ek_qV: field = 74782229908118823899664879888527092559463718885794571511field; + self = ch4X {u4M_f: ch4X {u4M_f: 24u8}.u4M_f}; + RJkso = 'N'; + let Tb4AO: (i64, i128) = (-462561173994763678i64, 140725776891534663403109214890124846512i128); + } + RJkso = '\u{413df}'; + return ([true; 1], 11984174823663281673, Self {u4M_f: 145u8}); + } + + function fK8MO ( + self, + const mpQGE: bool, + const G8_ST: u16, + BEmE: u8, + const dCAO: u32, + const iJMvg: bool, + cGs8: i8, + const A3ek: u128 + ) -> u32 { + const ZHmW = 90i8; + let bsm_: char = 'x'; + bsm_ = bsm_; + let kc_d = -30555i16; + let KAGe: u8 = 200u8; + const M_mM: i128 = 110104696325767202907725290195338037140i128; + KAGe *= 0; + bsm_ = '\x05'; + const dGxW = [24460u16; 3]; + kc_d -= kc_d; + const PwnWv: u128 = A3ek; + kc_d -= kc_d; + KAGe /= BEmE; + kc_d /= [12172i16, kc_d, kc_d, kc_d][0..4u32][0u32]; + let bxbgq: bool = mpQGE; + const hodi0: i32 = 815874292i32; + KAGe /= BEmE; + const V6FKl: char = '\u{6}'; + const yjEU: u32 = 2612636874u32; + const nRfe: ch4X = ch4X {u4M_f: 107u8}; + let PWmYK = -34301751957028087205129841560889708619i128; + if 6106677319154141920 == -5729875494597924622i64 || kc_d >= -11890 && aleo1crfv7ssvlu0dw88j8lr5pdmv4gk6068dh2zxqryx8pc69de93v9qjk5h89 == aleo1wg0mly57hvk82svdlpxlxdxluw9cvecxdkfmmqdjeq0l37udvgpsydpz4c { + kc_d /= -23693i16; + KAGe *= KAGe; + } else if false == mpQGE && bsm_ != V6FKl || -138945374842051487865676885269561564893 == M_mM { + let esxr9: ipD5 = cGs8; + KAGe **= BEmE; + if aleo1n54w0d84e5c3ed5jeaxljr57juxhzz8taftcktya5s8kljyu3sxqm0xrcy != aleo1mwsj8pparfps928r5vdr757zg63ecnlxl4uhcq6vfjwy6hk5dcrqyzn5wn && hodi0 == 1498527485i32 || PWmYK == M_mM { + let yX02: bool = true; + const xIpUY: i8 = -70; + kc_d /= -8233; + } else if bsm_ != 'V' || bsm_ != bsm_ && M_mM >= PWmYK { + const VIyf: bool = iJMvg; + PWmYK += PWmYK; + let jWfQV = aleo1v8kk7c59995vuxyf60anquvr3wz2fveyq589xmh44k3me8wf7ggsyxnf7k; + } else { + let gZgVT = dGxW[0u32..][0u32]; + esxr9 -= cGs8; + let blTE: i64 = 6354753965974858350i64; + const jN9y: u64 = 3625445339827857741u64; + } + } else { + PWmYK -= PWmYK; + const T8snY = 181u8; + const qrnJ: u8 = 221u8; + PWmYK += M_mM; + } + bxbgq = bxbgq; + const PzQ5: field = 91797699037738739312989363911069656field - 587209558607501761002field / 4315545190731803514940380797270field - 5403007314117060513673227field; + KAGe = self.u4M_f; + PWmYK += 18112987422846153125129443466441292451i128; + bsm_ = '\u{95d9e}'; + let sqLdR = -7174775067468488168i64; + bxbgq = false; + const Irv5: bool = mpQGE; + kc_d *= kc_d; + sqLdR = -6746378259168268383i64; + const cQ3hf = 161755142000528894781954756204371463320i128; + const qe6V = dGxW[0u32..][1u32]; + PWmYK += PWmYK; + bxbgq = true; + return dCAO; + } +} + + +function dPwrQ ( + Fgtp: u128, + AqgYp: field, + EkfsO: bool +) -> ( + u32, + i16, + i128, + u64, + u128, + [bool; (2, 1)], + u16 +) { + let il1j3 = 1395403650u32; + il1j3 += il1j3; + il1j3 = 2274311309; + const tH5R: [i64; 4] = [-243928998336315348i64 - (407205424343878363 + 7489031036307388297i64 + 7316092951417336 - 7973185593643805654 + (-6432073641054557023i64 / 99231110506801288i64 - -8786062284637711552)) * -1; 4]; + il1j3 /= il1j3; + const X64za = -5926457011888528143460174643418169650i128; + il1j3 = il1j3; + il1j3 **= 1885086843; + let GDEY: i32 = 589280969i32; + let duUo: field = AqgYp; + const jscLJ = 1905521274449411688u64; + let eRUm = Fgtp; + let l4zC: [i64; 2] = tH5R[1u32..895064543u32 + 3198080346u32 - 195914899u32 / 1130921121u32 - 4093144886u32][0u32..]; + const NK1m: field = 91722107372330264746136871473548283111494596926926; + let gffHw: i128 = 105906981805376593359243577777254340619i128; + l4zC[0] *= 1i64; + l4zC[0u32..1] = l4zC[0u32..4273806299u32 * 0u32 + 1949538920u32 + 1814030626u32 / (true? 2547879353u32 : 2150073328u32) - 1949538919u32]; + l4zC[0u32..2u32][il1j3] = 3520985158853765646; + const ne0je: [i128; 3] = [X64za; 3]; + l4zC[0..2u32][0] += -3563193217970886300i64; + l4zC[0u32..] = [8304137835333389498i64; 2]; + const bXSke = true? '=' : '/'; + let eNxNV: [u64; 1] = [jscLJ; 1]; + const vVLf = 56058u16; + l4zC[0..] = tH5R[2u32..]; + l4zC[1u32..] = tH5R[(true? 2504628058 ** 1u32 / 2166397411u32 - 1u32 + 325596669u32 - 325596667 : 2)..3u32]; + const CGRM: u128 = 109894469610598089964235447828297665294u128; + let aWmKd: i32 = 284478540i32; + if 1776166996i32 == GDEY || AqgYp != duUo && 2602384021 < il1j3 { + if bXSke == bXSke || aWmKd >= aWmKd { + l4zC[0u32] *= -1i64; + let PMJ0: u32 = il1j3; + let Xweq: K9Bs = K9Bs {loESr: ((-82949281121241471895287146871347741036i128, aleo1ak60m3dl0ln7r920c6dqqulua4zs5v3skv79yx4f4zyurkd9cgrsjm608a, 454966224421176438430708938354435820), true)}; + const lKKSG: char = bXSke; + K9Bs::LjoKc(); + Xweq.loESr = Xweq.loESr; + } else if eNxNV[0u32] != eNxNV[..1u32][0] || CGRM != Fgtp && -108607106796822814792910922667326950540i128 < ne0je[..2u32][..1u32][0] { + l4zC[0u32..] = tH5R[2u32..][..2u32]; + l4zC[1161815305 + 267724646 + 1725180315 - 3154720266u32..] = l4zC[0..]; + } else { + l4zC[1u32..2] = tH5R[2u32..3u32]; + gffHw -= ne0je[1u32..2u32][0]; + GDEY **= 1; + const y2oE7: bool = true; + } + eNxNV[..1u32] = eNxNV; + if duUo != duUo && [(51i8, 4588u16); 2][il1j3].1 <= 45465 { + let mzhf: address = ('쓱', aleo16924ad3ce7jwn24p69ffr4v0wzqgj7qwu6kgtnwsx25h2z4jwyxsgpwzue, [true]).1; + if NK1m != duUo || l4zC[((1169787051u32 / 2743303183u32 ** 2057795582 ** 0u32 / 4280892620) + 1050054091 + 2098047412u32) / 2261923129u32 * 2785177486 / (2846914876 + 812537828u32 / 1648988102u32 ** 1u32 - 2475452552u32 ** 1) - 1 - 6..1][EkfsO? 0u32 : 0] >= tH5R[2u32..][1u32] || -16 > 110i8 { + K9Bs::LjoKc(); + const rNdKJ: u16 = vVLf; + let Sa09d: bool = false; + let BFoG = vVLf; + let lvcD = tH5R[1u32 * (3332947289u32 + 1470818109u32 / 4212277027u32 - 1318164305u32) - 201764134u32 - 855169249u32 + (135545907u32 - 4162633442u32 * 0u32 + 2972927761u32) - 4066323269u32..2u32][0u32]; + let weAQm: u16 = 36185u16; + let zNfIt = ne0je[..1u32][0u32]; + l4zC[..2][il1j3] = tH5R[0u32..4u32][0..][0]; + l4zC[il1j3] += l4zC[0u32]; + } else if true == true || 89u8 + Pd5A(76196365986195068936413850590104250721, NK1m, eNxNV[0..][0], 1175864615u32, aWmKd, mzhf).3 / 215 > 4u8 { + il1j3 **= il1j3; + const y5Ly: (i32, ipD5) = (916717888i32, 114i8); + l4zC[0u32..1u32][0u32] /= tH5R[0..3][il1j3]; + const xKlj: field = 1562676991624401260122005232098868894657600253509806247699647; + l4zC[1u32..2u32][0] = 2883040735069343945; + l4zC[0u32..2u32][il1j3] *= l4zC[0]; + } else { + l4zC[0u32] = QD4rE(-26235, 276403093i32, EkfsO, 177u8, 127459149661866444632505634915500735634i128, aWmKd, -49, 3377054642u32).3; + eNxNV[0] *= 8; + let Q8HdG: u8 = 69u8; + const HIcZC: ipD5 = 55i8; + } + eRUm /= eRUm; + let Nlzxa = 9068535540529774750i64; + l4zC[0u32..2u32] = [4129909870293481590i64; 2]; + const IIGg: u64 = jscLJ; + let QXbz7: field = NK1m; + let HDFvh = [87173649742544738404430833640421970641868090525081field; 1]; + let u1bM: u32 = 3046534618; + } else if NK1m != NK1m || 46160 >= vVLf { + let Uup7 = aWmKd; + const TLSr: i128 = ne0je[0u32..3][2]; + let PQiI: ch4X = EkfsO? ch4X {u4M_f: 109u8}.zxMYt(bXSke, 27506i16, 3214369786948189487, il1j3, aleo1ntawnet2h5074n5hxxs4vt5azkks0q9lqq9gdvhz6aq2y9h9myrqvm4d72, ne0je[1u32..3u32][1]).2 : ch4X {u4M_f: 126}; + l4zC[..2][il1j3] = l4zC[0u32..][0u32]; + l4zC[1..] = EkfsO? l4zC[0u32..1u32] : l4zC[..1u32]; + eNxNV[..1u32][0] *= 0u64; + } else { + const SV1qQ = [true, false, false? true : true]; + const GwYG: bool = SV1qQ[..3u32][0u32]; + let pQlNu: u16 = 640u16; + let iE3Z: char = bXSke; + } + l4zC[0u32..2u32] = tH5R[0u32..2u32]; + } else { + const hkMI = tH5R[2u32]; + let eErnR: ch4X = ch4X {u4M_f: 46u8 / 211u8 / 209u8 - 200u8 * 0u8 / 50u8}; + l4zC[1u32..] = [3067430721817758846; 1]; + const ubmb: address = aleo1s6ak63yjr5ct282qfmncx33rfwq6679au5luxdxpjnparrl84c9sfa0nen; + duUo += NK1m; + } + return (4165917409u32, -30550, -3834343126120604195310832582304657041i128, 1140896371596319870, 217881573255777237249657450201863515124u128, [[false; 1], [false]], 19607); +} + +function kUOeO ( + MIcv: (ipD5, ch4X, field), + NT99: u8, + jc8N: u64, + const SQHQN: K9Bs, + const Z1wWQ: K9Bs, + lumj: ipD5 +) { + let GGBNb: i128 = SQHQN.loESr.0.0; + GGBNb = -133430138406663735799230118709653108413i128; + GGBNb /= Z1wWQ.loESr.0.0; + let r8jf: bool = aleo1u6g8yfwvd3jcmzk557qwm00nhev89lzq9fjgv2qufclu9lkjzypqdwq7wu == SQHQN.loESr.0.1 && 13958 < 62385u16 && 20840 != 16853u16; + let PoDR: i8 = MIcv.0 - -67i8 / (-57i8 - 13i8 + -1i8 * MIcv.0 * 1i8) / Pd5A(dPwrQ(89661148688673937827644759701482086350, MIcv.2, SQHQN.loESr.1).4, 0922042196423883343467239633457986315326989940274373768180field, jc8N, 2404423017u32, -1247854855, aleo10x6xpy90fqw9mcpef06ymdgd23xg9vv5uxry87zg67v7tdlg2gfqvzx88v).0[0u32..1u32][0u32] - 58i8; + let PN_Sm = jc8N; + let LJGr: u32 = 3128137791u32; + let XRsj = 140u8; + const FbiBF: char = '_'; + LJGr += 764203072u32; + r8jf = Z1wWQ.loESr.1; + GGBNb -= Z1wWQ.loESr.0.2; + let R_kK: u8 = 205; + const seZ8 = 27235u16; + let eJX9k = 57i8; + XRsj = MIcv.1.u4M_f; + const B67Eu: ipD5 = 121i8; + const vlI0: u16 = 5514u16; + let Tp4ph: [u32; (2, 1)] = [LJGr; (2, 1)]; + const TSuG = Z1wWQ.loESr.0.0; + const HXKuC = '\u{c49d5}'; + const Rzjt: u16 = vlI0; + const RPolE = 1676i16; + Tp4ph[0][0u32..] = Tp4ph[1u32..][0u32]; + GGBNb /= Z1wWQ.loESr.0.0; + let E30w: i64 = 8348674448346924863i64; + Tp4ph[0..][Pd5A(288935358854249657383323418648552879515u128, 1605857206041518070328532667391488788644406392519246729field, jc8N, Tp4ph[0u32][1690131998u32 / 3211687118u32 - 0u32..1][0u32], 1065332856i32, aleo195r2jg92g22a8varwhhrrh6uphl6rk3lfzyt0rwlwsxz6n2w0sxsg5k26k).5? 0u32 : 0u32] = Tp4ph[SQHQN.loESr.1? 0 : 0u32][0..]; + if 178897157166505687516989582888519969298 >= dPwrQ(324857913368140188524845407375158556726u128, 9707841793417456544678249852278804119447592007753854356field, true).4 || aleo10ae8vgga8a2lz004vzvwf2x8y4xj66smjzawqjlvgkyvlv60xvps5v9ums == SQHQN.loESr.0.1 || -1243795985i32 != -2001225286 { + R_kK += 44; + Tp4ph[0..][1u32] = Tp4ph[1][0..]; + LJGr += 85689352; + if SQHQN.loESr.0.2 >= SQHQN.loESr.0.2 && jc8N > 10965886346339517968 || ['\u{6b}'; 3] == ['0'; 3] { + Tp4ph[0u32..2][1u32] = Tp4ph[0][0..]; + let pS4bl: u32 = 2401752234u32; + let z0zj: i32 = 2097158003i32; + } else { + const O0Z8_ = HXKuC; + const ovAxl: [(field, u64, (ch4X, i128, u128, [i32; 1])); 2] = [(2488070214735792183309696019318field, 3118850203432483161u64, (ch4X {u4M_f: 85u8}, -123763223745523025144276067982398615401, 321067524089575557792591027532614066926u128, [353870528])); 2]; + } + } else if E30w > E30w && [3662; 3] != [Rzjt, SQHQN.loESr.1? 30601 : dPwrQ(282423436176289196322846958462168448244, Y8vwD().1, SQHQN.loESr.1).6, Rzjt] { + let rNjo: field = MIcv.2; + Tp4ph[792758845u32 * 3504908275u32 ** 0u32 - 792758845..] = [Tp4ph[1u32..][0u32], [Tp4ph[0u32][0u32..1968619161u32 ** 1u32 * 0u32 * 0u32 * 1708632059u32 ** 0u32 + 1u32][0u32]; 1]]; + let uVl7t: address = aleo1w593ead7vk33yzg2afpz6gmzz5gt7a7fnltqrhqlnxje9p4dxuzs3l4ce8; + } +} + +circuit K9Bs { + loESr: ((i128, address, i128), bool), + + function LjoKc () { + const BmVgo = 23570837221446895647001698957588338150025851735476255855field; + let KvJbb: bool = Pd5A(62764693052190790584543816535543355686u128, BmVgo, 18207454674813025273u64, 3942810995u32, -1190504332i32, aleo1u3dcvme7xmn5heg72w3ezgxnsqx2kjq0pqpe5l0qlan7ftf5x5ps2xe8tr).5; + let jeNm: u32 = 548763982 + (Pd5A(185311644235883465155179910110393414332, BmVgo, 12682205947571824945, 2878859660u32, 1182649260i32, true? aleo18yru0ky9lfct2hmvyj6h7n4cqwgrkl5wzzczvdyv5umzxkl8h5xqnxglqa : Pd5A(70357409385314394892339086735682680062u128, 572547950053847764785923618053750869535388202579230field, true? 18409388208258710500u64 : 8609348916518627611u64, 2232412715, 938210450, Pd5A(143813761995210027207277598580524668714u128, BmVgo, 14530098993354669741u64, 3222232187, 316314726, aleo1uhp9685y8dalg896efh5xaxsvy3pnw826x4f5999g845ummhxuqqngzgn7).1).1).5? 699202990u32 : 1616330354u32) ** 0u32; + KvJbb = false; + jeNm /= jeNm; + if '\u{6a40e}' != '\u{17}' || !true != KvJbb && 30738u16 != 25303u16 { + let GunU: i64 = 2835556863360502174i64; + GunU /= GunU; + } else if BmVgo == BmVgo && aleo13lugrs472ced2f6yfn6xlp7x6d8scqel8rqmg6wrg8lp9u5wvuzq3t4azd != aleo18qfrq20t7gzm2mzz0tkrx887pntztdk2empar2kckp0k9jy9pc8q80jp5w { + KvJbb = KvJbb; + if 15373794642731465642u64 != 11992754129422375840 && 13546632797984381731u64 != 16206877582048147045 { + jeNm /= jeNm; + let znoL: i64 = 1226743198339175700i64; + znoL += znoL; + const bVfKH: u128 = 55627413688258660435066438784700361802u128; + const fqZ5: i64 = 5376586014669651349; + let SLfKd: i128 = -91722512761008557603885528735931537547i128; + SLfKd *= 1; + for VVQUC in 1149586492..1149586514u32 { + const kaFR: [bool; 3] = [true; 3]; + } + const VoQcc: ipD5 = -71i8; + } + let niLZX = 58849u16; + const r8cPv: u8 = 254; + const cElsJ: u128 = 220266399092689526116013615097340403887u128; + const f1d9 = 19023u16; + const O2UV = BmVgo; + let aent: i64 = -4559711548633461161; + let FGQHu: u128 = cElsJ / cElsJ * 56199405720987505403594267315778594449u128 - 17876024415508653188565101016640801075u128 - 34517043643596089369277343154389386320u128 + cElsJ; + } + const z745: u16 = 64587u16; + let ASFB: u64 = ch4X {u4M_f: 170}.zxMYt('l', -5383, ch4X {u4M_f: 96}.zxMYt('\u{fccb4}', 15234, 8823739315747725762u64, 2781114400u32, aleo1rlamxxw79usa5dsvksa3vff3v5xwf2qjdpy2t0u5xehprfjpxcgslmxryc, 159881947820198328069196566384084963406).1, jeNm, aleo1d5hspgmz0urt8xalwxnsajpmjskfr8cd3qnvdaucrqa2mlld35rssd6qx3, -51456572071332240197688481611488372387i128).1; + if jeNm > jeNm || (51799u16, jeNm) == (z745 - 1 ** z745 / z745, jeNm) { + let RQ0T: field = BmVgo; + let VAoX: ch4X = ch4X {u4M_f: 202u8}; + let pAS9 = 443611016i32; + let FZT51: Self = Self {loESr: (Self {loESr: ((71800829369675395383794812986873759472i128, aleo164x2l55w9lx8xep0gqy95j20sxzne2mm82qyt8zfr49y3uu245rqdxdjpt, -24758905028725350274764708243365119483i128), true)}, z745).0.loESr}; + FZT51.loESr.0.0 /= FZT51.loESr.0.0; + let vBLg: i128 = FZT51.loESr.0.0; + const gGYr3: u128 = 53707942275749195535628499665541623881u128; + let HYhU: i64 = 1273821940303077683i64; + FZT51.loESr = FZT51.loESr; + } else if 156348089558402137405391778415428911259i128 != -132859203162321688572023338554456758645i128 || true == false || 204575770139921898841017576008field != 52780655881561780813510 { + const ttQ03 = 2058371373i32; + let mnupl: char = '\u{ead79}'; + let yQ0v: i32 = -1800628358i32; + let HiRo: field = BmVgo * BmVgo - (82398295499697486006387740field / 0239162578917642227705617875field / ((56i8 == -101i8 && -12i8 > 37i8? 643664035119718528016045545046074736 : BmVgo) / 3901402374768181685141323727723041field - 9200533451622310450field / 38833583207952560108field + BmVgo + 045940407719field) / BmVgo * 15006254745624651985649892159153236field) * BmVgo / 94389643349603561084field + BmVgo; + } + jeNm /= jeNm; + ASFB *= 0; + const NNYAy: [u64; 4] = [14037911186519992844u64, 15379028447159696105u64, 5098525618276611915u64, 6369389996837573219u64]; + jeNm /= jeNm; + ASFB -= ASFB; + KvJbb = KvJbb; + const uKl8a: i128 = 94385739374992371793272713667434801199i128; + jeNm = jeNm; + let Qrzm: char = '9'; + jeNm -= jeNm; + const EPzZH: bool = K9Bs {loESr: ((127836661528804795048709987129889572137i128, aleo18hn7056u5lwzpvsja6pn5ezhajaq0xqfrkddn5x9c5vw9mka6vzq7kf74a, -97976620665041584429154796040142089035i128), false)}.loESr.1; + } +} + + +function Pd5A ( + CFdHq: u128, + const yuTPY: field, + ntL2m: u64, + qXkpH: u32, + Oo1R: i32, + BEGYZ: address +) -> ( + [i8; 1], + address, + u64, + u8, + u64, + bool, + ipD5 +) { + let MyEPC: field = 31573356716288410417370703635155961189476871450257144276field; + const qiFVj = 7055141804003593778u64; + let PcJmD: char = '\x51'; + PcJmD = PcJmD; + let csHl: u8 = 140u8; + const na2J: u8 = 80u8; + let mG0o = 52223621876949416865816731068486476226i128; + for qDsm in (3043855649 * 0 * 0) * 0 - 0u32..29u32 { + PcJmD = PcJmD; + csHl **= 1u8; + const YJgw: u16 = 55258u16 ** 0u16 + 61836u16; + let WfAQB: char = PcJmD; + const rjQEY: address = aleo1lw24phjlrcymqd8z0mhgg5g2sj55m758jsrrm7g5g9c7rj4c0cpsl65tmc; + mG0o -= mG0o; + mG0o += mG0o; + } + MyEPC = yuTPY; + MyEPC -= [720267298926503259720108339101627490631148662631323703651510field; 1][0u32..][qXkpH / qXkpH - 590173556 / qXkpH / qXkpH - 1]; + const BHJMD = 13893547516647456344051963105815853491u128 - 231661250966145916186230983663157562171u128 / 207599654832544242510346901944621480259u128 / 7372285340255964308087218549523900891u128 / 309975318675188612844609855833965696305u128; + const XdBx = na2J; + MyEPC += yuTPY; + let fJa_: i64 = -7310608731426114383i64; + MyEPC -= yuTPY; + let piSbl: [u8; 3] = [222u8, 178u8, na2J]; + piSbl[1u32..3683135447 + 33024767u32 - 3644370435u32 + 1905344704 - 1977134481] = [181u8; 1]; + let Xczn = 2752297041u32; + piSbl = piSbl[0..]; + const kpIo = aleo1rzls3ttdzu9r897mf8m2jgrw4er32z6el4u6pyznesqwgnxmwypsk6p492; + if 31959u16 < 62578 || PcJmD == PcJmD { + let Rqpd: u16 = 65245u16; + let sYFaq: i16 = 27082i16; + let pLyE: address = kpIo; + const ilcV: u16 = 37654; + const tyb0 = -30i8; + piSbl[2..3][0u32] = piSbl[0u32..][..3u32][2u32]; + const GI27c: i128 = -107309900295368972699067153401678331094i128; + return ([32; 1], aleo163ee8k0e4gxq63uhmemhm44uc05agzscf8j5kwgyw9adcdngwg8qr4pj0r, 15763971490939201997, 232u8, 5943555108499018790u64, false, -116); + } else { + const bbwrt = aleo1jcy0syl9wuck6t5w0k35s6rxmfme0jn6fyzvmdwcras79wtzpyqqa8n8nc; + Xczn += 663955455; + csHl **= 1; + let JOr5: char = PcJmD; + piSbl[..1] = piSbl[2u32..3u32]; + piSbl[0u32..3] = piSbl[0u32..]; + const Nvk0t: u64 = qiFVj; + return ([-71i8], aleo15at5ldqrgpgucv4wuvqz62a4sy6ly0l4y609ngm04k97vzlc9q8say9l3y, 9178155858621197926, 176u8, 7531190539682716957, false, 48); + } +} + +function L5kB ( + const gyEo: u8, + const nscM: u8, + const ZqZ6E: u8, + const KfER: i32, + const TNMj: u8, + const ToVO: i32, + const eC3c9: address, + const gVyoz: (K9Bs, i16) +) -> ( + address, + field, + u16, + i32, + field, + i16, + u8 +) { + const oaI_P: u32 = 2583555375; + let vgAg = (93421845101738572386633174824469094234u128, I3mv(90818702243276426882979864268853823984, [11501051289734034623u64; 1], '\u{ac7af}', 65092301137278046506516213332312829238u128, 5414916651643281316).1); + let bGcS_: i16 = gVyoz.1; + vgAg.0 /= vgAg.0; + const S0IB: u8 = 164u8; + bGcS_ **= 0i16; + vgAg.0 -= 1u128; + for tSx89 in 3011293206..oaI_P / 2347338227 * oaI_P + 1522939909 - 1095202048 { + const uAGP7: u128 = 338874729909160014130790353559679655146u128; + let xsCC: Jyso = 16352215948387832216u64; + } + const TLKZ = 95539698688769223874871562814924266640388669260365151644294field; + for kLMqE in 3180464441..3180464455u32 { + vgAg = vgAg; + vgAg = vgAg; + const sE53: i16 = gVyoz.1; + const x4LRK: u32 = oaI_P; + let kpEvd: ch4X = ch4X {u4M_f: TNMj}; + kpEvd.u4M_f **= 1u8; + let OZB4u: i32 = KfER; + let TxLUC: u32 = 774921352u32; + } + const PiAB: address = gVyoz.0.loESr.0.1; + vgAg.0 /= vgAg.1; + let u2dPE: field = TLKZ; + u2dPE /= TLKZ; + let KA4NZ: u16 = 24992u16; + const xCrT: [address; 4] = [aleo1w4eu2ph6f4cvqagnmf95c77cp0wlc5lzuk3dxlyy9mvqnqn6d5xskl9qjz; 4]; + bGcS_ **= bGcS_; + let uZ1f: bool = false; + K9Bs::LjoKc(); + u2dPE *= u2dPE; + return (aleo1tedrl4crfu9exvep42kq2m727nrue5vk5tmksml965d4afxruvxslpxk58, 316020128178439715020162057340114595017624151000176409, 22927u16, 789920809, 7636484745724113479905418778970016939243562242197253403, -27815i16, 119u8); +} + +function dmUmS () -> ( + K9Bs, + bool, + char, + ([u8; 4], char, [i8; 2], ipD5), + ipD5, + i16, + u16, + RKDY +) { + const xzzO = ch4X {u4M_f: 3u8}; + const qm3o6 = -564934521i32; + if [31757, 24490u16, 53399u16] == [L5kB(176u8, 76u8, xzzO.u4M_f, 361354100, 108, qm3o6, aleo1qr4aq7ja77yulv7a9km7z0w5zkrg89gxwx2vasueluvx53gxkvxqt3z0dc, (K9Bs {loESr: ((158297628785579080954399197187193495693, aleo1sz8yx0dn0suu2m5pltawyaxg7u2n4l8pewehcs2xmaqgqxv055gql4mtch, -2064251535532062880031055873713535399i128), true)}, -12138)).2; 3] && !false != Pd5A(11430705587741262619359503989726990100u128, true? 513598720102954961742535377123120331710896516264674559 : 121280770029963097450428641740276981, 1744978732842122388, 3413985023u32, qm3o6, aleo1u89vskezyutv34tr8kjl34v8uncmawyrn30ar5r8hmqa9astdqxsafvyrm).5 { + const ANVs: bool = 9834949944015474472u64 != 4700776847183485055u64 && 2037777574u32 <= 63763920u32; + K9Bs::LjoKc(); + const gdtyg = (3826037243u32, 3035339276u32); + } else if 167u8 >= xzzO.u4M_f || 8702103003564374381690447389384959912 != 62912490186351192798300360592224084197u128 { + let V94TZ: i32 = qm3o6; + let hjM5: i128 = 74911662912462011016159353936239933461i128; + hjM5 *= 2; + let G0FXR = 2462199505u32; + const kg6jE: [bool; 4] = [true; 4]; + V94TZ **= 0; + let Bkjel: u128 = 0u128 * q2rpB(19590i16, G0FXR, aleo1e2zumdj2ewyrk87vcgq6g22dr6la4u345h3946skmwesddn7hszs87xepv, K9Bs {loESr: ((-79558688141432252773647940361904896233i128, aleo1lcykjqr75z8tupra9zs5n3860sf59sphgpzjn7lceywe9hmjmqqs6zg3j2, 163822436931356708566897518121090607196i128), false)}, '\u{105a7f}', 40262u16, (39805, aleo1gqj279pgsc04ckzlyhkthhsxsl79p62nny5u59u7d9exgqs3vugqls6czy)).1 + q2rpB(23369i16, 2890331594u32, aleo1eszz6negthtf0etc34nk52v5arputjflkhs75t0t099m5d7rzqqq9jlrvz, K9Bs {loESr: ((18380682409111925125152781998600534015, aleo1jddmf60ehe6eapjpm6jh9nm5lsfu0p4mhyklaxsh6zcq7g276yrsw23dsl, -20567145472546337348451696780909745175), true)}, '\x3b', 54255, (v7AND(27584992327970020766362611314753052428 + 270890596727481249768006461900990427779u128 + 23196960605144495942442688364250961540u128 - 33530134949974557912765364532241342329 / 203468986493504220776472873437707133273u128 - 13636840319777288975297376477193236278, 29i8).4, L5kB(84, xzzO.u4M_f, xzzO.u4M_f, 1605979347, 124u8, qm3o6, aleo1hnzs6tvepku5yj5d7fj4aaav3rgzc2ym6ty7asy9smvqku52hqpqk2w9a7, (K9Bs {loESr: ((114171488329727392578278449602431367951i128, aleo1kd5htujfje5u6llkysfnh3ltq9vvxjyrsngdj8xrnu3nvwr0egzqchnzvg, 28951957769989717136107388855582077357), false)}, -4949i16 + 24924i16 ** 0i16 * 29303i16 ** 0)).0)).1; + G0FXR *= 0; + } + let kyRV: bool = false; + const ZiIT: bool = true; + kyRV = ZiIT; + let gzirf = 47673874707413373014107602287377205131i128; + gzirf /= gzirf / gzirf + gzirf - -124784108253095648674801685949212139750i128 / gzirf / gzirf; + const RVfK: (field, i16) = (811615933939841879361685519923field, 13083i16); + const VBmXW: bool = ZiIT; + gzirf *= 0i128; + const N37N = -1818267590093072564i64; + let UTkfe = (aleo16ej63zxzd8sy4wr6zwt36dpn7r6znyntna2xt8xf032glq8rjvrqv0hts5, q2rpB(RVfK.1, 2299902576u32, aleo1xe2e2l6sp222settj7fsya05cj8hv7mlh9lca583k9xf5z0mgvysczgx5t, K9Bs {loESr: ((-114433289681515692371771984087319648279i128, aleo1zud7a43lvjwg08y5ld0dpx20g8m3mc8mxusyfs4m99y4vqp3gsqs7tvmjf, 144060165059045867172793779705573106977i128), true)}, 'L', 814u16, (58053u16, aleo1zjtveqca00jcc34ke80aw2zl0qljqhql8ejnnp3u2ldtulr4uups5rsusk)).2, 254848905410653826373705152158502396867u128); + let Q_JW: [address; 3] = [aleo175rltzqaf9tdzctxx6wp4cet28k5g2arp58wtk23rspgf5p4dqxqzrpq25; 3]; + const pLA1d: i64 = N37N; + const U4y8M = -66148102147010864492152139093748496056i128; + let nzv9 = I3mv(-45318567210468796496919707120937517994, [12594339491429564236u64; 1], '\u{53}', q2rpB(RVfK.1, 765688865u32 ** 1 ** I3mv(U4y8M, [2269163199428576359], '\x67', 194804214717507373989406628625932970123u128, 139742950707260817).0 * 2u32 - 2854464158u32 * 0u32, aleo1z8dtwsp5dncmpsarh4a7xj0v49zesvel5udjn03yj4a3gr3hyvfqjy4dlg, K9Bs {loESr: (kyRV? (U4y8M, Q_JW[2u32..3][0], gzirf) : (167243164943267350206483807773909918398i128, aleo1lymk3zm68n0wckqgxe5empxuhvl8vmasfd9dm5wzttdu79jkyygs20xzq0, -12903020677322563152682770815282075330i128), true)}, 'I', true? 4990u16 : 37172, (59927u16, Q_JW[..1][0])).1, 18173596348416286147).1; + const zaMu0: bool = VBmXW; + let N8AK: ipD5 = UTkfe.1; + K9Bs::LjoKc(); + let gjsY: i16 = RVfK.1; + Q_JW[0..][0] = Q_JW[..3u32][0u32]; + Q_JW[0..3u32][0] = aleo12al3jl6f9x6fxkmckwprk05wqwvk0x2l0ma6mdgggmgcxt6fncyqsp4z4w; + let YA9G1: Jyso = 15657568162133137276u64; + kyRV = zaMu0; + Q_JW[1..] = Q_JW[..2u32]; + let bMUY = U4y8M; + let QECZu: char = '\x78'; + if 65243 < 34545u16 && (pLA1d, QECZu, (VBmXW, gjsY, dPwrQ(nzv9, 20022353693801011835596572558274127725038772field, VBmXW).0, xzzO.u4M_f), xzzO.u4M_f) != (N37N, '\u{90f3f}', (mzTQ().5, -18240i16, 1251149650u32, xzzO.u4M_f), 134) { + Q_JW[1 ** (261346131063847462855912383632574814655 >= 279986099699317111418688536823606635437u128 || -123 > -39i8? 3190074793 : 1076714861) / 3340988212 / 3471673924 ** 0u32..2u32][1] = aleo10w0zw2e3quqns4lpf0rwyl4gu9gsxu936t879d8tam27wzcqjc9qjl5cc3; + Q_JW[..262259317 * 3u32 / 1207138661u32 ** 0u32 - 786777949][0u32] = aleo1l0dh7xpxl3ul4z88rxxyunmfsa4gfmskeujss333rpg6ljefr5fqp2lpjw; + const VM13Y: char = '\u{93247}'; + let ZAKa = 4261u16; + let ZEOt = mzTQ().5; + if xzzO.u4M_f == 167 && QECZu != QECZu || Q_JW[1u32..2u32][0] != Q_JW[1..][0] { + const uWdm3: i16 = -4622i16; + if 4u8 >= (ZEOt? 226u8 : xzzO.u4M_f) / xzzO.u4M_f + xzzO.u4M_f || L5kB(177, xzzO.u4M_f, xzzO.u4M_f, 1630635744i32, xzzO.u4M_f, 436462417, aleo18f9d4t3r23ey5pafncpcyznqf0pqvw9ahw2qwqcqxjzupjj3vyfqfl7w7p, (K9Bs {loESr: ((142601382846515566169068350281178498653i128, aleo19mllfdsh2ruexcgp25ajeq48ktav0250vq26lp8nlecjncr67vgsls8qhp, -76513605235405827031768161513354753193), true)}, -17203)).1 != RVfK.0 || 228931564181993539921522463592621177787u128 != 99941046182382246743704050922823798381 { + Q_JW[0..1] = [aleo1mjttr8de02wcwdn5f2k0jrthvvajdta0022flv4gf5kpk2q3tuzqgz2c79; 1]; + } else { + if UTkfe.2 <= nzv9 && 12110i16 == -5261i16 { + const mUr6u: i16 = RVfK.1; + let JPPY7: address = Q_JW[..3817435310u32 - 1586268664u32 - 2123174975u32 - 107991670u32][658150270u32 + 3422886252u32 + 108270166u32 - 4189306688u32]; + } else if -27261i16 > RVfK.1 || pLA1d >= pLA1d && RVfK.0 != RVfK.0 { + let XxsK: [field; 4] = [1476329893748319177825332610884949419943431233134371742327207269038162field; 4]; + const IyKS: i32 = qm3o6; + const mWOY3: i128 = U4y8M; + XxsK[351627622u32 + 2546577037u32 - 2451964741 ** 1 + (3453021862 / (ZiIT? 3571981871 : 1419006344) / 2854622076 + 1149802366 - 806906171u32 ** 0) + 1573612323u32 - 3169654605..4][0u32] /= XxsK[1u32..4][0]; + const fkA8H: char = VM13Y; + XxsK[1u32..4u32] = [XxsK[1u32..4u32][1u32]; 3]; + let Bi5gS = ZAKa; + const zdxoN: field = 367685020960567472562626809583106430476981747579109525911348343916field; + Q_JW[0..VBmXW? 2 : 2551418436 / 629203154 / 3145726753u32 / 3648257535 ** 1u32 + 2][0] = Q_JW[..3u32][1]; + } else { + Q_JW[1..zaMu0? true? false? ZiIT? 2u32 : 2 : 2 : 2u32 : 2u32][0] = aleo1fz0nv0epst9salxaek8j8u08f5g6g7l2zuge67jy6jgpm52xku9s66jjnh; + Q_JW[..2][1u32] = aleo19whctsyjd6avl4aayjakvzhwvutcdqwvahas9vcplglx5xr8dyps2fctue; + Q_JW[..2][1u32] = Q_JW[1u32..3u32][0u32]; + const fTxzo: i128 = U4y8M; + const Jn2vW = [VM13Y; 4]; + K9Bs::LjoKc(); + Q_JW[0..3u32][3787513271u32 / 3992379853u32 + (ZiIT? 858685439u32 : 3610860333) - 858685438u32..3u32][1u32] = aleo1z6a3jlj4rzn5xc07yjldjqzf3rcez94uh5fdu4qj8f3eqwt2yugqv2elp7; + Q_JW[399039470u32 * 7 / 2186560114 * v7AND(241847391524987975026296480092525972889, -3).1 / 3720999883u32 + 2u32] = aleo1tu28dlhey952vsd2c79etrddm4qrmd0nhc6dy8uphaalh6sggggsvk3gnc; + const tRIo = ((VBmXW, 1768647109u32, K9Bs {loESr: ((-169623627883673380789358947652924921099i128, aleo1e5uculkcfc4zl4rqdujn3hm40uadwmcwdrahs8rzvmymg8yhxuqq2u3ny9, -76977443037533332939649115709832008272i128), true)}, 4263510770u32), 64783u16, aleo1spsac2sq07xaq4v7506g4myn46gmt3ufxvw7z3k6q7vhqhd38ypq2qclfq, false); + } + let G06Q: Jyso = YA9G1; + Q_JW[..2740573487u32 ** 1u32 * 0u32 + 2804504703 - 2804504700u32][0] = Q_JW[2..3u32][0]; + const r0GHj = [xzzO, ch4X {u4M_f: 183u8}, ch4X {u4M_f: xzzO.u4M_f}, xzzO]; + const BGdvG: u128 = 185472751141872542312928374096509507979; + const mcVn = 43186637i32; + Q_JW[1..][0] = aleo1khfgnmvufz3ugmnf4ppm4szvz6h6hqpdrrxr2f87kz4nrunr9vxqd24ur7; + const nSjq: (ch4X, i8, [[i8; 4]; 2], i32) = (ch4X {u4M_f: 161u8}, 105i8, [-98i8; (2, 4)], 522855271i32); + Q_JW[1u32..3u32][2657884014u32 ** 2857594994 ** 0u32 - 1970318989 / 935252140 - 2657884011u32] = aleo1eelzjr4kw6rumv8msnxwul8z6uckgz9365e0t3kg78c6pvxengyshud3m2; + } + if (77147912933772472361213059325802896524u128, pLA1d, I3mv(U4y8M, [0u64 * YA9G1 / YA9G1; 1], QECZu, 295029141568013608016860610143669697228u128, YA9G1).0, '\x09') == (314134940696456722253846590901812262141u128, 1833445091029163523, 2831523674, '\x1f') && qm3o6 > qm3o6 || 2780980146 > 4055013850u32 { + Q_JW[false? 1 : 1u32] = Q_JW[2047621255u32 ** 1 * (3267984634u32 * 0 / 3402973877 - 0) + 1294132922u32 - 1294132922u32..3u32][1u32]; + let wZdq6: i128 = VBmXW? QD4rE(RVfK.1, 273440422i32, true, mzTQ().6, 166239316713555330396201884570696406604i128, qm3o6, -14, 908871282u32).1 : U4y8M; + Q_JW[3380015772 ** 3352780680u32 ** 0u32 - 3380015770..] = Q_JW[2..]; + let xLZx: field = RVfK.0; + } + Q_JW[1..3u32] = Q_JW[..2u32]; + bMUY += U4y8M; + let FS5A: RKDY = 6188849547834244082i64; + let ufJ9 = UTkfe.1; + for iIHR in 2941851598u32..2941851621u32 { + const q9M3: [(char, i128, i128, u32); 4] = [(VM13Y, 72576239264448476642350599093411882484i128, -147320893138752661054360662653095852220i128, 3115223728u32); 4]; + const OJZyp: char = '\u{cc76d}'; + let NYvTT: i128 = -29347687663896686628446969922135207346i128; + const LUTv7: u16 = 36968u16; + let bARMx: i128 = q9M3[2u32].2; + Q_JW[1..2u32] = Q_JW[2u32..]; + UTkfe.1 **= 1; + } + Q_JW[1u32..2][0u32] = Q_JW[2u32..3][0u32]; + } else if YA9G1 <= YA9G1 && (true? false : zaMu0) != ZEOt && RVfK.0 == 153564673309481869582field { + Q_JW[0..] = [aleo155lefkkhuwy3ehwx7hk4l5ccpskqv5vhppv785nk9rsnzyvgh5yqye8exp; 3]; + if (-90i8, aleo1kvz6rsmlk3femxjya4up02hfcp8ntn6mn72hzxp7rh3l84e6pvzqmuqsmm, (2008413433, (true, -57, (-7371462878838305626i64, -20623i16), 159597018746321768650800580602047675570))) == (N8AK, Q_JW[0u32..zaMu0? 3 : 3u32][0u32], (3388444860u32, (false, -119i8, (-946288012951300712i64, -31340i16), 226188615473836544987982299649658581699u128))) && (N8AK, true) != (UTkfe.1, 1179827463 != 2144277410u32 || 1638161633 > 4056343900u32) { + Q_JW[0u32..][0] = aleo1hpmkfsh9fm380zpsa3cmvezdx2ty6z0hl9hqpqr8kew8f3wu6cgsqv7mgg; + Q_JW[1u32..2][0] = aleo12rhensdu56x8cwadhhe8cgzyt42k2xlg93d2zl5uj4qmhz20lvyqvnue00; + UTkfe.0 = Q_JW[..3u32][0u32]; + nzv9 *= 0; + let XvHPh: (u32, u8) = (1354610303u32, xzzO.u4M_f); + let s0Tj: ipD5 = N8AK; + kUOeO((-66, ch4X {u4M_f: 106u8}.zxMYt(VM13Y, gjsY, YA9G1, 2919481725u32, Q_JW[0u32..3u32][1], bMUY * 2i128 - v7AND(135758918129523646772788181954932853254, -26i8).2.loESr.0.0 + bMUY).2, RVfK.0), XvHPh.1, 15124813998732003985u64, K9Bs {loESr: ((65944867508267693906401586650198296708i128, aleo18crz0jcg3kv8uk3crmsnmhxeqwfetldqg8z3r0zs7f3ylyjudypsqvcmst, 87237719200337825140614613656882735748), false)}, K9Bs {loESr: ((-84183053990035030841815095387858000448, aleo14kaakkwv0xtusxew2yqsxfct04pwhvh00k8jrvp22964vlessqzsm3yrex, 2965950499071776169169454300208275547), ZiIT)}, -114i8); + const bO4f_: (u32, u128) = (7778815u32, 12245470736488785572506927456147025180u128); + } else { + let P6oD: field = 2622497436864931080562210771462769765500840874694152field; + Q_JW[0..2u32][1u32] = Q_JW[1u32..][0u32]; + Q_JW[0u32..2u32][0] = aleo18m349kulxz2d8v8x9w9nlg2pkdpdrrz0w7jejcjpn9kwxm2uyspshjhuzs; + Q_JW[1] = Q_JW[1..2][0u32]; + Q_JW[2368011733u32 / 1040098046 * 1159992880 - 2319985759u32..3] = Q_JW[1..3]; + Q_JW[..3u32][2] = Q_JW[2u32]; + gzirf = -34818500926212296378951139568593038221i128; + const b6h2: i8 = 109i8; + } + let FU7k: char = VM13Y; + Q_JW = Q_JW[..3u32]; + let z9m4: Jyso = YA9G1; + let o3Ju = 2832329992u32; + K9Bs::LjoKc(); + const s_3KF: bool = false; + } else { + Q_JW[1u32..3u32][1u32] = Q_JW[2816411012u32 + 1018495970 - 3548385843u32 + 2530522625u32 - 2817043764..3][0u32..3][2]; + } + let Z3gp = 4229379730u32; + Q_JW[1u32..3][1] = Q_JW[0u32..670658133u32 - 561589228u32 + 2108130754u32 - 1805419097u32 + 719260658u32 + 2619359494u32 - 3750400711u32][0u32]; + } else if 51732u16 > 27315 || 2395660496296787270i64 != QD4rE(RVfK.1, -66082432, Pd5A(I3mv(U4y8M, [17062370155175507049u64; 1], QECZu, 209109243241184359029393566700631230582u128, 8945991577195378835u64).1 + nzv9 / UTkfe.2 - 167463559499735771693830500332104261928u128, 4333348642067252708261596877820594563307286720622027747320525438377703511170 * RVfK.0 / RVfK.0 * RVfK.0 + RVfK.0 * RVfK.0, Pd5A(48526231811683980575465009938913722154u128, 30456077663260601819710471481867715974205483196387792323934706706field, 11371141971481917945, 139739819u32, -479803390, aleo1dc72mcwsx3e87sc70hw6k8fq2hssjrvx0v9sfgju4k90qn8m3yysk9pynq).4, 3825090337, -1909151087i32, Pd5A(305311409886297113298711319869525617319u128, 926860179064786004568369543359611873318593009541120756field, 10285424944595658419, 3811662113, 330286470i32, aleo1ydv5q3jl0hwejfjwxfst03uh52xmfn30snnkvy0f4cmdxkw0r5rsuxvhav).1).5, false? 144u8 : 122, -9054995066721059757636586583000181994i128, -80618901i32, 118i8, 3333690113).3 { + Q_JW[..false? zaMu0? 3 : 3 : 3u32][2] = Q_JW[0u32..3u32][1]; + Q_JW[..3u32][0] = Q_JW[..3u32][0u32]; + Q_JW[..3] = Q_JW[0..3u32]; + const tTNbo: [i64; 2] = [5622994518162935690i64; 2]; + let ASUWU: K9Bs = K9Bs {loESr: ((-53188326090660235552859207606665414278i128, aleo1m8sexvn0j2s4r3qh9t8j39ge5rp3kz5v60pt5unyfs4p40rm6c8qsl2mzz, -94106919524289391866782466255445726086i128), true)}; + let pzEc: bool = ASUWU.loESr.1; + const sbAIh = aleo1nmahjsz833ccz0mjyd0ymms6wj83udrfp4epq8f4rv64jeh8y59qkcq8v6; + const bb7AA = 168201130786962705343919781389526898357u128; + if UTkfe.1 == UTkfe.1 || gjsY >= gjsY { + let b00q: (i32, [i8; 2]) = (qm3o6, [101i8, 32i8]); + let BNIkN: bool = VBmXW; + const QM7fs = U4y8M; + const vVwX: (address, ch4X, Jyso, [bool; 1]) = (aleo12vl5wds949fwe3zedevmvfetlmwrenu7yw98f68vssklk2fetu8qp8nkl0, ch4X {u4M_f: 242u8}, 7365788429874769228u64, [false; 1]); + K9Bs::LjoKc(); + QECZu = QECZu; + let u9XI: char = 'N'; + } + } else { + const JMOQn: char = '\x32'; + let d5TL: ipD5 = UTkfe.1; + const cHTPF: Jyso = 7841550331050540896u64; + Q_JW[..1u32] = [aleo14c8gg8drehmqgc05e8jh3umjem8lh74r6cxj76jdm5hdmfxuxsgspevggy]; + Q_JW[1..2u32][0u32] = Pd5A(UTkfe.2, RVfK.0, YA9G1, q2rpB(RVfK.1, 1279143531u32, Q_JW[0u32..][1], K9Bs {loESr: ((-51436087137856246857925314176352628217, aleo1ysj288w4vflhavq9ujd8x5asaygvfyreax795zcwql6qf75k0v9stnhvg5, -152803624330162199673660368446123942540), false)}, JMOQn, 0 ** (30100 + 0 * dPwrQ(nzv9, RVfK.0, zaMu0).6 - 10784 - 1 ** L5kB(xzzO.u4M_f, 128, 152, -2135871060, 246u8, 1027666380, aleo1trkfcgu2sj0eyfm2mgwuwfth8yt54dt2qy9unsuf0au3tfs3hvxsdwyvvu, (K9Bs {loESr: ((-145723253805835163390333449650995826450i128, aleo13ms4nxrrx8gz52ct95gzukgpnuh5twqf44wpdn8w0vntszr23uxs5tjsh5, 7506633758912406423086651237141484728i128), false)}, 27872)).2) * 0 + 0 * 55223u16 ** 1u16, (40275, L5kB(239u8, 80u8, 72u8, -1782944209, 110, -1i32 * 1153552703 ** 1i32 - -1257218279i32, aleo1cmy63c750uflce5ncp39ue7dt0v9cq0qanlkc9a7a9te6dap2c9sqjdved, (K9Bs {loESr: ((false? 54598702291090508524402604336042002999 : 4671589821902801777680574909932830914i128, aleo1ep0kvfa3e8ryl6xdetvueck7yae552m30renhtpktr5e9aea7syq2jar2y, -61414816538964793198254071283383330788), false)}, -22489)).0)).7, 507290020, aleo19wnae049w34ddtetw8lrdgvtkvuagma75xdlyf647xwpca6ztg9q6cuhfw).1; + const BpG2: i16 = 30693; + const vO6n: char = JMOQn; + } + Q_JW[2u32..][0u32] = aleo1plzsawyztefqgnx94en468u5sxgzdnphdzpsuvdncurwmd2e45pqgsrwhx; + Q_JW[1..][1] = Q_JW[..3][0]; + UTkfe = UTkfe; + if gzirf > 156540102541971155550613467166617361293i128 && -6502444888946503390i64 <= pLA1d && N37N < N37N { + let qrfX: Jyso = YA9G1; + const x5n7 = 62897u16; + Q_JW[..3][1] = aleo1ghg8n2kv59k7waylx9pu2juxe78khyq5mxqx4swk86wm6nld9cpszerza4; + Q_JW[1u32..3u32][1] = Q_JW[1u32..][0u32]; + Q_JW[2u32..3u32][0u32] = Q_JW[(zaMu0? 1 : 1u32)..2u32][0u32]; + Q_JW[1u32..][1u32..2] = Q_JW[1u32..3038920793 + 769895625 + 194658029u32 - 2636487559 - 1366986886u32]; + } else if Q_JW[0u32..2][1] != aleo1j0t94643m0yhrt0nnfrqnzzuf35rlcukdp683s94xhhhwrjuvvxsm8vtsd && QECZu == '\u{12}' && Pd5A(UTkfe.2, 2249290627446299795320149129032134329321532303037932049320355123, 14429961224637463760, dPwrQ(315080563485311149093447410297513127880u128, RVfK.0, VBmXW).0, qm3o6, aleo1kqnaygt4j6j4dx4ww2xu2jcnav0t5mynvzd30e9xg26z4gtc3qpshqv0sx).0[0..][0u32] == -5i8 { + Q_JW[1u32..2u32] = Q_JW[2u32..]; + let grSD = ZiIT; + } + const fR_g8: u16 = 22662; + let GrlFe = K9Bs {loESr: ((93724781975614071998196104988772761789i128, aleo1gqpze0uwacc7hdfl2m5dqjxewuzcx3zk7tzyn3qpe3fdrhdxtygskg5z5a, -14760761559607589392670111696343856247i128), true)}; + const qsHE: u32 = 3585681328u32; + return (GrlFe, ZiIT, QECZu, ([246u8; 4], '\u{18}', [-16i8; 2], -59i8), UTkfe.1, gjsY, I3mv(U4y8M, [YA9G1; 1], '\x78', UTkfe.2, 4637908875797398360u64).3, N37N); +} + +function XKP9 ( + const ZHxF4: i16, + const ZEUrw: (i128, u16, (i32, u32, field, u64), u128), + deEsz: i128, + KCR4: u32 +) { + const iVsWw: (i64, u64) = (2437211665529038062i64, ZEUrw.2.3); + let FN8T: i64 = iVsWw.0; + const fDmq = K9Bs {loESr: ((-100341170220760744500900887000901676053i128, aleo1vtrd4w579e7juwksuyc8mauu8fh4l3lqppu2xprtw5zeynqyh5xs48krpm, 143159851619076487599084179009580843293i128), false)}; + FN8T /= 6529970316163490364i64; + let j2g9W: u16 = ZEUrw.1; + let MsGt = deEsz; + K9Bs::LjoKc(); + FN8T *= FN8T; + const qVLDI: i16 = -14851i16; + const zvk29: ipD5 = 75i8; + const ME21K: bool = fDmq.loESr.1; + j2g9W -= ZEUrw.1; + let O_69f: bool = fDmq.loESr.1; + const AAsZ8 = ZHxF4; + const Ho5Fg = '\x74'; + if fDmq.loESr.1 == O_69f || [-81i8; 3] == [-105; 3] && 169 != 252u8 { + MsGt *= 1i128; + let J8GX: i16 = AAsZ8; + MsGt += fDmq.loESr.0.2; + const c1UM: u64 = 9341971734342752060; + J8GX += 12946; + const Aw86: ipD5 = zvk29; + j2g9W += ZEUrw.1; + } else { + let mLEi: u32 = 3113656243u32; + K9Bs::LjoKc(); + O_69f = O_69f; + j2g9W = ZEUrw.1; + MsGt -= ZEUrw.0; + } + K9Bs::LjoKc(); + FN8T -= iVsWw.0; + FN8T /= iVsWw.0; + FN8T += FN8T; + j2g9W /= ZEUrw.1; + MsGt -= 122096905818563743179660768311165668172i128; + O_69f = ME21K; + let jck2: i64 = iVsWw.0; + let LdsOq: [address; 3] = [aleo1fy0x0jm8zhkyzhjqrxtp5ylr7skglzy69wtl8snys8pzksudy59qhr0lcj, aleo1a32kn50sx3hrhck7zt03mjadfdmp87997jzf47cflgx8e75f0uzsehc34h, aleo1urps87kdnk6m2xjmh87kqxzv20ehvenqr5sucrv4e0jnjevwpyxs5rl5u9]; + const dgET: u128 = ZEUrw.3; + let zTnr = zvk29; + const QacH = fDmq.loESr.0.1; + const YcJ_ = 160u8; + const sFfV: u64 = ZEUrw.2.3; + LdsOq[..2u32][0u32] = LdsOq[2..false? 3 : 3][0u32]; + let k35E = YcJ_; + LdsOq[1..2u32] = LdsOq[..1u32]; + const xknxf: i64 = iVsWw.0; + const EhNu = ZEUrw.2.0; + const WlA3o: u8 = 167u8; + LdsOq[..2u32][1] = LdsOq[0u32..][KCR4 * KCR4 ** 0 - 3187832772u32]; +} + +circuit bmU5 { + Ym93w: RKDY, + QtiNX: [i16; 3], + bPmuq: RKDY, + nsVm: address, + + function a1NU5 ( + self, + ywLV1: address, + const GMYa: i32, + const U3uU0: address + ) -> ( + (u16, Jyso), + [ipD5; 4], + u32 + ) { + let xRFXz: field = 00438682555206414766500024075field; + xRFXz *= 220282224128572556755946878339150field; + const dIWqn: [Jyso; (2, 4)] = [[5537677808031020229u64 - 4127141556929208187u64 - 12489077282622935491u64 / 2412771168752492682u64; 4], [1763386308569258665u64; 4]]; + let Zln0f: Jyso = 13867034320101421355u64; + const PxN_: u32 = (2899906819u32, (541269459u32, [-17806i16, 9516i16, -29295i16, 14697i16], 1524746472u32), 'P', 133u8).1.0; + const cvUpd: bool = true; + let vHRc = 25025u16; + let eZ2sC: field = 0814790440535797406548663204820619475field; + let I7A21: u8 = 96u8; + eZ2sC *= 09722027628978216873733322field; + let eijFM = dIWqn[0u32][1u32]; + let YznR = U3uU0; + let BQYz: (i128, field) = (-12055274492436871545641028733929241448i128, 680122384830754133057); + eijFM -= 502677291142504005; + eZ2sC /= xRFXz; + const wC7h: i16 = -6446i16; + const G9crn = 1463481611155745939857332343797334553519field; + I7A21 -= I7A21; + const dsEv: bool = cvUpd; + let MfazE: field = 0825316953811124036125906035341484017863772273835310241853field; + BQYz = BQYz; + BQYz.1 /= G9crn; + BQYz.0 *= -11; + Zln0f *= 0u64; + let pPwu = 4310146035227027966u64; + let FP8N: u8 = I7A21; + let EIUm: u16 = vHRc; + const JtzE9: u32 = PxN_; + let IsU2: RKDY = 8021371201570905588; + const vy7t: bool = cvUpd; + const M1YFD = 74i8; + let tvPx: (ipD5, field, (bmU5, ch4X), i128) = (M1YFD, eZ2sC, (bmU5 {Ym93w: QD4rE(self.QtiNX[(dsEv? 2u32 : 2u32)..3][0], GMYa, false, I7A21, BQYz.0, GMYa, -102, 2356801918).3, QtiNX: self.QtiNX[..3u32], nsVm: YznR, bPmuq: false? 6902436975496171161 : 5010156910042524018i64}, ch4X {u4M_f: 168u8}.zxMYt('\u{49}', mzTQ().1, 1689545443140595681, ch4X {u4M_f: v7AND(298868957309467180458496747536823241187, -38i8).5}.fK8MO(false, 14722u16, 8u8, 359273078, false, Pd5A(122590509838902885673073082106559629949, 5647380791484422359749406981000286597597357547610644340field, 14362498035429822695u64, 1418957010u32, 1470292134i32, aleo1605q7lat02wys03ve85pjac3lgdtkrxvahn9kf364v3vj8pwggzq43vqeh).0[0u32..1][0u32] + -80 + 93 / 81i8, 108816512001427963009570655100439214029u128), aleo1gtmka6juhdl8l0va2fsujzetfvuut3aurdnp8u7kmd8ffm3yaugsmtj28z, -149709282786366419662898809312394629089i128).2), -84482361484751540328740038069065722997i128); + tvPx.2.0.QtiNX[2u32..3u32][0] += -1829; + if 709854383332079194 != 12678790371588593594u64 && [']'; 2] != ['o'; 2] { + tvPx.2.0.QtiNX[..2][1] /= tvPx.2.0.QtiNX[0..3u32][0u32]; + return ((40059u16, 10449903586007680201), [-80i8; 4], 445901818); + } else if GMYa > GMYa || 30i8 != tvPx.0 && (tvPx.2.0.Ym93w, self.bPmuq) == (IsU2, 917858893068797239) { + let x12NM: u32 = JtzE9; + const eGWLx: RKDY = -5225448239774503570i64; + const ajlGp: [i64; 1] = [-5694038756500871201]; + return ((32675u16, 1805454890190058667u64), [M1YFD; 4], PxN_); + } else { + kUOeO(dsEv? (-11, tvPx.2.1, (MfazE, tvPx.2.0.QtiNX[..3u32][1u32], Y8vwD().1, tvPx.2.0).0) : (tvPx.0, tvPx.2.1, L5kB(89, 132u8, 172u8, GMYa, 123u8, GMYa / GMYa + -1 * GMYa, aleo177904dwxrhk04pmt3s9kkx4e6m592ls0slntehfzdmgd9jmcesps2n0as0, (K9Bs {loESr: ((62134533685990411926845471780768463058i128, aleo1dvpl7xpwle50ffnhvgl7h9ag7pl3wz3yw6a7r5f0sgshdnyd4sxq70gjlg, -147894657023710723731271838620824930676i128), true)}, -12155)).4), 96u8, 15366636313350941927, K9Bs {loESr: ((100994652933028406021267672012945999050, aleo14vfe366srqh3c738hwy6x5nmgehl9jahatrfyhcz55gr453x6gqsa370lc, -62110067019634070621929284139586619852), true)}, K9Bs {loESr: ((-136621648542224632968579816659759414988, aleo1mwar85q03cugu55qh4c7peq4vtrc3fthhlhakfpl9t00txn5uyqq0dwy0l, 134117837136676345088100582949835236354i128), false)}, 87i8); + const WmfyN: field = G9crn; + const yV0oE = U3uU0; + MfazE *= 8452737957216197032176075; + let LUdN: (ipD5, u16, K9Bs, i16) = (101i8, 2946u16, K9Bs {loESr: ((78420226127485113915910520491043921140i128, aleo1yu7chfgwxasygzzpdk3xfgtjrd5r7f3q04m0yu4n2mpqlp2jsuyq0agydr, 44605281380611732700193024696311089787i128), true)}, -17231i16); + let dgFRe = LUdN.2; + tvPx.3 = -55227930280195397815326782150857550971i128 * -2 / dgFRe.loESr.0.0 - 74142032372499899046845842692757305168i128 / LUdN.2.loESr.0.2; + YznR = tvPx.2.0.nsVm; + return ((15461, 1772980496875896067u64), [-54; 4], 132136118u32); + } + } +} + + +function mzTQ () -> ( + i128, + i16, + address, + address, + u8, + bool, + u8 +) { + const WHon: ch4X = ch4X {u4M_f: 101u8}; + if aleo1ezte7txx3k35nf7wml0ekcz3wflfeq2fr23ydt3w343uuh4rkc9qvrqd53 == aleo1yh8xttr3nhhnujxv54psyjpyar9mdsvvv5pyk9d5p7hewtfcpc8swxmgq8 && 4653251142788314871 >= -5057112535680039170i64 || WHon.u4M_f <= 178 { + let A4fA: (u32, u8) = (2162737697, 133u8); + const c8dq: u8 = 42; + A4fA.1 += WHon.u4M_f; + const L1VYg = [aleo1p6g7njn2hkt2cvvz9dllfjgf6n8dgmmrxe60aduwvn08z0yrcups5snlz0; 1]; + const xlNK: u128 = 333111921169768501043092465175623836219u128; + } + const UBVt: address = -1669283699891376608i64 < -3298024842541253819i64 || -1510076376i32 >= 2012085866i32 || WHon.u4M_f != WHon.u4M_f? aleo1h7dkwp9qmh6zdk7nf5frxkdhazczeqff4p4a8jqnleyeuzwz25gqglqy3k : aleo1v63333x5cjl0dp5hhyp6nrxxynvcy666k6r0qv6lxuhyg52vt58s8puuq8; + const hh9A: field = 179031278369167751078079175838984166740622171471416619942field; + const vS3F = [9427353847714378179u64; 3]; + let jqat: ch4X = WHon; + jqat = ch4X {u4M_f: jqat.u4M_f}; + let x5DB: u32 = 260936385u32; + const GccX: i128 = (-32992675003677013349660016468989406286i128 + -166861090832790745401962769233509820212i128 * -1i128 * 0i128 / 111794390513078535612852873206452275584i128) / -138393426567483766385917146992071352493i128 / 87742284247118782046006072874926915805i128; + let Fgwd: field = hh9A; + let uKda = '\u{ffd7b}'; + const s1hP = GccX; + x5DB = v7AND(113764294845136463612170659492956266177u128, 29 / 8i8 + 104i8 + -126).1; + let XxlHz = -28114i16; + if I3mv(-10088692014413372624158538948877203127, vS3F[2u32..], uKda, 83424585726784390407931560058147138243u128, vS3F[..3][2]).3 != 28051u16 && 724181806 >= x5DB { + const oyUM: field = 6475175743186570345645222115field; + } else { + jqat.u4M_f *= 1; + x5DB **= 2647624728u32 * 3531911786u32 ** 0u32 / x5DB; + let Lta7 = QD4rE(9343, 2095974426i32, true, WHon.u4M_f, GccX, -1118891944i32, 52, 2812065419u32).3; + K9Bs::LjoKc(); + if 9662517225390988363638815785574018770 == 35942553977853665822916868589247971295u128 || -22495 <= XxlHz && -1496910802i32 < -1204440394i32 { + let ir66F: ipD5 = -57i8; + let qpLV: address = UBVt; + for Ba93 in 4066185443u32..1391571235u32 - ((true? 2545946037 : 3829559119) - 419550163 - 1688391962) ** 0u32 / 1640938254 / 4248425972 + 2674614228u32 { + let BKoFM: i128 = -55621625117362741389324776984008087223i128; + const c7vu: u32 = 1480685577u32; + } + let Pi4q: bool = false; + } else if -265027491i32 > -169385625 || UBVt != aleo16yr3fr84kn2zfptq3zrwue0va6rd2mdyrwxctg2k66x3flzlwv8qs3cnkj { + Lta7 -= -5681280276128736425i64; + Fgwd += Fgwd; + let L495N: i16 = -32625i16; + const fVFru = true; + } + uKda = uKda; + Lta7 += -5177035940480297694i64; + const SGfM = 79i8; + if -31586 >= XxlHz && WHon.u4M_f < jqat.u4M_f && (('\x13', aleo1l665gln6pajcgtgdnf3ryyl04m06ath6uve86p26n7n6y22pjsyqln3qvy, 1429815777, 8784), 21961864644578166field, '\u{77}') == (('\x33', UBVt, 802415056i32, 9352i16), Fgwd, '\x73') { + Lta7 *= Lta7 + 20i64 * q2rpB(XxlHz, x5DB, UBVt, K9Bs {loESr: ((GccX, Pd5A(I3mv(s1hP, vS3F[0..1], uKda, 141637796004676141429310365413645150479u128, 6212559693320041598u64).1, hh9A + 882239602879631339848field + hh9A * 596567972404709171830field + 6111977028529 / 79495274407542114422373033088, 12949141505232878209, dPwrQ(308910013879631883506735587091353796473u128, 83251980671013352053702987304267865259382857968547075, false).0, 268202136, aleo1kg2u92uc55q3q8rf37njh5h5ajlkl24hjpyuc73fcyjghmjzggysjk4he3).1, 157142484850504917269119711438162497807i128), Pd5A(338431651300970452001619468870613005580u128, 9936757004372304317823964634254069980123621522639385123861, 7109695584991429893, 583137863, 827418415i32, aleo16gt6l5gdkcgfh0jp63ssumdc95ezmge4hndtjx8cke6tgdpp7gxqp4af83).5)}, '\u{17}', 49422, (21801, aleo1utj6lc4mqgd2hv4a5dp4pxnp3fscmepjr3kg7vqupg2mmmvsay8qzagmtt)).0 * -1i64 * -1 + 569676108772538116 + 4380693625018689067i64; + } else if 98 > 226u8 || 62956u16 <= 16883u16 { + Fgwd += Y8vwD().1; + jqat = WHon; + Fgwd /= 742583107176030363995402653408; + } else { + const ZDgNT: char = '\u{1c}'; + } + } + const dg3J: [u16; 4] = [47618u16; 4]; + let Pr5gq: ipD5 = (2894750382554899165i64, -117i8, hh9A).1; + XxlHz = XxlHz; + const GBqr: u16 = 43670u16; + XxlHz **= 1i16; + const qmj8: u8 = WHon.u4M_f; + x5DB -= x5DB; + const Prmi = hh9A; + const IYac: char = '\u{6f}'; + const VPyl: bool = false; + K9Bs::LjoKc(); + const kTPmO: field = Prmi + Prmi / 5681335127477584223field * 6341638203320814340215947216field * Prmi / 222751542066377751453field; + const pCMP: field = hh9A; + let T0Iq: (i32, i16, u8) = (-732498172i32, 1257i16, 63u8); + T0Iq = (1517678200i32, -21074, 25); + jqat = WHon; + kUOeO((-7, ch4X {u4M_f: 142u8}, 023691906352161788905267945427769398762796700395728520585018897824), 139u8, 14473567956589276113u64, K9Bs {loESr: ((70113353135869289213227061883702758158, aleo12qg86l9q6urnperpjkrtxmvusjd0tgvf7hwhxjnnc7gquv494sxs6z4vm8, -116394397186503093288491722506793046841), true)}, K9Bs {loESr: (dg3J[..3u32][2u32], K9Bs {loESr: ((144560412188857352338229228872266475880i128, aleo1qcnhhqafqdp8r6c3dq4h6t5t53n09rafev9huzvpyd2aseek7qqspvpp5z, 168070128005806810667544723148487765245i128), false)}).1.loESr}, Pr5gq); + let AvvI0 = x5DB; + T0Iq.2 **= 0u8; + x5DB *= AvvI0; + if UBVt != aleo17faydprt2vk5jglkgq5czzsm9jvzc3z26nvfm2qwn9hl6lhqecrsa43qvv || [210u8; 3] == [55; 3] { + T0Iq = T0Iq; + if qmj8 <= 200 || jqat.u4M_f >= jqat.u4M_f { + let vuG1 = AvvI0; + for dmK1A in 1253496863u32..4277273242u32 - 1634021791 ** 0u32 - 3023776369 { + let KKmM = -83i8; + let p2tvV: i64 = 4007814456382104883i64; + const Nv0UC: ipD5 = 28i8; + x5DB *= 0u32; + T0Iq.1 += (149u8, 2451i16).1; + if [(0265659964574926366525242269868080858056935333547, 242997134677975523232085847862063579304u128, 114591995235084781782313408965188449574); 4] == [(pCMP, 296642632843535395719614041907781330798u128, 280095583006623467854573829361719045932u128); 4] && Fgwd == kTPmO - 8928507107968583field / 3592743415107047field + kTPmO * 844153571096684043470990 || T0Iq.0 > T0Iq.0 { + T0Iq.1 /= XxlHz; + let xkvo: field = 0552705377073104480673233958309263120641486525810010000200276field; + T0Iq.2 += qmj8; + const vdbzT: i16 = 3866i16; + if IYac != IYac && 33809275531801143422478665931840841002 < 330489722679441439879414126577884689799u128 { + let YYlo_ = 316710953778637751179886940189063977685u128; + } else if -159278054228982514785987722338040968283i128 >= s1hP || VPyl != VPyl || 14765807836121651902u64 > vS3F[(1567712901u32 * 1276201393u32 ** 0u32 - 976191591u32) - 281556001 - 36942625u32 - 273022684u32..][vuG1] { + T0Iq.0 += (3490u16, K9Bs {loESr: ((-165088434757481032634574995172467432740i128, aleo179rtmuz9fham2ddnsh3lgusruphautxkdf707x2awtstkdatlg8sw0d0pc, -105806039123831977818409015825708756952i128), false)}, 52829082729110267129000526081914880176u128, (('\x11', -1310894280i32), p2tvV)).3.0.1; + } else { + Fgwd += 973337086696912937122686540field; + xkvo -= Fgwd; + if VPyl == VPyl && -8770423121867769839i64 >= p2tvV || 129 <= T0Iq.2 { + let b9veE: Jyso = 8692247844566043377; + let MyDl: (i128, i32, u8, u8) = (s1hP, 972183152i32, 240u8, 26u8); + T0Iq.1 = vdbzT; + } else if 197161836 <= vuG1 || p2tvV == -2873537577969302238 { + let jZS8: ch4X = jqat; + const fGwE = [IYac; 2]; + vuG1 *= vuG1; + let ADM0Z: i16 = vdbzT - 0 * T0Iq.1; + jqat.u4M_f += jqat.u4M_f; + const nZ5B = vS3F[1u32]; + } else { + jqat = ch4X {u4M_f: jqat.u4M_f}.zxMYt(IYac, XxlHz, 2451272572465901257, AvvI0, UBVt, -160400091924921726986188087366228006291).2; + jqat.u4M_f = 220; + let VrfV: u32 = 2275363865; + const xSCWV = dg3J[..4u32]; + XxlHz += T0Iq.1; + } + let FUpt: u8 = qmj8; + let iM2ON = (VPyl? dg3J[(VPyl? 1 : 1u32)..4u32][2] : 64579u16) ** dg3J[1u32..3u32][AvvI0] ** 0u16; + let yTWo: ch4X = ch4X {u4M_f: 48u8}; + } + p2tvV += p2tvV; + } else if 68861795866900210541214707753628403414 > 145850562393766968081521126375467019747i128 && -997880423i32 > T0Iq.0 { + T0Iq = T0Iq; + const k0Ug = UBVt; + let Xdy4T = 164u8; + Fgwd += pCMP; + const nynlD: i128 = s1hP; + jqat.u4M_f += I3mv(132707510622041913300291911957443995170, vS3F[..1], uKda, q2rpB(-19512i16, 2777671353, k0Ug, v7AND(37281081255425919850698036136361537948, Nv0UC).2, '<', dg3J[..4u32][2u32], (2615, aleo1t7nmkmul67maad2svcjf2lmcgqfsg0u7ws9pstz8m4xl0hy2wvqqncwsgk)).1, 6574202257844738532u64).2; + } + } + vuG1 **= ((vuG1, dg3J[0u32..4u32][2u32], Pr5gq), XxlHz, Pr5gq).0.0; + const rVxZa = (vS3F[0u32..][0u32], -7381330369699263790i64, 109i8, [6058i16; 1]); + } else { + let XaeRa: address = UBVt; + const ZnFgD = 21198i16 + -18438i16 / -27882i16 * 15859i16 ** (0i16 * 21820i16 ** 1i16 + 31272i16) ** 0i16; + const fOaj: u8 = WHon.u4M_f; + T0Iq.0 /= T0Iq.0; + T0Iq.1 /= T0Iq.1; + let jpMwI: i128 = s1hP; + Fgwd = Fgwd; + if XaeRa == XaeRa || dg3J[..3u32][2] != 12411 && -2106265408 >= T0Iq.0 { + K9Bs::LjoKc(); + let YFyvO = 2456887686u32; + T0Iq.1 -= -12710i16; + } + } + return (-8942736925856645330722675899231415208i128, XxlHz, Pd5A(29913111905628698167370076573732826407, pCMP, 5293716692288000349, I3mv(GccX, vS3F[1u32..2], IYac, 124493138847132899264854850834390238155 / 314026628645626280201843665572185202694 - 0u128, vS3F[..1][x5DB]).0, 1171401527, UBVt).1, aleo1edfppwedhrpax67hhqs0gvrw47cmnwvymsr8gvp99zenxx9ahsqsy7dusa, jqat.u4M_f, true, jqat.u4M_f); + } else if VPyl != true && (true, 535042467027016111587418925960438922754500352683407954536) == (false, 4276033298467638270611178600398604004192180880915188676438553field) { + x5DB /= 3357799381; + const XLosz: field = kTPmO; + T0Iq.2 *= 3u8; + T0Iq = T0Iq; + let xPm27: u32 = 1377781607u32; + Pr5gq **= 1; + const RlrP3 = [30963i16; 1]; + const wSbmO: field = pCMP; + return (162250307780470550620740379072094787334i128, 9515, aleo1czvvu85yer35lz3v0gvc6uew05walku2zu8256vrf5dlwkx5huzs0gp7e8, aleo1s9txhp4nkcrr640xsu47dgfz6hj8tavxfpkex55h86js2xffeg8sgd73za, 92u8, true, 19); + } else { + uKda = IYac; + let kOdI8: i32 = T0Iq.0; + let m8TOp: address = aleo1ws32ldw4mwc3e6y8xfsr084cfvmcpdnez9vq22qdc36ezg8j4spqrnfq20; + x5DB **= jqat.fK8MO(VPyl, 20572, 36, 2633996613, VPyl, Pr5gq, 303866128589537236173667620923093064944); + Pr5gq *= -1; + const W_5N2: field = 456717974135375826952495195894330799field; + const myHF = -66222863682689083997547923518034731680i128; + T0Iq.1 = q2rpB(XxlHz, 2009658981, m8TOp, q2rpB(T0Iq.1, 4272511867, m8TOp, q2rpB(XxlHz, x5DB, m8TOp, K9Bs {loESr: ((-32774644313929394778362151905933142446, aleo1zp6hwpj0k86whwe0rc6kh8qpsvhsk33nlcydk3tgt4a4vp7dguzsfqtm5q, 142273365160159386764996478109974005488), true)}, '\u{faa65}', dg3J[917354670 - 952329332 / 3440760734 - 917354668u32..4][0u32], (19210, aleo1ndgfv82pruahps2704tv6klufm8um8tjefnlv3p9tw86mt3x55pspcrjk2)).5, '\x79', 7095, (dg3J[0..VPyl? 2u32 : 2][0], aleo1utuc7t0cpave652nhjzdzznew7eqjtku94zt8tke3yvqxtydcvgse4xcmv)).5, '\u{d}', 61219, (1583, Pd5A(196277826659175040175176147045559058625, 61029165148501717597534181357923523505245, 11607068464417451553, 1452821984, q2rpB(12476i16, 2997804169u32, aleo1mhd0srukjjmxcgk2ys4xrjyafuk89642s77dxtueam5zykxcfgzsqujaux, K9Bs {loESr: ((27298859349499071765264333636566038569i128, aleo1dcagyhd0mm65y4gyn5s2yrpqja6ea9lkqxermls5w7dqg0eycg9sh9wtrz, 27463888706679074846071504635558260170), 4208806648 <= 704079175u32 && 13 >= -70i8)}, '\x19', 42202u16, (62127u16, aleo1jtjc68kf2x3euxufngq0mm7szwwvhpzugqzk7ej4p4wvhym4cursppgq38)).4, Pd5A(106751335769590699653506785745884694761, 2775138576202486, 1282875935551505400, 1098935346, 1480718481, aleo1jvfmmqj39n6kguh7ll57pgfypla8hnjc669j4h20ewz67q6j05zsk6lw63).5? aleo14gvkp7ztldwdwscp2uz29yppjumpe45cncnchhreqxnvksqtsu8qzfh5r4 : aleo1lxnvpz0cd6y5eckl72zl8xardasygq53vwkh5ata89mzmcndxcyqvqagvn).1)).3[0u32..2u32][AvvI0]; + return (s1hP, XxlHz, m8TOp, Pd5A(18550188874072877112409516354834112, hh9A, ch4X {u4M_f: jqat.u4M_f}.zxMYt(IYac, dPwrQ(304563040286067220510631977555622898689u128, 7675057614445781737043610807798764720235171105250972977283, VPyl).1, 10926736841212715323u64, x5DB, UBVt, s1hP).1, 1573758222u32, -1204995043, Pd5A(q2rpB(29557i16, 611855373u32, aleo14fzg949v785clcw44a53v4rmnv8qcexdfd2dq8d33kuqa635eu8qx6vcls, K9Bs {loESr: ((105816630349831900677888605874296631000, aleo1fjuhu5c08dw6m9m5z6eupm2n2yjh7sld760gvud02enxjcs2yyrql2kauj, -35185906455339830728572622092821093484), true)}, 'D', 63180u16, (27176u16, aleo1433r2w00f7zwac4vgkj98pg6ft06ghsawpsw2lfdejmauye0kuyqvuzdrv)).1, 2426761361606725605733477230895209, Pd5A(187176153861659434785277474228019369001, 04054482340046899414677569570881853576, 6842138910897699000 / 13110368363050090172u64 - 0 + 11218946902821351849u64 * 0 * 0u64, 1698633002, 1852477864i32, aleo10c0u2e83273gp40rfey6y0dh62rwr9gegtpxjmh78hjq3dn7tqzqzylnlf).4, 817036363, 840826951, aleo1r0h7z3s6hy6tzzhk0rmgne4srw35kkecc5jru23dpccfg0smwgzqnsxwdq).1).1, 87u8, true, 101u8); + } +} \ No newline at end of file diff --git a/parser/benches/medium_1.leo b/parser/benches/medium_1.leo new file mode 100644 index 0000000000..72be640669 --- /dev/null +++ b/parser/benches/medium_1.leo @@ -0,0 +1,131 @@ +const Hqyz7: address = aleo1nr8us4x0p4yyd99qa878e06jwddqr79gavznpxc6degn2gcv8syseq4dqu; + + +const wGhr: u128 = 4235667942033320943751708062300111155; + + +function main ( + kwbCc: i16, + EYoq: i16 +) -> ( + bool, + i8 +) { + const i6Nx: u128 = 19653594751644457897907893417628551201u128; + const B4lTU: u16 = 16195u16; + const ZSXY: i64 = 7202018956140836812i64; + const Pa6v6: i64 = ZSXY; + let ZDMo: address = aleo1l0c74fedxeu6furwlu7rll54dfctkq3zdkxu7t99wljkjdu2mvyqea2tme; + let r4MO: address = Hqyz7; + ZDMo = ZDMo; + let lemUy = -117953486944586144083570938522518395328i128; + const Gps9 = -88i8; + return (false, -44); +} + +function n1L8 (hmFy: i16) -> ( + [(u128, field, (field, i16), i128); 1], + i32 +) { + const fNvO: field = 2750564077711941029722127649948645537455534027328847069044133377138109161318271362049015351591207614350232642126368462863979795820334965715740480274175573field; + const lmHt: u64 = 2269259618381692923u64; + let KjBI = 2026459569179830935i64 + 866530259422435247i64 - 2645462263636175910i64; + let aXWP: i64 = 4998340210106624395i64; + const RlUx: u32 = 4161027074u32; + const tXdcb = 4272514431369154706070578366360851993386624410603062440183406234072170341787899398086105322985899012859630300981347371254984104806559233268195649076887249field; + let Cx6n: u8 = 76u8; + const gQHav: i64 = -7958573780487908672; + let P0H5: i64 = KjBI; + KjBI = P0H5; + let GFe1: u8 = Cx6n; + let n3Yy = wGhr; + return ([(110864185312861243609835935897246916816u128, 8027383993546761796462571550076630783804181784535647612135622351173715093306398669014878563487584829796598305767019042817305553668855077844718984532061985field, (1734191401539596450667091308059679105135397069793607487076081463676390731066664430577576064187978113101858426081203997659500902563079326338873619720499688field, -21989i16), -150495415826944343782692157879357480108i128)], -1909034892i32); +} + +function sUaG ( + const oPSv: u64, + const Zq1GL: i64, + const DLxJx: (u16, i16, (i16, char, i64, u64)) +) { + let Q5zMF: i32 = 728603058i32; + const PGNcS: u64 = 2144886894999271593u64; + Q5zMF **= 1i32; + let cNWEb: u8 = 84; + let mXMNh: i64 = Zq1GL; + const KyK6H = [-8140698938246143192736917836090033228i128; 2]; + //RETURN +} + +function IYWBA ( + const CZrjP: i16, + const Rm29C: bool +) -> ( + field, + bool, + field, + bool +) { + const eLAlK: u64 = 16573868426039605925u64; + let EeHa1: i32 = -328911894i32; + EeHa1 /= EeHa1; + const Ugl9: char = '\u{0}'; + const vbXSV: char = Ugl9; + return (9734467587844032180135049760409289131752458803964775280205832969321799328489342874439633930227833935897419288695502424368396451812642234099755920744545580field, Rm29C, 6992853537485527616107390032134467669982048745678832067087057316512037110740310544306240132715608403358887486968673427333743888817361342248398851802398147, Rm29C); +} + +function ppiJD () -> ( + i32, + u8, + [u16; 2] +) { + let H9dM: char = '\x6d'; + let bu1f6: field = 1375053434411349954833697618758505804565334738968515748962076629929756121816538522980093957699888083791282567395555990973599793929063139594764266788458293field; + const Sz5W = (5452500649579431491i64 - -5629827325763702842i64 * 0i64 * (1766643220351448904i64 - 2507652939169077875i64 - 6817170868631554689i64 - 829411153429075840i64 / -3770752768528712120i64) / -2283682254362945243i64) / -5793797664062118757i64 * -1i64 * 1i64 / -1063877678551005733i64 - -6880869154805793385i64; + if -15384373465689585231904975931732993722i128 != -26752496697189791953116865077681343200 && Hqyz7 == Hqyz7 { + let Ffe7: u16 = 17444u16; + const ZfsM: bool = true; + Ffe7 /= 15862; + const cu1q: i8 = -95i8; + const d05Z: u32 = 4141246852u32; + let WyST9: [(u16, u16); 1] = [(Ffe7, Ffe7)]; + } + let kS2n: u128 = 78347670304791494401782539682926170246u128; + kS2n *= 1u128; + let mDRp = 11094583564268332311u64; + return (-1618015083i32, 180u8, [7977u16, 15857u16]); +} + +function O9Pym ( + RgmrC: u32, + A5gG: field +) -> [i32; 3] { + let wbYk = false; + const VlKu: field = 12034823521055684656803960735818709622060742766279427485221451640137620196285540080092505488883352800834441925489549958379284209458850777125442592258731151field; + let MNhB = -6776168784298605423i64 * 0i64 + -7115935549030314263i64 + 5418144407475453963i64 - 6083504378159267387i64; + let bGHh: bool = true; + let K2bc_ = RgmrC; + for YCkW in 2156152823..2156152837u32 { + sUaG(18086129069170702800u64, -8613953065723011850i64, (32716u16, 21214, (-15652i16, '\u{643e8}', -5135511156710229726, 3411414872253501622))); + let BR15 = MNhB; + const rUhu: [u32; 1] = [1184000687u32; 1]; + } + const h6nK: address = aleo1090rcrp27nedkusygfk7vs9gkaegkkeyk9lzx2sstydlky9hlspsr6q28g; + if -15514i16 != -5704i16 || K2bc_ >= K2bc_ || -18694 <= -32667i16 { + const IqRag: [bool; 4] = [false, false, true, false]; + let x9fPr = 110i8; + wbYk = false; + const K8ie: i8 = -78i8; + let PU93: u32 = RgmrC; + let V3ykU = '\u{141ee}'; + MNhB += 1353333771178790252i64; + let EqQO: char = V3ykU; + for fuyD in 1120955862..1120955874 { + const F9OQc: u64 = 11208591221347461172u64; + x9fPr /= x9fPr; + } + return [-745026943i32; 3]; + } else { + const Tgqo: u128 = true? 311260970582540822624922797527674715398u128 : 257906757538419513804363749589095902701u128; + return [-1428479824i32, -2099325920i32, 1618141399]; + } +} \ No newline at end of file diff --git a/parser/benches/medium_2.leo b/parser/benches/medium_2.leo new file mode 100644 index 0000000000..ceecf0b299 --- /dev/null +++ b/parser/benches/medium_2.leo @@ -0,0 +1,141 @@ +type xs1w = i8; + +type Z5tB = field; + +type tlVPo = address; + +type nsK2V = field; + +const QR0A: char = '\x7c'; + + +const AWye: xs1w = 115i8; + + +const NyOSS: i64 = -9112024196555249712i64; + + +circuit UaAlp { + Lq72: xs1w, +} + + +function main (const e6Xk: Z5tB) -> ( + bool, + i32 +) { + let CEPR = 916470734i32; + let vnI8e: ([u64; 2], field, (u8, bool, i16, UaAlp), u128) = ([2889181496092270957u64; 2], e6Xk, (100u8, true, -25462i16, UaAlp {Lq72: 124i8}), 37760135625388903844123788266413165465u128); + vnI8e.0[1u32..2][..1u32][0] -= vnI8e.0[0u32]; + vnI8e = vnI8e; + let qW6DN = true; + let k7ex: (tlVPo, i16, i32, [xs1w; 2]) = (aleo1m0f63uqdvnyzvepxs497gngxcqwhf9rn36przm0hyvcqg8tsyu9q9zcwa7, vnI8e.2.2, CEPR, [-111i8; 2]); + const VQn8: tlVPo = aleo155vefgc0t5yknnvtg4smfy7y5vhpru5t70nfn2nwaee9eeh3hyys4sew5k; + let GeVCw: UaAlp = vnI8e.2.3; + const jBlS = VQn8; + const FrZU_: i8 = AWye; + return (qW6DN, 101413968i32); +} + +function rqmLu ( + NFML: char, + QMKAV: i64 +) -> ( + address, + i16, + field, + u64, + u16 +) { + let RCqa = [1901182340385490071669784758737838188525280201638449765536941561135711020396220061527746756336674057817295412670452159986331379682153181375499201511956942field, 3762954748737525825800565834905724867725809544272623117743188164518934454008307409373575071111959839122640366966971683394952757289074471910475807688059161field]; + RCqa[..1u32][0u32] /= RCqa[2722709438 ** 0u32 * 3359775733 ** 1u32 + 621885425 - 2864750746u32 - 1116910412..2][0u32]; + const smbqG: Z5tB = 4439888477454096870793176575457233018778936668879584935658147170525933160250115153298062239208029034427719380092692447123716417481264166241017990941172699field; + let SyUgN: i8 = 69; + RCqa[..2] = RCqa; + const Y1KU: i128 = 97405228876352483168642295161473826241i128; + RCqa[0u32..2u32][1] *= RCqa[0u32..1][0u32]; + const mvGo: u128 = 169795069556376802589401758946050630589u128; + let IVnO: i64 = 5343892535930316306i64; + RCqa[0u32..887427927 * 3u32 / 2123569430u32 / 3029150021u32 + 618233057u32 - 472015339u32 - 146217716][0..][1] *= RCqa[1..][3912278184u32 + 851746752u32 ** (537034156u32 ** 0u32 / 1407830278u32) - 1068657130u32 - 2843621055u32]; + let mCFyw: i64 = QMKAV; + let A5Mtx = 2924523345158094175u64; + let DeTIv: u128 = jBtml(-1682496107, -21689, -1587968197i32).3; + RCqa[..false? 1u32 : 1u32] = RCqa[1u32..]; + return (aleo1es9rfhmgalsxp98em3vz84rpv9f23scfg8psya9feswdgx22dupqfj9g76, -25840, 6997858828717010106874414908217877987149986846543963933921422662340096126945997464575344199644167034548808666112748647877800676427793328759761681650787785field, 16701591620963259193, 27704u16); +} + +function gLeR (const ltYE: (char, char)) -> ( + i8, + u64 +) { + let u1Sx: i8 = -71i8; + const GPino = 251u8; + u1Sx *= -1; + let R_DB: i64 = -4528113102912117276; + R_DB /= R_DB; + let JTtRE = ltYE.1; + let GbFm: i128 = -90729062783389595540283719863095696635i128; + const WU_1: field = 12298641592796131448636852745264712871840940636430143500429547594328419579508003587060777258896545297051274586339383848215302076127997685192089080838171090field; + const oVZ0: char = ltYE.0; + const TzNpy: i32 = ([aleo1fhzvxwk4wpcnx6fjlcx9ay8ajnyx5wnunzz04qrl90fmc5j0y5qqka6rhc; 4], 1557904369i32, (1633941743i32, -9997653857003985702536225791587887214i128, "\x2c\u{10f49d}d", -1129519675037787853i64), aleo17ymuajln74htprfruf2u4cy2pcn85wp3dr3cepwu5trnnmulacqqlh4587).1; + const w5sE: [char; 3] = ['\x33'; 3]; + GbFm /= GbFm; + const wywm: u16 = 15960u16; + let pqswY: (u8, u128, u16, i16) = (21u8, 312976231132787483193089462972992041969u128, 42694u16, -24145i16); + return (74, 3906516312311027547u64); +} + +circuit KAjg { +} + + +function xfo64 ( + const yruPt: i128, + const nX1D: u8 +) -> ( + u16, + i32, + ((u64, address, u32), char, i64), + char +) { + const zVUMW = true; + let lr0eo: u128 = 121391538414525111368886992804963769570u128; + lr0eo *= 1u128; + let JXLf = 319748941135490065237961282805967438009u128; + lr0eo += jBtml(1408145078i32, 18864i16, -1248489626).3; + const Pbjb: i32 = -211550248; + return (57783, 1844050990, ((11506503550199076036u64, aleo1mw4w3u8n4um6mxshumwkzt44r546yy8cmn78lnqee6nff4weuuqsd2mpf3, 2662859884), '\u{3b}', 6526408650467898187i64), '\u{105bbb}'); +} + +function jBtml ( + VFw8B: i32, + NWJ7: i16, + const p0LX: i32 +) -> ( + i32, + i8, + i32, + u128, + i8 +) { + let gvQUM: i64 = 4037125634803550791i64; + const LmCwg: char = 'g'; + gvQUM /= gvQUM; + gvQUM /= -140562257311199343; + gvQUM += 5374352076809309733 + -7311152656384965611i64 / 3567039922885901823 / -2985691946813276109 - 3822948189711225817i64; + gvQUM -= gvQUM; + let CKv0: u32 = 3676790393; + if 107 < 47u8 || 4780895315372286719725570097497690476629729373943383807946296483611741484512681546130787708241328058631116297817062086172863093654079829115271460562868422field != 7982054780179063169560121074566830295371378178527621047378875980325034119262167457126966448864231470178037924417610450639715948611278602804538446771755230 { + CKv0 = 3911808377; + gvQUM -= gvQUM; + const pNpM: u128 = 109321630789574203281186954713440594125; + CKv0 -= CKv0; + let HwOOG: i32 = -1873872992i32; + CKv0 -= CKv0; + const keQsd: field = 11015005865013733702207615426928877863299071468100558157842771770055958954932789085937877273864104098654472278384047931502448190906145334102386491816927923field; + } + const fjUhE: field = 10093019984283224171603190060385302499576567470638200069653260485038239434771591542574318679127541932015353632827969455147712721532875369984181737304135668field; + const zXSXE = -13171i16; + let XviGv = gvQUM; + return (-518773154i32, 26i8, 742687481i32, 106286027905006275051216629536034575527, 3i8); +} \ No newline at end of file diff --git a/parser/benches/medium_3.leo b/parser/benches/medium_3.leo new file mode 100644 index 0000000000..2c5f81fdb5 --- /dev/null +++ b/parser/benches/medium_3.leo @@ -0,0 +1,117 @@ +type HGvc = char; + +type gOJKD = u64; + +type EFxm = gtQV; + +type aEw3O = i32; + +const osrt: u16 = 26669; + + +const fQIQx: gOJKD = 11778118567534946352u64; + + +const WzA2: bool = false; + + +const sJL7i: i8 = -64i8; + + +function kHP2 () -> ( + u8, + i64, + u128 +) { + let oqVTO: u32 = 3500171980u32; + let Hukr: address = aleo1ldm42fn08xu6y6qhe09phqjcl7xk9vldp2zpp5fvtznslpmv7gxqtw5qfd; + oqVTO -= oqVTO; + Hukr = Hukr; + let LPBf: u128 = 78202924632109320785868755439308685433u128; + oqVTO = oqVTO; + Hukr = Hukr; + let kvig: i64 = -5442148135952794654i64; + LPBf = LPBf; + kvig = -1452046324620095276; + return ([5u8, 7u8, 18u8, 97u8][0u32..4u32][false? oqVTO + 3987408031 * 1207361576 ** oqVTO + oqVTO - 3987408030u32 : 1u32], kvig, 277815298408416254847707979780000362140); +} + +function main ( + Q9DOI: field, + const dUAEB: i8, + const SEj4g: address +) { + const thtph: [u32; 3] = [3453204639u32; 3]; + const CHwG: HeJTD = HeJTD {}; + const prUJ: u16 = osrt; + let grcq: HeJTD = CHwG; + grcq = grcq; + const QdIT = aleo1pphryx5dnmwsjyup8znnj4w9qpvlrvm36j2gl9uulgl8vg4j9u9srxufzk; + grcq = HeJTD {}; + let P5L8: u8 = HeJTD {}.sxOgu(100534064157134121298169452117712518470).0; + const YIRE5 = 108u8; + P5L8 *= P5L8; + //RETURN +} + +circuit HeJTD { + + function sxOgu (self, const kksQi: i128) -> ( + u8, + i16, + [u128; 4], + address + ) { + let tgb7Z: bool = false; + tgb7Z = WzA2; + const aGPY: i8 = sJL7i; + let OKQp: u16 = 21911u16; + OKQp **= 1u16; + OKQp += OKQp; + let yo1eO: HGvc = '-'; + let r5XK = kHP2().0; + tgb7Z = WzA2; + tgb7Z = true; + r5XK += r5XK; + r5XK -= r5XK; + return (r5XK, -25382i16, [288029439387827313674819119656624687220, kHP2().2, 94803277963316423116564545225695504468, 108699602594758049345372064866936627487u128], aleo1cmgajygcpkrs43aud2upesptrf6sfxanxgf6ytf8rm4z6vnxfcqsvz88kk); + } + + function Keuz (&self, const qKKxX: i128) { + const lCYBT: bool = WzA2; + self = self; + self = self; + const fPcJ5: i32 = -1765493837; + self = self; + const A2mgB: address = aleo1dlgjsyeagpfg2lxc5d9srdcawucuxtklpw4le68xfd59wzl08qxqdrsde3; + self = self; + //RETURN + } +} + + +circuit gtQV { + L6gU: i16, + hC3az: u128, + j7uL: i64, + bFpJA: bool, +} + + +function WRVhi () -> u64 { + const kwp3 = 4062i16; + let maLh: [u16; 1] = [42138u16; 1]; + let jlbK: [i128; 4] = [167777657792304947682323667177143824400i128, 147207114508691533575493469927314056629i128, 66922896792228500944582561782862644012i128, -144705193941485103492871736247790985658i128]; + const KMFt = true; + let bipj: i64 = 7343659879021916427i64; + const CUZY: u128 = 100991402047349670687233987155884950904u128; + jlbK[0..][0u32..4u32][2] = jlbK[..2u32][1u32]; + const A9ur = CUZY; + let D1ki6: u64 = 7803539941792604692u64; + jlbK[2107741964 * 0u32 + 2488863191 - 2488863190u32..2896282209u32 - 1534373463 + 1853241563 + 231797636 + 254304638 - 757682938u32 - 2943569641u32][2] /= jlbK[3339182546 + 898119994u32 / 2751796078 - 3339182544u32..4][0]; + jlbK[3725489917u32 / 2537373408 / 3769922341u32 * 0u32 / 3952650523 + 3u32..4][..1] = jlbK[..1u32]; + let ezm9p = maLh[0u32..][0u32]; + const b16WX: [[i8; 2]; 3] = [-23i8; (3, 2)]; + const r8zp = kwp3 - 28411i16 / 3137i16; + return 2027828210765338626u64; +} \ No newline at end of file diff --git a/parser/benches/medium_4.leo b/parser/benches/medium_4.leo new file mode 100644 index 0000000000..95fa1ff341 --- /dev/null +++ b/parser/benches/medium_4.leo @@ -0,0 +1,101 @@ +type LWClh = u128; + +type IWJoY = i64; + +function p5TI ( + z5QN: address, + const Sw20j: address +) { + const AInR: i16 = -2073i16; + const WmUv8: address = Sw20j; + const xRbI8 = [28133i16, AInR, -10528i16, AInR]; + let Gm7Q1 = 12844i16; + Gm7Q1 -= xRbI8[2422977436 + 515495012 * 0 - 2422977435]; + Gm7Q1 += -16395; + const FSJ6A: i64 = 6157619886311720636i64 / -67081692260650279i64 + 8650193038720055377i64 + -3550500355098963899i64 - 4867657228102685270i64; + Gm7Q1 += -15150i16; + if 214u8 == 153u8 && ('\u{0}', FSJ6A, 53215u16, 377288379) == ('=', FSJ6A, 10078u16, -505993859i32) { + Gm7Q1 -= xRbI8[..4][1u32]; + Gm7Q1 -= xRbI8[0..2279480963 * 0u32 * 0 / 2816892006u32 + 2][897147343u32 + 1015327132u32 - 1278124375 + 0 * (1 ** 3041883806 ** 14495719 ** 0u32 * 211762163u32 * 17u32) - 634350099u32]; + Gm7Q1 += xRbI8[1u32..4][1u32]; + let qqer1: i32 = 640500406i32; + const DHmc: u32 = 231292247u32; + } else { + Gm7Q1 *= -1; + Gm7Q1 *= -1; + const gyOs = 1094302391u32; + Gm7Q1 = 2108i16; + Gm7Q1 += xRbI8[gyOs / gyOs + 2168728816 - gyOs - 1074426426u32..3u32][2u32]; + } + let pgYf: i32 = -1223492308i32; + //RETURN +} + +function main () { + const mYE5R: address = aleo16u2wdgzzdmfndu64a9rlf94aq3hjg8uvfdwuv6pj622szcm72sps7dvm67; + let SqpOn: u32 = 2435739144u32; + p5TI(mYE5R, aleo1y05nvp959n5uzvrs0rte284jjnhkrnnrdg5yp4jpcfzd75a7zszs7kfw6y); + SqpOn = 1586773493u32; + let QILV: i16 = 31660; + const BnJpQ: char = '\u{a9f63}'; + if 17528 == 56639u16 || [c8Vh(143367268170074814325756675108869918402i128).0, -1405951524078698972] == [-5042490098010934107i64; 2] || 4315305223689141172611854269629789624443791742668057254554273380375658646587985136947892668444816829988093868507801566408930423783067559496894602867497954field != 6375646387007274934866518418619368602817935506317354211520118493078759238563069180561541917197952804868043002978785395869313795428120903957615381567585860field { + const GTI_D: bool = false; + QILV /= -11080i16; + QILV -= QILV; + let ECVtH: IWJoY = c8Vh(-149749740516740905129012416792609445859).0; + } else if 122268392226707883586232047962234817449u128 > 76385952782941753938524643600831921136 || 86995834624605189932232106024753517488i128 != -108583076616482601687700136384290734107i128 { + SqpOn += SqpOn; + } + const gtyOM: IWJoY = -311987881571125041; + let Mdybo: char = '\x23'; + const yrnIT = gtyOM; + let pcnEp: i128 = [([19646718433106418990288691237342689585i128; 4], -49718263885898812241174302118607060822i128, true); 1][0u32].0[0u32..2u32][0u32]; + let hR1y: u16 = 18143u16; + const tmf9v: IWJoY = yrnIT; + let FXil: bool = true; + //RETURN +} + +function oyMp ( + yM7sW: u8, + const SU6nx: i8 +) -> ( + [i64; 1], + field, + field, + u64 +) { + const UwuSO = aleo1dwd3c25uxlgq65xyzemy9e3jvmcyzrmf0uemhty3avy3ksmszgpq8pp26w; + const KOIhm: i32 = -241128188i32; + let sLpfh: i32 = KOIhm; + let Ohr6b: ([i64; 1], u8, u64) = ([-4157173098401133484; 1], yM7sW, 7256365091210223672u64); + const ypKGm: i16 = -9221i16; + Ohr6b.0 = Ohr6b.0[..3543809812 + 4209153300u32 * 0u32 / 2521347128 ** 0u32 - 2410749134u32 - 1133060677]; + Ohr6b.0[0..][0] = Ohr6b.0[0]; + const VY22T = aleo1zg3zlxpzaa22tza2ejchq4pcuk7zg4uqmk9e0axauwa4c5wsfyps5d4mag; + let nlmd = ypKGm; + Ohr6b.1 /= 52; + let MBB2D = 93u8; + let s3NV = c8Vh(-166614928166821297736585794221812645694i128).1; + return ([-4467750620927002542; 1], 9278230888765121820706527843633347968314775222288054037375541747584194144677355778452873567746472118871275894084416114593223337643554376551787023186958306, 11889070541040557353472570949046112002889592379923772691570456361854595150726827315523183897692700149315250272794853793486179506546250113001503110933697750, 12480035228868259223u64); +} + +function c8Vh (FqsWX: i128) -> ( + i64, + i128, + address, + i8 +) { + let BwzC = -12788i16; + const ADjE = 880u16; + const tG2V = -26703i16 / 30731i16 + -19378i16 * 0i16 * 1i16; + const pKsRO: u8 = 14u8; + const TjwF: u64 = 5244319823805907838u64; + const PAP4 = aleo1e2vgp062l8qgp3hjtt6gmadsynnw60lyfa0m6scqrtqg8z4755rs00yx3f; + const Ig25 = 3770644008u32; + BwzC -= BwzC; + let H52x: u16 = ADjE; + const dItwn = tG2V; + BwzC *= dItwn + -398 - tG2V - -9022i16 - 8625i16; + return (-2777271838952094387i64, FqsWX, aleo1whw79gakaz4x0k8h43njvpurr88llp33vyc2cmn9c86jwuvsrygsx0fmcd, 50i8); +} \ No newline at end of file diff --git a/parser/benches/medium_5.leo b/parser/benches/medium_5.leo new file mode 100644 index 0000000000..1250297734 --- /dev/null +++ b/parser/benches/medium_5.leo @@ -0,0 +1,119 @@ +type pD0X5 = i8; + +type XKaI = i16; + +const XwcBV: i128 = -32572378035711434115931151745732207466i128; + + +const w6aTH: pD0X5 = -93i8; + + +function cD4r (const Ef4DK: u8) -> bool { + for Sv9O in 3706976931..3706976938u32 { + let pKGY: u128 = 311016385552046158086754861239673139644u128; + let yNcR: u128 = pKGY; + for DDbgy in 3988444086..3988444106 { + yNcR = pKGY; + const MiCDS = 203u8; + pKGY = 6786571399753485756038607500832553953u128; + const x9Kt: i32 = 512603574i32; + } + const pLdgh = 5722i16; + pKGY += yNcR; + let hFkI: XKaI = 31625; + } + let SggA: i8 = -111i8; + SggA /= SggA; + jxlM5([-75, -121i8, -6, 39]); + SggA += SggA; + if 8425416191047753543i64 < 5934851800616123467i64 && 3156932270u32 >= 351248398 ** 0 * 3886250762u32 && Ef4DK == Ef4DK { + let sEIHa: i32 = -856941478; + sEIHa = -488975297i32; + let F7Zh: i32 = -2034366605i32; + const y5M2 = [true; 3]; + let rk0b: u32 = 3172526925u32; + } else if aleo1cg07hzfcd7fgelkvztrzsmnxlft6v5pnklzq5f7av5rtj8d4wu8sawysp5 == aleo1uzrrk9taq4a49ht3szzft90nda9ttnhgqmf34usnz9mn5arh8cgqqyhphq || 1037328189i32 < -1901996675i32 && 1796045335698448709i64 >= -8770729005250501820i64 { + const Qd6I: i64 = -2936881039795955623; + SggA -= SggA; + const qfWz: field = 11868574597504245849412759878797470230958899864383535393820114892572467525738645004768652990020629690814753190302756167841756399627109003235558224574300748field; + const aSFc = qfWz; + } + let Rjka: u128 = 129874334876628464772675045313311550090u128; + return 4170085385614217102u64 > 2900170916628410432u64 && (8859831151384150600u64, 9584u16, 64997411429767251474068675400579704411u128, 51394u16) != (8694497216948073522u64, 12295u16, Rjka, 26950u16) || aleo1j3c7r67xcd5qd9hyc03jnsazss4thwsdckeun24sggvxcgyaxuxq5sexds == aleo1jupcxnkqw94s8es4342man4ggx964l5cuct6p47u6w7zh99z9u8qshynps; +} + +circuit FKmZ { + M8qe: i32, + D73jn: bool, + zqD4: u64, + GCdL: char, +} + + +function jxlM5 (const TWEq9: [pD0X5; 4]) { + const Lp82: i128 = XwcBV; + const msPjY: pD0X5 = TWEq9[3u32..4u32][338693848u32 + 2907541410 ** 0 - 338693849..1][0u32]; + const BQ6VH: pD0X5 = TWEq9[1u32..2u32][0u32]; + const Lab8h = -7426i16; + let e9hbf: u32 = 3611541251; + const DrW8: i16 = Lab8h; + const m_gwo: field = 10149559664849165995965876030637766340317581756563239767481396552863162506821848546264761419152379420397534597160071655018754572310314016031519867789251685; + let xx8jE: i32 = -1865425211i32; + xx8jE -= xx8jE; + let hrqV: u64 = 17666560190951007606u64; + const NdtZ: XKaI = DrW8; + //RETURN +} + +function main () -> XKaI { + let u2PY: u16 = 15187u16; + u2PY += 9468; + let Wupm: address = aleo1gj4zc6cxxqt0u6cawjjs3nrvpn27a2u0udnaj09kgveukymneu8sc42lsk; + Wupm = Wupm; + let nhX5: u32 = 3866864476u32; + let dwHKQ: char = '\u{67}'; + const WBmh: char = '\x1f'; + Wupm = Wupm; + return -12118; +} + +function Gsyy ( + const lTdD: XKaI, + const VM8m: u16 +) -> ( + u16, + XKaI, + pD0X5, + (u8, i64, address, i64), + u8 +) { + const hAIr: i64 = -1583366540111540541i64; + let W51HO: u128 = 59818555547149636611889596765236400129u128; + let yToh: u128 = W51HO; + let RIXGZ: u8 = 49u8; + W51HO = yToh; + const IbhZ6: bool = false; + W51HO += W51HO; + RIXGZ = RIXGZ; + const u1Sum: u8 = 173; + return (19356u16, -3834i16, 30i8, (13, -1940134876651428626i64, aleo1j07mer7u70duc0uf7r5vqltj2sd9amksayj9rexzehutdpnknvps3mqvys, 5856886436435778601i64), 224u8); +} + +function CsfYJ () -> ( + u16, + pD0X5 +) { + const Jt9fI: (u16, (i128, i8, u8, pD0X5), u8) = (32789u16, (6144650023358955586197856856735185762i128, 113i8, 131u8, -116i8), 54u8); + jxlM5([Jt9fI.1.1; 4]); + const RGcf: u128 = 328631271023943473067383416776906123936u128; + let ykT7 = false; + let AJxJF: pD0X5 = Jt9fI.1.3; + let o1z_y = 287974553047910791989339924422694174888u128; + ykT7 = ykT7; + AJxJF = AJxJF; + let kA0NE: i64 = -995045265928595531i64; + const gB6i: pD0X5 = 88i8; + AJxJF = 111i8 * 1i8 * 0i8 ** (Jt9fI.1.1 - gB6i * 0i8 + -4i8) - Jt9fI.1.1; + kA0NE -= kA0NE; + return (4874, 69i8); +} \ No newline at end of file diff --git a/parser/benches/small_1.leo b/parser/benches/small_1.leo new file mode 100644 index 0000000000..b87bbfabc6 --- /dev/null +++ b/parser/benches/small_1.leo @@ -0,0 +1,43 @@ +type Ol3w = field; + +type Ahe2 = bool; + +type xAjc = i8; + +type TduZ = i64; + +type DF5y = Ol3w; + +function main ( + iMMX: xAjc, + const lySK: TduZ +) { + const gLgI: u128 = 282699336138350242645277143389445348100; + const uWur = 10659i16; + const yqAU: u8 = 59u8; + let v2qM: TduZ = -2800677576350134891i64; + v2qM += v2qM; + const tdgp: i32 = 1456793899i32; + v2qM -= v2qM; + const OEX0 = -124i8; + v2qM = 4055474362711520878i64; + let dFD7L: [xAjc; 2] = [iMMX; 2]; + //RETURN +} + +function lAof ( + const hfZCT: i16, + const P9fd: i64 +) -> ( + Ahe2, + Ol3w, + u64, + i32 +) { + const c75wu: u64 = 8280018649401688824; + const RBo4Z: u64 = 11792350555921266020u64; + const HIo8: u32 = 2592983979u32; + const jKMc: TduZ = -6800829732228999313i64; + const nJ3_ = hfZCT; + return (false, 6795313442177019610056975536579598755713325033744905803767505096755634532108405203751482245835828500042025491235448688532189762093820810066426628199044126, 5678811033286957920u64, 340900260i32); +} \ No newline at end of file diff --git a/parser/benches/small_2.leo b/parser/benches/small_2.leo new file mode 100644 index 0000000000..eb25a5971e --- /dev/null +++ b/parser/benches/small_2.leo @@ -0,0 +1,38 @@ +type uxXY = (u32, char); + +type gzOiV = bool; + +type J0S_ = i8; + +type OX7t = field; + +type eIgg = i32; + +function AVQf (kstq3: u8) -> ( + field, + i16 +) { + let XqP6: gzOiV = true; + let dnqz: i64 = 8877565108763008728i64; + dnqz -= dnqz; + dnqz = 76181988128375147i64; + XqP6 = XqP6; + dnqz += dnqz; + return (3975283943008764423806352823979937462787237989962909506785125306005907038027118917027678156122087199647358557544951681775626814651745659422151809322132026, -4361i16); +} + +function main ( + Mv6I9: i128, + const VcQam: u64, + const w78D6: OX7t +) -> ( + i128, + gzOiV +) { + let Jb16: char = '\u{2}'; + Jb16 = '\x4f'; + Jb16 = Jb16; + Jb16 = Jb16; + Jb16 = '\u{5}'; + return (-10944738092911991956337139207987089638i128, false); +} \ No newline at end of file diff --git a/parser/benches/small_3.leo b/parser/benches/small_3.leo new file mode 100644 index 0000000000..026201f9de --- /dev/null +++ b/parser/benches/small_3.leo @@ -0,0 +1,47 @@ +type RoqL = i64; + +type AaPhh = u8; + +type XPNqC = bool; + +const NQAz: address = aleo176mk6cldmpuuyh2t3eqvzpqqve9ets04rv6fmxmwsu6g4hpddgzsemf4ha; + + +const u8TFy = 287154293074239475275759998449933521189u128; + + +const xfK1Q: u8 = 211u8; + + +const xQ3fN: u32 = 2283742765u32; + + +circuit JFjRt { + P08i: i8, + JVRV: [char; 3], + FCVt: [u16; 4], + NsGIE: u8, +} + + +function main () { + const eiC8P: i16 = 13718i16; + const pnP_ = '\u{18}'; + const YJXe: u32 = xQ3fN; + let h9obt: u128 = u8TFy; + const kqZU: i32 = -362665035i32; + //RETURN +} + +function EOTm (ujgq: char) -> ( + u64, + address +) { + const ky9F = JFjRt {P08i: -19i8, JVRV: "\u{50}\\\u{5840c}", NsGIE: xfK1Q, FCVt: [39137u16, 28193u16, 647u16, 7050u16]}; + let UozOu: address = NQAz; + const Ifeky: i32 = 1323028989i32; + const WGCDN: i32 = Ifeky; + const ff4g: address = NQAz; + const DFO1: field = 4949224453308256785438301712742221616498146217822614960935813525606408755826533468738939148388266885632720559379619397182660164245432115466081418332631047field; + return (3667993466002095237u64, aleo1gjyxuuzckr9r00q5334gwev4z58jetc6fg0t7wy94zjusr047c9qsa7f4f); +} \ No newline at end of file diff --git a/parser/benches/small_4.leo b/parser/benches/small_4.leo new file mode 100644 index 0000000000..8ba613430b --- /dev/null +++ b/parser/benches/small_4.leo @@ -0,0 +1,42 @@ +type km8Fr = u32; + +type kzW6 = i32; + +const HvzMe: [i128; 1] = [129052111439600100445300449390992581554i128; 1]; + + +const tZYp: field = 532412591991187314534825718392614065009291195021344743358025579695136815735262187551374572170974348796915332593276900604722917065800076960197412192803632field; + + +const Fp0x4 = 222015611u32; + + +const certw: i8 = -24i8; + + +const k3uF = false; + + +function main () -> u128 { + let ICvC: u128 = 103376857680360010061660663587489098187u128; + const FrGt: i8 = -7i8; + const KJ4T: char = '\u{2b}'; + ICvC *= 2u128; + ICvC += ICvC - 0u128 * ICvC * 0 - 153072875935437715327147328595122262565 + (ICvC / ICvC + 284163310479396430280687598543511894458u128) - 232529188309985706261210350055651476542; + return ICvC; +} + +function uaKPx (const QNzSh: i128) -> ( + u32, + i8 +) { + const MsgN = [-106i8; 2]; + let xGxjP: i64 = 9166993170921840593i64 + -2529766390868818195i64 - 2791307521551366519i64 / -3538780045482804336i64; + let hDX6 = false; + const Fwgr = '\u{5c030}'; + let egmv: char = '\u{99cad}'; + return (1055028656, MsgN[1..][0u32]); +} + +circuit PANW { +} diff --git a/parser/benches/small_5.leo b/parser/benches/small_5.leo new file mode 100644 index 0000000000..6f918dd1a0 --- /dev/null +++ b/parser/benches/small_5.leo @@ -0,0 +1,53 @@ +type Rx6fk = u8; + +type Sq9N = i8; + +type Plflu = i64; + +type f1gXY = i32; + +const jpPIR: u8 = 16u8; + + +const f2Tb9: i128 = 45051584313652375601764187183414341445; + + +const V5kfY: i16 = -8790i16; + + +circuit Sjme { + hmJC: i16, + CcHF: [u128; 2], + ZoZp: char, + A_Pj: u32, +} + + +function main () -> ( + i8, + i32, + f1gXY, + field +) { + let ohlv: f1gXY = -1259603809i32; + let gZRDA: i64 = -7347494256161757768i64; + gZRDA *= 0; + const ok24: Plflu = -2051516710597000367i64; + gZRDA *= gZRDA; + return (8i8, ohlv, 948067729i32, 1783509931145130420616818325370403915997535152021967071633491200599020999853659867294845842362448613053777476366231124404691257428640224773765087015983573field); +} + +function tEt1 ( + DMUO: u128, + OA4M: u64 +) -> Plflu { + const nXWy: u128 = 186484550818404824661609584894630678829; + let dXEf: f1gXY = -240549848i32; + const fWQ_: Sq9N = 42; + const mX9QW: i8 = fWQ_; + for GhJkG in 2746090830u32..2746090848u32 { + dXEf **= 0; + } + dXEf /= -664932742; + return 3717439950548678713i64; +} \ No newline at end of file diff --git a/parser/examples/input_parser.rs b/parser/examples/input_parser.rs new file mode 100644 index 0000000000..6cc6661bcd --- /dev/null +++ b/parser/examples/input_parser.rs @@ -0,0 +1,74 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use leo_errors::{emitter::Handler, Result}; +use leo_span::symbol::create_session_if_not_set_then; + +use std::{ + fs, + path::{Path, PathBuf}, +}; +use structopt::StructOpt; + +#[derive(Debug, StructOpt)] +#[structopt( + name = "input parser", + about = "Parse an Input file and save its JSON representation" +)] +struct Opt { + /// Path to the input file. + #[structopt(parse(from_os_str))] + input_path: PathBuf, + + /// Optional path to the output directory. + #[structopt(parse(from_os_str))] + out_dir_path: Option, + + /// Whether to print result to STDOUT. + #[structopt(short, long)] + print_stdout: bool, +} + +fn main() -> Result<(), String> { + let opt = Opt::from_args(); + let input_string = fs::read_to_string(&opt.input_path).expect("failed to open an input file"); + let input_tree = create_session_if_not_set_then(|_| { + Handler::with(|handler| { + let input = + leo_parser::parse_program_inputs(&handler, input_string.clone(), opt.input_path.to_str().unwrap())?; + Ok(input.to_json_string()?) + }) + .map_err(|e| e.to_string()) + })?; + + if opt.print_stdout { + println!("{}", input_tree); + } + + let out_path = if let Some(out_dir) = opt.out_dir_path { + format!( + "{}/{}.json", + out_dir.as_path().display(), + opt.input_path.file_stem().unwrap().to_str().unwrap() + ) + } else { + format!("./{}.json", opt.input_path.file_stem().unwrap().to_str().unwrap()) + }; + + fs::write(Path::new(&out_path), input_tree).expect("failed to write output"); + + Ok(()) +} diff --git a/parser/examples/parser.rs b/parser/examples/parser.rs index 801646f27f..3f040aba69 100644 --- a/parser/examples/parser.rs +++ b/parser/examples/parser.rs @@ -15,56 +15,61 @@ // along with the Leo library. If not, see . use leo_ast::Ast; -use leo_errors::{emitter::Handler, Result}; +use leo_errors::emitter::Handler; use leo_span::symbol::create_session_if_not_set_then; -use std::{env, fs, path::Path}; +use std::{ + fs, + path::{Path, PathBuf}, +}; +use structopt::StructOpt; -fn to_leo_tree(filepath: &Path) -> Result { - // Loads the Leo code as a string from the given file path. - let program_filepath = filepath.to_path_buf(); - let program_string = fs::read_to_string(&program_filepath).expect("failed to open input file"); +#[derive(Debug, StructOpt)] +#[structopt(name = "leo parser", about = "Parse Leo AST and store it as a JSON")] +struct Opt { + /// Path to the Leo file. + #[structopt(parse(from_os_str))] + input_path: PathBuf, - // Parses the Leo file constructing an ast which is then serialized. - create_session_if_not_set_then(|_| { - let handler = Handler::default(); - let ast = leo_parser::parse_ast(&handler, filepath.to_str().unwrap(), &program_string)?; - Ok(Ast::to_json_string(&ast).expect("serialization failed")) - }) + /// Optional path to the output directory. + #[structopt(parse(from_os_str))] + out_dir_path: Option, + + /// Whether to print result to STDOUT. + #[structopt(short, long)] + print_stdout: bool, } -fn main() -> Result<()> { - // Parse the command-line arguments as strings. - let cli_arguments = env::args().collect::>(); +fn main() -> Result<(), String> { + let opt = Opt::from_args(); + let code = fs::read_to_string(&opt.input_path).expect("failed to open file"); - // Check that the correct number of command-line arguments were passed in. - if cli_arguments.len() < 2 || cli_arguments.len() > 3 { - eprintln!("Warning - an invalid number of command-line arguments were provided."); - println!( - "\nCommand-line usage:\n\n\tleo_ast {{PATH/TO/INPUT_FILENAME}}.leo {{PATH/TO/OUTPUT_DIRECTORY (optional)}}\n" - ); - return Ok(()); // Exit innocently + // Parses the Leo file constructing an ast which is then serialized. + let serialized_leo_tree = create_session_if_not_set_then(|_| { + Handler::with(|h| { + let ast = leo_parser::parse_ast(&h, opt.input_path.to_str().unwrap(), &code)?; + let json = Ast::to_json_string(&ast)?; + println!("{}", json); + Ok(json) + }) + .map_err(|b| b.to_string()) + })?; + + if opt.print_stdout { + println!("{}", serialized_leo_tree); } - // Construct the input filepath. - let input_filepath = Path::new(&cli_arguments[1]); - - // Construct the serialized syntax tree. - let serialized_leo_tree = to_leo_tree(input_filepath)?; - println!("{}", serialized_leo_tree); - - // Determine the output directory. - let output_directory = match cli_arguments.len() == 3 { - true => format!( + let out_path = if let Some(out_dir) = opt.out_dir_path { + format!( "{}/{}.json", - cli_arguments[2], - input_filepath.file_stem().unwrap().to_str().unwrap() - ), - false => format!("./{}.json", input_filepath.file_stem().unwrap().to_str().unwrap()), + out_dir.as_path().display(), + opt.input_path.file_stem().unwrap().to_str().unwrap() + ) + } else { + format!("./{}.json", opt.input_path.file_stem().unwrap().to_str().unwrap()) }; - // Write the serialized syntax tree to the output directory. - fs::write(Path::new(&output_directory), serialized_leo_tree).expect("failed to write output"); + fs::write(Path::new(&out_path), serialized_leo_tree).expect("failed to write output"); Ok(()) } diff --git a/parser/src/lib.rs b/parser/src/lib.rs index 21a1001bde..917a6a1a7a 100644 --- a/parser/src/lib.rs +++ b/parser/src/lib.rs @@ -23,14 +23,13 @@ #![doc = include_str!("../README.md")] pub(crate) mod tokenizer; -use leo_input::LeoInputParser; pub use tokenizer::KEYWORD_TOKENS; pub(crate) use tokenizer::*; pub mod parser; pub use parser::*; -use leo_ast::{Ast, Input}; +use leo_ast::{Ast, Input, ProgramInput, ProgramState}; use leo_errors::emitter::Handler; use leo_errors::Result; @@ -42,63 +41,17 @@ pub fn parse_ast, Y: AsRef>(handler: &Handler, path: T, sourc Ok(Ast::new(parser::parse(handler, path.as_ref(), source.as_ref())?)) } -/// Parses program input from from the input file path and state file path -pub fn parse_program_input, Y: AsRef, T2: AsRef, Y2: AsRef>( +/// Parses program inputs from from the input file path and state file path +pub fn parse_program_inputs, Y: AsRef>( + handler: &Handler, input_string: T, input_path: Y, - state_string: T2, - state_path: Y2, ) -> Result { - let input_syntax_tree = LeoInputParser::parse_file(input_string.as_ref()).map_err(|mut e| { - e.set_path( - input_path.as_ref(), - &input_string - .as_ref() - .lines() - .map(|x| x.to_string()) - .collect::>()[..], - ); + let program_input: ProgramInput = + parser::parse_input(handler, input_path.as_ref(), input_string.as_ref())?.try_into()?; - e - })?; - let state_syntax_tree = LeoInputParser::parse_file(state_string.as_ref()).map_err(|mut e| { - e.set_path( - state_path.as_ref(), - &state_string - .as_ref() - .lines() - .map(|x| x.to_string()) - .collect::>()[..], - ); - - e - })?; - - let mut input = Input::new(); - input.parse_input(input_syntax_tree).map_err(|mut e| { - e.set_path( - input_path.as_ref(), - &input_string - .as_ref() - .lines() - .map(|x| x.to_string()) - .collect::>()[..], - ); - - e - })?; - input.parse_state(state_syntax_tree).map_err(|mut e| { - e.set_path( - state_path.as_ref(), - &state_string - .as_ref() - .lines() - .map(|x| x.to_string()) - .collect::>()[..], - ); - - e - })?; - - Ok(input) + Ok(Input { + program_input, + program_state: ProgramState::default(), + }) } diff --git a/parser/src/parser/file.rs b/parser/src/parser/file.rs index 3d6e473b2f..59cc7752db 100644 --- a/parser/src/parser/file.rs +++ b/parser/src/parser/file.rs @@ -149,59 +149,21 @@ impl ParserContext<'_> { /// Returns an [`Identifier`] AST node if the next tokens represent a valid package name. pub fn parse_package_name(&mut self) -> Result { // Build the package name, starting with valid characters up to a dash `-` (Token::Minus). - let mut base = self.expect_loose_identifier()?; - - // Build the rest of the package name including dashes. - loop { - match &self.peek_token().as_ref() { - Token::Minus => { - let span = self.expect(Token::Minus)?; - base.span = base.span + span; - let next = self.expect_loose_identifier()?; - base.name = Symbol::intern(&format!("{}-{}", base.name, next.name)); - base.span = base.span + next.span; - } - Token::Int(_) => { - let (num, span) = self.eat_int().unwrap(); - base.name = Symbol::intern(&format!("{}{}", base.name, num.value)); - base.span = base.span + span; - } - Token::Ident(_) => { - let next = self.expect_ident()?; - base.name = Symbol::intern(&format!("{}{}", base.name, next.name)); - base.span = base.span + next.span; - } - x if KEYWORD_TOKENS.contains(x) => { - let next = self.expect_loose_identifier()?; - base.name = Symbol::intern(&format!("{}{}", base.name, next.name)); - base.span = base.span + next.span; - } - _ => break, - } - } + let base = self.expect_loose_identifier()?; // Return an error if the package name contains a keyword. if let Some(token) = KEYWORD_TOKENS.iter().find(|x| x.keyword_to_symbol() == Some(base.name)) { self.emit_err(ParserError::unexpected_str(token, "package name", &base.span)); } - // Return an error if the package name contains invalid characters. - if !base - .name - .as_str() - .chars() - .all(|x| x.is_ascii_lowercase() || x.is_ascii_digit() || x == '-' || x == '_') - { - self.emit_err(ParserError::invalid_package_name(&base.span)); - } - // Return the package name. Ok(base) } /// Returns an [`ImportTree`] AST node if the next tokens represent a valid package import /// with accesses. - fn parse_import_tree(&mut self) -> Result { + // Public soely foro writing import parsing tests. + pub fn parse_import_tree(&mut self) -> Result { // Parse the first part of the path. let first_name = self.parse_package_name()?; let start = first_name.span.clone(); diff --git a/parser/src/parser/input.rs b/parser/src/parser/input.rs new file mode 100644 index 0000000000..4d6b1c6a1a --- /dev/null +++ b/parser/src/parser/input.rs @@ -0,0 +1,83 @@ +// Copyright (C) 2019-2022 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use super::*; + +use leo_errors::{ParserError, Result}; + +impl ParserContext<'_> { + /// Returns a [`ParsedInputFile`] struct filled with the data acquired in the file. + pub fn parse_input(&mut self) -> Result { + let mut sections = Vec::new(); + + while self.has_next() { + let token = self.peek()?; + if matches!(token.token, Token::LeftSquare) { + sections.push(self.parse_section()?); + } else { + return Err(ParserError::unexpected_token(token.token.clone(), &token.span).into()); + } + } + + Ok(ParsedInputFile { sections }) + } + + /// Parses particular section in the Input or State file. + /// ` + /// [] + /// <...definition> + /// ` + /// Returns [`Section`]. + pub fn parse_section(&mut self) -> Result
{ + self.expect(Token::LeftSquare)?; + let section = self.expect_ident()?; + self.expect(Token::RightSquare)?; + + let mut definitions = Vec::new(); + + while let Some(SpannedToken { + token: Token::Ident(_), .. + }) = self.peek_option() + { + definitions.push(self.parse_input_definition()?); + } + + Ok(Section { + name: section.name, + span: section.span.clone(), + definitions, + }) + } + + /// Parses a single parameter definition: + /// ` : = ;` + /// Returns [`Definition`]. + pub fn parse_input_definition(&mut self) -> Result { + let name = self.expect_ident()?; + self.expect(Token::Colon)?; + let (type_, span) = self.parse_type()?; + self.expect(Token::Assign)?; + let value = self.parse_primary_expression()?; + self.expect(Token::Semicolon)?; + + Ok(Definition { + name, + type_, + value, + span, + }) + } +} diff --git a/parser/src/parser/mod.rs b/parser/src/parser/mod.rs index 429d28bbf3..adcd32e72f 100644 --- a/parser/src/parser/mod.rs +++ b/parser/src/parser/mod.rs @@ -34,6 +34,7 @@ pub use context::*; pub mod expression; pub mod file; +pub mod input; pub mod statement; pub mod type_; @@ -54,3 +55,10 @@ pub fn parse(handler: &Handler, path: &str, source: &str) -> Result { tokens.parse_program() } + +/// Parses an input file at the given file `path` and `source` code text. +pub fn parse_input(handler: &Handler, path: &str, source: &str) -> Result { + let mut tokens = ParserContext::new(handler, crate::tokenize(path, source.into())?); + + tokens.parse_input() +} diff --git a/parser/src/parser/statement.rs b/parser/src/parser/statement.rs index 91c1d2a21c..d988363c33 100644 --- a/parser/src/parser/statement.rs +++ b/parser/src/parser/statement.rs @@ -295,11 +295,14 @@ impl ParserContext<'_> { let declare = self.expect_oneof(&[Token::Let, Token::Const])?; // Parse variable names. - let variable_names = if self.peek_is_left_par() { - self.parse_paren_comma_list(|p| p.parse_variable_name(&declare).map(Some)) - .map(|(vars, ..)| vars)? + let (variable_names, parened) = if self.peek_is_left_par() { + ( + self.parse_paren_comma_list(|p| p.parse_variable_name(&declare).map(Some)) + .map(|(vars, ..)| vars)?, + true, + ) } else { - vec![self.parse_variable_name(&declare)?] + (vec![self.parse_variable_name(&declare)?], false) }; // Parse an optional type ascription. @@ -320,6 +323,7 @@ impl ParserContext<'_> { _ => unreachable!("parse_definition_statement_ shouldn't produce this"), }, variable_names, + parened, type_, value: expr, }) diff --git a/parser/src/test.rs b/parser/src/test.rs index af9b221600..07d6100094 100644 --- a/parser/src/test.rs +++ b/parser/src/test.rs @@ -111,6 +111,27 @@ impl Namespace for ParseExpressionNamespace { } } +struct ParseImportNamespace; + +impl Namespace for ParseImportNamespace { + fn parse_type(&self) -> ParseType { + ParseType::ContinuousLines + } + + fn run_test(&self, test: Test) -> Result { + create_session_if_not_set_then(|_| { + let tokenizer = tokenize(test)?; + if all_are_comments(&tokenizer) { + return Ok(yaml_or_fail(Statement::Expression(ExpressionStatement { + expression: implicit_value_expr(), + span: Span::default(), + }))); + } + with_handler(tokenizer, |p| p.parse_import_statement()).map(yaml_or_fail) + }) + } +} + struct ParseStatementNamespace; impl Namespace for ParseStatementNamespace { @@ -209,16 +230,30 @@ impl Namespace for SerializeNamespace { } } +struct InputNamespace; + +impl Namespace for InputNamespace { + fn parse_type(&self) -> ParseType { + ParseType::Whole + } + + fn run_test(&self, test: Test) -> Result { + create_session_if_not_set_then(|_| with_handler(tokenize(test)?, |p| p.parse_input()).map(yaml_or_fail)) + } +} + struct TestRunner; impl Runner for TestRunner { fn resolve_namespace(&self, name: &str) -> Option> { Some(match name { "Parse" => Box::new(ParseNamespace), - "ParseStatement" => Box::new(ParseStatementNamespace), + "ParseImport" => Box::new(ParseImportNamespace), "ParseExpression" => Box::new(ParseExpressionNamespace), - "Token" => Box::new(TokenNamespace), + "ParseStatement" => Box::new(ParseStatementNamespace), "Serialize" => Box::new(SerializeNamespace), + "Input" => Box::new(InputNamespace), + "Token" => Box::new(TokenNamespace), _ => return None, }) } diff --git a/parser/src/tokenizer/lexer.rs b/parser/src/tokenizer/lexer.rs index 8e76253419..6bc4a5d090 100644 --- a/parser/src/tokenizer/lexer.rs +++ b/parser/src/tokenizer/lexer.rs @@ -388,7 +388,11 @@ impl Token { return (0, None); } let eol = input.windows(2).skip(2).position(|x| x[0] == b'*' && x[1] == b'/'); - let len = if let Some(eol) = eol { eol + 4 } else { input.len() }; + let len = if let Some(eol) = eol { + eol + 4 + } else { + return (0, None); + }; return (len, Some(Token::CommentBlock(input_tendril.subtendril(0, len as u32)))); } else if let Some(len) = eat(input, "/=") { return (len, Some(Token::DivEq)); diff --git a/span/Cargo.toml b/span/Cargo.toml index 8d356c0149..f6b8744bf6 100644 --- a/span/Cargo.toml +++ b/span/Cargo.toml @@ -32,9 +32,5 @@ features = [ "derive", "rc" ] [dependencies.scoped-tls] version = "1.0.0" -[dependencies.pest] -version = "2.0" - [dependencies.tendril] version = "0.4.2" - diff --git a/span/src/span.rs b/span/src/span.rs index 0003518e10..7ad057be8e 100644 --- a/span/src/span.rs +++ b/span/src/span.rs @@ -18,7 +18,6 @@ use std::{fmt, sync::Arc, usize}; -use pest::Span as PestSpan; use serde::ser::{Serialize, SerializeStruct, Serializer}; use serde::Deserialize; use tendril::StrTendril; @@ -38,18 +37,18 @@ pub struct Span { /// The path to the Leo file containing the error. pub path: Arc, #[serde(with = "crate::tendril_json")] - /// The content of the file between the above boundries. + /// The content of the file between the above boundaries. pub content: StrTendril, } impl Span { - /// Generate a new span from where: - /// - the Leo line starts. - /// - the Leo line stops. - /// - the Leo column starts. - /// - the Leo column stops. - /// - the path to the Leo file. - /// - the content of those specified bounds. + /// Generate a new span from: + /// - Where the Leo line starts. + /// - Where the Leo line stops. + /// - Where the Leo column starts. + /// - Where the Leo column stops. + /// - The path to the Leo file. + /// - The content of those specified bounds. pub fn new( line_start: usize, line_stop: usize, @@ -96,7 +95,6 @@ impl Serialize for Span { } } -/// Conversion from a pest span where the leo-input library uses these. impl fmt::Display for Span { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.line_start == self.line_stop { @@ -111,22 +109,6 @@ impl fmt::Display for Span { } } -impl<'ast> From> for Span { - fn from(span: PestSpan) -> Self { - let start = span.start_pos().line_col(); - let end = span.end_pos().line_col(); - - Span::new( - start.0, - end.0, - start.1, - end.1, - Arc::new(String::new()), - span.as_str().into(), - ) - } -} - impl std::ops::Add for &Span { type Output = Span; diff --git a/span/src/span_json.rs b/span/src/span_json.rs index 8a6d1262ec..7befdb4cb8 100644 --- a/span/src/span_json.rs +++ b/span/src/span_json.rs @@ -23,7 +23,7 @@ use serde::ser::SerializeMap; use serde::{Deserializer, Serializer}; use std::fmt; -/// The AST contains a few tuple-like enum variants the contain spans +/// The AST contains a few tuple-like enum variants that contain spans. /// #[derive(Serialize, Deserialize)] outputs these fields as anonmyous /// mappings, which makes them difficult to remove from the JSON AST. /// This function provides a custom serialization that maps the keyword diff --git a/span/src/symbol.rs b/span/src/symbol.rs index 3e99ae8674..74ee62d6cf 100644 --- a/span/src/symbol.rs +++ b/span/src/symbol.rs @@ -110,6 +110,7 @@ symbols! { circuit, Class: "class", context, + constants, CoreFunction, console, Const: "const", @@ -160,6 +161,9 @@ symbols! { record, state, state_leaf, + + public, + private, } /// An interned string. diff --git a/tests/expectations/parser/parser/expression/literal/comment.leo.out b/tests/expectations/parser/parser/expression/literal/comment.leo.out index 9f4cc8a518..0b21f6a280 100644 --- a/tests/expectations/parser/parser/expression/literal/comment.leo.out +++ b/tests/expectations/parser/parser/expression/literal/comment.leo.out @@ -1,22 +1,12 @@ --- -namespace: Token +namespace: Parse expectation: Pass outputs: - - "'// test1' @ 1:1-9" - - "'// test2' @ 1:1-9" - - "'//test3' @ 1:1-8" - - "'/' @ 1:1-2,'/' @ 1:3-4,'test4' @ 1:5-10" - - "'/* test5 */' @ 1:1-12" - - "'/*' @ 1:1-3" - - "'test' @ 1:1-5,'6' @ 1:6-7,'*' @ 1:8-9,'/' @ 1:9-10" - - "'/* test 7' @ 1:1-10" - - "'*' @ 1:1-2,'/' @ 1:2-3" - - "'/*test8 */' @ 1:1-11" - - "'/* test9*/' @ 1:1-11" - - "'/*test10*/' @ 1:1-11" - - "'/*/**/' @ 1:1-7" - - "'/**/' @ 1:1-5" - - "'/*//*/' @ 1:1-7" - - "'/** /*/' @ 1:1-8" - - "'/** **/' @ 1:1-8" - - "'/*' @ 1:1-3" + - name: "" + expected_input: [] + import_statements: [] + imports: {} + aliases: {} + circuits: {} + global_consts: {} + functions: {} diff --git a/tests/expectations/parser/parser/import/alias.leo.out b/tests/expectations/parser/parser/import/alias.leo.out new file mode 100644 index 0000000000..0aed27aec6 --- /dev/null +++ b/tests/expectations/parser/parser/import/alias.leo.out @@ -0,0 +1,25 @@ +--- +namespace: ParseImport +expectation: Pass +outputs: + - tree: + base: + - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + - "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + kind: + Leaf: + alias: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 18 + path: "" + content: import a.b as bar; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 18 + path: "" + content: import a.b as bar; diff --git a/tests/expectations/parser/parser/import/basic.leo.out b/tests/expectations/parser/parser/import/basic.leo.out new file mode 100644 index 0000000000..02412948b5 --- /dev/null +++ b/tests/expectations/parser/parser/import/basic.leo.out @@ -0,0 +1,46 @@ +--- +namespace: ParseImport +expectation: Pass +outputs: + - tree: + base: + - "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" + - "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 11 + path: "" + content: import a.b; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 11 + path: "" + content: import a.b; + - tree: + base: + - "{\"name\":\"AB\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import AB.c;\\\"}\"}" + - "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import AB.c;\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 12 + path: "" + content: import AB.c; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 12 + path: "" + content: import AB.c; diff --git a/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out b/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out index 50ad5ede20..6b6c98c602 100644 --- a/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out +++ b/tests/expectations/parser/parser/import/import_empty_list_fail.leo.out @@ -1,5 +1,6 @@ --- -namespace: Parse +namespace: ParseImport expectation: Fail outputs: - - "Error [EPAR0370002]: Cannot import empty list\n --> test:3:10\n |\n 3 | import a.();\n | ^^\nError [EPAR0370002]: Cannot import empty list\n --> test:5:10\n |\n 5 | import a.();\n | ^^" + - "Error [EPAR0370002]: Cannot import empty list\n --> test:1:10\n |\n 1 | import a.();\n | ^^" + - "Error [EPAR0370002]: Cannot import empty list\n --> test:1:10\n |\n 1 | import a.();\n | ^^" diff --git a/tests/expectations/parser/parser/import/invalid.leo.out b/tests/expectations/parser/parser/import/invalid.leo.out new file mode 100644 index 0000000000..6a622f4188 --- /dev/null +++ b/tests/expectations/parser/parser/import/invalid.leo.out @@ -0,0 +1,5 @@ +--- +namespace: ParseImport +expectation: Fail +outputs: + - "did not consume all input: 'import' @ 2:1-7\n'*' @ 2:8-9\n';' @ 2:9-10\n" diff --git a/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out b/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out index e44abfa775..a533f14747 100644 --- a/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out +++ b/tests/expectations/parser/parser/import/invalid_chars_fail.leo.out @@ -1,5 +1,6 @@ --- -namespace: Parse +namespace: ParseImport expectation: Fail outputs: - - "Error [EPAR0370012]: package names must be lowercase alphanumeric ascii with underscores and singular dashes\n --> test:3:8\n |\n 3 | import AB.c;\n | ^^\nError [EPAR0370012]: package names must be lowercase alphanumeric ascii with underscores and singular dashes\n --> test:5:8\n |\n 5 | import AB.c;\n | ^^" + - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:1:1\n |\n 1 | import AB.c;\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:1:1\n |\n 1 | import AB.c;\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/import/keyword_fail.leo.out b/tests/expectations/parser/parser/import/keyword_fail.leo.out index c229c8167f..45f5f6c351 100644 --- a/tests/expectations/parser/parser/import/keyword_fail.leo.out +++ b/tests/expectations/parser/parser/import/keyword_fail.leo.out @@ -1,5 +1,6 @@ --- -namespace: Parse +namespace: ParseImport expectation: Fail outputs: - - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'function'\n --> test:3:8\n |\n 3 | import function.a;\n | ^^^^^^^^\nError [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:5:8\n |\n 5 | import import.a;\n | ^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'function'\n --> test:1:8\n |\n 1 | import function.a;\n | ^^^^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'package name', got 'import'\n --> test:1:8\n |\n 1 | import import.a;\n | ^^^^^^" diff --git a/tests/expectations/parser/parser/import/many_import.leo.out b/tests/expectations/parser/parser/import/many_import.leo.out new file mode 100644 index 0000000000..731114c76a --- /dev/null +++ b/tests/expectations/parser/parser/import/many_import.leo.out @@ -0,0 +1,130 @@ +--- +namespace: ParseImport +expectation: Pass +outputs: + - tree: + base: + - "{\"name\":\"tes_import\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import tes_import.(\\\"}\"}" + kind: + Nested: + tree: + - base: + - "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Point,\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 2 + line_stop: 2 + col_start: 1 + col_stop: 6 + path: "" + content: "Point," + - base: + - "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"foo,\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 3 + line_stop: 3 + col_start: 1 + col_stop: 4 + path: "" + content: "foo," + span: + line_start: 1 + line_stop: 4 + col_start: 8 + col_stop: 2 + path: "" + content: "import tes_import.(\n ...\n ...\n);" + span: + line_start: 1 + line_stop: 4 + col_start: 8 + col_stop: 2 + path: "" + content: "import tes_import.(\n ...\n ...\n);" + - tree: + base: + - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.(\\\"}\"}" + kind: + Nested: + tree: + - base: + - "{\"name\":\"Bar\",\"span\":\"{\\\"line_start\\\":2,\\\"line_stop\\\":2,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"Bar,\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 2 + line_stop: 2 + col_start: 1 + col_stop: 4 + path: "" + content: "Bar," + - base: + - "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"baz.(Baz, Bazzar),\\\"}\"}" + kind: + Nested: + tree: + - base: + - "{\"name\":\"Baz\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":6,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"baz.(Baz, Bazzar),\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 3 + line_stop: 3 + col_start: 6 + col_stop: 9 + path: "" + content: "baz.(Baz, Bazzar)," + - base: + - "{\"name\":\"Bazzar\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":11,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"baz.(Baz, Bazzar),\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 3 + line_stop: 3 + col_start: 11 + col_stop: 17 + path: "" + content: "baz.(Baz, Bazzar)," + span: + line_start: 3 + line_stop: 3 + col_start: 1 + col_stop: 18 + path: "" + content: "baz.(Baz, Bazzar)," + - base: + - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bat.bat.Bat,\\\"}\"}" + - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bat.bat.Bat,\\\"}\"}" + - "{\"name\":\"Bat\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bat.bat.Bat,\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 4 + line_stop: 4 + col_start: 1 + col_stop: 12 + path: "" + content: "bat.bat.Bat," + span: + line_start: 1 + line_stop: 5 + col_start: 8 + col_stop: 2 + path: "" + content: "import bar.(\n ...\n ...\n ...\n);" + span: + line_start: 1 + line_stop: 5 + col_start: 8 + col_stop: 2 + path: "" + content: "import bar.(\n ...\n ...\n ...\n);" diff --git a/tests/expectations/parser/parser/import/many_import_star.leo.out b/tests/expectations/parser/parser/import/many_import_star.leo.out new file mode 100644 index 0000000000..ff2a51d9b8 --- /dev/null +++ b/tests/expectations/parser/parser/import/many_import_star.leo.out @@ -0,0 +1,137 @@ +--- +namespace: ParseImport +expectation: Pass +outputs: + - tree: + base: + - "{\"name\":\"test_import\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import test_import.*; // local import\\\"}\"}" + kind: + Glob: + span: + line_start: 1 + line_stop: 1 + col_start: 20 + col_stop: 21 + path: "" + content: import test_import.*; // local import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 21 + path: "" + content: import test_import.*; // local import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 21 + path: "" + content: import test_import.*; // local import + - tree: + base: + - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.*; // imports directory import\\\"}\"}" + kind: + Glob: + span: + line_start: 1 + line_stop: 1 + col_start: 12 + col_stop: 13 + path: "" + content: import bar.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 13 + path: "" + content: import bar.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 13 + path: "" + content: import bar.*; // imports directory import + - tree: + base: + - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" + - "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" + kind: + Glob: + span: + line_start: 1 + line_stop: 1 + col_start: 16 + col_stop: 17 + path: "" + content: import bar.baz.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 17 + path: "" + content: import bar.baz.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 17 + path: "" + content: import bar.baz.*; // imports directory import + - tree: + base: + - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" + - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" + - "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" + kind: + Glob: + span: + line_start: 1 + line_stop: 1 + col_start: 20 + col_stop: 21 + path: "" + content: import bar.bat.bat.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 21 + path: "" + content: import bar.bat.bat.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 21 + path: "" + content: import bar.bat.bat.*; // imports directory import + - tree: + base: + - "{\"name\":\"car\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import car.*; // imports directory import\\\"}\"}" + kind: + Glob: + span: + line_start: 1 + line_stop: 1 + col_start: 12 + col_stop: 13 + path: "" + content: import car.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 13 + path: "" + content: import car.*; // imports directory import + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 13 + path: "" + content: import car.*; // imports directory import diff --git a/tests/expectations/parser/parser/import/names.leo.out b/tests/expectations/parser/parser/import/names.leo.out new file mode 100644 index 0000000000..b0cedd3e09 --- /dev/null +++ b/tests/expectations/parser/parser/import/names.leo.out @@ -0,0 +1,67 @@ +--- +namespace: ParseImport +expectation: Pass +outputs: + - tree: + base: + - "{\"name\":\"a0_f\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a0_f.foo;\\\"}\"}" + - "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a0_f.foo;\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 16 + path: "" + content: import a0_f.foo; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 16 + path: "" + content: import a0_f.foo; + - tree: + base: + - "{\"name\":\"a_9\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a_9.bar;\\\"}\"}" + - "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a_9.bar;\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 15 + path: "" + content: import a_9.bar; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 15 + path: "" + content: import a_9.bar; + - tree: + base: + - "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.hello;\\\"}\"}" + - "{\"name\":\"hello\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":20,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.hello;\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 25 + path: "" + content: import hello_world.hello; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 25 + path: "" + content: import hello_world.hello; diff --git a/tests/expectations/parser/parser/import/names_underscore.leo.out b/tests/expectations/parser/parser/import/names_underscore.leo.out new file mode 100644 index 0000000000..25c42ab9f4 --- /dev/null +++ b/tests/expectations/parser/parser/import/names_underscore.leo.out @@ -0,0 +1,25 @@ +--- +namespace: ParseImport +expectation: Pass +outputs: + - tree: + base: + - "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" + - "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" + kind: + Leaf: + alias: ~ + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 23 + path: "" + content: import hello_world.foo; + span: + line_start: 1 + line_stop: 1 + col_start: 8 + col_stop: 23 + path: "" + content: import hello_world.foo; diff --git a/tests/expectations/parser/parser/import/star.leo.out b/tests/expectations/parser/parser/import/star.leo.out new file mode 100644 index 0000000000..222dd3bfb4 --- /dev/null +++ b/tests/expectations/parser/parser/import/star.leo.out @@ -0,0 +1,5 @@ +--- +namespace: ParseImport +expectation: Fail +outputs: + - "Error [EPAR0370005]: expected ; -- got '-'\n --> test:1:12\n |\n 1 | import test-import.*;\n | ^" diff --git a/tests/expectations/parser/parser/inputs/input_success.leo.out b/tests/expectations/parser/parser/inputs/input_success.leo.out new file mode 100644 index 0000000000..6fde85fcfe --- /dev/null +++ b/tests/expectations/parser/parser/inputs/input_success.leo.out @@ -0,0 +1,764 @@ +--- +namespace: Input +expectation: Pass +outputs: + - sections: + - name: main + definitions: + - type_: Boolean + name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"a: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 4 + line_stop: 4 + col_start: 12 + col_stop: 16 + path: "" + content: "a: bool = true; " + span: + line_start: 4 + line_stop: 4 + col_start: 4 + col_stop: 8 + path: "" + content: "a: bool = true; " + - type_: + IntegerType: U8 + name: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"b: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 5 + line_stop: 5 + col_start: 12 + col_stop: 13 + path: "" + content: "b: u8 = 2; " + span: + line_start: 5 + line_stop: 5 + col_start: 4 + col_stop: 6 + path: "" + content: "b: u8 = 2; " + - type_: Field + name: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 6 + line_stop: 6 + col_start: 12 + col_stop: 13 + path: "" + content: "c: field = 0; " + span: + line_start: 6 + line_stop: 6 + col_start: 4 + col_stop: 9 + path: "" + content: "c: field = 0; " + - type_: Group + name: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"d: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 7 + line_stop: 7 + col_start: 13 + col_stop: 14 + path: "" + content: "d: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 7 + line_stop: 7 + col_start: 16 + col_stop: 17 + path: "" + content: "d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 13 + col_stop: 23 + path: "" + content: "d: group = (0, 1)group; " + span: + line_start: 7 + line_stop: 7 + col_start: 4 + col_stop: 9 + path: "" + content: "d: group = (0, 1)group; " + - type_: Address + name: "{\"name\":\"e\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 8 + line_stop: 8 + col_start: 14 + col_stop: 77 + path: "" + content: "e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 8 + line_stop: 8 + col_start: 4 + col_stop: 11 + path: "" + content: "e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + - type_: + Array: + - IntegerType: U8 + - - value: "32" + name: "{\"name\":\"f\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"f: [u8; 32] = [0; 32]; \\\"}\"}" + value: + ArrayInit: + element: + Value: + Implicit: + - "0" + - span: + line_start: 9 + line_stop: 9 + col_start: 16 + col_stop: 17 + path: "" + content: "f: [u8; 32] = [0; 32]; " + dimensions: + - value: "32" + span: + line_start: 9 + line_stop: 9 + col_start: 15 + col_stop: 22 + path: "" + content: "f: [u8; 32] = [0; 32]; " + span: + line_start: 9 + line_stop: 9 + col_start: 4 + col_stop: 12 + path: "" + content: "f: [u8; 32] = [0; 32]; " + - type_: + Array: + - Array: + - IntegerType: U8 + - - value: "2" + - - value: "3" + name: "{\"name\":\"g\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"g: [[u8; 2]; 3] = [[0; 2]; 3]; \\\"}\"}" + value: + ArrayInit: + element: + ArrayInit: + element: + Value: + Implicit: + - "0" + - span: + line_start: 10 + line_stop: 10 + col_start: 21 + col_stop: 22 + path: "" + content: "g: [[u8; 2]; 3] = [[0; 2]; 3]; " + dimensions: + - value: "2" + span: + line_start: 10 + line_stop: 10 + col_start: 20 + col_stop: 26 + path: "" + content: "g: [[u8; 2]; 3] = [[0; 2]; 3]; " + dimensions: + - value: "3" + span: + line_start: 10 + line_stop: 10 + col_start: 19 + col_stop: 30 + path: "" + content: "g: [[u8; 2]; 3] = [[0; 2]; 3]; " + span: + line_start: 10 + line_stop: 10 + col_start: 4 + col_stop: 16 + path: "" + content: "g: [[u8; 2]; 3] = [[0; 2]; 3]; " + - type_: + Tuple: + - Boolean + - Boolean + name: "{\"name\":\"h\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"h: (bool, bool) = (true, false); \\\"}\"}" + value: + TupleInit: + elements: + - Value: + Boolean: + - "true" + - span: + line_start: 11 + line_stop: 11 + col_start: 20 + col_stop: 24 + path: "" + content: "h: (bool, bool) = (true, false); " + - Value: + Boolean: + - "false" + - span: + line_start: 11 + line_stop: 11 + col_start: 26 + col_stop: 31 + path: "" + content: "h: (bool, bool) = (true, false); " + span: + line_start: 11 + line_stop: 11 + col_start: 19 + col_stop: 32 + path: "" + content: "h: (bool, bool) = (true, false); " + span: + line_start: 11 + line_stop: 11 + col_start: 4 + col_stop: 16 + path: "" + content: "h: (bool, bool) = (true, false); " + span: + line_start: 3 + line_stop: 3 + col_start: 2 + col_stop: 6 + path: "" + content: "[main]" + - name: registers + definitions: + - type_: Boolean + name: "{\"name\":\"r0\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r0: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 14 + line_stop: 14 + col_start: 13 + col_stop: 17 + path: "" + content: "r0: bool = true; " + span: + line_start: 14 + line_stop: 14 + col_start: 5 + col_stop: 9 + path: "" + content: "r0: bool = true; " + - type_: + IntegerType: U8 + name: "{\"name\":\"r1\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r1: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 15 + line_stop: 15 + col_start: 13 + col_stop: 14 + path: "" + content: "r1: u8 = 2; " + span: + line_start: 15 + line_stop: 15 + col_start: 5 + col_stop: 7 + path: "" + content: "r1: u8 = 2; " + - type_: Field + name: "{\"name\":\"r2\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r2: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 16 + line_stop: 16 + col_start: 13 + col_stop: 14 + path: "" + content: "r2: field = 0; " + span: + line_start: 16 + line_stop: 16 + col_start: 5 + col_stop: 10 + path: "" + content: "r2: field = 0; " + - type_: Group + name: "{\"name\":\"r3\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r3: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 17 + line_stop: 17 + col_start: 14 + col_stop: 15 + path: "" + content: "r3: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 17 + line_stop: 17 + col_start: 17 + col_stop: 18 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 17 + line_stop: 17 + col_start: 14 + col_stop: 24 + path: "" + content: "r3: group = (0, 1)group; " + span: + line_start: 17 + line_stop: 17 + col_start: 5 + col_stop: 10 + path: "" + content: "r3: group = (0, 1)group; " + - type_: Address + name: "{\"name\":\"r4\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 18 + line_stop: 18 + col_start: 15 + col_stop: 78 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 18 + line_stop: 18 + col_start: 5 + col_stop: 12 + path: "" + content: "r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + - type_: + Array: + - IntegerType: U8 + - - value: "32" + name: "{\"name\":\"r5\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r5: [u8; 32] = [0; 32]; \\\"}\"}" + value: + ArrayInit: + element: + Value: + Implicit: + - "0" + - span: + line_start: 19 + line_stop: 19 + col_start: 17 + col_stop: 18 + path: "" + content: "r5: [u8; 32] = [0; 32]; " + dimensions: + - value: "32" + span: + line_start: 19 + line_stop: 19 + col_start: 16 + col_stop: 23 + path: "" + content: "r5: [u8; 32] = [0; 32]; " + span: + line_start: 19 + line_stop: 19 + col_start: 5 + col_stop: 13 + path: "" + content: "r5: [u8; 32] = [0; 32]; " + - type_: + Array: + - Array: + - IntegerType: U8 + - - value: "2" + - - value: "3" + name: "{\"name\":\"r6\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r6: [[u8; 2]; 3] = [[0; 2]; 3]; \\\"}\"}" + value: + ArrayInit: + element: + ArrayInit: + element: + Value: + Implicit: + - "0" + - span: + line_start: 20 + line_stop: 20 + col_start: 22 + col_stop: 23 + path: "" + content: "r6: [[u8; 2]; 3] = [[0; 2]; 3]; " + dimensions: + - value: "2" + span: + line_start: 20 + line_stop: 20 + col_start: 21 + col_stop: 27 + path: "" + content: "r6: [[u8; 2]; 3] = [[0; 2]; 3]; " + dimensions: + - value: "3" + span: + line_start: 20 + line_stop: 20 + col_start: 20 + col_stop: 31 + path: "" + content: "r6: [[u8; 2]; 3] = [[0; 2]; 3]; " + span: + line_start: 20 + line_stop: 20 + col_start: 5 + col_stop: 17 + path: "" + content: "r6: [[u8; 2]; 3] = [[0; 2]; 3]; " + - type_: + Tuple: + - Boolean + - Boolean + name: "{\"name\":\"r7\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"r7: (bool, bool) = (true, false); \\\"}\"}" + value: + TupleInit: + elements: + - Value: + Boolean: + - "true" + - span: + line_start: 21 + line_stop: 21 + col_start: 21 + col_stop: 25 + path: "" + content: "r7: (bool, bool) = (true, false); " + - Value: + Boolean: + - "false" + - span: + line_start: 21 + line_stop: 21 + col_start: 27 + col_stop: 32 + path: "" + content: "r7: (bool, bool) = (true, false); " + span: + line_start: 21 + line_stop: 21 + col_start: 20 + col_stop: 33 + path: "" + content: "r7: (bool, bool) = (true, false); " + span: + line_start: 21 + line_stop: 21 + col_start: 5 + col_stop: 17 + path: "" + content: "r7: (bool, bool) = (true, false); " + span: + line_start: 13 + line_stop: 13 + col_start: 2 + col_stop: 11 + path: "" + content: "[registers]" + - name: constants + definitions: + - type_: Boolean + name: "{\"name\":\"c0\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c0: bool = true; \\\"}\"}" + value: + Value: + Boolean: + - "true" + - span: + line_start: 24 + line_stop: 24 + col_start: 13 + col_stop: 17 + path: "" + content: "c0: bool = true; " + span: + line_start: 24 + line_stop: 24 + col_start: 5 + col_stop: 9 + path: "" + content: "c0: bool = true; " + - type_: + IntegerType: U8 + name: "{\"name\":\"c1\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c1: u8 = 2; \\\"}\"}" + value: + Value: + Implicit: + - "2" + - span: + line_start: 25 + line_stop: 25 + col_start: 13 + col_stop: 14 + path: "" + content: "c1: u8 = 2; " + span: + line_start: 25 + line_stop: 25 + col_start: 5 + col_stop: 7 + path: "" + content: "c1: u8 = 2; " + - type_: Field + name: "{\"name\":\"c2\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c2: field = 0; \\\"}\"}" + value: + Value: + Implicit: + - "0" + - span: + line_start: 26 + line_stop: 26 + col_start: 13 + col_stop: 14 + path: "" + content: "c2: field = 0; " + span: + line_start: 26 + line_stop: 26 + col_start: 5 + col_stop: 10 + path: "" + content: "c2: field = 0; " + - type_: Group + name: "{\"name\":\"c3\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c3: group = (0, 1)group; \\\"}\"}" + value: + Value: + Group: + Tuple: + x: + Number: + - "0" + - span: + line_start: 27 + line_stop: 27 + col_start: 14 + col_stop: 15 + path: "" + content: "c3: group = (0, 1)group; " + y: + Number: + - "1" + - span: + line_start: 27 + line_stop: 27 + col_start: 17 + col_stop: 18 + path: "" + content: "c3: group = (0, 1)group; " + span: + line_start: 27 + line_stop: 27 + col_start: 14 + col_stop: 24 + path: "" + content: "c3: group = (0, 1)group; " + span: + line_start: 27 + line_stop: 27 + col_start: 5 + col_stop: 10 + path: "" + content: "c3: group = (0, 1)group; " + - type_: Address + name: "{\"name\":\"c4\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;\\\"}\"}" + value: + Value: + Address: + - aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 + - span: + line_start: 28 + line_stop: 28 + col_start: 15 + col_stop: 78 + path: "" + content: "c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + span: + line_start: 28 + line_stop: 28 + col_start: 5 + col_stop: 12 + path: "" + content: "c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;" + - type_: + Array: + - IntegerType: U8 + - - value: "32" + name: "{\"name\":\"c5\",\"span\":\"{\\\"line_start\\\":29,\\\"line_stop\\\":29,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c5: [u8; 32] = [0; 32]; \\\"}\"}" + value: + ArrayInit: + element: + Value: + Implicit: + - "0" + - span: + line_start: 29 + line_stop: 29 + col_start: 17 + col_stop: 18 + path: "" + content: "c5: [u8; 32] = [0; 32]; " + dimensions: + - value: "32" + span: + line_start: 29 + line_stop: 29 + col_start: 16 + col_stop: 23 + path: "" + content: "c5: [u8; 32] = [0; 32]; " + span: + line_start: 29 + line_stop: 29 + col_start: 5 + col_stop: 13 + path: "" + content: "c5: [u8; 32] = [0; 32]; " + - type_: + Array: + - Array: + - IntegerType: U8 + - - value: "2" + - - value: "3" + name: "{\"name\":\"c6\",\"span\":\"{\\\"line_start\\\":30,\\\"line_stop\\\":30,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c6: [[u8; 2]; 3] = [[0; 2]; 3]; \\\"}\"}" + value: + ArrayInit: + element: + ArrayInit: + element: + Value: + Implicit: + - "0" + - span: + line_start: 30 + line_stop: 30 + col_start: 22 + col_stop: 23 + path: "" + content: "c6: [[u8; 2]; 3] = [[0; 2]; 3]; " + dimensions: + - value: "2" + span: + line_start: 30 + line_stop: 30 + col_start: 21 + col_stop: 27 + path: "" + content: "c6: [[u8; 2]; 3] = [[0; 2]; 3]; " + dimensions: + - value: "3" + span: + line_start: 30 + line_stop: 30 + col_start: 20 + col_stop: 31 + path: "" + content: "c6: [[u8; 2]; 3] = [[0; 2]; 3]; " + span: + line_start: 30 + line_stop: 30 + col_start: 5 + col_stop: 17 + path: "" + content: "c6: [[u8; 2]; 3] = [[0; 2]; 3]; " + - type_: + Tuple: + - Boolean + - Boolean + name: "{\"name\":\"c7\",\"span\":\"{\\\"line_start\\\":31,\\\"line_stop\\\":31,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"c7: (bool, bool) = (true, false); \\\"}\"}" + value: + TupleInit: + elements: + - Value: + Boolean: + - "true" + - span: + line_start: 31 + line_stop: 31 + col_start: 21 + col_stop: 25 + path: "" + content: "c7: (bool, bool) = (true, false); " + - Value: + Boolean: + - "false" + - span: + line_start: 31 + line_stop: 31 + col_start: 27 + col_stop: 32 + path: "" + content: "c7: (bool, bool) = (true, false); " + span: + line_start: 31 + line_stop: 31 + col_start: 20 + col_stop: 33 + path: "" + content: "c7: (bool, bool) = (true, false); " + span: + line_start: 31 + line_stop: 31 + col_start: 5 + col_stop: 17 + path: "" + content: "c7: (bool, bool) = (true, false); " + span: + line_start: 23 + line_stop: 23 + col_start: 2 + col_stop: 11 + path: "" + content: "[constants]" diff --git a/tests/expectations/parser/parser/serialize/linear_regression.leo.out b/tests/expectations/parser/parser/serialize/linear_regression.leo.out index 91a060a842..f9cb892e7f 100644 --- a/tests/expectations/parser/parser/serialize/linear_regression.leo.out +++ b/tests/expectations/parser/parser/serialize/linear_regression.leo.out @@ -95,6 +95,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -106,6 +107,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":25,\\\"line_stop\\\":25,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32; \\\"}\"}" + parened: false type_: ~ value: Value: @@ -117,6 +119,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32; \\\"}\"}" + parened: false type_: ~ value: Value: @@ -128,6 +131,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"xy_sum\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let xy_sum = 0i32; \\\"}\"}" + parened: false type_: ~ value: Value: @@ -139,6 +143,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"x2_sum\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x2_sum = 0i32; \\\"}\"}" + parened: false type_: ~ value: Value: @@ -289,6 +294,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"numerator\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let numerator = (num_points * xy_sum) - (x_sum * y_sum); \\\"}\"}" + parened: false type_: ~ value: Binary: @@ -312,6 +318,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"denominator\",\"span\":\"{\\\"line_start\\\":36,\\\"line_stop\\\":36,\\\"col_start\\\":13,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let denominator = (num_points * x2_sum) - (x_sum * x_sum);\\\"}\"}" + parened: false type_: ~ value: Binary: @@ -335,6 +342,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = numerator / denominator;\\\"}\"}" + parened: false type_: ~ value: Binary: @@ -368,6 +376,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"num_points\",\"span\":\"{\\\"line_start\\\":42,\\\"line_stop\\\":42,\\\"col_start\\\":13,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let num_points = 5i32; \\\"}\"}" + parened: false type_: ~ value: Value: @@ -379,6 +388,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"x_sum\",\"span\":\"{\\\"line_start\\\":44,\\\"line_stop\\\":44,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let x_sum = 0i32;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -390,6 +400,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"y_sum\",\"span\":\"{\\\"line_start\\\":45,\\\"line_stop\\\":45,\\\"col_start\\\":13,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let y_sum = 0i32;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -500,6 +511,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" + parened: false type_: Array: - Identifier: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let points: [Point; 5] = [\\\"}\"}" @@ -622,6 +634,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"reg\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":7,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg = LinearRegression::new(points);\\\"}\"}" + parened: false type_: ~ value: Call: @@ -639,6 +652,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"slope\",\"span\":\"{\\\"line_start\\\":64,\\\"line_stop\\\":64,\\\"col_start\\\":7,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let slope = reg.slope();\\\"}\"}" + parened: false type_: ~ value: Call: @@ -655,6 +669,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"offset\",\"span\":\"{\\\"line_start\\\":65,\\\"line_stop\\\":65,\\\"col_start\\\":7,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let offset = reg.offset(slope);\\\"}\"}" + parened: false type_: ~ value: Call: diff --git a/tests/expectations/parser/parser/serialize/palindrome.leo.out b/tests/expectations/parser/parser/serialize/palindrome.leo.out index 6ecc69d502..2b42f7d562 100644 --- a/tests/expectations/parser/parser/serialize/palindrome.leo.out +++ b/tests/expectations/parser/parser/serialize/palindrome.leo.out @@ -56,6 +56,7 @@ outputs: variable_names: - mutable: false identifier: "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":11,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const str_len = 20u32; // saving const for convenience\\\"}\"}" + parened: false type_: ~ value: Value: @@ -67,6 +68,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = true;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -76,6 +78,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let processed = 0u8;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -103,6 +106,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}" + parened: false type_: ~ value: Access: @@ -129,6 +133,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let skipped = 0u8;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -140,6 +145,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":21,\\\"line_stop\\\":21,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_empty = 0u8;\\\"}\"}" + parened: false type_: ~ value: Value: @@ -151,6 +157,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_sym = ' ';\\\"}\"}" + parened: false type_: ~ value: Value: diff --git a/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out b/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out index 9ac6f544ab..5d6bad730c 100644 --- a/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out +++ b/tests/expectations/parser/parser/serialize/pedersen_hash.leo.out @@ -64,6 +64,7 @@ outputs: variable_names: - mutable: true identifier: "{\"name\":\"digest\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":13,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let digest: group = 0group;\\\"}\"}" + parened: false type_: Group value: Value: @@ -143,6 +144,7 @@ outputs: variable_names: - mutable: false identifier: "{\"name\":\"pedersen\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":11,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen = PedersenHash::new(parameters);\\\"}\"}" + parened: false type_: ~ value: Call: diff --git a/tests/expectations/parser/parser/statement/definition.leo.out b/tests/expectations/parser/parser/statement/definition.leo.out index 7caa8013f0..eeb30f3d76 100644 --- a/tests/expectations/parser/parser/statement/definition.leo.out +++ b/tests/expectations/parser/parser/statement/definition.leo.out @@ -14,6 +14,7 @@ outputs: col_stop: 6 path: "" content: let x = expr; + parened: false type_: ~ value: Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let x = expr;\\\"}\"}" @@ -36,6 +37,7 @@ outputs: col_stop: 6 path: "" content: let x = (); + parened: false type_: ~ value: TupleInit: @@ -66,6 +68,7 @@ outputs: col_stop: 6 path: "" content: let x = x+y; + parened: false type_: ~ value: Binary: @@ -100,6 +103,7 @@ outputs: col_stop: 6 path: "" content: "let x = (x,y);" + parened: false type_: ~ value: TupleInit: @@ -132,6 +136,7 @@ outputs: col_stop: 6 path: "" content: let x = x(); + parened: false type_: ~ value: Call: @@ -164,6 +169,7 @@ outputs: col_stop: 8 path: "" content: const x = expr; + parened: false type_: ~ value: Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":11,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const x = expr;\\\"}\"}" @@ -186,6 +192,7 @@ outputs: col_stop: 8 path: "" content: const x = (); + parened: false type_: ~ value: TupleInit: @@ -216,6 +223,7 @@ outputs: col_stop: 8 path: "" content: const x = x+y; + parened: false type_: ~ value: Binary: @@ -250,6 +258,7 @@ outputs: col_stop: 8 path: "" content: "const x = (x,y);" + parened: false type_: ~ value: TupleInit: @@ -282,6 +291,7 @@ outputs: col_stop: 8 path: "" content: const x = x(); + parened: false type_: ~ value: Call: @@ -314,6 +324,7 @@ outputs: col_stop: 6 path: "" content: "let x: u32 = expr;" + parened: false type_: IntegerType: U32 value: @@ -337,6 +348,7 @@ outputs: col_stop: 6 path: "" content: "let x: u32 = ();" + parened: false type_: IntegerType: U32 value: @@ -368,6 +380,7 @@ outputs: col_stop: 6 path: "" content: "let x: u32 = x+y;" + parened: false type_: IntegerType: U32 value: @@ -403,6 +416,7 @@ outputs: col_stop: 6 path: "" content: "let x: u32 = (x,y);" + parened: false type_: IntegerType: U32 value: @@ -436,6 +450,7 @@ outputs: col_stop: 6 path: "" content: "let x: u32 = x();" + parened: false type_: IntegerType: U32 value: @@ -469,6 +484,7 @@ outputs: col_stop: 8 path: "" content: "const x: u32 = expr;" + parened: false type_: IntegerType: U32 value: @@ -492,6 +508,7 @@ outputs: col_stop: 8 path: "" content: "const x: u32 = ();" + parened: false type_: IntegerType: U32 value: @@ -523,6 +540,7 @@ outputs: col_stop: 8 path: "" content: "const x: u32 = x+y;" + parened: false type_: IntegerType: U32 value: @@ -558,6 +576,7 @@ outputs: col_stop: 8 path: "" content: "const x: u32 = (x,y);" + parened: false type_: IntegerType: U32 value: @@ -591,6 +610,7 @@ outputs: col_stop: 8 path: "" content: "const x: u32 = x();" + parened: false type_: IntegerType: U32 value: @@ -633,6 +653,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y) = expr;" + parened: true type_: ~ value: Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"let (x, y) = expr;\\\"}\"}" @@ -664,6 +685,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y) = ();" + parened: true type_: ~ value: TupleInit: @@ -703,6 +725,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y) = x+y;" + parened: true type_: ~ value: Binary: @@ -746,6 +769,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y) = (x,y);" + parened: true type_: ~ value: TupleInit: @@ -787,6 +811,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y) = x();" + parened: true type_: ~ value: Call: @@ -828,6 +853,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y) = expr;" + parened: true type_: ~ value: Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const (x, y) = expr;\\\"}\"}" @@ -859,6 +885,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y) = ();" + parened: true type_: ~ value: TupleInit: @@ -898,6 +925,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y) = x+y;" + parened: true type_: ~ value: Binary: @@ -941,6 +969,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y) = (x,y);" + parened: true type_: ~ value: TupleInit: @@ -982,6 +1011,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y) = x();" + parened: true type_: ~ value: Call: @@ -1023,6 +1053,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y): u32 = expr;" + parened: true type_: IntegerType: U32 value: @@ -1055,6 +1086,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y): u32 = ();" + parened: true type_: IntegerType: U32 value: @@ -1095,6 +1127,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y): u32 = x+y;" + parened: true type_: IntegerType: U32 value: @@ -1139,6 +1172,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y): u32 = (x,y);" + parened: true type_: IntegerType: U32 value: @@ -1181,6 +1215,7 @@ outputs: col_stop: 10 path: "" content: "let (x, y): u32 = x();" + parened: true type_: IntegerType: U32 value: @@ -1223,6 +1258,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y): u32 = expr;" + parened: true type_: IntegerType: U32 value: @@ -1255,6 +1291,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y): u32 = ();" + parened: true type_: IntegerType: U32 value: @@ -1295,6 +1332,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y): u32 = x+y;" + parened: true type_: IntegerType: U32 value: @@ -1339,6 +1377,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y): u32 = (x,y);" + parened: true type_: IntegerType: U32 value: @@ -1381,6 +1420,7 @@ outputs: col_stop: 12 path: "" content: "const (x, y): u32 = x();" + parened: true type_: IntegerType: U32 value: @@ -1423,6 +1463,7 @@ outputs: col_stop: 9 path: "" content: "let (x,y,) = ();" + parened: true type_: ~ value: TupleInit: @@ -1453,6 +1494,7 @@ outputs: col_stop: 7 path: "" content: "let (x,) = ();" + parened: true type_: ~ value: TupleInit: @@ -1483,6 +1525,7 @@ outputs: col_stop: 6 path: "" content: "let x: [char; _] = \"Hello, World!\";" + parened: false type_: Array: - Char @@ -1529,6 +1572,7 @@ outputs: col_stop: 6 path: "" content: "let x: [[u8; 2]; 2] = [[0,0], [0,0]];" + parened: false type_: Array: - Array: diff --git a/tests/parser/expression/literal/comment.leo b/tests/parser/expression/literal/comment.leo index 3dc0ab4360..7a56501b3f 100644 --- a/tests/parser/expression/literal/comment.leo +++ b/tests/parser/expression/literal/comment.leo @@ -1,5 +1,5 @@ /* -namespace: Token +namespace: Parse expectation: Pass */ @@ -9,11 +9,13 @@ expectation: Pass //test3 -/ / test4 +// test4 /* test5 */ + /* test 6 */ + /* test 7 */ @@ -32,5 +34,3 @@ test 6 */ /** /*/ /** **/ - -/* \ No newline at end of file diff --git a/unused/tests/parser/import/alias.leo b/tests/parser/import/alias.leo similarity index 65% rename from unused/tests/parser/import/alias.leo rename to tests/parser/import/alias.leo index 5913a203b0..ba0956bd77 100644 --- a/unused/tests/parser/import/alias.leo +++ b/tests/parser/import/alias.leo @@ -1,5 +1,5 @@ /* -namespace: Parse +namespace: ParseImport expectation: Pass */ diff --git a/tests/parser/import/basic.leo b/tests/parser/import/basic.leo new file mode 100644 index 0000000000..11f4b70672 --- /dev/null +++ b/tests/parser/import/basic.leo @@ -0,0 +1,8 @@ +/* +namespace: ParseImport +expectation: Pass +*/ + +import a.b; + +import AB.c; \ No newline at end of file diff --git a/tests/parser/import/import_empty_list_fail.leo b/tests/parser/import/import_empty_list_fail.leo index 4e8bbe7b80..ca14b5fe0d 100644 --- a/tests/parser/import/import_empty_list_fail.leo +++ b/tests/parser/import/import_empty_list_fail.leo @@ -1,5 +1,5 @@ /* -namespace: Parse +namespace: ParseImport expectation: Fail */ diff --git a/unused/tests/parser/import/invalid.leo b/tests/parser/import/invalid.leo similarity index 69% rename from unused/tests/parser/import/invalid.leo rename to tests/parser/import/invalid.leo index 245ef87b12..ab4f073b5f 100644 --- a/unused/tests/parser/import/invalid.leo +++ b/tests/parser/import/invalid.leo @@ -1,5 +1,5 @@ /* -namespace: Parse +namespace: ParseImport expectation: Fail */ diff --git a/tests/parser/import/invalid_chars_fail.leo b/tests/parser/import/invalid_chars_fail.leo deleted file mode 100644 index 47cf2bcb72..0000000000 --- a/tests/parser/import/invalid_chars_fail.leo +++ /dev/null @@ -1,8 +0,0 @@ -/* -namespace: Parse -expectation: Fail -*/ - -import AB.c; - -import AB.c; diff --git a/tests/parser/import/keyword_fail.leo b/tests/parser/import/keyword_fail.leo index 11b5456b79..fd12e8c7ff 100644 --- a/tests/parser/import/keyword_fail.leo +++ b/tests/parser/import/keyword_fail.leo @@ -1,5 +1,5 @@ /* -namespace: Parse +namespace: ParseImport expectation: Fail */ diff --git a/unused/tests/parser/import/many_import.leo b/tests/parser/import/many_import.leo similarity index 51% rename from unused/tests/parser/import/many_import.leo rename to tests/parser/import/many_import.leo index 47b104aa34..a9cf5fa9b2 100644 --- a/unused/tests/parser/import/many_import.leo +++ b/tests/parser/import/many_import.leo @@ -1,14 +1,14 @@ /* -namespace: Parse +namespace: ParseImport expectation: Pass */ -import test-import.( // local import +import tes_import.( Point, foo, ); -import bar.( // imports directory import +import bar.( Bar, baz.(Baz, Bazzar), bat.bat.Bat, diff --git a/unused/tests/parser/import/many_import_star.leo b/tests/parser/import/many_import_star.leo similarity index 77% rename from unused/tests/parser/import/many_import_star.leo rename to tests/parser/import/many_import_star.leo index 276deb7fcb..2a4fa63366 100644 --- a/unused/tests/parser/import/many_import_star.leo +++ b/tests/parser/import/many_import_star.leo @@ -1,11 +1,14 @@ /* -namespace: Parse +namespace: ParseImport expectation: Pass */ -import test-import.*; // local import +import test_import.*; // local import import bar.*; // imports directory import + import bar.baz.*; // imports directory import + import bar.bat.bat.*; // imports directory import + import car.*; // imports directory import diff --git a/tests/parser/import/names.leo b/tests/parser/import/names.leo new file mode 100644 index 0000000000..6538138cbb --- /dev/null +++ b/tests/parser/import/names.leo @@ -0,0 +1,10 @@ +/* +namespace: ParseImport +expectation: Pass +*/ + +import a0_f.foo; + +import a_9.bar; + +import hello_world.hello; diff --git a/unused/tests/parser/import/names_underscore.leo b/tests/parser/import/names_underscore.leo similarity index 68% rename from unused/tests/parser/import/names_underscore.leo rename to tests/parser/import/names_underscore.leo index 8bc3ebefaf..d730848799 100644 --- a/unused/tests/parser/import/names_underscore.leo +++ b/tests/parser/import/names_underscore.leo @@ -1,5 +1,5 @@ /* -namespace: Parse +namespace: ParseImport expectation: Pass */ diff --git a/tests/parser/import/star.leo b/tests/parser/import/star.leo new file mode 100644 index 0000000000..e7da78de66 --- /dev/null +++ b/tests/parser/import/star.leo @@ -0,0 +1,6 @@ +/* +namespace: ParseImport +expectation: Fail +*/ + +import test-import.*; diff --git a/tests/parser/inputs/input_success.leo b/tests/parser/inputs/input_success.leo new file mode 100644 index 0000000000..fae8348174 --- /dev/null +++ b/tests/parser/inputs/input_success.leo @@ -0,0 +1,34 @@ +/* +namespace: Input +expectation: Pass +*/ + +[main] +a: bool = true; +b: u8 = 2; +c: field = 0; +d: group = (0, 1)group; +e: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +f: [u8; 32] = [0; 32]; +g: [[u8; 2]; 3] = [[0; 2]; 3]; +h: (bool, bool) = (true, false); + +[registers] +r0: bool = true; +r1: u8 = 2; +r2: field = 0; +r3: group = (0, 1)group; +r4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +r5: [u8; 32] = [0; 32]; +r6: [[u8; 2]; 3] = [[0; 2]; 3]; +r7: (bool, bool) = (true, false); + +[constants] +c0: bool = true; +c1: u8 = 2; +c2: field = 0; +c3: group = (0, 1)group; +c4: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8; +c5: [u8; 32] = [0; 32]; +c6: [[u8; 2]; 3] = [[0; 2]; 3]; +c7: (bool, bool) = (true, false); diff --git a/unused/state/Cargo.toml b/unused/state/Cargo.toml index 1628b317b4..9f7fe0dab3 100644 --- a/unused/state/Cargo.toml +++ b/unused/state/Cargo.toml @@ -25,10 +25,6 @@ version = "1.5.3" path = "../errors" version = "1.5.3" -[dependencies.leo-input] -path = "../input" -version = "1.5.3" - [dependencies.snarkvm-algorithms] git = "https://github.com/AleoHQ/snarkVM.git" rev = "51633e2" diff --git a/unused/tests/parser/import/alias.leo.out b/unused/tests/parser/import/alias.leo.out deleted file mode 100644 index a221eb06c6..0000000000 --- a/unused/tests/parser/import/alias.leo.out +++ /dev/null @@ -1,40 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Package: - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - alias: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b as bar;\\\"}\"}" - span: - line_start: 3 - line_stop: 3 - col_start: 10 - col_stop: 18 - path: "" - content: import a.b as bar; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 18 - path: "" - content: import a.b as bar; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 18 - path: "" - content: import a.b as bar; - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {} diff --git a/unused/tests/parser/import/basic.leo b/unused/tests/parser/import/basic.leo deleted file mode 100644 index f0fabaab79..0000000000 --- a/unused/tests/parser/import/basic.leo +++ /dev/null @@ -1,6 +0,0 @@ -/* -namespace: Parse -expectation: Pass -*/ - -import a.b; \ No newline at end of file diff --git a/unused/tests/parser/import/basic.leo.out b/unused/tests/parser/import/basic.leo.out deleted file mode 100644 index e59ba7eaff..0000000000 --- a/unused/tests/parser/import/basic.leo.out +++ /dev/null @@ -1,40 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Package: - name: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a.b;\\\"}\"}" - alias: ~ - span: - line_start: 3 - line_stop: 3 - col_start: 10 - col_stop: 11 - path: "" - content: import a.b; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 11 - path: "" - content: import a.b; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 11 - path: "" - content: import a.b; - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {} diff --git a/unused/tests/parser/import/invalid.leo.out b/unused/tests/parser/import/invalid.leo.out deleted file mode 100644 index b71e40aa89..0000000000 --- a/unused/tests/parser/import/invalid.leo.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Parse -expectation: Fail -outputs: - - "Error [EPAR0370005]: expected . -- got ';'\n --> test:3:18\n |\n 3 | import foo as bar;\n | ^" diff --git a/unused/tests/parser/import/many_import.leo.out b/unused/tests/parser/import/many_import.leo.out deleted file mode 100644 index 503368ee35..0000000000 --- a/unused/tests/parser/import/many_import.leo.out +++ /dev/null @@ -1,138 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Packages: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import test-import.( // local import\\\"}\"}" - accesses: - - Symbol: - symbol: "{\"name\":\"Point\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":5,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Point,\\\"}\"}" - alias: ~ - span: - line_start: 4 - line_stop: 4 - col_start: 5 - col_stop: 10 - path: "" - content: " Point," - - Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" foo,\\\"}\"}" - alias: ~ - span: - line_start: 5 - line_stop: 5 - col_start: 5 - col_stop: 8 - path: "" - content: " foo," - span: - line_start: 3 - line_stop: 6 - col_start: 8 - col_stop: 2 - path: "" - content: "import test-import.( // local import\n ...\n ...\n);" - span: - line_start: 3 - line_stop: 6 - col_start: 8 - col_stop: 2 - path: "" - content: "import test-import.( // local import\n ...\n ...\n);" - - package_or_packages: - Packages: - name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.( // imports directory import\\\"}\"}" - accesses: - - Symbol: - symbol: "{\"name\":\"Bar\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" Bar,\\\"}\"}" - alias: ~ - span: - line_start: 9 - line_stop: 9 - col_start: 5 - col_stop: 8 - path: "" - content: " Bar," - - Multiple: - name: "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" - accesses: - - Symbol: - symbol: "{\"name\":\"Baz\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" - alias: ~ - span: - line_start: 10 - line_stop: 10 - col_start: 10 - col_stop: 13 - path: "" - content: " baz.(Baz, Bazzar)," - - Symbol: - symbol: "{\"name\":\"Bazzar\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":15,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" baz.(Baz, Bazzar),\\\"}\"}" - alias: ~ - span: - line_start: 10 - line_stop: 10 - col_start: 15 - col_stop: 21 - path: "" - content: " baz.(Baz, Bazzar)," - span: - line_start: 10 - line_stop: 10 - col_start: 5 - col_stop: 22 - path: "" - content: " baz.(Baz, Bazzar)," - - SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":5,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" - access: - SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":9,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"Bat\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" bat.bat.Bat,\\\"}\"}" - alias: ~ - span: - line_start: 11 - line_stop: 11 - col_start: 13 - col_stop: 16 - path: "" - content: " bat.bat.Bat," - span: - line_start: 11 - line_stop: 11 - col_start: 9 - col_stop: 16 - path: "" - content: " bat.bat.Bat," - span: - line_start: 11 - line_stop: 11 - col_start: 5 - col_stop: 16 - path: "" - content: " bat.bat.Bat," - span: - line_start: 8 - line_stop: 12 - col_start: 8 - col_stop: 2 - path: "" - content: "import bar.( // imports directory import\n ...\n ...\n ...\n);" - span: - line_start: 8 - line_stop: 12 - col_start: 8 - col_stop: 2 - path: "" - content: "import bar.( // imports directory import\n ...\n ...\n ...\n);" - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {} diff --git a/unused/tests/parser/import/many_import_star.leo.out b/unused/tests/parser/import/many_import_star.leo.out deleted file mode 100644 index 2e89b6a0d4..0000000000 --- a/unused/tests/parser/import/many_import_star.leo.out +++ /dev/null @@ -1,172 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Package: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import test-import.*; // local import\\\"}\"}" - access: - Star: - span: - line_start: 3 - line_stop: 3 - col_start: 20 - col_stop: 21 - path: "" - content: import test-import.*; // local import - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 21 - path: "" - content: import test-import.*; // local import - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 21 - path: "" - content: import test-import.*; // local import - - package_or_packages: - Package: - name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.*; // imports directory import\\\"}\"}" - access: - Star: - span: - line_start: 5 - line_stop: 5 - col_start: 12 - col_stop: 13 - path: "" - content: import bar.*; // imports directory import - span: - line_start: 5 - line_stop: 5 - col_start: 8 - col_stop: 13 - path: "" - content: import bar.*; // imports directory import - span: - line_start: 5 - line_stop: 5 - col_start: 8 - col_stop: 13 - path: "" - content: import bar.*; // imports directory import - - package_or_packages: - Package: - name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" - access: - SubPackage: - name: "{\"name\":\"baz\",\"span\":\"{\\\"line_start\\\":6,\\\"line_stop\\\":6,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.baz.*; // imports directory import\\\"}\"}" - access: - Star: - span: - line_start: 6 - line_stop: 6 - col_start: 16 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - span: - line_start: 6 - line_stop: 6 - col_start: 12 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - span: - line_start: 6 - line_stop: 6 - col_start: 8 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - span: - line_start: 6 - line_stop: 6 - col_start: 8 - col_stop: 17 - path: "" - content: import bar.baz.*; // imports directory import - - package_or_packages: - Package: - name: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" - access: - SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" - access: - SubPackage: - name: "{\"name\":\"bat\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":16,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import bar.bat.bat.*; // imports directory import\\\"}\"}" - access: - Star: - span: - line_start: 7 - line_stop: 7 - col_start: 20 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - span: - line_start: 7 - line_stop: 7 - col_start: 16 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - span: - line_start: 7 - line_stop: 7 - col_start: 12 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - span: - line_start: 7 - line_stop: 7 - col_start: 8 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - span: - line_start: 7 - line_stop: 7 - col_start: 8 - col_stop: 21 - path: "" - content: import bar.bat.bat.*; // imports directory import - - package_or_packages: - Package: - name: "{\"name\":\"car\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import car.*; // imports directory import\\\"}\"}" - access: - Star: - span: - line_start: 8 - line_stop: 8 - col_start: 12 - col_stop: 13 - path: "" - content: import car.*; // imports directory import - span: - line_start: 8 - line_stop: 8 - col_start: 8 - col_stop: 13 - path: "" - content: import car.*; // imports directory import - span: - line_start: 8 - line_stop: 8 - col_start: 8 - col_stop: 13 - path: "" - content: import car.*; // imports directory import - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {} diff --git a/unused/tests/parser/import/names.leo b/unused/tests/parser/import/names.leo deleted file mode 100644 index a37f401735..0000000000 --- a/unused/tests/parser/import/names.leo +++ /dev/null @@ -1,8 +0,0 @@ -/* -namespace: Parse -expectation: Pass -*/ - -import a0-f.foo; -import a-9.bar; -import hello-world.hello; diff --git a/unused/tests/parser/import/names.leo.out b/unused/tests/parser/import/names.leo.out deleted file mode 100644 index 1bf21bcd9d..0000000000 --- a/unused/tests/parser/import/names.leo.out +++ /dev/null @@ -1,96 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Package: - name: "{\"name\":\"a0-f\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":13,\\\"col_stop\\\":16,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a0-f.foo;\\\"}\"}" - alias: ~ - span: - line_start: 3 - line_stop: 3 - col_start: 13 - col_stop: 16 - path: "" - content: import a0-f.foo; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 16 - path: "" - content: import a0-f.foo; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 16 - path: "" - content: import a0-f.foo; - - package_or_packages: - Package: - name: "{\"name\":\"a-9\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":8,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"bar\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":12,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import a-9.bar;\\\"}\"}" - alias: ~ - span: - line_start: 4 - line_stop: 4 - col_start: 12 - col_stop: 15 - path: "" - content: import a-9.bar; - span: - line_start: 4 - line_stop: 4 - col_start: 8 - col_stop: 15 - path: "" - content: import a-9.bar; - span: - line_start: 4 - line_stop: 4 - col_start: 8 - col_stop: 15 - path: "" - content: import a-9.bar; - - package_or_packages: - Package: - name: "{\"name\":\"hello-world\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"hello\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":20,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello-world.hello;\\\"}\"}" - alias: ~ - span: - line_start: 5 - line_stop: 5 - col_start: 20 - col_stop: 25 - path: "" - content: import hello-world.hello; - span: - line_start: 5 - line_stop: 5 - col_start: 8 - col_stop: 25 - path: "" - content: import hello-world.hello; - span: - line_start: 5 - line_stop: 5 - col_start: 8 - col_stop: 25 - path: "" - content: import hello-world.hello; - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {} diff --git a/unused/tests/parser/import/names_underscore.leo.out b/unused/tests/parser/import/names_underscore.leo.out deleted file mode 100644 index df3f7dfc8d..0000000000 --- a/unused/tests/parser/import/names_underscore.leo.out +++ /dev/null @@ -1,40 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Package: - name: "{\"name\":\"hello_world\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" - access: - Symbol: - symbol: "{\"name\":\"foo\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import hello_world.foo;\\\"}\"}" - alias: ~ - span: - line_start: 3 - line_stop: 3 - col_start: 20 - col_stop: 23 - path: "" - content: import hello_world.foo; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 23 - path: "" - content: import hello_world.foo; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 23 - path: "" - content: import hello_world.foo; - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {} diff --git a/unused/tests/parser/import/star.leo b/unused/tests/parser/import/star.leo deleted file mode 100644 index c5363d15a0..0000000000 --- a/unused/tests/parser/import/star.leo +++ /dev/null @@ -1,6 +0,0 @@ -/* -namespace: Parse -expectation: Pass -*/ - -import test-import.*; diff --git a/unused/tests/parser/import/star.leo.out b/unused/tests/parser/import/star.leo.out deleted file mode 100644 index 1b7fc65ae5..0000000000 --- a/unused/tests/parser/import/star.leo.out +++ /dev/null @@ -1,38 +0,0 @@ ---- -namespace: Parse -expectation: Pass -outputs: - - name: "" - expected_input: [] - import_statements: - - package_or_packages: - Package: - name: "{\"name\":\"test-import\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":8,\\\"col_stop\\\":19,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"import test-import.*;\\\"}\"}" - access: - Star: - span: - line_start: 3 - line_stop: 3 - col_start: 20 - col_stop: 21 - path: "" - content: import test-import.*; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 21 - path: "" - content: import test-import.*; - span: - line_start: 3 - line_stop: 3 - col_start: 8 - col_stop: 21 - path: "" - content: import test-import.*; - imports: {} - aliases: {} - circuits: {} - global_consts: {} - functions: {}